Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tinymce django not showing up

I know this question have been asked here so many times, but i just cant show up Tinymce in my admin's flatpages. I don't know where I'm missing or doing something wrong. Please help me out where I'm going wrong. The javascript file is in:

C:\Users\Kakar\web\cms\static\js\tinymce\tinymce.min.js

urls.py:

    (r'^tiny_mce/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': 'C:/Users/Kakar/web/cms/static/js/tinymce' }),

In my templates dir i have another admin folder, which have the change_form.html: and right after {{ media }}:

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

In the firebug it says: ReferenceError: tinyMCE is not defined tinyMCE.init({

Please help me out. Thank you.

like image 283
Karl Avatar asked Jan 27 '26 11:01

Karl


1 Answers

Your url for you tinymce script is currently pointing to http://yoursite/tiny_mce/ because of this: (r'^tiny_mce/... but the script you have included would attempt to GET tinymce.min.js from http:/yoursite/tinymce.min.js because you have not included the /tiny_mce/tinymce.min.js in front of it. If your tinymce.min.js is in a subdirectory you would need to include the path to it as follows <script type="text/javascript" src="/tiny_mce/(pathtodirectory)/tinymce.min.js"></script>

like image 187
Ernest Jumbe Avatar answered Jan 30 '26 02:01

Ernest Jumbe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!