Skip to content
Snippets Groups Projects
Commit a4c4621d authored by plup's avatar plup
Browse files

feature: moved yaml settings to default settings

parent 402c5f46
No related branches found
No related tags found
1 merge request!158Load djangoldp conguration from YAML file
Pipeline #7547 passed
...@@ -4,7 +4,7 @@ import yaml ...@@ -4,7 +4,7 @@ import yaml
import django import django
from django.conf import settings as django_settings from django.conf import settings as django_settings
from djangoldp.conf.settings import LDPSettings from djangoldp.conf.settings import LDPSettings
from djangoldp.tests.settings_yaml import yaml_config from djangoldp.tests.settings_default import yaml_config
# override config loading # override config loading
ldpsettings = LDPSettings("") ldpsettings = LDPSettings("")
......
"""This module contains YAML configurations for djangoldp testing."""
from django.conf.global_settings import *
yaml_config = """
# defines default settings for testing DjangoLDP. You can use this in your own packages by following the example in dependencies:
# runner.py
DEBUG=False ldppackages:
- djangoldp.tests
ALLOWED_HOSTS=["*"]
SITE_URL='http://happy-dev.fr' server:
BASE_URL='http://happy-dev.fr' ALLOWED_HOSTS:
- '*'
DJANGOLDP_PACKAGES=['djangoldp.tests'] LDP_RDF_CONTEXT:
INSTALLED_APPS=('django.contrib.auth', "@context":
'django.contrib.contenttypes', "@vocab": "http://happy-dev.fr/owl/#"
'django.contrib.sessions', "foaf": "http://xmlns.com/foaf/0.1/"
'django.contrib.admin', "doap": "http://usefulinc.com/ns/doap#"
'django.contrib.messages', "ldp": "http://www.w3.org/ns/ldp#"
'django.contrib.staticfiles', "rdfs": "http://www.w3.org/2000/01/rdf-schema#"
'guardian', "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
'djangoldp', "xsd": "http://www.w3.org/2001/XMLSchema#"
'djangoldp.tests', "geo": "http://www.w3.org/2003/01/geo/wgs84_pos#"
) "acl": "http://www.w3.org/ns/auth/acl#"
"name": "rdfs:label"
DATABASES={ "website": "foaf:homepage"
'default': { "deadline": "xsd:dateTime"
'ENGINE': 'django.db.backends.sqlite3', "lat": "geo:lat"
} "lng": "geo:long"
} "jabberID": "foaf:jabberID"
"permissions": "acl:accessControl"
REST_FRAMEWORK = { "mode": "acl:mode"
'DEFAULT_PAGINATION_CLASS': 'djangoldp.pagination.LDPPagination', "view": "acl:Read"
'PAGE_SIZE': 5 "change": "acl:Write"
} "add": "acl:Append"
"delete": "acl:Delete"
AUTH_USER_MODEL='tests.User' "control": "acl:Control"
ANONYMOUS_USER_NAME = None AUTH_USER_MODEL: 'tests.User'
EMAIL_HOST: somewhere
MIDDLEWARE = [ ANONYMOUS_USER_NAME: None
'django.middleware.security.SecurityMiddleware', AUTHENTICATION_BACKENDS:
'django.contrib.sessions.middleware.SessionMiddleware', - django.contrib.auth.backends.ModelBackend
'django.middleware.common.CommonMiddleware', - guardian.backends.ObjectPermissionBackend
'django.middleware.csrf.CsrfViewMiddleware', ROOT_URLCONF: djangoldp.urls
'django.contrib.auth.middleware.AuthenticationMiddleware', SEND_BACKLINKS: false
'django.contrib.messages.middleware.MessageMiddleware', SITE_URL: http://happy-dev.fr
'django.middleware.clickjacking.XFrameOptionsMiddleware', BASE_URL: http://happy-dev.fr
] REST_FRAMEWORK:
AUTHENTICATION_BACKENDS=( DEFAULT_PAGINATION_CLASS: djangoldp.pagination.LDPPagination
'django.contrib.auth.backends.ModelBackend', 'guardian.backends.ObjectPermissionBackend') PAGE_SIZE: 5
USE_ETAGS: true
ROOT_URLCONF='djangoldp.urls' DEFAULT_CONTENT_TYPE: text/html
FILE_CHARSET: utf-8
TEMPLATES = [ SEND_BACKLINKS: False
{ """
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
LDP_RDF_CONTEXT={
"@context": {
"@vocab": "http://happy-dev.fr/owl/#",
"foaf": "http://xmlns.com/foaf/0.1/",
"doap": "http://usefulinc.com/ns/doap#",
"ldp": "http://www.w3.org/ns/ldp#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"geo": "http://www.w3.org/2003/01/geo/wgs84_pos#",
"acl": "http://www.w3.org/ns/auth/acl#",
"name": "rdfs:label",
"website": "foaf:homepage",
"deadline": "xsd:dateTime",
"lat": "geo:lat",
"lng": "geo:long",
"jabberID": "foaf:jabberID",
"permissions": "acl:accessControl",
"mode": "acl:mode",
"view": "acl:Read",
"change": "acl:Write",
"add": "acl:Append",
"delete": "acl:Delete",
"control": "acl:Control"
}
}
SEND_BACKLINKS=False
"""This module contains YAML configurations for djangoldp testing."""
yaml_config = """
dependencies:
ldppackages:
- djangoldp.tests
server:
ALLOWED_HOSTS:
- '*'
LDP_RDF_CONTEXT:
"@context":
"@vocab": "http://happy-dev.fr/owl/#"
"foaf": "http://xmlns.com/foaf/0.1/"
"doap": "http://usefulinc.com/ns/doap#"
"ldp": "http://www.w3.org/ns/ldp#"
"rdfs": "http://www.w3.org/2000/01/rdf-schema#"
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
"xsd": "http://www.w3.org/2001/XMLSchema#"
"geo": "http://www.w3.org/2003/01/geo/wgs84_pos#"
"acl": "http://www.w3.org/ns/auth/acl#"
"name": "rdfs:label"
"website": "foaf:homepage"
"deadline": "xsd:dateTime"
"lat": "geo:lat"
"lng": "geo:long"
"jabberID": "foaf:jabberID"
"permissions": "acl:accessControl"
"mode": "acl:mode"
"view": "acl:Read"
"change": "acl:Write"
"add": "acl:Append"
"delete": "acl:Delete"
"control": "acl:Control"
AUTH_USER_MODEL: 'tests.User'
EMAIL_HOST: somewhere
ANONYMOUS_USER_NAME: None
AUTHENTICATION_BACKENDS:
- django.contrib.auth.backends.ModelBackend
- guardian.backends.ObjectPermissionBackend
ROOT_URLCONF: djangoldp.urls
SEND_BACKLINKS: false
SITE_URL: http://happy-dev.fr
BASE_URL: http://happy-dev.fr
REST_FRAMEWORK:
DEFAULT_PAGINATION_CLASS: djangoldp.pagination.LDPPagination
PAGE_SIZE: 5
USE_ETAGS: true
DEFAULT_CONTENT_TYPE: text/html
FILE_CHARSET: utf-8
SEND_BACKLINKS: False
"""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment