Demo application for Wireup, a Python dependency injection library.
Demo contains a Flask application and a set of commands using Click. The web application and commands share the same service layer using Wireup.
This is intended as a demo to showcase various aspects of wireup. Feel free to explore and play around with to get familiar with the library.
demoapp/app.py
- Flask app initialization.demoapp/cli.py
- Cli for this application via Click.demoapp/service
- Service declaration.demoapp/blueprint
- Autowiring api views.test
- Tests. Various examples on testing the services in isolation.
python -m demoapp.cli
- Create initial db with
python -m demoapp.cli create-db
- Add a blog post
python -m demoapp.cli create-post "Hello World" "This is my first blog"
FLASK_APP=demoapp/app.py python -m flask run