"python manage.py runserver" vs "django-admin runserver" -


i have app, scaffold, installed, runs when use python manage.py runserver when try start using django-admin, fails;

you must either define environment variable django_settings_module or call settings.configure() before accessing settings. 

i try calling django-admin migrate --settings=scaffold.settings , get; importerror: no module named scaffold.settings

i've tried multiple things, googled around, can't seem figure out need change. settings.py file in directory ..\scaffold no longer 1 need use.

you should using manage.py unless have specific reason not wanting project-specific configuration. according docs

manage.py automatically created in each django project. manage.py thin wrapper around django-admin takes care of several things before delegating django-admin:

  • it puts project’s package on sys.path.
  • it sets django_settings_module environment variable points project’s settings.py file.
  • it calls django.setup() initialize various internals of django.

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -