url routing - Django URLConf include from sub-app not working -


i trying include django sub-app's urls main urls.py.

app/urls.py:

urlpatterns = patterns(     '',     ...     include('transfers.urls'),  ) 

app/transfers/urls.py:

urlpatterns = patterns(     '',     url(r'^transfers/$', 'some.view'),     ... ) 

but route not found error. last element of route urlconf module sub-app. has not been delisted parent url list.

using urlconf defined in app.urls, django tried these url patterns, in order: 1. 2. ... 30. <module 'transfers.urls' '/path/to/app/transfers/urls.pyc'>  current url, transfers/, didn't match of these. 

when copy first url pattern transfers.urls main urls.py, works. seems including sub-app urls.py, not sure if in right way.

how can work properly?

you can try this:

url(r'^transfers/', include('transfers.urls', namespace="transfers")), 

then can use host:port/transfers/transfers/.

these 2 transfers different. first 1 one in app/urls.py, , second 1 one in app/transfers/urls.py.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -