-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for crashes when using tinymce in STATICFILES_DIRS in development mode. #131
Conversation
@@ -13,9 +13,12 @@ | |||
|
|||
if 'staticfiles' in settings.INSTALLED_APPS or 'django.contrib.staticfiles' in settings.INSTALLED_APPS: | |||
JS_URL = getattr(settings, 'TINYMCE_JS_URL',os.path.join(settings.STATIC_URL, 'tiny_mce/tiny_mce.js')) | |||
JS_ROOT = getattr(settings, 'TINYMCE_JS_ROOT',os.path.join(settings.STATIC_ROOT, 'tiny_mce')) | |||
JS_ROOT = getattr(settings, 'TINYMCE_JS_ROOT', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use the static library to build the right PATH here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Static library? What do you mean?
[scratching head]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is what powers the findstatic command: https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/#findstatic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it doesn't really makes sense to use STATICDIRS without a STATIC_ROOT because collectstatic will copy files from STATICDIRS to STATIC_ROOT |
Alas, it does make sense when we use the debug server. |
Yes true. Then we should use:
|
And where should I copy-paste the code? To settings.py of my project? It doesn't work... [piteously meowing] |
d56b9aa
to
b46ded9
Compare
Done, check it up please. |
I think it is something we want to do if staticfiles is present in the INSTALLED_APPS and not if we use MEDIA. Also please remove the documentation changes. |
a99caba
to
0912ae8
Compare
Alas, I don't understand what do you mean. Maybe that's because I'm not a pro Django coder. = ( |
Look at the diff, you should see that you removed |
[hopefully] Maybe you'll modify it yourself? |
It's your PR and your fix isn't it? |
Okay, let's do it... |
Done. Is it good enough? |
I will let line 19 as it was otherwise it looks to be good yes. |
…tead of STATIC_ROOT
Done! |
Thanks a lot. It looks good for me. |
Fix for crashes when using tinymce in STATICFILES_DIRS in development mode.
Thank you, comrade! |
I just released 2.0.5 with your fix. |
Here I've added some quick and dirty fix when using STATICFILES_DIRS instead of STATIC_ROOT.