I have a little problem with my django website's urls.
In fact I have:
urlpatterns = i18n_patterns('',
url(r'^test/(?P<variable_name>\w+)/$', views.testUrl),
I have a dynamic page created with the name "test". redirected from the view after some treatment :
def testUrl(request, variable_name):
current_site = Site.objects.get_current()
urlTest = HttpRequest.get_full_path(request)
parseIt = variable_name.split("/")
...
for x in parseIt:
if x == 'm':
if ToFind[:1] == 'm':
ID = ToFind[1:]
else:
ID = ToFind
try:
context_ret = GetId(x, api_url, ID, api_key, context_ret)
except Exception as err:
context_ret['message'] = err
return render(request, 'base_templates/test.html', context_ret)
elif x == 'z':
try:
context_ret = GetId(x, api_url, ToFind, api_key, context_ret)
except Exception as err:
context_ret['message'] = err
return render(request, 'base_templates/test.html', context_ret)
return render(request, 'base_templates/test.html', context_ret)
So if I type mydomain.org/test/ I have my dynamic page showing. Perfect.
But if I do mydomain.org/test/{whatever} I have the test.html template rendered but not the dynamic page ! Thus, the problem is that I have dynamic plugins within this dynamic page, I need to - whatever is behind test/ - use the same dynamic page. And not juste the template.
Without changing the url..
Is there a way of doing it ?
Edit:
here is an example of a call: domain.org/test/1923/