Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
FREEDOM251

Freedom251 › Blog › deployment

Install Django: Set Up a Local Project or Deploy to a VPS

By Freedom251 Team · · 10 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

To install Django, use a supported Python 3 release, create a virtual environment for your project, and install Django with pip. For local development, start the project with Django’s runserver. For a VPS, use a production WSGI or ASGI server instead, then configure a reverse proxy, HTTPS, static files, and the other deployment settings Django requires.

What do you need before installing Django?

Django is a Python web framework, so a compatible Python installation is the prerequisite. The compatible range depends on the Django release you plan to use; installing the newest Python available is not automatically the right choice if that release falls outside the supported range.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

As an Amazon Associate I earn from qualifying purchases.

Django’s FAQ lists these Python ranges for the releases shown below. It also says that only the latest micro release in each supported Python series is officially supported. Check the compatibility information for the Django version you intend to install before choosing Python, especially if you are following an older project’s instructions.

Django release Supported Python series
Django 5.2 Python 3.10–3.14
Django 6.0 Python 3.12–3.14
Django 6.1 Python 3.12–3.15
Django 6.2 Python 3.12–3.15

These ranges are release-specific, not a promise that every Django version supports every listed Python version. The Django version you choose also determines which Python releases are suitable. If a project already specifies a Django version, check that version’s compatibility before upgrading Python or installing a different Django release.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Check that Python and pip are available

Open a terminal (or PowerShell on Windows) and check the Python command available on your system:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
python --version
python -m pip --version

On macOS and many Linux distributions, the Python 3 command may instead be python3. On Windows, the Python launcher can be invoked as py. Use the command that corresponds to the Python installation you intend to use; using python -m pip ties pip to that interpreter more reliably than running a standalone pip command.

How do you install Django locally on Windows, macOS, or Linux?

Create a virtual environment inside the project directory, activate it, update pip within that environment, and install Django there. This keeps project packages separate from system Python and other projects, and avoids needing administrator privileges for an ordinary project installation.

1. Create a project directory

Choose or create a directory for the application, then open a terminal in it. The examples below use .venv as the virtual-environment directory name. Keeping it inside the project makes the environment easy to identify; the environment itself is local setup, not a replacement for tracking the project’s source code and dependency choices.

2. Create and activate the virtual environment

On macOS or Linux, run:

python3 -m venv .venv
source .venv/bin/activate

On Windows PowerShell, run:

py -m venv .venv
..venvScriptsActivate.ps1

After activation, update pip and install Django. Keep using the same terminal session so the activated environment remains in effect:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
python -m pip install --upgrade pip
python -m pip install Django

Windows also supports installing with py -m pip install Django. Whichever command you use, it should refer to the interpreter used to create the environment. Installing into the activated environment prevents a global Django installation from being confused with the version your project actually uses.

3. Decide whether to install the latest available package or pin a release

python -m pip install Django asks pip to install the package version it selects as current and compatible with the interpreter and package constraints. For a project that needs a reproducible setup, choose an explicit release after checking Django’s official release information, then install that version with a pin:

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
python -m pip install Django==6.1.2

6.1.2 is an example of a specific release, not a claim that it is the latest release now or the right version for every project. Release numbers change; check the official release information before copying a pin into a new project. A version pin is useful when you need a known version on another machine or during deployment, but it also means upgrades do not happen simply because a newer release becomes available.

4. Verify the installation and create a project

Check which Django version is available in the active environment, then create a project in the current directory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
python -m django --version
django-admin startproject config .

The final dot in startproject config . means “put the generated project files in this directory” rather than creating another nested directory. The project package is named config in this example; you can choose another valid name. The command produces manage.py in the project directory, which you use for project-level Django commands.

Apply the initial database migrations and start the local development server:

python manage.py migrate
python manage.py runserver

Open http://127.0.0.1:8000/ on the same machine to see the development site. The server prints its local address in the terminal. Stop it with Ctrl+C when finished. This is a convenient feedback loop for development, not a production deployment method.

What changes when you install Django on a VPS?

The package installation is similar, but a VPS needs an operational deployment around the Django application. Use a non-root account for the app, keep its Python packages in a virtual environment, and run it with a production WSGI or ASGI server. A web server or reverse proxy commonly sits in front to handle public web traffic, HTTPS, and static files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

1. Connect and install Python tooling

For a typical Ubuntu- or Debian-style Linux VPS, connect over SSH and install the Python tools shown here:

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
ssh your-user@your-server
sudo apt update
sudo apt install python3 python3-venv python3-pip

The account name and server address are examples to replace with the values for your server. Package names and commands differ among Linux distributions, so use the distribution’s package manager and package names if they do not match. Do not run the application as root; use a regular account with access to the application files and only the privileges it needs.

2. Prepare the application environment

Create a directory for the app, enter it, create its virtual environment, and install the packages needed by the deployment:

mkdir -p ~/apps/myproject
cd ~/apps/myproject
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install Django gunicorn

Here, Gunicorn is an example of a production WSGI server. Install the Django version and all application dependencies that the project requires; installing Django and Gunicorn alone does not transfer the application code or automatically configure the service. Copy or clone the project into the VPS application directory, then run subsequent project commands from the appropriate directory and with the intended environment active.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Apply migrations, collect static files, and check deployment settings

Once the project files and environment-specific configuration are in place, run the project’s migrations, collect static files, and ask Django to check deployment settings:

python manage.py migrate
python manage.py collectstatic --noinput
python manage.py check --deploy

Migrations apply database schema changes required by the application. collectstatic gathers static assets into the configured collection location so they can be served in deployment. The deployment check can identify configuration issues to address before launch; a successful check is not a substitute for reviewing security, infrastructure, and application behavior.

