This is a tools for init flask restful api project, this can save your time.
Project description
Installing
Install and update using pip:
pip install -U rflask
A Simple Example
$ rflask init
project_name: [flask-restful-api-20200125-090404]
author: [Deacon]
author_email: [deacon@example.com]
description: [Flask restful api project.]
...
...
Create file /Users/donghp/Downloads/Git_doc/PythonProject/init-flask-restful-api/flask-restful-api-20200125-090404/supervisord_example.conf
Done.
Project dir tree:
.
├── applications
│ ├── test
│ │ ├── README.rst
│ │ ├── __init__.py
│ │ ├── models.py
│ │ ├── urls.py
│ │ └── views.py
│ ├── user
│ │ ├── README.rst
│ │ ├── __init__.py
│ │ ├── models.py
│ │ └── views.py
│ └── __init__.py
├── enums
│ └── __init__.py
├── exceptions
│ ├── __init__.py
│ └── project_excepions.py
├── flask_ext
│ ├── __init__.py
│ └── logger.py
├── logs
├── requirements
│ ├── dev.txt
│ └── prod.txt
├── scripts
│ └── __init__.py
├── utils
│ ├── __init__.py
│ └── commands.py
├── README.rst
├── __init__.py
├── app.py
├── autoapp.py
├── compat.py
├── database.py
├── extensions.py
├── gunicorn.conf
├── gunicorn_example.conf
├── settings.py
├── setup.py
├── supervisord.conf
└── supervisord_example.conf
Then, you can do like this:
$ cd your_project
$ pip install pipenv
$ pipenv install --dev
$ pipenv run python app.py
* Serving Flask app "autoapp" (lazy loading)
* Environment: dev
* Debug mode: on
2020-01-23 13:03:24,151 [4554636736:MainThread] [_internal.py:_internal:_log] [INFO]: * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
2020-01-23 13:03:24,152 [4554636736:MainThread] [_internal.py:_internal:_log] [INFO]: * Restarting with stat
2020-01-23 13:03:24,600 [4616764864:MainThread] [_internal.py:_internal:_log] [WARNING]: * Debugger is active!
2020-01-23 13:03:24,604 [4616764864:MainThread] [_internal.py:_internal:_log] [INFO]: * Debugger PIN: 186-303-110
Deploy to docker
In your project root dir, open the terminal:
$ git clone ***.git
$ cd <your_project>
$ docker-compose up
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rflask-1.0.7.tar.gz
(14.6 kB
view hashes)
Built Distribution
rflask-1.0.7-py2.py3-none-any.whl
(15.9 kB
view hashes)
Close
Hashes for rflask-1.0.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2169a5a10ff18096ccba3d834ecb6ec9379d54fa3c3aa439d4542d4edb3be0d |
|
MD5 | 74a2e767b2af00f3a9f8ec758d3a5e85 |
|
BLAKE2b-256 | ae16454b9712e8e2683b5ebda4c44dcd4bcc352fbbbf3f6561118ef7f93b9af6 |