django ckeditor won't show on the formDefine css class in django FormsDjango Passing Custom Form Parameters to FormsetShould I put #! (shebang) in Python scripts, and what form should it take?Create empty queryset by default in django form fieldsDjango Form won't renderDjango Forms: if not valid, show form with error messageCkeditor - DjangoDjango Form Fields won't show in my templateAttributeError: 'NoneType' object has no attribute 'split' Getting Error unknowingly on CMD. How to resolve it?Setdata to CKEditor from Multiple CKEditors
How to load files as a quickfix window at start-up
How to save money by shopping at a variety of grocery stores?
How to run a command 1 out of N times in Bash
What caused the end of cybernetic implants?
ELI5 what is SMTChecker?
What's the origin of the concept of alternate dimensions/realities?
What is the chance of getting a Red Cabbage in year 1?
How were US credit cards verified in-store in the 1980's?
Moscow SVO airport, how to avoid scam taxis without pre-booking?
Could a simple hospital oxygen mask protect from aerosol poison?
Why do presidential pardons exist in a country having a clear separation of powers?
Can you use Apple Care+ without any checks (bringing just MacBook)?
Why do motor drives have multiple bus capacitors of small value capacitance instead of a single bus capacitor of large value?
Four day weekend?
What is the practical impact of using System.Random which is not cryptographically random?
How is the anglicism "jackpot" commonly expressed in French?
Why does the U.S. military maintain their own weather satellites?
Don't look at what I did there
Can a level 20 Berserker barbarian use the Frenzy feature all day with one use?
Is Borg adaptation only temporary?
Calculate Landau's function
IList<T> implementation
Coupling two 15 Amp circuit breaker for 20 Amp
apt-file regex: find multiple packages at once using or
django ckeditor won't show on the form
Define css class in django FormsDjango Passing Custom Form Parameters to FormsetShould I put #! (shebang) in Python scripts, and what form should it take?Create empty queryset by default in django form fieldsDjango Form won't renderDjango Forms: if not valid, show form with error messageCkeditor - DjangoDjango Form Fields won't show in my templateAttributeError: 'NoneType' object has no attribute 'split' Getting Error unknowingly on CMD. How to resolve it?Setdata to CKEditor from Multiple CKEditors
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Followed every step mentioned in https://django-ckeditor.readthedocs.io/en/latest/, but when I view the form, I don't get any editor. Also I did run "python manage.py collectstatic"
settings.py specific to ckeditor.
INSTALLED_APPS = [
'ckeditor',
'ckeditor_uploader',
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,"static")
CKEDITOR_BASEPATH = STATIC_ROOT+"/ckeditor/ckeditor"
CKEDITOR_UPLOAD_PATH = "ck_uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
MEDIA_URL = STATIC_URL+'media/'
MEDIA_ROOT = os.path.join(STATIC_ROOT,'media')
urls.py
url(r'^ckeditor/', include('ckeditor_uploader.urls')),
forms.py
from ckeditor.widgets import CKEditorWidget
class BlogPostForm(forms.ModelForm):
class Meta():
model = BlogPost
fields = ('title','brief','content','accept_comments','is_public')
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
No suggestions worked so far (including moving the widget definition out of Meta).
I am custom rendering the forms and this is how the field is getting rendered in the form.
form.details
Also rendering the whole form using form.as_p
didn't make any difference.
This is what the HTML field shows when I use Chrome developer tools --> Elements.
<textarea cols="40" id="id_details" name="details" rows="10" required="" data-processed="0" data-config=""skin": "moono-lisa", "toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "toolbar": "Custom", "height": 291, "width": 835, "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725, "toolbar_Custom": [["Bold", "Italic", "Underline"], ["NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"], ["Link", "Unlink"], ["RemoveFormat", "Source"]], "language": "en-us"" data-external-plugin-resources="[]" data-id="id_details" data-type="ckeditortype"></textarea>
python-3.x django-forms ckeditor5
add a comment |
Followed every step mentioned in https://django-ckeditor.readthedocs.io/en/latest/, but when I view the form, I don't get any editor. Also I did run "python manage.py collectstatic"
settings.py specific to ckeditor.
INSTALLED_APPS = [
'ckeditor',
'ckeditor_uploader',
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,"static")
CKEDITOR_BASEPATH = STATIC_ROOT+"/ckeditor/ckeditor"
CKEDITOR_UPLOAD_PATH = "ck_uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
MEDIA_URL = STATIC_URL+'media/'
MEDIA_ROOT = os.path.join(STATIC_ROOT,'media')
urls.py
url(r'^ckeditor/', include('ckeditor_uploader.urls')),
forms.py
from ckeditor.widgets import CKEditorWidget
class BlogPostForm(forms.ModelForm):
class Meta():
model = BlogPost
fields = ('title','brief','content','accept_comments','is_public')
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
No suggestions worked so far (including moving the widget definition out of Meta).
I am custom rendering the forms and this is how the field is getting rendered in the form.
form.details
Also rendering the whole form using form.as_p
didn't make any difference.
This is what the HTML field shows when I use Chrome developer tools --> Elements.
<textarea cols="40" id="id_details" name="details" rows="10" required="" data-processed="0" data-config=""skin": "moono-lisa", "toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "toolbar": "Custom", "height": 291, "width": 835, "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725, "toolbar_Custom": [["Bold", "Italic", "Underline"], ["NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"], ["Link", "Unlink"], ["RemoveFormat", "Source"]], "language": "en-us"" data-external-plugin-resources="[]" data-id="id_details" data-type="ckeditortype"></textarea>
python-3.x django-forms ckeditor5
add a comment |
Followed every step mentioned in https://django-ckeditor.readthedocs.io/en/latest/, but when I view the form, I don't get any editor. Also I did run "python manage.py collectstatic"
settings.py specific to ckeditor.
INSTALLED_APPS = [
'ckeditor',
'ckeditor_uploader',
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,"static")
CKEDITOR_BASEPATH = STATIC_ROOT+"/ckeditor/ckeditor"
CKEDITOR_UPLOAD_PATH = "ck_uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
MEDIA_URL = STATIC_URL+'media/'
MEDIA_ROOT = os.path.join(STATIC_ROOT,'media')
urls.py
url(r'^ckeditor/', include('ckeditor_uploader.urls')),
forms.py
from ckeditor.widgets import CKEditorWidget
class BlogPostForm(forms.ModelForm):
class Meta():
model = BlogPost
fields = ('title','brief','content','accept_comments','is_public')
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
No suggestions worked so far (including moving the widget definition out of Meta).
I am custom rendering the forms and this is how the field is getting rendered in the form.
form.details
Also rendering the whole form using form.as_p
didn't make any difference.
This is what the HTML field shows when I use Chrome developer tools --> Elements.
<textarea cols="40" id="id_details" name="details" rows="10" required="" data-processed="0" data-config=""skin": "moono-lisa", "toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "toolbar": "Custom", "height": 291, "width": 835, "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725, "toolbar_Custom": [["Bold", "Italic", "Underline"], ["NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"], ["Link", "Unlink"], ["RemoveFormat", "Source"]], "language": "en-us"" data-external-plugin-resources="[]" data-id="id_details" data-type="ckeditortype"></textarea>
python-3.x django-forms ckeditor5
Followed every step mentioned in https://django-ckeditor.readthedocs.io/en/latest/, but when I view the form, I don't get any editor. Also I did run "python manage.py collectstatic"
settings.py specific to ckeditor.
INSTALLED_APPS = [
'ckeditor',
'ckeditor_uploader',
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,"static")
CKEDITOR_BASEPATH = STATIC_ROOT+"/ckeditor/ckeditor"
CKEDITOR_UPLOAD_PATH = "ck_uploads/"
CKEDITOR_IMAGE_BACKEND = "pillow"
MEDIA_URL = STATIC_URL+'media/'
MEDIA_ROOT = os.path.join(STATIC_ROOT,'media')
urls.py
url(r'^ckeditor/', include('ckeditor_uploader.urls')),
forms.py
from ckeditor.widgets import CKEditorWidget
class BlogPostForm(forms.ModelForm):
class Meta():
model = BlogPost
fields = ('title','brief','content','accept_comments','is_public')
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
No suggestions worked so far (including moving the widget definition out of Meta).
I am custom rendering the forms and this is how the field is getting rendered in the form.
form.details
Also rendering the whole form using form.as_p
didn't make any difference.
This is what the HTML field shows when I use Chrome developer tools --> Elements.
<textarea cols="40" id="id_details" name="details" rows="10" required="" data-processed="0" data-config=""skin": "moono-lisa", "toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "toolbar": "Custom", "height": 291, "width": 835, "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725, "toolbar_Custom": [["Bold", "Italic", "Underline"], ["NumberedList", "BulletedList", "-", "Outdent", "Indent", "-", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"], ["Link", "Unlink"], ["RemoveFormat", "Source"]], "language": "en-us"" data-external-plugin-resources="[]" data-id="id_details" data-type="ckeditortype"></textarea>
python-3.x django-forms ckeditor5
python-3.x django-forms ckeditor5
edited Mar 28 at 0:13
Bhargav Rao♦
32.5k21 gold badges95 silver badges115 bronze badges
32.5k21 gold badges95 silver badges115 bronze badges
asked Oct 28 '18 at 3:47
RhonaldRhonald
465 bronze badges
465 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Ck editor
Step 1: pip install django-ckeditor
Step 2: INSTALLED_APPS = ['ckeditor',]
Step 3: GO TO==> models.py
and add text field RichTextField
Like this:
from ckeditor.fields import RichTextField
class Post(models.Model):
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
title = models.CharField(max_length=200)
text = RichTextField(blank=True, null=True)
Step 4: python manage.py makemigrations and migrate
Step 5: Now check the admin page, ckeditor
is apply in textfield
If you want to add ckeditor in html file
Step 6: in forms.py
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ('title','text',)
Step 7: in html file add two line of code:
safe
form.media
add a comment |
You placed wrong the following two lines.
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
They must be out of Meta class, so it will be the following.
class BlogPostForm(forms.ModelForm):
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
class Meta():
model = BlogPost
fields = ('title','brief','content','accept_comments','is_public')
didn't make much difference.
– Rhonald
Mar 27 at 23:33
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53028220%2fdjango-ckeditor-wont-show-on-the-form%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Ck editor
Step 1: pip install django-ckeditor
Step 2: INSTALLED_APPS = ['ckeditor',]
Step 3: GO TO==> models.py
and add text field RichTextField
Like this:
from ckeditor.fields import RichTextField
class Post(models.Model):
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
title = models.CharField(max_length=200)
text = RichTextField(blank=True, null=True)
Step 4: python manage.py makemigrations and migrate
Step 5: Now check the admin page, ckeditor
is apply in textfield
If you want to add ckeditor in html file
Step 6: in forms.py
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ('title','text',)
Step 7: in html file add two line of code:
safe
form.media
add a comment |
Ck editor
Step 1: pip install django-ckeditor
Step 2: INSTALLED_APPS = ['ckeditor',]
Step 3: GO TO==> models.py
and add text field RichTextField
Like this:
from ckeditor.fields import RichTextField
class Post(models.Model):
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
title = models.CharField(max_length=200)
text = RichTextField(blank=True, null=True)
Step 4: python manage.py makemigrations and migrate
Step 5: Now check the admin page, ckeditor
is apply in textfield
If you want to add ckeditor in html file
Step 6: in forms.py
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ('title','text',)
Step 7: in html file add two line of code:
safe
form.media
add a comment |
Ck editor
Step 1: pip install django-ckeditor
Step 2: INSTALLED_APPS = ['ckeditor',]
Step 3: GO TO==> models.py
and add text field RichTextField
Like this:
from ckeditor.fields import RichTextField
class Post(models.Model):
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
title = models.CharField(max_length=200)
text = RichTextField(blank=True, null=True)
Step 4: python manage.py makemigrations and migrate
Step 5: Now check the admin page, ckeditor
is apply in textfield
If you want to add ckeditor in html file
Step 6: in forms.py
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ('title','text',)
Step 7: in html file add two line of code:
safe
form.media
Ck editor
Step 1: pip install django-ckeditor
Step 2: INSTALLED_APPS = ['ckeditor',]
Step 3: GO TO==> models.py
and add text field RichTextField
Like this:
from ckeditor.fields import RichTextField
class Post(models.Model):
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
title = models.CharField(max_length=200)
text = RichTextField(blank=True, null=True)
Step 4: python manage.py makemigrations and migrate
Step 5: Now check the admin page, ckeditor
is apply in textfield
If you want to add ckeditor in html file
Step 6: in forms.py
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ('title','text',)
Step 7: in html file add two line of code:
safe
form.media
edited Aug 8 at 17:56
ejderuby
8054 silver badges20 bronze badges
8054 silver badges20 bronze badges
answered Aug 8 at 17:19
Gaurav NagarGaurav Nagar
213 bronze badges
213 bronze badges
add a comment |
add a comment |
You placed wrong the following two lines.
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
They must be out of Meta class, so it will be the following.
class BlogPostForm(forms.ModelForm):
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
class Meta():
model = BlogPost
fields = ('title','brief','content','accept_comments','is_public')
didn't make much difference.
– Rhonald
Mar 27 at 23:33
add a comment |
You placed wrong the following two lines.
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
They must be out of Meta class, so it will be the following.
class BlogPostForm(forms.ModelForm):
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
class Meta():
model = BlogPost
fields = ('title','brief','content','accept_comments','is_public')
didn't make much difference.
– Rhonald
Mar 27 at 23:33
add a comment |
You placed wrong the following two lines.
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
They must be out of Meta class, so it will be the following.
class BlogPostForm(forms.ModelForm):
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
class Meta():
model = BlogPost
fields = ('title','brief','content','accept_comments','is_public')
You placed wrong the following two lines.
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
They must be out of Meta class, so it will be the following.
class BlogPostForm(forms.ModelForm):
brief = forms.CharField(widget=CKEditorWidget())
content = forms.CharField(widget=CKEditorWidget())
class Meta():
model = BlogPost
fields = ('title','brief','content','accept_comments','is_public')
answered Dec 19 '18 at 18:43
JayJay
5782 silver badges20 bronze badges
5782 silver badges20 bronze badges
didn't make much difference.
– Rhonald
Mar 27 at 23:33
add a comment |
didn't make much difference.
– Rhonald
Mar 27 at 23:33
didn't make much difference.
– Rhonald
Mar 27 at 23:33
didn't make much difference.
– Rhonald
Mar 27 at 23:33
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53028220%2fdjango-ckeditor-wont-show-on-the-form%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown