Skip to main content

A crud library for python

Project description

django-beam CI ReadTheDocs codecov

django-beam provides you with a set of views, templates, and integrations for the most common CRUD applications. It aims to offer the functionality of Django's own admin but in a way that integrates seamlessly with your frontend code.

Breaking changes

In version 3.0 Component was renamed to Facet in order to reduce confusion with web components.

Features

  • CRUD operations based on class-based views
  • Easily extensible
  • Extensions for common use cases and popular third-party packages

Documentation

The full documentation can be found at https://django-beam.readthedocs.io/en/latest/.

Quickstart

To get started, you'll need to follow these steps:

  1. Install django-beam:
pip install django-beam
  1. Add "beam" and "crispy_forms" to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
    # ...
    "beam",
    "beam.themes.bootstrap4",
    "crispy_forms",
]
  1. Import and use beam in your Django project, as shown in the example below:
# books/models.py
from django.db import models

class Book(models.Model):
    title = models.CharField(max_length=255)
    author = models.ForeignKey("Author", on_delete=models.CASCADE, related_name="books")


class Author(models.Model):
    title = models.CharField(max_length=255)

# books/views.py
import beam

class BookViewSet(beam.ViewSet):
    model = Book
    fields = ['title', 'author']

class AuthorViewSet(beam.ViewSet):
    model = Author
    fields = ['title']

# urls.py
from django.urls import path, include

urlpatterns = [
    path('books/', include(BookViewSet().get_urls())),
    path('authors/', include(AuthorViewSet().get_urls())),
    # ...
]

For more examples and detailed explanations of various django-beam features, refer to the full documentation.

beam.contrib

The beam.contrib package provides integration with several third-party Django apps, such as:

  • beam.contrib.auth: Viewsets for editing users and groups, and optional templates for default Django registration views.
  • beam.contrib.autocomplete_light: Integration with django-autocomplete-light.
  • beam.contrib.reversion: Experimental integration with django-reversion.

Refer to the documentation for usage instructions on each of the contrib packages.

Testing

You can use the tox testing tool to run the tests:

tox -e py312-django_latest

Run the tests of a specific test file only:

tox -e py312-django_latest -- test_tags

Run against all supported versions of Python and Django:

tox

Support

If you encounter any issues or have questions, please refer to the django-beam documentation or raise an issue on the GitHub repository.

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_beam-3.0.0.tar.gz (102.5 kB view details)

Uploaded Source

File details

Details for the file django_beam-3.0.0.tar.gz.

File metadata

  • Download URL: django_beam-3.0.0.tar.gz
  • Upload date:
  • Size: 102.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for django_beam-3.0.0.tar.gz
Algorithm Hash digest
SHA256 f6bb1b77859172fee3edee39b072e83e85b3c8a98bed94909edc68d3c8d4333e
MD5 8c242af881974012b0d830b5086597d1
BLAKE2b-256 82f2976578932ca2bae749b9f178af96527c9d4e9bc3d97842dcc9b3f5af4e24

See more details on using hashes here.

Supported by

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