Skip to content

Commit

Permalink
Ch05: Redirect root HttpResponseRedirect.
Browse files Browse the repository at this point in the history
  • Loading branch information
jambonrose committed Jul 30, 2015
1 parent 4dc1d03 commit 2e80366
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion suorganizer/urls.py
Expand Up @@ -19,8 +19,10 @@
from blog import urls as blog_urls
from organizer import urls as organizer_urls

from .views import redirect_root

urlpatterns = [
url(r'^$', include(blog_urls)),
url(r'^$', redirect_root),
url(r'^admin/', include(admin.site.urls)),
url(r'^blog/', include(blog_urls)),
url(r'^', include(organizer_urls)),
Expand Down
5 changes: 5 additions & 0 deletions suorganizer/views.py
@@ -0,0 +1,5 @@
from django.http import HttpResponseRedirect


def redirect_root(request):
return HttpResponseRedirect('/blog/')

0 comments on commit 2e80366

Please sign in to comment.