from django.conf.urls import url
from rest_framework import routers
from service import views

router = routers.DefaultRouter()
router.register('placement_points', views.PlacementPointViewSet)
router.register('pre_placement_points', views.PrePlacementPointViewSet)
router.register('ao_rayons', views.AOViewSet)
router.register('postamate_and_pvz_groups', views.PostAndPVZCategoryViewSet)
router.register('other_object_groups', views.OtherObjectsCategoryViewSet)

urlpatterns = router.urls

urlpatterns += [
    url(r'load_csv/', views.refresh_placement_points.as_view(), name='upload_placement_points'),
    url(r'upload_post_and_pvz/', views.upload_post_and_pvz, name='upload_post_and_pvz'),
    url(r'upload_other_objects/', views.upload_other_objects, name='upload_other_objects'),
    url(r'me/', views.get_current_user, name='me'),
    url('download_pvz_template/', views.download_pvz_template, name='download_pvz_template'),
    url('download_other_template/', views.download_other_template, name='download_other_template'),
]
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
