Creating a Python-backed front end, featuring FastAPI, htmx, and TailwindCSS.
- π Table of Contents
- π§ About
- π Getting Started
- π§ Running the tests
- π Usage
- π Deployment
- βοΈ Built Using
- βοΈ Authors
- π Acknowledgements
Build a beautiful web application using nothing more than Python, htmx, and TailwindCSS. Harness the power of Jinja templates and server-side rendering to create a dynamic, REST-ful web app.
This repository was prepared as part of a workshop on how to create a python-backed front end, featuring Jinja templates for HTML rendering, TailwindCSS for style, and htmx for pizzazz! π
The main branch contains the "starter" app, which lacks all of the features. It only contains a basic FastAPI "Hello, World!" application. Each subsequent branch contains more features. If you want the fully-featured application, switch to the appropriate branch and select "Use This Template" (make sure to only clone the "current" branch).
Your only requirement is to have Python 3.11 (or later) installed locally. The rest of the dependencies are in the pyproject.toml
file, as well as the requirements.txt
file.
Why both? If you use a package manager (i.e., I use
pdm
), you can use your package manager to install dependencies from thepyproject.toml
. Otherwise, you can go the more traditional route using therequirements.txt
file.
If you have a package manager, you can use that to install directly from the pyproject.toml
file. Otherwise, you can go the traditional rout (see below).
After cloning the repo locally, you will need to create a virtual environment. Navigate to the location where you have cloned the project and run the following command:
python -m venv .venv
This will create a .venv
directory within your project.
Next, activate your environment:
# On Windows
.\.venv\Scripts\activate
# On MacOS/Linux
$ source myvenv/bin/activate
Then, install the requirements:
python -m pip install -r requirements.txt
After activating your virtual environment, you can run tests by typing pytest
on the command line.
pytest
If everything has gone well so far, all tests should pass.
This repo was created primarily to aid in a workshop setting, so your mileage may vary. Feel free to clone the repo and make it your own. But most of all, have fun! π₯³
- Coming Soon
- FastAPI
- Jinja2
- TailwindCSS
- HTMX
- @tataraba - Mario Munoz, Python By Night
- Coming soon