Skip to content

Commit

Permalink
Added redirection of homepage to /todos endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
shreys7 committed Dec 4, 2019
1 parent 68ba07a commit a8faed3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion todoApp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
from django.urls import path, include
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from . import settings
from . import settings, views

urlpatterns = [
path('todos/', include('todos.urls')),
path('admin/', admin.site.urls),
path('', views.index)
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += staticfiles_urlpatterns()
4 changes: 4 additions & 0 deletions todoApp/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.shortcuts import redirect

def index(request):
return redirect('/todos')

0 comments on commit a8faed3

Please sign in to comment.