add settings PINAX_BLOG_SLUG_UNIQUE. Add route and view for admin login in blog_ext app

remotes/origin/HEAD
Max Yakovenko 7 years ago
parent 101ce7f3f4
commit 53be416d84
  1. 1
      blog_ext/urls.py
  2. 5
      blog_ext/views.py
  3. 1
      eshop_project/settings/base.py

@ -8,4 +8,5 @@ urlpatterns = [
re_path(r"^section/(?P<section>[-\w]+)/$", views.SectionIndexView.as_view(), name="blog_section"), re_path(r"^section/(?P<section>[-\w]+)/$", views.SectionIndexView.as_view(), name="blog_section"),
re_path(r"^post/(?P<post_pk>\d+)/$", views.StaffPostDetailView.as_view(), name="blog_post_pk"), re_path(r"^post/(?P<post_pk>\d+)/$", views.StaffPostDetailView.as_view(), name="blog_post_pk"),
re_path(r"^post/(?P<post_secret_key>\w+)/$", views.SecretKeyPostDetailView.as_view(), name="blog_post_secret"), re_path(r"^post/(?P<post_secret_key>\w+)/$", views.SecretKeyPostDetailView.as_view(), name="blog_post_secret"),
re_path(r"^(?P<post_slug>[-\w]+)/$", views.SlugUniquePostDetailView.as_view(), name="blog_post_slug")
] ]

@ -3,7 +3,10 @@ from pinax.blog.views import (
StaffPostDetailView as BaseStaffPostDetailView, StaffPostDetailView as BaseStaffPostDetailView,
SectionIndexView as BaseSectionIndexView, SectionIndexView as BaseSectionIndexView,
SecretKeyPostDetailView as BaseSecretKeyPostDetailView, SecretKeyPostDetailView as BaseSecretKeyPostDetailView,
) SlugUniquePostDetailView as BaseSlugUniquePostDetailView)
class SlugUniquePostDetailView(BaseSlugUniquePostDetailView):
pass
class StaffPostDetailView(BaseStaffPostDetailView): class StaffPostDetailView(BaseStaffPostDetailView):

@ -202,6 +202,7 @@ AUTH_PASSWORD_VALIDATORS = [
# PINAX_BLOG_SCOPING_URL_VAR = "username" # PINAX_BLOG_SCOPING_URL_VAR = "username"
# PINAX_BLOG_SCOPING_MODEL = AUTH_USER_MODEL # PINAX_BLOG_SCOPING_MODEL = AUTH_USER_MODEL
# PINAX_BLOG_HOOKSET = "multiblog.hooks.HookSet" # where `multiblog` is the package name of our project # PINAX_BLOG_HOOKSET = "multiblog.hooks.HookSet" # where `multiblog` is the package name of our project
PINAX_BLOG_SLUG_UNIQUE = True
# Logging # Logging
LOGGING = { LOGGING = {

Loading…
Cancel
Save