django-admin startproject projectname
django-admin startproject myproject
python manage.py runserver
python manage.py runserver
python manage.py startapp appname
python manage.py startapp myapp
python manage.py makemigrations
python manage.py makemigrations
python manage.py migrate
python manage.py migrate
python manage.py createsuperuser
python manage.py createsuperuser
python manage.py collectstatic
python manage.py collectstatic
python manage.py test
python manage.py test
python manage.py shell
python manage.py shell
python manage.py check
python manage.py check
manage.py
commands.# Inside your_app/management/commands/your_command.py
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Description of the command'
def handle(self, *args, **options):
# Command logic
python manage.py dbshell
python manage.py dbshell
python manage.py sqlmigrate appname migrationname
python manage.py sqlmigrate myapp 0001
python manage.py loaddata fixturename
python manage.py loaddata mydata
python manage.py dumpdata appname
python manage.py dumpdata myapp > myapp_fixture.json
Remember to replace projectname
, appname
, migrationname
,
and
fixturename
with your actual project, app, migration, and fixture
names respectively. These
commands form the backbone of your interactions with Django's manage.py utility and are essential for efficient
Django
development.