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>Finally, I solved this problem, I had to change urls.py as like:</p>

<pre><code>from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin

    urlpatterns = [
        url(r'^', include("website.urls", namespace='home')),
        url(r'^admin/', admin.site.urls),

    ]

    if settings.DEBUG:
        urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
        urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
</code></pre>

python django file-upload django-models django-admin