<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Dynamic URLs in Django</title>
	<atom:link href="http://www.artfulcode.net/articles/dynamic-urls-django/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artfulcode.net/articles/dynamic-urls-django/</link>
	<description>Resources and tips for dynamic, interactive languages.</description>
	<lastBuildDate>Mon, 23 Jan 2012 14:26:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Dave Holden</title>
		<link>http://www.artfulcode.net/articles/dynamic-urls-django/comment-page-1/#comment-2097</link>
		<dc:creator>Dave Holden</dc:creator>
		<pubDate>Thu, 05 Aug 2010 09:29:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/articles/dynamic-urls-django/#comment-2097</guid>
		<description>For simple HMTL pages you could always use the FlatPages app that comes with DJango:-

http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/

Or, a generic method would have the urls.py such as

urlpatterns = patterns(‘mysite.controllers’,
    (r’^people/$’, ‘people.index’),
    (r&#039;^(?P[^/]+)/(?P[^/]+)/$&#039;, &#039;generic_view&#039;)
)

the generic_view then loads a specific view if it exists, else it uses a simple generic handler.</description>
		<content:encoded><![CDATA[<p>For simple HMTL pages you could always use the FlatPages app that comes with DJango:-</p>
<p><a href="http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/" rel="nofollow">http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/</a></p>
<p>Or, a generic method would have the urls.py such as</p>
<p>urlpatterns = patterns(‘mysite.controllers’,<br />
    (r’^people/$’, ‘people.index’),<br />
    (r&#8217;^(?P[^/]+)/(?P[^/]+)/$&#8217;, &#8216;generic_view&#8217;)<br />
)</p>
<p>the generic_view then loads a specific view if it exists, else it uses a simple generic handler.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: floepi</title>
		<link>http://www.artfulcode.net/articles/dynamic-urls-django/comment-page-1/#comment-2068</link>
		<dc:creator>floepi</dc:creator>
		<pubDate>Wed, 16 Jun 2010 00:01:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/articles/dynamic-urls-django/#comment-2068</guid>
		<description>Hi there,

I am trying to make this work with Django 1.2 and always get an error:

unknown specifier: ?P.

My urls.py looks like


from django.conf.urls.defaults import *

def free_pattern(request, view, segments=&quot;&quot;):
    segments = segments.split(r&#039;/&#039;)
    try:
        view_fn = getattr(&#039;/&#039;, view)
    except AttributeError:
        raise Http404
    return view_fn(request, *segments)


urlpatterns = patterns(&#039;mysite.controllers&#039;,
    (r&#039;^people/$&#039;, &#039;people.index&#039;),
    (r&#039;^(?P.+?)/(?:(?P.+?)/)?$&#039;, free_pattern)
)


Could you please tell me what I am doing wrong. 

Thanks for posting this solution by the way. 

Cheers,

Phil</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>I am trying to make this work with Django 1.2 and always get an error:</p>
<p>unknown specifier: ?P.</p>
<p>My urls.py looks like</p>
<p>from django.conf.urls.defaults import *</p>
<p>def free_pattern(request, view, segments=&#8221;"):<br />
    segments = segments.split(r&#8217;/')<br />
    try:<br />
        view_fn = getattr(&#8216;/&#8217;, view)<br />
    except AttributeError:<br />
        raise Http404<br />
    return view_fn(request, *segments)</p>
<p>urlpatterns = patterns(&#8216;mysite.controllers&#8217;,<br />
    (r&#8217;^people/$&#8217;, &#8216;people.index&#8217;),<br />
    (r&#8217;^(?P.+?)/(?:(?P.+?)/)?$&#8217;, free_pattern)<br />
)</p>
<p>Could you please tell me what I am doing wrong. </p>
<p>Thanks for posting this solution by the way. </p>
<p>Cheers,</p>
<p>Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Napierkowski</title>
		<link>http://www.artfulcode.net/articles/dynamic-urls-django/comment-page-1/#comment-2008</link>
		<dc:creator>Kyle Napierkowski</dc:creator>
		<pubDate>Sat, 20 Feb 2010 09:49:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.artfulcode.net/articles/dynamic-urls-django/#comment-2008</guid>
		<description>Thanks much, I&#039;m working on my first Django site right now and was wondering about creating this kind of catch-all.  Simple and does the job.

Kyle</description>
		<content:encoded><![CDATA[<p>Thanks much, I&#8217;m working on my first Django site right now and was wondering about creating this kind of catch-all.  Simple and does the job.</p>
<p>Kyle</p>
]]></content:encoded>
	</item>
</channel>
</rss>

