32
loading...
This website collects cookies to deliver better user experience
pip install pipenv
dev
and open command prompt inside it.pipenv install
pipenv shell
pip freeze
to check the libraries installed. It will give no result as no python libraries are installed in this environment yet.pip install django==2.2.6
django-admin
which is a django administrator with which we initialize our new project.django-admin startproject Beginner
Beginner
Folder : This folder has the same name as our Parent folder(Project Name). It contains all the settings and configurations of the whole project.
__init__.py
: This file tells the interpreter that it's a python project.settings.py
: This file contains all the configurations of this project like SECRET_KEY
, ALLOWED_HOSTS
, INSTALLED_APPS
, MIDDLEWARES
, 'STATIC FILES CONFIG`, etc. We will discuss about all of this in detail in a seperate blog.urls.py
: This file contains the root level url configurations. When we run our project, all the urls are checked and matched from this file.wsgi.py
: This file is the entry point of our project for the web servers during deployment. This file actually connects the web server with our django project. From Django 3.0, we also have asgi.py
file. ASGI is the successor of WSGI which would need a seperate blog for discussion.manage.py
: This python file is located at the root directory. This is same as django-admin
. It works like a django administrator but only works for the current project. We can control the whole project with this command like python manage.py runserver
- We can run this file by giving instructions with it like runserver
, createsuperuser
, etc.cd Beginner
and type : python manage.py runserver
. This runs our django project on our system's localhost at port 8000: http://localhost:8000/