from __future__ import absolute_import

import debug_toolbar
from django.conf.urls import include
from django.contrib import admin
from django.contrib.flatpages import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import path, re_path

admin.autodiscover()

urlpatterns = [
    re_path(r"", include("dashboard.urls")),
    re_path(r"^admin/", admin.site.urls),
    re_path(r"^impersonate/", include("impersonate.urls")),
    re_path(r"^accounts/", include("allauth.urls")),
    re_path(r"^database/", include("userdbs.urls")),
    re_path(r"^domains/", include("domains.urls")),
    re_path(r"^hosting/", include("hostingpackages.urls")),
    re_path(r"^website/", include("websites.urls")),
    re_path(r"^mail/", include("managemails.urls")),
    re_path(r"^osuser/", include("osusers.urls")),
    re_path(r"^contact/", include("contact_form.urls")),
    re_path(r"^impressum/$", views.flatpage, {"url": "/impressum/"}, name="imprint"),
]

# Uncomment the next line to serve media files in dev.
# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urlpatterns += staticfiles_urlpatterns()
urlpatterns += [
    path("__debug__/", include(debug_toolbar.urls)),
]
