Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea/
.history/
.vscode/
__pycache__/
Binary file added __pycache__/manage.cpython-39.pyc
Binary file not shown.
Binary file added cpims/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added cpims/__pycache__/apps.cpython-39.pyc
Binary file not shown.
Binary file added cpims/__pycache__/logging_config.cpython-39.pyc
Binary file not shown.
Binary file added cpims/__pycache__/settings.cpython-39.pyc
Binary file not shown.
Binary file added cpims/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file added cpims/__pycache__/views.cpython-39.pyc
Binary file not shown.
Binary file added cpims/__pycache__/wsgi.cpython-39.pyc
Binary file not shown.
77 changes: 31 additions & 46 deletions cpims/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@

ALLOWED_HOSTS = ['*']

cpims_db_host = os.environ.get('CPIMS_HOST') if os.environ.get('CPIMS_HOST') else '127.0.0.1'
cpims_db_pass = os.environ.get('CPIMS_PASSWORD') if os.environ.get('CPIMS_PASSWORD') else 'Xaen!ee8'
cpims_db_instance = os.environ.get('CPIMS_DB') if os.environ.get('CPIMS_DB') else 'cpims_upgrade'
cpims_db_port = os.environ.get('CPIMS_PORT') if os.environ.get('CPIMS_PORT') else '5432'
cpims_db_user = os.environ.get('CPIMS_DBUSER') if os.environ.get('CPIMS_DBUSER') else 'cpimsdbuser'
cpims_debug = eval(os.environ.get('CPIMS_DEBUG')) if os.environ.get('CPIMS_DEBUG') else False
cpims_db_host = os.environ.get(
'CPIMS_HOST') if os.environ.get('CPIMS_HOST') else '127.0.0.1'
cpims_db_pass = os.environ.get(
'CPIMS_PASSWORD') if os.environ.get('CPIMS_PASSWORD') else 'root'
cpims_db_instance = os.environ.get(
'CPIMS_DB') if os.environ.get('CPIMS_DB') else 'db_cpims'
cpims_db_port = os.environ.get(
'CPIMS_PORT') if os.environ.get('CPIMS_PORT') else '5432'
cpims_db_user = os.environ.get(
'CPIMS_DBUSER') if os.environ.get('CPIMS_DBUSER') else 'root'
cpims_debug = eval(os.environ.get(
'CPIMS_DEBUG')) if os.environ.get('CPIMS_DEBUG') else True

DEBUG = cpims_debug

Expand All @@ -44,28 +50,11 @@
'rest_framework',
'data_cleanup',
'cpovc_offline_mode',
# forums,
# 'adminsortable',
# 'simple_forums',
'cpovc_manage',
'notifications',
'cpovc_help',
'cpovc_manage',
'notifications',
'cpovc_help',
]

# MIDDLEWARE = (
# 'django.contrib.sessions.middleware.SessionMiddleware',
# 'django.middleware.common.CommonMiddleware',
# 'django.middleware.csrf.CsrfViewMiddleware',
# 'django.contrib.auth.middleware.AuthenticationMiddleware',
# 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
# # 'cpovc_access.middleware.AuthenticationPolicyMiddleware',
# 'django.contrib.messages.middleware.MessageMiddleware',
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
# 'django.middleware.security.SecurityMiddleware',
# #'cpovc_main.middleware.SqlPrintingMiddleware',
# 'cpovc_auth.middleware.UserRestrictMiddleware',
# # 'cpovc_access.middleware.FailedLoginMiddleware',
# )

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
Expand Down Expand Up @@ -94,9 +83,7 @@
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'cpovc_main.context_processors.global_settings',
# forums,
# 'simple_forums.context_processors.installed_apps'
'cpovc_main.context_processors.global_settings',
],
},
},
Expand All @@ -105,13 +92,6 @@
WSGI_APPLICATION = 'cpims.wsgi.application'


# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
# }

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
Expand Down Expand Up @@ -150,9 +130,9 @@
AUTH_USER_MODEL = 'cpovc_auth.AppUser'

# AUTHENTICATION_BACKENDS = ['cpovc_auth.backends.CPOVCAuthenticationBackend']
AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']
# AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend']

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

ALLOW_NATIONAL_ID_LOGIN = True

Expand Down Expand Up @@ -222,10 +202,8 @@
}
CSRF_FAILURE_VIEW = 'cpims.views.csrf_failure'

OFFLINE_MODE_CAPABILITY_ENABLED = eval(os.environ.get('CAN_WORK_OFFLINE', 'True'))

# import logging configs
from .logging_config import *
OFFLINE_MODE_CAPABILITY_ENABLED = eval(
os.environ.get('CAN_WORK_OFFLINE', 'False'))

# kmhfl API
KMHFL_USERNAME = '10004'
Expand All @@ -241,7 +219,14 @@
KMHFL_TOKEN_URL = ''

# nascop API
NASCOP_API_BASE_URL = os.environ.get('NASCOP_API_BASE_URL') if os.environ.get('NASCOP_API_BASE_URL') else ''
NASCOP_LOGIN_URL = os.environ.get('NASCOP_LOGIN_URL') if os.environ.get('NASCOP_LOGIN_URL') else ''
NASCOP_EMAIL = os.environ.get('NASCOP_EMAIL') if os.environ.get('NASCOP_EMAIL') else ''
NASCOP_PASSWORD = os.environ.get('NASCOP_PASSWORD') if os.environ.get('NASCOP_PASSWORD') else ''
NASCOP_API_BASE_URL = os.environ.get(
'NASCOP_API_BASE_URL') if os.environ.get('NASCOP_API_BASE_URL') else ''
NASCOP_LOGIN_URL = os.environ.get(
'NASCOP_LOGIN_URL') if os.environ.get('NASCOP_LOGIN_URL') else ''
NASCOP_EMAIL = os.environ.get(
'NASCOP_EMAIL') if os.environ.get('NASCOP_EMAIL') else ''
NASCOP_PASSWORD = os.environ.get(
'NASCOP_PASSWORD') if os.environ.get('NASCOP_PASSWORD') else ''


STATIC_ROOT = os.path.join(BASE_DIR, 'assets')
Loading