.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 3.1.5 on 2021-02-15 11:47
|
||||
|
||||
import anatomy.models
|
||||
import django.core.files.storage
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('anatomy', '0032_auto_20210215_1144'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='anatomyquestion',
|
||||
name='image',
|
||||
field=models.ImageField(storage=django.core.files.storage.FileSystemStorage(base_url='/media//', location='/home/django/rad/media//'), upload_to=anatomy.models.image_directory_path),
|
||||
),
|
||||
]
|
||||
+3
-3
@@ -20,15 +20,15 @@ from helpers.images import image_as_base64
|
||||
|
||||
image_storage = FileSystemStorage(
|
||||
# Physical file location ROOT
|
||||
location=u"{0}/anatomy/".format(settings.MEDIA_ROOT),
|
||||
location=u"{0}/".format(settings.MEDIA_ROOT),
|
||||
# Url for file
|
||||
base_url=u"{0}anatomy/".format(settings.MEDIA_URL),
|
||||
base_url=u"{0}/".format(settings.MEDIA_URL),
|
||||
)
|
||||
|
||||
|
||||
def image_directory_path(instance, filename):
|
||||
# file will be uploaded to MEDIA_ROOT/anatomy/picture/<filename>
|
||||
return u"picture/{0}".format(filename)
|
||||
return u"picture/anatomy/{0}".format(filename)
|
||||
|
||||
|
||||
class BodyPart(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user