mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Update settings and urls to fix new deprecations
This commit is contained in:
@@ -10,6 +10,7 @@ https://docs.djangoproject.com/en/1.7/ref/settings/
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
import os
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||
@@ -18,13 +19,12 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = os.environ.get('SECRET_KEY') if os.environ.get('SECRET_KEY') else 'gxhy(a#5mhp289_=6xx$7jh=eh$ymxg^ymc+di*0c*geiu3p_e'
|
||||
SECRET_KEY = os.environ.get('SECRET_KEY') if os.environ.get(
|
||||
'SECRET_KEY') else 'gxhy(a#5mhp289_=6xx$7jh=eh$ymxg^ymc+di*0c*geiu3p_e'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = bool(int(os.environ.get('DEBUG'))) if os.environ.get('DEBUG') else True
|
||||
|
||||
TEMPLATE_DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ['pyrigs.nottinghamtec.co.uk', 'rigs.nottinghamtec.co.uk', 'pyrigs.herokuapp.com']
|
||||
|
||||
INTERNAL_IPS = ['127.0.0.1']
|
||||
@@ -33,7 +33,6 @@ ADMINS = (
|
||||
('Tom Price', 'tomtom5152@gmail.com')
|
||||
)
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = (
|
||||
@@ -69,7 +68,6 @@ ROOT_URLCONF = 'PyRIGS.urls'
|
||||
|
||||
WSGI_APPLICATION = 'PyRIGS.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
|
||||
DATABASES = {
|
||||
@@ -81,6 +79,7 @@ DATABASES = {
|
||||
|
||||
if not DEBUG:
|
||||
import dj_database_url
|
||||
|
||||
DATABASES['default'] = dj_database_url.config()
|
||||
|
||||
# Logging
|
||||
@@ -111,12 +110,12 @@ LOGGING = {
|
||||
'mail_admins': {
|
||||
'class': 'django.utils.log.AdminEmailHandler',
|
||||
'level': 'ERROR',
|
||||
# But the emails are plain text by default - HTML is nicer
|
||||
# But the emails are plain text by default - HTML is nicer
|
||||
'include_html': True,
|
||||
},
|
||||
},
|
||||
'loggers': {
|
||||
# Again, default Django configuration to email unhandled exceptions
|
||||
# Again, default Django configuration to email unhandled exceptions
|
||||
'django.request': {
|
||||
'handlers': ['mail_admins'],
|
||||
'level': 'ERROR',
|
||||
@@ -183,19 +182,7 @@ USE_L10N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
DATETIME_INPUT_FORMATS = ('%Y-%m-%dT%H:%M','%Y-%m-%dT%H:%M:%S')
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.core.context_processors.debug",
|
||||
"django.core.context_processors.i18n",
|
||||
"django.core.context_processors.media",
|
||||
"django.core.context_processors.static",
|
||||
"django.core.context_processors.tz",
|
||||
"django.core.context_processors.request",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
)
|
||||
|
||||
DATETIME_INPUT_FORMATS = ('%Y-%m-%dT%H:%M', '%Y-%m-%dT%H:%M:%S')
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/1.7/howto/static-files/
|
||||
@@ -206,10 +193,28 @@ STATIC_DIRS = (
|
||||
os.path.join(BASE_DIR, 'static/')
|
||||
)
|
||||
|
||||
TEMPLATE_DIRS = (
|
||||
os.path.join(BASE_DIR, 'templates'),
|
||||
)
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [
|
||||
os.path.join(BASE_DIR, 'templates'),
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.core.context_processors.debug",
|
||||
"django.core.context_processors.i18n",
|
||||
"django.core.context_processors.media",
|
||||
"django.core.context_processors.static",
|
||||
"django.core.context_processors.tz",
|
||||
"django.core.context_processors.request",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
]
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
USE_GRAVATAR=True
|
||||
USE_GRAVATAR = True
|
||||
|
||||
TERMS_OF_HIRE_URL = "http://www.nottinghamtec.co.uk/terms.pdf"
|
||||
|
||||
@@ -6,19 +6,19 @@ from registration.backends.default.views import RegistrationView
|
||||
import RIGS
|
||||
from RIGS import regbackend
|
||||
|
||||
urlpatterns = patterns('',
|
||||
urlpatterns = [
|
||||
# Examples:
|
||||
# url(r'^$', 'PyRIGS.views.home', name='home'),
|
||||
# url(r'^blog/', include('blog.urls')),
|
||||
|
||||
url(r'^', include('RIGS.urls')),
|
||||
url('^user/register/$', RegistrationView.as_view(form_class=RIGS.forms.ProfileRegistrationFormUniqueEmail),
|
||||
url('^user/register/$', RegistrationView.as_view(form_class=RIGS.forms.ProfileRegistrationFormUniqueEmail),
|
||||
name="registration_register"),
|
||||
url('^user/', include('django.contrib.auth.urls')),
|
||||
url('^user/', include('registration.backends.default.urls')),
|
||||
|
||||
url(r'^admin/', include(admin.site.urls)),
|
||||
)
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
|
||||
272
RIGS/urls.py
272
RIGS/urls.py
@@ -1,4 +1,5 @@
|
||||
from django.conf.urls import patterns, include, url
|
||||
from django.contrib.auth.views import password_reset
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from RIGS import models, views, rigboard, finance, ical, versioning, forms
|
||||
from django.views.generic import RedirectView
|
||||
@@ -6,153 +7,152 @@ from django.views.generic import RedirectView
|
||||
from PyRIGS.decorators import permission_required_with_403
|
||||
from PyRIGS.decorators import api_key_required
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# Examples:
|
||||
# url(r'^$', 'PyRIGS.views.home', name='home'),
|
||||
# url(r'^blog/', include('blog.urls')),
|
||||
url('^$', login_required(views.Index.as_view()), name='index'),
|
||||
url(r'^closemodal/$', views.CloseModal.as_view(), name='closemodal'),
|
||||
urlpatterns = [
|
||||
# Examples:
|
||||
# url(r'^$', 'PyRIGS.views.home', name='home'),
|
||||
# url(r'^blog/', include('blog.urls')),
|
||||
url('^$', login_required(views.Index.as_view()), name='index'),
|
||||
url(r'^closemodal/$', views.CloseModal.as_view(), name='closemodal'),
|
||||
|
||||
url('^user/login/$', 'RIGS.views.login', name='login'),
|
||||
url(r'^user/password_reset/$', 'django.contrib.auth.views.password_reset', {'password_reset_form':forms.PasswordReset}),
|
||||
url('^user/login/$', views.login, name='login'),
|
||||
url(r'^user/password_reset/$', password_reset, {'password_reset_form': forms.PasswordReset}),
|
||||
|
||||
# People
|
||||
url(r'^people/$', permission_required_with_403('RIGS.view_person')(views.PersonList.as_view()),
|
||||
name='person_list'),
|
||||
url(r'^people/add/$',
|
||||
permission_required_with_403('RIGS.add_person')(views.PersonCreate.as_view()),
|
||||
name='person_create'),
|
||||
url(r'^people/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_person')(views.PersonDetail.as_view()),
|
||||
name='person_detail'),
|
||||
url(r'^people/(?P<pk>\d+)/history/$',
|
||||
permission_required_with_403('RIGS.view_person')(versioning.VersionHistory.as_view()),
|
||||
name='person_history', kwargs={'model': models.Person}),
|
||||
url(r'^people/(?P<pk>\d+)/edit/$',
|
||||
permission_required_with_403('RIGS.change_person')(views.PersonUpdate.as_view()),
|
||||
name='person_update'),
|
||||
# People
|
||||
url(r'^people/$', permission_required_with_403('RIGS.view_person')(views.PersonList.as_view()),
|
||||
name='person_list'),
|
||||
url(r'^people/add/$',
|
||||
permission_required_with_403('RIGS.add_person')(views.PersonCreate.as_view()),
|
||||
name='person_create'),
|
||||
url(r'^people/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_person')(views.PersonDetail.as_view()),
|
||||
name='person_detail'),
|
||||
url(r'^people/(?P<pk>\d+)/history/$',
|
||||
permission_required_with_403('RIGS.view_person')(versioning.VersionHistory.as_view()),
|
||||
name='person_history', kwargs={'model': models.Person}),
|
||||
url(r'^people/(?P<pk>\d+)/edit/$',
|
||||
permission_required_with_403('RIGS.change_person')(views.PersonUpdate.as_view()),
|
||||
name='person_update'),
|
||||
|
||||
# Organisations
|
||||
url(r'^organisations/$',
|
||||
permission_required_with_403('RIGS.view_organisation')(views.OrganisationList.as_view()),
|
||||
name='organisation_list'),
|
||||
url(r'^organisations/add/$',
|
||||
permission_required_with_403('RIGS.add_organisation')(views.OrganisationCreate.as_view()),
|
||||
name='organisation_create'),
|
||||
url(r'^organisations/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_organisation')(views.OrganisationDetail.as_view()),
|
||||
name='organisation_detail'),
|
||||
url(r'^organisations/(?P<pk>\d+)/history/$',
|
||||
permission_required_with_403('RIGS.view_organisation')(versioning.VersionHistory.as_view()),
|
||||
name='organisation_history', kwargs={'model': models.Organisation}),
|
||||
url(r'^organisations/(?P<pk>\d+)/edit/$',
|
||||
permission_required_with_403('RIGS.change_organisation')(views.OrganisationUpdate.as_view()),
|
||||
name='organisation_update'),
|
||||
# Organisations
|
||||
url(r'^organisations/$',
|
||||
permission_required_with_403('RIGS.view_organisation')(views.OrganisationList.as_view()),
|
||||
name='organisation_list'),
|
||||
url(r'^organisations/add/$',
|
||||
permission_required_with_403('RIGS.add_organisation')(views.OrganisationCreate.as_view()),
|
||||
name='organisation_create'),
|
||||
url(r'^organisations/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_organisation')(views.OrganisationDetail.as_view()),
|
||||
name='organisation_detail'),
|
||||
url(r'^organisations/(?P<pk>\d+)/history/$',
|
||||
permission_required_with_403('RIGS.view_organisation')(versioning.VersionHistory.as_view()),
|
||||
name='organisation_history', kwargs={'model': models.Organisation}),
|
||||
url(r'^organisations/(?P<pk>\d+)/edit/$',
|
||||
permission_required_with_403('RIGS.change_organisation')(views.OrganisationUpdate.as_view()),
|
||||
name='organisation_update'),
|
||||
|
||||
# Venues
|
||||
url(r'^venues/$',
|
||||
permission_required_with_403('RIGS.view_venue')(views.VenueList.as_view()),
|
||||
name='venue_list'),
|
||||
url(r'^venues/add/$',
|
||||
permission_required_with_403('RIGS.add_venue')(views.VenueCreate.as_view()),
|
||||
name='venue_create'),
|
||||
url(r'^venues/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_venue')(views.VenueDetail.as_view()),
|
||||
name='venue_detail'),
|
||||
url(r'^venues/(?P<pk>\d+)/history/$',
|
||||
permission_required_with_403('RIGS.view_venue')(versioning.VersionHistory.as_view()),
|
||||
name='venue_history', kwargs={'model': models.Venue}),
|
||||
url(r'^venues/(?P<pk>\d+)/edit/$',
|
||||
permission_required_with_403('RIGS.change_venue')(views.VenueUpdate.as_view()),
|
||||
name='venue_update'),
|
||||
# Venues
|
||||
url(r'^venues/$',
|
||||
permission_required_with_403('RIGS.view_venue')(views.VenueList.as_view()),
|
||||
name='venue_list'),
|
||||
url(r'^venues/add/$',
|
||||
permission_required_with_403('RIGS.add_venue')(views.VenueCreate.as_view()),
|
||||
name='venue_create'),
|
||||
url(r'^venues/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_venue')(views.VenueDetail.as_view()),
|
||||
name='venue_detail'),
|
||||
url(r'^venues/(?P<pk>\d+)/history/$',
|
||||
permission_required_with_403('RIGS.view_venue')(versioning.VersionHistory.as_view()),
|
||||
name='venue_history', kwargs={'model': models.Venue}),
|
||||
url(r'^venues/(?P<pk>\d+)/edit/$',
|
||||
permission_required_with_403('RIGS.change_venue')(views.VenueUpdate.as_view()),
|
||||
name='venue_update'),
|
||||
|
||||
# Rigboard
|
||||
url(r'^rigboard/$', login_required(rigboard.RigboardIndex.as_view()), name='rigboard'),
|
||||
url(r'^rigboard/calendar/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'),
|
||||
url(r'^rigboard/calendar/(?P<view>(month|week|day))/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'),
|
||||
url(r'^rigboard/calendar/(?P<view>(month|week|day))/(?P<date>(\d{4}-\d{2}-\d{2}))/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'),
|
||||
url(r'^rigboard/archive/$', RedirectView.as_view(permanent=True,pattern_name='event_archive')),
|
||||
url(r'^rigboard/activity/$',
|
||||
permission_required_with_403('RIGS.view_event')(versioning.ActivityTable.as_view()),
|
||||
name='activity_table'),
|
||||
url(r'^rigboard/activity/feed/$',
|
||||
permission_required_with_403('RIGS.view_event')(versioning.ActivityFeed.as_view()),
|
||||
name='activity_feed'),
|
||||
# Rigboard
|
||||
url(r'^rigboard/$', login_required(rigboard.RigboardIndex.as_view()), name='rigboard'),
|
||||
url(r'^rigboard/calendar/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'),
|
||||
url(r'^rigboard/calendar/(?P<view>(month|week|day))/$', login_required()(rigboard.WebCalendar.as_view()),
|
||||
name='web_calendar'),
|
||||
url(r'^rigboard/calendar/(?P<view>(month|week|day))/(?P<date>(\d{4}-\d{2}-\d{2}))/$',
|
||||
login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'),
|
||||
url(r'^rigboard/archive/$', RedirectView.as_view(permanent=True, pattern_name='event_archive')),
|
||||
url(r'^rigboard/activity/$',
|
||||
permission_required_with_403('RIGS.view_event')(versioning.ActivityTable.as_view()),
|
||||
name='activity_table'),
|
||||
url(r'^rigboard/activity/feed/$',
|
||||
permission_required_with_403('RIGS.view_event')(versioning.ActivityFeed.as_view()),
|
||||
name='activity_feed'),
|
||||
|
||||
url(r'^event/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_event')(rigboard.EventDetail.as_view()),
|
||||
name='event_detail'),
|
||||
url(r'^event/(?P<pk>\d+)/print/$',
|
||||
permission_required_with_403('RIGS.view_event')(rigboard.EventPrint.as_view()),
|
||||
name='event_print'),
|
||||
url(r'^event/create/$',
|
||||
permission_required_with_403('RIGS.add_event')(rigboard.EventCreate.as_view()),
|
||||
name='event_create'),
|
||||
url(r'^event/(?P<pk>\d+)/edit/$',
|
||||
permission_required_with_403('RIGS.change_event')(rigboard.EventUpdate.as_view()),
|
||||
name='event_update'),
|
||||
url(r'^event/(?P<pk>\d+)/duplicate/$',
|
||||
permission_required_with_403('RIGS.add_event')(rigboard.EventDuplicate.as_view()),
|
||||
name='event_duplicate'),
|
||||
url(r'^event/archive/$', login_required()(rigboard.EventArchive.as_view()),
|
||||
name='event_archive'),
|
||||
url(r'^event/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_event')(rigboard.EventDetail.as_view()),
|
||||
name='event_detail'),
|
||||
url(r'^event/(?P<pk>\d+)/print/$',
|
||||
permission_required_with_403('RIGS.view_event')(rigboard.EventPrint.as_view()),
|
||||
name='event_print'),
|
||||
url(r'^event/create/$',
|
||||
permission_required_with_403('RIGS.add_event')(rigboard.EventCreate.as_view()),
|
||||
name='event_create'),
|
||||
url(r'^event/(?P<pk>\d+)/edit/$',
|
||||
permission_required_with_403('RIGS.change_event')(rigboard.EventUpdate.as_view()),
|
||||
name='event_update'),
|
||||
url(r'^event/(?P<pk>\d+)/duplicate/$',
|
||||
permission_required_with_403('RIGS.add_event')(rigboard.EventDuplicate.as_view()),
|
||||
name='event_duplicate'),
|
||||
url(r'^event/archive/$', login_required()(rigboard.EventArchive.as_view()),
|
||||
name='event_archive'),
|
||||
|
||||
url(r'^event/(?P<pk>\d+)/history/$',
|
||||
permission_required_with_403('RIGS.view_event')(versioning.VersionHistory.as_view()),
|
||||
name='event_history', kwargs={'model': models.Event}),
|
||||
url(r'^event/(?P<pk>\d+)/history/$',
|
||||
permission_required_with_403('RIGS.view_event')(versioning.VersionHistory.as_view()),
|
||||
name='event_history', kwargs={'model': models.Event}),
|
||||
|
||||
|
||||
# Finance
|
||||
url(r'^invoice/$',
|
||||
permission_required_with_403('RIGS.view_invoice')(finance.InvoiceIndex.as_view()),
|
||||
name='invoice_list'),
|
||||
url(r'^invoice/archive/$',
|
||||
permission_required_with_403('RIGS.view_invoice')(finance.InvoiceArchive.as_view()),
|
||||
name='invoice_archive'),
|
||||
url(r'^invoice/waiting/$',
|
||||
permission_required_with_403('RIGS.add_invoice')(finance.InvoiceWaiting.as_view()),
|
||||
name='invoice_waiting'),
|
||||
|
||||
# Finance
|
||||
url(r'^invoice/$',
|
||||
permission_required_with_403('RIGS.view_invoice')(finance.InvoiceIndex.as_view()),
|
||||
name='invoice_list'),
|
||||
url(r'^invoice/archive/$',
|
||||
permission_required_with_403('RIGS.view_invoice')(finance.InvoiceArchive.as_view()),
|
||||
name='invoice_archive'),
|
||||
url(r'^invoice/waiting/$',
|
||||
permission_required_with_403('RIGS.add_invoice')(finance.InvoiceWaiting.as_view()),
|
||||
name='invoice_waiting'),
|
||||
url(r'^event/(?P<pk>\d+)/invoice/$',
|
||||
permission_required_with_403('RIGS.add_invoice')(finance.InvoiceEvent.as_view()),
|
||||
name='invoice_event'),
|
||||
|
||||
url(r'^event/(?P<pk>\d+)/invoice/$',
|
||||
permission_required_with_403('RIGS.add_invoice')(finance.InvoiceEvent.as_view()),
|
||||
name='invoice_event'),
|
||||
url(r'^invoice/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_invoice')(finance.InvoiceDetail.as_view()),
|
||||
name='invoice_detail'),
|
||||
url(r'^invoice/(?P<pk>\d+)/print/$',
|
||||
permission_required_with_403('RIGS.view_invoice')(finance.InvoicePrint.as_view()),
|
||||
name='invoice_print'),
|
||||
url(r'^invoice/(?P<pk>\d+)/void/$',
|
||||
permission_required_with_403('RIGS.change_invoice')(finance.InvoiceVoid.as_view()),
|
||||
name='invoice_void'),
|
||||
url(r'^payment/create/$',
|
||||
permission_required_with_403('RIGS.add_payment')(finance.PaymentCreate.as_view()),
|
||||
name='payment_create'),
|
||||
url(r'^payment/(?P<pk>\d+)/delete/$',
|
||||
permission_required_with_403('RIGS.add_payment')(finance.PaymentDelete.as_view()),
|
||||
name='payment_delete'),
|
||||
|
||||
url(r'^invoice/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_invoice')(finance.InvoiceDetail.as_view()),
|
||||
name='invoice_detail'),
|
||||
url(r'^invoice/(?P<pk>\d+)/print/$',
|
||||
permission_required_with_403('RIGS.view_invoice')(finance.InvoicePrint.as_view()),
|
||||
name='invoice_print'),
|
||||
url(r'^invoice/(?P<pk>\d+)/void/$',
|
||||
permission_required_with_403('RIGS.change_invoice')(finance.InvoiceVoid.as_view()),
|
||||
name='invoice_void'),
|
||||
url(r'^payment/create/$',
|
||||
permission_required_with_403('RIGS.add_payment')(finance.PaymentCreate.as_view()),
|
||||
name='payment_create'),
|
||||
url(r'^payment/(?P<pk>\d+)/delete/$',
|
||||
permission_required_with_403('RIGS.add_payment')(finance.PaymentDelete.as_view()),
|
||||
name='payment_delete'),
|
||||
# User editing
|
||||
url(r'^user/$', login_required(views.ProfileDetail.as_view()), name='profile_detail'),
|
||||
url(r'^user/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_profile')(views.ProfileDetail.as_view()),
|
||||
name='profile_detail'),
|
||||
url(r'^user/edit/$', login_required(views.ProfileUpdateSelf.as_view()),
|
||||
name='profile_update_self'),
|
||||
url(r'^user/reset_api_key$', login_required(views.ResetApiKey.as_view(permanent=False)), name='reset_api_key'),
|
||||
|
||||
# User editing
|
||||
url(r'^user/$', login_required(views.ProfileDetail.as_view()), name='profile_detail'),
|
||||
url(r'^user/(?P<pk>\d+)/$',
|
||||
permission_required_with_403('RIGS.view_profile')(views.ProfileDetail.as_view()),
|
||||
name='profile_detail'),
|
||||
url(r'^user/edit/$', login_required(views.ProfileUpdateSelf.as_view()),
|
||||
name='profile_update_self'),
|
||||
url(r'^user/reset_api_key$', login_required(views.ResetApiKey.as_view(permanent=False)), name='reset_api_key'),
|
||||
# ICS Calendar - API key authentication
|
||||
url(r'^ical/(?P<api_pk>\d+)/(?P<api_key>\w+)/rigs.ics$', api_key_required(ical.CalendarICS()), name="ics_calendar"),
|
||||
|
||||
# ICS Calendar - API key authentication
|
||||
url(r'^ical/(?P<api_pk>\d+)/(?P<api_key>\w+)/rigs.ics$', api_key_required(ical.CalendarICS()), name="ics_calendar"),
|
||||
|
||||
# API
|
||||
url(r'^api/(?P<model>\w+)/$', login_required(views.SecureAPIRequest.as_view()), name="api_secure"),
|
||||
url(r'^api/(?P<model>\w+)/(?P<pk>\d+)/$', login_required(views.SecureAPIRequest.as_view()), name="api_secure"),
|
||||
|
||||
# Legacy URL's
|
||||
url(r'^rig/show/(?P<pk>\d+)/$', RedirectView.as_view(permanent=True,pattern_name='event_detail')),
|
||||
url(r'^bookings/$', RedirectView.as_view(permanent=True,pattern_name='rigboard')),
|
||||
url(r'^bookings/past/$', RedirectView.as_view(permanent=True,pattern_name='event_archive')),
|
||||
)
|
||||
# API
|
||||
url(r'^api/(?P<model>\w+)/$', login_required(views.SecureAPIRequest.as_view()), name="api_secure"),
|
||||
url(r'^api/(?P<model>\w+)/(?P<pk>\d+)/$', login_required(views.SecureAPIRequest.as_view()), name="api_secure"),
|
||||
|
||||
# Legacy URL's
|
||||
url(r'^rig/show/(?P<pk>\d+)/$', RedirectView.as_view(permanent=True, pattern_name='event_detail')),
|
||||
url(r'^bookings/$', RedirectView.as_view(permanent=True, pattern_name='rigboard')),
|
||||
url(r'^bookings/past/$', RedirectView.as_view(permanent=True, pattern_name='event_archive')),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user