https://github.com/rmed/flask-discussion
Flask extension that adds integration for several comment systems
https://github.com/rmed/flask-discussion
Last synced: 2 months ago
JSON representation
Flask extension that adds integration for several comment systems
- Host: GitHub
- URL: https://github.com/rmed/flask-discussion
- Owner: rmed
- License: mit
- Created: 2019-11-09T11:38:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-01T12:38:11.000Z (about 5 years ago)
- Last Synced: 2025-02-01T03:22:24.907Z (3 months ago)
- Language: HTML
- Size: 26.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - rmed/flask-discussion - Flask extension that adds integration for several comment systems (HTML)
README
# Flask-Discussion
[](https://flask-discussion.readthedocs.io/en/latest/?badge=latest)
Flask-Discussion is an extension for
[Flask](https://palletsprojects.com/p/flask/) that adds support for several
discussion/comment systems to your application.Supported comment systems:
- [Disqus](https://disqus.com)
- [Isso](https://github.com/posativ/isso/)
- [Remark42](https://github.com/umputun/remark42)## Quickstart
First install the extension:
```
pip install Flask-Discussion
```And then initialize it in your application:
```python
from flask import Flask
from flask_discussion import Discussiondiscussion = Discussion()
def init_app():
app = Flask(__name__)# Set config values
# .....discussion.init_app(app)
```This will register the extension templates (which contain the macros for each
comment system) with your application, making them available in your own
templates.If you want to be able to swap comment systems through the configuration of
your application, you may use the macro defined in
`flask_discussion/helper.html`:```django
{% import "flask_discussion/helper.html" as discussion %}
{{ discussion.render_comments(title="Page title", identifier="my-page", url="http://mypage.com") }}
```
Note that the macro **receives any keyword argument and will relay the
appropriate information to the corresponding system-specific macro** (i.e. each
comment system may use only specific information, therefore you should provide
all possible values for all comment systems).However, if you only want to use a specific comment system, you may import its
macros directly. For instance, for Disqus:```django
{% import "flask_discussion/disqus.html" as disqus %}
{{ disqus.render_comments(identifier="my-page", url="http://mypage.com", title="Page title") }}
```
## Documentation
Documentation is available at .