diff --git a/.gitignore b/.gitignore index 68bc17f9..ec0f3da1 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,5 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +static/ diff --git a/adaptive_hockey_federation/adaptive_hockey_federation/settings.py b/adaptive_hockey_federation/adaptive_hockey_federation/settings.py index 84546f65..318ae6f5 100644 --- a/adaptive_hockey_federation/adaptive_hockey_federation/settings.py +++ b/adaptive_hockey_federation/adaptive_hockey_federation/settings.py @@ -9,6 +9,7 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.2/ref/settings/ """ +import os from pathlib import Path @@ -53,10 +54,11 @@ ROOT_URLCONF = 'adaptive_hockey_federation.urls' +TEMPLATES_DIR = os.path.join(BASE_DIR, 'templates') TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [TEMPLATES_DIR], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -117,7 +119,9 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ -STATIC_URL = 'static/' +STATIC_URL = '/static/' + +STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),) # Default primary key field type # https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field diff --git a/adaptive_hockey_federation/main/urls.py b/adaptive_hockey_federation/main/urls.py index be614e14..2b42c518 100644 --- a/adaptive_hockey_federation/main/urls.py +++ b/adaptive_hockey_federation/main/urls.py @@ -6,7 +6,7 @@ urlpatterns = [ - path('users', views.users, name='users'), + path('users/', views.users, name='users'), path('teams//', views.teams_id, name='teams_id'), path('teams/', views.teams, name='teams'), path( diff --git a/adaptive_hockey_federation/templates/base.html b/adaptive_hockey_federation/templates/base.html index bd76e1eb..abf55399 100644 --- a/adaptive_hockey_federation/templates/base.html +++ b/adaptive_hockey_federation/templates/base.html @@ -2,35 +2,28 @@ - - - {% load static %} - - - - - - - - + + {% block title %} Тут будет заголовок {% endblock %} - +
- {% include 'includes/header.html' %} + {% include 'includes/header.html' %}
- {% block content %} - Тут будет основной текст - {% endblock %} + {% block content %} + Основной текст + {% endblock %}
-