POC of a simplified -but full featured- API for camptocamp.org
Requirements: python and docker
./scripts/install_dev_env.sh
This command will create a python virtual environments, upgrade pip and setup tools and then install the project in edition mode. Windows users, you must use .\scripts\install_dev_env.bat
(to be tested though).
Before starting edition/tests, you must activate the environment and have a redis on port 6379 and a postgresql on port 5432. It can be easily achievied with:
source venv/bin/activate # activate the environment (if it's not automatic, see IDE section)
docker-compose up -d # start redis and postgresql
flask_camp init_db # init the database, only if you want to run the app
The first run may take a while ☕
flask run
If it's not done, run flask_camp init_db
to init the database (be carefull, the test suite totally clean it on each run)
pytest
And a little bit more friendly, the test tab in VScode!
💡 The test suite totally clean the database it on each run. You may need to re-run flask_camp init_db
before re-running the app. Though, your modification should be tested using the test suite, so it may not happen so often. 💡
The repo is configured to be working out-of-the box with VSCode with python/pylance extension. But feel free to use/add another conf for your favorite IDE.
TODO