How to get current_app for using with reverse in multi-deployable reusable Django application?
django, django-urls, python
Solution
After exploring this topic for several days, I found that it isn't natural to mount django app more than once.
There is implementation of pluggable applications pattern: http://github.com/nowells/django-pluggables. It looks too tricky for me.
So I decided to move repeated functionality to custom tags and duplicate templates for each usage of my app. I hope using custom tags and extend feature help me to follow DRY principle.
Problem
I'm writing reusable app. And I want to deploy it several times. Here is urls.py: ``` urlpatterns = patterns('', (r'^carphotos/', include('webui.photos.urls', app_name='car-photos') ), (r'^userphotos/', include('webui.photos.urls', app_name='profile-photos') ),) ``` and photos/urls.py: ``` urlpatterns = patterns('webui.photos.views', url(r'^$', album_list, name="album-list" ) url(r'^newalbum/$', album_page, {'create': True}, name="album-create"),) ``` On the album_list view I want to show url for creating new album album_page. I found that I have to use parameter current_app of reverse function to get proper URL. But how to get this current_app? I thought the answer is something simple. But I can't find it in django documentation. Thanks, Nick