Skip to content

Commit

Permalink
<update> readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kirianguiller committed Oct 16, 2020
1 parent 2bc6f14 commit 50fac6f
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ 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

```
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
Expand All @@ -67,3 +57,37 @@ pip install pytest
pytest
```


### Deploy the app in production

##### Folder settup

On the server, create the project folder

```
mkdir /var/www/flask_api_example
```

In the project folder, create a python virtual environment
```
python -m venv ven
```

Install the python packages requirements
```
pip install -r requirements.txt
```

Initialize the DB (or paste an existant one)
```
python migrate.py seed_db
```

##### Proxy setting

If needed to, allow the folder access to the server user that will have control the app
```
sudo chown -Rf <admin>:<group> /var/www/flask_api_example/
```

Navigate to the posted URL in your terminal to be greeted with Swagger, where you can test out the API.

0 comments on commit 50fac6f

Please sign in to comment.