<del>I'm having lots of trouble with a problem and I am hoping someone has 
already encountered it and can help me with</del>. I have encountered some 
weird behaviour that I thought I should share in case anyone gets the same 
problem or perhaps I have stumbled on a bug. I fixed it in my local urlconf 
with a quick workaround as I don't have time to look into it further right 
now, but I think the problem is related to the way the urlpatterns are 
automatically added to the project in the brand module.

The problem only occurs when DEBUG = False. Everything works fine when 
running with DEBUG = True. Even in the python shell (with DEBUG = False) 
everything seems to work fine:

>>> from django.core.urlresolvers import reverse
>>> reverse('satchmo_brand_list')
'/brand/'

What's even more confusing is that the site works fine with DEBUG=False 
when using ./manage.py runserver. Otherwise, with uWsgi and gunicorn, I get 
the NoReverseMatch err.

#urls.py (excerpt)

from satchmo_store.urls import urlpatterns
from satchmo_utils.urlhelper import replace_urlpattern
from localsite.views import HomeView

# ... other code

urlpatterns += patterns('',
    url(r'^$', HomeView.as_view(), name='soxbox_home'),
)

# ... patterns from other apps    

replacement = url(r'^(?P<brandname>.*)/$', 'localsite.views.brand_page', {},
                  'satchmo_brand_view')
replace_urlpattern(urlpatterns, replacement)
replacement = url(r'^(?P<parent_slugs>([-\w]+/)*)?(?P<slug>[-\w]+)/$',
                  'localsite.views.category_view', name='satchmo_category')
replace_urlpattern(urlpatterns, replacement)

To work around the problem for now, I just included the brand urls 
manually: `url(r'^brand/', include('satchmo_ext.brand.urls'))` in my 
urlconf.

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/satchmo-users/-/LMAElWtsmicJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.

Reply via email to