To clarify:  "/shop" DOES take me to the shop.  But, "/shop/dashboard" 
produces this error as described.

On Friday, January 5, 2018 at 11:41:52 AM UTC-5, Mike Robinson wrote:
>
> I just installed "pip3 django-oscar" in the usual way and I added the shop 
> urls under "/shop" to my urls.py.
>
> I find that I can get to the shop but not to the dashboard with 
> "/shop/dashboard."  I get an error from the default dashboard auth-fn.
>
> ImproperlyConfigured: Please follow Oscar's default dashboard app layout 
> or set a custom access_fn
>
> So I put some debugging messages into my local copy and now things start 
> to get weird.
>
> url-name 'dashboard:promotion-list-by-page' 
>
> gets url '/shop/dashboard/content-blocks/pages/' 
>
> view_module 'django.contrib.flatpages.views'
>
> Huh?!  So I go into the manage.py shell and try some one-liners.  This 
> one's good:
>
> >>> resolve(r'/shop/dashboard/content-blocks/create/')
>
> ResolverMatch(func=oscar.apps.dashboard.promotions.views.CreateRedirectView, 
> args=(), kwargs={}, url_name=promotion-create-redirect, app_names=[], 
> namespaces=['dashboard'])
>
> ... but this one tries to go to flatpages!
>
> >>> resolve(r'/shop/dashboard/content-blocks/pages/')
>
> ResolverMatch(func=django.contrib.flatpages.views.flatpage, args=(), 
> kwargs={'url': ''}, url_name=django.contrib.flatpages.views.flatpage, 
> app_names=[], namespaces=[])
>
>
> ... and I'm sure that I am looking at the Python code that defines both:
>
>
>     def get_urls(self):
>
>         urls = [
>
>             url(r'^$', self.list_view.as_view(), name='promotion-list'),
>
>             url(r'^pages/$', self.page_list.as_view(),
>
>                 name='promotion-list-by-page'),
>
>             url(r'^page/(?P<path>/([\w-]+(/[\w-]+)*/)?)$',
>
>                 self.page_detail.as_view(), name='promotion-list-by-url'),
>
>             url(r'^create/$',
>
>                 self.create_redirect_view.as_view(),
>
> "promotion-list-by-page" occurs only once in the source-code.  As I said 
> above – "reverse()" produces the URL-string indicated, but it resolves to a 
> flatpage while its next-door-neighbor resolves properly to a create-view. 
>  I also printed the class-name so I also know that "PageDetailView" is 
> what's being referenced.
>
> Yes, I -am- running under Python 3...
>
> I simply cannot explain why one URL is not being resolved while its 
> next-door-neighbor is.  Especially since the URL that I'm trying to 
> resolve, came from "reverse()!"
>

-- 
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
--- 
You received this message because you are subscribed to the Google Groups 
"django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-oscar+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-oscar.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-oscar/fbe26148-ff5c-433c-8f4d-af08a224b128%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to