Code Monkey home page Code Monkey logo

Comments (3)

fsbraun avatar fsbraun commented on May 19, 2024

@MrUsiPusi Thank you! Well spotted! django CMS checks both the "old" MIDDLEWARE_CLASSES and the "new" MIDDLEWARE. Since MIDDLEWARE_CLASSES was removed in Django 2 (I think), django CMS will only need to check for MIDDLEWARE and adjust its error messaeg accordingly.

if getattr(settings, 'MIDDLEWARE', None):
middlewares = settings.MIDDLEWARE
else:
middlewares = settings.MIDDLEWARE_CLASSES
for middleware in required_middlewares:
if middleware not in middlewares:
section.error("%s middleware must be in MIDDLEWARE_CLASSES" % middleware)

from django-cms.

marksweb avatar marksweb commented on May 19, 2024

@raffaellasuardini I think the issue here is that the error message says MIDDLEWARE_CLASSES regardless of if the setting is MIDDLEWARE_CLASSES or MIDDLEWARE. So I think the fix would likely be;

 if getattr(settings, 'MIDDLEWARE', None): 
     middlewares = settings.MIDDLEWARE
     setting_name = "MIDDLEWARE"
 else: 
     middlewares = settings.MIDDLEWARE_CLASSES
     setting_name = "MIDDLEWARE_CLASSES"
 for middleware in required_middlewares: 
     if middleware not in middlewares: 
         section.error("%s middleware must be in %s" % (middleware, setting_name)) 

from django-cms.

fsbraun avatar fsbraun commented on May 19, 2024

We can imho also remove the check for MIDDLEWARE_CLASSES since it's been removed from Django since v2.0

from django-cms.

Related Issues (20)

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.