GithubHelp home page GithubHelp logo

Comments (3)

briancappello avatar briancappello commented on August 10, 2024

Hi @nielslerches, thanks for the report! I think this is maybe both a bug and a case of missing documentation :)

The Admin Bundle includes its own AdminSecurityController - which is the same as the regular SecurityController, except it is configured to use admin-specific templates. This should be included in your declarative routes like so:

# your-project/your_app_bundle/routes.py

from flask_unchained import (controller, resource, func, include, prefix,
                                get, delete, post, patch, put, rule)

routes = lambda: [
  # ...
  include('flask_unchained.bundles.admin.routes'),
]

And then, if you take a look at flask_unchained/bundles/admin/routes.py, the endpoint names must also be configured to match:

# your-project/your_app_bundle/config.py
from flask_unchained import BundleConfig

class Config(BundleConfig):
  ADMIN_LOGIN_ENDPOINT = 'admin.login'
  ADMIN_LOGOUT_ENDPOINT = 'admin.logout'

Hopefully that gets it working as expected?

from flask-unchained.

nielslerches avatar nielslerches commented on August 10, 2024

Yes, this solves the problem :)

from flask-unchained.

briancappello avatar briancappello commented on August 10, 2024

Hi @nielslerches, I've just pushed a new release, v0.8.1, that fixes this and a few other bugs I discovered playing around with the Admin Bundle. It also adds a couple new features, for example better integrating the Security Bundle with the Admin interface by adding ModelAdmins for the User and Role classes. Apologies for the delay in getting this pushed and please do let me know if you encounter any other issues and/or have any questions - I'll do my best to answer them as quickly as I can! Thanks again :)

from flask-unchained.

Related Issues (11)

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.