Make sure that you have Python 3.7 or later installed.
You can use pipenv.
Go to project directory and run command (you can replace 3.7
by Python version you've installed).
pipenv --python 3.7
pipenv install
If you don't have MySQL then you can use dockerized version:
docker run -p 3306:3306 --name tortoise-example-mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:8.0
docker start tortoise-example-mysql
Get your container id (docker ps
) and connect to container:
docker exec -it [container_id] mysql -uroot -proot
Run following queries to create user and databases:
CREATE DATABASE IF NOT EXISTS tortoise;
CREATE DATABASE IF NOT EXISTS alchemy;
CREATE USER 'test_user'@'%' IDENTIFIED BY 'test1234';
GRANT ALL PRIVILEGES ON tortoise.* TO 'test_user'@'%';
GRANT ALL PRIVILEGES ON alchemy.* TO 'test_user'@'%';
Go to src_tortoise
directory.
Activate venv:
pipenv shell
Run migrations:
aeris upgrade
Install fixtures:
python app.py init
Activate venv if you haven't done that before:
pipenv shell
Run server:
python app.py
Open http://localhost:8080/user
in your web browser.
- GET
/user
- list of users withusername
andemail
- GET
/user/name
- list of usernames - GET
/user/full
- list of users with assigned groups and addresses
Go to src_alchemy
directory.
Activate venv:
pipenv shell
Run migrations:
alembic upgrade head
Install fixtures:
python app.py init
Activate venv if you haven't done that before:
pipenv shell
Run server:
python app.py
Open http://localhost:8080/user
in your web browser.
- GET
/user
- list of users withusername
andemail
- GET
/user/name
- list of usernames - GET
/user/full
- list of users with assigned groups and addresses