This article describe the necessary steps required to go LIVE with a simple web app coded in Flask, using Heroku as deployment platform. The product used to demonstrate the process, can be found on Github released under the MIT License.
In a rush? Check out the Adminator Flask Dashboard LIVE demo or access the source code.
How to push LIVE the app - short version
$ git clone https://github.com/app-generator/flask-dashboard-adminator.git $ cd flask-dashboard-adminator
- Authenticate in the Heroku platform, using the console
$ heroku login
This command should open a browser window that invites the user to confirm the operation.
- Create a new project into Heroku platform
$ heroku create
This command will create a new project, visible in the Heroku dashboard right away.
- Push the sources, trigger the remote app build and deployment
$ git push heroku master
If the logs, printed in the terminal shows no errors, we should see Adminator Dashboard running in the browser:
A few words about the magic. The app is provisioned with basic scripts required by the Heroku platform to operate a successful deploy:
- runtime.txt - the file specify the Python version to be used - 3.6 in our case
- run.py - handler responsible to build the WSGI interface for the app
- Procfile - a special file required by Heroku that trigger the deployment under Gunicorn. The file has only one line:
web: gunicorn run:app --log-file=-
Let's recap all commands:
$ # Clone the sources $ git clone https://github.com/app-generator/flask-dashboard-adminator.git $ cd flask-dashboard-adminator $ $ # Login into Heroku $ heroku login $ $ # Create the app into Heroku platform (with a random app name) $ heroku create $ $ # Create the app with a specific name $ heroku create my-flask-app $ $ # Commit changes and trigger the build and deploy $ git push heroku master
The LIVE deployment can be accessed via Heroku dashboard or typing in the terminal `open` command:
$ heroku open
The command should open a new browser window that reveals the login page.
Links & Resources
Adminator is a responsive Bootstrap 4 Admin Template crafted by ColorLib. It provides you with a collection of ready to use code snippets and utilities, custom pages, a collection of applications and some useful widgets.
Heroku is a cloud platform as a service supporting several programming languages. One of the first cloud platforms, Heroku has been in development since June 2007, when it supported only the Ruby programming language, but now supports Java, Node.js, Scala, Clojure, Python, PHP, and Go.
AppSeed, the provider of this free product, is a platform that uses automation tools and boilerplate code to provide UI-Ready web apps coded in various patterns and programming languages.
In case you find this post useful and want to play with more flask dashboards, already provisioned with deployment scripts for Heroku, Docker, Gunincorn, and Waitress, feel free to access the links:
- Flask Dashboard Black - UI-ready Admin panel - LIVE Demo
- Flask Admin Panel Argon - LIVE Demo - MIT License
The full-list with open-source admin dashboards is published on Github.