From 10f4ed8a37d5eb2caa6258fd5d66bce4c6a79e8c Mon Sep 17 00:00:00 2001
From: "jp.dev"
Date: Fri, 20 Nov 2020 20:52:22 -0300
Subject: [PATCH] reestructuracion del sitio
---
ProyectoWeb/ProyectoWeb/settings.py | 1 +
ProyectoWeb/ProyectoWeb/urls.py | 1 +
ProyectoWeb/ProyectoWebApp/apps.py | 7 +
ProyectoWeb/ProyectoWebApp/models.py | 3 -
.../templates/ProyectoWebApp/base.html | 5 +-
.../templates/ProyectoWebApp/home.html | 3 +-
.../templates/ProyectoWebApp/servicios.html | 10 -
ProyectoWeb/ProyectoWebApp/urls.py | 4 +-
ProyectoWeb/ProyectoWebApp/views.py | 4 -
ProyectoWeb/README.md | 188 ++++++++++++++++--
ProyectoWeb/manage.py | 22 ++
.../migrations/0008_auto_20201120_1523.py | 22 ++
.../__pycache__/0001_initial.cpython-38.pyc | Bin 0 -> 887 bytes
.../0002_auto_20201118_2354.cpython-38.pyc | Bin 0 -> 563 bytes
.../0003_auto_20201118_2357.cpython-38.pyc | Bin 0 -> 546 bytes
.../0004_auto_20201119_0000.cpython-38.pyc | Bin 0 -> 559 bytes
.../0005_auto_20201119_0010.cpython-38.pyc | Bin 0 -> 590 bytes
.../0006_auto_20201119_0323.cpython-38.pyc | Bin 0 -> 589 bytes
.../0007_auto_20201119_0323.cpython-38.pyc | Bin 0 -> 590 bytes
.../0008_auto_20201120_1523.cpython-38.pyc | Bin 0 -> 701 bytes
.../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 160 bytes
ProyectoWeb/servicios/models.py | 6 +-
.../templates/servicios/servicios.html | 18 ++
ProyectoWeb/servicios/urls.py | 11 +
ProyectoWeb/servicios/views.py | 5 +
25 files changed, 266 insertions(+), 44 deletions(-)
create mode 100644 ProyectoWeb/ProyectoWebApp/apps.py
delete mode 100644 ProyectoWeb/ProyectoWebApp/models.py
delete mode 100644 ProyectoWeb/ProyectoWebApp/templates/ProyectoWebApp/servicios.html
create mode 100755 ProyectoWeb/manage.py
create mode 100644 ProyectoWeb/servicios/migrations/0008_auto_20201120_1523.py
create mode 100644 ProyectoWeb/servicios/migrations/__pycache__/0001_initial.cpython-38.pyc
create mode 100644 ProyectoWeb/servicios/migrations/__pycache__/0002_auto_20201118_2354.cpython-38.pyc
create mode 100644 ProyectoWeb/servicios/migrations/__pycache__/0003_auto_20201118_2357.cpython-38.pyc
create mode 100644 ProyectoWeb/servicios/migrations/__pycache__/0004_auto_20201119_0000.cpython-38.pyc
create mode 100644 ProyectoWeb/servicios/migrations/__pycache__/0005_auto_20201119_0010.cpython-38.pyc
create mode 100644 ProyectoWeb/servicios/migrations/__pycache__/0006_auto_20201119_0323.cpython-38.pyc
create mode 100644 ProyectoWeb/servicios/migrations/__pycache__/0007_auto_20201119_0323.cpython-38.pyc
create mode 100644 ProyectoWeb/servicios/migrations/__pycache__/0008_auto_20201120_1523.cpython-38.pyc
create mode 100644 ProyectoWeb/servicios/migrations/__pycache__/__init__.cpython-38.pyc
create mode 100644 ProyectoWeb/servicios/templates/servicios/servicios.html
create mode 100644 ProyectoWeb/servicios/urls.py
diff --git a/ProyectoWeb/ProyectoWeb/settings.py b/ProyectoWeb/ProyectoWeb/settings.py
index dfd9693..124760e 100644
--- a/ProyectoWeb/ProyectoWeb/settings.py
+++ b/ProyectoWeb/ProyectoWeb/settings.py
@@ -38,6 +38,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'ProyectoWebApp',
+ 'servicios',
]
MIDDLEWARE = [
diff --git a/ProyectoWeb/ProyectoWeb/urls.py b/ProyectoWeb/ProyectoWeb/urls.py
index 5596116..9c622f0 100644
--- a/ProyectoWeb/ProyectoWeb/urls.py
+++ b/ProyectoWeb/ProyectoWeb/urls.py
@@ -21,4 +21,5 @@ from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('ProyectoWebApp.urls')),
+ path('servicios/', include('servicios.urls')),
]
diff --git a/ProyectoWeb/ProyectoWebApp/apps.py b/ProyectoWeb/ProyectoWebApp/apps.py
new file mode 100644
index 0000000..a99c0ba
--- /dev/null
+++ b/ProyectoWeb/ProyectoWebApp/apps.py
@@ -0,0 +1,7 @@
+from django.apps import AppConfig
+
+
+class ProyectowebappConfig(AppConfig):
+ name = 'ProyectoWebApp'
+
+
diff --git a/ProyectoWeb/ProyectoWebApp/models.py b/ProyectoWeb/ProyectoWebApp/models.py
deleted file mode 100644
index 71a8362..0000000
--- a/ProyectoWeb/ProyectoWebApp/models.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from django.db import models
-
-# Create your models here.
diff --git a/ProyectoWeb/ProyectoWebApp/templates/ProyectoWebApp/base.html b/ProyectoWeb/ProyectoWebApp/templates/ProyectoWebApp/base.html
index 46bb9fb..d166e5f 100644
--- a/ProyectoWeb/ProyectoWebApp/templates/ProyectoWebApp/base.html
+++ b/ProyectoWeb/ProyectoWebApp/templates/ProyectoWebApp/base.html
@@ -8,7 +8,7 @@
-
+
@@ -28,7 +28,7 @@
diff --git a/ProyectoWeb/ProyectoWebApp/templates/ProyectoWebApp/servicios.html b/ProyectoWeb/ProyectoWebApp/templates/ProyectoWebApp/servicios.html
deleted file mode 100644
index 29ec10a..0000000
--- a/ProyectoWeb/ProyectoWebApp/templates/ProyectoWebApp/servicios.html
+++ /dev/null
@@ -1,10 +0,0 @@
-{% extends 'ProyectoWebApp/base.html' %}
-
-{% load static %}
-
-{% block content %}
-
-
-
-{% endblock %}
-
diff --git a/ProyectoWeb/ProyectoWebApp/urls.py b/ProyectoWeb/ProyectoWebApp/urls.py
index 1504684..e49fca1 100644
--- a/ProyectoWeb/ProyectoWebApp/urls.py
+++ b/ProyectoWeb/ProyectoWebApp/urls.py
@@ -1,17 +1,17 @@
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"),
- path('servicios', views.servicios, name ='Servicios'),
path('tienda', views.tienda, name ='Tienda'),
path('blog', views.blog, name ='Blog'),
path('contacto', views.contacto, name='Contacto'),
path('sample/', views.sample, name ='Sample'),
]
+
urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
diff --git a/ProyectoWeb/ProyectoWebApp/views.py b/ProyectoWeb/ProyectoWebApp/views.py
index ab11ca6..317fe77 100644
--- a/ProyectoWeb/ProyectoWebApp/views.py
+++ b/ProyectoWeb/ProyectoWebApp/views.py
@@ -2,9 +2,6 @@ from django.shortcuts import render, HttpResponse
def home(request):
return render(request, "ProyectoWebApp/home.html")
-
-def servicios(request):
- return render(request, "ProyectoWebApp/servicios.html")
def tienda(request):
return render(request, "ProyectoWebApp/tienda.html")
@@ -18,4 +15,3 @@ def contacto(request):
def sample(request):
return render(request, "ProyectoWebApp/sample.html")
-
diff --git a/ProyectoWeb/README.md b/ProyectoWeb/README.md
index f7f85ab..89b07f0 100644
--- a/ProyectoWeb/README.md
+++ b/ProyectoWeb/README.md
@@ -1,21 +1,173 @@
-# 📚️ [Proyecto Web Completo](https://gitea.kickto.net/jp.av.dev/intro_Django/src/branch/master/ProyectoWeb)
+**Ejémplo estructura común página web**
+```
++---------------------------------------+
+| +------+ +-------------------+ |
+| | Logo | | Menu | |<---- cont. estatico y dinamico
+| +------+ +-------------------+ |
+| |
+| |
+| +-------------------------------+ |
+| | | |
+| | | |
+| | Zona de Carga | |
+| | | |
+| | de Contenido | |<---- cont. estatico y dinamico
+| | | |
+| | | |
+| | | |
+| +-------------------------------+ |
+| |
+| +-------------------------------+ |
+| | Pie de página | | <---- rrss, contacto
+| +-------------------------------+ |
++---------------------------------------+
+```
+El contenido a mostar en la zona de carga dependerá
+de lo seleccionado en menú o pie de página.
+
+- Crear URLs y Vistas
+- Crear Plantillas y herencias
+- Manejar archivos externos
+- Conf. panel de administración
+- Conf. conexión a BBDD
+- CRUD con BBDD
+- Trabajo con formularios y envío de mails
+- Depsliege
+
+
+## Inicio ProyectoWeb
+```
+django-admin startproject ProyectoWeb
+
+cd ProyectoWeb
+
+python3 manage.py startapp ProyectoWebApp
+
+# configuar settings.py (TimeZone, idioma, ip , mail, bd...)
+
+python3 manage.py runserver 192.168.0.4:8000'
+```
+
+### Menu:
+- Home
+- Servicios
+- Tienda
+- Blog
+- Contacto
+- *(admin)*
+
+
+App/
+*views.py*
+```
+from django.shortcuts import render, HttpResponse
+
+def home(request):
+ return HttpResponse("Inicio")
+
+def servicios(request):
+ return HttpResponse("Servicios")
+
+def tienda(request):
+ return HttpResponse("Tienda")
+
+def blog(request):
+ return HttpResponse("Blog")
+
+def contacto(request):
+ return HttpResponse("Contacto")
+```
+Project/*urls.py*
+```
+from django.contrib import admin
+from django.urls import path
+from ProyectoWebApp import views
+
+urlpatterns = [
+ path('admin/', admin.site.urls),
+ path('', views.home, name="Inicio"),
+ path('servicios/', views.servicios, name ='Servicios'),
+ path('tienda/', views.tienda, name ='Tienda'),
+ path('blog/', views.blog, name ='Blog'),
+ path('contacto/', views.contacto, name='Contacto'),
+]
+```
+
+*Como es común un proyecto se compone de varias Apps*
+*Y una App puede ser reutilizada en otro proyecto*
+*urls.py explica como organizar urls para manejar multiples Apps*
+
+
+### Organizar URLs
+
+**Including another URLconf**
+ - 1. Import the include() function: *from django.urls import include, path*
+ - 2. Add a URL to urlpatterns: *path('blog/', include('blog.urls'))*
+
+
+Project/*urls.py*
+```
+from django.contrib import admin
+from django.urls import path, include
+
+
+urlpatterns = [
+ path('admin/', admin.site.urls),
+ path('ProyectoWebApp/', include('ProyectoWebApp.urls')),
+]
+```
+**Para evitar tener que escribir misitio.com/ProyectoWebApp/home**
+**Dejar '' en vez de 'Proyec...' en el path de ProyectoWeb/urls.py**
+
+### Crear urls.py en la carpeta de la aplicacion
+*App/urls.py*
+```
+from django.urls import path
+from ProyectoWebApp import views
+
+urlpatterns = [
+ path('', views.home, name="Inicio"),
+ path('servicios/', views.servicios, name ='Servicios'),
+ path('tienda/', views.tienda, name ='Tienda'),
+ path('blog/', views.blog, name ='Blog'),
+ path('contacto/', views.contacto, name='Contacto'),
+]
+```
+
+## Crear Templates
+
+***ProyectoWebApp/templates/ProyectoWebApp/ por convención***
+inicio - servicios - tienda - blog - contacto
+
+### Registrar App
+***Project/settings.py***
+```
+INSTALLED_APPS = [
+ ...
+ 'ProyectoWebApp',
+]
+```
+
+### Modificar vistas para html
+App/*views.py*
+```
+from django.shortcuts import render, HttpResponse
+
+def home(request):
+ return render(request, "ProyectoWebApp/home.html")
+
+def servicios(request):
+ return render(request, "ProyectoWebApp/servicios.html")
+
+def tienda(request):
+ return render(request, "ProyectoWebApp/tienda.html")
+
+def blog(request):
+ return render(request, "ProyectoWebApp/blog.html")
+
+def contacto(request):
+ return render(request, "ProyectoWebApp/contacto.html")
+```
-## [Proyecto Web](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7a_Proyecto_Web_Completo#user-content-proyecto-web)
-- [Iniciar Proyecto Django](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7a_Proyecto_Web_Completo#user-content-inicio-proyectoweb)
-- [Creación Vistas](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7a_Proyecto_Web_Completo#user-content-creaci%C3%B3n-de-las-vistas)
-- [Registro de URLs](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7a_Proyecto_Web_Completo#user-content-registro-de-urls)
-- [Organizar URLs por App](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7a_Proyecto_Web_Completo#user-content-organizar-urls-por-app)
-- [Crear Templates](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7a_Proyecto_Web_Completo#user-content-crear-templates)
-- [Restrar App](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7a_Proyecto_Web_Completo#user-content-registrar-app)
-- [Registro Vistas html](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7a_Proyecto_Web_Completo#user-content-modificar-vistas-para-html)
-## [Bootstrap y Herencia en la estructura del sitio](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7b_Proyecto_Web_Completo)
-- [Formato del sitio con Bootstrap](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7b_Proyecto_Web_Completo#user-content-dar-formato-al-sitio-con-bootstrap)
-- [TAG {% load static %}](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7b_Proyecto_Web_Completo#user-content-tag-load-static)
-- [Herencia de Plantillas](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7b_Proyecto_Web_Completo#user-content-herencia-de-plantillas-y-estructura-del-sitio)
-- [Creación de plantilla base](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7b_Proyecto_Web_Completo#user-content-creaci%C3%B3n-plantilla-base)
-- [Barra de navegación, destacar sitio en visita](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7b_Proyecto_Web_Completo#user-content-barra-de-navegacion-destacar-sitio-en-visita)
-- [Creación App servicios](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7b_Proyecto_Web_Completo#user-content-creacion-de-otra-app)
-- [ORM Creación modelo](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7b_Proyecto_Web_Completo#user-content-orm-object-relational-mapping)
-- [Pillow, almacenar imagenes](https://gitea.kickto.net/jp.av.dev/intro_Django/wiki/7b_Proyecto_Web_Completo#user-content-para-usar-imagenes)
diff --git a/ProyectoWeb/manage.py b/ProyectoWeb/manage.py
new file mode 100755
index 0000000..bab5e1a
--- /dev/null
+++ b/ProyectoWeb/manage.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+"""Django's command-line utility for administrative tasks."""
+import os
+import sys
+
+
+def main():
+ """Run administrative tasks."""
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ProyectoWeb.settings')
+ try:
+ from django.core.management import execute_from_command_line
+ except ImportError as exc:
+ raise ImportError(
+ "Couldn't import Django. Are you sure it's installed and "
+ "available on your PYTHONPATH environment variable? Did you "
+ "forget to activate a virtual environment?"
+ ) from exc
+ execute_from_command_line(sys.argv)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/ProyectoWeb/servicios/migrations/0008_auto_20201120_1523.py b/ProyectoWeb/servicios/migrations/0008_auto_20201120_1523.py
new file mode 100644
index 0000000..61795bd
--- /dev/null
+++ b/ProyectoWeb/servicios/migrations/0008_auto_20201120_1523.py
@@ -0,0 +1,22 @@
+# Generated by Django 3.1.3 on 2020-11-20 18:23
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('servicios', '0007_auto_20201119_0323'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='servicio',
+ options={'verbose_name': 'servicio', 'verbose_name_plural': 'servicios'},
+ ),
+ migrations.AlterField(
+ model_name='servicio',
+ name='imagen',
+ field=models.ImageField(upload_to='servicios'),
+ ),
+ ]
diff --git a/ProyectoWeb/servicios/migrations/__pycache__/0001_initial.cpython-38.pyc b/ProyectoWeb/servicios/migrations/__pycache__/0001_initial.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c2f4e452951a2bf18dc1de8bb943ce75caed3e29
GIT binary patch
literal 887
zcmY*X&2H2%5VoCcHp%XmLJMb3KrY?F8KI(9MLo1aY7tT{R(8ity-niaBrV%3h+AI(
z@d7*mFJp1z)ED5;129gu?PANL`TRHEd^7JxqmbbE`tt`rcL@1q!SZksY~iY&paB9j
zBRP#}&SFN%8v+cR&jcJnXU-=lcECL(QSS=xl8Biwm#I!_sfx;YxdM?@Q+u>L1_-ur
zRbS8u5>p^C0~$LiiCxi~c{YUT&wQXbUFd;#=^iua<6Zzh1eX+1_#YY|3SkJN_G|^w
z0N>tg(dsfvJ-81KVC@@&^-CwE@em$j0*_3vf5ZI9_=iHD$*EL^N!T@PZzpoiFllPV
zr&=Vn05d4H%o9E5r($k`N@$s6@|?#i6X5}
zOfXeNEeZ+Bc=%H)3S+MXO_`|#c&$u-5es*_*o8Xh34rN0CA1`bjN9?F3|g;>n6?6&
zwPhl_%o?3!kz?GB*Rd2CRHm=WwpItx$oRbF%()3U$I>;KK!3>jhbGDFD@1)+$Qm;>
zLlC7XKonCcD$Q)b!FDUnzAd`O#v&$ojf(BsNG8}mNp$Cidp6t7AMIcsM>1c)P?ciQ
zJ>Q9bihs1`dT)H9axp%>DC*PkTdn3|TC3{4nA`&E-%2pPYr^s7=H_$0V7*b!we4;X
zSM?Z;&s^rZE@f<;uH4LP7BI^GxWC=M?d=1seE_qhNYw^R+FaZ8+QU1No%alXHU7&^
NzE@U-%8Ik<`~x-A0xtjn
literal 0
HcmV?d00001
diff --git a/ProyectoWeb/servicios/migrations/__pycache__/0002_auto_20201118_2354.cpython-38.pyc b/ProyectoWeb/servicios/migrations/__pycache__/0002_auto_20201118_2354.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c647c4d23cd7e60a8bc440e7b5d4815380cb94ca
GIT binary patch
literal 563
zcmYjN!A`
z*@G8P{(=W_T11#+Ci70JdGwQh>&C#&9Y33g?spx%ZmZdO_lRlib({R*EoNe1X0e;k$@Bu0m(1~tr#9-
zwoal9R96a!&K6>(DpUCTi8rFQkyV86OYcs`;N3nZ*}ZqJi*dCqStF!rXt2cGLlU(
aD3&hjtHl;s9mkD(w7C2@SJnA}HR~5?YM5{U
literal 0
HcmV?d00001
diff --git a/ProyectoWeb/servicios/migrations/__pycache__/0003_auto_20201118_2357.cpython-38.pyc b/ProyectoWeb/servicios/migrations/__pycache__/0003_auto_20201118_2357.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..229cd8e35a35626e24aa04456b419bb3a69b82ca
GIT binary patch
literal 546
zcmZWlyH3L}6t$i7se?
z1}1)ifpVSFhs2fc^?e?lLD9bKD1+LsD=
z;>Up3wt00)j&goor=-g~pK-3MoX1j(Bfz}I`QzA+%(kfnj35z^1RA;_eW+0Uz{_E&u=k
literal 0
HcmV?d00001
diff --git a/ProyectoWeb/servicios/migrations/__pycache__/0004_auto_20201119_0000.cpython-38.pyc b/ProyectoWeb/servicios/migrations/__pycache__/0004_auto_20201119_0000.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b77c144b7967e8492724454c33d2d03c1cf64fe5
GIT binary patch
literal 559
zcmY*V%}&BV5Z-MIlnN$z@$SKd3oW2g6Jzw`2{ch-!evvs0~XtE?G_Te>eUDF0elG`
zVJ{v$`3fGyX^|f%*~!ee-+VjY-c+j=!Fd08V*^UaXV$ETfz2r%xr2!lP6HCs9;M`*
zaE@+LPYXxN$}5g)iihI#pKa4-+@_MI^lpT92jZE}}qsloK4ML)z297!@*M
zZupcJUNpptyokajRqiYl>zXP{NG87L3#qmp$7wTnoC?-*T28asJY=o*{(&+V995Y>
z(iaj~J93syL
znP_N4)y{$xl8)dIT+GFkC1Uvdg;$c)kd>$JYx_=wU=JRn^xnQq#1y<#$XnkG>qH9e-IezT
z`~V-o&uj@5zd%74I|+%zNHdx@`{rrieCYSPjN@
zW6s%Y1_GR01`hI-xN%|u?mHHEzlg^IZo7H9)Jc`9!Yu01d3XdSl;$ZFWHARu>wL*$
z2i=ud3xf;ZR{^biLDLqrN!qua=}|KfwqsCl(nYFF{3wc|XEIq=N{*v(G#ZUAC5@uk
zKXPn)-=RH>(2zuLgL(7Ua_oUS$>PsRGR2?8R(Xm3TPPH>L-~YRd2T;g!lU{Pd-$
zuEV!lZE;a4^AYF&K;0kBnecS$kZeEy?-ZkGSZ=jL`YlRxLB)5(&h=a_xc|r9HE*-P
ju^m_?#ZnDn-h8^5pFXzl9?-h=U+kT~tW`~Iu;=^*QNEw=
literal 0
HcmV?d00001
diff --git a/ProyectoWeb/servicios/migrations/__pycache__/0006_auto_20201119_0323.cpython-38.pyc b/ProyectoWeb/servicios/migrations/__pycache__/0006_auto_20201119_0323.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b84cbb4d1ef711c861622937d8e762afccf80ccd
GIT binary patch
literal 589
zcmZ8d!A{#i5Zztdi4%n);K047`huOHA|X{3oH!*^YO6}Vtengc9Bi-Ibt1tPuKWQ%
zzz^^-d+n*ez=3q^G$mrB8O@u0^R#b%Zf$iL#c2Ck-gCx&*I+YT0wv@vZ>>2@S)9##R73!e^%+6P0wyR3~ccUk!cZt=MmmlG!$}zmSEvl>V
zn^reCsg(JJ0Mw~wv5JzBT^mzDFcwW_HN_ME@#k)L`1
literal 0
HcmV?d00001
diff --git a/ProyectoWeb/servicios/migrations/__pycache__/0007_auto_20201119_0323.cpython-38.pyc b/ProyectoWeb/servicios/migrations/__pycache__/0007_auto_20201119_0323.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8b49af69289801c7d2aa21b6969eeba427348d61
GIT binary patch
literal 590
zcmZut!A{#i5Zztdi4z4X$bma2e8EnTs45{uPn<$46;#QWm6MqU2ixoJI+5U7IPwSl
z06)OT?6oI;p@+iQAti^7G^2U5Z=Uwe#l}XLQOFNZ@{Tk1y9Vpw5;&nWyHtPy&sff5
z&eZ_&yf0_
zlt1T5R#J3|oGQCZ#ru;b%FIA4=kDH>p
z3cqS~jgv~5?>PPk>V9R;gzvWw=@cLTbBg`)T05lQqBNUSd`G;vp34RI|GF>D+gae)
h4$P8bs`g>re7c#xe{9+HY2ErqOXtV6s;Le3oLAmVpZfp+
literal 0
HcmV?d00001
diff --git a/ProyectoWeb/servicios/migrations/__pycache__/0008_auto_20201120_1523.cpython-38.pyc b/ProyectoWeb/servicios/migrations/__pycache__/0008_auto_20201120_1523.cpython-38.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e5a19684d05182d0a50ae5da0fdaf65e3da1d506
GIT binary patch
literal 701
zcmYjP&2G~`5Z*s0w$(}?4&@1ue5sv82#`=!E+7sqNPv)hSvlEhaIn4Zu3f2I+iTu{
z7vK#LkFr-zyaI@ySvR3sX~y%-jOUw~-FN%@F~RdK`YLCPknbMs9)aK(#Xdl#h@us#
zX-;dFGfG|%#T36LiUVEoE1q*D-jF2tfw?4MF0RX^DY{ZO){Sbdpt1`e+C5_g$0+s)
z6_A`Nk~2k@H0K~z0TLjE5}%n0)(kx(#3LB5LiCQ;RE2B4WO<|_B#vElvSmd2$bz{j
z7p1oOL6&8YWYKq8PP1t?nM|I@Y&M;_aGPTSqEeKUi@#kz&f1$-gq0K&NHQmSbwb7Tb=(K$g^Z&rx+tt|g_8wDQg`k0_C$?<3aRe5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!Hkenx(7s(xBk
zUP-ooKv8~WYH~?_ad>JHoC9JPrxulECTHds>*r>s7bTWt=I0gb$H!;pWtPOp>lIYq
T;;_lhPbtkwwF4Rd8HgDG^3EtS
literal 0
HcmV?d00001
diff --git a/ProyectoWeb/servicios/models.py b/ProyectoWeb/servicios/models.py
index e4f1738..9f25194 100644
--- a/ProyectoWeb/servicios/models.py
+++ b/ProyectoWeb/servicios/models.py
@@ -5,10 +5,10 @@ from django.db import models
class Servicio(models.Model):
titulo = models.CharField( max_length = 50 )
contenido = models.CharField( max_length = 50 )
- imagen = models.ImageField(upload_to = 'servicios')
+ imagen = models.ImageField( upload_to= 'servicios' )
created = models.DateTimeField( auto_now_add = True)
updated = models.DateTimeField( auto_now_add = True)
-
+
class Meta:
verbose_name = 'servicio'
verbose_name_plural = 'servicios'
@@ -17,5 +17,3 @@ class Servicio(models.Model):
def __str__(self):
return self.titulo
-
-
diff --git a/ProyectoWeb/servicios/templates/servicios/servicios.html b/ProyectoWeb/servicios/templates/servicios/servicios.html
new file mode 100644
index 0000000..7fac6f8
--- /dev/null
+++ b/ProyectoWeb/servicios/templates/servicios/servicios.html
@@ -0,0 +1,18 @@
+{% extends 'ProyectoWebApp/base.html' %}
+
+{% load static %}
+
+{% block content %}
+
+ {% for servicio in servicios %}
+
+
+
{{servicio.titulo}}
+
{{servicio.contenido}}
+

+
+
+ {% endfor %}
+
+{% endblock %}
+
diff --git a/ProyectoWeb/servicios/urls.py b/ProyectoWeb/servicios/urls.py
new file mode 100644
index 0000000..2bc8be9
--- /dev/null
+++ b/ProyectoWeb/servicios/urls.py
@@ -0,0 +1,11 @@
+from django.urls import path
+from . import views
+from django.conf import settings
+from django.conf.urls.static import static
+
+urlpatterns = [
+ path('', views.servicios, name ='Servicios'),
+]
+
+
+urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
diff --git a/ProyectoWeb/servicios/views.py b/ProyectoWeb/servicios/views.py
index 91ea44a..e22f045 100644
--- a/ProyectoWeb/servicios/views.py
+++ b/ProyectoWeb/servicios/views.py
@@ -1,3 +1,8 @@
from django.shortcuts import render
+from servicios.models import Servicio
# Create your views here.
+def servicios(request):
+ servicios = Servicio.objects.all()
+ return render(request, "servicios/servicios.html", {"servicios":servicios})
+