Django is a python high-level web framework for rapid development of web applications. It’s totally free and opensource. Django allows us to focus on the development of our ideas, not on reinventing things. In this Django tutorial, I want to discuss
- Features of Django
- Django rest framework
- How to Build an app – Django tutorial step by step
Features of Django python
Django is a web framework that consists of a set of components that helps the developers to develop web apps faster and easier. I really experienced the beauty of Django from the last few years. Its amazing guys. it will take care of all the security issues, authentications, logs, etc. let’s discuss the core features in this Django tutorial.
1.Fast and Easy
Yes, Django is very fast and easy to learn and build things. whatever your ideas it will take less time to build and we can easily adopt it. By executing the simple commands we can do a lot of things in our apps.
Django is a fully loaded web framework. it has hundreds of external packages, that allow the developer to build fast their apps. we don’t need to build all the things, we just focus on what we need. Django provides everything that you need. you can check Django packages.
Django provides high security for apps. Django has inbuilt functionality for handling security issues. especially login and authentications. we don’t need to manage the validations and authentications of the user, but Django does for us.
There are so many features, I discussed most popular of them. you can check all of them in Django documentation.
Django rest framework
Django provides the Django rest framework that allows the developers to interact with other web applications. Django REST framework is the most powerful and flexible for building APIs. API – Application Programming Interface which allows interacting with other apps. we can do following common web requests like
How to Build an app – Django tutorial step by step
let us start building our first web app. lets rock it guys.
create a virtual environment:
It’s better to create a virtual environment whenever you start a project. virtual environments allow us to keep all the requirements in one place so that we can easily deploy our project successfully and we can easily share our Django python project with others. Before that, you must install Python and PIP. Now create a virtual environment by the following command in your command prompt. <dj> user-defined. Note: It is for windows check out other in internet
python -m virtualenv dj
Installing Django Python
Now install Django in our virtual environment by the following command.
python -m pip install django
Create a Django project
Now create a Django project with the below command. here “devpyjp” is the project name. you can create your own.
django-admin startproject devpyjp
Run your project
Now change your directory to project folder like “cd <projectfolder>” in windows. Now run on command prompt like below.
python manage.py runserver
The above command is used to run our project. it will execute our python files, it will show errors if our code goes wrong. But up to now we never write a single line of code.so it executed successfully and we get one IP address like http://127.0.0.1:8000/. This is the project URL for now, later we can change like www.devpyjp.com
Now copy that URL to your browser and hit enter. It will show like below.
Congratulations! we successfully build our project but this is the initial stage, we need to move on this. for more Django tutorial python 3 stay connected with us.
Subscribe our email list, you will get every new post faster than anyone else from Devpyjp. for more click Django tutorials online.
For more python tutorials check out our Blog