“python manage.py runserver” vs “django-admin runserver”

后端 未结 1 1943
轮回少年
轮回少年 2020-12-11 06:31

I have an app, Scaffold, installed, that runs perfectly when I use python manage.py runserver but when I try to start it using django-admin, it fails;



        
相关标签:
1条回答
  • 2020-12-11 07:23

    You should be using manage.py unless have a specific reason for not wanting project-specific configuration. According to the docs

    manage.py is automatically created in each Django project. manage.py is a thin wrapper around django-admin that takes care of several things for you before delegating to django-admin:

    • It puts your project’s package on sys.path.
    • It sets the DJANGO_SETTINGS_MODULE environment variable so that it points to your project’s settings.py file.
    • It calls django.setup() to initialize various internals of Django.
    0 讨论(0)
提交回复
热议问题