Skip to content

Commit b203c7a

Browse files
committed
Make 'development mode' easier to use
Redirect from `/` to `/nexus/` so one doesn't need to remember to do that after starting `./manage.py runserver`.
1 parent 327e1ad commit b203c7a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

tests/testapp/test_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def test2(request):
331331
response = test2(request)
332332
assert response.status_code, 302
333333
assert 'Location' in response
334-
assert response['Location'] == '/'
334+
assert response['Location'] == '/foo/'
335335

336336
def test_global(self):
337337
switch = Switch.objects.create(key='test', status=DISABLED)

tests/urls.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
import nexus
88
from django.conf.urls import include, url
99
from django.contrib import admin
10+
from django.http import HttpResponse
11+
from django.views.generic.base import RedirectView
1012

1113
from gargoyle.compat import subinclude
1214

1315

14-
def foo(request):
15-
from django.http import HttpResponse
16-
return HttpResponse()
17-
1816
admin.autodiscover()
1917
nexus.autodiscover()
2018

2119
urlpatterns = [
2220
url(r'^nexus/', include(nexus.site.urls)),
2321
url(r'^admin/', subinclude(admin.site.urls)),
24-
url(r'^$', foo, name='gargoyle_test_foo'),
22+
url(r'^foo/$', lambda request: HttpResponse(), name='gargoyle_test_foo'),
23+
url(r'^/?$', RedirectView.as_view(url='/nexus/', permanent=False)),
2524
]

0 commit comments

Comments
 (0)