"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',
]
MEDIA_URL = '/media/'
#MEDIA_URL = '/media/'
STATIC_URL = '/static/'
STATIC_ROOT = local_dir('static')
STATICFILES_DIRS = [local_dir('static_src')]

View file

@ -334,5 +334,3 @@ if settings.DEBUG:
urlpatterns = [
url(r'^__debug__/', include(debug_toolbar.urls)),
] + 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'
)
logo = models.ImageField(
upload_to=get_sponsor_upload_path,
help_text='A logo for the sponsor'
logo = models.URLField(
max_length=255,
help_text='A URL to the logo'
)
url = models.URLField(
null=True,
blank=True,
help_text="A URL to the sponsor."
help_text="An URL to the sponsor."
)
def __str__(self):

View file

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