-2
I’m creating a field of ImageField
no Jango, but when I put to save, it saves in the bank the name of the image but does not save the path to the image.
models:
class Cliente(models.Model):
photo = models.ImageField(upload_to='static/media/imagens/', blank=True)
Settings:
MEDIA_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = "/static/"
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'core/static')
]
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
file path:
core
-static
-geral
-media
-imagens
I hope you help me.