A template for quickly prototyping web applications using FastAPI, Django, and HTMX.
- FastAPI: For creating high-performance APIs.
- Django: Used for its excellent admin interface.
- HTMX: For accessing AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML.
- Hyperscript: For script and style as HTML attributes.
- Supabase: Used as a database. This template does not use its auth layer and instead relies on Django's auth because of its admin interface.
- Click the "Use this template" button to create a new repository with the same files and folders as this template.
- Clone your newly created repository.
- Install the required packages by running
pip install -r requirements.txt
. - Set up your Supabase database and configure the settings in your project accordingly.
- Run the FastAPI application.
- Access the Django admin interface and set up your admin user and other configurations.
- Supabase: Set up your Supabase database and configure the
SUPABASE_URL
andSUPABASE_KEY
in your project settings. - Django: Configure the Django settings as you normally would. Make sure to set up the Django admin user so you can access the admin interface.
Run the FastAPI application using uvicorn
:
uvicorn main:app --reload
This will start the FastAPI application with hot-reloading enabled.
- FastAPI application: Access the FastAPI application by navigating to
http://127.0.0.1:8000
in your browser. - Django admin interface: Access the Django admin interface by navigating to the admin URL configured in your Django settings.
If you have any ideas, just open an issue and tell me what you think.
If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.