<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://es.wikieducator.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
		<id>https://es.wikieducator.org/index.php?action=history&amp;feed=atom&amp;title=Curso_Python_DGA_2011%2Fdjango%2Fcontenidos</id>
		<title>Curso Python DGA 2011/django/contenidos - Historial de revisiones</title>
		<link rel="self" type="application/atom+xml" href="https://es.wikieducator.org/index.php?action=history&amp;feed=atom&amp;title=Curso_Python_DGA_2011%2Fdjango%2Fcontenidos"/>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;action=history"/>
		<updated>2026-06-19T02:24:22Z</updated>
		<subtitle>Historial de revisiones para esta página en el wiki</subtitle>
		<generator>MediaWiki 1.23.14</generator>

	<entry>
		<id>https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5230&amp;oldid=prev</id>
		<title>Lmorillas en 15:37 25 ago 2011</title>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5230&amp;oldid=prev"/>
				<updated>2011-08-25T15:37:57Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión de 15:37 25 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Template (plantillas): capa de Presentación. Describe cómo se van a presentar los datos al usuario.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Template (plantillas): capa de Presentación. Describe cómo se van a presentar los datos al usuario.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!--&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Basado en [http://www.zonical.net/?p=200 Django 101]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;https://docs.djangoproject.com/en/1.3/intro/tutorial01/&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;--&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/intro}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/intro}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/admin}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/admin}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/contenidos/vistas}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/contenidos/vistas}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/forms}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/forms}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lmorillas</name></author>	</entry>

	<entry>
		<id>https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5228&amp;oldid=prev</id>
		<title>Lmorillas en 12:51 24 ago 2011</title>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5228&amp;oldid=prev"/>
				<updated>2011-08-24T12:51:31Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión de 12:51 24 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{MiTitulo| Contenido}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{MiTitulo| Contenido}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;TEP&lt;/del&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;TOC|right&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Evolución del desarrollo web ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Evolución del desarrollo web ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lmorillas</name></author>	</entry>

	<entry>
		<id>https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5227&amp;oldid=prev</id>
		<title>Lmorillas en 12:50 24 ago 2011</title>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5227&amp;oldid=prev"/>
				<updated>2011-08-24T12:50:34Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión de 12:50 24 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/admin}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/admin}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/contenidos/vistas}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{:Curso_Python_DGA_2011/django/contenidos/vistas}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{:Curso_Python_DGA_2011/django/forms}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lmorillas</name></author>	</entry>

	<entry>
		<id>https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5218&amp;oldid=prev</id>
		<title>Lmorillas en 09:44 24 ago 2011</title>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5218&amp;oldid=prev"/>
				<updated>2011-08-24T09:44:38Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;amp;diff=5218&amp;amp;oldid=5214&quot;&gt;Mostrar los cambios&lt;/a&gt;</summary>
		<author><name>Lmorillas</name></author>	</entry>

	<entry>
		<id>https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5214&amp;oldid=prev</id>
		<title>Lmorillas en 06:25 24 ago 2011</title>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5214&amp;oldid=prev"/>
				<updated>2011-08-24T06:25:26Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión de 06:25 24 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 548:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 548:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para eso hay que cambiar la plantilla '''admin/index.html'''. En lugar de usar la variable '''app_list''', puedes forzar las aplicaciones como quieras.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para eso hay que cambiar la plantilla '''admin/index.html'''. En lugar de usar la variable '''app_list''', puedes forzar las aplicaciones como quieras.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Curso_Python_DGA_2011/django/contenidos/vistas}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:&lt;/ins&gt;Curso_Python_DGA_2011/django/contenidos/vistas}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lmorillas</name></author>	</entry>

	<entry>
		<id>https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5212&amp;oldid=prev</id>
		<title>Lmorillas en 06:20 24 ago 2011</title>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5212&amp;oldid=prev"/>
				<updated>2011-08-24T06:20:24Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión de 06:20 24 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 547:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 547:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Por defecto aparecen todas las aplicaciones de INSTALLED_APPS por orden alfabético. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Por defecto aparecen todas las aplicaciones de INSTALLED_APPS por orden alfabético. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para eso hay que cambiar la plantilla '''admin/index.html'''. En lugar de usar la variable '''app_list''', puedes forzar las aplicaciones como quieras.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Para eso hay que cambiar la plantilla '''admin/index.html'''. En lugar de usar la variable '''app_list''', puedes forzar las aplicaciones como quieras.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Curso_Python_DGA_2011/django/contenidos/vistas}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lmorillas</name></author>	</entry>

	<entry>
		<id>https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5211&amp;oldid=prev</id>
		<title>Lmorillas en 16:58 23 ago 2011</title>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5211&amp;oldid=prev"/>
				<updated>2011-08-23T16:58:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;amp;diff=5211&amp;amp;oldid=5210&quot;&gt;Mostrar los cambios&lt;/a&gt;</summary>
		<author><name>Lmorillas</name></author>	</entry>

	<entry>
		<id>https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5210&amp;oldid=prev</id>
		<title>Lmorillas en 15:22 23 ago 2011</title>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5210&amp;oldid=prev"/>
				<updated>2011-08-23T15:22:44Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión de 15:22 23 ago 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 335:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 335:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Más información sobre las relaciones entre modelos: [https://docs.djangoproject.com/en/1.3/ref/models/relations/ Acceder a objetos relacionados.] Para más infor sobre cómo usar los dobles guiones bajos para hacer búsquedas por campos mediante la API: [http://docs.djangoproject.com/en/1.3/topics/db/queries/#field-lookups búsquedas mediante los campos] Para más detalles sobre la API de la base de datos: [https://docs.djangoproject.com/en/1.3/topics/db/queries/ Referencia de la Base de Datos].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Más información sobre las relaciones entre modelos: [https://docs.djangoproject.com/en/1.3/ref/models/relations/ Acceder a objetos relacionados.] Para más infor sobre cómo usar los dobles guiones bajos para hacer búsquedas por campos mediante la API: [http://docs.djangoproject.com/en/1.3/topics/db/queries/#field-lookups búsquedas mediante los campos] Para más detalles sobre la API de la base de datos: [https://docs.djangoproject.com/en/1.3/topics/db/queries/ Referencia de la Base de Datos].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== El poderoso Admin de Django ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* El Admin es una herramienta pensada para el &amp;quot;backend&amp;quot;, no para el acceso de los usuarios&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Simplifica la tarea de insertar, modificar y eliminar contenido de la web.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=== Activar el Admin ===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Por defecto está desactivado.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Añade '''django.contrib.admin''' a la lista de '''INSTALLED_APPS''' en&amp;#160; '''settings.py'''.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Ejecuta&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; $ python manage.py syncdb&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Tip|Siempre que añadimos una nueva aplicación hay que actualizar la base de datos}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Edita el fichero '''urls.py''' de tu proyecto y descomenta las líneas que hacen referencia al admin (3 líneas en total)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;El fichero tiene que quedar al final algo así:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;source lang=&amp;quot;python&amp;quot; line=&amp;quot;GESHI_NORMAL_LINE_NUMBERS&amp;quot; highlight=&amp;quot;4, 5, 16&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;from django.conf.urls.defaults import *&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# Uncomment the next two lines to enable the admin:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;from django.contrib import admin 	&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;admin.autodiscover()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;urlpatterns = patterns('',&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; # Example:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; # (r'^mysite/', include('mysite.foo.urls')),&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; # Uncomment the admin/doc line below and add 'django.contrib.admindocs'&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; # to INSTALLED_APPS to enable admin documentation:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; # (r'^admin/doc/', include('django.contrib.admindocs.urls')),&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; # Uncomment the next line to enable the admin:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; (r'^admin/', include(admin.site.urls)),&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/source&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lmorillas</name></author>	</entry>

	<entry>
		<id>https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5209&amp;oldid=prev</id>
		<title>Lmorillas: Página creada con '{{:Curso Python DGA 2011/django/nav}} {{MiTitulo| Contenido}}  {{TEP}}  == Evolución del desarrollo web == # Páginas HTML estáticas # CGI:  código para generar páginas web…'</title>
		<link rel="alternate" type="text/html" href="https://es.wikieducator.org/index.php?title=Curso_Python_DGA_2011/django/contenidos&amp;diff=5209&amp;oldid=prev"/>
				<updated>2011-08-23T14:26:51Z</updated>
		
		<summary type="html">&lt;p&gt;Página creada con &amp;#039;{{:Curso Python DGA 2011/django/nav}} {{MiTitulo| Contenido}}  {{TEP}}  == Evolución del desarrollo web == # Páginas HTML estáticas # CGI:  código para generar páginas web…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{:Curso Python DGA 2011/django/nav}}&lt;br /&gt;
{{MiTitulo| Contenido}}&lt;br /&gt;
&lt;br /&gt;
{{TEP}}&lt;br /&gt;
&lt;br /&gt;
== Evolución del desarrollo web ==&lt;br /&gt;
# Páginas HTML estáticas&lt;br /&gt;
# CGI:  código para generar páginas web dinámicas:&lt;br /&gt;
# Código embebido en páginas web (PHP, JSP, ASP, ...) &lt;br /&gt;
# Frameworks web:&lt;br /&gt;
#* RoR, Struts, Symphony&lt;br /&gt;
#* Django, Pylons, Web2Py&lt;br /&gt;
&lt;br /&gt;
== Django ==&lt;br /&gt;
Django permite a los desarrolladores crear de forma rápida sitios web de altas prestaciones basados en información almacenada en bases de datos bajo el principio de no repetición (Do Not Repeat Yourself: DRY).&lt;br /&gt;
&lt;br /&gt;
=== El nombre ===&lt;br /&gt;
Adrian Holovaty, co-creador de Django, es un guitarrista inspirado por Django Reinhardt.&lt;br /&gt;
&lt;br /&gt;
=== MVC / MVT ===&lt;br /&gt;
MTV: Desarrollo web según un patrón Modelo - Vista - Template (similar al patrón MVC)&lt;br /&gt;
* Modelo: capa de Datos. Describe los datos que gestiona la aplicación. Cada modelo enlaza una tabla en la base de datos.&lt;br /&gt;
* Vista: capa de Negocio. Describe a qué datos hay que acceder y los transforma.&lt;br /&gt;
* Template (plantillas): capa de Presentación. Describe cómo se van a presentar los datos al usuario.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Basado en [http://www.zonical.net/?p=200 Django 101]&lt;br /&gt;
https://docs.djangoproject.com/en/1.3/intro/tutorial01/&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Instalación ==&lt;br /&gt;
https://docs.djangoproject.com/en/1.3/intro/install/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import django&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; django.VERSION&lt;br /&gt;
(1, 3, 0, 'final', 0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Crear un proyecto ==&lt;br /&gt;
Seguimos el tutorial de django: https://docs.djangoproject.com/en/1.3/intro/tutorial01/&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
$ django-admin.py startproject sitio_encuestas&lt;br /&gt;
$ ls -l&lt;br /&gt;
sitio_encuestas/&lt;br /&gt;
    __init__.py&lt;br /&gt;
    manage.py&lt;br /&gt;
    settings.py&lt;br /&gt;
    urls.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;__init__.py&lt;br /&gt;
: Indica que se trata de un paquete.&lt;br /&gt;
;manage.py&lt;br /&gt;
: Programa de gestión de django. A partir de ahora será el que usemos para interactuar con el proyecto.&lt;br /&gt;
;settings.py&lt;br /&gt;
: Fichero de configuración del proyecto.&lt;br /&gt;
;urls.py&lt;br /&gt;
: Gestiona la tabla de urls a las que responde el proyecto.&lt;br /&gt;
&lt;br /&gt;
== Servidor de desarrollo ==&lt;br /&gt;
Comprobamos el funcionamiento:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd sitio_encuestas&lt;br /&gt;
$ python manage.py runserver&lt;br /&gt;
Validating models...&lt;br /&gt;
&lt;br /&gt;
0 errors found&lt;br /&gt;
Django version 1.3, using settings 'sitio_encuestas.settings'&lt;br /&gt;
Development server is running at http://127.0.0.1:8000/&lt;br /&gt;
Quit the server with CONTROL-C.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Comprobamos la dirección con el navegador o &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ curl -I  127.0.0.1:8000&lt;br /&gt;
HTTP/1.0 200 OK&lt;br /&gt;
Date: Mon, 22 Aug 2011 20:33:33 GMT&lt;br /&gt;
Server: WSGIServer/0.1 Python/2.7.1+&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Este servidor ligero nos servirá para desarrollar el proyecto. No está pensado para sitios en producción.&lt;br /&gt;
{{Tip| Podemos cambiar el puerto ejecutando:&lt;br /&gt;
  $ python manage.py runserver 8080&lt;br /&gt;
y También la ip:&lt;br /&gt;
  $ python manage.py runserver 0.0.0.0:8000&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuración del proyecto ==&lt;br /&gt;
Editar '''settings.py'''&lt;br /&gt;
Como el fichero necesita rutas absolutas, podemos añadir esta función:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import os&lt;br /&gt;
def ruta_abs(x):&lt;br /&gt;
    return os.path.join(os.path.abspath(os.path.dirname(__file__)), x)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuración de la base de datos===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
DATABASES = {&lt;br /&gt;
    'default': {&lt;br /&gt;
        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.&lt;br /&gt;
        'NAME': '',                      # Or path to database file if using sqlite3.&lt;br /&gt;
        'USER': '',                      # Not used with sqlite3.&lt;br /&gt;
        'PASSWORD': '',                  # Not used with sqlite3.&lt;br /&gt;
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.&lt;br /&gt;
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Para usar sqlite:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
DATABASES = {&lt;br /&gt;
    'default': {&lt;br /&gt;
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.&lt;br /&gt;
        'NAME': ruta_abs('encuestas.db'),                      # Or path to database file if using sqlite3.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
Cambiamos también otros datos:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
TIME_ZONE = 'Europe/Madrid'&lt;br /&gt;
LANGUAGE_CODE = 'es-es'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ejecutamos:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
$python manage.py syncdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
que crea las tablas necesarias para el desarrollo de proyecto, incluyendo todas las aplicaciones incuidas en INSTALLED_APPS&lt;br /&gt;
&lt;br /&gt;
==Proyectos y aplicaciones==&lt;br /&gt;
Para optimizar los recursos, un proyecto puede tener varias aplicaciones. Estas aplicaciones se pueden instalar en varios proyectos. &lt;br /&gt;
Por eso se dice que las aplicaciones de django son '''&amp;quot;pluglables&amp;quot;'''.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
$ python manage.py startapp encuestas&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Esto creará el siguiente directorio:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
encuestas/&lt;br /&gt;
    __init__.py&lt;br /&gt;
    models.py&lt;br /&gt;
    views.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hay que añadir la nueva apliación a '''INSTALLED_APPS''' dentro de '''settings.py'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
INSTALLED_APPS = (&lt;br /&gt;
    'django.contrib.auth',&lt;br /&gt;
    'django.contrib.contenttypes',&lt;br /&gt;
    'django.contrib.sessions',&lt;br /&gt;
    'django.contrib.sites',&lt;br /&gt;
    'django.contrib.messages',&lt;br /&gt;
    'sitio_encuestas.encuestas'&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Definición de modelos==&lt;br /&gt;
'''models.py'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from django.db import models&lt;br /&gt;
 &lt;br /&gt;
class Encuesta(models.Model):&lt;br /&gt;
    pregunta = models.CharField(max_length=200)&lt;br /&gt;
    fecha_pub = models.DateTimeField(u'fecha de publicación')&lt;br /&gt;
 &lt;br /&gt;
    def __unicode__(self):&lt;br /&gt;
        return self.pregunta&lt;br /&gt;
 &lt;br /&gt;
class Opcion(models.Model):&lt;br /&gt;
    encuesta = models.ForeignKey(Encuesta)&lt;br /&gt;
    opcion = models.CharField(max_length=200)    &lt;br /&gt;
    votos = models.IntegerField()&lt;br /&gt;
 &lt;br /&gt;
    def __unicode__(self):&lt;br /&gt;
        return self.opcion&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
$ python manage.py sql encuestas&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Esto hará que veamos el siguiente código SQL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
BEGIN;&lt;br /&gt;
CREATE TABLE &amp;quot;encuestas_encuesta&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; integer NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;pregunta&amp;quot; varchar(200) NOT NULL,&lt;br /&gt;
    &amp;quot;fecha_pub&amp;quot; datetime NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
CREATE TABLE &amp;quot;encuestas_opcion&amp;quot; (&lt;br /&gt;
    &amp;quot;id&amp;quot; integer NOT NULL PRIMARY KEY,&lt;br /&gt;
    &amp;quot;encuesta_id&amp;quot; integer NOT NULL REFERENCES &amp;quot;encuestas_encuesta&amp;quot; (&amp;quot;id&amp;quot;),&lt;br /&gt;
    &amp;quot;opcion&amp;quot; varchar(200) NOT NULL,&lt;br /&gt;
    &amp;quot;votos&amp;quot; integer NOT NULL&lt;br /&gt;
)&lt;br /&gt;
;&lt;br /&gt;
COMMIT;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Si el código es correcto, ejecutamos:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ python manage.py syncdb&lt;br /&gt;
Creating table encuestas_encuesta&lt;br /&gt;
Creating table encuestas_opcion&lt;br /&gt;
&lt;br /&gt;
You just installed Django's auth system, which means you don't have any superusers defined.&lt;br /&gt;
Would you like to create one now? (yes/no): yes&lt;br /&gt;
Username (Leave blank to use 'lm'): lm&lt;br /&gt;
E-mail address: lm@micorreo.com&lt;br /&gt;
Password: &lt;br /&gt;
Password (again): &lt;br /&gt;
Superuser created successfully.&lt;br /&gt;
Installing custom SQL ...&lt;br /&gt;
Installing indexes ...&lt;br /&gt;
No fixtures found.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Jugando con el ORM de Django ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
$ python manage.py shell&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; from encuestas.models import Encuesta, Pregunta # Importa las clases del modelo&lt;br /&gt;
&lt;br /&gt;
# No hay encuestas&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; Encuesta.objects.all()&lt;br /&gt;
[]&lt;br /&gt;
&lt;br /&gt;
# Creamos una nueva encuesta&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import datetime&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p = Encuesta(pregunta=&amp;quot;¿Cómo va el curso?&amp;quot;, fecha_pub=datetime.datetime.now())&lt;br /&gt;
&lt;br /&gt;
# Guardamos el objeto en la base de datos&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.save()&lt;br /&gt;
&lt;br /&gt;
# Creación de ID automática&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.id&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
# Acceso a los valores&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.pregunta&lt;br /&gt;
&amp;quot;¿Cómo va el curso?&amp;quot;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.fecha_pub&lt;br /&gt;
datetime.datetime(2011, 7, 15, 12, 00, 53)&lt;br /&gt;
&lt;br /&gt;
# Cambio de valores de los atributos&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.pub_date = datetime.datetime(2011, 7, 20, 0, 0)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.save()&lt;br /&gt;
&lt;br /&gt;
# objects.all() muestra todas las encuestas de la base de datos&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; Encuesta.objects.all()&lt;br /&gt;
[&amp;lt;Encuesta: ¿Cómo va el curso?]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Vemos el contenido de la encuesta porque hemos añadido el método '''__unicode__'''. Si no, veríamos '''&amp;lt;Encuesta: Encuesta object&amp;gt;''' Se crea el método __unicode__ y no __str__ porque los modelos de Django tratan con unicode por defecto.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# API de búsquedas de Django&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; Encuesta.objects.filter(id=1)&lt;br /&gt;
[&amp;lt;Encuesta: ¿Cómo va el curso?&amp;gt;]&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; Encuesta.objects.filter(pregunta__startswith='¿Cómo')&lt;br /&gt;
[&amp;lt;Encuesta: ¿Cómo va el curso?&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
# Obtener las encuestas de 2011&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; Encuesta.objects.get(fecha_pub__year=2011)&lt;br /&gt;
&amp;lt;Encuesta: ¿Cómo va el curso?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; Encuesta.objects.get(id=2)&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
    ...&lt;br /&gt;
DoesNotExist: Encuesta matching query does not exist.&lt;br /&gt;
&lt;br /&gt;
# Búsqueda por clave primaria&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; Encuesta.objects.get(pk=1)&lt;br /&gt;
&amp;lt;Encuesta: ¿Cómo va el curso?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Vamos a insertar unas opciones para ver cómo funcionan las relaciones.&lt;br /&gt;
# Podemos crear las opciones desde la misma encuesta:&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p = Encuesta.objects.get(pk=1)&lt;br /&gt;
&lt;br /&gt;
# Opciones relacionadas con nuestra encuesta:&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.opcion_set.all()&lt;br /&gt;
[]&lt;br /&gt;
&lt;br /&gt;
# Creamos tres opciones&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.opcion_set.create(opcion='Muy bien', votos=0)&lt;br /&gt;
&amp;lt;Opcion: Muy bien&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.opcion_set.create(opcion='Bien', votos=0)&lt;br /&gt;
&amp;lt;Opcion: Bien&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; c = p.opcion_set.create(opcion='Regular', votos=0)&lt;br /&gt;
&lt;br /&gt;
# Los objetos Opción tienen acceso desde la API a la encuesta a la que pertenecen:&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; c.encuesta&lt;br /&gt;
&amp;lt;Encuesta: ¿Cómo va el curso?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Y viceversa. Los objetos Encuesta acceden a sus Opciones: &lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.opcion_set.all()&lt;br /&gt;
[&amp;lt;Choice: Not much&amp;gt;, &amp;lt;Choice: The sky&amp;gt;, &amp;lt;Choice: Just hacking again&amp;gt;]&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.opcion_set.count()&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
# La API sigue de forma automática las relaciones.&lt;br /&gt;
# Para separar las relaciones se usan dobles guiones bajos.&lt;br /&gt;
# Busca todas las Opciones para cualquier encuesta publicada en 2011&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; Opcion.objects.filter(encuesta__fecha_pub__year=2011)&lt;br /&gt;
[&amp;lt;Opcion: Muy bien&amp;gt;, &amp;lt;Opcion: Bien&amp;gt;, &amp;lt;Opcion: Regular&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
# Elimina una de las opciones: &lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; c = p.opcion_set.filter(opcion__startswith='Regular')&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; c.delete()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Otros métodos en los modelos ===&lt;br /&gt;
Podemos añadir métodos normales a los modelos:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import datetime&lt;br /&gt;
class Encuesta(models.Model):&lt;br /&gt;
    #...&lt;br /&gt;
    def publicada_hoy(self):&lt;br /&gt;
        return self.fecha_pub.date() == datetime.date.today()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Y podemos usarlos así:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p = Escuesta.objects.get(pk=1)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; p.publicada_hoy()&lt;br /&gt;
False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Más información sobre las relaciones entre modelos: [https://docs.djangoproject.com/en/1.3/ref/models/relations/ Acceder a objetos relacionados.] Para más infor sobre cómo usar los dobles guiones bajos para hacer búsquedas por campos mediante la API: [http://docs.djangoproject.com/en/1.3/topics/db/queries/#field-lookups búsquedas mediante los campos] Para más detalles sobre la API de la base de datos: [https://docs.djangoproject.com/en/1.3/topics/db/queries/ Referencia de la Base de Datos].&lt;/div&gt;</summary>
		<author><name>Lmorillas</name></author>	</entry>

	</feed>