Django Management Commands Using django-admin instead of manage.py

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

You can get rid of manage.py and use the django-admin command instead. To do so, you will have to manually do what manage.py does:

  • Add your project path to your PYTHONPATH
  • Set the DJANGO_SETTINGS_MODULE
export PYTHONPATH="/home/me/path/to/your_project"
export DJANGO_SETTINGS_MODULE="your_project.settings"

This is especially useful in a virtualenv where you can set these environment variables in the postactivate script.

django-admin command has the advantage of being available wherever you are on your filesystem.



Got any Django Question?