Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justmars/django-entries
Generic reusable title-description-content CRUD on Django.
https://github.com/justmars/django-entries
Last synced: 3 days ago
JSON representation
Generic reusable title-description-content CRUD on Django.
- Host: GitHub
- URL: https://github.com/justmars/django-entries
- Owner: justmars
- License: bsd-3-clause
- Created: 2021-12-04T07:39:18.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-24T10:55:13.000Z (over 1 year ago)
- Last Synced: 2024-10-11T07:53:27.188Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 207 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# django-entries
## Overview
Basic create-read-update-delete (CRUD) functionality for an `Entry` model.
The base [template](./entries/templates/base.html) makes use of light css and javascript:
1. `starter.css` [stylesheet](./entries/static/css/starter.css)
2. `pylon` 0.1.1 for `` and `` layouts
3. `htmx` 1.6.1 for html-over-the-wire functionality, e.g. [infinite scrolling](./entries/docs/infinity_scroll.md)
4. `hyperscript` 0.9 for client-side reactivity
5. `simplemde` a simple markdown editor## Quickstart
Install in your virtual environment:
```zsh
.venv> pip3 install django-entries # poetry add django-entries
```Include package in main project settings file:
```python
# in project_folder/settings.py
INSTALLED_APPS = [..., "django_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 # newurlpatterns = [
...,
path("entry/", include("django_entries.urls")), # new
path(
"", TemplateView.as_view(template_name="home.html")
), # (optional: if fresh project install)
]
```Add to database:
```zsh
.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:
```zsh
.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
```zsh
.venv> pytest
```