Python Django Series 1

Django is an open source and high-level web roof. Python’s desktop code structure is provided by Django. As a matter of fact, it is often seen that using Django is the reason for mirroring the system to web applications that will avoid complexity.

As a developer who has previously used Django, I must say that he also prepares a dynamic system for database operations. For this reason, Django sets the stage for more frequent use than other web roofs.

I want to recommend a site that I always use when starting a new project from scratch. When it comes to developing software, my first source is always authorized websites. For this reason, let’s provide a detailed review by clicking on this button with you🚀

I have prepared a fun installation stage for you in the visual above. If you don’t find it sufficient, you can access the documentation by clicking on the link I have attached.

Installation Stages

  • Django Setup with Pip Commands

Because I prefer Python as a programming language, I use pip to install packages. If it isn’t installed on your computer, you must first install the python administrator.

Let’s go to the stage of installing Django on your machine, assuming that the pip installation has been done.

pip install Django
  • Create A Virtual Environment

For the virtual Django working environment, the environment must be installed.

pip install virtualenv
  • Creating The Django Project
django-admin startproject mysite

For The Curious 📝

When creating the Django folder, it must be created on Root.

🔒When creating the database, I chose SQLite as the local database that runs without a server. But if you want to use a different database, you can view the databases by clicking on the button below.

  • Running The Server
python manage.py runserver

Localhost (127.0.0.1:8000) must be visited to check the commands running in the server environment. When you visit Localhost, you should encounter Django lines and the install worked successfully.

  • Creating Users For Admin
python manage.py startapp polls

The above installation performs a kind of controller operation found in other frameworks. For example, if the created project is mysite, it moves the mysite project to the polls folder.

In fact, if you need to sample the polls folder, we can think of it as the src folder in Php Symfony. In the Src folder, all controllers and migrations folders are located here, while in the polls folder, different practicalities can be used as the same extensions and the same files.

🔖 The views.py file in the Polls folder serves as a controller. In addition, to go into the folder, we need to enter the URL address below.

127.0.0.1:8000/polls/

🔖 For application polls/urls.py the URL must be created in it. Django documents can be found in tutorial01.

💎 Views.py what is written in the file is displayed on the Localhost screen.

Conclusion

Many frameworks need to host reliability information in their overall structure. In Django, this is through creating a good management system for the user. (python manage.py migrate)

We’re at the end of the Python Django 1 Series. In summary, a clean installation was made and operations were performed that will be reflected in the localhost page in the project. In the next stage, the process of creating an admin panel and adding tables is followed.
Hope to see you in another post. I wish you a healthy and beautiful religion…

REFERENCES

https://en.wikipedia.org/wiki/Django_(web_framework)

Yuksel Celik, Karabuk University, Special Topic 2, Python – Django.

Related Posts

Leave a Reply