Skip to content

Latest commit

 

History

History
75 lines (51 loc) · 1.38 KB

setup-without-docker.md

File metadata and controls

75 lines (51 loc) · 1.38 KB

Setup

Use this guide if you do NOT want to use Docker in your project.

Getting Started

Create and activate a virtual environment, and then install the requirements.

Set Environment Variables

Update project/server/config.py, and then run:

$ export APP_NAME="amazon"
$ export APP_SETTINGS="project.server.config.ProductionConfig"
$ export FLASK_DEBUG=0

By default the app is set to use the production configuration. If you would like to use the development configuration, you can alter the APP_SETTINGS environment variable:

$ export APP_SETTINGS="project.server.config.DevelopmentConfig"

Using Pipenv or python-dotenv? Use the .env file to set environment variables:

APP_NAME="amazon"
APP_SETTINGS="project.server.config.DevelopmentConfig"
FLASK_DEBUG=1

Create DB

$ python manage.py create-db
$ python manage.py db init
$ python manage.py db migrate
$ python manage.py create-admin
$ python manage.py create-data

Run the Application

$ python manage.py run

Access the application at the address http://localhost:5000/

Testing

Without coverage:

$ python manage.py test

With coverage:

$ python manage.py cov

Run flake8 on the app:

$ python manage.py flake

or

$ flake8 project