diff --git a/README.md b/README.md index a545f68..f627b02 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 : /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.