1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Configure Django App

This commit is contained in:
Alexandre Iooss
2019-07-08 11:08:07 +02:00
parent 5c03f15d6f
commit 3345ddb0f7
6 changed files with 59 additions and 30 deletions

View File

@ -1,21 +1,21 @@
"""note_kfet URL Configuration
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2018-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include
from django.views.generic import RedirectView
urlpatterns = [
# No app, so redirect to admin
path('', RedirectView.as_view(pattern_name='admin:index'), name='index'),
# Include Django Contrib and Core routers
# admin/login/ is redirected to the non-admin login page
path('i18n/', include('django.conf.urls.i18n')),
path('accounts/', include('django.contrib.auth.urls')),
path('accounts/profile/',
RedirectView.as_view(pattern_name='index')),
path('admin/doc/', include('django.contrib.admindocs.urls')),
path('admin/', admin.site.urls),
]