Skip to content

Commit

Permalink
Fix logout; createsuperuser -> createmongodbsuperuser
Browse files Browse the repository at this point in the history
  • Loading branch information
andersju committed Aug 31, 2022
1 parent 6750c42 commit 180b017
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Nedan är ett exempel på en minimal installation i Linux.
cp bibstat/settings_local.py.example bibstat/settings_local.py
vi bibstat/settings_local.py # eller nano, eller...
# Skapa admin-användare
python manage.py createsuperuser --username=super [email protected]
python manage.py createmongodbsuperuser --username=super [email protected]

# Starta servern
python manage.py runserver
Expand Down
4 changes: 3 additions & 1 deletion bibstat/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.admin",
"django_js_reverse",
# Bibstat specific apps
"django_mongoengine",
"django_mongoengine.mongo_auth",
#'django_mongoengine.mongo_admin',
'django_mongoengine.mongo_admin',
"libstat",
]

Expand Down Expand Up @@ -145,6 +146,7 @@
)

LOGIN_REDIRECT_URL = "/surveys"
LOGOUT_REDIRECT_URL = "/admin"

"""
Logging
Expand Down
4 changes: 2 additions & 2 deletions bibstat/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.urls import re_path
from django.views.generic import TemplateView
from django.contrib.auth import logout
from django.contrib.auth.views import LogoutView

from django_js_reverse.views import urls_js

Expand Down Expand Up @@ -63,7 +63,7 @@
re_path(r"^export$", export_api, name="export_api"),
# Auth
re_path(r"^login$", login, name="login"),
re_path(r"^logout$", logout, {"next_page": "admin"}, name="logout"),
re_path(r"^logout$", LogoutView.as_view(), name='logout'),
# Index
re_path(r"^$", index, name="index"),
re_path(r"^admin$", libstat.views.index.admin, name="admin"),
Expand Down

0 comments on commit 180b017

Please sign in to comment.