DJANGO NOTES
Django is a free open_source framework for building web apps in Python. It’s a most popular framework because it helps us build website in lesser time with fewer lines of code. That’s why a lot of companies like YOUTUBE, INSTAGRAM, DROPBOX,SPOTIFY, PINTREST etc uses Django.
DJANGO Features :
l Admin Site - Interface for managing data and huge time saver
l Object - Relational Mapper ORM - Abstracts the database so we can query or persist data with writing a lot of SQL code.
l Authentication - It comes with authentication package for identifying users
l Caching Data
URL - Uniform Resource Locator
HTTP - Hpertext Transfer Protocol
When client requests a website from web server, it processes it and returns Html, Css, Javascript bake to client in broswer and it is browser’s responsibility to render it or decode it in beautiful web page.
MVT Architecture Django :---
Information for creating a Database.
One website has one project. In creating a Django project we create multiple apps.
l The MVT ( Model View Template) is software design pattern.
l The view is used to execute the business logic and interact with the model to carry data and render the template.
l There is no separate controller and complete application is based on Model View and templates.
A view pulls data from database processes it and send to template after which template renders it. Template is (html, css, javascript) but there remains a placeholder in templates which is to be filled.
So, when we start. The request will first come in main project’s url.py from where it will be sent to some app’s url.py . To make a project fully functional one app should be present.
--> python manage.py startapp anyname
This command creates an app directory in the project file.
And settings.py file is only present in project file not in app files. Because settings are specific to main project. Setting stores where your templates will be stored, what database is used, time used by server.
Comments
Post a Comment