Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

django.core.exceptions.ImproperlyConfigured: Requested setting ROOT_URLCONF, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

# It's probably easier to just use manage.py instead of django-admin
python3 manage.py <command>
# If you really want to use django-admin, you can try this
export PYTHONPATH=/home/YOUR_NAME/project_path
export DJANGO_SETTINGS_MODULE=my_project.settings
django-admin <command>
 
PREVIOUS NEXT
Tagged: #Requested #setting #settings #You #define #environment #variable #call #accessing
ADD COMMENT
Topic
Name
6+6 =