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.
 
 
 
 
 
 

33 satır
1.1 KiB

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