<p>Can i print out a url <code>/admin/manage/products/add</code> of a certain view in a template?</p>

<p>Here is the rule i want to create a link for</p>

<pre><code>(r'^manage/products/add/$', create_object, {'model': Product, 'post_save_redirect': ''}),
</code></pre>

<p>I would like to have /manage/products/add in a template without hardcoding it. How can i do this?</p>

<p><strong>Edit:</strong> I am not using the default admin (well, i am but it is at another url), this is my own</p>

[{'answer_id': 47212, 'author': 'Peter Hoffmann', 'author_id': 720, 'author_profile': 'https://Stackoverflow.com/users/720', 'pm_score': 2, 'selected': False, 'text': '<p>If you use <a href="https://docs.djangoproject.com/en/1.2/topics/http/urls/#naming-url-patterns" rel="nofollow noreferrer">named url patterns</a> you can do the follwing in your template</p>\n\n<pre><code>{% url create_object %}\n</code></pre>\n'}, {'answer_id': 47213, 'author': 'Cristian', 'author_id': 680, 'author_profile': 'https://Stackoverflow.com/users/680', 'pm_score': 0, 'selected': False, 'text': '<p>The preferred way of creating the URL is by adding a <code>get_absolute_url</code> method to your model classes. You can hardcode the path there so you at least get closer to following the KISS philosophy.</p>\n\n<p>You can go further by utilizing the <code>permalink</code> decorator that figures the path based on the urls configuration.</p>\n\n<p>You can read more in the django documentation <a href="https://docs.djangoproject.com/en/dev/ref/models/instances/#get-absolute-url" rel="nofollow noreferrer">here</a>.</p>\n'}, {'answer_id': 47304, 'author': 'Harley Holcombe', 'author_id': 1057, 'author_profile': 'https://Stackoverflow.com/users/1057', 'pm_score': 5, 'selected': True, 'text': '<p>You can use <code>get_absolute_url</code>, but that will only work for a particular object.  Since your object hasn\'t been created yet, it won\'t work in this case.</p>\n\n<p>You want to use <a href="https://docs.djangoproject.com/en/1.2/topics/http/urls/#naming-url-patterns" rel="nofollow noreferrer">named URL patterns</a>.  Here\'s a quick intro:</p>\n\n<p>Change the line in your urls.py to:</p>\n\n<pre><code>(r\'^manage/products/add/$\', create_object, {\'model\': Product, \'post_save_redirect\': \'\'}, "create-product"),\n</code></pre>\n\n<p>Then, in your template you use this to display the URL:</p>\n\n<pre><code>{% url create-product %}\n</code></pre>\n\n<p>If you\'re using Django 1.5 or higher you need this:</p>\n\n<pre><code>{% url \'create-product\' %}\n</code></pre>\n\n<p>You can do some more powerful things with named URL patterns, they\'re very handy.  Note that they are only in the development version (and also 1.0).</p>\n'}]
['https://Stackoverflow.com/questions/47207', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2592/']