from django.contrib import admin
from django.urls import path, include, re_path
from django.contrib.auth import views as auth_views
from revproxy.views import ProxyView
from django.contrib.admin.views.decorators import staff_member_required

urlpatterns = [
    path('admin/', admin.site.urls),
    path('accounts/login/', auth_views.LoginView.as_view(), name='login'),
    path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'),
    re_path(r'^flower/(?P<path>.*)$', staff_member_required(ProxyView.as_view(upstream='http://127.0.0.1:5555/flower/'))),
    path('', include('core.urls')),
]