Getting started


Install django-beam using pip:

pip install django-beam

Add beam, beam.themes.boostrap4 and crispy_forms to your INSTALLED_APPS in

# in your
    # ...

Quickstart example

Let’s say you have a list of books that you want to manage in your Django project. You can use django-beam to quickly create a list view, detail view, create view and update view for your books.

# books/
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/
import beam

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

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

from django.urls import path, include

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