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("search/<str:prefix>:<str:query>", views.search, name="search"),
    path("search/<str:query>", views.search, {'prefix': ''}, name="search"),
    path("search/", views.search, {'prefix': '', 'query': ''}, name="search"),
    path("about/", views.about, name="about"),
    path("bugs/", views.bugs, name="bugs"),
    path("movie/<int:id>", views.movie, name="movie"),
    path("ultimas/rss/", LatestMoviesFeed()),
    path("admin/", admin.site.urls),
    # path('api/', include(v1_api.urls)),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
