Deploy to Heroku, it takes 7 minutes.
Our templates are% compatible with Heroku, just make sure to understand and execute the following steps.
Create an account on heroku.com, do not create a project, you will do that later, all you need is email and password set.
Install Heroku (if you don't have it yet)
1npm i heroku -g
1heroku login -i
1heroku create <your_application_name>
1heroku plugins:install buildpack-registry 2heroku plugins:install buildpacks
1heroku buildpacks:add --index 1 heroku/python 2heroku buildpacks:add --index 2 heroku/nodejs
1$ heroku addons:create heroku-postgresql:hobby-dev 2# this command will also automatically add a DATABASE_URL env variable with the Postgres database url
You cannot create a .env
file on Heroku, instead you need to manually add all the variables using the command line or under your Heroku dashboard project settings.
Open your .env
file and copy and paste each variable (FLASK_APP, FLASK_ENV, etc.) to Heroku. ⚠️ Do not add the DATABASE_URL
variable again, it was already added by Heroku automatically when we added the Postgres add-on.
1$ heroku config:set FLASK_APP_KEY="any key works" 2$ heroku config:set FLASK_APP=src/app.py 3# ↓ Important: Set to "production" 4$ heroku config:set FLASK_ENV=production 5$ heroku config:set BASENAME=/ 6$ heroku config:set BACKEND_URL=
The last step is to push your code to Heroku with your most recent changes:
1git add . 2git commit -m 'deploying to heroku' 3git push heroku main
That is it! If you encounter any issues please refer to the FAQ Heroku file.