Creating a project:
django-admin startproject ProjectName
django-admin startproject STM
Which files are what?
NOTE, currently all these files are related to project and not our app
1. [Link] :
2. [Link] : Web server that django creats for us
3. [Link] : URL ROUTING SYSTEM FOR OUR WEB PORTAL which will consist the
list of paths
4. [Link] : Command center of our django app
Launching a Django App:
python [Link] runserver
this will take us to default landing page of our django app
Turning off the server
CTRL + C
So now we have created a project, but we are building our django app
Hence we have to create it
Creating our app
python [Link] startapp appName
python [Link] startapp SmartTrafficManager
Our app will be created with the appName with following files
1. [Link] - Admin panel
2. [Link] - We build our database and Classbase Objects.
3. [Link] - Functions and classes that triggers our url patterns
Now that our app is created we need to configure, i.e add our appname in installed
app of [Link] so that Django server will know that appName is connected with
our Project
ABOUT URL Paths:
Whenever we use some url path, like /object it triggers the function
associated with that urlpattern and return template or api or any response
NOTE: -> Always create functions in [Link] and use the [Link] to
route to those functions.
Using Templates: Basically HTML pages
Create a folder names "templates" with exact same spelling, create a folder
with your appname and store the html pages in it