Material Design for Django

Overview

Django Material

Material design for Django.

Join the chat at https://gitter.im/viewflow/django-material
  • Django-Material 1.7.x compatible with Django 1.11/2.0/2.1/2.2/3.0/3.1
  • Django-Material 1.6.x compatible with Django 1.11/2.0/2.1/2.2/3.0
  • Django-Material 1.[3,4,5].x compatible with Django 1.11/2.0/2.1/2.2
  • Django-Material 1.2.x compatible with Django 1.11/2.0
  • Django-Material 1.1.x compatible with Django 1.8/1.9/1.10/1.11

Tested with:

demo/static/img/browserstack_small.png

Overview

  • Forms - New way to render django forms
    • Strong python/html code separation
    • Easy redefinition of particular fields rendering
    • Complex form layout support
  • Frontend - Quick starter template for modular admin-line applications development

.screen.png

Demo

http://forms.viewflow.io/

To checkout and run open source demo version locally, you need to have git and tox tools installed.

git clone https://github.com/viewflow/django-material.git
cd django-material

TOXENV=py36-dj111 tox -- python manage.py migrate --settings=demo.settings
TOXENV=py36-dj111 tox -- python manage.py loaddata demo/fixtures/* --settings=demo.settings
TOXENV=py36-dj111 tox -- python manage.py runserver --settings=demo.settings

Then you can go to http://127.0.0.1:8000/integration/ and login with admin:admin username and password to the demo site.

Documentation

http://docs.viewflow.io/material_forms.html

License

Django Material is an Open Source project licensed under the terms of the BSD3 license

Django Material Pro with additional features has a commercial-friendly license. Check http:viewflow.io/pro/ for details.

Changelog

1.9.0 2020-04-30

  • Add support for attribute removing #500
  • Add support for groups in checkbox select multiple #436
  • Add basic support for ordering custom fields in list view #224
  • Change to lazy evaluation {{ modules }} context variable
Issues
  • Invalid template name in 'extends' tag: ''. Got this from the 'current_module.base_template' variable.

    Invalid template name in 'extends' tag: ''. Got this from the 'current_module.base_template' variable.

    hello guys, I created a module with manage.py startmodule applitest and i leave all by default and i uncomment default code in (models.py, urls.py and views.py) and everything was fine. But when go to localhost:8000/applitest/mymodel/ it throws TemplateSyntaxError.

    enhancement frontend 
    opened by TobinFrost 21
  • forms.MultipleChoiceField do no materializing

    forms.MultipleChoiceField do no materializing

    forms.MultipleChoiceField has no materialized implementation. It's standard widget. Django 1.9.2 django-material 0.5.1

    enhancement invalid forms 
    opened by voronind 18
  • WYSIWYG Editor support

    WYSIWYG Editor support

    I use TinyMCE, but it not working after I install django-material. Is it not support WYSIWYG Editor?

    enhancement forms frontend 
    opened by rewrz 15
  • Make list_actions consistent between ModelViewSet and ListMovelView

    Make list_actions consistent between ModelViewSet and ListMovelView

    ModelViewSet accepts list of tuples in format:

    list_actions = [
        ('Delete objects', DeleteView)
    ]
    

    Whereas the ListMovelView accepts in format:

    list_actions = [
        ('Delete objects', 'delete_view_url')
    ]
    

    A relatively easy fix should be to simply move the _get_actions, get_action_view_kwargs and get_action_view from ModelViewSet into ListMovelView because as default ModelViewSet uses ListMovelView as its list_view_class anyway. This would make it possible to use list_actions in ListMovelView with passing the view directly into it, rather than reversing the url regardless of whether the ListMovelView is used from ModelViewSet or independently.

    EDIT: Additionally, it would be nice to have template_name default to {model_name}_action_{action_name}.html (through get_template_names)

    EDIT 2: A has_action_permission should be added to BaseActionView which defaults to not requiring any permission. This makes it easy to e.g. restrict delete action to people with model's can_delete permission (which makes sense).

    opened by emihir0 13
  • Foreign Key Popup not opening in a new window

    Foreign Key Popup not opening in a new window

    Hi,

    When I've got a foreign key field, it's possible to "add" a new foreign key value. Normally with Django, it opens a new browser (target=blank).

    However, with Material, it just opens a new page- meaning you leave the original model you were trying to edit.

    I made a screenshot which should make more sense.

    Not sure if this is a one-off bug for me, or a project wide-issue...

    2016-06-28 at 3 21 10 pm

    bug admin 
    opened by yarnball 12
  • AjaxModelSelect OPTIONS header issue

    AjaxModelSelect OPTIONS header issue

    OPTIONS header is used for CORS and cannot be trusted for data transfer in request body.

    Eg. on AWS lambda request body is cleared with OPTIONS header. I've managed to override this by reading body from wsgi: request_body = request.environ['wsgi.input']

    Sadly, this is not the solution. Microsoft Edge 16 doesn't send request body with OPTIONS request. So AJAX widget is not usable on Edge at all. After all component should be using POST or GET for this. I suggest using POST with some kind of parameter and provide backward compatibility for OPTIONS. In JS with autocompleter initialization provide parametrization:

    var autocompleteType = <setting>;  // <-- this should be OPTIONS or POST. OPTIONS for backward compatibility.
    var url = '.';
    if (autocompleteType === "POST") {
       url = '.?autocomplete';
    }
    (...)
    .devbridgeAutocomplete({
      (...)
      serviceUrl: url,
      showNoSuggestionNotice: true,
      type: autocompleteType
    })
    

    That way we could use POST method for both POSTs and autocompletes using URL param.

    bug forms 
    opened by grzegorzbialy 11
  • When I click an item in dropdown selector , the item won't be selected

    When I click an item in dropdown selector , the item won't be selected

    for example ,in http://forms.viewflow.io/demo/bank/, when I click America in Nationality, America won't be choosed. My browser is Google Chrome v61.0.3163.100.

    bug forms 
    opened by liangWenPeng 10
  • v2: publish npm package

    v2: publish npm package

    Perhaps components from https://github.com/viewflow/django-material/tree/v2/material/static/material/components could be installed with npm install django-material, do you think this will be possible ?

    enhancement wontfix frontend 
    opened by jpic 10
  • Contributing by adding formsets: little bit of guidance

    Contributing by adding formsets: little bit of guidance

    Hi! First of all: awesome project, first thing i thought about when I learned about Google's Material design.

    I don't have an issue but I didn't know where to put this, so I figured I'd do it here.

    I'd like to build out some missing parts of the Admin, I want it in one of my projects and would love to be able to offer this design to my clients. I've forked and integrated the project as a dev version in a current project, and ran into the missing formsets thing and I'd like to start there!

    I was hoping someone could point me in the right direction for adding formsets, it would save me quite some time figuring out how the Admin internals work. If not, no problem, I'll do it anyway but it'll take me a little bit longer :) I'll take a look at the issues as well to see if I can fix a couple of them while I'm at it.

    I'd be happy to write a small contributing guide in the process to try to give the project a boost.

    Let me know if help is welcome!

    question 
    opened by Zowie 9
  • Multiple admin modules support

    Multiple admin modules support

    I have two custom admin modules, how can I apply material admin for both of them?

    enhancement admin postponed 
    opened by sysint64 9
  • Added inline style for checkbox

    Added inline style for checkbox

    null

    opened by marcelometal 0
  • Editable fields on list view

    Editable fields on list view

    It's posible to add fields directly editable on list view?

    Like django-admin ModelAdmin list_editable option.

    opened by rmosquera-aira 0
  • Filters defined in ModelViewSet's get_queryset method are not applied to Detail and Delete views

    Filters defined in ModelViewSet's get_queryset method are not applied to Detail and Delete views

    DetailModelView and DeleteModelView views don't have ModelViewMixin in them so they never call self.viewset.get_queryset() for pre-filtering in get_object(). As a consequence, ModelViewSets that don't define explicit permission checks do not list objects filtered out by get_queryset() but still allow to see them and delete (but not update as UpdateModelView has ModelViewMixin). This inconsistency makes me believe this is not intended behavior and looks like potential security hole.

    opened by ikseek 0
  • AjaxMultipleModelSelect rendering is unpolished

    AjaxMultipleModelSelect rendering is unpolished

    I'm having a few issues with the way that the AjaxMultipleModelSelect field is rendered.

    1. The label doesn't become active. It stays large and is positioned in the field. Clicking and typing into the field doesn't move the label to the top-left corner. The label ends up overlapping with the chips. See example from demo http://demo.viewflow.io/integration/sea/add/ image

    2. Original select field isn't hidden. The AjaxMultipleModelSelect field just renders below the default select field. May be an individual issue as this doesn't seem to be an issue in the demo. I've been writing my own JS function to hide the original select field (mimicking the behavior of AjaxModelSelect fields, which do render properly). image

    Otherwise been mostly happy with the library. Thank you!

    django-material-pro==1.7.6

    opened by Zenonquest 1
  • Theme - Difference Between Colors

    Theme - Difference Between Colors

    While using the themes I noticed that some of the color options don't have much difference, if any, between the primary and secondary color. The worst ones are: cyan, light green, and brown. Ones that are not quite as bad are: indigo, light blue, teal, and blue gray. The rest have great contrast!

    Then it seems like the themes excessively use the secondary color for most of the text, which is not how it displays in the demo application.

    Looking at the theme files it seems like there might be original files that the theme ones are generated off of? I am more than happy to work through and propose a fix for these items, but was curious if I might be able to get the original files which would make it a little easier.

    Screen Shot of lightgreen

    This is a screenshot showing the light green theme, and also how the secondary color is used for the sidebar as well as other text.

    opened by RedFrez 0
  • List view slow since 1.9.0

    List view slow since 1.9.0

    Not sure if this is something specific to my setup or not, but since updating to 1.9.0 list views with large amounts of data take a long time to load despite pagination. Perhaps it is related to #224 ?

    For example, loading a list that has 135700 entries, showing 100 at a time (1357 pages) 1.9.0: 23 Seconds 1.7.6: About 2.5 Seconds

    I've rolled by production system back 1.7.6 so no huge rush here. Thanks

    opened by SamuelLayNZ 0
  • suggestion for quickstart tutorial page

    suggestion for quickstart tutorial page

    I follwed along the official tutorial here, and when I ran ./manage.py makemigrations helloworld, django won't make migrations by giving me this error

    django.core.exceptions.ImproperlyConfigured: Cannot import 'helloworld'. Check that 'demo.helloworld.apps.HelloworldConfig.name' is correct.
    

    Turned out app name helloworld was not recognised, so I had to change apps.py like the following

    from django.apps import AppConfig
    
    
    class HelloworldConfig(AppConfig):
        default_auto_field = 'django.db.models.BigAutoField'
        # name = 'helloworld' 
        name = 'demo.helloworld'  # new
    

    And in demo/urls.py, I used path, rather than url. If a user uses django 3 version, path would be better in my opinion.

    from django.contrib import admin
    from django.urls import path, include
    from django.views import generic
    from material.frontend import urls as frontend_urls
    
    urlpatterns = [
        path('admin/', admin.site.urls),
        path('', generic.RedirectView.as_view(url='/workflow/', permanent=False)),
        path('', include(frontend_urls)),
     #]
    
    opened by harryghgim 0
  • Double InputHidden rendering

    Double InputHidden rendering

    Form:

    class ContactForm(ModelForm):
        scope_prefix = 'contact_data'
        form_name = 'contact_form'
    
        layout = Layout(
            Row('name', 'function'),
            Row('primary', 'user_pwd')
        )
    
        class Meta:
            model = Contact
            fields = ('name', 'function','primary', 'user_pwd')
    
        def __init__(self, *args, **kwargs):
            super(ContactForm, self).__init__(*args, **kwargs)
    
            if self.instance.pk:
                self.fields["user_pwd"].disabled = True
                if self.initial.get("primary"):
                    self.fields["primary"].disabled = True
            else:
                # self.fields["user_pwd"].widget = forms.HiddenInput()
                self.fields["user_pwd"].widget.attrs["type"] = "hidden"
                self.fields["user_pwd"].label = ""
    

    Output:

    image

    opened by nikolaysm 2
  • Disable deletion if model.PROTECTED fk linked

    Disable deletion if model.PROTECTED fk linked

    File "material/frontend/views/delete.py", line 47, in get_context_data
        kwargs.setdefault("deleted_objects", dict(self._get_deleted_objects()))
      File "material/frontend/views/delete.py", line 39, in _get_deleted_objects
        collector.collect([self.object])
      File "django/db/models/deletion.py", line 302, in collect
        raise ProtectedError(
    
    bug frontend postponed 
    opened by kmmbvnr 0
  • Theme static files not overwriting the the default ones

    Theme static files not overwriting the the default ones

    I know quite a few people reported the same warning message:

    Found another file with the destination path 'material/imgs/sidenav.svg'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
    Found another file with the destination path 'material/imgs/background.svg'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
    Found another file with the destination path 'material/css/materialize.frontend.min.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
    Found another file with the destination path 'material/css/materialize.frontend.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
    Found another file with the destination path 'material/css/materialize.forms.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
    Found another file with the destination path 'material/css/materialize.frontend.print.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
    Found another file with the destination path 'material/css/materialize.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
    0 static files copied to '/srv/www/pmas/public-www/static', 285 unmodified.
    

    But I am more concerned about the 0 static files copied, obviously the theme static files are not collected due to whatever reason. I have compared the static files from the server against the default theme and they are identical. I have made sure the theme is above the material app in INSTALLED_APPS

    Any ideas please?

    enhancement frontend postponed 
    opened by variable 2
Releases(1.1.0)
  • 1.1.0(Oct 27, 2017)

    Update MaterializeCSS to 0.100.2 Forms - Localize DateTime picker Forms - Add clear button on ajax autocomplete fields Frontend - Allow to set ordering in the list view from viewset Frontend - Fix permission check for the create view Admin - Fix inline formset errors Admin - Add file download link on the file fields

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(May 29, 2017)

    • Django 1.11 support
    • Update MaterializeCSS to 0.98.2
    • Fix missing badges in shipped MaterializeCSS build
    • Localization added: German/French/Spanish/Korean/Chinese
    • Forms - Fix allows using html in a help_text of widgets
    • Frontend - Improved Login/Logout/403/404/500 service screen templates
    • Admin - fix application list layout
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Mar 13, 2016)

    The last alpha release.

    • Forms - Fix controls in new forms in formsets
    • Forms - New way to append or override widget attrs in template
    • Forms - Removed group_class, add_group_class, add_label_class redifinable parts
    • Admin - Match table styles to google guidelines.
    • Admin - Start to work on admin widget support improvements http://forms.viewflow.io/demo/widget/admin/
    • Admin - Fix scrollbar
    • Frontend - Switch from fontawesome to material-design-iconic font
    • Frontend - Fix broken links on user navigation menu
    • Frontend - Modules are refactored to AppConfig mixins
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(May 11, 2015)

    • Migrated to new version of materializecss framework
    • List all applications in admin navigation menu
    • Added breadcrumbs in admin
    • Custom material css and js cleanup
    • New Frontend template
    • Various widget rendering fixes (splitdatetime, empty selects)
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Apr 3, 2015)

A cool, modern and responsive django admin application based on bootstrap 5

django-baton A cool, modern and responsive django admin application based on bootstrap 5 Documentation: readthedocs Live Demo Now you can try django-b

Otto srl 494 Oct 19, 2021
Collection of admin fields and decorators to help to create computed or custom fields more friendly and easy way

django-admin-easy Collection of admin fields, decorators and mixin to help to create computed or custom fields more friendly and easy way Installation

Ezequiel Bertti 328 Oct 15, 2021
django's default admin interface made customizable. popup windows replaced by modals. :mage: :zap:

django-admin-interface django-admin-interface is a modern responsive flat admin interface customizable by the admin itself. Features Beautiful default

Fabio Caccamo 947 Oct 22, 2021
WordPress look and feel for Django administration panel

Django WP Admin WordPress look and feel for Django administration panel. Features WordPress look and feel New styles for selector, calendar and timepi

Maciej Marczewski 259 Sep 13, 2021
Legacy django jet rebooted , supports only Django 3

Django JET Reboot Rebooting the original project : django-jet. Django Jet is modern template for Django admin interface with improved functionality. W

null 41 Oct 9, 2021
Extendable, adaptable rewrite of django.contrib.admin

django-admin2 One of the most useful parts of django.contrib.admin is the ability to configure various views that touch and alter data. django-admin2

Jazzband 1.1k Oct 19, 2021
Modern responsive template for the Django admin interface with improved functionality. We are proud to announce completely new Jet. Please check out Live Demo

Django JET Modern template for Django admin interface with improved functionality Attention! NEW JET We are proud to announce completely new Jet. Plea

Geex Arts 3.2k Oct 18, 2021
Django Smuggler is a pluggable application for Django Web Framework that helps you to import/export fixtures via the automatically-generated administration interface.

Django Smuggler Django Smuggler is a pluggable application for Django Web Framework to easily dump/load fixtures via the automatically-generated admin

semente 359 Sep 28, 2021
A Django app for easily adding object tools in the Django admin

Django Object Actions If you've ever tried making admin object tools you may have thought, "why can't this be as easy as making Django Admin Actions?"

Chris Chang 406 Oct 15, 2021
Extends the Django Admin to include a extensible dashboard and navigation menu

django-admin-tools django-admin-tools is a collection of extensions/tools for the default django administration interface, it includes: a full feature

Django Admin Tools 638 Oct 11, 2021
An improved django-admin-tools dashboard for Django projects

django-fluent-dashboard The fluent_dashboard module offers a custom admin dashboard, built on top of django-admin-tools (docs). The django-admin-tools

django-fluent 295 Sep 9, 2021
Extendable, adaptable rewrite of django.contrib.admin

django-admin2 One of the most useful parts of django.contrib.admin is the ability to configure various views that touch and alter data. django-admin2

Jazzband 1.1k Oct 15, 2021
Django application and library for importing and exporting data with admin integration.

django-import-export django-import-export is a Django application and library for importing and exporting data with included admin integration. Featur

null 2.2k Oct 21, 2021
Jazzy theme for Django

Django jazzmin (Jazzy Admin) Drop-in theme for django admin, that utilises AdminLTE 3 & Bootstrap 4 to make yo' admin look jazzy Installation pip inst

David Farrington 813 Oct 23, 2021
Responsive Theme for Django Admin With Sidebar Menu

Responsive Django Admin If you're looking for a version compatible with Django 1.8 just install 0.3.7.1. Features Responsive Sidebar Menu Easy install

Douglas Miranda 812 Sep 29, 2021
With Django Hijack, admins can log in and work on behalf of other users without having to know their credentials.

Django Hijack With Django Hijack, admins can log in and work on behalf of other users without having to know their credentials. Docs 3.x docs are avai

null 1k Oct 14, 2021
A jazzy skin for the Django Admin-Interface (official repository).

Django Grappelli A jazzy skin for the Django admin interface. Grappelli is a grid-based alternative/extension to the Django administration interface.

Patrick Kranzlmueller 3.1k Oct 15, 2021
Django Semantic UI admin theme

Django Semantic UI admin theme A completely free (MIT) Semantic UI admin theme for Django. Actually, this is my 3rd admin theme for Django. The first

Alex 33 Oct 18, 2021
Visually distinguish environments in Django Admin

django-admin-env-notice Visually distinguish environments in Django Admin. Based on great advice from post: 5 ways to make Django Admin safer by hakib

Yuri Shikanov 228 Oct 15, 2021