DJANGO_SETTINGS_MODULE

115 views
Skip to first unread message

Muhammad Arslan Iqbal

unread,
Apr 16, 2022, 11:50:48 PM4/16/22
to oTree help & discussion
Hi Everyone,

I am getting the following error 
"Failed to create session: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings."

I am trying to run the SVO slider Otree task available on Github 

The requirements.txt reads:
otree==5.8.0
psycopg2>=2.8.4
sentry-sdk>=0.7.9

The runtime.txt reads
python-3.9 
(The above is red and shows package is not installed error)

The main.py file inside "Responsibility_Lab" Main folder, along with settings.py, that contains many other apps reads
#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
# os.environ['DJANGO_SETTINGS_MODULE'] = 'Responsibility_Lab.settings'
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Responsibility_Lab.settings")

from otree.management.cli import execute_from_command_line
execute_from_command_line(sys.argv, script_file=__file__)


Also, when I try to run--    python manage.py diffsettings
I get the following error: No module named 'Responsibility_Lab'

There are other apps as well in my experiment under Responsibility_Lab folder that works fine. The manage.py and settings.py files are also in the Responsibility_Lab folder.

I am not sure why I am getting this error. I have uninstalled and installed otree again. Deleted the old database. Any help will be much appreciated. I am just a beginner in coding, I apologize if the mistakes are very basic.

Regards,
Arslan

Chris @ oTree

unread,
Apr 17, 2022, 12:34:06 AM4/17/22
to Muhammad Arslan Iqbal, oTree help & discussion
I recommend using the SVO app from here: https://www.otreehub.com/projects/otree-more-demos/

Sent from my phone

On Apr 17, 2022, at 11:50 AM, Muhammad Arslan Iqbal <muhammad.ar...@gmail.com> wrote:

Hi Everyone,
--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/be24260b-cd17-4a36-a1c9-2ec5be09b271n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages