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