Module dj_database_url not found

319 views
Skip to first unread message

xinghu...@barcelonagse.eu

unread,
Mar 16, 2021, 6:04:34 AM3/16/21
to oTree help & discussion
Dear Otree discussion group,

I encountered an issue when I am testing an otree app I designed before, which worked perfect when I lauched it last time. Here is the details. I entered "otree devserver" in PowerShell. It returns the following warning message: 
P1.PNG

I am trying to fix this, but has no clue why this issue is there. Does this has something to do with the text we put in requirement.text? I have there 
otree>=5.0.6
psycopg2>=2.8.6
sentry-sdk==1.26.4.

Or is this due to the things to import in the settings.py?

import os
from os import environ

import dj_database_url
from boto.mturk import qualification

import otree.settings

BASE_DIR = os.path.dirname(os.path.abspath(__file__))

# the environment variable OTREE_PRODUCTION controls whether Django runs in
# DEBUG mode. If OTREE_PRODUCTION==1, then DEBUG=False
if environ.get('OTREE_PRODUCTION') not in {None, '', '0'}:
DEBUG = False
else:
DEBUG = True

DATABASES = {
'default': dj_database_url.config(
# Rather than hardcoding the DB parameters here,
# it's recommended to set the DATABASE_URL environment variable.
# This will allow you to use SQLite locally, and postgres/mysql
# on the server
# fall back to SQLite if the DATABASE_URL env var is missing
default='sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3')
)
}

I would appreciate a lot if someone could tell me what is wrong there. Thanks a lot.

Best
Xinghua

Chris @ oTree

unread,
Mar 16, 2021, 6:08:49 AM3/16/21
to oTree help & discussion
Hi, if you want you can send me the project and I can try to update it to be compatible with the current oTree version.

Liang Wang

unread,
Aug 17, 2021, 4:57:19 PM8/17/21
to oTree help & discussion
Dear all, I have the same error. Please, any suggestions are really appreciated.

ModuleNotFoundError: No module named 'dj_database_url'


Chris @ oTree

unread,
Aug 17, 2021, 9:11:04 PM8/17/21
to oTree help & discussion
same, please send me your project.
Reply all
Reply to author
Forward
0 new messages