Deployment
PyFyre is a static-site generator like React.js and Vue. To deploy a PyFyre application is really quite easy.
To create a build files:
cd <app_directory>
pyfyre build
And it will produce all the files needed to deploy your application through Netlify, Vercel, or other static site hosting platform.
Netlify
Create a netlify.toml
file on the main app directory (not in the build) and paste this:
[build]
# Directory to change to before starting a build.
# This is where we will look for package.json/.nvmrc/etc.
# If not set, defaults to the root directory.
base = "/"
# Directory that contains the deploy-ready HTML files and
# assets generated by the build. This is relative to the base
# directory if one has been set, or the root directory if
# a base has not been set. This sample publishes the directory
# located at the absolute path "root/project/build-output"
publish = "build/"
# Default build command.
command = "pip install PyFyre && pyfyre build"
[[redirects]]
from = "/*"
to = "/"
status = 200
force = false
Add the requirements.txt and only add pyfyre to it:
pyfyre
Add runtime.txt
, runtime.txt tells Netlify that we're using a specific Python version, in our case, it's 3.8
3.8
3.8
with no spaces, indentation, or skipped lines.
And this is now ready for Netlify deployment. Happy hacking!
Last updated