25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

29 satır
1007 B

  1. from django.conf.urls import include, url
  2. from django.views.generic import TemplateView
  3. from tastypie.api import Api
  4. from .api import ImageResource, ThumbnailResource, PinResource, UserResource
  5. v1_api = Api(api_name='v1')
  6. v1_api.register(ImageResource())
  7. v1_api.register(ThumbnailResource())
  8. v1_api.register(PinResource())
  9. v1_api.register(UserResource())
  10. urlpatterns = [
  11. url(r'^api/', include(v1_api.urls, namespace='api')),
  12. url(r'^pins/pin-form/$', TemplateView.as_view(template_name='core/pin_form.html'),
  13. name='pin-form'),
  14. url(r'^pins/tag/(?P<tag>(\w|-)+)/$', TemplateView.as_view(template_name='core/pins.html'),
  15. name='tag-pins'),
  16. url(r'^pins/user/(?P<user>(\w|-)+)/$', TemplateView.as_view(template_name='core/pins.html'),
  17. name='user-pins'),
  18. url(r'^(?P<pin>[0-9]+)/$', TemplateView.as_view(template_name='core/pins.html'),
  19. name='recent-pins'),
  20. url(r'^$', TemplateView.as_view(template_name='core/pins.html'),
  21. name='recent-pins'),
  22. ]