Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Django News Box
This django app is a toolbox to easily setup news in your projects.
## Features
* easy custom fields
* optional SEO fields
* optional publication period
* optional i18n support via hvad
* optional django-cms support
## Installation
## django CMS integration
### models.py
class News(NewsboxCMSBase, NewsboxSEOBase):
class Meta:
newsbox_detail_url_name = "news_detail" # optional
### cms_app.py
class NewsApphook(CMSApp):
name = _("News")
urls = ["myproject.news_urls"]
apphook_pool.register(NewsApphook)
### news_urls.py
from django.conf.urls import patterns, url
from newsbox.views import NewsboxDetailView
from .models import News
urlpatterns = patterns(
'',
url(
r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[0-9a-zA-Z_-]+)/$',
NewsboxDetailView.as_view(
template_name="myproject/news_detail.html",
model=News,),
name='news_detail'),
)
### cms_plugin.py
TODO