saul-g / el-libro-de-django Goto Github PK
View Code? Open in Web Editor NEWLa versiòn en español del libro Django.
Home Page: http://django-book.blogspot.mx/
License: Other
La versiòn en español del libro Django.
Home Page: http://django-book.blogspot.mx/
License: Other
Lo he intentado tanto en Debian como en OS X, y cuando ejecutas make html
, o make epub
te encuentras con el siguiente error.
StandaloneHTMLBuilder.init(self)
File "/usr/local/lib/python2.7/dist-packages/sphinx/builders/html.py", line 107, in init
self.init_highlighter()
File "/usr/local/lib/python2.7/dist-packages/sphinx/builders/html.py", line 155, in init_highlighter
self.config.trim_doctest_flags)
File "/usr/local/lib/python2.7/dist-packages/sphinx/highlighting.py", line 78, in __init__
style = get_style_by_name(stylename)
File "/usr/local/lib/python2.7/dist-packages/pygments/styles/__init__.py", line 61, in get_style_by_name
(builtin and ", though it should be builtin") + ".")
ClassNotFound: Could not find style module 'matizze'.
hay un texto que no corresponde.
Al final de la pagina 36 del Tutorial 1.8.0.pfd aparece ese codigo.
from django.db import models
class Pregunta(models.Model):
# ... Aquí van los campos
def __str__(self): # __unicode__ en Python 2
return self.Pregunta
class Opcion(models.Model):
# ... Aquí van los campos
def __str__(self): # __unicode__ en Python 2
return self.Opcion
Pregunta y Opcion , no son atributos de la clase y al hacer uso de ellos aparece:
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from encuestas.models import Pregunta, Opcion
>>> Pregunta.objects.all()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/django/db/models/query.py", line 141, in __repr__
return repr(data)
File "/usr/local/lib/python3.4/dist-packages/django/db/models/base.py", line 496, in __repr__
u = six.text_type(self)
File "/home/antonio/django/misitio/encuestas/models.py", line 11, in __str__
return self.Pregunta
AttributeError: 'Pregunta' object has no attribute 'Pregunta'
Creo que el código correcto es:
class Pregunta(models.Model):
def __str__(self):
return self.texto_pregunta
class Opcion(models.Model):
def __str__(self):
return self.texto_opcion
La parte del capitulo 4, donde habla de "Cargadores de Plantillas", ahi manejan la variable TEMPLATE_DIRS, y estaba revisando la documentacion de Django 1.8, y ahi aparece que esa variable ya es obsoleta.
https://docs.djangoproject.com/en/1.8/ref/settings/#template-dirs
Y que ahora se usara DIRS, https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-TEMPLATES-DIRS.
Esto podria entrar para el libro original como para la traduccion (puede que este equivocado, ya que soy novato),
Saludos.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.