Quick install guideΒΆ
Before you can use Django, youβll need to get it installed. We have a complete installation guide that covers all the possibilities; this guide will guide you to a minimal installation thatβll work while you walk through the introduction.
Install PythonΒΆ
Being a Python web framework, Django requires Python. See What Python version can I use with Django? for details. Python includes a lightweight database called SQLite so you wonβt need to set up a database just yet.
Get the latest version of Python at https://www.python.org/downloads/ or with your operating systemβs package manager.
You can verify that Python is installed by typing python
from your shell;
you should see something like:
Python 3.x.y
[GCC 4.x] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Set up a databaseΒΆ
This step is only necessary if youβd like to work with a βlargeβ database engine like PostgreSQL, MariaDB, MySQL, or Oracle. To install such a database, consult the database installation information.
Install DjangoΒΆ
Youβve got three options to install Django:
Install an official release. This is the best approach for most users.
Install a version of Django provided by your operating system distribution.
Install the latest development version. This option is for enthusiasts who want the latest-and-greatest features and arenβt afraid of running brand new code. You might encounter new bugs in the development version, but reporting them helps the development of Django. Also, releases of third-party packages are less likely to be compatible with the development version than with the latest stable release.
Always refer to the documentation that corresponds to the version of Django youβre using!
If you do either of the first two steps, keep an eye out for parts of the documentation marked new in development version. That phrase flags features that are only available in development versions of Django, and they likely wonβt work with an official release.
VerifyingΒΆ
To verify that Django can be seen by Python, type python
from your shell.
Then at the Python prompt, try to import Django:
>>> import django >>> print(django.get_version()) 6.1
You may have another version of Django installed.
Thatβs it!ΒΆ
Thatβs it β you can now move onto the tutorial.