from django.conf.urls import url
from . import views

urlpatterns = [
    # ex: /api/threads/
    url(r'^$', views.post_list.as_view()),
    # ex: /api/threads/143/first-post
    url(r'(?P<pk>[0-9]+?)/(?P<slug>[-\w\d]+?)/$', views.post_detail.as_view())
]
from django.conf.urls import url
from . import views

urlpatterns = [
    # ex: /api/board/{name}/threads/
    url(r'^$', views.post_list.as_view()),
    # ex: /api/board/{name}/threads/{key}/{title}
    url(r'(?P<key>[a-zA-Z0-9]{4,4})/(?P<slug>[-\w]+?)/$', views.post_detail.as_view())
]
replace pk with key