Add profile page and temporary base.html

This commit is contained in:
Sokurov Idar
2021-02-06 14:33:55 +03:00
parent 2919761b2f
commit 981e793e3e
6 changed files with 149 additions and 7 deletions

View File

@@ -15,7 +15,6 @@ from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
@@ -27,7 +26,6 @@ DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
@@ -72,7 +70,6 @@ TEMPLATES = [
WSGI_APPLICATION = 'access_controller.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
@@ -83,7 +80,6 @@ DATABASES = {
}
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
@@ -102,7 +98,6 @@ AUTH_PASSWORD_VALIDATORS = [
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/
@@ -116,7 +111,6 @@ USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/
@@ -126,3 +120,4 @@ STATICFILES_DIRS = [
]
MEDIA_ROOT = BASE_DIR / 'media'
MEDIA_URL = '/media/'

View File

@@ -13,9 +13,15 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from access_controller import settings
from main.views import *
urlpatterns = [
path('admin/', admin.site.urls),
path('profile/', profile_page, name="Profile"),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)