Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Google Moderator for PyCon ORM Panel
I'm going to be moderating a panel this year at PyCon between 5 of the Python ORMs(Django, SQLAlchemy, SQLObject, Google App Engine, and web2py). To make my job easier, and to make sure the most interesting questions are asked I've setup a Google Moderator page for the panel here. Go ahead and submit your questions, and moderate others to try to ensure we get the best questions possible, even if you can't make it to PyCon(there will be a recording made I believe). I'll be adding my own questions shortly to make sure they are as interesting as I think they are.Also, if you aren't already, do try to make it out to PyCon, there's still time and the talks look to be really exceptional. -
New Django Site: Brite Revolution
Josh Kersey announced tonight a new site built by the folks at Cabedge and it appears to be done in Django. I love seeing fresh ideas, especially concerning digital media. I have long thought the music industry just doesn't get the last 5 to 10 years of technological innovation and public mood shift. Now, I am not industry expert, but I don't think it takes a wizard to see that Apple has single handedly been disruptive in this area. Couple that with the ability for individuals to produce very high quality recordings in their basement cheaply and then leverage social media and the Internet to distribute their music. The game has changed. Brite Revolution is the first thing I have seen that is formerly recognizing that and building a business model around it. From their About page: Artists need to be able to make music again without going into debt or losing ownership of their music. Fans need more music from their favorite artists on a regular basis and feel like a part of an event again. Philanthropic organizations need more opportunities to connect directly with people to make a difference in the world. To top it all off, they … -
New Django Site: Brite Revolution
Josh Kersey announced tonight a new site built by the folks at Cabedge and it appears to be done in Django. I love seeing fresh ideas, especially concerning digital media. I have long thought the music industry just doesn't get the last 5 to 10 years of technological innovation and public mood shift. Now, I am not industry expert, but I don't think it takes a wizard to see that Apple has single handedly been disruptive in this area. Couple that with the ability for individuals to produce very high quality recordings in their basement cheaply and then leverage social media and the Internet to distribute their music. The game has changed. Brite Revolution is the first thing I have seen that is formerly recognizing that and building a business model around it. From their About page: Artists need to be able to make music again without going into debt or losing ownership of their music. Fans need more music from their favorite artists on a regular basis and feel like a part of an event again. Philanthropic organizations need more opportunities to connect directly with people to make a difference in the world. To top it all off, they … -
Join us a djangopeople.net!
Hey, I just stumbled upon a nice “social” site called djangopeople.net. It’s a site listing people who use Django, along with some interesting contact information. As the site says (when i signed up): Django People lists 4116 Django developers from around the world, in 110 different countries. The aim of the site is to help Django developers find like-minded souls near them, and hopefully kick-start some local meet-ups and user groups. Come us and join the party! -
The low-down on Django-Techblog
I figured I would write-up some of the features of Django Techblog, the blogging application I wrote to power this site. It does most of what you would expect from a blogging app, but there are a few features that it does differently. The main difference is extended markup, but there are a couple of other features that worthy of note: Multi-blog capable. I want to blog on a variety of subjects, but because some of the things I post about (namely the geeky stuff) are only of interest to a select few, I risk turning away visitors who aren't interested in those techy posts. Categories and tags are one solution to this, but I prefer to have a number of blogs under an umbrella blog, each with its own posts, templates and tags. In Techblog, there is also a concept of a channel which appears exactly like a blog from the front-end, but aggregates posts & tags from one or more blogs. In this site, the home-page at / is actually a channel consisting of /blog/tech/ and /blog/personal.Microblogging. Techblog has support for Twitter and potentially other microblogging services could be added. You add your twitter account details, which Techblog … -
The low-down on Django-Techblog
I figured I would write-up some of the features of Django Techblog, the blogging application I wrote to power this site. It does most of what you would expect from a blogging app, but there are a few features that it does differently. The main difference is extended markup, but there are a couple of other features that worthy of note: Multi-blog capable. I want to blog on a variety of subjects, but because some of the things I post about (namely the geeky stuff) are only of interest to a select few, I risk turning away visitors who aren't interested in those techy posts. Categories and tags are one solution to this, but I prefer to have a number of blogs under an umbrella blog, each with its own posts, templates and tags. In Techblog, there is also a concept of a channel which appears exactly like a blog from the front-end, but aggregates posts & tags from one or more blogs. In this site, the home-page at / is actually a channel consisting of /blog/tech/ and /blog/personal.Microblogging. Techblog has support for Twitter and potentially other microblogging services could be added. You add your twitter account details, which Techblog … -
Werkzeug and reverse urls
Werkzeug and reverse urls -
Django Applications at Work
Today someone at my work just released a simple Django app, the second one now running at my company. Here are the two Django apps running so far: Server scanner This is the first Django application that we use. It started out as a script that would scan all the computers on our network and determine what version of our software they were running by inspecting a special file in one of the publicly available SMB shares. The script took about half an hour to run and generated static html that was then served up by Apache. This became cumbersome for a number of reasons. For one, it took about an hour to scan the entire network. There was no persistence whatsoever so my script had no memory of which servers had our software installed on it. These servers are quick to check. The ones that are slow to check are the ones that are actually no longer on the network, or do not have the publicly available share that we are expecting. When the project manager emailed me one day and said "the servers on this page are often out of date" I sprung in to action and converted … -
Painless Amazon EC2 Backup
The past year on Amazon EC2 has taught me many things but first and foremost is back up consistently. I’ll say it again, back up consistently! Amazon even makes the backup almost painless, almost… Amazon has EC2 (the compute cloud) and S3 (the data repository). Out of the box you can back up from [...] -
Getting client OS in Django
Some times it can be useful to serve our site content with little differences depending on the visitor operating system. I really think it's a bad idea changing the content or doing some big changes, depending on it, but this post can be useful for it as well.So, while most time just some Javascript is used to customize user experience based on its operating system, few times it'll also be useful to do it in the server side.For those cases, here you've a simple context processor that will make available a template variable named "platform" which content can be "Linux", "Mac" or "Windows".import redef user_agent(request): ''' Context processor for Django that provides operating system information base on HTTP user agent. A user agent looks like (line break added): "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) \ Gecko/2009020409 Iceweasel/3.0.6 (Debian-3.0.6-1)" ''' print 'user_agent' # Mozilla/5.0 regex = '(?P<application_name>\w+)/(?P<application_version>[\d\.]+)' regex += ' \(' # X11 regex += '(?P<compatibility_flag>\w+)' regex += '; ' # U regex += '(?P<version_token>[\w .]+)' regex += '; ' # Linux i686 regex += '(?P<platform_token>[\w .]+)' # anything else regex += '; .*' user_agent = request.META['HTTP_USER_AGENT'] result = re.match(regex, user_agent) if result: result_dict = result.groupdict() full_platform = result_dict['platform_token'] platform_values … -
Updating CouchDB Views In Django
CouchDB views are a bit like stored procedures in a traditional database system. As with stored procedures it’s difficult to keep them in sync with your code, and to keep them in your version control system. In this article I’ll show you how you can use a django management command to update your views from [...] -
New CSS
I never thought that my personal blog would be useful to anyone except myself. I've not put a lot of effort into attracting traffic, but it's been trickling my way. I never really finished the templates and CSS for programmerq.net, so I spent a little time here and there over the past few days and added some CSS, and updated the templates to make the blog experience a bit nicer. I haven't added the template tags to turn on the calendar view in the sidebar, but I don't know how useful it would be anyway. I really enjoy the Django templating language. I was able to add the gravitar functionality to the comment system without modifying the source of the blog app that I use. All I did was create an app that had the template tag snippet, and a template for rendering. To get the gravitar to show up, I just copied the default comment rendering template out of the blog app, and told it to load the template tag and render in the appropriate place. As always, every site is under construction, and this site isn't an exception. I'm willing to take suggestions for improvement on my blog, … -
My Django-Compress Tasks
I am thoroughly impressed by django-compress as mentioned in yesterday's post. There are number of things that I'll be looking to add over the next couple of days that hopefully will make it even more useful for more than just me. I'll be committing these to my fork and submitting pull requests upstream to hopefully have them committing into the main repository. For output files, create the intermediary folders if they don't exist. Add a gzip option flag to the command to create gzip versions of the output files. Add a new css filter for replacing url() property contents with prefixes defined in configuration (allowing for the serving of content locally during development, and then off of CDN servers when deployed). Add a new version strategy, that will default to a prefix folder using today's timestamp (YYYYMMDD). Also allow for an optional parameter to the command line to override this default prefix. Add another "extra_context" variable called ABSOLUTE_URL to enable an override of both the PREFIX variable I included yesterday as well as the default MEDIA_URL. I need this so as to be able to put things like Google hosted libraries like jQuery, but also to have a quick and … -
My Django-Compress Tasks
I am thoroughly impressed by django-compress as mentioned in yesterday's post. There are number of things that I'll be looking to add over the next couple of days that hopefully will make it even more useful for more than just me. I'll be committing these to my fork and submitting pull requests upstream to hopefully have them committing into the main repository. For output files, create the intermediary folders if they don't exist. Add a gzip option flag to the command to create gzip versions of the output files. Add a new css filter for replacing url() property contents with prefixes defined in configuration (allowing for the serving of content locally during development, and then off of CDN servers when deployed). Add a new version strategy, that will default to a prefix folder using today's timestamp (YYYYMMDD). Also allow for an optional parameter to the command line to override this default prefix. Add another "extra_context" variable called ABSOLUTE_URL to enable an override of both the PREFIX variable I included yesterday as well as the default MEDIA_URL. I need this so as to be able to put things like Google hosted libraries like jQuery, but also to have a quick and … -
Convenciones de proyecto en Django
Django ofrece una flexibilidad muy grande a la hora de configurar nuestros proyectos permitiéndonos organizarlos con estructuras muy diversas. Esta flexibilidad permite que podamos adaptar Django a necesidades concretas pero por otro lado hace que mucha gente se pregunte cuál es la manera correcta de organizar la estructura de sus proyectos. Convenciones en Django, creado por Eric Holscher, pretende ser un punto de referencia sobre las mejores prácticas y convenciones en Django. Esto es una traducción al español de las convenciones sobre proyectos. -
Slughifi: slugs a prueba de caracteres internacionales
Slughifi es un código que mejora las características de la función slugify de django.template.defaultfilters. Soporta muchos más caracteres internacionales con todo tipo de acentuación. Mientras que slugify elimina todos estos caracteres al generar el slug, slughifi los reemplaza por caracteres no acentuados haciendo honor a su nombre al proporcionar slugs altamente fieles a la cadena sobre la que se aplica. Fue presentado hace bastante tiempo en este hilo de la lista de correo django-users y dí con él por casualidad. Desde entonces no he dejado de utilizarlo en mis proyectos. Slughifi parece no estar disponible en la página original en la que se encontraba. Sin embargo sí lo está en el trac de django-fr y también lo podéis bajar directamente desde aquí. -
django-multilingual syntax poll
Those days there is some activity in the django model translation area, specially for the two new projects that joined django-multilingual and transdb to achieve this: django-transmeta and django-modeltranslation.While there are some intentional differences among some projects (for example django-modeltranslation is the only one that can translate models without editing them), it would be great to merge all (or most) existing projects, and join the efforts to get our best application (and hopefully it'll worth to be included in Django itself).So, with the merge of those applications in mind, we're planning to create a branch on django-multilingual that will have the very best of each existing application, and any other cool idea.So if you have good Python/Django skills, and want to add some open source work in your CV... ;) join us now!Or if you are a potential user of this application, or you just think that your opinion is worth to be shared, please fill the MODEL SYNTAX POLL, or mail us with your ideas.Here there are simple sample for each option on the poll:class Translationclass MyModel(model.Model): my_field = CharField() class Translation(multilingual.Translation): my_i18n_field = CharField()custom fieldsclass MyModel(model.Model): my_field = CharField() my_i18n_field = TransCharField()separate modelclass MyModel(model.Model): my_field = CharField() my_i18n_field … -
The tools of choice
Well, we have decided which tools we are going to use for our semester project. The winners are: Eclipse with the following plugins: PyDev (For python Development) Subclipse (For SVN connectivity) And for our development framework (after a period of uncertainty): Django was the clear winner. PostgreSQL will be our DBMS. Eventually we’ll configure the Apache HTTP Server to work with mod_wsgi for Apache-Python interpretation. Shortly I’ll post on how to get all those working nice together. Until then. -
Scratching Django-Compact for Django-Compress
Last week I talked about a project I had started to build called, django-compact, whose goal it was to provide a build process for all the various CSS and Javascript files in a given project. I was quickly notified in via Will Larson on Twitter that I should checkout django-compress. I did. To say that I was following the same approach would be an understatement. Furthermore, this project was much further along than I was. I spent the better part of this morning getting a subsection of my project wired up to use it and am well satisfied. There was a small additional feature I wanted to add, so I forked the project and made the additions. I feel like the changes are non-breaking and generally useful and therefore hope to get them pushed upstream. The feature in question involves being able to have multiple MEDIA_URLs for different outputs. I call them PREFIXes. My approach was to patch the media_url function in compress.utils to accept defaulted argument called prefix. If prefix exists in a non-empty state, then it concatenates itself with the url argument, otherwise it concatenates with the settings.MEDIA_URL setting. Upstream in render_common I look for a dictionary key … -
Scratching Django-Compact for Django-Compress
Last week I talked about a project I had started to build called, django-compact, whose goal it was to provide a build process for all the various CSS and Javascript files in a given project. I was quickly notified in via Will Larson on Twitter that I should checkout django-compress. I did. To say that I was following the same approach would be an understatement. Furthermore, this project was much further along than I was. I spent the better part of this morning getting a subsection of my project wired up to use it and am well satisfied. There was a small additional feature I wanted to add, so I forked the project and made the additions. I feel like the changes are non-breaking and generally useful and therefore hope to get them pushed upstream. The feature in question involves being able to have multiple MEDIA_URLs for different outputs. I call them PREFIXes. My approach was to patch the media_url function in compress.utils to accept defaulted argument called prefix. If prefix exists in a non-empty state, then it concatenates itself with the url argument, otherwise it concatenates with the settings.MEDIA_URL setting. Upstream in render_common I look for a dictionary key … -
Adding a simple WYSIWYM Markdown editor to your models
I'm a Markdown fan. Period. Since I first discovered it some years ago, I've been using it for storing all my "output-to-HTML" texts. Blango, the blog engine I wrote for this site, uses Markdown for post contents. As I've said, I really like Markdown, but typing (and sometimes escaping) all those *[]() gets boring from time to time. I've been looking for something like a WYSIWYG editor for some time, but none of the available choices seemed good enough for me. However, I recently stumbled upon WMD. So, what's WMD and why should I care? In the author's own words: So WMD is something new: a Wysiwym Markdown editor. Wysiwym stands for What You See Is What You Mean. WMD produces clean semantic HTML, leaving presentation details like fonts and colors up to style sheets. But you're not left in the dark about cosmetics; as you type, WMD's live preview shows you exactly what your text will look like after the current styles have been applied. Markdown is a simple markup language that's as easy to read and write as plain-text email. WMD uses Markdown as an input format, converting it into HTML behind the scenes. You can also mix … -
Ottawa Python Authors Group Meeting
The Ottawa Python Authors Group is having a meeting tomorrow (Monday) and Michael Soulier will be presenting talks on concurrency in Django, and an Introduction to Git. It has been a while since the last meeting and this promises to be a good one. -
Templayer 1.5.1 Released
This release fixes a number of bugs in the 1.5 release: Templayer Home Page Download Tarball -
Three New Debian Django Packages
Recently my employer, credativ UK1 have been kind enough to allow me to spend some time working on Debian packaging from some Django apps we've started using internally. Chris Lamb was kind enough to sponsor the upload of these packages. Django developers, this means that if you are running a Debian GNU/Linux machine2, you can type: apt-get install python-django-<app name> and you will have it installed for all users on the system. You won't need to mess around with any Python packaging systems, or modify your environment to be able to use them. So, what are the packages and why are we using them? django-tinymce django-tinymce is a Django app providing integration with TinyMCE, a pure JavaScript rich text editor. It provides a widget that can be used within forms, and can also easily be used within views. It integrates with django-filebrowser, which I will mention below. django-cms integrates with django-tinymce to provide a rich text editor for pages within it. As our website content will have to be maintained by people who may have little or no experience with HTML (or Markdown or anything else that isn't Word), this is obviously desirable. django-filebrowser django-filebrowser is a Django app that … -
Añadir encoding UTF-8 a nuestros archivos .py
Esto es una pequeña ayuda para aquellos que empiezan con Python/Django. A menudo utilizamos variables o comentarios en nuestro código python que tienen caracteres acentuados u otros que no son ASCII. Estos caracteres causan errores de sintaxis como el siguiente: SyntaxError: Non-ASCII character '\xc3' in file /proyecto/app1/models.py on line 5, but no encoding declared; Para solucionarlo nos basta con definir el encoding a utilizar insertando la siguiente línea de texto al comienzo de nuestro archivo .py: # -*- encoding: utf-8 -*- Con esto estaremos especificando que nuestro archivo .py está codificado en UTF-8. La codificación UTF-8 bastará en la mayoría de los casos pero también puedes utilizar otras codificaciones. Aquí tienes más información respecto a este tema.