Skip to main content

Engine to create database applications based on Django and the IBM Carbon Design System

Project description

CI Documentation Status Translation status

Documentation

Documentation is hosted at readthedocs.io

BREAD Engine

This package provides functionality to create django database applications in a quick and customizable way. Similar concept are CRUD (create-read-update-delete) frameworks or RAD (rapid application development) tools. BREAD is also partly a replacement of the django-admin interface, however, there is no API compatability to it.

Installation

pip install basx-bread

Quickstart

The following are the required step to get a new project quickly up and running. For seasoned Django users there should be nothing new for the most parts. In that case only the section Registering the UI might be worth reading.

Setup

    python3 -m venv .venv
    . .venv/bin/activate # this is for bash, for windows use the script .venv/bin/Activate.ps1, there are also scripts for csh and fish
    pip install basx-bread # should run without problems, but users reported problems in some Mac setups due to native libraries missing
    django-admin startproject --template .venv/lib/pythonX.Y/site-packages/bread/resources/project_template/ myproject . # template-file path depends on the python version

    # adding a Django "app", Django projects consist of different apps with different models, pretty standard
    # can also be achieved with "python manage.py startapp mymodels" but it would create a few unnecessary files
    mkdir mymodels mymodels/migrations
    touch mymodels/__init__.py mymodels/migrations/__init__.py
    echo -e 'from django.apps import AppConfig\n\n\nclass Mymodels(AppConfig):\n    name = "mymodels"' > mymodels/apps.py

After this the file mymodels/models.py needs to be created and filled with your database models. Then add "mymodels" to the list of INSTALLED_APPS inside myproject/settings/base.py.

Registering the UI

In order to get started with the UI quickly the following code can be put into mymodels/urls.py. The code below assumes there exists a single model inside mymodels/models.py called MyModel.

    from bread.utils import quickregister
    from . import models

    urlpatterns = []
    quickregister(urlpatterns, models.MyModel)

The root URL list in myproject/urls.py needs to be extended with an item path("myapp", include("mymodels.urls")).

Running the application

Finally run the following commands to initialize the database and start the development server.

    python manage.py makemigrations
    python manage.py migrate
    python manage.py createsuperuser
    python manage.py runserver

The application can now be accessed via http://127.0.0.1:8000.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

basx-bread-0.4.34.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

basx_bread-0.4.34-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

File details

Details for the file basx-bread-0.4.34.tar.gz.

File metadata

  • Download URL: basx-bread-0.4.34.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for basx-bread-0.4.34.tar.gz
Algorithm Hash digest
SHA256 a3d882fbd48150ae056b7e83ca7ca780654fad0b3d31af284da52fc5e0404dc1
MD5 c487d7322125c1dac1a4e960f80aac30
BLAKE2b-256 1aa4bb7eb226322ea8001a139dbf27ad2dcea6a83c2908b3bc943447f5839790

See more details on using hashes here.

File details

Details for the file basx_bread-0.4.34-py3-none-any.whl.

File metadata

  • Download URL: basx_bread-0.4.34-py3-none-any.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for basx_bread-0.4.34-py3-none-any.whl
Algorithm Hash digest
SHA256 768b41064b65d3c82ae73cb2c1cc68fe81fff18f702eba7a788b4ccec823d853
MD5 6840b7473ff1ff95597fc5680346726b
BLAKE2b-256 71d1d861f7abd73f8e404f411e3359169ea4d49502190b84f81ae37f15756b39

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