Serv Media Files
This commit is contained in:
parent
789acccca1
commit
977f746f2d
@ -120,6 +120,10 @@ USE_TZ = True
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
MEDIA_URL = '/media/'
|
||||
|
||||
MEDIA_ROOT = BASE_DIR / 'media'
|
||||
|
||||
# Configuracion correo electronico
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
EMAIL_HOST = 'smtp.gmail.com'
|
||||
|
@ -1,5 +1,8 @@
|
||||
from django.urls import path
|
||||
from ProyectoWebApp import views
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.home, name="Inicio"),
|
||||
@ -9,3 +12,6 @@ urlpatterns = [
|
||||
path('contacto', views.contacto, name='Contacto'),
|
||||
path('sample/', views.sample, name ='Sample'),
|
||||
]
|
||||
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
|
||||
|
||||
|
@ -5,7 +5,7 @@ from django.db import models
|
||||
class Servicio(models.Model):
|
||||
titulo = models.CharField( max_length = 50 )
|
||||
contenido = models.CharField( max_length = 50 )
|
||||
imagen = models.ImageField()
|
||||
imagen = models.ImageField(upload_to = 'servicios')
|
||||
created = models.DateTimeField( auto_now_add = True)
|
||||
updated = models.DateTimeField( auto_now_add = True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user