imagehost/imagehosting/urls.py

23 lines
861 B
Python
Raw Normal View History

2017-09-27 13:35:32 +03:00
# -*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
2017-10-10 18:24:26 +03:00
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.contrib.auth.views import login, logout
2017-10-11 19:01:22 +03:00
2017-09-27 13:35:32 +03:00
urlpatterns = [
url(r'^$', views.image_new, name='image_new'),
url(r'^post/(?P<pk>[0-9]+)/$', views.image_detail, name='image_detail'),
url(r'^all/$', views.all_posts, name='all_posts'),
2017-10-10 18:24:26 +03:00
url(r'^delete/(?P<pk>[0-9]+)/$', views.delete_post, name='delete_post'),
url(r'^admin/', admin.site.urls),
url(r'^login$', login, {'template_name':'imagehosting/login.html'}, name='login'),
url(r'^logout/$', logout)
2017-09-27 13:35:32 +03:00
]
2017-10-10 18:24:26 +03:00
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += staticfiles_urlpatterns()