Knowledge base
1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!
Install Django
This guide concerns Django, an open-source web development framework in Python, particularly renowned for its robustness and rapid development capabilities.
Installing Django
Prerequisites
- Suitable hosting:
- Deploying a Python application that requires an application server running continuously is not suitable for standard shared web hosting.
- Full server access via SSH is required.
- Technical environment:
- Python 3 installed on the server, as well as the
pippackage manager.
- Python 3 installed on the server, as well as the
- Basic knowledge:
- Familiarity with the command-line interface (CLI) under Linux and the management of Python virtual environments (such as
venv).
- Familiarity with the command-line interface (CLI) under Linux and the management of Python virtual environments (such as
Here are the general steps to set up your environment on your server:
It is necessary to install Django on Web offers that guarantee full control over the execution environment, such as Cloud VPS / VPS Lite: discover the different Web hosting options from Infomaniak.
- Connect to your VPS server via SSH.
- Create and activate a virtual environment dedicated to your project to isolate its dependencies (e.g.,
python3 -m venv my_environmentthensource my_environment/bin/activate). - Install the framework using the package manager:
pip install django. - Initialize your new project with the command:
django-admin startproject name_of_project.
Deployment
Please note that the development server integrated with Django (launched via runserver) is not designed for a production environment. To securely expose your site on the internet on your Infomaniak VPS, you will need to configure an application server (such as Gunicorn or uWSGI) behind a reverse proxy such as Nginx or Apache.
Link to this FAQ: https://faq.infomaniak.com/516
Has this FAQ been helpful?