from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings
from django.conf.urls.i18n import i18n_patterns
from inventory import views
import debug_toolbar

urlpatterns = [
    path('__debug__/', include(debug_toolbar.urls)),
    path('silk/', include('silk.urls', namespace='silk')),
    path('api-auth/', include('rest_framework.urls')),
    path('api/', include('api.urls')),
    path('dj-rest-auth/', include('dj_rest_auth.urls')),

]
urlpatterns += i18n_patterns(
    path('admin/', admin.site.urls),
    path('switch_language/', views.switch_language, name='switch_language'),
    path('accounts/', include('allauth.urls')),
    path('prometheus/', include('django_prometheus.urls')),
    path('', include('inventory.urls')),
    path('ledger/', include('django_ledger.urls', namespace='django_ledger')),

)

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
