Deploying Snakeskin Projects to Netlify
This guide explains how to deploy a Snakeskin project to Netlify.
Prerequisites
-
A Snakeskin project that builds successfully with
snakeskin build - A Netlify account
- Netlify CLI installed (optional)
Option 1: Deploy via Git Integration
- Push your Snakeskin project to GitHub, GitLab, or Bitbucket
- Log in to your Netlify account
- Click "New site from Git"
- Select your repository
-
Configure the build settings:
-
Build Command:
pip install snakeskin-xplnhub && snakeskin build - Publish Directory:
dist
-
Build Command:
- Click "Deploy site"
Option 2: Deploy via Netlify CLI
- Install Netlify CLI:
bash
npm install -g netlify-cli - Log in to Netlify:
bash
netlify login - Navigate to your Snakeskin project directory:
bash
cd my-snakeskin-project - Initialize Netlify:
bash
netlify init - Deploy to Netlify:
bash
netlify deploy --prod Configuration
The netlify.toml file in your project configures how Netlify
builds and serves your project:
toml
[build]
publish = "dist"
command = "pip install snakeskin-xplnhub && snakeskin build"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200 Troubleshooting
- Build Environment: Netlify uses a Linux environment, so ensure your build works on Linux
- Python Version: Specify the Python version in a
runtime.txtfile if needed - Dependencies: Add any Python dependencies to a
requirements.txtfile - Build Timeout: If your build takes too long, optimize it or increase the build timeout in Netlify settings
Notes
- Netlify primarily supports JavaScript frameworks, so you're using it as a static file host
-
The build process runs
snakeskin buildto generate static files - For more complex setups, consider using Netlify Functions to run serverless Python code