Rambling about Django, Python, Ansible and sometimes PHP and Wordpress. I enjoy talking about all technologies, and offer help when I can.
Wednesday, March 31, 2010
Saturday, March 20, 2010
Saturday, March 13, 2010
Django Model Values as Dict
This is pretty easy to do but I always forget
obj_dict = MyModel.Objects.filter(id__gt=0).values()And you can also add MyModel.objects.filter(id__gt=0).values_list('COLUMN',flat=True)
Friday, February 26, 2010
Hylafax 6.0 Debian Lenny T38modem 1.2.0 Asterisk 1.6
After fighting with t38modem for a week I finally found versions of opal and ptlib that work with t38modem 1.2 for sending faxes (have not tested receiving yet).
ptlib-2.6.6
opal-3.6.7
t38modem-1.2.0
I am using most of the other instructions from this how to below.
Hylafax 6.0 Debian (or Ubuntu) T38modem 1.0 Asterisk 1.6
Thursday, February 25, 2010
Debian Backports copy paste
echo 'deb http://www.backports.org/debian lenny-backports main contrib non-free' >> /etc/apt/sources.list apt-get update && apt-get install debian-backports-keyring --force-yes && apt-get updateinstructions [Debian Backports]: "deb http://www.backports.org/debian lenny-backports main contrib non-free"
Monday, February 15, 2010
Django | User authentication in Django | Django documentation
Django auth doesn't have all the urls listed anywhere so here they are:
(r'^accounts/login/$', 'django.contrib.auth.views.login'),
(r'^accounts/logout/$', 'django.contrib.auth.views.logout'),
(r'^accounts/password_change/$', 'django.contrib.auth.views.password_change'),
(r'^accounts/password_change_done/$', 'django.contrib.auth.views.password_change_done'),
(r'^accounts/password_reset/$', 'django.contrib.auth.views.password_reset'),
(r'^accounts/accounts/password_reset/done/$', 'django.contrib.auth.views.password_reset_done'),
(r'^accounts/reset/(?P[0-9A-Za-z]+)-(?P.+)/$', 'django.contrib.auth.views.password_reset_confirm'),
(r'^accounts/reset/done/$', 'django.contrib.auth.views.password_reset_complete'),
Django | User authentication in Django | Django documentation
Friday, January 29, 2010
Django | Generic views | Django documentation
Took me forever to figure this out with generi views, but the I just don't read well. Here is an example template:
<p class=\"paginator\">
<span class=\"step-links\">
{% if page_obj.has_previous %}
<a href=\"?page={{ page_obj.previous_page_number }}\"><</a>
{% endif %}
<span class=\"current\">
Page <span class=\"this-page\">{{ page }}</span> of {{ paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href=\"?page={{ page_obj.next_page_number }}\">></a>
{% endif %}
</span>
</p>
"If the results are paginated, the context will contain these extra variables: paginator: An instance of django.core.paginator.Paginator. page_obj: An instance of django.core.paginator.Page." Django Generic views object_list:
Thursday, January 28, 2010
Dynamic Inlines Built into Django Admin in 1.2
So I was talking at a Django round table last night and talking about the fixes I did to the dynamic inlines for the admin. And someone mentioned that a)jquery is now included in Django 1.2 and b) dynmaic inlines are built in as well.
/django/trunk/django/contrib/admin/media/js/inlines.js
Sunday, January 24, 2010
Django CMS Photologue plugin with Gallerific
I just made a fork of the django cms photologue plugin with gallerific jquery gallery
Django CMS Photologue plugin with Gallerific
Friday, January 22, 2010
Django snippets: jQuery Double Click Edit ManyToMany in Admin
Take a look at my code on django snippets. Just drop this into your templates/admin/change_form.html and any select for a foreign key or many to many will allow a double click to pop up and edit
Django snippets: jQuery Double Click Edit ManyToMany in Admin
Django snippets: jQuery Double Click Edit ManyToMany in Admin
Thursday, January 14, 2010
Fabric, Django, Git, Apache, mod_wsgi, virtualenv and pip deployment | Morethanseven
Another good example of django deployments with fabric
Saturday, January 09, 2010
Friday, January 08, 2010
How the Washington Post creates and deploys sites fast with virtualenv and Django
Great tutorial for creating and easy process to deploy Django projects.
washingtontimes's django-repositories at master - GitHub
Django App to battle trac ... finally, now if some one can incorporate time tracking and other PM into it that would be sweet, maybe I'll do that in my abundance of spare time.
pyDanny: Picking a Django powered CMS
I picked django-cms but now im second guessing myself :(
Thursday, January 07, 2010
Quick tip: how to convert tables to InnoDB
apt-get install maatkit
mk-find --engine MyISAM --exec "ALTER TABLE %D.%N ENGINE=INNODB" --print
Wednesday, January 06, 2010
Subscribe to:
Posts (Atom)