项目
在 GitHub 查看
marty331/fasthtmx
关于
FastAPI-HTMX 演示项目
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Fast-HTMX
Description
Fast-HTMX is a demo project of FastAPI and HTMX. The purpose of this project is to illustrate how to create a website with no JavaScript, using only HTML, CSS, and Python. HTMX is a plugin that allows this to be possible.
HTMX Attributes
The following HTMX attributes are used in this project:
- hx-get
- hx-post
- hx-trigger
- hx-target
- hx-push-url
- hx-indicator
- hx-swap
Structure
db - Database setup
models - Data models
schema - Pydantic models
services - Database services
static - Static files
templates - Contains files for each page and partials for all partial pages that are related to the main page of the directory which it is under.
viewmodels - View models for gathering data for pages and partials.
main.py - Main operational file for running FastAPI.
How to run
- Create virtual environment
- Activate virtual environment
- Install requirements
pip3 install -r requirements.txt - Run project
python3 -m uvicorn main:app --reloadUsing Docker
- Build image
docker build -t fast-htmx . - Create Database
touch sql_app.db - Run container
docker run -v $(pwd)/sql_app.db:/code/sql_app.db -d --name fast-htmx -p 8000:8000 fast-htmx
- Build image
探索相关项目
加载中…