How to upload image file from django admin panel ?
<p>I am making a personal website using django 1.10
I want to upload my website logo from admin for why I can edit this in future. So that I have wrote website app and the models of website is :</p>

<p>from <strong>future</strong> import unicode_literals</p>

<p>from django.db import models</p>

<pre><code># Create your models here.
class Website(models.Model):
    title = models.CharField(max_length=255)
    name = models.CharField(max_length=255)
    logo = models.ImageField(max_length=255, upload_to='images/')

    def __unicode__(self):
        return self.name

    def __str__(self):
        return self.name
</code></pre>

<p>Admin panel:
<a href="http://i.stack.imgur.com/FdpvX.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/FdpvX.jpg" alt="enter image description here"></a></p>

<p>But image is not uploaded in <code>media/images</code> folder.
Please help me about this issue.</p>

<p>It saves inside project folder if I change this in settings.py:</p>

<p>Before:</p>

<pre><code>MEDIA_URL = "/media/"
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "media_cdn")
</code></pre>

<p>After:</p>

<pre><code>MEDIA_URL = "/media/"
MEDIA_ROOT = os.path.join(os.path.dirname(PROJECT_ROOT), "media_cdn")
</code></pre>

python django file-upload django-models django-admin