Merge branch 'rearrange_urls' into 'master'
Rearrange the urls See merge request !8
This commit is contained in:
commit
4840445504
|
@ -5,5 +5,5 @@ from machines.routers import router
|
|||
urlpatterns = [
|
||||
url(r'^api/', include(router.urls)),
|
||||
url(r'^(?P<pk>\w+)/$', MachineDetail.as_view(), name='machine-detail'),
|
||||
url(r'^$', MachineList.as_view()),
|
||||
url(r'^$', MachineList.as_view(), name='machines-list'),
|
||||
]
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from django.conf.urls import url, include
|
||||
from django.contrib import admin
|
||||
from django.views.generic import TemplateView
|
||||
from stagestatus.views import redirect_machines
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^admin/', admin.site.urls),
|
||||
url(r'^machines/', include('machines.urls')),
|
||||
url(r'^', TemplateView.as_view(template_name='index.html')),
|
||||
url(r'machines/', include('machines.urls')),
|
||||
url(r'', redirect_machines),
|
||||
]
|
||||
|
|
6
stagestatus/views.py
Normal file
6
stagestatus/views.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import reverse
|
||||
|
||||
|
||||
def redirect_machines(request):
|
||||
return HttpResponseRedirect(reverse('machines-list'))
|
Loading…
Reference in New Issue
Block a user