https://github.com/webu/dalec-discourse
DALEC -- Aggregate a lot of discourse content for django
https://github.com/webu/dalec-discourse
aggregator dalec discourse django
Last synced: 11 months ago
JSON representation
DALEC -- Aggregate a lot of discourse content for django
- Host: GitHub
- URL: https://github.com/webu/dalec-discourse
- Owner: webu
- License: bsd-3-clause
- Created: 2023-06-26T09:36:01.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-23T15:09:09.000Z (over 2 years ago)
- Last Synced: 2024-06-11T17:42:01.026Z (about 2 years ago)
- Topics: aggregator, dalec, discourse, django
- Language: Python
- Homepage:
- Size: 47.9 KB
- Stars: 1
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# 🗣 dalec-discourse
[](https://pypi.org/project/dalec-discourse/)
[](https://github.com/psf/black)
[](https://pycqa.github.io/isort/)
[](https://semver.org/)
[](https://dalec-discourse.readthedocs.io/en/latest/?badge=latest)
Django Aggregate a Lot of External Content -- Discourse
Aggregate last discourse post from a given discourse instance.
Plugin of [🤖 dalec](https://github.com/webu/dalec).
## Installation
Install the module:
```
pip install dalec-discourse
```
In django settings `INSTALLED_APPS`, add:
```
INSTALLED_APPS = [
...
"dalec",
"dalec_prime",
"dalec_discourse",
...
]
```
## Usage
General usage:
```django
{% load dalec %}
{% dalec "discourse" content_type [channel=None] [channel_object=None] [template=None] %}
```
Real examples:
### Topics
Retrieves latest topics:
```django
{% dalec "discourse" "topic" %}
```
Retrieves latest topics from a category:
```django
{% dalec "discourse" "topic" channel="category" channel_object="15" %}
```
### Categories
Retrieves discourse categories:
```django
{% dalec "discourse" "category" %}
```
### User topics and replies
Retrieves user topics and replies:
```django
{% dalec "discourse" "user_topic_and_reply" channel="user" channel_object="zorro" %}
```
## Settings
Django settings must define:
- `DALEC_DISCOURSE_BASE_URL` : discourse instance url (ex: `https://discourse.org/`)
- `DALEC_DISCOURSE_API_USERNAME` : discourse username (ex: `admin`)
- `DALEC_DISCOURSE_API_TOKEN` : discourse api token (ex: `azeazeaezdfqsmlkrjzr`)
It could also define the login/password attribute, and then this auth method will be used
(may be usefull for htaccess access for instance):
- `DISCOURSE_AUTH_USERNAME`
- `DISCOURSE_AUTH_PASSWORD`