Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1072937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:55:37+00:00 2026-05-16T20:55:37+00:00

Using django-tinymce I have successfully embedded TinyMCE in the Admin before. Embedding it in

  • 0

Using django-tinymce I have successfully embedded TinyMCE in the Admin before. Embedding it in a front-end form does not seem to work for me however.

I have a form which is a modelForm. It doesn’t add any extra fields (‘comment’ and ‘statement’ are the only fields used and they exist in the model). On the textarea field, ‘comment’, of that form I would like to use TinyMCE. I have tried the following:

class EntryForm(forms.ModelForm):
    comment = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows': 30}, mce_attrs=TINYMCE_USER_CONFIG))

    class Meta:
        model = Entry
        fields = ['statement','comment',]

and

class EntryForm(forms.ModelForm):
    class Meta:
        model = Entry
        fields = ['statement','comment',]

    def __init__(self, *args, **kwargs):
        super(EntryForm, self).__init__(*args, **kwargs)
        self.fields['comment'].widget = TinyMCE(attrs={'cols': 80, 'rows': 15}, mce_attrs=TINYMCE_USER_CONFIG,)

and

class EntryForm(forms.ModelForm):

    class Meta:
        model = Entry
        fields = ['statement','comment',]

    class Media:
        js = ('/media/tinymce/jscripts/tiny_mce/tiny_mce.js',
                '/sitemedia/js/tinymce_setup.js',)

In the HEAD html tags I have put {{ form.media }} (the form is called form in the views and template). I am also using Grappelli and Filebrowser for the Admin.

Could someone please explain what I’m missing or the process of getting this to work?
Thanks very much!

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:55:37+00:00Added an answer on May 16, 2026 at 8:55 pm

    To answer my own question:the last option works.

    The problem was that `/sitemdia/js/tinymce_setup.js’ was a Grappelli setup file. This should only be used by the Admin. I removed that bit so I ended up with:

    class Media:
        js = ('/media/tinymce/jscripts/tiny_mce/tiny_mce.js',
                '',)
    

    And in the header I added

    <script type="text/javascript">
            tinyMCE.init({
                    mode: "textareas",
                    theme: "simple"
            });
    </script>
    

    You can also instead of removing the setup file insert another file that does work (with for example the tinyMCE.init bit of code in it).

    That should do the trick :).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Django form using textareas and TinyMCE for text entry. I would
I using Django and a generic view django.views.generic.create_update.create_object I have a model form wich
Using django-contact-form , I have overridden the form class: from contact_form.forms import ContactForm from
I'm using django-tinymce in my Django website. Through the admin interface one can edit
i'm using Django registration, and unlike everybody else, I seem to have the opposite
I am using django-storages backend and I have previously not used Amazon S3. I
I'm using TinyMCE with the tinymce-django app in my Django website. I am using
Using django comments framework http://docs.djangoproject.com/en/dev/ref/contrib/comments/ Not sure is there option, to make all comments
using django 1.4 I have a model with a datetimefield. I imported django.utils.timezone to
I`m using Django to send some emails with embedded images to my gmail account.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.