GithubHelp home page GithubHelp logo

ghostsarah0042 / django-dynamic-datatb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from app-generator/django-dynamic-datatb

0.0 0.0 0.0 114 KB

Django Dynamic Datatables - Open-Source Library | AppSeed

Home Page: https://pypi.org/project/django-dynamic-datatb/

License: MIT License

JavaScript 47.13% Python 34.03% CSS 1.05% HTML 17.79%

django-dynamic-datatb's Introduction

Open-Source library for Django that provides a powerful data table interface (paginated information) with minimum effort - actively supported by AppSeed.


Features

  • Modern Stack: Django & VanillaJS
  • DT layer provided by Simple-DataTables
  • Server-side pagination
  • Search, Filters
  • Exports in PDF, CSV formats
  • MIT License (commercial use allowed)

Django Dynamic DataTables - Open-Source tool provided by AppSeed.


How to use it


Step #1 - Install the package

$ pip install django-dynamic-datatb
// OR
$ pip install git+https://github.com/app-generator/django-dynamic-datatb.git

Step #2 - Update Configuration, add new imports

import os, inspect
import django_dyn_dt

Step #3 - Update Configuration, include the new APPs

INSTALLED_APPS = [
    'django_dyn_dt',  # <-- NEW App
]

Step #4 - Update Configuration, include the new TEMPLATES DIR

TEMPLATE_DIR_DATATB = os.path.join(BASE_DIR, "django_dyn_dt/templates") # <-- NEW App

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [TEMPLATE_DIR_DATATB],                                  # <-- NEW Include
        "APP_DIRS": True,
        "OPTIONS": {
        },
    },
]

Step #5 - Update Configuration, update STATICFILES_DIRS DIR

DYN_DB_PKG_ROOT = os.path.dirname( inspect.getfile( django_dyn_dt ) ) # <-- NEW App

STATICFILES_DIRS = (
    os.path.join(DYN_DB_PKG_ROOT, "templates/static"),
)

Step #6 - Register the model in settings.py (DYNAMIC_DATATB section)

This sample code assumes that app1 exists and model Book is defined and migrated.

DYNAMIC_DATATB = {
    # SLUG -> Import_PATH 
    'books'  : "app1.models.Book",
}

Step #7 - Update routing, include APIs

from django.contrib import admin
from django.urls import path, include         # <-- NEW: 'include` directive added

urlpatterns = [
    path("admin/", admin.site.urls),
    path('', include('django_dyn_dt.urls')),  # <-- NEW: API routing rules
]    

Step #8 - Use the Dynamic Datatable module

If the managed model is Books, the dynamic interface is /datatb/books/ and all features available.


Django Dynamic DataTables - Open-Source Tool for Developers.


Links & resources



Django Dynamic DataTables - Open-source library provided by AppSeed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.