https://github.com/esimorre/django-flette
Minimalist wedding between django and flet
https://github.com/esimorre/django-flette
django flet fullstack-development purepython python rest-api
Last synced: 21 days ago
JSON representation
Minimalist wedding between django and flet
- Host: GitHub
- URL: https://github.com/esimorre/django-flette
- Owner: esimorre
- Created: 2024-10-16T08:04:32.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-20T09:34:08.000Z (over 1 year ago)
- Last Synced: 2025-02-25T16:24:11.326Z (over 1 year ago)
- Topics: django, flet, fullstack-development, purepython, python, rest-api
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# django-flette
Minimalist wedding between django and flet
[Live demo](https://ricocs.alwaysdata.net/)
Implementation of a minimalist pure python frontend/backend POC based on django and flet
* no DRF but a simple json view
* reuse of the flet "todo" sample
* a unique API function: initial loading of tasks corresponding to the names of django groups in base
## flet client generation
```python
# can modify this in todo/main.py
API_URL = "https://MYSITE/api/"
# or with same origin
API_URL = None
```
```bash
cd todo
# --web-renderer html : lighter client
flet build web --base-url frontend --web-renderer html -o ../static/web
cd ..
zip static
```
## Installation (dev local)
```bash
python manage.py migrate
# populate: user admin(admin) & groups/tasks
python manage.py loaddata data.yaml
# frontend & backend (same origin)
python manage.py runserver
# separate frontend (desktop mode)
flet run -p 8001 main.py
# separate frontend (browser)
flet run -p 8001 --web main.py
```
## Deployement
```bash
wget https://github.com/esimorre/django-flette/archive/refs/heads/master.zip
unzip master.zip
(build venv)
pip install django==5.0 pyYAML
get static.zip
unzip static.zip -d ROOT_PROJECT
# Apache: static pathes
#/frontend/admin/=/.venv/lib/python3.12/site-packages/django/contrib/admin/static/admin/
#/frontend/=/ROOT_PROJECT/static/web/
```