Django Cheatsheet

Fredy Yudiawan
Dec 28, 2022

--

create new project :

django-admin startproject [project_name]

create django app:

python manage.py startapp [app name]

run the app:

python manage.py runserver

creating views:

go to settings.py then find INSTALLED_APPS.

create urls.py in the apps folder

create basic view in views.py

register the views in the base project

SETTING UP MODELS AND DATABASE:

go to applications then go to models.py

run this to make the migrations :

python manage.py makemigrations
python manage.py migrate

Register the newly created model to admin in application folder

create super user in admin

python manage.py createsuperuser

--

--

Fredy Yudiawan
Fredy Yudiawan

Written by Fredy Yudiawan

Nature Photographer by day, software developer by night. https://www.linkedin.com/in/ftansari/

No responses yet