kopia lustrzana https://gitlab.com/marnanel/chapeau
Moving un_chapeau's login code here to chapeau.
rodzic
50731c0446
commit
98339716e3
|
@ -2,3 +2,4 @@ include LICENSE.txt
|
|||
include README.md
|
||||
recursive-include chapeau *.py
|
||||
recursive-include chapeau *.xml
|
||||
recursive-include chapeau *.html
|
||||
|
|
|
@ -1,12 +1,32 @@
|
|||
from django.contrib import admin
|
||||
from django.urls import path, re_path, include
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib.auth import views as auth_views
|
||||
import oauth2_provider.views as oauth2_views
|
||||
import chapeau.kepi.urls
|
||||
import chapeau.trilby_api.urls
|
||||
from . import settings
|
||||
|
||||
##################################
|
||||
# OAuth2 provider endpoints
|
||||
|
||||
oauth2_endpoint_views = [
|
||||
path('authorize', oauth2_views.AuthorizationView.as_view(), name="authorize"),
|
||||
path('token', oauth2_views.TokenView.as_view(), name="token"),
|
||||
path('revoke-token', oauth2_views.RevokeTokenView.as_view(), name="revoke-token"),
|
||||
]
|
||||
|
||||
##################################################
|
||||
|
||||
urlpatterns = [
|
||||
path(r'admin/', admin.site.urls),
|
||||
|
||||
# auth
|
||||
path('accounts/login/', auth_views.LoginView.as_view(), name='login'),
|
||||
path('accounts/logout/', auth_views.LogoutView.as_view(), name='logout'),
|
||||
path('oauth/', include((oauth2_endpoint_views, 'oauth2_provider'), namespace="oauth2_provider")),
|
||||
|
||||
# chapeau's own stuff
|
||||
# path('', chapeau.tophat_ui.views.FrontPageView.as_view()), # or something
|
||||
path(r'', include(chapeau.kepi.urls)),
|
||||
path(r'', include(chapeau.trilby_api.urls)),
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<html><head><title>chapeau login</title></head>
|
||||
<body>
|
||||
|
||||
<h1>chapeau 👒 development login</h1>
|
||||
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
|
||||
</body></html>
|
Ładowanie…
Reference in New Issue