Django - Create Project

After successfully installed Python and Django, lets start creating a project, type following command to create project.

List of django admin commands:


Create django project:

django-admin startproject project1

This will create a "project1" folder with some python files.

Type in command prompt: cd project1, Now Run server:

python runserver

Open Browers: type to check django installed and running successfully.

To change django server port

python runserver 4000

Django IDE - Visual Studio Code

Download Visual Studio Code from its official website: Visualstudio

After downloading, click setup file, and install it

To better use django in visual studio code intall extensions: python, django, django snippet, html css support

Create First App

In Visual Studio Code, open directory where your Djanto installed and type any one below command:

python startapp hello

If you check in window explorer, under scripts folder, you will see your project folder too with some files - Blank file for initialising variables - Project settings like database connectivity, installed apps, templates, debug, timezone, etc - Urls declaration, mapping - Web Server Gateway Interface - It is a command-line utility which allows us to interact with the project in various ways