From 607d49bcd02939a1f992297f5d50e2ce08378472 Mon Sep 17 00:00:00 2001 From: Dani Hodovic Date: Mon, 5 Aug 2024 16:02:11 -0300 Subject: [PATCH] docs: add usersessions_list to sample_deployment --- sample_deployment/poetry.lock | 8 +++--- sample_deployment/pyproject.toml | 2 +- .../example/templates/example/home.html | 3 +++ .../templates/example/social_metadata.html | 3 +-- .../sample_deployment/settings.py | 27 +++++++++++-------- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/sample_deployment/poetry.lock b/sample_deployment/poetry.lock index 628bd1a..ba1dcbd 100644 --- a/sample_deployment/poetry.lock +++ b/sample_deployment/poetry.lock @@ -309,13 +309,13 @@ steam = ["python3-openid (>=3.0.8)"] [[package]] name = "django-allauth-ui" -version = "1.2.0" +version = "1.3.0" description = "" optional = false python-versions = "<4.0.0,>=3.8" files = [ - {file = "django_allauth_ui-1.2.0-py3-none-any.whl", hash = "sha256:b45b033b1f0cc991f57440bc14078d1f2c37e377caf5a671588a5e7a5a91542e"}, - {file = "django_allauth_ui-1.2.0.tar.gz", hash = "sha256:8b072715a0bcf90189b3ce720e1a5228ab69ad9b060232d2c477617106ea6f69"}, + {file = "django_allauth_ui-1.3.0-py3-none-any.whl", hash = "sha256:e7bcd7f42df9ff26e25a3c2857cdfd07999d8cb87526e15eaa5f3aad53781da5"}, + {file = "django_allauth_ui-1.3.0.tar.gz", hash = "sha256:8736d5996757ab213b27fbda3df603a612de496892e553bd09fe3557d475b59b"}, ] [package.dependencies] @@ -1467,4 +1467,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "380026a733034835470daf212a1fdc60a57fdb581892be6ed71fee0d1213cc4e" +content-hash = "8744ffe68a96f6ac9fc3abf20d21e53daa414f6c225e6dbcd32f5b858b55184e" diff --git a/sample_deployment/pyproject.toml b/sample_deployment/pyproject.toml index 5d8bceb..b8890c1 100644 --- a/sample_deployment/pyproject.toml +++ b/sample_deployment/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.11" -django-allauth-ui = "^1.2.0" +django-allauth-ui = "^1.3.0" gunicorn = "^22.0.0" django-allauth = "^0.63.3" django-widget-tweaks = "^1.5.0" diff --git a/sample_deployment/sample_deployment/example/templates/example/home.html b/sample_deployment/sample_deployment/example/templates/example/home.html index 018b903..89ed66d 100644 --- a/sample_deployment/sample_deployment/example/templates/example/home.html +++ b/sample_deployment/sample_deployment/example/templates/example/home.html @@ -25,6 +25,9 @@
  • Reauthenticate
  • +
  • + User Sessions +
  • Logout
  • diff --git a/sample_deployment/sample_deployment/example/templates/example/social_metadata.html b/sample_deployment/sample_deployment/example/templates/example/social_metadata.html index f2e67bc..83e4f95 100644 --- a/sample_deployment/sample_deployment/example/templates/example/social_metadata.html +++ b/sample_deployment/sample_deployment/example/templates/example/social_metadata.html @@ -11,6 +11,5 @@
    You need to log in to display social account metadata
    - -{% endif %} + {% endif %} {% endblock content %} diff --git a/sample_deployment/sample_deployment/settings.py b/sample_deployment/sample_deployment/settings.py index 67aafdb..667fdb5 100644 --- a/sample_deployment/sample_deployment/settings.py +++ b/sample_deployment/sample_deployment/settings.py @@ -36,26 +36,28 @@ # Application definition INSTALLED_APPS = [ + "allauth_ui", + "allauth", + "allauth.account", + "allauth.socialaccount", + "allauth.socialaccount.providers.github", + "allauth.socialaccount.providers.gitlab", + "allauth.usersessions", "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", - "django.contrib.sessions", + "django.contrib.humanize", "django.contrib.messages", - "whitenoise.runserver_nostatic", + "django.contrib.sessions", "django.contrib.staticfiles", + "django_browser_reload", "django_extensions", "sample_deployment.example", - "allauth_ui", - "allauth", - "allauth.account", - "allauth.socialaccount", - "allauth.socialaccount.providers.github", - "allauth.socialaccount.providers.gitlab", - "widget_tweaks", - "tailwind", "sample_deployment.theme", - "django_browser_reload", "slippers", + "tailwind", + "whitenoise.runserver_nostatic", + "widget_tweaks", ] MIDDLEWARE = [ @@ -65,6 +67,7 @@ "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", + "allauth.usersessions.middleware.UserSessionsMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "django_browser_reload.middleware.BrowserReloadMiddleware", @@ -213,3 +216,5 @@ "level": "INFO", }, } + +USERSESSIONS_TRACK_ACTIVITY = True