......
- python3, mysql server
- python3 -m virtualenv env
- source ./env/bin/activate
- pip install pip --upgrade
- pip install -r requirements.txt
You have to create a folder called instance in the project root. Create two files, development.cfg, testing.cfg /jcapi /instance development.cfg testing.cfg
Example content of these files (development.cfg):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'mysql://<user>:<password>@localhost/<database_name>'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECRET_KEY = '2s-ymN5--KIp7goh-CVRrliS9aMTrYuVmWy3-CYnXjJcq3AZXHLBOf8I26aw_5AHUf7'
JWT_SECRET_KEY = '1ZNA-ax-6NW-J8VR7hsRxNvfvoMm5mahcYTO6RGra-nVv8AArsWlc10xcLN4Ha1I-XdcoYpL'
JWT_ACCESS_TOKEN_EXPIRES = 1800
MAIL_SERVER='your server address'
MAIL_PORT=465
MAIL_USERNAME='[email protected]'
MAIL_PASSWORD='my pass'
MAIL_DEFAULT_SENDER='[email protected]'
MAIL_ENABLED=True
I'm generating these secret keys like this:
bash$ < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-64};echo;
- mysql> CREATE DATABASE jc_dev;
- mysql> CREATE DATABASE jc_test;
- export FLASK_APP=run.py
- flask db init
- flask db migrate
- flask db upgrade
- tox
- export FLASK_ENV=development
- export FLASK_APP=run.py
- py.test -v
- ./start.sh