update config file
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Gregory Trullemans 2021-12-21 12:58:08 +01:00
parent 27f7502489
commit 60a5708709
5 changed files with 23 additions and 5 deletions

View File

@ -137,8 +137,8 @@ STATIC_ROOT = BASE_DIR / 'staticfiles'
# Media root/url
MEDIA_URL = "/static/img/gymnast/" # https://media.khana.be
MEDIA_ROOT = os.path.join(BASE_DIR, "/static/img/gymnast")
MEDIA_URL = "/media/gymnast/"
MEDIA_ROOT = os.path.join(BASE_DIR, "/media/gymnast")
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field

View File

@ -64,7 +64,7 @@
<div class="form-group row {% if form.picture.errors %}has-error has-feedback{% endif %}">
<label for="id_picture" class="col-4 col-sm-2 col-md-3 col-lg-3 col-xl-3 col-form-label">Picture</label>
<div class="col-8 col-sm-9 col-md-9 col-lg-9 col-xl-9">
{{ form.picture }}
{% if form.picture.errors %}&nbsp;<span class="btn btn-sm btn-danger-outline">{% for error in form.picture.errors %}{{error}}{% endfor %}</span>{% endif %}
</div>
</div>

View File

@ -35,7 +35,7 @@ class GymnastForm(forms.ModelForm):
"hours_by_week": forms.TextInput(
attrs={"class": "form-control", "placeholder": "11,5"}
),
"picture": ClearableFileInput(), # forms.ImageField(widget=forms.ClearableFileInput(attrs={'multiple': False})),
"picture": ClearableFileInput(),
}
club_related = forms.CharField(

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.8 on 2021-12-21 11:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0003_alter_gymnast_picture'),
]
operations = [
migrations.AlterField(
model_name='gymnast',
name='picture',
field=models.ImageField(blank=True, null=True, upload_to='media/gymnast'),
),
]

View File

@ -34,7 +34,7 @@ class Gymnast(Markdownizable):
verbose_name="# Training by week"
)
hours_by_week = models.PositiveSmallIntegerField(verbose_name="# Hours by week")
picture = models.ImageField(upload_to="static/img/gymnasts", null=True, blank=True)
picture = models.ImageField(upload_to="media/gymnast", null=True, blank=True)
def __str__(self):
return u"%s, %s" % (self.last_name, self.first_name)