
from django.contrib import admin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import include

from tastypie.api import Api

from main import views
from main.feeds import LatestMoviesFeed
from main.api import ResourceMovies


v1_api = Api(api_name='v1')
v1_api.register(ResourceMovies())


urlpatterns = [
    path('', views.home, name='home'),
    path('movies/', views.movies, name='movies'),
    path('movies/<str:args>', views.movies, name='movies'),
    path('movies/director/<str:name>', views.by_director, name='by_director'),
    path('addcount/<int:id>/', views.addcount, name='addcount'),
    path('ultimas/rss/', LatestMoviesFeed()),
    path('admin/', admin.site.urls),
    path('api/', include(v1_api.urls)),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

