2013-02-28 12:45:21 +00:00
|
|
|
from __future__ import unicode_literals
|
2014-04-02 00:46:34 +00:00
|
|
|
import warnings
|
2013-02-28 12:45:21 +00:00
|
|
|
|
|
|
|
from django.conf.urls.i18n import i18n_patterns
|
2013-03-25 14:45:24 +00:00
|
|
|
from django.http import HttpResponse, StreamingHttpResponse
|
2014-11-26 21:21:29 +00:00
|
|
|
from django.utils.deprecation import RemovedInDjango20Warning
|
2013-02-28 12:45:21 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
2014-04-02 00:46:34 +00:00
|
|
|
|
2014-11-26 21:21:29 +00:00
|
|
|
# test deprecated version of i18n_patterns() function (with prefix). Remove it
|
2014-04-02 00:46:34 +00:00
|
|
|
# and convert to list of urls() in Django 2.0
|
2014-11-26 21:21:29 +00:00
|
|
|
with warnings.catch_warnings():
|
|
|
|
warnings.filterwarnings('ignore', category=RemovedInDjango20Warning)
|
2014-04-02 00:46:34 +00:00
|
|
|
|
|
|
|
urlpatterns = i18n_patterns('',
|
|
|
|
(r'^simple/$', lambda r: HttpResponse()),
|
|
|
|
(r'^streaming/$', lambda r: StreamingHttpResponse([_("Yes"), "/", _("No")])),
|
|
|
|
)
|