
Although this project is developed using React Native, the actual experience should not be inferior to most of the native applications developed by individuals on Github.
Installation dependencies and operation
Install dependencies
pip install -r requirements.txt
database initialization
python manage.py db init
run locally
python manage.py runserver -h0.0.0.0 -p80
server deployment
Step 1: Add additional environmental variables
export flask_server_type=”development”
At the same time, define database address and other information in config.py.
Step 2: Start the service. Gunicorn is recommended. The steps are as follows:
gunicorn -w 3 manage:app -b 0.0.0.0:8000
Step 3: Configure nginx and forward port 80 requests to gunicorn:
sudo ln -s deployment/nginx /etc/nginx/sites-enabled/mysitename.conf
API design and documentation
The API is designed in restful API style.
There are three types of requests:
GET Get data
POST Create Data
PUT/PATCH modifies data
Comments0