Skip to content

Instantly share code, notes, and snippets.

#models.py de ejemplo resumido para el blog
class Noticia(models.Model):
'''Modelo simple de noticia'''
titulo = models.CharField(max_length=100)
cuerpo = models.TextField()
fecha = models.DatetimeField()
imagen = models.ImageField(upload_to="heaven")
#models.py de ejemplo resumido para el blog
class Noticia(models.Model):
'''Modelo simple de noticia'''
titulo = models.CharField(max_length=100)
cuerpo = models.TextField()
*.log
*.pot
*.mo
*.pyc
*.swp
*.swo
files/uploads/
local_settings.py
#acortado por conveniencia
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'files/media')
STATIC_ROOT = os.path.join(PROJECT_DIR, 'files/static')
TEMPLATE_DIRS = (
os.path.join(PROJECT_DIR, 'templates'),
)
@fitoria
fitoria / settings_local.py
Created November 20, 2011 23:04
settings_local.py
import os
PROJECT_DIR = os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
@fitoria
fitoria / Radios de Nicaragua
Created November 6, 2011 16:07
Medios de comunicación online #votonica
Cualquiera abre con VLC http://www.videolan.org/vlc/
Radio la Primerísima 680am 91.7 fm
http://www.rlp.com.ni/static/envivo/envivo.ram (real player)
http://www.rlp.com.ni/static/envivo/envivo.m3u (winamp)
http://www.rlp.com.ni/static/envivo/envivo.asx (windows media)
La Nueva Radio Ya.
http://nuevaya.com.ni/ya.m3u
http://nuevaya.com.ni/ya.pls
cantidad_actores = Familia.objects.filter(municipio__departamento__id = id).count() + \
Cooperativa.objects.filter(municipio__departamento__id = id).count() + \
Centrales.objects.filter(municipio__departamento__id = id).count()+ \
AsistenciaTecnica.objects.filter(municipio__departamento__id = id).count()
@fitoria
fitoria / gist:1165025
Created August 23, 2011 12:54 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: Python developer at a start up in Chile.
Favorite Python project: Django or Sugar.
Favorite Conference: PyCon
Python Experience Level: Medium (4 years)
@fitoria
fitoria / installtigger.sh
Created June 30, 2011 22:10
Install tigger with rvm at your home
#!/bin/bash
export TIGGER_HOME=$HOME/.tigger/bin
echo "bajando y descomprimiendo tigger"
curl http://www.tiggerlovesdevs.com/tigger.tar.bz2 | tar -jxv
cd tigger
echo "reparando makefile"
sed "s@/usr/bin@$TIGGER_HOME@g" makefile > makefile.temp
cat makefile.temp > makefile
rm makefile.temp
echo "creando carpeta destino"
@fitoria
fitoria / template.html
Created May 11, 2011 16:32
Django magic embed sample
{% load magicembed %}
{{ video|magicembed:"640x480" }} => esto carga un video con la dimensiones 640x480
<img src="{{ video|magicthumbnail }}" /> Esto carga el thumbnail del video.