Forums

File uploading

Is there possibility to upload file to your website? For example i have a script that trying to upload an images that user choose from website. It worked perfect when i use it in localhost but in the deployment i get "Internal server error 500" whether i upload an image from admin panel or account in my app. I really appreciate any information you can provide.

Look in the error log for the traceback that will tell you what's going wrong.

It tells me : urllib.error.HTTPError: HTTP Error 403: Forbidden That's why I'm don't know the exact reason

And this when i tried to upload message straightforward from admin panel: ValueError: "<Image: 1>" needs to have a value for field "image" before this many-to-many relationship can be used.

403 forbidden means you're not correctly authenticated to do the upload. Not sure about the other error. Are you sure you're running the version of Django that the code was written for?

It works perfectly under the Django 1.10.3 when I use localhost and I use the same version here. That's why i thought it could be server limitation. The media folder is basic like this: MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/'

Are you trying to access an external site? Is it on our whitelist

Thanks. I dunno how i could miss this article. It's true that I wanted to have ability saving pics from different resources and one of them from whitelist (http://www.deviantart.com/). Thank you for explanation.