Q:

How to use reverse() in django on included URLs?

My urls.py looks roughly like this:
...
url(r'^advance-day/$', 'mafia.views.advance_day', name='advance_day'),
url(r'^form/', include(form_urls)),
...

I recently moved things to a separate form_urls.py for form URLs because there are a lot of forms, and I want to not have them in the way. However, I then can't figure out how to use django.core.urlresolvers.reverse() on them without using the whole name of the view. I can do reverse(mafia.views.investigation_form) for example, but I'd prefer to be able to do reverse(form_urls:investigation) or something. 
I also have the same problem in templates. Before I convert every instance of {% url sign_up %} into {% url mafia.views.sign_up %}, etc. I'd like to try doing this with names still. Is there  way?

A:

The problem you are facing is solved by namespacing of url patterns:
To start with, add add a namespace argument to your master urls.py for your included urls:
url(r'form/', include(form_urls, namespace='forms')),

Assuming you have the following in form_urls:
url(r'my-form/$', 'mafia.views.my_form', name='my_form'),

You can then reverse it with {% urls forms:my_form %}.

