Skip to content

Commit

Permalink
chore: Update gh actions and corresponding setting and docs configura…
Browse files Browse the repository at this point in the history
…tion.
  • Loading branch information
Nico-AP committed Nov 15, 2024
1 parent b25ae7f commit c7ea3f6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install psycopg2 mysqlclient
pip install -r test_project/dev_requirements.txt
- name: Run Tests With ${{ matrix.db }}
env:
DB: ${{ matrix.db }}
Expand All @@ -54,6 +55,7 @@ jobs:
DB_USER: ${{ matrix.db_user }}
DB_PASSWORD: password
DB_PORT: ${{ matrix.db_port }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
python test_project/manage.py test ddm
Expand Down
4 changes: 2 additions & 2 deletions docs/antora-playbook.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
site:
title: DDM Documentation
start_page: ddm::index.adoc
start_page: index.adoc
content:
sources:
- url: https://github.com/uzh/ddm.git
branches: [main, develop]
tags: [v1.0.0]
tags: [v1.0.19, v1.0.0]
version: true
start_path: docs
ui:
Expand Down
2 changes: 2 additions & 0 deletions test_project/dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage==7.6.4
python-dotenv==1.0.1
2 changes: 2 additions & 0 deletions test_project/manage.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env python
import os
import sys
from dotenv import load_dotenv


def main():
"""Run administrative tasks."""
load_dotenv()
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
try:
from django.core.management import execute_from_command_line
Expand Down
31 changes: 18 additions & 13 deletions test_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import os
import sys

from dotenv import load_dotenv

load_dotenv()

PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DDM_DIR = os.path.join(PROJECT_DIR, 'ddm')
Expand All @@ -10,8 +13,6 @@
sys.path.append(PROJECT_DIR)
sys.path.append(DDM_DIR)

test_config = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'test_config.json')))

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
Expand Down Expand Up @@ -69,19 +70,24 @@

DB_CONFIG = {
'default': {
'ENGINE': test_config['DB_ENGINE'],
'NAME': test_config['DB_NAME'],
'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
'NAME': os.environ.get('DB_NAME', 'ddmtestdb'),
'USER': os.environ.get('DB_USER', 'ddmtestuser'),
'PASSWORD': os.environ.get('DB_PASSWORD'),
'HOST': os.environ.get('DB_HOST', ''),
}
}
DATABASES = DB_CONFIG

ALLOWED_HOSTS = ['localhost', '127.0.0.1']
SECRET_KEY = os.environ.get('SECRET_KEY')
ROOT_URLCONF = 'urls'
DATABASES = DB_CONFIG
DEBUG = True
SECRET_KEY = test_config['SECRET_KEY']
SITE_ID = 1

USE_TZ = True
TIME_ZONE = 'Europe/Zurich'

LANGUAGE_CODE = 'en'
USE_I18N = True
LANGUAGES = [
Expand All @@ -108,26 +114,25 @@
}
}

DDM_SETTINGS = {
'EMAIL_PERMISSION_CHECK': r'.*(\.|@)uzh\.ch$',
}

AUTH_PASSWORD_VALIDATORS = [
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', },
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', },
{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', },
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', },
]

DDM_SETTINGS = {
'EMAIL_PERMISSION_CHECK': r'.*(\.|@)uzh\.ch$',
}

LOGIN_REDIRECT_URL = '/projects/'
LOGOUT_REDIRECT_URL = '/login/'

DDM_DEFAULT_HEADER_IMG_LEFT = '/media/project_10/headers/DDLabLogo.png'
DDM_DEFAULT_HEADER_IMG_RIGHT = '/media/project_10/headers/IKMZ_Logo.png'
DDM_DEFAULT_HEADER_IMG_LEFT = ''
DDM_DEFAULT_HEADER_IMG_RIGHT = ''

# INTERNAL_IPS = ["127.0.0.1", ] # Added for debugging purposes


# ckeditor 5 configuration
CKEDITOR_5_FILE_UPLOAD_PERMISSION = 'authenticated'
CKEDITOR_5_ALLOW_ALL_FILE_TYPES = True
Expand Down

0 comments on commit c7ea3f6

Please sign in to comment.