Installation of Django

 Installation of Django


Let's Get Started

1. Install Python (Ignore if you already installed it )

2. Install VS code editor (Ignore if you already installed it )

4. Make folder where you want make project ( Here i make "Django project" folder)

5. open that folder in vs code software
1. Open software
2. Click on file
3. Select open folder



6. open terminal in vs code
1. Click on terminal
2. Select new terminal


7. Install Virtual environment
1. pip install virtualenv


2. virtualenv venv
                In this this command venv is my virtual environment name you can give any thing you want.         As you see we successfully create virtual environment.



8. Activate virtual environment
1. venv/Scripts/activate



9. Install Django
1. pip install django


2. pip install djangorestframework



10. Make new project in django
1. django-admin startproject myform .
         This dot avoid making of double folder & here my project name is "myform" you can give anything you want.

    After making project you see this folder which name you give to your project and a python file "manage.py"
 myform folder contain below python files
        1. __init__.py: This is empty and changes the directory into an importable Python package. 
 
        2. settings.py: As the name suggest, it is the place where most configuration items will be set. 
 
        3. urls.py: The URLs are set with urls.py. With this, we don’t have to explicitly write every URL for the project in this file. However, we have to tell Django about where the URLs have been declared (i.e., we need to link other URL in urls.py). 
 
        4. Wsgi.py: This is to help application in production and is similar to other applications like Flask, Tornado, Pyramid which exposes some “app” object. 


11. Run 
1. python manage.py runserver
    Copy http://127.0.0.1:0000  and paste it to your browser and hit ENTER

12. Done

If you see this on your machine then you are successfully install Django.







Comments

Popular posts from this blog

Installation of VS Code Editor