This repository was created before the Esmerald directives were created and added to its core.
Now that is in place for also quite some time, this repository no longer needs updating and you can also check an example using the directives about how to generate a similar project to this one.
Esmerald also became something bigger, better and with greater support so this repository no longer makes sense in bigger picture.
Cookiecutter serving as base for projects using tortoise (or any other ORM, really) with deployment configurations
This cookiecutter served by Esmerald serves the purpose of a scaffold example for an application using:
Brings also an initial migration using Esmerald supported tables.
- Python 3.8+.
- Esmerald.
- Virtual environment.
- Docker
- Cookiecutter
$ cookiecutter https://github.com/dymmond/esmerald-tortoise-nginx-gunicorn-supervisor
After creating a virtual environment at your choice.
make requirements
- Installs the requirements to run the development environment.docker compose up
- Starts the docker compose for databases and redis.make upgrade
- Runs the migrations against the database.make run
- Starts the development environment with the development settings.
You can now access the http://localhost:8000
INFO: Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)
INFO: Started reloader process [28061] using WatchFiles
INFO: Started server process [28063]
INFO: Waiting for application startup.
Every project has its own strategy but this cookiecutter brings a deployment
folder containing
all the files needed and prepared for the nginx, supervisor and gunicorn used for a deployment
as well as a Dockerfile
prepared to be built.
Once the cookiecutter is installed some endpoints can be use to verify if it is working.
You can access the application docs via:
This is not mandatory to be used and serves as quick entry point for applications that need to be deployed in a production environment and helps speeding up the process. Feel free to discard what is not needed.