First activate virtual env, common choice is to call it .venv
python3 -m venv <.venv> source .venv/bin/activate
It'll show something like this in terminal, which means venv is activated
(.venv)>
Now inside the virtual env activated window, install django/drf
pip install django djangorestframework
Add 'rest_framework'
to your INSTALLED_APPS
setting.
INSTALLED_APPS = [
...
'rest_framework',
]
Create a project
django-admin startproject <project_name> .
Start the server
python3 manage.py runserver
Create a folder apps
mkdir apps
create an app folder with app_name inside apps
folder
cd apps mkdir <app_name>
Now go back to where manage.py
is
cd ../../
Create apps structure on that folder
django-admin.py startapp <app_name> ./apps/<app_name>
Or from the apps
folder we can create an app structure
go to apps folder
cd apps
create new app by accessing manage.py
python ../manage.py startapp <app_name>
database makemigrations
python3 manage.py makemigrations
migrate the migration files
python3 manage.py migrate
exit the virtual env
(.venv) > deactivate