Commit fe964e5a authored by RJC's avatar RJC

changed TIMEZONE settings and added tz_detect for utc to local time conversion

parent 2cc6c087
...@@ -11,8 +11,10 @@ https://docs.djangoproject.com/en/3.2/ref/settings/ ...@@ -11,8 +11,10 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
""" """
from pathlib import Path from pathlib import Path
from dotenv import load_dotenv
import os import os
DIRNAME = os.path.abspath(os.path.dirname(__file__)) DIRNAME = os.path.abspath(os.path.dirname(__file__))
load_dotenv()
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
...@@ -34,12 +36,14 @@ ALLOWED_HOSTS = [] ...@@ -34,12 +36,14 @@ ALLOWED_HOSTS = []
INSTALLED_APPS = [ INSTALLED_APPS = [
'forum.apps.ForumConfig', 'forum.apps.ForumConfig',
'Dashboard.apps.DashboardConfig',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'tz_detect',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
...@@ -108,7 +112,7 @@ AUTH_PASSWORD_VALIDATORS = [ ...@@ -108,7 +112,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC' TIME_ZONE = 'Asia/Hong_Kong'
USE_I18N = True USE_I18N = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment