climate-tech-handbook / data-magic

Scripts and other fun tricks to enhance the site
MIT License
10 stars 5 forks source link

use bluepront to organise routes #28

Closed shreeup closed 1 year ago

shreeup commented 1 year ago

@bigolboyyo / @futuresoup Could you please review changes? Or you think should i go ahead and merge

bigolboyyo commented 1 year ago

@shreeup | @futuresoup | @howard989

Thanks Shree, great work!

This is a great start. I've been tinkering with this as well and have worked out some additional error handling I will pull later.

Did you test and make sure this runs and works before submitting?

I recommend checking out asyncio if you run into async issues.

Remember to properly utilize init.py files to prevent circular imports

And lastly if you want to get crazy with the power of Flask check out Application Factories

shreeup commented 1 year ago

I am seeing an error in when i try to run flask run. Please find debug trace below


(venv) shree@rahuls-mac-mini app % flask run --debug
/Users/shree/Downloads/OpenSource/ClimateTech-data-magic/app/api
Usage: flask run [OPTIONS]
Try 'flask run --help' for help.

Error: While importing 'app.app', an ImportError was raised:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.10/site-packages/flask/cli.py", line 218, in locate_app
    __import__(module_name)
  File "/Users/shree/Downloads/OpenSource/ClimateTech-data-magic/app/app.py", line 9, in <module>
    from utils.utils import get_env_vars, create_generator
ModuleNotFoundError: No module named 'utils'

I am trying to fix this issue.

shreeup commented 1 year ago

proof of testing

image