Entries is a helper Django app with CRUD functions based on htmx.
Project description
django-entries
Overview
Basic create-read-update-delete (CRUD) functionality for an Entry
model.
The base template makes use of light css and javascript:
starter.css
stylesheetpylon
0.1.1 for<hstack>
and<vstack>
layoutshtmx
1.6.1 for html-over-the-wire functionality, e.g. infinite scrollinghyperscript
0.9 for client-side reactivitysimplemde
a simple markdown editor
Quickstart
Install in your virtual environment:
.venv> pip3 install django-entries # poetry add django-entries
Include package in main project settings file:
# in project_folder/settings.py
INSTALLED_APPS = [
...,
'crispy_forms', # add crispy_forms at least > v1.13, if not yet added
'entries' # this is the new django-entries folder
]
# in project_folder/urls.py
from django.views.generic import TemplateView
from django.urls import path, include # new
urlpatterns = [
...,
path('entry/', include('entries.urls')), # new
path("", TemplateView.as_view(template_name="home.html")), # (optional: if fresh project install)
]
Add to database:
.venv> python manage.py migrate # adds the `Entry` model to the database.
.venv> python manage.py createsuperuser # (optional: if fresh project install)
Login to add:
.venv> `python manage.py runserver`
# Visit http://127.0.0.1:8000/entry/entries/list
# Assumes _entry_ as folder in config/urls.py
# The `Add entry` button is only visible to logged in users.
# Can login via admin using the superuser account http://127.0.0.1:8000/admin/
# Visit the list page again at http://127.0.0.1:8000/entry/entries/list to see the `Add entry` button.
Test
.venv> pytest --ds=config.settings --cov
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-entries-0.1.11.tar.gz
(48.8 kB
view hashes)
Built Distribution
Close
Hashes for django_entries-0.1.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe6f2320a2235d4d9227e207a35c64dca2da35983877abe204b3a74a2e27fb3c |
|
MD5 | 13b88c69c5d305b07ecdb0f7cbe39096 |
|
BLAKE2b-256 | 510109611eb2abd00c8beaf0052e57247948d31129475285391437f4e3255b93 |