Misago
  • Introduction
  • Setup
    • Create server on Digital Ocean
    • Point domain at your server
    • Setup Misago on your Server
    • Upgrading your Misago to latest version
  • Settings
    • Accessing settings
    • Static settings reference
    • Dynamic settings reference
  • Coding style
  • GDPR Compliance Guide
  • Social authentication
  • User rank styles
  • Category styles
  • User authentication
  • Writing new admin actions
  • Permissions framework
  • View decorators
  • Context processors
  • Frontend context
  • Audit trail
  • Forms
  • Cache
  • Sending mails
  • Markup
  • Posting process
  • Profile fields
  • Threads types
  • Extending pages
  • Validating registrations
  • Validators
  • Search filters
  • Template tags
  • Shortcuts
  • View errors
  • Locales
Powered by GitBook
On this page
  • misago.core.decorators.require_POST
  • misago.core.errorpages.shared_403_exception_handler
  • misago.core.errorpages.shared_404_exception_handler
  • misago.users.decorators.deny_authenticated
  • misago.users.decorators.deny_guests
  • misago.users.decorators.deny_banned_ips
  • misago.users.decorators.deflect_authenticated
  • misago.users.decorators.deflect_guests
  • misago.users.decorators.deflect_banned_ips

View decorators

Misago apps define plenty of decorators for you to wrap your views with.

misago.core.decorators.require_POST

Function that checks if request made to access view is POST. If it's not, decorator renders wrong_way.html template and returns it in 405 response. This is its only difference to Django's counterpart.

misago.core.errorpages.shared_403_exception_handler

If your project has different error handler for 403 errors defined, you can use this decorator to make your function shared handler between Misago and other views. This will make Misago handle 403 exceptions coming from under its path while leaving alone exceptions coming from your site.

misago.core.errorpages.shared_404_exception_handler

Same as above but for custom 404 error handler.

misago.users.decorators.deny_authenticated

This decorator will block requests made to view if user is authenticated, displaying page with error message or returning JSON/XML in its stead.

misago.users.decorators.deny_guests

This decorator will block requests made to view if user is not authenticated, displaying page with error message or returning JSON/XML in its stead.

misago.users.decorators.deny_banned_ips

This decorator will block requests made to view if user IP is banned, displaying page with error message or returning JSON/XML in its stead.

misago.users.decorators.deflect_authenticated

This decorator will return redirect to forum index if user is authenticated.

misago.users.decorators.deflect_guests

This decorator will return redirect to forum index if user is not authenticated.

misago.users.decorators.deflect_banned_ips

This decorator will return redirect to forum index if user IP is banned.

PreviousPermissions frameworkNextContext processors

Last updated 7 years ago