Django installation in windows

Open command prompt in windows 

then in command prompt  type    d:  

and press enter .

and use following commands 

To create folder  myap -execute the following command:

D:\> mkdir myap

To  go  myap folder path -execute the following command:

D:\>cd myap 

To create a virtual environment for your project, open a new command prompt, navigate to the myap  folder where you want to create your project and then execute the following command:-

D:\myap>python -m venv env

In the command prompt, ensure your virtual environment is active, and execute the following command:

D:\myap>env\Scripts\activate

execute the following command to install django.

D:myap>pip install django

run the following command - This will create a myproject  directory in your current directory

D:\myap>django-admin startproject  myproject

then go to myproject folder path type following command :-


D:\myap>cd myproejct


To create your app, make sure you’re in the your project  directory &  type this command:


D:\myap\myproejct>python manage.py  startapp hello 

That’ll create a directory hello app folder inside my_project folder:

after it open your myap folder inside it you will see my_project folder 



and inside my_project folder you will see following structure:-

 

D:\mywork\myproejct>python manage.py runserver.


Previous
Next Post »