"Just" use static files for logos.

This commit is contained in:
Vidir Valberg Gudmundsson 2017-07-15 15:21:00 +02:00
parent 7cd82ea3bb
commit d6a07110b7
4 changed files with 7 additions and 9 deletions

View file

@ -49,7 +49,7 @@ INSTALLED_APPS = [
'django_extensions', 'django_extensions',
] ]
MEDIA_URL = '/media/' #MEDIA_URL = '/media/'
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATIC_ROOT = local_dir('static') STATIC_ROOT = local_dir('static')
STATICFILES_DIRS = [local_dir('static_src')] STATICFILES_DIRS = [local_dir('static_src')]

View file

@ -334,5 +334,3 @@ if settings.DEBUG:
urlpatterns = [ urlpatterns = [
url(r'^__debug__/', include(debug_toolbar.urls)), url(r'^__debug__/', include(debug_toolbar.urls)),
] + urlpatterns ] + urlpatterns
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View file

@ -25,15 +25,15 @@ class Sponsor(CreatedUpdatedModel):
help_text='A short description of the sponsorship' help_text='A short description of the sponsorship'
) )
logo = models.ImageField( logo = models.URLField(
upload_to=get_sponsor_upload_path, max_length=255,
help_text='A logo for the sponsor' help_text='A URL to the logo'
) )
url = models.URLField( url = models.URLField(
null=True, null=True,
blank=True, blank=True,
help_text="A URL to the sponsor." help_text="An URL to the sponsor."
) )
def __str__(self): def __str__(self):

View file

@ -25,7 +25,7 @@ Sponsors | {{ block.super }}
</section> </section>
{% endif %} {% endif %}
<div class="page-header"> <div class="page-header">
<h1>{{ sponsor.tier.name}} <small>{{ sponsor.tier.description}}</small></h1> <h1>{{ sponsor.tier.name}}</h1>
</div> </div>
<section> <section>
@ -35,7 +35,7 @@ Sponsors | {{ block.super }}
{% if sponsor.url %} {% if sponsor.url %}
<a href="{{ sponsor.url }}"> <a href="{{ sponsor.url }}">
{% endif %} {% endif %}
<img src="{{ sponsor.logo.url }}" /> <img src="{{ sponsor.logo }}" />
<div class="caption"> <div class="caption">
{{ sponsor.description }} {{ sponsor.description }}