THE DJANGO PROJECT
A project made entirely in Django is available for download from GITHUB. Before talking about the project, let us summarize the salient features of Django Framework.
DJANGO FRAMEWORK FEATURES
PYTHON
Django uses the Python language, which allows for fast prototyping and is one of the most popular languages for programmers, released back in 1991. It also has various libraries so that you are not starting completely from scratch. The community is very active and you can find useful resources with great ease.
SAFETY
Even if you are not a web security expert, the Django framework has very simple and intuitive management: login and ORM sessions for databases are functionally automated. It is also constantly updated with new security patches, making it perfectly reliable. With Python Django you use less code and save time.
GUIDES
Django offers English guides on its website, which are very clear and simple. You have to read them carefully and take your time to view the framework well and only then work on it. Beware of versions: download the guide that refers to the version of Django you have chosen.
DEPLOY
One of the biggest drawbacks of Django is the deployment. In fact, it is not possible to do this through the ftp protocol, as is usually the case. One solution was offered by Google Cloud: it made download guides freely available to the developer community.
CROSS PLATFORM
Django has great portability, in fact it allows you to create applications that can be used on different operating systems: mac, linux, windows. It allows you to switch from one database to another by writing only one line of code. It also has responsiveness tools at its core, which make designed applications adapt instantly to various screen resolutions.
SCALABILITY
Django is highly scalable. It uses an architecture that is based on shared-nothing components, which makes each part independent of the others. Thus, hardware can be added retrospectively and at each level, without affecting the whole architecture. This is one of the reasons why Instagram turned to Django.
According to ReviewBox website spokeswoman Erika Cecchetto:
“Most sites and apps are used on smartphones, while on the computer those more complex procedures involving simultaneous work on multiple software are carried out. For this reason, the applications that are designed must be 100 percent responsive, so that they adapt to the use of tablets and computer media of any kind.”
Django, the “turnkey framework,” is an excellent choice for those who want to web great applications. Suffice it to say that sites such as: Mozilla, National Geographic, Disqus use it. Initially the introductory part of training through the guides might seem a bit long, but it will be necessary to proceed expeditiously.
In addition, the presence of a large worldwide community is a guarantee, because every problem will be solvable through input from other users and there will be constant feedback.
PROJECT INSTALLATION
The procedure I am about to show you was performed on a machine Ubuntu Linux 22.04. If you have another Windows or macOS operating system refer to the documentation. First, you need to download the project from GITHUB and save it to a folder locally. The address is as follows: https://github.com/malbasini/django-project. I list the necessary software:
- MySQL Server available at https://www.mysql.com/downloads/, choose the community version.
- MySqlWorkbench (optional) you can always use the MySQL command line as in my case since it is not available on Ubuntu with ARM 64-bit architecture.
- Python, you can find it at https://www.python.org/ choose the version for your Operating System.
- A code editor, you can use Visual Studio Code or the community version of PyCharm which you can find at https://www.jetbrains.com/edu-products/download/other-PCE.html
These are the prerequisites for installing the project. Once the installation is done perform the following steps:
- Creating the virtual environment with the command
python3 -m venv venv, placing itself in the root of the project. Once you have created the environment the virtual environment activate it by moving to the newly created venv folder with the cd venv command and run the following command valid for Linux and macOS:
source bin/activate
- Install all dependencies, starting with Django.
- pip install django
- pip install mysql-connector-python
- pip install python-decouple
- pip install django-phonenumber-field
- pip install django-crispy-forms
- pip install crispy-bootstrap5
- pip install django-widget-tweaks
- pip install django-summernote
- pip install django-recaptcha
- pip install pymysql
- pip install phonenumbers
- pip install six
- pip install certifi
For a massive installation of these dependencies, consult the README.md file
Place in the root directory and issue the following commands:
-
- python3 manage.py migrate
- Write the .env file (configuration file) with the MySQL information and the SMTP server information. You can generate the secret key at the following address: https://djecrety.ir/
- Apply the changes written in the README.md file or via MySqlWorkbench or from the command line MySQL if not available.
- run the command python3 manage.py runserver to run the development server on port 8000.
Leave A Comment