Skip to main content

Library to bind Django models with NiceGUI elements using DRF and SSE.

Project description

Installation:

pip install django-nice

Usage:

set these settings in your settings.py file:

from django_nice.config import Config

# Configure the base URL (host) for the API
Config.configure(host='http://your-production-server.com', api_endpoint='/api')

add these to your projects urls.py file:

from django_nice.config import Config

# Register API and SSE endpoints for a model (e.g., Data model in app 'myapp')
Config.add_urls_to_project(urlpatterns, app_label='myapp', model_name='Data')

then use inside your NiceGUI component like this:

from nicegui import ui
from django_nice.frontend import bind_element_to_model

@ui.page('/')
def index():
    textarea = ui.textarea('This is data that is bound to the django model').classes('w-full')
    bind_element_to_model(textarea, app_label='myapp', model_name='Data', pk=1, field_name='data_to_display')

ui.run()

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

django_nice-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

django_nice-0.1.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_nice-0.1.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for django_nice-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b120e7a5c11f6b2f5184e70fb4103d122a69a688fda130b3aa6804570ca0d76
MD5 96ac75ba2e656cb6bfa3983ee0762a61
BLAKE2b-256 26825251bcbe8e18409fbaab9199645c5077b25df661e4566c868752a61afec2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_nice-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for django_nice-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac11d15c4006beef232294099057a5351e140b8b045f0dfc2313998205b2e35e
MD5 6410fe3a98f436de6ed8e6b82c8c01d7
BLAKE2b-256 a62c6af268ca3827be683b8f532ec3ce0036f598fe33a21e6a36d3c544b074e7

See more details on using hashes here.

Supported by

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