DJANGO NOTES
A good amount of this webpage has been sourced from this video. Please watch it. I do not claim to be the source for any of the content shown here. This page exists as a personal diary of what I am being taught.
Here is my personal set of Django notes for the python programming language. This is my effort to break away from PHP backend work into a strictly python environment.
What is DJANGO?
Django is a fancy pants python framework for hosting websites and services using
Model
View
Controller
design philosophy .
What is the structure of a Django application?
manage.py : DOn't worry about it. It lets you run command line commands. THis file resides in the root folder of the project.
django_project : The project file, it contains all the major parts of the project. There can be more than on of these
__init__.py : This is an empty file, it tells python the project is a package.
settings.py : This is where we change the settings and configurations of the project. Place all project settings in this file.
urls.py : IMPORTANT FILE! This is the URL mappings file. Any url the program recives (ie.. www.app.com/myPage
), it routes it to the proper method/page.
wsgi.py : This is the way python communicates with the WEB SERVER.
Quick Tips
django-admin startproject django_project .
starts the project with the name django_project
python manage.py runserver
starts the server on localhost