Django CRUDgen
📌 Introduction
django-crudgen is a Django package that automatically generates CRUD views and templates for your Django models. Just install the package, add it to INSTALLED_APPS, and let it handle the repetitive CRUD work for you!
🚀 Installation
Install the package using pip:
pip install crudgen
Then, add crudgen to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
...,
"crudgen", # Enable the package
]
🛠 Usage
1️⃣ Register the CRUD views for your models
In your urls.py, import and use the generate_crud_urls function:
from django.urls import path, include
from crud_builder.generators import generate_crud_urls
from myapp.models import MyModel
urlpatterns = [
path("mymodel/", include(generate_crud_urls(MyModel, "my_app_name"))),
]
This will automatically create URLs for listing, creating, updating, and deleting MyModel objects.
2️⃣ Access the CRUD Views
Once the URLs are registered, you can access them via:
http://127.0.0.1:8000/mymodel/(List view)http://127.0.0.1:8000/mymodel/create/(Create view)http://127.0.0.1:8000/mymodel/<int:pk>/(Detail view)http://127.0.0.1:8000/mymodel/<int:pk>/update/(Update view)http://127.0.0.1:8000/mymodel/<int:pk>/delete/(Delete view)
3️⃣ Customize Templates
The package provides default templates inside:
crud_builder/templates/crud_builder/
You can override them by creating your own templates in your app's templates/ directory.
📜 License
This package is licensed under the MIT License.
❤️ Contributing
Feel free to submit issues and pull requests on GitHub!
📬 Contact
For any questions, reach out at mohammadh.khoddami@gmail.com.
Release files for django-crudgen 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_crudgen-0.1.0.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_crudgen-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / django_crudgen-0.1.0.tar.gz
| Download URL | django_crudgen-0.1.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94a713b8ee9fd21cdaae1acd91b1d105c7569e580d26a7c8a3d20d0496e988c5
|
|
BLAKE2b-256 checksum How to use checksums |
f8ee60eec41d3c494618973b289febc419e0dda8024128308a71ddd5c0930acb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / django_crudgen-0.1.0-py3-none-any.whl
| Download URL | django_crudgen-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb29e0f1f0872369172f8dc124f6e9484d20a4c7c84a0eb27e79272bc1c85849
|
|
BLAKE2b-256 checksum How to use checksums |
98a4250a8cb4eca95b529095477fc11a07247dfd457625af65bd19f55bd39d7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|