2

The common url action parameters in django-cms are for example: ?edit to enter Edit-mode, ?toolbar_off to disable/hide the toolbar.

Now I'd like to add a new action parameter e.g. ?logout which just logs out the user no matter on which url he/she currently is. I'd tried to include this in the urls.py with the following pattern:

    url(r'^.*\?logout$', RedirectView.as_view(url='/admin/logout/')),

I read in another SO answer that you shouldn't catch URL Params with an url pattern...

Should I do this in a kind of middleware? Or where else?

Using django==1.11, django-cms==3.5.3

zypro
  • 1,158
  • 3
  • 12
  • 33

1 Answers1

1

This should definily go into a middleware. It would probably work as well as an url pattern, but is kind of not "how you do it" - at least I never saw anything like it in a tutorial or documentation.

benzkji
  • 1,718
  • 20
  • 41