<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: kawuondo</title>
    <description>The latest articles on DEV Community by kawuondo (@kawuondo).</description>
    <link>https://dev.to/kawuondo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F310271%2Ff77a1c5b-7e27-4aa4-b97a-e66e59ce499c.png</url>
      <title>DEV Community: kawuondo</title>
      <link>https://dev.to/kawuondo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kawuondo"/>
    <language>en</language>
    <item>
      <title>Answer: Django doesn't match CreateView if the route begins with 'post/'</title>
      <dc:creator>kawuondo</dc:creator>
      <pubDate>Mon, 06 Jan 2020 21:13:53 +0000</pubDate>
      <link>https://dev.to/kawuondo/answer-django-doesn-t-match-createview-if-the-route-begins-with-post-485p</link>
      <guid>https://dev.to/kawuondo/answer-django-doesn-t-match-createview-if-the-route-begins-with-post-485p</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/45000677/django-doesnt-match-createview-if-the-route-begins-with-post/45000712#45000712" rel="noopener noreferrer"&gt;
              &lt;span class="title-flare"&gt;answer&lt;/span&gt; re:  Django doesn't match CreateView if the route begins with 'post/'
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Jul  9 '17&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/45000677/django-doesnt-match-createview-if-the-route-begins-with-post/45000712#45000712" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          2
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;Django will use the first matching regex, which in this case is &lt;code&gt;r'^post/(?P&amp;lt;slug&amp;gt;[-\w]+)/$'&lt;/code&gt;. This routes to &lt;code&gt;PostDetailView&lt;/code&gt; with a slug of &lt;code&gt;new&lt;/code&gt;. Since you don't have a post with that slug, the view will raise a 404. &lt;/p&gt;
&lt;p&gt;To fix this, simply put the &lt;code&gt;CreatePostView&lt;/code&gt; above the &lt;code&gt;PostDetailView&lt;/code&gt;:&lt;/p&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/45000677/django-doesnt-match-createview-if-the-route-begins-with-post/45000712#45000712" rel="noopener noreferrer"&gt;Open Full Answer&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
