title: Django 2.0 throws AttributeError: ''Image' object has no attribute 'replace'"
body: <p><strong>When trying to set an html image to my static path + image path in Django 2.0, the django development server displays the following error:</strong></p>
  
  <pre><code>Error during template rendering
  
  In template /Users/arikanevsky/webappgit/ari/templates/ari/software.html, error at line 5
  
  'Image' object has no attribute 'replace'
  </code></pre>
  
  <p><strong>The Image class from models.py:</strong></p>
  
  <pre><code>class Image(models.Model):
      """This class contains a reference to the ImageField.
  
      It is part of a base of models comprising the webapp.
  
      """
      uplpath = '%Y/%m/%d'
      dfltpath = 'page_images/Y/M/D/no_img.jpg'
  
      image = models.ImageField(upload_to=uplpath, default=dfltpath)
  
      def __str__(self):
          """Return human readable string of self.image."""
          return self.image.name
  </code></pre>
  
  <p><strong>The urlpatterns from urls.py:</strong></p>
  
  <pre><code>urlpatterns = [
      path('', views.index, name='index'),
      path('&lt;int:page_id&gt;/bio/', views.bio, name='bio'),
      path('&lt;int:page_id&gt;/software/', views.software, name='software'),
      path('&lt;int:page_id&gt;/publications/',
       views.publications, name='publications'),
      path('&lt;int:page_id&gt;/career/', views.career, name='career'),
      path('&lt;int:page_id&gt;/education/', views.education, name='education'),
      ]
  </code></pre>
  
  <p><strong>The index method from views.py:</strong></p>
  
  <pre><code>def index(request):
      page_list = get_list_or_404(Page.objects.all())
      return render(request, 'ari/index.html', {'page_list': page_list})
  </code></pre>
  
  <p><strong>The index.html file (it is used as named):</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{% if page_list %}
  &lt;ul&gt;
  {% for page in page_list %}
      &lt;a href="/ari/{{page.id}}/bio"&gt;&lt;p&gt;My bio page&lt;/p&gt;&lt;/a&gt;
      &lt;a href="/ari/{{page.id}}/career"&gt;&lt;p&gt;My career page&lt;/p&gt;&lt;/a&gt;
      &lt;a href="/ari/{{page.id}}/software"&gt;&lt;p&gt;My software page&lt;/p&gt;&lt;/a&gt;
      &lt;a href="/ari/{{page.id}}/publications"&gt;&lt;p&gt;My publication page&lt;/p&gt;. &lt;/a&gt;
  {% endfor %}
  &lt;/ul&gt;
  {% else %}
  &lt;p&gt;No pages are available :(&lt;/p&gt;
  {% endif %}</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>The software method from views.py:</strong></p>
  
  <pre><code>def software(request, page_id):
      software_page = get_object_or_404(Page, pk=page_id)
      return render(request, 'ari/software.html', {'software_page': software_page})
  </code></pre>
  
  <p><strong>The software.html file:</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{% load static %}
  
  &lt;img src = "{% static software_page.image %}" alt = "Profile Picture"/&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>The app directory structure is the following</strong>:</p>
  
  <p>(I believe we can ignore the .ipynb and pycache dirs)</p>
  
  <pre><code>|-akanev
  |  |-__pycache__
  |-ari
  |  |-.ipynb_checkpoints
  |  |-__pycache__
  |  |-migrations
  |  |  |-__pycache__
  |  |-templates
  |  |  |-ari
  |  |  |  |-page_images
  </code></pre>
  
  <p><strong>The relevant environment dir paths defined in settings.py:</strong></p>
  
  <pre><code>MEDIA_ROOT: '/Users/arikanevsky/webappgit/ari/templates/ari/page_images'
  
  MEDIA_URL: ''
  
  BASE_DIR: '/Users/arikanevsky/webappgit'
  
  STATICFILES_DIRS: []
  
  STATIC_ROOT: None
  
  STATIC_URL: '/page_images/'
  
  TEMPLATES:  
  [{'APP_DIRS': True,
  'BACKEND': 'django.template.backends.django.DjangoTemplates',
  'DIRS': [],
  'OPTIONS': {'context_processors':   ['django.template.context_processors.debug',
                                     'django.template.context_processors.request',
                                   'django.contrib.auth.context_processors.auth',
                                   'django.contrib.messages.context_processors.messages']}}]
  </code></pre>
  
  <p><strong>The img src line in the software.html file throws the error:</strong> </p>
  
  <pre><code>Exception Type: AttributeError at /ari/4/software/
  Exception Value: 'Image' object has no attribute 'replace'
  </code></pre>
  
  <p>Would appreciate any and all clues to as what this mysterious error may be! </p>
  
  <p>Thanks :)</p>