use proper url naming instead of hardcoding paths

This commit is contained in:
Nick Sweeting 2020-07-27 23:56:35 -04:00
parent b8c8c4a599
commit d70bb7980e
5 changed files with 42 additions and 22 deletions

View file

@ -5,7 +5,7 @@ from django.views import static
from django.conf import settings
from django.views.generic.base import RedirectView
from core.views import MainIndex, LinkDetails
from core.views import MainIndex, OldIndex, LinkDetails
# print('DEBUG', settings.DEBUG)
@ -14,6 +14,8 @@ urlpatterns = [
path('robots.txt', static.serve, {'document_root': settings.OUTPUT_DIR, 'path': 'robots.txt'}),
path('favicon.ico', static.serve, {'document_root': settings.OUTPUT_DIR, 'path': 'favicon.ico'}),
path('docs/', RedirectView.as_view(url='https://github.com/pirate/ArchiveBox/wiki'), name='Docs'),
path('archive/', RedirectView.as_view(url='/')),
path('archive/<path:path>', LinkDetails.as_view(), name='LinkAssets'),
path('add/', RedirectView.as_view(url='/admin/core/snapshot/add/')),
@ -25,8 +27,8 @@ urlpatterns = [
path('accounts/', include('django.contrib.auth.urls')),
path('admin/', admin.site.urls),
path('old.html', MainIndex.as_view(), name='OldHome'),
path('old.html', OldIndex.as_view(), name='OldHome'),
path('index.html', RedirectView.as_view(url='/')),
path('index.json', static.serve, {'document_root': settings.OUTPUT_DIR, 'path': 'index.json'}),
path('', RedirectView.as_view(url='/admin/core/snapshot/'), name='Home'),
path('', MainIndex.as_view(), name='Home'),
]