Reputation: 25587
my admin urls are sat behind a prefix by doing the following.
1#
(r'^admin/', include(admin.site.urls)),
is placed within urls_core.py
2#
(r'^api/', include('project.urls_core')),
is palced within urls.py
All admin URLs work fine except app indexes.
If I go to any URL such as:
I receive 'INVALID REQUEST' as my response. Status code is 200 (OK) though.
I have never received this error message before.
Does anyone have a clue? Thanks guys!
Upvotes: 0
Views: 486
Reputation: 50806
I think some middleware, that strips the leading api/ from the url should help you:
import re
class URLPrefixMiddleware:
def process_request(self, request):
request.path = re.sub('^api/','',request.path)
You shouldn't need your additional URL configuration then anymore. Put it in middleware.py in some app dir and add it to installed middleware!
Upvotes: 1