Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
djangoldp-packages
djangoldp
Commits
a4c4621d
Commit
a4c4621d
authored
4 years ago
by
plup
Browse files
Options
Downloads
Patches
Plain Diff
feature: moved yaml settings to default settings
parent
402c5f46
No related branches found
No related tags found
1 merge request
!158
Load djangoldp conguration from YAML file
Pipeline
#7547
passed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
djangoldp/tests/runner.py
+1
-1
1 addition, 1 deletion
djangoldp/tests/runner.py
djangoldp/tests/settings_default.py
+53
-94
53 additions, 94 deletions
djangoldp/tests/settings_default.py
djangoldp/tests/settings_yaml.py
+0
-53
0 additions, 53 deletions
djangoldp/tests/settings_yaml.py
with
54 additions
and
148 deletions
djangoldp/tests/runner.py
+
1
−
1
View file @
a4c4621d
...
@@ -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 diff is collapsed.
Click to expand it.
djangoldp/tests/settings_default.py
+
53
−
94
View file @
a4c4621d
"""
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 diff is collapsed.
Click to expand it.
djangoldp/tests/settings_yaml.py
deleted
100644 → 0
+
0
−
53
View file @
402c5f46
"""
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
"""
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment