- Add newsapp to INSTALLED_APPS
- Add 'newsapp': 'testpackage.migrations.news' in MIGRATION_MODULES
- Run manage.py makemigrations newsapp
- Run manage.py migrate newsapp
- Include the news in your project urls.py path('news/', include('newsapp.urls'))
You can extend new object with extra field by defining in settings.py:
NEWSAPP_NEWS_CLASS = 'news.models.NewCustom'
and in models.py start writing your class like this:
from newsapp.models import NewAbstract, NewCategory class NewCustom(NewAbstract): ...your code here... class Meta(NewAbstract.Meta): abstract = True
- NEWSAPP_NEWS_ON_PAGE - how much news in list. Default 10
- NEWSAPP_ENABLE_ARCHIVE - add archive by date functionality
- NEWSAPP_ENABLE_CATEGORIES - add categories functionality
- NEWSAPP_ENABLE_TAGS - add tags functionality
- support django-modeltranslation