o a @sddlmZddlmZddlmZddlmZmZm Z ddl m Z ddl m Z ddlmZddlmZd Zd d Zed d ZdS))settings)FlatPage)get_current_site)Http404 HttpResponseHttpResponsePermanentRedirect)get_object_or_404)loader) mark_safe) csrf_protectzflatpages/default.htmlcCs|ds d|}t|j}z tt||d}Wn$ty;|ds:tjr:|d7}tt||d}t d|j YSwt ||S)a3 Public interface to the flat page view. Models: `flatpages.flatpages` Templates: Uses the template defined by the ``template_name`` field, or :template:`flatpages/default.html` if template_name is not defined. Context: flatpage `flatpages.flatpages` object /)urlsitesz%s/) startswithridrrrendswithr APPEND_SLASHrpathrender_flatpage)requestr site_idfr@/usr/lib/python3/dist-packages/django/contrib/flatpages/views.pyflatpages    rcCsr|jr|jjsddlm}||jS|jrt|jt f}nt t }t |j |_ t |j |_ t|d|i|S)z3 Internal interface to the flat page view. r)redirect_to_loginr)registration_requireduseris_authenticateddjango.contrib.auth.viewsrr template_namer select_templateDEFAULT_TEMPLATE get_templater titlecontentrrender)rrrtemplaterrrr0s     rN) django.confrdjango.contrib.flatpages.modelsrdjango.contrib.sites.shortcutsr django.httprrrdjango.shortcutsrdjango.templater django.utils.safestringr django.views.decorators.csrfr r"rrrrrrs