egillanton / flask-bootstrap4-heroku-skeleton

Flask App Template, Includes minimal Bootstrap 4 and Heroku setup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flask-bootstrap4-heroku-skeleton

Table of Contents

Click to expand

1. Introduction

This is a template project used to kickstart a Flask project containing:

  • Bootstrap 4.5.2 CDN
  • Procfile for Heroku
  • python-dotenv for setting up local variables

2. Setup

Make sure to have Python 3.6 or newer, and pip installed.

2.1. Get virtualenv

$ pip install virtualenv

2.2. Create a virtual enviroment

Make sure to create a Python3 instead of Python2 enviroment by refrencing its binaries.

$ which python3
/usr/bin/python3

You can use any name you want, we will use "venv".

$ virtualenv -p /usr/bin/python3  venv

2.3. Activate enviroment

$ . venv/bin/activate

Now you have activated your virual enviroment and your teminal should display its name as so:

$(venv)

2.4. Install requried packages

$(venv) pip3 install -r requirements.txt  

2.5. Run The Application

$(venv) flask run

You’ll see output similar to this:

Serving Flask app "app"
Environment: development
Debug mode: on
Running on http://127.0.0.1:5000/
Restarting with stat
Debugger is active!
Debugger PIN: 298-204-950

Open the link in your browser.

2.6. Push to Heroku

Make sure you have installed Heroku CLI, and have authentication to the Heroku project.

Install the Heroku CLI Download and install the Heroku CLI.

If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key. Login into Heroku

$ heroku login

Clone the repository Use Git to clone heroku-app's source code to your local machine.

$ heroku git:clone -a <heroku-app>
$ cd <heroku-app>

Deploy your changes Make some changes to the code you just cloned and deploy them to Heroku using Git.

$ git add .
$ git commit -am "make it better"
$ git push heroku master

3. License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

4. Contributors

Become a contributor

🌟 PLEASE STAR THIS REPO IF YOU FOUND SOMETHING INTERESTING 🌟

About

Flask App Template, Includes minimal Bootstrap 4 and Heroku setup

License:Apache License 2.0


Languages

Language:HTML 77.2%Language:Python 21.3%Language:Shell 1.5%