Merge branch 'feature/django_2' into develop
This commit is contained in:
commit
076808f183
@ -1,6 +1,8 @@
|
||||
from django.conf.urls import url, include
|
||||
from django.conf.urls import include
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.urls import path
|
||||
from rest_framework import routers
|
||||
|
||||
from billard import views
|
||||
|
||||
router = routers.DefaultRouter()
|
||||
@ -9,20 +11,19 @@ router.register(r'locationdata', views.LocationDataViewSet)
|
||||
app_name = 'billard'
|
||||
urlpatterns = [
|
||||
# ex. /billard/
|
||||
url(r'^$', login_required(views.LocationIndexView.as_view()), name='location_index'),
|
||||
path('', login_required(views.LocationIndexView.as_view()), name='location_index'),
|
||||
# ex. /billard/1/
|
||||
url(r'^(?P<pk>[0-9]+)/$', login_required(views.LocationDetailView.as_view()), name='location_detail'),
|
||||
path('<int:pk>/', login_required(views.LocationDetailView.as_view()), name='location_detail'),
|
||||
# ex. /billard/1/accounting/
|
||||
url(r'^(?P<pk>[0-9]+)/accounting/$', views.AccountingView.as_view(), name='accounting_detail'),
|
||||
path('<int:pk>/accounting/', views.AccountingView.as_view(), name='accounting_detail'),
|
||||
# ex. /billard/1/accounting/confirm
|
||||
url(r'^(?P<pk>[0-9]+)/accounting/confirm/$', views.accounting_confirm, name='accounting_detail_confirm'),
|
||||
path('<int:pk>/accounting/confirm/', views.accounting_confirm, name='accounting_detail_confirm'),
|
||||
# ex. /billard/1/account_modal/
|
||||
url(r'^(?P<loc_pk>[0-9]+)/account_modal/$', views.account_modal_view, name='account_modal'),
|
||||
path('<int:loc_pk>/account_modal/', views.account_modal_view, name='account_modal'),
|
||||
# ex. /billard/1/account_modal/confirm/
|
||||
url(r'^(?P<loc_pk>[0-9]+)/account_modal/(?P<pks>[0-9]+(,[0-9]+)*)/confirm/$', views.account_modal_confirm_view,
|
||||
name='account_modal_confirm'),
|
||||
path('<int:loc_pk>/account_modal/<pks>/confirm/', views.account_modal_confirm_view, name='account_modal_confirm'),
|
||||
# ex. /billard/api/v1/ (rest api)
|
||||
url(r'api/v1/', include(router.urls)),
|
||||
path('api/v1/', include(router.urls)),
|
||||
# ex. /billard/process_location_data/
|
||||
url(r'^process_location_data/$', views.process_location_data, name='process_location_data'),
|
||||
path('process_location_data/', views.process_location_data, name='process_location_data'),
|
||||
]
|
||||
|
@ -14,23 +14,25 @@ Including another URLconf
|
||||
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.conf import settings
|
||||
from django.conf.urls import url, include
|
||||
from django.conf.urls import include
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.urls import path
|
||||
from django.views.generic import RedirectView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^admin/', admin.site.urls),
|
||||
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||
url(r'^billard/', include('billard.urls')),
|
||||
url(r'^login/$', auth_views.login, name='login'),
|
||||
url(r'^logout/$', auth_views.logout, name='logout'),
|
||||
url(r'^', include('django.contrib.auth.urls')),
|
||||
url(r'^$', RedirectView.as_view(url='billard/', permanent=False), name='index')
|
||||
path('admin/', admin.site.urls),
|
||||
path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||
path('billard/', include('billard.urls')),
|
||||
path('login/', auth_views.login, name='login'),
|
||||
path('logout/', auth_views.logout, name='logout'),
|
||||
path('', include('django.contrib.auth.urls')),
|
||||
path('', RedirectView.as_view(url='billard/', permanent=False), name='index')
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
import debug_toolbar
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^__debug__/', include(debug_toolbar.urls)),
|
||||
path('__debug__/', include(debug_toolbar.urls)),
|
||||
] + urlpatterns
|
||||
|
@ -1,4 +1,4 @@
|
||||
Django<2.0
|
||||
Django<2.1
|
||||
django-crispy-forms==1.7.0
|
||||
django-extensions>=1.7.0
|
||||
djangorestframework>=3.6.0
|
||||
|
Loading…
Reference in New Issue
Block a user