2

I have installed a django application with django-tinymce and django-filebrowser. In my machine every thing works fine. when I deployed the application to the production, filebrowser fails to upload file and it shows me the error message Failed

Here is my settings

MEDIA_ROOT = '/srv/www/staticFiles/APCC/'

MEDIA_URL = '/static/APCC/'

STATIC_ROOT = '/srv/www/staticFiles'

STATIC_URL = '/static/'

and here is my apache configs

<Location "/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE APCC.settings
    PythonDebug Off
    PythonOption django.root /srv/APCC
    PythonPath "['/srv/APCC/'] + sys.path"
</Location>
    Alias "/static/" "/srv/www/staticFiles/"
    <Location "/static">
            SetHandler None
            Order deny,allow
            Allow from all
    </Location>
</VirtualHost>

I have make sure that the MEDIA_ROOT directory is created and the uploads folder required by the filebrowser is also created under it.

Also the MEDIA_ROOT directory and the uploads directories have write permissions.

I believe the problem is in my apache configuration or file structure. where would be the problem? also is there any logs specific for tinycme or filebrowser to check?

Anas Rabei
  • 307
  • 1
  • 4
  • 14
  • What is the entire error message? – Pavel Anossov Feb 24 '13 at 17:27
  • I do not see any error message. Just the word Failed appears to me. – Anas Rabei Feb 24 '13 at 17:28
  • Sorry Pavel, I checked apache error logs and found this line at the end of uploading process (TypeError: must be string without null bytes, not str, referer: http://myhost:8000/srv/APCC/admin/filebrowser/upload/?type=image&pop=2) – Anas Rabei Feb 24 '13 at 17:32
  • The backslash at the end of `MEDIA_ROOT` bothers me (..APCC/'\\). – Pavel Anossov Feb 24 '13 at 17:38
  • It is a typing mistake while posting the question. I tried this (MEDIA_ROOT = '/srv/www/staticFiles/APCC') and this (MEDIA_ROOT = '/srv/www/staticFiles/APCC/') and the result is the same – Anas Rabei Feb 24 '13 at 17:42
  • Does it work without apache? Through `python manage.py runserver myhost:8080`. If it doesn't, we'll get a full stacktrace at least. If it does, then the problem is with apache configuration. Do you get a descriptive error page if you set `DEBUG = True` in your settings? – Pavel Anossov Feb 24 '13 at 17:45
  • it does work without apache and I set DEBUG=True but I did not get any error page. I see the word Failed only – Anas Rabei Feb 24 '13 at 18:05
  • Let's try `PythonDebug On` in apache settings. – Pavel Anossov Feb 24 '13 at 18:06
  • I have turned on PythonDebug in the apache configs but I did not where to check the logs. I checked the errors.log and the same previous error appear – Anas Rabei Feb 24 '13 at 18:10
  • How large is the file you're trying to upload? Is `LimitRequestBody` set anywhere in apache? – Pavel Anossov Feb 24 '13 at 18:13
  • the file size is 40kb and there is not LimitRequestBody settings in any of my apache config files – Anas Rabei Feb 24 '13 at 18:20
  • I had reconfigured apahce with mod_wsgi instead of mod_python and every thing works fine. It seems that the problem was with mod_python as it is deprecated. Thnx Pavel for your help – Anas Rabei Feb 25 '13 at 06:52

0 Answers0