Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vignette
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alexandre (erdnaxe)
vignette
Commits
94e1a13c
Commit
94e1a13c
authored
Oct 31, 2018
by
Alexandre (erdnaxe)
🎇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redirect to app after login
parent
b699bad2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
urls.py
web/vignette/urls.py
+12
-3
No files found.
web/vignette/urls.py
View file @
94e1a13c
...
...
@@ -17,7 +17,7 @@ from django.contrib import admin
from
django.contrib.auth.decorators
import
login_required
from
django.urls
import
include
,
path
from
django.utils.translation
import
gettext_lazy
as
_
from
django.views.generic
import
TemplateView
from
django.views.generic
import
TemplateView
,
RedirectView
from
rest_framework_swagger.views
import
get_swagger_view
# Customize Django Admin site
...
...
@@ -26,12 +26,21 @@ admin.site.site_title = _('Gallery Admin')
admin
.
site
.
login
=
login_required
(
admin
.
site
.
login
)
urlpatterns
=
[
path
(
''
,
TemplateView
.
as_view
(
template_name
=
"index.html"
)),
# React app
path
(
''
,
login_required
(
TemplateView
.
as_view
(
template_name
=
"index.html"
)),
name
=
'app'
),
# Django REST API
path
(
'api/'
,
get_swagger_view
(
title
=
'Vignette API'
)),
path
(
'api/auth/'
,
include
(
'rest_auth.urls'
)),
path
(
'api/auth/registration/'
,
include
(
'rest_auth.registration.urls'
)),
path
(
'api/gallery/'
,
include
(
'gallery.urls'
)),
# Django Admin
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'account/'
,
include
(
'allauth.urls'
)),
# Login, logout, registration, email verification...
path
(
''
,
include
(
'allauth.urls'
)),
# On first login Django-allauth redirects here rather than on the app
path
(
'accounts/profile/'
,
RedirectView
.
as_view
(
pattern_name
=
'app'
,
permanent
=
False
))
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment