Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Taller Django!
Hoy se llevó a cabo un el primer taller sobre Django en Nicaragua, la cita se dió en SIMAS y estuve compartiendo con los asistentes sobre como hacer una pequeña aplicación de blog en este framework y la experiencia de SIMAS. … Continue reading → -
Taller Django!
Hoy se llevó a cabo un el primer taller sobre Django en Nicaragua, la cita se dió en SIMAS y estuve compartiendo con los asistentes sobre como hacer una pequeña aplicación de blog en este framework y la experiencia de SIMAS. Acá les dejo la presentación que utilicé: Django View more presentations from Adolfo Fitoria. Hay algunas fotos haciendo click acá -
Bleach, HTML sanitizer and auto-linker
Bleach, HTML sanitizer and auto-linker. HTML sanitisation is notoriously difficult to do correctly, but Bleach (a Python library) looks like an excellent effort. It uses the html5lib parsing library to deal with potentially malformed HTML, uses a whitelist rather than a blacklist and has a neat feature for auto-linking URLs that is aware of the DOM (so it won’t try to auto-link a URL that is already wrapped in a link element). It was written by the Mozilla team for addons.mozilla.org and support.mozilla.org so it should be production ready. -
Django Apps rock
There's been some chat on mailing lists and conferences about the reusability of apps and about how reusable apps suck. So here's in defence of plain old normal non-reusable Django apps. The ones that probably power most of your current awesome Django sites. They rock. Easy to write and build out a site with. Django apps deserve credit for being so rapid to develop and having a very small set of boilerplate and required code (just a models). So before people come up with schemes for making apps reusable, please remember, we've got a great solution for building apps now. Let's not ruin the speed and simplicity of Django app whilst in pursuit of improved reuse. -
Simple MySQL Backup @ Github
A while ago I wrote about a little script I created, for simple backups of MySQL databases and emailing the backups. I found some time to continue on the project and moved it to Github. You can find it as well as documentation there! Simple MySQL Backup @ Github -
Simple MySQL Backup @ Github
A while ago I wrote about a little script I created, for simple backups of MySQL databases and emailing the backups. I found some time to continue on the project and moved it to Github. You can find it as well as documentation there! Simple MySQL Backup @ Github -
Simple MySQL Backup @ Github
A while ago I wrote about a little script I created, for simple backups of MySQL databases and emailing the backups. I found some time to continue on the project and moved it to Github. You can find it as well as documentation there! Simple MySQL Backup @ Github -
Simple MySQL Backup @ Github
A while ago I wrote about a little script I created, for simple backups of MySQL databases and emailing the backups. I found some time to continue on the project and moved it to Github. You can find it as well as documentation there! Simple MySQL Backup @ Github -
When App Engine went wrong
About a month ago Clearwind launched a new site on App Engine. It's a pretty straightforward site for a great client we had. We'd been working on the site for many months a little bit here and there, building out new features as the client requested them. Within a few hours of starting work we had a base site running on App Engine as our test. So that site sat there, quite happily serving out those odd few requests as we added in new features. There was the occasional errors for things like data migrations and testing of new features as we went, but nothing major. And then in September, the site went live - and there was much rejoicing. And then it went down. I did an update (this is a push of the code to the server) and it came back up. And then it went down. And so on. It couldn't stay up for more than about 10 requests or so, sometimes more, sometimes less. I started tweeting, I was pretty upset. The site that had been working fine, just didn't seem to work well. We were getting errors similar to issue 772 and issue 1409. As … -
Cassandra and ElasticSearch backends for Django-nonrel in development
This is a quick update: Rob Vaterlaus has started working on a Cassandra backend and Alberto Paro is working on an ElasticSearch backend for Django-nonrel. The Cassandra backend is still experimental and lacks support for ListField (from djangotoolbox.fields), but overall it already looks very very interesting. This backend comes with experimental secondary indexes support for Cassandra and requires a recent Cassandra 0.7 build. Secondary indexes allow to efficiently query the DB by attributes other than the primary key which makes Cassandra more similar to App Engine and MongoDB than low-level key-value stores. This feature is disabled, by default, though. Currently, without secondary indexes all queries are filtered in memory. The repository contains the installation instructions, so head over and play with the code, if you're fearless. Keep in mind: it's not production ready and it depends on the latest bleeding-edge Cassandra code. Any help with the backend is highly appreciated. The ElasticSearch backend is also in alpha state. Not all unit tests pass, yet, and for now it only supports a simple subset of ElasticSearch. Basically, you can use string operations like __contains, __istartswith, __regex and you can compare integers via __gt, __lt, etc. and you can order results. Currently, … -
Postgres 9 Streaming Replication and Django-Balancer
Over the past couple of weeks I've had the opportunity to dig in to Postgres 9's streaming replication. What I found was a relatively easy way to configure a system for basic replication with very impressive speed. Postgres's streaming replication is an enhancement to the log-shipping warm standby that was available in previous versions. Instead of replaying write-ahead log (WAL) files as they become available on the slave's filesystem, the slave nodes connect directly to the master and stream the log as it generated. This results in extremely fast replication, typically under a second. It can't match the cascading features of Slony, but if you're looking for a simple structure with a master database feeding one or more read-only slaves then Postgres 9 is a great choice. Here's how I got everything working on Ubuntu 10.04. UPDATE: I've changed the NFS details below to squash the user and group IDs and set the anonymous access user and group to the slave server's user and group IDs. This resolves issues where the postgres use has a different ID on the slave server than the master server, so files received from master are owned by the wrong user. Postgres 9 Postgres 9 … -
OCLUG Web Site to Become a Wiki
The Ottawa Canada Linux Users Group board of directors has decided to retire their Django meeting announcement web site and replace it with a plain wiki. But, it's been a great run for close to 4 years: 69 meetings posted, always up-to-date 65 speakers 34 local Linux jobs posted hundreds of members' blog posts aggregated zero maintenance time (removal of old meetings & jobs is automatic) zero reported defects zero down time -
Keeping your logging compatible with Sentry
Something I've noticed while digging around in various libraries, is the inconsistent use of logging. This creates some problems with Sentry, and in the end gives us some very ugly exception logging. Let's take a simple example (we're going to use Celery for this one): if task.eta: try: ... -
Keeping your logging compatible with Sentry
Something I've noticed while digging around in various libraries, is the inconsistent use of logging. This creates some problems with Sentry, and in the end gives us some very ugly exception logging. Let's take a simple example (we're going to use Celery for this one): if task.eta: try: ... -
Peter Norvig on programming languages
Peter Norvig: [Programming] language choice is not as important as all the other choices: if you have the right overall architecture, the right team of programmers, the right development process that allows for rapid development with continuous improvement, then many languages will work for you; if you don’t have those things you’re in trouble regardless of your language choice. -
Capturing images from a webcam in Django with jpegcam
Django integration of jpegcam widget that allow users to save images from a computer webcam. -
Django template filter para obtener thumbnails de youtube.
Acá les dejo un Django template filter para obtener el thumbnail de un video de youtube a partir de su url, ejemplo de uso: <img src="{{video.url|youthumbnail: 's'}}"/> Tiene dos parámetros de tamaño ‘s’ para un thumbnail pequeño y ‘l’ para … Continue reading → -
Django template filter para obtener thumbnails de youtube.
Acá les dejo un Django template filter para obtener el thumbnail de un video de youtube a partir de su url, ejemplo de uso: <img src="{{video.url|youthumbnail: 's'}}"/> Tiene dos parámetros de tamaño 's' para un thumbnail pequeño y 'l' para un thumbnail grande. Ver en DjangoSnippets -
Local Django development with Nginx
When doing local Django development with runserver you end up doing some changes, then refreshing in Firefox/Chrome/Safari again and again. Doing this means that all your static resources are probably served via Django. Presumably via django.views.static.serve, right? What's wrong with that? Not much, but we can do better. So, you serve it via Nginx and let Nginx take care of all static resources. You'll still use Django's own runserver so no need for mod_wsgi, gunicorn or uWSGI. This requires that you have Nginx installed and running on your local development environment. First you need to decide on a fake domain name. For example mylittlepony. Edit your /etc/hosts file by adding this line: 127.0.1.1 mylittlepony [410 more words] -
Local Django development with Nginx
When doing local Django development with runserver you end up doing some changes, then refreshing in Firefox/Chrome/Safari again and again. Doing this means that all your static resources are probably served via Django. Presumably via django.views.static.serve, right? What's wrong with that? Not much, but we can do better. So, you serve it via Nginx and let Nginx take care of all static resources. You'll still use Django's own runserver so no need for mod_wsgi, gunicorn or uWSGI. This requires that you have Nginx installed and running on your local development environment. First you need to decide on a fake domain name. For example mylittlepony. Edit your /etc/hosts file by adding this line: 127.0.1.1 mylittlepony [410 more words] -
Local Django development with Nginx
When doing local Django development with runserver you end up doing some changes, then refreshing in Firefox/Chrome/Safari again and again. Doing this means that all your static resources are probably served via Django. Presumably via django.views.static.serve, right? What's wrong with that? Not much, but we can do better. So, you serve it via Nginx and let Nginx take care of all static resources. You'll still use Django's own runserver so no need for mod_wsgi, gunicorn or uWSGI. This requires that you have Nginx installed and running on your local development environment. First you need to decide on a fake domain name. For example mylittlepony. Edit your /etc/hosts file by adding this line: 127.0.1.1 mylittlepony [410 more words] -
Local Django development with Nginx
When doing local Django development with runserver you end up doing some changes, then refreshing in Firefox/Chrome/Safari again and again. Doing this means that all your static resources are probably served via Django. Presumably via django.views.static.serve, right? What's wrong with that? Not much, but we can do better. So, you serve it via Nginx and let Nginx take care of all static resources. You'll still use Django's own runserver so no need for mod_wsgi, gunicorn or uWSGI. This requires that you have Nginx installed and running on your local development environment. First you need to decide on a fake domain name. For example mylittlepony. Edit your /etc/hosts file by adding this line: 127.0.1.1 mylittlepony [410 more words] -
Django Patterns: Model Inheritance
This post discusses the two flavors of model inheritance supported by Django, some of their use-cases as well as some potential gotchas. -
Django Patterns: Model Inheritance
This post discusses the two flavors of model inheritance supported by Django, some of their use-cases as well as some potential gotchas. Overview When the queryset refactor landed a couple years ago, Django's ORM grew support for model inheritance. Model inheritance comes in two flavors, abstract and ... not. What are the important differences in how Django handles these two types of inheritance? Multi-table inheritance (not abstract) Directly extending a model results in two tables where the shared fields are stored in one table (the parent model's table) and the fields unique to the child model are stored on the child model's table. The child model contains a foreign key to the parent model and whenever queried automatically includes the joins. class Media(models.Model): title = models.CharField(max_length=255) pub_date = models.DateTimeField() class Photo(Media): # note that Photo extends Media image = models.ImageField(upload_to='photos') class Video(Media): video = models.FileField(upload_to='videos') class VideoWithThumbnail(Video, Photo): """ Querying this object will result in 3 inner joins on filters/gets Saving/deleting will require at least 4 queries, but in my testing saving actually required 10 queries and deleting 13! """ pass Because of the way these items are stored in the database, it is possible to query against all media … -
Django Patterns: Model Inheritance
This post discusses the two flavors of model inheritance supported by Django, some of their use-cases as well as some potential gotchas. Overview When the queryset refactor landed a couple years ago, Django's ORM grew support for model inheritance. Model inheritance comes in two flavors, abstract and ... not. What are the important differences in how Django handles these two types of inheritance? Multi-table inheritance (not abstract) Directly extending a model results in two tables where the shared fields are stored in one table (the parent model's table) and the fields unique to the child model are stored on the child model's table. The child model contains a foreign key to the parent model and whenever queried automatically includes the joins. class Media(models.Model): title = models.CharField(max_length=255) pub_date = models.DateTimeField() class Photo(Media): # note that Photo extends Media image = models.ImageField(upload_to='photos') class Video(Media): video = models.FileField(upload_to='videos') class VideoWithThumbnail(Video, Photo): """ Querying this object will result in 3 inner joins on filters/gets Saving/deleting will require at least 4 queries, but in my testing saving actually required 10 queries and deleting 13! """ pass Because of the way these items are stored in the database, it is possible to query against all media …