Skip to content

Commit

Permalink
<update> readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kirianguiller committed Oct 15, 2020
1 parent c9773ea commit 2bc6f14
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand All @@ -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

```
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 2bc6f14

Please sign in to comment.