Clone this repo
git clone https://github.com/pdf3rn/django-rest-starter.git
cd django-rest-starter
Create virtual env:
python -m venv venv
Install requirements
pip install -r requirements.txt
Makemigrations and migrate
python manage.py makemigrations
# after make migrations then migrate to DB
python manage.py migrate
Make superadmin account
python manage.py createsuperuser
Run server
python manage.py runserver
# show all migrations
python manage.py showmigrations
# make migrations
python manage.py makemigrations
# after make migrations then migrate to DB
python manage.py migrate
# rollback all migrations for 'app_name'
python manage.py migrate [app_name] zero
# rollback migrations
python manage.py [migrations_name] zero
This project has main app called 'app', you can create sub-apps under main app folder
# Create subfolder
mkdir app/app_name
# Start app
python manage.py startapp app_name app/app_name
Update project name in apps.py
file adding the prefix app.
to the app string name