-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from PetrDlouhy/Django20
Compatibility fixes for Django 2.0 and 2.1
- Loading branch information
Showing
16 changed files
with
144 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
from django.conf.urls import include, url, handler404, handler500 | ||
from django.http import HttpResponseNotFound, HttpResponseServerError | ||
from django.contrib.auth import views as auth_views | ||
from django.views.i18n import javascript_catalog | ||
try: | ||
from django.views.i18n import JavaScriptCatalog | ||
javascript_catalog = JavaScriptCatalog.as_view() | ||
except ImportError: # Django<1.10 | ||
from django.views.i18n import javascript_catalog | ||
|
||
|
||
handler404 = 'scribbler.tests.urls.test_404' | ||
handler500 = 'scribbler.tests.urls.test_500' | ||
|
||
|
||
def test_404(request): | ||
def test_404(request, exception=None): | ||
return HttpResponseNotFound() | ||
|
||
|
||
def test_500(request): | ||
def test_500(request, exception=None): | ||
return HttpResponseServerError() | ||
|
||
|
||
js_info_dict = { | ||
'packages': ('scribbler', ), | ||
} | ||
|
||
try: | ||
login_url = url(r'^test/', auth_views.LoginView.as_view(template_name='test.html')) | ||
except AttributeError: | ||
login_url = url(r'^test/', auth_views.login, {'template_name': 'test.html'}) | ||
|
||
urlpatterns = [ | ||
url(r'^scribble/', include('scribbler.urls')), | ||
url(r'^jsi18n/$', javascript_catalog, js_info_dict, name='jsi18n'), | ||
url(r'^test/', auth_views.login, {'template_name': 'test.html'}), | ||
login_url, | ||
] |
Oops, something went wrong.