LAU gym fails to meet minimum standards

The LAU Beirut fitness center does not meet the minimum requirements concerning space, hygiene, and equipment which fulfill students’ needs. Gyms must follow certain guidelines in order to provide a…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Django Framework

What is Django?

Django is a free and open source web application framework and is written in Python and follows MVT architectural pattern. It takes care of the hassle of web development so that you can focus on writing your application.

Why Django?

Here are the points that make Django an obvious choice:

1. Django supports the project from small size (perfect for Start-ups) to the biggest size (such as Disqus or Washington Post) because of its ability to scale quickly and flexibly.

2. Django is open source so it is kept updated by developers. It means that you can get an answer to your questions very easily.

3. Django has more fully featured toolkit of the component. It has everything that you need to create an app.

4. Django takes care of user authentication, content administration, sitemaps, RSS feeds, and many more tasks.

5. Django is versatile. You can create things from content management system to social networks to scientific computing platform.

6. Django takes care of security. It helps the developers to avoid serious mistakes such as SQL injection, cross-site scripting, cross-site request forgery and clickjacking.

7. Django runs on every platform (Mac, Windows, and Linux).

8. It is also supported by all cloud providers. So you can deploy your app to any provider by running just one single command.

9. It has excellent documentation. It means you can save a lot of your time.

Installation:

Django is written in Python. In order to install Django, you need to install Python first. (Install the latest version of Python).

Now follow these steps (on Windows):

1) Run PowerShell as administrator.

2) Check Python version by running this command:

python — version

If it throws an error of “The term ‘python’ is not reorganized”, then you have to set the Environment variable by running this command:

[Environment]::SetEnvironmentVariable(“Path”, “$env:Path;<YOUR PYTHON FOLDER PATH>”)

If it throws an error of “The term ‘python’ is not reorganized”, then you have to set the Environment variable of “Scripts” folder under “Python” Folder.

4) Now install Django by running this command:

It will automatically install the supported version of Django.

5) Check installed Django version by running this command:

django-admin — version

Create Django App using command prompt/power shell:

To create new Django app, please follow these steps:

1) Create any directory where you want to create Django app.

2) Run this command:

django-admin startproject <PROJECT-NAME>

This will create a new Django project with the mentioned name.

File Structure of Django Project:

When you create any Django project then it will create following files:

<PROJECT-NAME>/

manage.py

<PROJECT-NAME>/

settings.py

urls.py

wsgi.py

manage.py: Never edit or delete this file. It allows you to access the database, create users.

settings.py: This file is the overall settings of your website.

urls.py: It is like a table of content of your website.

wesi.py: It stands for web server gateway interface.

To run newly created Project:

Go to the directory where you have created your project and run this command on PowerShell:

python manage.py runserver

So this is all about Django framework and how we can install it and how we can create a new project using Django.

Add a comment

Related posts:

MileVerse Team Interview

Hi dear readers! MileVerse has organized a Q&A session with the executives and core team members to introduce the platform from the perspective of the people, who are building it! MileVerse is a…

What is Fibromyalgia?

Have you ever imagined being in pain but being unable to pinpoint the source? Unfortunately, about 4 million US adults, almost 2% of the adult population, suffer from this chronic and painful…

AFRIKTA

AFRIKTA is a digital marketing agency and a business directory that focuses on companies based in Africa. We help small, medium and large organizations based in Africa to promote their businesses…