15 Responses

  1. Abdulla says:

    Nice exercise …

    When i tried to upload pdf file ” hello, you have uploaded the wrong file type.”

    but when tried to upload image file give Server Error (500)

    • Karan Mittal says:

      This implies that the image file is not handled correctly at the server-side. please check if you have installed the packages like Pillow for this purpose.

  2. DataFlair Team says:

    Hey Abdulla,

    It seems like you haven’t installed PILLOW library of Python. Install that in your virtual environent and try running that again.

  3. Leena says:

    Not showing the uploaded file

  4. Ig says:

    Hi! May I use this method to upload file after my projet was deployed to server?

    • Karan Mittal says:

      You can use this method if your server is static, But I would recommend that you properly create your models and save only one file per user because its quite easy to run out of space for this. also, If you are looking for scaling, you should use a combination of databases for storing and retrieving your files.

  5. Joe Wilson says:

    Where is STATIC_URL and STATIC_ROOT in settings.py in project dir in this example?

    • PhiWue says:

      @Data-Flair Team:
      You probably made a mistake in your order. If you follow the learn-django tutorial the section “6. Django File Upload” comes before “7. Django Static File Handling”

      Therefore we can’t know that STATIC_URL and STATIC_ROOT will be set in the next Tutorial. So maybe you should just switch order.
      I was already confused in the beginning where you talked about a previous tutorial which I couldn’t remember till I figured out it will be the next one.

  6. Ranjeet says:

    i am not able to view image in django/admin interface
    it says:- doesn’t exist. Perhaps it was deleted?
    but image is present in media folder

  7. IK says:

    Newbie here. Tried the upload code but no file seems to be going into my media directory and can’t tell what the issue is.
    I have checked the media path over and over again & it looks ok.
    Any advise please?

  8. Riyaz Pathan says:

    can we upload pdf or doc file

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.