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

Python Django Basics Notes

This document provides an overview of the basics of Python Django, highlighting its high-level framework features and the MTV architecture. It outlines the project structure, common commands for managing a Django application, and the use of templates and static files. Additionally, it includes an example of using the ORM and instructions for setting up the admin panel.

Uploaded by

mamnakoli
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)
2 views2 pages

Python Django Basics Notes

This document provides an overview of the basics of Python Django, highlighting its high-level framework features and the MTV architecture. It outlines the project structure, common commands for managing a Django application, and the use of templates and static files. Additionally, it includes an example of using the ORM and instructions for setting up the admin panel.

Uploaded by

mamnakoli
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
You are on page 1/ 2

Python Django - Basics Notes

1. Introduction to Django:

- High-level Python Web Framework

- Follows MTV architecture (Model-Template-View)

- Comes with admin panel, ORM, routing, and templating

2. Django Project Structure:

- manage.py: Command-line utility

- settings.py: Configuration

- urls.py: URL routing

- models.py: Database structure

- views.py: Logic and data handling

- templates/: HTML UI

3. Common Commands:

- django-admin startproject projectname

- python manage.py startapp appname

- python manage.py runserver

- python manage.py makemigrations

- python manage.py migrate

4. Templates and Static Files:

- Use {% %} for logic and {{ }} for variables in HTML

- Store static files in /static/ folder


5. ORM Example:

class Student(models.Model):

name = models.CharField(max_length=100)

roll_no = models.IntegerField()

Student.objects.create(name="Ravi", roll_no=101)

6. Admin Panel:

- Register model in admin.py

- Create superuser with: python manage.py createsuperuser

Prepared by: Patel Ravikumar Baldevbhai

Enrollment No: 236400307186

College: R.C. Technical Institute

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy