https://github.com/pmaigutyak/mp-articles
https://github.com/pmaigutyak/mp-articles
articles django posts
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/pmaigutyak/mp-articles
- Owner: pmaigutyak
- License: isc
- Created: 2017-02-05T17:21:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-09-13T06:14:15.000Z (over 3 years ago)
- Last Synced: 2025-09-25T13:53:21.649Z (8 months ago)
- Topics: articles, django, posts
- Language: Python
- Size: 55.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MP-Articles
Django articles app.
### Installation
Install with pip:
```sh
$ pip install django-mp-articles
```
Add articles to urls.py:
```
urlpatterns += i18n_patterns(
url(r'^articles/', include('articles.urls', namespace='articles')),
)
```
Add articles to settings.py:
```
INSTALLED_APPS = [
'articles',
]
# Default: ('news', _('News')),
ARTICLE_TYPE_CHOICES = (
('example', _('Example')),
('example2', _('Example 2')),
)
# Default: None
DEFAULT_ARTICLE_TYPE = 'example'
```
Run migrations:
```
$ python manage.py migrate
```
### Template tags
To get latest articles in template you should load 'articles' tags and add 'get_latest_articles' template tag into your template.
Examples:
```
{% load articles %}
{% get_latest_articles article_type='example' %}
{% get_latest_articles article_type='example' count=3 %}
{% get_latest_articles article_type='example' as latest_articles %}
```
### Requirements
App require this packages:
* django-modeltranslation
* django-mp-pagination
* django-ckeditor