I have a bunch of regular site paths that I'd like to be able to refer to
both in my Python code and in my templates, e.g.
settings.py:
site_root = "/portal"
contact_url = site_root + "/contact"
sitemap_url = site_root + "/sitemap"
login_url = site_root + "/account/login"
logout_url = site_root + "/account/logout"
newspost_url = site_root + "/news/post"
and then make these accessible in some random template using somthing like
the following:
404.html:
{% extends "base.html" %}
{% block content %}
Sorry, we couldn't find that page.
<p>
Maybe it has moved -- why not look in the
<a href="{% block sitemap_url %}">Site Directory</a>?
<p>
If it seems like an error, please <a href="{% block contact_url %}">contact
us</a>.
{% endblock %}
Can anyone suggest a good way of doing this?
TIA,
Ian
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.