Last Updated: February 25, 2016
·
636
· leech

Triple quote strings in URL patterns produce error

A quick reminder, that drives me crazy sometimes.

This is a stupid protip but may help somebody to resolve the annoying 'str' object has no attribute 'regex' error.

urlpatterns = patterns('',
    url(
        r'^$',
        views.dashboard,
        name='admin-dashboard'
    ),
    url(
        r'^business/$',
        views.business_list,
        name='admin-business'
    ),

    """
    url(
        r'^business/$',
        views.business_list,
        name='admin-business'
    ),
    """
)