Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yamila-moreno/api-example
API example
https://github.com/yamila-moreno/api-example
Last synced: 4 days ago
JSON representation
API example
- Host: GitHub
- URL: https://github.com/yamila-moreno/api-example
- Owner: yamila-moreno
- License: gpl-3.0
- Created: 2016-01-31T08:33:44.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-18T17:59:22.000Z (almost 9 years ago)
- Last Synced: 2024-11-08T03:38:01.286Z (about 2 months ago)
- Language: Python
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
API Example
It's a very simple API made with Anillo and Python. To get ready with your environment:
* You need to copy myapp.ini and pytest.ini files outside the repository
* You need to export two env vars: MY_APP and MY_APP_TEST, pointing the previous files
* You need sqlite (usually it's in all Linux)
* I encourage you to use a virtualenv (with Python3!!!)
* You need to install requirements.txt and requirements-server.txtNote: if you're not using postgres (not mandatory!), you don't need to install psycopg2 (which is in `requirements.txt`)
Once you've all of this, you can run the API locally directly with Anillo:
```
(myvenv) src/ $ python run.py serve --create-db --with-fixtures --no-hot-reload
```Or, if you installed requirements-server.txt, you can run the application with Gunicorn:
```
(myvenv) src/ $ gunicorn -b 0.0.0.0:5005 --access-logfile - --error-logfile - --log-level debug 'wsgi:load_application("create-db", "with-fixtures")'
```And you can run the tests:
```
(myvenv) src/ $ python run.py test
```