Tiny_mce blank popups in Django Admin

If you are having blank pages popping up in your Django admin, or perhaps other systems as well, this may be your answer. Look at your on-page source of where the the tinymce javascript files are coming from. If you have something like:

<script type="text/javascript" src="http://somedomain.com/static/js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="http://somedomain.com/static/js/tiny_mce_config/tiny_mce_config.js"></script>

You will most likely be seeing blank popups. To fix this, change your site settings media URL to be a relative path. So

MEDIA_URL = 'http://somedomain.com/static/'

Becomes

MEDIA_URL = '/static/'

And now your tiny_mce installation should load properly. :)


Comments

  • Roger Aug. 7, 2009 at 8:04 p.m.

    Thanks for the tip, Zenos but:

    1) This does not solve the problem for me

    2) What if I am serving static files from a different server altogether, so that relative paths don’t work?

    Roger

  • Zenos Aug. 8, 2009 at 9:23 p.m.

    Hi Roger,

    1) There are quite a few other reasons that tiny_mce might throw up blank popups. I had to start with the most basic install of tiny_mce in a local development environment and then work from there to figure out this issue, but I saw several others problems around the web that would cause this problem.

    2) Why would you server static files on a different server all together? This seems unwise because if one site goes down, both of your sites go down, so I don’t see this as being a common scenario for almost all websites.

    Thanks, Zenos

  • Alfredo Di Napoli Oct. 22, 2009 at 12:47 p.m.

    Dear Zenos, your method won’t work. The issue is due to the cross platform call of some procedures. You have to change the document.domain by hand in a way described here:

    http://wiki.moxiecode.com/index.php/TinyMCE:Cross_domain_loading

    I hope this will help people like me and save by headaches :)

    Regards,

    Alfredo

  • Serkan Yazıcıoğlu Dec. 15, 2009 at 11:58 a.m.

    Thanks solved my problem ;)

  • apaajha July 30, 2010 at 3:07 a.m.

    thanks zenos… :)

We Recommend