mirror of
https://github.com/Hopiu/django-tos.git
synced 2026-05-28 03:23:58 +00:00
1) in urls a view "tos" has context object evaluated only in a runtime. This means that even if tos was changed, the "tos" view shows always the same old tos object.
2) check_tos view uses now messages framework instead of {{note}}
3) Support for translation in "you cannot login..." message added
The following code was tested with django 1.4 and it is reported to work well.
10 lines
No EOL
317 B
Python
10 lines
No EOL
317 B
Python
from django.conf.urls import url, patterns
|
|
from tos.views import check_tos, TosView
|
|
|
|
urlpatterns = patterns('',
|
|
# Terms of Service conform
|
|
url(r'^confirm/$', check_tos, name='tos_check_tos'),
|
|
|
|
# Terms of service simple display
|
|
url(r'^$', TosView.as_view(), name='tos'),
|
|
) |