This repository serves as a template for a basic web application built using Flask in Python.
- Git
- Python3
- Postgres
- An IDE of your choice
- Clone the repository.
$ git clone git@github.com:Kyle-L/Flask-Template.git
- Check into the cloned repository.
cd Flask-Template/app
- Install Pipenv using pip, install pip if you haven't already.
pip install pipenv
- Setup a virtual environment with Pipenv.
$ python3 -m venv env
- Start the virtual environment
$ source env/bin/activate
- Install the requirements
$ pip3 install -r requirements.txt
- Set environment variables.
$ export FLASK_APP=app
$ export FLASK_DEBUG=1
- Setup Postgres database using Flask-SQLAlchemy.
$ python3
>> from app import db, create_app
>> db.create_all(app=create_app())
>> exit()
- Run the server.
$ flask run