Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

urls.py 1.1 KiB

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