4. Choose WSGI or ASGI and run a production server

Django supports two application interfaces: WSGI and ASGI. A WSGI server such as Gunicorn can load the application callable generated in the project’s wsgi.py. An ASGI deployment uses the corresponding callable in asgi.py and an ASGI-capable server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Django’s documented server options include Gunicorn, uWSGI, Apache/mod_wsgi, Daphne, Hypercorn, Uvicorn, and Granian. The right choice depends on the interface and deployment you are setting up. Installing a server package is only one step: configure how the process starts, which application entry point it loads, and how it is kept running and restarted when needed. Gunicorn’s own guide recommends installing it inside a virtual environment and documents gunicorn --version as a way to verify the installed command.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Do not expose Django’s runserver as the public server. It is deliberately a lightweight development server, not the production application server. The production server handles application requests behind the web-server arrangement appropriate for your host.

5. Put a web server or reverse proxy in front

A common VPS arrangement places Nginx or Apache in front of the WSGI or ASGI server. The front-end web server can terminate HTTPS, serve static files efficiently, and proxy dynamic application requests to the application server. The exact proxy configuration and process-management setup depend on the distribution, provider, server choice, domain, and deployment layout; the package-install commands alone do not create these parts.

Configure the VPS firewall to expose only the ports needed for SSH and the public web proxy. Keep the application process and internal application-server endpoint behind that public-facing layer as your deployment design requires. Confirm that the service manager starts the app at boot and that the application recovers appropriately after a process restart or server reboot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which database should a Django project use?

SQLite is a practical default for local work: it is included with Python and is convenient for a small project without a separate database service. For a substantial production application, Django’s FAQ recommends PostgreSQL. Django also officially supports MariaDB, MySQL, SQLite, and Oracle.

When practical, develop against the same database family you plan to use in production. Differences between database engines can affect the application, so relying on SQLite during development while deploying to another engine can leave database-specific behavior untested. For a VPS, provision a dedicated database and a database user with only the privileges the application needs. Put connection values in environment-specific configuration rather than embedding production credentials in source code, and run migrations as part of deployment.

The appropriate engine and its setup commands depend on the application and hosting provider. The Django installation steps do not create a production database, database account, backup schedule, or secure connection; treat those as separate deployment tasks.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What must you configure before a Django VPS goes live?

Before launch, review Django’s deployment settings and the surrounding service setup. Production safety depends on more than replacing the development server: configure the application for its real host, protect secrets, serve static assets, enable HTTPS, and make the service observable and recoverable.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
  • Deployment checks: Run python manage.py check --deploy against the production configuration and resolve issues it identifies.
  • Host and secret settings: Set ALLOWED_HOSTS for the hosts that should serve the site, keep secret values in environment-specific configuration, and use production-appropriate debug settings and other critical settings.
  • HTTPS and cookies: Enable HTTPS at the web-server layer and configure the application’s secure-cookie settings consistently with that arrangement.
  • Static files: Configure where collectstatic places files and how the web server or another intended static-file layer delivers them.
  • Logging and errors: Set up error reporting and logging so you can investigate failures after deployment rather than relying on the interactive development terminal.
  • Database operations: Review backups and the migration procedure. Verify that the database is reachable by the app and that its credentials have appropriate privileges.
  • Process operations: Set worker counts and timeouts for the chosen server, decide restart behavior, and ensure the service starts automatically and remains available after a reboot.
  • Network exposure: Check that the firewall exposes only the access needed for SSH and the public web proxy.

These are connected checks, not interchangeable fixes. For example, collecting static files does not configure HTTPS, and a deployment check does not establish that backups work or that a service restarts correctly. Verify each layer in the environment where the application will actually run.

How do local and VPS installations differ?

Local setup prioritizes isolation and a fast development loop; VPS setup adds production serving and operational controls. The same project can move between them, but the server role, database choice, and security configuration must change with the environment.

Area Local development VPS deployment
Python packages Project-specific virtual environment and pip-installed Django. Project-specific virtual environment with the application’s dependencies and production server.
Request serving Django runserver for development and testing. Production WSGI or ASGI server; do not use runserver publicly.
Database SQLite is convenient for small local projects. PostgreSQL is Django’s recommended production choice; other officially supported engines are available.
Traffic handling Access the local development server directly on the machine. Commonly use Nginx or Apache as a reverse proxy and web server in front of the app server.
Operations Run commands interactively while developing. Configure HTTPS, static-file delivery, logs, backups, process restarts, and deployment settings.

Use the local workflow to build and test the application, but treat deployment as a separate configuration task rather than copying the local server command to a public machine. The app code may be shared; the environment settings and infrastructure responsibilities are not.

Frequently Asked Questions

Why can `python` and `python3` show different versions?

A computer can have more than one Python installation, and each command may resolve to a different one. Create the virtual environment with the interpreter you intend to use, then use that environment’s activated `python` command for pip and Django commands.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What does `python manage.py migrate` do?

It applies the database changes described by the project’s migrations, allowing the database schema to match what the installed application expects. Run it against the intended database configuration; on a VPS, that means confirming the production connection settings before applying changes.

Can I keep Django’s development server running on a VPS for a private preview?

It is useful for local development and testing, but Django explicitly says `runserver` is not suitable for production. For a VPS deployment, use a production WSGI or ASGI server even if the site is small or temporarily accessible to a limited audience.

Do I need both a WSGI or ASGI server and Nginx or Apache?

They commonly have different roles: the application server runs Django, while a front-end web server or reverse proxy handles public traffic, HTTPS, and often static files. The exact arrangement depends on the deployment, but Django’s production guidance does not treat `runserver` as a substitute for it.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

deploymentDjangoPythonVPSWeb development

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.