ASKBOT / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
1.56k stars 625 forks source link

Askbot sets TINYMCE_URL, but python-django-tinymce expects TINYMCE_JS_URL #201

Open AdamWill opened 10 years ago

AdamWill commented 10 years ago

I may be missing something here, but I don't think so.

Askbot's sample configs specify a Django config setting "TINYMCE_URL", and there's a (fairly idiotic) check in startup_procedures.py which checks that this is set to what Askbot believes is the One True Value It Can Possibly Be and complains if it isn't.

However, AFAICT, python-django-tinymce does not use this setting at all. It expects a setting TINYMCE_JS_URL , which points not to the directory but to the file tiny_mce.js . It then derives a JS_BASE_URL setting from this. But AFAICS it doesn't do anything with a setting called TINYMCE_URL.

I think this has probably been hidden in most deployments because you also turn the compressor on and specify TINYMCE_JS_ROOT, and I think in that case, the setting is unimportant so long as python-django-tinymce's compressor function works. But it's still wrong and will lead to the wrong thing happening if the compressor doesn't work for any reason, I think - python-django-tinymce's bundled tinymce, assuming the copy installed on the server has one, will be used instead of askbot's.

AdamWill commented 10 years ago

yeah, OK, if I'm reading python-django-tinymce's compressor.py correctly, the setting of TINYMCE_JS_URL is entirely moot when the compressor is in use, because the compressor basically reads all tinymce .js files out of TINYMCE_JS_ROOT, compresses them, and serves that out.

AFAICS there isn't even a fallback from the compressor to the JS_URL if the compressor goes sideways, so if you're enabling the compressor, I think you may as well completely drop the setting and checking of TINYMCE_URL instead of correcting it to TINYMCE_JS_URL.

AdamWill commented 10 years ago

oh, I was looking at our (fedora's) packaged askbot; looks like this was fixed since on upstream master, at least in the main file (setup_templates / settings.py). There's still a stray TINYMCE_URL in tinymce_sample_config.py .