Last modified: March 23, 2026
This article is written in: πΊπΈ
Netlify allows you to easily deploy and manage static websites. A Python-based static site generator like Pelican, MkDocs, or Frozen-Flask produces HTML files that Netlify serves through its global CDN.
+-----------+ push +------------+ build +----------+
| | -------------> | | ------------> | |
| Git Repo | | Netlify | | CDN Edge |
| (GitHub, | | Build Env | | Nodes |
| GitLab) | | (Python + | | (Global) |
| | <------------- | pip) | <------------ | |
+-----------+ webhook +------------+ deploy +----------+
|
|
+-----+-----+
| End Users |
+-----------+
requirements.txt:# requirements.txt
pelican==4.9.1
markdown==3.6
Sign up at netlify.com if you don't have an account.
Connect your repository by clicking "New site from Git" in the Netlify dashboard, choosing your Git provider, and selecting the repository.
Configure build settings in the dashboard or, preferably, through a netlify.toml file at the root of your repo:
[build]
command = "pip install -r requirements.txt && pelican content -s publishconf.py"
publish = "output"
[build.environment]
PYTHON_VERSION = "3.11"
publish points to the directory that contains the generated HTML files.
Deploy by clicking "Deploy site" or simply pushing a commit to the linked branch.
Domain settings let you use a custom domain or the auto-generated *.netlify.app subdomain:
Navigate to "Domain settings" in the site dashboard.
Wait for DNS propagation, which can take a few minutes to 48 hours.
SSL/TLS is provisioned automatically through Let's Encrypt once DNS is verified:
Check the "SSL/TLS certificate" section in domain settings.
main).netlify.toml or in the dashboard under "Build & deploy β Branches":[context.production]
command = "pelican content -s publishconf.py"
[context.branch-deploy]
command = "pelican content -s pelicanconf.py"
PELICAN_SITEURL = https://example.com
ANALYTICS_ID = UA-XXXXXXXX-X
import os
SITEURL = os.environ.get("PELICAN_SITEURL", "http://localhost:8000")
netlify.toml:[context.production.environment]
PELICAN_SITEURL = "https://example.com"
[context.deploy-preview.environment]
PELICAN_SITEURL = "https://preview.example.com"
npm install -g netlify-cli
netlify deploy --prod --dir=output
curl -I https://your-site.netlify.app._redirects file or redirect rules in netlify.toml for custom routing:[[redirects]]
from = "/old-path"
to = "/new-path"
status = 301
With these steps and configurations, you can deploy, preview, and manage a static Python website on Netlify with full continuous deployment support.