Skip to content

Instantly share code, notes, and snippets.

@eclecticmiraclecat
Created November 10, 2020 14:42
Show Gist options
  • Save eclecticmiraclecat/f9735c865d1aeb2dd0e8f78833b214b9 to your computer and use it in GitHub Desktop.
Save eclecticmiraclecat/f9735c865d1aeb2dd0e8f78833b214b9 to your computer and use it in GitHub Desktop.
# project urls.py
from django.urls import path, include
from django.views.generic import RedirectView

urlpatterns = [
    path('catalog/', include('catalog.urls')),
    path('', RedirectView.as_view(url='catalog/')),
]
# app urls.py
from django.urls import path
from .views import index

urlpatterns = [
  path('', index, name='index')
]
# views.py
from django.shortcuts import HttpResponse

def index(request):
  return HttpResponse('hi')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment