page view permissions problems

18 views
Skip to first unread message

GCA Black

unread,
Feb 5, 2017, 2:59:57 PM2/5/17
to django CMS developers
Hey All, 
I'm missing something simple here; I cannot seem to figure out how to enforce login to view pages (user login/registration), does this functionality have to be done at the django level and not django-cms? I used the djangocms installer, and in the admin I'm able to turn on view permissions on a page, but once I log out and browse to the page, I get a 404 error saying the in the site urls.py there is no pattern matching accounts/login -- what and where do I need to add, enable this? Help will be greatly appreciated!

GCA Black

unread,
Feb 5, 2017, 3:02:01 PM2/5/17
to django CMS developers
This the urls.py as created by installer: 
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals

from cms.sitemaps import CMSSitemap
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

admin.autodiscover()

urlpatterns = [
    url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap',
        {'sitemaps': {'cmspages': CMSSitemap}}),
    url(r'^select2/', include('django_select2.urls')),
]

urlpatterns += i18n_patterns('',
    url(r'^admin/', include(admin.site.urls)),  # NOQA
    url(r'^', include('cms.urls')),
)

# This is only needed when using runserver.
if settings.DEBUG:
    urlpatterns = [
        url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
        ] + staticfiles_urlpatterns() + urlpatterns

GCA Black

unread,
Feb 6, 2017, 9:50:23 AM2/6/17
to django CMS developers
on the chance someone else has this basic problem/question -- the login for users is done outside of djangocms, either in django or 3rd party login/auth/registration app


On Sunday, February 5, 2017 at 2:59:57 PM UTC-5, GCA Black wrote:
Reply all
Reply to author
Forward
0 new messages