Deploying Gestor de Tareas Django to production requires a few changes from the default development configuration. The project ships with Gunicorn (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LucPinheiro/gestor-tarea-django/llms.txt
Use this file to discover all available pages before exploring further.
gunicorn>=21.0) already listed in requirements.txt, so no extra installation step is needed beyond a standard pip install -r requirements.txt. You will also need to harden the Django settings — especially DEBUG, SECRET_KEY, and ALLOWED_HOSTS — before exposing the application to the internet. See the Environment Variables and Settings Reference page for a full settings breakdown.
Prerequisites
Python & pip
Python 3.10 or newer and pip must be available on the target server. The project’s
requirements.txt targets Django 5.0+, which requires Python 3.10+.Gunicorn
Gunicorn is already declared in
requirements.txt (gunicorn>=21.0). It is installed automatically when you run pip install -r requirements.txt.Linux server or PaaS
A Linux server (Ubuntu 22.04+ recommended) with SSH access, or a PaaS provider such as Render. The live demo runs on Render.
Nginx or reverse proxy
On a bare server, Nginx (or another reverse proxy such as Caddy) should sit in front of Gunicorn to handle TLS termination, static file serving, and connection management.
Step-by-step Deployment with Gunicorn
The following steps walk through a full production deployment on a Linux server. Run all commands from the project root (the directory that containsmanage.py).
Clone the repository and install dependencies
Clone the repository from GitHub, create a virtual environment, and install all required packages from
requirements.txt. This includes Django 5, Gunicorn, pandas, openpyxl, and django-import-export.Set environment variables
Before running any Django management commands, export the required environment variables. At minimum you need
SECRET_KEY, DEBUG, and ALLOWED_HOSTS. Refer to the Environment Variables and Settings Reference page for the full list of available variables and recommended values.The default
settings.py does not read from environment variables. Before these exports take effect you must first apply the production overrides described in the Environment Variables and Settings Reference. For persistent configuration, inject values through your server’s environment management — for example a systemd EnvironmentFile or the environment variable panel of your PaaS provider.Collect static files
Django’s
collectstatic command gathers all static assets from each installed app into the directory defined by STATIC_ROOT (BASE_DIR / 'staticfiles' by default). This must be run before starting the application server so Nginx can serve CSS, JavaScript, and images directly.Apply database migrations
Run all pending migrations to bring the database schema up to date. On a fresh deployment this creates all required tables. On subsequent deployments it applies only the new migration files.
Start Gunicorn
Launch Gunicorn pointing at the WSGI application object defined in
mi_proyecto/wsgi.py. The module path mi_proyecto.wsgi:application maps directly to the application variable exposed by get_wsgi_application() in that file.--bind 0.0.0.0:8000— listens on all interfaces on port 8000. Nginx will proxy requests to this address; you do not need to expose port 8000 publicly.--workers 3— spawns three worker processes, which is a reasonable default for small to medium deployments. A common formula is(2 × CPU cores) + 1.
Deploying to Render (PaaS)
The live demo of Gestor de Tareas Django is hosted on Render at https://django-gestortarea.onrender.com/. Render is a good choice for getting a production deployment running quickly without manually managing servers, Nginx, or systemd units.Connect the GitHub repository
Log in to Render, click New → Web Service, and connect your GitHub account. Select the
gestor-tarea-django repository. Render will detect it as a Python project.Set the Build Command
In the Render service settings, set the Build Command to install dependencies, apply migrations, and collect static files in a single step:
Set the Start Command
Set the Start Command to launch Gunicorn using the WSGI module from
mi_proyecto/wsgi.py:Add environment variables
In the Render dashboard, navigate to Environment and add the following key–value pairs:
See the Environment Variables and Settings Reference page for details on each setting and how to wire them into
| Key | Value |
|---|---|
SECRET_KEY | A long, random, unique string |
DEBUG | False |
ALLOWED_HOSTS | django-gestortarea.onrender.com |
settings.py.Production Checklist
Review each item below before routing live traffic to the application.Set ALLOWED_HOSTS to your actual domain(s). The default
ALLOWED_HOSTS = ['*'] in settings.py is permissive and suitable for development only. In production, set it to the exact hostname(s) your application will respond to, for example yourdomain.com,www.yourdomain.com.Run
collectstatic before every deployment. Static files (CSS, JavaScript) are stored under each app’s static/ directory during development. The collectstatic command copies them into STATIC_ROOT (staticfiles/ by default) so Nginx or your PaaS can serve them. Re-run it whenever static files change.