class FlatpageFallbackMiddleware Each time any Django application raises a 404 error, this middleware checks the flatpages database for the requested URL as a last resort. Specifically, it checks for a flatpage with the given URL with a site ID that corresponds to the SITE_ID setting. If it finds a match, it follows this algorithm: If the flatpage has a custom template, it loads that template. Otherwise, it loads the template flatpages/default.html. It passes that template a single context v
mail_managers(subject, message, fail_silently=False, connection=None, html_message=None) [source] django.core.mail.mail_managers() is just like mail_admins(), except it sends an email to the site managers, as defined in the MANAGERS setting.
centroid Returns a Point representing the centroid of this polygon.
SimpleTestCase.modify_settings() [source] It can prove unwieldy to redefine settings that contain a list of values. In practice, adding or removing values is often sufficient. The modify_settings() context manager makes it easy: from django.test import TestCase class MiddlewareTestCase(TestCase): def test_cache_middleware(self): with self.modify_settings(MIDDLEWARE={ 'append': 'django.middleware.cache.FetchFromCacheMiddleware', 'prepend': 'django.middlew
class ExceptionMiddleware New in Django 1.10. Catches exceptions raised during the request/response cycle and returns the appropriate response. Http404 is processed by handler404 (or a more friendly debug page if DEBUG=True). PermissionDenied is processed by handler403. MultiPartParserError is processed by handler400. SuspiciousOperation is processed by handler400 (or a more friendly debug page if DEBUG=True). Any other exception is processed by handler500 (or a more friendly debug pag
get_language_bidi() [source] Returns selected language’s BiDi layout: False = left-to-right layout True = right-to-left layout
items()
class SetPasswordForm A form that lets a user change their password without entering the old password.
name Returns the name of the data source.
storage.StaticFilesStorage.post_process(paths, **options) This method is called by the collectstatic management command after each run and gets passed the local storages and paths of found files as a dictionary, as well as the command line options. The CachedStaticFilesStorage uses this behind the scenes to replace the paths with their hashed counterparts and update the cache appropriately.
Page 117 of 226