1👍
Your entire approach is mistaken, unfortunately. A view is responsible entirely for responding to a URL and returning a response. It simply doesn’t make sense to talk about having two views at a single URL.
If you need functionality provided by two apps within one URL, then think about abstracting the shared functionality into a utility method, or a template tag, or a context processor.
0👍
Add the dollar sign to the regex:
url(r'^$', 'joins.views.home', name='home'),
Without the $
the ^
regex matches all urls.
Of course the item.views.items
will not work anyway (django executes the first matched url) but other views from item
app will work just fine.
- [Answer]-Execute api function on button click using Django urls – Django/Python
- [Answer]-How to deal with user_id field properly?
- [Answer]-Django 1.7 modelform_factory form is always invalid with factory_boy created model
- [Answer]-Once custom 404 page comes for Django it doesn't redirect
- [Answer]-Why polymer not render html markup fetched from server in json format?
0👍
You want something like this I think:
url(r'^joins/', include('joins.urls')),
url(r'^items/', include('item.urls')),
see this: https://docs.djangoproject.com/en/1.7/topics/http/urls/#including-other-urlconfs
@s_spirit You want two views for one URL? To do that write a view that gets both models, pass both to your render function and make a template that displays what you want from each. Making two urls the same will only do what the first match does – joel goldstick 2 hours ago
- [Answer]-Using django-compressor with render_block from sekizai_tags
- [Answer]-Django inclison tag, endless pagination doesn't work
- [Answer]-Inconsistent results from Django ORM
- [Answer]-Django jQuery Rest Framework