Current File : //usr/local/apps/python3/lib/python3.11/site-packages/django/__pycache__/shortcuts.cpython-311.pyc |
�
�rRhj � � � d Z ddlmZmZmZmZ ddlmZ ddlm Z m
Z
ddlmZ dd�Z
ddd �d
�Zd� Zd� Zd
� Zd� Zd� Zd� ZdS )z�
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
� )�Http404�HttpResponse�HttpResponsePermanentRedirect�HttpResponseRedirect)�loader)�NoReverseMatch�reverse)�PromiseNc �T � t j ||| |�� � }t |||� � S )z�
Return an HttpResponse whose content is filled with the result of calling
django.template.loader.render_to_string() with the passed arguments.
)�using)r �render_to_stringr )�request�
template_name�context�content_type�statusr �contents �H/usr/local/apps/python3/lib/python3.11/site-packages/django/shortcuts.py�renderr s/ � � �%�m�W�g�U�S�S�S�G����v�6�6�6� F)� permanent�preserve_requestc �X � |rt nt } |t | g|�R i |��|�� � S )ak
Return an HttpResponseRedirect to the appropriate URL for the arguments
passed.
The arguments could be:
* A model: the model's `get_absolute_url()` function will be called.
* A view name, possibly with arguments: `urls.reverse()` will be used
to reverse-resolve the name.
* A URL, which will be used as-is for the redirect location.
Issues a temporary redirect by default. Set permanent=True to issue a
permanent redirect. Set preserve_request=True to instruct the user agent
to preserve the original HTTP method and body when following the redirect.
)r )r r �resolve_url)�tor r �args�kwargs�redirect_classs r �redirectr sQ � �&