diff --git a/README.md b/README.md index 7947116..a545f68 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,13 @@ pip install -r requirements.txt to get the dependencies. +### Manage the database + +Explicitely set the environment (```dev``` ,```prod``` and ```test```) +``` +export FLASK_CONFIG=dev +``` + Next, initialize the database ``` @@ -32,6 +39,9 @@ python manage.py seed_db Type "Y" to accept the message (which is just there to prevent you accidentally deleting things -- it's just a local SQLite database) + +### Run the app + Finally run the app with ``` @@ -40,7 +50,12 @@ python wsgi.py Navigate to the posted URL in your terminal to be greeted with Swagger, where you can test out the API. +### Run the app for local development +The following command is a shorthand for running the development server +``` +python dev.py +``` ## Running tests diff --git a/manage.py b/manage.py index e3cb6d1..17b8003 100644 --- a/manage.py +++ b/manage.py @@ -4,7 +4,7 @@ from app import create_app, db from commands.seed_command import SeedCommand -env = os.getenv("FLASK_ENV") or "test" +env = os.getenv("FLASK_CONFIG") or "test" print(f"Active environment: * {env} *") app = create_app(env) diff --git a/wsgi.py b/wsgi.py index 63fc433..2a4134c 100644 --- a/wsgi.py +++ b/wsgi.py @@ -2,6 +2,6 @@ from app import create_app -app = create_app(os.getenv("FLASK_ENV") or "test") +app = create_app(os.getenv("FLASK_CONFIG") or "test") if __name__ == "__main__": app.run(debug=True)