Skip to content

Getting Started#

Create Project#

pip install django
django-admin startproject myproject
cd myproject

Create App#

python manage.py startapp myapp

App Registration#

# settings.py
INSTALLED_APPS = [
    ...
    'myapp',
]

Database Setup#

python manage.py migrate

Create Superuser#

python manage.py createsuperuser

Run Server#

python manage.py runserver

Project Structure#

myproject/
├── manage.py
├── .env
├── myproject/
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
└── myapp/
    ├── admin.py
    ├── models.py
    ├── views.py
    ├── urls.py
    └── migrations/

Requirement Management#

pip freeze > requirements.txt
pip install -r requirements.txt