from django.conf.urls.defaults import *
from .feed import blogFeed

urlpatterns = patterns('copywriting',
    (r'^feed\.rss$',                                    blogFeed()),
    (r'^feed/$',                                        blogFeed()),
    (r'^tag/(?P<in_tag>\w+)/$',	                        'views.withTag'),
    # (r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/$', 'views.listBlogEntriesByYearMonthDay'),
    (r'^(?P<requestYear>\d+)/(?P<requestMonth>\d+)/$',	'views.listArticlesByYearMonth'),
    (r'^(?P<requestYear>\d+)/$',                        'views.listArticlesByYear'),
    (r'^(?P<slug>[^\.]+)/$',                            'views.showArticle'),
    (r'^$',                                             'views.listArticles'),
)

from django.conf.urls.defaults import *
from .feed import blogFeed

urlpatterns = patterns('copywriting',
    (r'^feed\.rss$', blogFeed()),
    (r'^feed/$', blogFeed()),
    (r'^tag/(?P<in_tag>\w[\w-]+)/$', 'views.withTag'),
    # (r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/$', 'views.listBlogEntriesByYearMonthDay'),
    (r'^(?P<requestYear>\d+)/(?P<requestMonth>\d+)/$', 'views.listArticlesByYearMonth'),
    (r'^(?P<requestYear>\d+)/$', 'views.listArticlesByYear'),
    (r'^(?P<slug>[^\.]+)/$', 'views.showArticle'),
    (r'^$', 'views.listArticles'),
)

Allow slugs in url patterns
Allow slugs in url patterns

  from django.conf.urls.defaults import *
  from .feed import blogFeed
  
  urlpatterns = patterns('copywriting',
-     (r'^feed\.rss$',                                    blogFeed()),
-     (r'^feed/$',                                        blogFeed()),
+     (r'^feed\.rss$', blogFeed()),
+     (r'^feed/$', blogFeed()),
-     (r'^tag/(?P<in_tag>\w+)/$',	                        'views.withTag'),
+     (r'^tag/(?P<in_tag>\w[\w-]+)/$', 'views.withTag'),
      # (r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/$', 'views.listBlogEntriesByYearMonthDay'),
-     (r'^(?P<requestYear>\d+)/(?P<requestMonth>\d+)/$',	'views.listArticlesByYearMonth'),
+     (r'^(?P<requestYear>\d+)/(?P<requestMonth>\d+)/$', 'views.listArticlesByYearMonth'),
-     (r'^(?P<requestYear>\d+)/$',                        'views.listArticlesByYear'),
+     (r'^(?P<requestYear>\d+)/$', 'views.listArticlesByYear'),
-     (r'^(?P<slug>[^\.]+)/$',                            'views.showArticle'),
+     (r'^(?P<slug>[^\.]+)/$', 'views.showArticle'),
-     (r'^$',                                             'views.listArticles'),
+     (r'^$', 'views.listArticles'),
  )
  
Allow slugs in url patterns
## Code Before:
from django.conf.urls.defaults import *
from .feed import blogFeed

urlpatterns = patterns('copywriting',
    (r'^feed\.rss$',                                    blogFeed()),
    (r'^feed/$',                                        blogFeed()),
    (r'^tag/(?P<in_tag>\w+)/$',	                        'views.withTag'),
    # (r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/$', 'views.listBlogEntriesByYearMonthDay'),
    (r'^(?P<requestYear>\d+)/(?P<requestMonth>\d+)/$',	'views.listArticlesByYearMonth'),
    (r'^(?P<requestYear>\d+)/$',                        'views.listArticlesByYear'),
    (r'^(?P<slug>[^\.]+)/$',                            'views.showArticle'),
    (r'^$',                                             'views.listArticles'),
)

## Instruction:
Allow slugs in url patterns
## Code After:
from django.conf.urls.defaults import *
from .feed import blogFeed

urlpatterns = patterns('copywriting',
    (r'^feed\.rss$', blogFeed()),
    (r'^feed/$', blogFeed()),
    (r'^tag/(?P<in_tag>\w[\w-]+)/$', 'views.withTag'),
    # (r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/$', 'views.listBlogEntriesByYearMonthDay'),
    (r'^(?P<requestYear>\d+)/(?P<requestMonth>\d+)/$', 'views.listArticlesByYearMonth'),
    (r'^(?P<requestYear>\d+)/$', 'views.listArticlesByYear'),
    (r'^(?P<slug>[^\.]+)/$', 'views.showArticle'),
    (r'^$', 'views.listArticles'),
)
