fixes + ordering

This commit is contained in:
Niko Abeler 2023-08-24 21:15:37 +02:00
parent f1d0734abf
commit 2bf7deb4ca
3 changed files with 8 additions and 6 deletions

View File

@ -101,6 +101,7 @@ class Character(models.Model):
class Meta:
verbose_name = _("character")
verbose_name_plural = _("characters")
ordering = ["name"]
def __str__(self):
return self.name

View File

@ -29,10 +29,11 @@
<div class="row">
</div>
<a href="{{character.picture.url}}" style="float:left;margin-right:10px;margin-bottom:10px;">
<img src="{{character.picture.url}}" width="300"/>
</a>
{% if character.picture %}
<a href="{{character.picture.url}}" style="float:left;margin-right:10px;margin-bottom:10px;">
<img src="{{character.picture.url}}" width="300"/>
</a>
{% endif %}
<p>{{character.description|md|safe}}</p>
<div class="column">
</div>

View File

@ -7,7 +7,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent.parent
SECRET_KEY = "django-insecure-e*p%e)pwf+-ntt4wpn-^^7-0yq)!cjo*om18vy77-=*c0jjfqa"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = os.environ.get("DJANGO_HOST").split(",")
CSRF_TRUSTED_ORIGINS = [
@ -25,5 +25,5 @@ DATABASES = {
}
}
EDIA_ROOT = "/data/media"
MEDIA_ROOT = "/data/media"
MEDIA_URL = "/media/"