implemented for blog as a test
This commit is contained in:
parent
60c3c8ed8e
commit
615514259d
|
@ -38,7 +38,7 @@ THIRD_PARTY_APPS = (
|
|||
'allauth.socialaccount', # registration
|
||||
'stdimage',
|
||||
'rest_framework',
|
||||
'markdownx',
|
||||
'draceditor',
|
||||
)
|
||||
|
||||
# Apps specific for this project go here.
|
||||
|
|
|
@ -33,7 +33,7 @@ urlpatterns = [
|
|||
|
||||
url(r'^api/v1/', include(router.urls, namespace='v1')),
|
||||
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||
url(r'^markdownx/', include('markdownx.urls')),
|
||||
url(r'^draceditor/', include('draceditor.urls')),
|
||||
url(r'^blog/$', blog, name='contact'),
|
||||
url(r'^blog/rss/$', BlogFeed()),
|
||||
url(r'^blog/(?P<slug>[0-9A-Za-z_\-]+)/$', blog, name='blog-item'),
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from django.contrib import admin
|
||||
from django.db import models
|
||||
from django.contrib.admin import ModelAdmin
|
||||
from markdownx.widgets import AdminMarkdownxWidget
|
||||
|
||||
from mhackspace.blog.models import Post, Category
|
||||
|
||||
|
@ -14,9 +13,6 @@ class PostAdmin(ModelAdmin):
|
|||
readonly_fields = ('published_date',)
|
||||
filter_horizontal = ('categories',)
|
||||
prepopulated_fields = {"slug": ("title",)}
|
||||
formfield_overrides = {
|
||||
models.TextField: {'widget': AdminMarkdownxWidget},
|
||||
}
|
||||
|
||||
@admin.register(Category)
|
||||
class CategoryAdmin(ModelAdmin):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.urls import reverse
|
||||
from draceditor.models import DraceditorField
|
||||
|
||||
from mhackspace.users.models import User
|
||||
from stdimage.models import StdImageField
|
||||
|
@ -34,7 +35,7 @@ class Post(models.Model):
|
|||
"height": 220,
|
||||
"crop": True}})
|
||||
|
||||
description = models.TextField()
|
||||
description = DraceditorField()
|
||||
published_date = models.DateTimeField(default=timezone.now)
|
||||
updated_date = models.DateTimeField(default=timezone.now)
|
||||
active = models.BooleanField(default=True)
|
||||
|
|
|
@ -62,4 +62,4 @@ git+https://github.com/olymk2/scaffold.git
|
|||
djangorestframework==3.5.4
|
||||
django-filter==1.0.1
|
||||
|
||||
django-markdownx
|
||||
draceditor
|
||||
|
|
Loading…
Reference in New Issue