Deployment
Ways of deploying the application
Deploying with Waitress & Cloudflare
Waitress is a production-quality WSGI server that can be used to run your Flask application. Here's how you can run your application with Waitress and have it hosted by Cloudflare:
Activate the Python virtual environment:
Install Waitress:
Navigate to your application's directory and run Wrapper.py:
or
Replace
path/to/your/application
with the actual path to your application's directory.By default, I have waitress set to use 4 threads. If you want to change this, edit this line in 'server.py' to the amount of threads you want.
The application will now be available at http://localhost:5000.
Configure Cloudflare:
Go to your Cloudflare dashboard, add your domain, and update your DNS records to point to your server's IP address and port 5000. Make sure your SSL/TLS encryption mode is set to "Full".
Deploying to Heroku
This application is designed to be easily deployable to Heroku. It uses the DATABASE_URL
environment variable to configure the database, and automatically converts postgres://
URLs to postgresql://
URLs, which are required by SQLAlchemy.
To deploy the application to Heroku, you can use the Heroku CLI:
Last updated