Issue
I am using pycharm as editor of my django app. Everything was working fine until I updated my mac os. After that a lot of settings got messed up for the python interpreter.
I managed to fix most of the issue and now I can "run the server" correctly. However, I still can't get the python console to run properly.
When I open the console and I try to import a model, I get the following error:
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
The thing that kills me is that I have the DJANGO_SETTINGS_MODULE
set in my django server environmental variables so it's if the python console was not picking that up.
Solution
Found a solution. I added export DJANGO_SETTINGS_MODULE=mywebsite.settings to my system env variable and it worked. It's a work around I know, but at least.
Answered By - giaggi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.