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