0% found this document useful (0 votes)
8 views2 pages

Django Steps Notes

The document outlines essential steps for setting up a Django project, including installation, project and app creation, model definition, migrations, view creation, URL configuration, and running the server. It provides a concise memory trick to remember the order of these steps: Project → App → Register → Model → Migrate → View → URL → Run. Each step is accompanied by relevant code snippets for clarity.

Uploaded by

arpitmahajan856
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Django Steps Notes

The document outlines essential steps for setting up a Django project, including installation, project and app creation, model definition, migrations, view creation, URL configuration, and running the server. It provides a concise memory trick to remember the order of these steps: Project → App → Register → Model → Migrate → View → URL → Run. Each step is accompanied by relevant code snippets for clarity.

Uploaded by

arpitmahajan856
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Essential Django Steps (Exam Notes)

■ ESSENTIAL DJANGO STEPS

1. Install + Create Project


pip install django
django-admin startproject project
cd project

2. Create App
python [Link] startapp app

3. Register App ([Link])


INSTALLED_APPS = ['app']

4. Create Model ([Link])


class Student([Link]):
name = [Link](max_length=100)

5. Apply Migrations
python [Link] makemigrations
python [Link] migrate

6. Create View ([Link])


from [Link] import HttpResponse

def home(request):
return HttpResponse("Hello")

7. Connect URL

project/[Link]
from [Link] import path, include

urlpatterns = [
path('', include('[Link]')),
]

app/[Link]
from [Link] import path
from .views import home

urlpatterns = [
path('', home),
]

8. Run Server
python [Link] runserver

■ MEMORY TRICK
Project → App → Register → Model → Migrate → View → URL → Run

You might also like