Last improvement. It's working now.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
cf3e6569e1
commit
411f096d78
|
@ -137,6 +137,7 @@ STATIC_ROOT = BASE_DIR / 'staticfiles'
|
|||
|
||||
|
||||
# Media root/url
|
||||
# https://devcenter.heroku.com/articles/s3
|
||||
MEDIA_URL = "/media/"
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
||||
|
||||
|
|
|
@ -15,7 +15,9 @@ Including another URLconf
|
|||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
from django.conf.urls.static import static
|
||||
|
||||
from config import settings
|
||||
import config.views
|
||||
import ultron.followup.urls
|
||||
import ultron.location.urls
|
||||
|
@ -62,4 +64,4 @@ urlpatterns = [
|
|||
|
||||
# Administration
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<div class="block block-four"></div>
|
||||
<a href="javascript:void(0)">
|
||||
{% if gymnast.picture %}
|
||||
<img src="{{ gymnast.picture.url }}" alt="{{ gymnast }}" class="avatar">
|
||||
<img src="{{ MEDIA_ROOT }}{{ gymnast.picture.url }}" alt="{{ gymnast }}" class="avatar">
|
||||
{% endif %}
|
||||
<h4 class="title mb-2">{{ gymnast.first_name }} {{ gymnast.last_name }}</h4>
|
||||
</a>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.8 on 2021-12-22 08:35
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('people', '0004_alter_gymnast_picture'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='gymnast',
|
||||
name='picture',
|
||||
field=models.ImageField(blank=True, null=True, upload_to='gymnast'),
|
||||
),
|
||||
]
|
|
@ -343,10 +343,8 @@ def gymnast_create_or_update(request, gymnast_id=None):
|
|||
|
||||
if request.method == "POST":
|
||||
gymnast_form = GymnastForm(request.POST, request.FILES, instance=gymnast)
|
||||
print(gymnast_form)
|
||||
|
||||
if gymnast_form.is_valid():
|
||||
# handle_uploaded_file(request.FILES['file'])
|
||||
if gymnast_form.is_valid():
|
||||
gymnast = gymnast_form.save()
|
||||
return HttpResponseRedirect("/gymnast/details/" + str(gymnast.id))
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue