Django : Difference between django-admin.py and django-admin

Viewed 383

Okay here's the catch. When I create a django project with django-admin.py startproject myproject and starts server like python3 manage.py runserver, it all works fine.

However, when I create project with django-admin startproject myproject and starts server like python3 manage.py runserver, it gives me tonnes of system check errors like :


django.core.exceptions.ImproperlyConfigured: Passing a 3-tuple to include() is not supported. Pass a 2-tuple containing the list of patterns and app_name, and provide the namespace argument to include() instead.

or

django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:

ERRORS:
?: (admin.E408) 'django.contrib.auth.middleware.AuthenticationMiddleware' must be in MIDDLEWARE in order to use the admin application.
?: (admin.E409) 'django.contrib.messages.middleware.MessageMiddleware' must be in MIDDLEWARE in order to use the admin application.
?: (admin.E410) 'django.contrib.sessions.middleware.SessionMiddleware' must be in MIDDLEWARE in order to use the admin application.
1 Answers

They should be the same, but I think somehow it is not same in your machine. Check your django-admin version by:

django-admin version
django-admin.py version

For future reference, you should not use django-admin.py as it will be removed as entry point from Django 4.0. Please see the Django Deprecation Timeline for more information.

Related