diff --git a/.gitignore b/.gitignore index aac87cd..31d976d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,8 @@ media # Backup files # *.bak -# If you are using PyCharm # +# If you are using PyCharm # +.idea/ # User-specific stuff .idea/**/workspace.xml .idea/**/tasks.xml @@ -103,7 +104,8 @@ env/ venv/ ENV/ env.bak/ -venv.bak/ +venv.bak/ +soita-venv/ # mkdocs documentation /site diff --git a/config/settings.py b/config/settings.py index b6a07f7..dac18de 100644 --- a/config/settings.py +++ b/config/settings.py @@ -36,6 +36,7 @@ DEBUG = get_secret("DEBUG") ALLOWED_HOSTS = get_secret("ALLOWED_HOSTS") +APPEND_SLASH = False # Application definition diff --git a/config/templates/base.html b/config/templates/base.html new file mode 100644 index 0000000..09c3505 --- /dev/null +++ b/config/templates/base.html @@ -0,0 +1,16 @@ + + +
+ + +Username: {{user.username}}
+Name: {{user.first_name}} {{user.last_name}}
+Email: {{user.email}}
+ {% else %} + Guest nr 123 + {% endif %} +{% endblock %} + diff --git a/config/urls.py b/config/urls.py index a40f86d..ee67220 100644 --- a/config/urls.py +++ b/config/urls.py @@ -16,8 +16,10 @@ Including another URLconf from django.contrib import admin from django.urls import include from django.urls import path +from .views import index urlpatterns = [ + path('', index), path('users/', include("users.urls")), path('questions/', include("questions.urls")), path('answers/', include("answers.urls")), diff --git a/config/views.py b/config/views.py new file mode 100644 index 0000000..02bfdd5 --- /dev/null +++ b/config/views.py @@ -0,0 +1,10 @@ +from django.shortcuts import render, redirect +from django.template import loader + + + +def index(request): + # context = { + # 'latest_question_list': latest_question_list, + # } + return render(request, 'index.html') \ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..09c3505 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,16 @@ + + + + + +Username: {{user.username}}
+Name: {{user.first_name}} {{user.last_name}}
+Email: {{user.email}}
+ {% else %} + Guest nr 123 + {% endif %} +{% endblock %} +