34👍
✅
If your DJANGO_SETTINGS_MODULE
environment variable is set, you can use django-admin.py
from any working directory, whereas you need to be in the project directory to use ./manage.py
(or have it in your path).
Use virtualenv
, and have DJANGO_SETTINGS_MODULE
set by bin/activate
, and then you can use django-admin.py
.
9👍
Why do the Django documentation code examples using django-admin.py instead of manage.py when demonstrating subcommands such as loaddata and dumpdata?
Well, because these scripts are the same in priciple, with the differences, you already mentioned. The Django docs also mention
django-admin.py <subcommand> [options]
manage.py <subcommand> [options]
side by side. Usually you use django-admin.py
to start a new project or application and manage.py
to do the rest.
👤miku
- [Django]-Manager isn't available; User has been swapped for 'pet.Person'
- [Django]-Django form got multiple values for keyword argument
- [Django]-Why don't my south migrations work?
Source:stackexchange.com