djangoldp-ds4go 1.0.1__tar.gz → 1.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/PKG-INFO +1 -1
- djangoldp_ds4go-1.0.3/README.md +59 -0
- djangoldp_ds4go-1.0.3/djangoldp_ds4go/__init__.py +1 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/management/commands/import_rss.py +13 -3
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go.egg-info/PKG-INFO +1 -1
- djangoldp_ds4go-1.0.1/README.md +0 -20
- djangoldp_ds4go-1.0.1/djangoldp_ds4go/__init__.py +0 -1
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/admin.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/apps.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/management/__init__.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/management/commands/__init__.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/migrations/0001_initial.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/migrations/0002_djangoldp_i18n.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/migrations/__init__.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/models/__base_model.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/models/__base_named_model.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/models/__init__.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/models/category.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/models/fact.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/models/media.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/translation.py +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go.egg-info/SOURCES.txt +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go.egg-info/dependency_links.txt +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go.egg-info/requires.txt +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go.egg-info/top_level.txt +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/setup.cfg +0 -0
- {djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/setup.py +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# DjangoLDP DS4GO
|
|
2
|
+
|
|
3
|
+
This is a Django package for the DS4GO ecosystem, providing models and tools for fact-checking applications.
|
|
4
|
+
|
|
5
|
+
See [DSIF](https://dsif.eu/).
|
|
6
|
+
|
|
7
|
+
## Configuration
|
|
8
|
+
|
|
9
|
+
Add `djangoldp_ds4go` to your `INSTALLED_APPS` and configure internationalization settings:
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
dependencies:
|
|
13
|
+
- djangoldp-account
|
|
14
|
+
- django-webidoidc-provider
|
|
15
|
+
- djangoldp-i18n
|
|
16
|
+
- djangoldp-ds4go
|
|
17
|
+
# ...
|
|
18
|
+
|
|
19
|
+
ldppackages:
|
|
20
|
+
- rest_framework
|
|
21
|
+
- oidc_provider
|
|
22
|
+
- djangoldp_account
|
|
23
|
+
- djangoldp_i18n
|
|
24
|
+
- djangoldp_ds4go
|
|
25
|
+
# ...
|
|
26
|
+
|
|
27
|
+
# [...]
|
|
28
|
+
|
|
29
|
+
server:
|
|
30
|
+
# [...] # See djangoldp configuration for other settings
|
|
31
|
+
|
|
32
|
+
USE_I18N: True
|
|
33
|
+
# Your application default language, will be served if no header are provided
|
|
34
|
+
LANGUAGE_CODE: fr
|
|
35
|
+
# Your application fallback language, will be served when a requested language is not available
|
|
36
|
+
MODELTRANSLATION_DEFAULT_LANGUAGE: fr
|
|
37
|
+
# Priority order. Ensure that every language is listed here to avoid empty translations
|
|
38
|
+
MODELTRANSLATION_FALLBACK_LANGUAGES:
|
|
39
|
+
- fr
|
|
40
|
+
- en
|
|
41
|
+
- es
|
|
42
|
+
# A list of all supported languages, you **must** make a migration afterwise
|
|
43
|
+
LANGUAGES:
|
|
44
|
+
- ['fr', 'Français']
|
|
45
|
+
- ['en', 'English']
|
|
46
|
+
- ['es', 'Español']
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Run `python manage.py makemigrations` and `python manage.py migrate` after updating language settings.
|
|
50
|
+
|
|
51
|
+
## Importing RSS Data
|
|
52
|
+
|
|
53
|
+
Import fact-check data from RSS feeds using the management command:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python manage.py import_rss --rss_file="path/to/rss.xml"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This command parses RSS XML to create or update facts, handling translations based on the feed language, creating category hierarchies, and importing media metadata.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.0.3'
|
{djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/management/commands/import_rss.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
|
|
3
3
|
from defusedxml.ElementTree import parse
|
|
4
|
+
from django.conf import settings
|
|
4
5
|
from django.core.management.base import BaseCommand
|
|
5
6
|
|
|
6
7
|
from djangoldp_ds4go.models import Category, Fact, Media
|
|
@@ -36,7 +37,12 @@ class Command(BaseCommand):
|
|
|
36
37
|
review = json.loads(review_elem.text) if review_elem is not None else {}
|
|
37
38
|
except json.JSONDecodeError:
|
|
38
39
|
review = {}
|
|
39
|
-
self.stderr.write(
|
|
40
|
+
self.stderr.write(
|
|
41
|
+
self.style.WARNING(
|
|
42
|
+
"Failed to parse review for item with guid %s. Ignoring."
|
|
43
|
+
% (guid)
|
|
44
|
+
)
|
|
45
|
+
)
|
|
40
46
|
|
|
41
47
|
description = item.find("description").text
|
|
42
48
|
content_elem = item.find("content:encoded", ns)
|
|
@@ -66,7 +72,9 @@ class Command(BaseCommand):
|
|
|
66
72
|
setattr(fact, f"author_{language}", author)
|
|
67
73
|
|
|
68
74
|
if enclosure_url:
|
|
69
|
-
setattr(fact, f"enclosure_{language}", enclosure_url)
|
|
75
|
+
setattr(fact, f"enclosure_{language}", enclosure_url).replace(
|
|
76
|
+
"medias/", getattr(settings, "MEDIA_URL", "/media/")
|
|
77
|
+
)
|
|
70
78
|
|
|
71
79
|
fact.save()
|
|
72
80
|
|
|
@@ -79,7 +87,9 @@ class Command(BaseCommand):
|
|
|
79
87
|
|
|
80
88
|
# Medias
|
|
81
89
|
for media_elem in item.findall("media:content", ns):
|
|
82
|
-
url = media_elem.get("url")
|
|
90
|
+
url = media_elem.get("url").replace(
|
|
91
|
+
"medias/", getattr(settings, "MEDIA_URL", "/media/")
|
|
92
|
+
)
|
|
83
93
|
file_size = int(media_elem.get("fileSize", 0))
|
|
84
94
|
width = int(media_elem.get("width", 0))
|
|
85
95
|
height = int(media_elem.get("height", 0))
|
djangoldp_ds4go-1.0.1/README.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# DjangoLDP DS4GO
|
|
2
|
-
|
|
3
|
-
This is a Django project for DS4GO ecosystem.
|
|
4
|
-
|
|
5
|
-
See [DSIF](https://dsif.eu/).
|
|
6
|
-
|
|
7
|
-
## Server settings
|
|
8
|
-
|
|
9
|
-
```yaml
|
|
10
|
-
USE_I18N: True
|
|
11
|
-
# Your application default language, will be served if no header are provided
|
|
12
|
-
LANGUAGE_CODE: fr
|
|
13
|
-
# Your application fallback language, will be served when a translation is not available
|
|
14
|
-
MODELTRANSLATION_DEFAULT_LANGUAGE: fr
|
|
15
|
-
# A list of all supported languages, you **must** make a migration afterwise
|
|
16
|
-
LANGUAGES:
|
|
17
|
-
- ['fr', 'Français']
|
|
18
|
-
- ['en', 'English']
|
|
19
|
-
- ['es', 'Español']
|
|
20
|
-
```
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.0.1'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/management/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/migrations/0002_djangoldp_i18n.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go/models/__base_named_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{djangoldp_ds4go-1.0.1 → djangoldp_ds4go-1.0.3}/djangoldp_ds4go.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|