Forums

Problem with TinyMCE

Hi,

I've uploaded the TinyMCE js files to:

/ > home > andybyers > tinymce > jscripts > tiny_mce

And I've set the JS up like this:

<script type="text/javascript" src="/home/andybyers/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

<script type="text/javascript"> tinyMCE.init({ mode : "textareas" }); </script> </head> <body> <!-- OF COURSE YOU NEED TO ADAPT ACTION TO WHAT PAGE YOU WANT TO LOAD WHEN HITTING "SAVE" --> <form method="post" action="show.php"> <p> <textarea name="content" cols="50" rows="15">This is some content that will be editable with TinyMCE.</textarea> <input type="submit" value="Save" /> </p> </form>

Am I being completely stupid or does JS not operate properly on PA?

The web app does not serve static files from your root directory. If you want to serve tiny_mce.js, put the file in /var/www/static. It will then be available to your webapp app at http://andybyers.pythonanywhere.com/tiny_mce.js.

Cheers glenn - I was being a moron, hadn't set the static file URL or DIR - working now!

http://andybyers.pythonanywhere.com/tinymce

I have setup everything other static files working and setup command Python3.6 manage.py collectstatic its done but problem is not showing tinymce field in django admin and as well in create post template? I don't know please it there the way to setup static_url and root for tinymce in settings.py? like all other static staff I have set?

Make sure that the tinyMCE static files are actually being collected by collect static and are appearing in the static folders that you have configured. If they are not, find out where they are going and add a static mapping for that.