Friday, September 24, 2021

Django project

 Project = Several applications + configuration information 

Note:

The Django applications can be plugged into other projects .ie these are reusable.

( pluggable django applications ).

withour existing django project there is no chance of existing django application. before creating any application first we required to create project.

How to create Django project ?

django-admin

django-admin startproject firstproject





__init__.py:

It is a blank python script. Because of this special file name, Django treated this folder as python package.

Note: If any folder contains __init__.py file then only that folder is treated as python package. 


settings.py:

In this file  we have to specify all our project settings and configuration like installed applications, middleware configurations, database configurations etc.

urls.py:

Here we have to store all our url-patterns of our project.

For every view (web page) we have to define separate url-patterns. End user can use url-patterns to access our webpages.

wsgi.py:

wsgi ---> Web Server Gateway Interface

we can use this file while deploying our application in production on online server.

manage.py

The most commonly used python script is manage.py 

It is a command line utility to interact with Django project in various ways like to run development server, run tests , create migration etc.

How to Run Django Development Server ?













No comments:

Post a Comment