I have a django app myapp
, which registers a menu-command foo
to be called via ./manage.py foo
.
The command should send a reminder email to all users. The mail contains a link in it, to a specific view, lets say bar
. bar
has the this entry in the urls.py
:
url(r'^(?P<id>\d+)/$', views.bar, name='bar'),
How do I correctly determine the absolute url in this context?
The relative url would be reverse('myapp:bar')
. But how do I get the base to that?
I could just hardcode it in settings.py
of my project, but that would go against the philosophy of django, wouldn't it?