
Django Framework is a Very useful and very Scalable framework. you can use for web development, API development and more web pages and Services. it is actually open source and free.
Generally Django using a Python Language for coding, means Django is a one framework which is give you path and support to make web page using Python Language.
Requirements for Start Django ?
- Firstly, you need one code editor like Visual Studio Code, Atom, Visual Studio.
- My personal recommendation for code editor is Visual Studio Code.
- Now you have to Install Python in your PC/Leptop. yo can go to this https://www.python.org/downloads/ link and install python.
- Now you ready for start your journey with Django.
Now, we’ll Create the Django Project through CLI.
- First open Terminal in your Pc.
- First Create virtual environment for your local PC.
- virtualenv –python=python3 [Environment Name]
- After you should have to go inside the environment and activate environment.
- cd test [cd environment name]
- Scripts\activate
- Install Django in your Virtualenv.
- pip install django [it will download the latest version of django in your environment.]
- Finally our django package is installed in project. now we’ll create new project.
- django-admin startproject [ProjectName]
Above command we’ll create new project in your PC. - Above In Image you can see project created. inside somefiles also there, we’ll discuss later.
don’t worry I’ll cacth them very soon.
- django-admin startproject [ProjectName]
- Actually guys I want to try i can give you complete guidance in one shot how to work with django so please stay tunned !!
- Also follow all steps if you’re beginner so it will help you a lot.
Congrats !! Finally Django Project is ready.
- Now you can see the project on your browser, please type the below command.
- python manage.py runserver
- After this command go to your browser and go with http://127.0.0.1:8000/
- But You can find below issue when you run the “Python manage.py runserver”
You can see above issue because when we created Django project at the same time by default some tables also came along with so we have Migrate them for that Django give one command for migrate the tables.
Python manage.py migrate
- python manage.py runserver
- Django Framework providing the Admin panel so you can maintain your Django models[Tables] from Client-side , no need to go and check with any database server. please type below command.
- python manage.py createsuperuser
after you have to give username , password.
again Run the server with python manage.py runserver and go with http://127.0.0.1:8000/admin - Above Image through you can understand the you have to give Username and Password what you set before with that command [python manage.py createsuperuser]
- python manage.py createsuperuser
I believed you can understand the above topic related Django Framework, if you want to know more about you can visit www.coderssnippet.com for advance topics for programming. and please feel free to comment if you have any query I’ll look into that asap.
Thank you guys,
Have a good day.