OwlCyberSecurity - MANAGER
Edit File: views.cpython-39.pyc
a ���e� � @ s� d dl mZ d dlmZ d dlmZ d dlmZmZm Z d dl mZ d dlm Z d dlmZ d dlmZ d Zd d� Zedd � �ZdS )� )�settings)�FlatPage)�get_current_site)�Http404�HttpResponse�HttpResponsePermanentRedirect)�get_object_or_404)�loader)� mark_safe)�csrf_protectzflatpages/default.htmlc C s� |� d�sd| }t| �j}ztt||d�}W nL tyz |�d�sttjrt|d7 }tt||d�}t d| j � Y S � Y n0 t| |�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 �/)�url�sitesz%s/)� startswithr �idr r r �endswithr ZAPPEND_SLASHr �path�render_flatpage)�requestr Zsite_id�f� r �_/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/django/contrib/flatpages/views.py�flatpage s r c C sr |j r$| jjs$ddlm} || j�S |jr<t�|jt f�}n t� t �}t|j�|_t|j �|_ t|�d|i| ��S )z3 Internal interface to the flat page view. r )�redirect_to_loginr )Zregistration_required�user�is_authenticatedZdjango.contrib.auth.viewsr r Z template_namer Zselect_template�DEFAULT_TEMPLATEZget_templater �title�contentr �render)r r r �templater r r r 0 s r N)Zdjango.confr Zdjango.contrib.flatpages.modelsr Zdjango.contrib.sites.shortcutsr Zdjango.httpr r r Zdjango.shortcutsr Zdjango.templater Zdjango.utils.safestringr Zdjango.views.decorators.csrfr r r r r r r r �<module> s