Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Training
I’m pleased to announce that I’ll be teaching a week-long introductory Django course in Kansas City, September 21st - 25th. Teaching’s folks how to use Django is one of my favorite things to do – in fact, I’m in San Jose right now gearing up for a tutorial at OSCON tomorrow – so it seemed a natural thing to make it an aspect of my business. So, if you need to learn Django, why not come spend a week in Kansas City with me? -
Efficiently Test Emails in Django
Testing emails can be an inefficient process. The email needs to leave your machine, arrive at the SMTP server, get forwarded to your test mail server and then downloaded by your email client. Do you want those 30 seconds of your life back? Using an SMTP sink, you can receive the email to your screen instantly. Setup is easy. ♦ Download smtp_sink.py ♦ Put it in whatever your project directory is. You will want to create a "inbox" directory. Besides outputting to the screen, this will automatically copy the email to the inbox directory in case you need to reference it later ♦ Change your settings.py to have: EMAIL_HOST = '127.0.0.1', EMAIL_HOST_USER = '', EMAIL_PORT = 25 If you have a script that loads your sandbox environment automatically, you will want to load smtp_sink.py automatically. It will send a test signal to see if it's already running and not start twice. If you run automated test scripts, the output of the "inbox" can be tested. -
Templatetag {% if %} con más comparaciones
Este snippet reemplaza la funcionalidad del templatetag {% if %} permitiendo realizar comparaciones con operadores >, <, >=, <=, != además de las comparaciones que permite hacer {% if %} por defecto ... -
Django, Push Notifications, and Prowl
One issue that I have had with this blog for a while has been the lack of notifications when a new, legitimate comment is posted under one of my articles. I don’t get many comments, but when I do, I would like to be able to respond right away. I don’t like email notifications, so when Prowl was announced this week, I was excited about the possibility of sending push notifications to my iPhone whenever a new comment was posted. It turned out to be much easier than I anticipated, thanks to Jacob Burch’s Prowlpy module and Django’s signals framework. To setup push notifications for anything, you need to get these done first: Register for an account at the Prowl site, then go to iTunes Store and buy Prowl for your iPhone/iPod Touch After setting up your device, login to your account at the Prowl web site, click on Settings, and generate an API key Download and install Prowlpy and httplib2. I opted for simply putting Prowlpy somewhere on my PYTHONPATH, and installing httplib2 through aptitude: sudo apt-get install python-httplib2 Now that you are ready, simply create a signals.py file under whichever Django application you would like to use to … -
Django Training
I'm pleased to announce that this September, Revolution Systems will be offering a four-day Django training course here in Kansas City, taught by Jacob Kaplan-Moss. Jacob has taught a number of similar courses privately in the past, but this is the first time we're opening this up to the public. If you've been wanting to really learn Django, this is a great chance. The class is intended for relative beginners to Django, but by the time you leave you'll know enough to create some pretty awesome websites. The class will be Monday, September 21 - Friday, September 25, 2009 in Kansas City, MO. For more, or to sign up, check out the full details. -
Pyrohose Logo Design
I spent last weekend finishing up a logo for a super secret project I can't go into yet at the client's request. I can share the logo in the meantime. When the client gives me the green-light I'll come back and update the post with a link to the project. -
Python Job Alert
My employer is looking for a new Python developer to work here in Oxford, UK. The company I work for runs 2degreesnetwork.com, which is collaboration service for sustainable business. Basically, it's a social networking type of site for businesses to collaborate on climate change and related issues. I'm not officially allowed to say this, but the closest analogy is ‘Facebook for Businesses’. This is the office. Ignore the man in the far corner, he is just a hobo that wandered in. The site is built with Django, so obviously Django experience would be a bonus, but experience with any MVC framework would be valuable. We're looking for someone who isn't necessarily a specialist and who doesn't mind getting to grips with new technology and dabbling in the front-end from time to time. You will be working in a very relaxed working environment with a diverse bunch of characters. The full job description is below, but all you really need to know is that you will be working with yours truly! If you are interested, Email your CV to james DOT tarin AT 2degreesnetwork DOT com. Would you like to do something genuinely useful with your Software Development skills (Python/Django)? 2degrees … -
Python Job Alert
My employer is looking for a new Python developer to work here in Oxford, UK. The company I work for runs 2degreesnetwork.com, which is collaboration service for sustainable business. Basically, it's a social networking type of site for businesses to collaborate on climate change and related issues. I'm not officially allowed to say this, but the closest analogy is ‘Facebook for Businesses’. This is the office. Ignore the man in the far corner, he is just a hobo that wandered in. The site is built with Django, so obviously Django experience would be a bonus, but experience with any MVC framework would be valuable. We're looking for someone who isn't necessarily a specialist and who doesn't mind getting to grips with new technology and dabbling in the front-end from time to time. You will be working in a very relaxed working environment with a diverse bunch of characters. The full job description is below, but all you really need to know is that you will be working with yours truly! If you are interested, Email your CV to james DOT tarin AT 2degreesnetwork DOT com. Would you like to do something genuinely useful with your Software Development skills (Python/Django)? 2degrees … -
Python Job Alert
My employer is looking for a new Python developer to work here in Oxford, UK. The company I work for runs 2degreesnetwork.com, which is collaboration service for sustainable business. Basically, it's a social networking type of site for businesses to collaborate on climate change and related issues. I'm not officially allowed to say this, but the closest analogy is ‘Facebook for Businesses’. This is the office. Ignore the man in the far corner, he is just a hobo that wandered in. The site is built with Django, so obviously Django experience would be a bonus, but experience with any MVC framework would be valuable. We're looking for someone who isn't necessarily a specialist and who doesn't mind getting to grips with new technology and dabbling in the front-end from time to time. You will be working in a very relaxed working environment with a diverse bunch of characters. The full job description is below, but all you really need to know is that you will be working with yours truly! If you are interested, Email your CV to james DOT tarin AT 2degreesnetwork DOT com. Would you like to do something genuinely useful with your Software Development skills (Python/Django)? 2degrees … -
DjangoCon 2009, Portland OR
DjangoCon 2009 has been officially announced! It will be in Portland, Oregon, my new hometown. I will be planning some after-parties at restaurants, local breweries and the like. -
Twenty questions about the GPL
foo.py is a Python library released under the GPLv3. bar.py is a library distributed commercially. If bar contains import foo, must bar.py be released under the GPL? Does the answer change if foo.py does not ship with bar.py, but nonetheless requires foo.py to function? Does the answer change if foo.py does not ship with bar.py and does not require its presence to function? libfoo.so is a C shared library released under the GPLv3. -
Viertes Treffen der Django-UserGroup Hamburg
Das vierte Treffen der Django-UserGroup Hamburg findet am Dienstag, den 04.08.2009 um 19:30 statt. Wie beim letzten Mal treffen wir uns wieder in den Räumen der CoreMedia AG in der Ludwig-Erhard-Straße 18 in 20459 Hamburg. Eine Anfahrtsbeschreibung gibt es auf der CoreMedia Webseite oder via Google Maps. Bitte am Eingang Ludwig-Erhard-Straße 18 bei CoreMedia AG klingeln, in den 3. Stock fahren und oben am Empfang nach der Django-UserGroup fragen. Da wir in den Räumlichkeiten einen Beamer zur Verfügung haben hat jeder Teilnehmer die Möglichkeit einen kurzen Vortrag (Format: Lightning Talks oder etwas länger) zu halten. Bereits fest stehen folgende Vorträge: Stefan Imhoff: Git Arne Brodowski: ReStructuredText Tim Adler: Garantiert gutes Webdesign Daniel Spilker: Django und Google App Engine Weitere Vorträge können gerne in den Kommentaren angekündigt werden oder auch erst spontan vor Ort. Eingeladen ist wie immer jeder der Interesse hat sich mit anderen Djangonauten auszutauschen. Eine Anmeldung ist nicht erforderlich. Für ein paar Getränke wird wieder gesorgt sein, es ist aber durchaus erlaubt/erwünscht sich selbst Getränke und/oder etwas zu Essen mitzubringen. Weitere Informationen über die UserGroup gibt es auf www.dughh.de. -
Django internals: authentication
Django’s session and authentication frameworks are designed to Just Work™, and can seem pretty magical. Like the rest of Django, though, these parts aren’t magic — just Python. So let’s take a look at the internals of sessions and authentication and see how the whole thing works. Our journey begins with the session middleware. You’ll see that the process_request method is pretty simple: it looks up the session engine setting, looks for a session key in the request’s cookies, and then sets request. -
Django powered AJAX Chat – Part 2
I’m sorry I left my last Django powered AJAX Chat – Part 1 post so abandoned, we have been dealing with an ever increasing amount of study stuff at the uni and I didn’t have much time to keep on writing about our chat application. I have been working hard to improve some of the functionality of the application, both on the Django side and the jQuery side. There are still many rough edges, but this time I’ve got some more along the lines of plug&play. So, just for those impatient ones who like to see to believe, this is a screenshot of it in action: Screenshot of the Django chat application using the jQuery Javascript library, you can appreciate the use of special formatting for users who are joining the room, normal formatting for user messages and... yes... smileys! Pretty neat, huh? There is a lot of ground to cover with this one, so maybe I’ll split this post in two… we will see. The Idea Have a pure Django + jQuery chat application working on our site. The users will be presented with a GUI like the one above, listing the messages in the chat room, and will … -
Knowing when to back off a project…
A couple of years ago I created the original code behind project Django Queue Service on a bet with myself at the O’Reilly Open Source Convention. A few months later I popped the whole thing up on Google Code hosting … Continue reading → -
The Bug Genie 2 SVN Integration on Windows with VisualSVN Server
In my local development environment at home I use The Bug Genie 2 for bugtracking. The tool is quiet cool, although the german translation is totally broken (I fixed it and send it to them, let's see what happens). It comes with a module called "svn_integration" for integrating SVN into the tracker to automatically have updated issues when the SVN comments contain special keywords. That's quiet cool, too, but unfortunatly does not work for me. I'm using Windows Vista Business x64 as os and for SVN the wonderful, free and easy VisualSVN Server. Next ugly thing on The Bug Genie is that there is no documentation for the modules. I found an entry in the forums how to use the integration in windows, but that did not work out of the box. But the code is already within the module, what is good. So open modules/svn_integration/post_commit.php from your buggenie installation directory and adjust this line with your path to the bugtracker installation dir: define('BUGS2_INCLUDE_PATH', 'D:\\xampp\\htdocs\\bugs\\'); Then create a batch file in the same directory called post-commit.bat. You can see the source below, copy it and adjust the following variables. I used the code from the forum post and adjusted it … -
The Bug Genie 2 SVN Integration on Windows with VisualSVN Server
In my local development environment at home I use The Bug Genie 2 for bugtracking. The tool is quiet cool, although the german translation is totally broken (I fixed it and send it to them, let's see what happens). It comes with a module called "svn_integration" for integrating SVN into the tracker to automatically have updated issues when the SVN comments contain special keywords. That's quiet cool, too, but unfortunatly does not work for me. I'm using Windows Vista Business x64 as os and for SVN the wonderful, free and easy VisualSVN Server. Next ugly thing on The Bug Genie is that there is no documentation for the modules. I found an entry in the forums how to use the integration in windows, but that did not work out of the box. But the code is already within the module, what is good. So open modules/svn_integration/post_commit.phpfrom your buggenie installation directory and adjust this line with your path to the bugtracker installation dir: define('BUGS2_INCLUDE_PATH', 'D:\\xampp\\htdocs\\bugs\\'); Then create a batch file in the same directory called post-commit.bat. You can see the source below, copy it and adjust the following variables. I used the code from the forum post and adjusted it a … -
The Bug Genie 2 SVN Integration on Windows with VisualSVN Server
In my local development environment at home I use The Bug Genie 2 for bugtracking. The tool is quiet cool, although the german translation is totally broken (I fixed it and send it to them, let's see what happens). It comes with a module called "svn_integration" for integrating SVN into the tracker to automatically have updated issues when the SVN comments contain special keywords. That's quiet cool, too, but unfortunatly does not work for me. I'm using Windows Vista Business x64 as os and for SVN the wonderful, free and easy VisualSVN Server. Next ugly thing on The Bug Genie is that there is no documentation for the modules. I found an entry in the forums how to use the integration in windows, but that did not work out of the box. But the code is already within the module, what is good. So open modules/svn_integration/post_commit.phpfrom your buggenie installation directory and adjust this line with your path to the bugtracker installation dir: define('BUGS2_INCLUDE_PATH', 'D:\\xampp\\htdocs\\bugs\\'); Then create a batch file in the same directory called post-commit.bat. You can see the source below, copy it and adjust the following variables. I used the code from the forum post and adjusted it a … -
The Bug Genie 2 SVN Integration on Windows with VisualSVN Server
In my local development environment at home I use The Bug Genie 2 for bugtracking. The tool is quiet cool, although the german translation is totally broken (I fixed it and send it to them, let's see what happens). It comes with a module called "svn_integration" for integrating SVN into the tracker to automatically have updated issues when the SVN comments contain special keywords. That's quiet cool, too, but unfortunatly does not work for me. I'm using Windows Vista Business x64 as os and for SVN the wonderful, free and easy VisualSVN Server. Next ugly thing on The Bug Genie is that there is no documentation for the modules. I found an entry in the forums how to use the integration in windows, but that did not work out of the box. But the code is already within the module, what is good. So open modules/svn_integration/post_commit.phpfrom your buggenie installation directory and adjust this line with your path to the bugtracker installation dir: define('BUGS2_INCLUDE_PATH', 'D:\\xampp\\htdocs\\bugs\\'); Then create a batch file in the same directory called post-commit.bat. You can see the source below, copy it and adjust the following variables. I used the code from the forum post and adjusted it a … -
Crear una imagen de nuestros modelos con django-command-extensions
Algo interesante que nos aporta django-command-extensions es poder crear una representación gráfica de nuestros modelos (o por decirlo de otro modo nuestro esquema de base de datos) con tan sólo un comando. Esto es posible gracias a GraphViz y el resultado es algo parecido a un diseño UML. Para poder utilizar este comando debemos tener instalado pygraphviz y por supuesto la aplicación django_extensions debe estar incluída en el setting INSTALLED_APPS de nuestro proyecto ... -
Django Social Bookmarks
The Django Social Bookmarks app does what you might expect this application to do. It provides an easy and reusable way to get those pesky add to this social network site on a Django site. It currently supports 34 different sites, ranging from the big ones like; twitter, facebook, slashdot, delicious, digg, technorati, strumble to local networks like nujij (Dutch), ekudos and tagmos or netjes (Belgium). All texts in the app use Django i18n so people should have no trouble contributing both links and translations to make it truly comprehensive. After adding social_bookmarks to INSTALLED_APPS and making sure the images are reachable you can use the provided inclusion-tag to add the links in a template. Template example: {% load social_bookmarks_tags %} <div class="content"> {{ content }} {% show_social_bookmarks object.title object.get_absolute_url %} </div> The default inclusion-tag template specifies some simple css classes so you can theme the links without having to write you own template. CSS: /* div around the entire block of links ^/ .socialbookmarks { display: block; } .socialbookmarks strong { font-weight: bold; color: black; } /* individual links */ .socialbookmarks .social { color: #ccc; } /* no borders on images */ .socialbookmarks .social a img { border: 0px; … -
Django localized date template filter
UPDATE! This is going to be redundant in Django 1.2, in which you can add DATE_FORMAT to your django.po files. I’ve often been frustrated that using settings.DATE_FORMAT does not give a localized date. Granted that the name of a month may be localized, but the format string does not change. So let’s start out by modifying settings.py. We wrap our default date format in a ugettext so the makemessages command will detect it, and we need to make it a dummy function, because the i18n library cannot be imported in settings.py due to circularity (it depends on settings.py). ugettext = lambda s: s DATE_FORMAT = ugettext('N j, Y') Run compilemessages and type in your localized date formats. Now we need a template filter that uses a localized format for calling the Django date format function. This is really simple: from django.template.defaultfilters import stringfilter from django.utils import dateformat from django.utils.translation import ugettext from django.conf import settings @register.filter() def localdate(value): """Format date with localized date format""" format = ugettext(settings.DATE_FORMAT) return dateformat.format(value, format) And done. Using the filter is straight forward: Date: {{ my_date|localdate }} -
DjangoCon 2009 en Portland
La próxima DjangoCon tendrá lugar del 8 al 12 de Septiembre en Portland (Oregon). Los primeros 3 días serán de conferencia y los siguientes 2 de sprint. El precio de asistencia está entre los 132$ y los 400$. Tenéis toda la información en la página de DjangoCon, donde también está abierta la propuesta de charlas. -
Announcing pyvcs, django-vcs, and piano-man
Justin Lilly and I have just released pyvcs, a lightweight abstraction layer on top of multiple version control systems, and django-vcs, a Django application leveraging pyvcs in order to provide a web interface to version control systems. At this point pyvcs exists exclusively to serve the needs of django-vcs, although it is separate and completely usable on its own. Django-vcs has a robust feature set, including listing recent commits, pretty diff rendering of commits, and code browsing. It also supports multiple projects. Both pyvcs and django-vcs currently support Git and Mercurial, although adding support for a new backend is as simple as implementing four methods and we'd love to be able to support additional VCS like Subversion or Bazaar. Django-vcs comes with some starter templates (as well as CSS to support the pretty diff rendering).It goes without saying that we'd like to thank the authors of the VCS themselves, in addition we'd like to thank the authors of Dulwich, for providing a pure Python implementation of the Git protocol, as well as the Pocoo guys, for pygments, the syntax highlighting library for Python, as well as the pretty diff rendering which we lifted out of the lodgeit pastbin application.Having announced … -
Jak sprawdzać zgodność kodu Pythona z PEP8
Znalazłem ostatnio bardzo fajne narzędzie do sprawdzania czy kod Pythona jest zgodny z zalecanym stylem pisania kodu w Pythonie(PEP8). Jest to skrypt uruchamiany z konsoli który sprawdza czy wskazany moduł jest zgodny z PEP8. Przykład użycia: $ pep8.py --filename=*.py --show-source --show-pep8 /sciezka/do/projektu/ parts/djangopl/sitemaps.py:14:5: E301 expected 1 blank line, found 0 def changefreq(self, obj): ^ Separate top-level function and class definitions with two blank lines. Method definitions inside a class are separated by a single blank line. Extra blank lines may be used (sparingly) to separate groups of related functions. Blank lines may be omitted between a bunch of related one-liners (e.g. a set of dummy implementations). Use blank lines in functions, sparingly, to indicate logical sections. ... parametry: filename - wzorzec jakie pliki mają być brane pod uwagę show-source - przy każdym błędzie będzie wypisany kawałek kodu i wskazane w którym miejscu jest błąd show-pep8 - do każdego błędu będzie podane wyjaśnienie z dokumentu PEP8 Wynik działania prezentuje się bardzo ładnie i można szybko wychwycić gdzie jest błąd i zobaczyć dlaczego tak nie powinno się pisać kodu w Pythonie. Znalazłem też opis jak zintegrować sprawdzanie zgodności z PEP8 z testami wykorzystywanymi w systemie typu continuous integration: http://www.ajaxline.com/continuous-integration-in-django-project Przydatne linki związane …