Project to build APIs of 3rd level Steps to run this project:
- install poetry: pip install poetry
- git clone https://github.com/IDEHCO3/hyper-resource-sanic
- Inside hyper-resource-sanic folder, via cmd/shell, execute: poetry install
- In hyper-resource-sanic folder, via cmd/shell, using reverse engineerings in database such as postgres, execute: python hrcodegen.py --schema a_schema postgresql://an_user_name:a_password@a_host:a_port/a_database --outfile ./generator/all_models.py
4.1 Example: python hrcodegen.py --schema public postgresql://postgres:12345@127.0.0.1:5432/postgres --outfile ./generator/all_models.py - Inspect and if necessary adjust, the file all_models.py that was generated in folder generator. For example, rename classes or attributes or remove.
- Still in hyper-resource-sanic folder, execute:
python -m generator.generate_all_files
6.1 By default get, head and options is generated. To generating patch/put, post and delete execute: python -m generator.generate_all_files True True True - In hyper-resource-sanic folder modify the file .env and configure to your database (if necessary). See the environment variable URLDB.
- In hyper-resource-sanic folder execute: python -m src.index See in http://127.0.0.1:8000/
If you don't have GDAL lib or python GDAL bindings installed in your environment probrably will face similar probrems like the following
Try to solve this executing the following commands: