Problem with DJANGO_SETTINGS_MODULE

210 views
Skip to first unread message

Dariusz Mysior

unread,
Mar 7, 2016, 2:34:42 PM3/7/16
to Django users
I use Django 1.8 Python 3.4.3 and I have problem when i go to Ipython or Python and I try use command from contact.forms import MessageForm2 I have a error like below. I add that in wsgi.py and manage.py I have line
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biblio.settings")

where biblio is my main project name


Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

James Schneider

unread,
Mar 7, 2016, 4:44:33 PM3/7/16
to django...@googlegroups.com
Are you accessing the shell via the 'manage.py shell' command? Doing so should set up the Django environment variables for you automatically.

Or are you just firing up a standard Python interpreter shell and trying to import your forms directly?


-James

Dariusz Mysior

unread,
Mar 8, 2016, 12:37:04 AM3/8/16
to Django users
When I use Console system it work's using manage shell and next import but in PyCharm Edu 2 in Python Console I have this message like below I wright. In PyCharm Ipython run automaticly I am not using manage shell command. How can I set it in PyCharm?

James Schneider

unread,
Mar 8, 2016, 1:47:43 AM3/8/16
to django...@googlegroups.com


On Mar 7, 2016 9:37 PM, "Dariusz Mysior" <mysior...@gmail.com> wrote:
>
> When I use Console system it work's using manage shell and next import but in PyCharm Edu 2 in Python Console I have this message like below I wright. In PyCharm Ipython run automaticly I am not using manage shell command. How can I set it in PyCharm?
>
>

https://www.jetbrains.com/pycharm/help/running-tasks-of-manage-py-utility.html

Reply all
Reply to author
Forward
0 new messages