test

Installing Django




 In Django, every web app you want to create is called a project; and a project is a sum of applications. An application is a set of code files relying on the MVT pattern. As an example let's say we want to build a website called pyshop , the website is our project and, the forum, news, contact engine are applications. This structure makes it easier to move an application between projects since every application is independent.

Create a project called Pyshop



Apply this command


Go to terminal and create a Django  project called Pyshop

startproject

django-admin startproject name [directory]
Creates a Django project directory structure for the given project name in the current directory or the given destination.
By default, the new directory contains manage.py and a project package (containing a settings.py and other files).
If only the project name is given, both the project directory and project package will be named <projectname> and the project directory will be created in the current working directory.





run the server


we go to the site 


Now let's create a new folder called products, and in terminal, we will open a new windows (Local 2)



startapp

django-admin startapp name [directory]
Creates a Django app directory structure for the given app name in the current directory or the given destination.
By default, the new directory contains a models.py file and other app template files. If only the app name is given, the app directory will be created in the current working directory.





We saw the different functions in the our products folder

Installing Django Installing Django Reviewed by ohhhvictor on May 31, 2019 Rating: 5

No comments:

Powered by Blogger.