From cf9eb34e965c781fbf4ca92bf09bd35879b73daa Mon Sep 17 00:00:00 2001 From: prance Date: Sun, 30 Jan 2022 19:34:46 +0100 Subject: [PATCH] get "welcome" back as home --- MUOR/MUOR/settings.py | 4 ++-- MUOR/MUOR/urls.py | 6 +++--- MUOR/MUOR/views.py | 6 ------ MUOR/templates/home.html | 18 ++++++++++-------- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/MUOR/MUOR/settings.py b/MUOR/MUOR/settings.py index 9c25529c5..663c18a3e 100644 --- a/MUOR/MUOR/settings.py +++ b/MUOR/MUOR/settings.py @@ -126,7 +126,7 @@ STATICFILES_DIRS = ( STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') -LOGIN_REDIRECT_URL = 'home' +LOGIN_REDIRECT_URL = '/loader.html' LOGOUT_REDIRECT_URL = 'home' # Default primary key field type @@ -142,7 +142,7 @@ AVAILABLE_PORTS_RANGE = (6000, 7000) DOCKER_IMAGE = 'openrefine:latest' SESSION_EXPIRE_AT_BROWSER_CLOSE = True -SESSION_COOKIE_AGE = 60 * 60 +SESSION_COOKIE_AGE = 1 * 60 CELERY_BROKER_URL = 'redis+socket:///var/run/redis/redis-server.sock' CELERY_TIMEZONE = "Europe/Warsaw" diff --git a/MUOR/MUOR/urls.py b/MUOR/MUOR/urls.py index b4251c028..a5b993210 100644 --- a/MUOR/MUOR/urls.py +++ b/MUOR/MUOR/urls.py @@ -25,7 +25,7 @@ urlpatterns = [ path('admin/', admin.site.urls), path('', include('django.contrib.auth.urls')), path('signup/', SignUpView.as_view(), name='signup'), - path('welcome/', TemplateView.as_view(template_name='home.html'), name='home'), - path('favicon.ico', RedirectView.as_view(url=staticfiles_storage.url('images/favicon.ico'))), - path('', views.home, name='home') + path('', TemplateView.as_view(template_name='home.html'), name='home'), + path('favicon.ico', RedirectView.as_view( + url=staticfiles_storage.url('images/favicon.ico'))), ] diff --git a/MUOR/MUOR/views.py b/MUOR/MUOR/views.py index 944f84540..776825dac 100644 --- a/MUOR/MUOR/views.py +++ b/MUOR/MUOR/views.py @@ -20,9 +20,3 @@ class SignUpView(generic.CreateView): success_url = reverse_lazy('login') template_name = 'registration/signup.html' - -def home(request): - # if request.user.is_authenticated: - # logout(request) - - return redirect("/welcome") diff --git a/MUOR/templates/home.html b/MUOR/templates/home.html index 6dd9f1a1a..f519e245b 100644 --- a/MUOR/templates/home.html +++ b/MUOR/templates/home.html @@ -4,12 +4,14 @@ {% block title %}Home{% endblock %} {% block content %} -{% if user.is_authenticated %} -

Hi {{ user.username }}!

-

Log Out

-{% else %} -

You are not logged in

-

Log In

-

Create an account

-{% endif %} + {% if user.is_authenticated %} +

Hi {{ user.username }}!

+

Go to your instance

+

Log Out

+ {% else %} +

You are not logged in

+

Log In

+

Create an + account

+ {% endif %} {% endblock %} \ No newline at end of file