28 lines
791 B
Python
28 lines
791 B
Python
from django.conf.urls.static import static
|
|
from django.urls import path, include
|
|
from django.shortcuts import redirect
|
|
|
|
from thoughts import views
|
|
from whispermaphone import settings
|
|
|
|
def redirect_view(original, new):
|
|
def v(request):
|
|
return redirect(new)
|
|
return path(original, v, name="redirect" + original)
|
|
|
|
urlpatterns = [
|
|
path("", views.index, name="index"),
|
|
path("about", views.about, name="about"),
|
|
path("login", views.login, name="login"),
|
|
path("post", views.post, name="post"),
|
|
path("search", views.search, name="thoughts_search"),
|
|
# path('__debug__/', include('debug_toolbar.urls')),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
|
|
urlpatterns += [
|
|
redirect_view("[post", "/post")
|
|
]
|