Code Monkey home page Code Monkey logo

django-dynamic-admin's People

Contributors

ahivert avatar gitron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

django-dynamic-admin's Issues

Security vulnerability in urls.py

The installation guide mentions adding dynamic_admin_forms.urls to urls.py.

However, doing this will mean that the URL can be accessed by anyone, even those who are not admin users. This will render the widget in the browser and potentially expose sensitive information.

I have modified the package to define the URLs within a custom admin site:

class CustomAdminSite(AdminSite):
    def get_urls(self):
        urls = super().get_urls()
        my_urls = [
            path("dynamic-admin-form/<app_label>/<model_name>/<field_name>/",
                 self.admin_view(CustomDynamicModelAdminMixin.render_field))
        ]
        return my_urls + urls

Wrapping the view in self.admin_view adds Django's security checks, meaning only users with access to the admin dashboard can call the URL.

I needed to modify the mixin to target the custom admin site, rather than the default, and the JS file to reflect the new admin URL.

Be able to customize url

The url currently used is hard coded. We should be able to let the user set the whole url or at least a prefix.

It makes sense to have GET requests sent to this url /admin/dynamic-admin-form/?${params}

Complete support for select2 widgets

Currently, select2 widgets will be replaced by normal select elements when the field rerenders. It would however be nice to update the widgets option instead of replacing it.

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.