hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
6de185a15e65b953198facda51a63595416fe605b342a983c9b1ec9d3386f09a | import posixpath
from collections import defaultdict
from django.utils.safestring import mark_safe
from .base import (
Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs,
)
from .library import Library
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
class BlockContext:
def __in... |
dfce43f7e35eaa6f443ffd8a614fdecfbd4ef1f8828867d2236d985d40b08055 | """
This is the Django template system.
How it works:
The Lexer.tokenize() method converts a template string (i.e., a string
containing markup with custom template tags) to tokens, which can be either
plain text (TokenType.TEXT), variables (TokenType.VAR), or block statements
(TokenType.BLOCK).
The Parser() class ta... |
756828f8968292003448223f2661b96628732f495b0d97f9ad3272535ba7e3da | import functools
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
from .base import Context, Template
from .context import _builtin_context_processors
from .exceptions import TemplateDoesNotExist
from .lib... |
7b6e59124df1832f66fab05e0b6cab5a0cfbabb885621bcc6abc929d870c1ff4 | """Default tags used by the template system, available to all templates."""
import re
import sys
import warnings
from collections import namedtuple
from datetime import datetime
from itertools import cycle as itertools_cycle, groupby
from django.conf import settings
from django.utils import timezone
from django.utils.... |
7b7d1771401991e324da4a78918660fbbc31d8f42504ca963b1089a23f1f11ca | import functools
from collections import Counter, OrderedDict
from pathlib import Path
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
class ... |
5c029747afc9e90974a4d534e5eafcb30776253a12e65fcfa4d3d233beff13e0 | from contextlib import contextmanager
from copy import copy
# Hard-coded processor for easier use of CSRF protection.
_builtin_context_processors = ('django.template.context_processors.csrf',)
class ContextPopException(Exception):
"pop() has been called more times than push()"
pass
class ContextDict(dict):... |
76b7f2558ba049ed6583d5486ec0b7a112d41bae06c3de0eabbec52df93664d2 | """
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the 'context_processors' option of the configuration
of a DjangoTemplates backend and use... |
401bec4ed0f8622c86a14e215eb5bcbea4740810053991ae0e844fdda18480eb | """
Parser and utilities for the smart 'if' tag
"""
# Using a simple top down parser, as described here:
# http://effbot.org/zone/simple-top-down-parsing.htm.
# 'led' = left denotation
# 'nud' = null denotation
# 'bp' = binding power (left = lbp, right = rbp)
class TokenBase:
"""
Base class for operators a... |
391532dd529aaa45abc7c831afc133ac894fbc400cad46fe2cecd9302b6734a4 | """Default variable filters."""
import random as random_module
import re
import types
from decimal import ROUND_HALF_UP, Context, Decimal, InvalidOperation
from functools import wraps
from operator import itemgetter
from pprint import pformat
from urllib.parse import quote
from django.utils import formats
from django.... |
836822e457d2ba0f966a4d8fe167a0eea19cc07af0232e3bbec7b7e586242db9 | import functools
from importlib import import_module
from inspect import getfullargspec
from django.utils.html import conditional_escape
from django.utils.itercompat import is_iterable
from .base import Node, Template, token_kwargs
from .exceptions import TemplateSyntaxError
class InvalidTemplateLibrary(Exception):... |
9bc020f7e0ee90d636f6268720ed0976cfa106e7db553daaaff6e69b5a67c553 | import re
from django.conf import settings
from django.http import HttpResponsePermanentRedirect
from django.utils.deprecation import MiddlewareMixin
class SecurityMiddleware(MiddlewareMixin):
def __init__(self, get_response=None):
self.sts_seconds = settings.SECURE_HSTS_SECONDS
self.sts_include_... |
73008eca5b249f99a7cbb48ad29962b114e5df67ee4779fd20ff1597f0299dd0 | import re
from urllib.parse import urlparse
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.mail import mail_managers
from django.http import HttpResponsePermanentRedirect
from django.urls import is_valid_path
from django.utils.deprecation import MiddlewareMixin
... |
a2ae89d0bff534b66ebd5d45d4cc6e14fcdd512ef5df4d69cb41961c10269369 | import re
from django.utils.cache import patch_vary_headers
from django.utils.deprecation import MiddlewareMixin
from django.utils.text import compress_sequence, compress_string
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(MiddlewareMixin):
"""
Compress content if the browser allows gzip c... |
30b5025e2adbeb36bfa364f898aa241afa30f19fa34eb5217c6049f36cb4333e | from django.conf import settings
from django.conf.urls.i18n import is_language_prefix_patterns_used
from django.http import HttpResponseRedirect
from django.urls import get_script_prefix, is_valid_path
from django.utils import translation
from django.utils.cache import patch_vary_headers
from django.utils.deprecation i... |
e2bcec1b99bf67655a6cdec9ff96557858f5e17dc501bb34894e4b2a805bf63b | """
Clickjacking Protection Middleware.
This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
"""
from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
class XFrameOptionsMiddleware(MiddlewareMixin):
... |
2624465efb5f997c584e89b2ee075ee69706e39197ed1d2aa57888e45934e9d1 | from django.utils.cache import (
cc_delim_re, get_conditional_response, set_response_etag,
)
from django.utils.deprecation import MiddlewareMixin
from django.utils.http import parse_http_date_safe
class ConditionalGetMiddleware(MiddlewareMixin):
"""
Handle conditional GET operations. If the response has a... |
3b6a3fa32fd6aaa39d213f277204ce16ffbe5900d9c6c9553e029e57464659cf | """
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE = [
'django.middleware.cache.UpdateCacheMiddl... |
7d2953793084cfb2bb040c00524e0a3036a30e852c8fb10f646ad710b1b03a85 | """
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
import logging
import re
import string
from urllib.parse import urlparse
from django.conf import settings
from django.core.exceptions import DisallowedHost, Improperl... |
d66ad582570ac28a085b31b140f8117af56481dd620406bb11258f50064d712f | from django.core import signals
from django.db.utils import (
DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, ConnectionHandler,
ConnectionRouter, DatabaseError, DataError, Error, IntegrityError,
InterfaceError, InternalError, NotSupportedError, OperationalError,
ProgrammingError,
)
__all__ = [
'conne... |
b47405cdfadcba9aabaeffd4c7cc2f44a60eb048bc5a2c1874c1d7ef04e98ea6 | from contextlib import ContextDecorator
from django.db import (
DEFAULT_DB_ALIAS, DatabaseError, Error, ProgrammingError, connections,
)
class TransactionManagementError(ProgrammingError):
"""Transaction management is used improperly."""
pass
def get_connection(using=None):
"""
Get a database c... |
ea181a2b91a28b6720072f3bd10d2514e85dcb1bd52c979eb5d5b4b15e7ac5d4 | import pkgutil
from importlib import import_module
from pathlib import Path
from threading import local
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
DEFAULT_DB_ALIAS = ... |
1df480ad95a5df8544aa4919439b5a421c1e1fcebe3297114282affbb5f284bb | import uuid
from django.utils import lru_cache
class IntConverter:
regex = '[0-9]+'
def to_python(self, value):
return int(value)
def to_url(self, value):
return str(value)
class StringConverter:
regex = '[^/]+'
def to_python(self, value):
return value
def to_url... |
f17ba0f4d8495c3132b115d6ad8da21dfd2c9df24c52642461902898f96d58c6 | """Functions for use in URLsconfs."""
from functools import partial
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from .resolvers import (
LocalePrefixPattern, RegexPattern, RoutePattern, URLPattern, URLResolver,
)
def include(arg, namespace=None):
app_name = No... |
15d1df36fe4dc16108b7512a129458ef127e8b8b43f9208b8f4b6adea4fa5f51 | from .base import (
clear_script_prefix, clear_url_caches, get_script_prefix, get_urlconf,
is_valid_path, resolve, reverse, reverse_lazy, set_script_prefix,
set_urlconf, translate_url,
)
from .conf import include, path, re_path
from .converters import register_converter
from .exceptions import NoReverseMatc... |
6a52cd8e4391b40c67782d34838aa74691b9c28b8e1ef26f19bca67692ad1bf2 | from django.http import Http404
class Resolver404(Http404):
pass
class NoReverseMatch(Exception):
pass
|
172cc774c1a85a3f5c872f26e29c6e1108206ebb5b8b1635540bec5abe8fc384 | from threading import local
from urllib.parse import urlsplit, urlunsplit
from django.utils.encoding import iri_to_uri
from django.utils.functional import lazy
from django.utils.translation import override
from .exceptions import NoReverseMatch, Resolver404
from .resolvers import get_ns_resolver, get_resolver
from .u... |
5470dc9a080d44749b3c902a97928985eef05f8a528eb29beb816efa9d780fd4 | import functools
from importlib import import_module
from django.core.exceptions import ViewDoesNotExist
from django.utils.module_loading import module_has_submodule
@functools.lru_cache(maxsize=None)
def get_callable(lookup_view):
"""
Return a callable corresponding to lookup_view.
* If lookup_view is a... |
d1f1f72613fc715640cfc981c78061d24cb7c03b8f9c67f170a3b5883f68b33a | """
This module converts requested URLs to callback view functions.
URLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a ResolverMatch object which provides access to all
attributes of the resolved URL match.
"""
import functools
import re
import threading
from importlib imp... |
4ba72438c9af517faf5524fa002f8cf01cec7d5430b8450074759a6cc37e3862 | """
Django validation and HTML form handling.
"""
from django.core.exceptions import ValidationError # NOQA
from django.forms.boundfield import * # NOQA
from django.forms.fields import * # NOQA
from django.forms.forms import * # NOQA
from django.forms.formsets import * # NOQA
from django.forms.models import * # ... |
84e902d05645317e2eb884e567d9c2e63ec89794993e4b453d514b70e5fd3663 | """
Helper functions for creating Form classes from Django models
and database field objects.
"""
from collections import OrderedDict
from itertools import chain
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError,
)
from django.forms.fields import ChoiceField,... |
02af66c88bd759d2d480b476b7d657eb57c2aa88fcdd50910274ca1f4a8eede1 | from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import BooleanField, IntegerField
from django.forms.utils import ErrorList
from django.forms.widgets import HiddenInput
from django.utils.functional import cached_property
from django.utils.html import html_safe
fr... |
b810182f9e45262e2dede4c40012e39c5783fc26b89a4346c88f114c40de288d | """
HTML Widget classes
"""
import copy
import datetime
import re
import warnings
from itertools import chain
from django.conf import settings
from django.forms.utils import to_current_timezone
from django.templatetags.static import static
from django.utils import datetime_safe, formats
from django.utils.dates import... |
5fbce947040d73a41038f9eb5c0f6de1e2e2189945636d3d768ecde1b485ccf7 | import datetime
from django.forms.utils import flatatt, pretty_name
from django.forms.widgets import Textarea, TextInput
from django.utils.functional import cached_property
from django.utils.html import conditional_escape, format_html, html_safe
from django.utils.safestring import mark_safe
from django.utils.translati... |
77f02e9737075a49849149808b6a21c67323ed4f844da654054c7a22b33e731e | """
Field classes.
"""
import copy
import datetime
import math
import os
import re
import uuid
from decimal import Decimal, DecimalException
from io import BytesIO
from urllib.parse import urlsplit, urlunsplit
from django.core import validators
from django.core.exceptions import ValidationError
# Provide this import ... |
d44931297ebecbe923d17cddc2ff9e2632f7cef6ea8f1d3e49ac381003900208 | import json
from collections import UserList
from django.conf import settings
from django.core.exceptions import ValidationError # backwards compatibility
from django.utils import timezone
from django.utils.html import escape, format_html, format_html_join, html_safe
from django.utils.translation import gettext_lazy ... |
511c671466d635ae4c728d8b371403ad65879ac5e1e1663540f2c9f6b9530e99 | import functools
from pathlib import Path
from django.conf import settings
from django.template.backends.django import DjangoTemplates
from django.template.loader import get_template
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
try:
from django.template... |
145bf4ed391984f57afe5bc3070429844d9f90e60c51228be17f69ebb21023d3 | """
Form classes
"""
import copy
from collections import OrderedDict
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
# BoundField is imported for backwards compatibility in Django 1.9
from django.forms.boundfield import BoundField # NOQA
from django.forms.fields import Field, FileField
# pretty_... |
f2ce407bdb9a1845bb4bcb52bc55232a955ea3817a02f967e2cb5b025881bc97 | import collections.abc
import warnings
from math import ceil
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
class UnorderedObjectListWarning(RuntimeWarning):
pass
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
... |
57ad6db17863c549cbc5f355010054521bd282f74384b2f76a3212e530869722 | """
Global Django exception and warning classes.
"""
class FieldDoesNotExist(Exception):
"""The requested model field does not exist"""
pass
class AppRegistryNotReady(Exception):
"""The django.apps registry is not populated yet"""
pass
class ObjectDoesNotExist(Exception):
"""The requested obje... |
dac60c49edc806b10d7904fbaf2b3ed3809199ff215b64360a39640542328c79 | import django
from django.core.handlers.wsgi import WSGIHandler
def get_wsgi_application():
"""
The public interface to Django's WSGI support. Return a WSGI callable.
Avoids making django.core.handlers.WSGIHandler a public API, in case the
internal WSGI implementation changes or moves in the future.
... |
ca21c65b5e7a7c5429768bf33fb338dade36617fb56dac0b623aa14f60d8b4ec | """
Functions for creating and restoring url-safe signed JSON objects.
The format used looks like this:
>>> signing.dumps("hello")
'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk'
There are two components here, separated by a ':'. The first component is a
URLsafe base64 encoded JSON of the object passed to dumps(). T... |
b864726c708967be1bcb61d5fbd2445af7e69f0fec72e85cc5a44fdd49990e31 | from django.dispatch import Signal
request_started = Signal(providing_args=["environ"])
request_finished = Signal()
got_request_exception = Signal(providing_args=["request"])
setting_changed = Signal(providing_args=["setting", "value", "enter"])
|
a67fc0a23a7f493cb5713b5686eb789b51cf104a88e5ccc31056478ae89adea4 | import ipaddress
import re
from pathlib import Path
from urllib.parse import urlsplit, urlunsplit
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.functional import SimpleLazyObject
from django.utils.ipv6 import is_valid_ipv6_address
from django.... |
e49226a01d4164db9904eb79ab20d7eede7531c61b9032d7e3978a98d37f15eb | from django.http.cookie import SimpleCookie, parse_cookie
from django.http.request import (
HttpRequest, QueryDict, RawPostDataException, UnreadablePostError,
)
from django.http.response import (
BadHeaderError, FileResponse, Http404, HttpResponse,
HttpResponseBadRequest, HttpResponseForbidden, HttpResponse... |
66983a3845bdf9d1afaf9072421947c868cb273bcd36b9c62f55b3a259ec33a5 | from http import cookies
# For backwards compatibility in Django 2.1.
SimpleCookie = cookies.SimpleCookie
# Add support for the SameSite attribute (obsolete when PY37 is unsupported).
cookies.Morsel._reserved.setdefault('samesite', 'SameSite')
def parse_cookie(cookie):
"""
Return a dictionary parsed from a ... |
9d5b0efe5b5d754d96c061e99b1df7f9ad8b3c1bcb0af86c48a242ad7306611b | """
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
import base64
import binascii
import cgi
from urllib.parse import unquote
from django.conf import settings
from django.core.exceptions import (
RequestDa... |
2f4315ebc4142489f787b9f3a2ab8875e5d322825277a2102eb6951856520ca4 | import datetime
import json
import mimetypes
import os
import re
import sys
import time
from email.header import Header
from http.client import responses
from urllib.parse import quote, urlparse
from django.conf import settings
from django.core import signals, signing
from django.core.exceptions import DisallowedRedir... |
e1184b4dfb8b9e4a4169ba37d515ae373456f74dd72fd5d09cde77a13d0f800c | import copy
import re
import warnings
from io import BytesIO
from itertools import chain
from urllib.parse import quote, urlencode, urljoin, urlsplit
from django.conf import settings
from django.core import signing
from django.core.exceptions import (
DisallowedHost, ImproperlyConfigured, RequestDataTooBig,
)
from... |
1c5cc9b2f87ec7dca3a23bb892222928023453fe1caeda1fb6a893f2594cfeef | from datetime import datetime, tzinfo
import pytz
from django.template import Library, Node, TemplateSyntaxError
from django.utils import timezone
register = Library()
# HACK: datetime instances cannot be assigned new attributes. Define a subclass
# in order to define new attributes in do_timezone().
class datetim... |
a26ddcbb8355687e0c554abe5cf2f13d53652d40b14db6e9d2a015552682963e | from urllib.parse import quote, urljoin
from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.html import conditional_escape
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" ... |
23a8d14812ef2f7e07fbfaf01ae1df536d950613b6207351b9eefc2966fca537 | from django.template import Library, Node, TemplateSyntaxError
from django.utils import formats
register = Library()
@register.filter(is_safe=False)
def localize(value):
"""
Force a value to be rendered as a localized value,
regardless of the value of ``settings.USE_L10N``.
"""
return str(formats... |
ee977af521254d6769993f1eb229a955987291a8b5ca8a6c360195484fdc4752 | from django.conf import settings
from django.template import Library, Node, TemplateSyntaxError, Variable
from django.template.base import TokenType, render_value_in_context
from django.template.defaulttags import token_kwargs
from django.utils import translation
from django.utils.safestring import SafeData, mark_safe
... |
a2d6377384e2f582f115f3ae217e5367bc35d9a1833e4c867d036c68f559fccd | from django.core.cache import InvalidCacheBackendError, caches
from django.core.cache.utils import make_template_fragment_key
from django.template import (
Library, Node, TemplateSyntaxError, VariableDoesNotExist,
)
register = Library()
class CacheNode(Node):
def __init__(self, nodelist, expire_time_var, fra... |
eb0117239c8115960355e76734f7346d86d7186f90ce421443ee7412b0eb03f9 | from functools import wraps
from django.utils.cache import patch_vary_headers
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-language')
def index(request):
...
... |
3eda5219df0178f6b5bad1aabca305ce92ed649c69576fc97a3f25970e5b0896 | from django.middleware.gzip import GZipMiddleware
from django.utils.decorators import decorator_from_middleware
gzip_page = decorator_from_middleware(GZipMiddleware)
gzip_page.__doc__ = "Decorator for views that gzips pages if the client supports it."
|
116f8345ed9d47cca0e117fc1d11e5f1ce3e0bc98bdc72866ba3f16512a616d5 | from functools import wraps
def xframe_options_deny(view_func):
"""
Modify a view function so its response has the X-Frame-Options HTTP
header set to 'DENY' as long as the response doesn't already have that
header set. Usage:
@xframe_options_deny
def some_view(request):
...
"""
... |
360645364697d03c0325650d3608fe1516c13901325b82b06eb58364e6bff46a | """
Decorators for views based on HTTP headers.
"""
from calendar import timegm
from functools import wraps
from django.http import HttpResponseNotAllowed
from django.middleware.http import ConditionalGetMiddleware
from django.utils.cache import get_conditional_response
from django.utils.decorators import decorator_f... |
b922f36fad660ae14a226f2d4771acfcd3f51fb53e04e114fd039cdc88410bfe | from functools import wraps
from django.middleware.cache import CacheMiddleware
from django.utils.cache import add_never_cache_headers, patch_cache_control
from django.utils.decorators import decorator_from_middleware_with_args
def cache_page(timeout, *, cache=None, key_prefix=None):
"""
Decorator for views ... |
43fba5fe7f0cf3d5a83cbf3b983628999ef89affdd8eeb9d659f9bfae07523ab | import functools
from django.http import HttpRequest
def sensitive_variables(*variables):
"""
Indicate which variables used in the decorated function are sensitive so
that those variables can later be treated in a special way, for example
by hiding them when logging unhandled exceptions.
Accept ... |
c4f59554dc3f0c189dbd7fd9558bcdec278fb751e9c69531b1beb032bd0e7b86 | from functools import wraps
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import decorator_from_middleware
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds CSRF protection ... |
5939f31179cac89ab31e52eefd5b17227620f86a240cd042518355fd4e94fa89 | from django.views.generic.base import RedirectView, TemplateView, View
from django.views.generic.dates import (
ArchiveIndexView, DateDetailView, DayArchiveView, MonthArchiveView,
TodayArchiveView, WeekArchiveView, YearArchiveView,
)
from django.views.generic.detail import DetailView
from django.views.generic.e... |
b7f6b0a8edf321375e25b89955a03067ea9c9dedad181af2134b3837f64c493a | import logging
from functools import update_wrapper
from django.core.exceptions import ImproperlyConfigured
from django.http import (
HttpResponse, HttpResponseGone, HttpResponseNotAllowed,
HttpResponsePermanentRedirect, HttpResponseRedirect,
)
from django.template.response import TemplateResponse
from django.... |
ccf3b70fcac5ad20e3246d4e9d1627d1fac6a95abc54c2801148a1654d8dac89 | from django.core.exceptions import ImproperlyConfigured
from django.forms import models as model_forms
from django.http import HttpResponseRedirect
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
from django.views.generic.detail import (
BaseDetailView, SingleObjectMixin, SingleObjec... |
13b888943f8521add96f1cf4810724d30278db42757e503e5127acbf9af17542 | import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils import timezone
from django.utils.functional import cached_property
from django.utils.translation import gettext as _
from django.views... |
9bca2da1f7c95cf5bd9a5faf02d5de3386ac4d3e48e29beea11e01863a5607a0 | from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.http import Http404
from django.utils.translation import gettext as _
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
class SingleObjectMixin(ContextMixin):
"""
Provide the ability ... |
192eb0560885cf8307b195e2ee37ca8e54a21ebae6670f1a809976e9f559c233 | from django.core.exceptions import ImproperlyConfigured
from django.core.paginator import InvalidPage, Paginator
from django.db.models.query import QuerySet
from django.http import Http404
from django.utils.translation import gettext as _
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
... |
2e9f59735eed472ddb57050bc6ad7ff2a065a176e09aa890888cf36ea92a0d29 | from django.urls import include, re_path
from django.views import defaults
__all__ = ['handler400', 'handler403', 'handler404', 'handler500', 'include', 'url']
handler400 = defaults.bad_request
handler403 = defaults.permission_denied
handler404 = defaults.page_not_found
handler500 = defaults.server_error
def url(re... |
dc7af5ef48335699883ac1d440ea601b5e8b13a9c6fd4e4bf244a84a234a7854 | import re
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.urls import re_path
from django.views.static import serve
def static(prefix, view=serve, **kwargs):
"""
Return a URL pattern for serving files in debug mode.
from django.conf import settings
... |
4c6ff4f5679d1ad70e8628c9b43c7171091c394d790e292ad0d90b195bf0bc22 | import functools
from django.conf import settings
from django.urls import LocalePrefixPattern, URLResolver, get_resolver, path
from django.views.i18n import set_language
def i18n_patterns(*urls, prefix_default_language=True):
"""
Add the language code prefix to every URL pattern within this function.
Thi... |
09d9f3735c3c3d0313012621626fcbcc9b26098946721f528a35a81f35b06cc7 | """
LANG_INFO is a dictionary structure to provide meta information about languages.
About name_local: capitalize it as if your language name was appearing
inside a sentence in your language.
The 'fallback' key can be used to specify a special fallback logic which doesn't
follow the traditional 'fr-ca' -> 'fr' fallbac... |
1491d68907d98cf0d6c9f4d6c105c02818e9d570ad16f61bfa86ea6a504f1530 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd E Y р.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'd E Y р. H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_F... |
85fc1234cf6490302d0cf9126acd90597d6a1c8b7b1ac060990f344d4bc14ec3 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_FORMAT = 'F Y.'
MONTH_DAY_FO... |
0480c0e740bdce3c541bb73ec85add871b3444e10ff4eb4918298224356d31b4 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \d\e F \d\e Y \á\s H:i'
YEAR_MONTH_FORMA... |
6bab9043166bb5101dffc19eb263048d66beaaebe306ade027929ad7bb32d723 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMA... |
1c89b2b65db1534ba2fdb7619a9e866562ea7c72117ffd6289db5a8e57e087b8 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT =... |
5542f3f68a81fe000929f97abec6e5a54cc7c17ddb6095c2e124ea45c39b24b8 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \d\e F \d\e Y à\s H:i'
YEAR_MONTH_FORMAT... |
1d9b3a743bab61703cbf59d7f6fab9438ab5c15d75b7d95a9c8fbbc4300659cc | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORM... |
b19c82788400a3a1c2b4aaf9b7a5bacbc2e5fd8e58874cd7bb2f6acf909a533f | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j F Y، ساعت G:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_F... |
a80c4abfffbfb9bb1f1f8a9db6fbe00aa0e2ac187d4e7b9e99a2f3742e43e7eb | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j E Y, G:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT... |
a91a861632759570a94718fe519f11c5ee0128f7bae99376659e8a6e55530628 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \d\e F \d\e Y à\s H:i'
YEAR_MONTH_FORMAT... |
11b4f28864ce5c9759c54c25788b6f93f0b02b930c97d474a469e21142feec76 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'g:i A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
# MONTH_DAY_FORMAT =
SHORT_DA... |
10ff3c5cd58a666baef7820f33f33fe2f18afc4ec0ae8029e13ba0ed610057e9 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y. F j.'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'Y. F j. H:i'
YEAR_MONTH_FORMAT = 'Y. F'
MONTH_DAY_FO... |
771595609dd7a6bc97825f0ace9d617b401b20c36dbc94ad6869a67452629be1 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i a'
DATETIME_FORMAT = 'j F, Y h:i a'
YEAR_MONTH_FORMAT = 'F, Y'
MONTH_D... |
a6db08455f9f0d094ae2f3edce3c236dd63c99b7273d862f8d96943a42b60bdf | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j. F Y G:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMA... |
f1d223685c5096c77bf4a3be90714d82dfafc98aabc772bdfce25ffcd3086043 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'Y\k\o N j\a'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'Y\k\o N j\a, H:i'
YEAR_MONTH_FORMAT = r'Y\k\o ... |
2f0290c358286d16119eeb077b7648da96c2b40d4dd467e408ad372dc285a5c8 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'h:i A'
# DATETIME_FORMAT =
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = 'j F'
SHOR... |
c8f18fde409b402534558dcff8abb1c76ca5ede58532c32d1aee71cc376bea3a | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMA... |
6d95b7e95f7501a300a7fc49511af61567c4146527b6cecc044ddeb8717c0ded | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G.i'
DATETIME_FORMAT = r'j. E Y \k\e\l\l\o G.i'
YEAR_MONTH_FORMAT = 'F Y'
MON... |
67a643b7cfa18335ff3596ef73f9e9158486c3a0bf8fb38a715e19407054cae7 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'd F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT ... |
99c9430283ca9febf13330073ea427f894edcf2f6ecf0e9ef231eb80310fe07a | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j F Y, H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT... |
ce9b32a620e116e6731a277241858fa1e330acbe1c12c1aa759193bb805d680b | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '20 januari 2009'
TIME_FORMAT = 'H:i' # '15:23'
DATET... |
23c9e42f7f22596da9f1e4653f2de62bce5bb489cc20af66c482f19818e6f227 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5日
TIME_FORMAT = 'H:i' # 20:45
DATETIME_FORMAT =... |
c29f95089d886399c48d049e8e899178c1b663213feab6b88448926d816deb22 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oct 2006'
TIME_FORMAT = 'P' # '2:30 p.m.'
DATET... |
5c15d1ebfc4063fa07b39ac0bb96062628bafb27a75902761c5aadc9abdaf2bb | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F، Y'
TIME_FORMAT = 'g:i A'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'... |
e07fed5f3c09215227f6ec6fb330963fd72537363576d080f4d0b8d8986f9c1b | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'h:ia'
DATETIME_FORMAT = 'j F Y h:ia'
# YEAR_MONTH_FORMAT =
MONTH_DAY_FORMAT = ... |
bcdaac75f141413639c8a8c4bc25e5656bab28cd569811f415b167a4855020f6 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j ខែ F ឆ្នាំ Y'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j ខែ F ឆ្នាំ Y, G:i'
# YEAR_MONTH_FORMAT =
MO... |
b67cbd08fac9255e6a449fe6cae890f1f31f8377e736dbf7aba68e4b12dd2b41 | # This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \d\e F \d\e Y \a \l\a\s H:i'
YEAR_MONTH_FORMAT = r'F \d\e Y'
MONTH_DAY_FORMAT = r'j \d\e F'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:i'
FIRST_DAY_OF_W... |
5ea5cbeb2ff522736c5410d505456c88de1d3d27da9d773ee590a1ddce876a23 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j בF Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j בF Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMA... |
4d470a52d109fe49af6d6fef80753ae23b059323d8068aecb14fc71142bc86bc | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMA... |
72862bfc4acdee800b379722aa94507276fec6bdc31718c5a544af69aa11852f | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FORMAT = 'H:i' # 14:30
DATETIME_FORMAT = 'l d F Y H:i' # Mercoledì ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.