Skip to content

Commit 52e6658

Browse files
committed
added context processor for dot version
1 parent 12a1ca2 commit 52e6658

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

example/example/context_processors.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from oauth2_provider import VERSION
2+
3+
4+
def dot_version(request):
5+
return {'version': VERSION}

example/example/settings/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102

103103
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
104104
"django.core.context_processors.request",
105+
"example.context_processors.dot_version",
105106
)
106107

107108
ROOT_URLCONF = 'example.urls'

example/example/urls.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from django.contrib import admin
33
from django.core.urlresolvers import reverse_lazy
44
from django.views.generic import TemplateView
5-
from oauth2_provider import VERSION
65

76
from .views import (
87
ConsumerView, ConsumerExchangeView, ConsumerDoneView, ApiEndpoint, ApiClientView
@@ -16,7 +15,6 @@
1615
url(
1716
regex=r'^$',
1817
view=TemplateView.as_view(template_name='example/home.html'),
19-
kwargs={'version': VERSION},
2018
name='home'
2119
),
2220
url(

0 commit comments

Comments
 (0)