2021-04-28 02:47:33 +00:00
|
|
|
from django.conf.urls.static import static
|
2021-10-21 14:00:25 +00:00
|
|
|
from django.urls import path, include
|
2024-01-30 02:17:46 +00:00
|
|
|
from django.shortcuts import redirect
|
2020-09-06 02:00:45 +00:00
|
|
|
|
2022-04-30 17:33:57 +00:00
|
|
|
from thoughts import views
|
2021-04-28 02:47:33 +00:00
|
|
|
from whispermaphone import settings
|
2020-09-06 03:12:54 +00:00
|
|
|
|
2024-01-30 02:17:46 +00:00
|
|
|
def redirect_view(original, new):
|
|
|
|
def v(request):
|
|
|
|
return redirect(new)
|
|
|
|
return path(original, v, name="redirect" + original)
|
|
|
|
|
2020-09-06 02:00:45 +00:00
|
|
|
urlpatterns = [
|
2020-09-06 03:38:15 +00:00
|
|
|
path("", views.index, name="index"),
|
2022-01-06 19:20:47 +00:00
|
|
|
path("about", views.about, name="about"),
|
2022-01-06 20:05:18 +00:00
|
|
|
path("login", views.login, name="login"),
|
2022-01-06 19:20:47 +00:00
|
|
|
path("post", views.post, name="post"),
|
2022-09-17 18:00:48 +00:00
|
|
|
path("search", views.search, name="thoughts_search"),
|
2024-01-30 02:17:46 +00:00
|
|
|
# path('__debug__/', include('debug_toolbar.urls')),
|
|
|
|
]
|
|
|
|
|
|
|
|
if settings.DEBUG:
|
|
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
|
|
|
|
|
|
urlpatterns += [
|
|
|
|
redirect_view("[post", "/post")
|
|
|
|
]
|