diff --git a/OACPL/settings.base.py b/OACPL/settings.base.py index 4b1ba69..abbbb27 100644 --- a/OACPL/settings.base.py +++ b/OACPL/settings.base.py @@ -51,7 +51,8 @@ INSTALLED_APPS = [ 'expert_witnesses', 'forum.apps.ForumConfig', 'main.apps.MainConfig', - 'newsletters.apps.NewslettersConfig' + 'newsletters.apps.NewslettersConfig', + 'tinymce' ] MIDDLEWARE = [ @@ -142,5 +143,3 @@ STATIC_URL = '/static/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/' - -CKEDITOR_UPLOAD_PATH = 'ckeditor' diff --git a/OACPL/urls.py b/OACPL/urls.py index 80a6f0d..45331d0 100644 --- a/OACPL/urls.py +++ b/OACPL/urls.py @@ -39,5 +39,6 @@ urlpatterns = [ url(r'^media/secure/(?P.*)$', protected_serve, {'document_root': os.path.join(settings.MEDIA_ROOT, 'secure')}, name='secure media'), url(r'^media/(?P.*)$', serve, {'document_root': settings.MEDIA_ROOT}, name='media'), url(r'^newsletter/subscribe', newsletters.views.subscribe, name='subscribe'), - url(r'^newsletter/', newsletters.views.newsletters, name='newsletters') + url(r'^newsletter/', newsletters.views.newsletters, name='newsletters'), + url(r'^tinymce/', include('tinymce.urls')) ] diff --git a/newsletters/models.py b/newsletters/models.py index 5aedf67..b893411 100644 --- a/newsletters/models.py +++ b/newsletters/models.py @@ -2,9 +2,11 @@ from django.db import models from django.contrib.auth.admin import User from django.utils import timezone +from tinymce.models import HTMLField + class Newsletter(models.Model): - body = models.TextField() + body = HTMLField() created = models.DateTimeField(auto_now_add=True) creator = models.ForeignKey(User) publish = models.DateTimeField(default=timezone.now) diff --git a/requirements.txt b/requirements.txt index e01550b..de69a84 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ bootstrap-admin==0.3.7.1 Django==1.11.5 Pillow==4.2.1 requests==2.11.1 +django-tinymce4-lite==1.7.0