For example:
using the module registration with templates in templates/registration and
an url.py including:
url(r'^accounts/', include('registration.backends.default.urls'))
what would be the best way to address the registration link: /accounts/register/ without hardcoding it?
but in general, how do I refer an app (and eventually the views) and not use an hard coded URL?
I have seen once a dedicated function but I am not sure.
Inside your views and other Python modules you can use the
reversefunction. https://docs.djangoproject.com/en/1.4/topics/http/urls/#reverseIn the template you would use the
urltemplate tag. https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#urlIt helps to give your url patterns names to make this reversing as easy as possible. https://docs.djangoproject.com/en/1.4/topics/http/urls/#id2 The included url patterns in django-registration all have names that you can reference.