Installation
Prerequisites
- Python: Django is a Python-based web framework, so you’ll need to have Python installed on your system first. See this guide for instructions on installing Python.
- git:
gitis required only if you want to install Django's development version.
Install Django
There are 3 ways to install Django:
Install an official stable release
This is the recommended way to install Django. To install the official release of Django, use this command:
python -m pip install Django
python -m pip install Django
py -m pip install Django
Install a distribution-specific package
Check the distribution-specific notes to see if your platform/distribution provides official Django packages/installers. These packages usually handle dependencies automatically and support system-managed upgrades, but they often lag behind and rarely include the latest release of Django.
Install the latest development version
This option is for enthusiasts who want the latest-and-greatest features and don’t mind running fresh, untested code. The development version may contain bugs, but reporting them helps the development of Django. Keep in mind that third-party packages are often less compatible with the development version than with the latest stable release.
Follow these instructions to get the latest development version of Django:
- Clone the Django's
maindevelopment branch:
git clone https://github.com/django/django.git
- Activate the virtual environment and run the following command to install it locally:
python -m pip install -e django/
python -m pip install -e django/
py -m pip install -e django\
git pull command inside the django directory.Verify Installation
To verify Django installation, activate the virtual environment and run the following command:
python -m django --version
python -m django --version
py -m django --version
The above command is equivalent to running the following command:
django-admin --version
You can alternatively run the following code inside Python shell, to verify installation:
import django
print(django.get_version())
# Prints the installed version of Django
TODO: Production Environment
If you plan on using Django on a production site, you'll also need Apache and mod_wsgi as well. Also, nginx + uWSGI as well?
TODO: Update this Section Later
References: https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/modwsgi/https://github.com/PirateDevCom/personal-docs/blob/main/docs/deployments/aws/Django%40EC2-Debian12.md
Introduction
Django is a free and open-source, Python-based web framework. It is maintained by the Django Software Foundation (DSF), an independent non-profit organization established in the US.
Getting Started
Every Django application starts with a project. This guide shows you how to create and set one up.
