Skip to main content

A simple package to generate CRUD views for Django models.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_crudgen-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_crudgen-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file django_crudgen-0.1.0.tar.gz.

File metadata

  • Download URL: django_crudgen-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for django_crudgen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 94a713b8ee9fd21cdaae1acd91b1d105c7569e580d26a7c8a3d20d0496e988c5
MD5 476a64d0773ca643796b19b975a94c73
BLAKE2b-256 f8ee60eec41d3c494618973b289febc419e0dda8024128308a71ddd5c0930acb

See more details on using hashes here.

File details

Details for the file django_crudgen-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_crudgen-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for django_crudgen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb29e0f1f0872369172f8dc124f6e9484d20a4c7c84a0eb27e79272bc1c85849
MD5 332d232c3d13a482b11d79cc3d5a6058
BLAKE2b-256 98a4250a8cb4eca95b529095477fc11a07247dfd457625af65bd19f55bd39d7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page