Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
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 … -
Features of a good Django plugin
Well, my opinion on them anyway. -
Even better than I thought
Yesterday, I blogged about a positive experience I had with Packt Publishing's relationship with Open Source projects. In that blog entry, I called on companies, including Packt, to give more back to the communities that produce Open Source, including financial contribution where possible. It has since been drawn to my attention that Packt already contributes financially to the Django Foundation, as well as other Open Source projects. Packt pays a royalty back to projects when they sell books on an Open Source topic Packt - I salute you again for this excellent policy, and I apologize for the error on my part. My broader comment still stands: there are many companies that derive profit from open source, but give little if anything back to the projects from which they derive that profit. To those companies - I strongly encourage you to follow the example of Packt. -
Doing the right thing
My life has been fairly busy of late. My daughter was born on June 19; Django v1.1 is almost out the door; and we have lots of interesting stuff underway at work. So, when Packt Publishing contacted me asking if I would like to review their recently released book, I declined. I barely have enough time to read books at the moment, let alone review them. However, I asked if I could have a complimentary copy anyway. After all - I am a Django core developer, and if I (and many other people) hadn't volunteered my time to develop Django, Packt wouldn't have a topic to publish a book about. To my surprise, they agreed. Sitting on my hard disk is a freshly downloaded copy of "Django 1.0 Template Development", by Scott Newman. If Django template development sounds like something you might be interested in knowing more about, and you want to know more about this book, a sample chapter is available. I find this kind of attitude encouraging. It would have been very easy to dismiss my request, but Packt took the opportunity to give a little something back to the community that enables them to derive financial benefit. … -
An update on the book
So, the repository for the second edition of Practical Django Projects is not yet done, but due to the general clamor I’m opening up public access; you can browse it, or check out a copy of the code, from its page on Bitbucket. You’ll probably want to have a look over the README file displayed on that page, since it provides helpful information on how the repository works. Right now the first three chapters’ worth of ... Read full entry -
An update on the book
So, the repository for the second edition of Practical Django Projects is not yet done, but due to the general clamor I’m opening up public access; you can browse it, or check out a copy of the code, from its page on Bitbucket. You’ll probably want to have a look over the README file displayed on that page, since it provides helpful information on how the repository works. Right now the first three ... Read full entry and comments -
Professionalism
Yes, it’d be nice if contractors kept up to date on the progress of the various building codes. They don’t. There are a lot of people who asked about the building codes in the 1970s and were told (right or wrong) what they were. So they went ahead and learned their trade, build their homes, and chose watching a DVD or spending time with their kids over watching city council do battle over asbestos insulation. -
An if-substring-in-string Django Template Construction
Here's a quick tip for Django template hackers. It's a known fact of Django templates that the syntax is purposefully limited. I've been living with the need for an if-substring-in-string construction. Of course, I could write a custom template tag, but work is quitebusy. So on a whim and a 10 minute break I tried this yesterday, and it worked well for me. Take a look and let me know what you think.First, the problem.Bookmark FormattingI have a custom app for pulling in my Delicious bookmarks and formatting them as link posts here on this site. I include the HTML I want in the original bookmark and have a bit of template code to insert preview images generated by ShrinkTheWeb. When I link a YouTube video, I do a quick cut-n-paste of the video to embed the player, and in these cases, I don't want to include the preview image. In Python, this would be super simple: if 'http://www.youtube.com/' not in link_url: show_thumb() However, Django templates don't have a similiar syntax.A Solution Using {% with %}So here's what I did: {% with link_url|slice:":23" as short_url %} {% ifnotequal short_url "http://www.youtube.com/" %} My ShrinkTheWeb image goes here. {% endifnotequal %} Other … -
Django and nginx settings
Django and nginx settings -
EveryBlock libera su código fuente
Hace un par de días se ha liberado el código de EveryBlock bajo licencia GPL. EveryBlock ofrece noticias e información local sobre barrios de distintas ciudades de Estados Unidos. Se trata de uno de los sitios web más interesantes que utilizan Django. El código fuente se puede encontrar dividido en distintos paquetes en el sitio oficial. El código incluye paquetes que trabajan con información geográfica, el sistema de publicación completo de EveryBlock y hasta un paquete de blog y otro de wiki. -
AvaTint Launched!
The site very simply takes your avatar and turns it into any color you select. The online community is starting to do this to support and protest many things. This is the 2.0 way of making your page background black for a cause. We created this site in 90 minutes using Django on June 19th. I got home from dinner and noticed that some twitter icons were coming in green. This caught my attention because I had suggested yellow to protest Obama's massive government spending a few days earlier. I mentioned this to Rudy Menendez (yes related) and suggested it would be useful for the less tech savvy to create a page to change an avatar's color. We knew the Pyhon package PIL could do this and Rudy found jscolor as a color selection tool. Together we created and deployed this application. The timeline is roughtly as follows: 12:25am CT Floated the idea to Rudy via IM 12:30am CT Created local proof of concept that PIL could handle it 12:35am CT Created local project diretory 12:38am CT Download jscolor 12:56am CT Registered domain 1:14am CT Rudy jokes about test scripts 2:00am CT Start deploy to production server and test 2:10am … -
SVN usability
Okay, time to import this code into SVN. svn import, right? This should be easy! svn import https://...../trunk/ Oh crap, that tried to import everything. ^C Guess I’ll just set svn:ignore. svn propset . svn:ignore svn propset svn:ignore . svn propedit svn:ignore svn propedit svn:ignore . Okay. Can’t do that on a non checkout. Fine. cd .. svn co https://...../trunk/ myproject.svn cd myproject.svn/ mv ../myproject/* . Right, okay. Add some files now. -
MySQL Backup Skript mit Emailversand.
A while ago I found a good script for backing up a MySQL database and sending it via email to a recipient here. The script is cool, but I didn't like its structure and the fact, that you have to add the database values inline and that it can only backup a single database. For this reason I rewrote it a little and you can download it here. Features: Backup of mutliple databases Sending of backups to multiple users For every single database a mail is send and there is no file saved on the server. And wow: it's really easy to configure! How do I use it? Download the current version (0.1) Adjust the backup.php (you're getting help by my wonderful comments) upload everything to a directory of your choice if applicable, create a cronjob to periodically execute the script And here the backup.php that calls the appropriate classes and executes the backup (also included in the download): ini_set('error_reporting', E_ALL);// include the filesrequire_once 'MySQLConfig.php';require_once 'MySQLBackup.php'; // add some databases to backup// the domain will be appended to the email subject and is also included within the sql file for identification.$cfgHost0 = new MySQLConfig('username0', 'password0', 'database_name0', 'domain0');$cfgHost1 = new MySQLConfig('username1', 'password1', … -
MySQL backup script with emailing
A while ago I found a good script for backing up a MySQL database and sending it via email to a recipient here. The script is cool, but I didn't like its structure and the fact, that you have to add the database values inline and that it can only backup a single database. For this reason I rewrote it a little and you can download it here. Features: Backup of mutliple databases Sending of backups to multiple users For every single database a mail is send and there is no file saved on the server. And wow: it's really easy to configure! How do I use it? Download the current version (0.1) Adjust the backup.php (you're getting help by my wonderful comments) upload everything to a directory of your choice if applicable, create a cronjob to periodically execute the script And here the backup.php that calls the appropriate classes and executes the backup (also included in the download): ini_set("error_reporting", E_ALL); // include the files require_once "MySQLConfig.php"; require_once "MySQLBackup.php"; // add some databases to backup // the domain will be appended to the email subject and is also included within the sql file for identification. $cfgHost0 = new MySQLConfig("username0", "password0", … -
MySQL backup script with emailing
A while ago I found a good script for backing up a MySQL database and sending it via email to a recipient here. The script is cool, but I didn't like its structure and the fact, that you have to add the database values inline and that it can only backup a single database. For this reason I rewrote it a little and you can download it here. Features: Backup of mutliple databases Sending of backups to multiple users For every single database a mail is send and there is no file saved on the server. And wow: it's really easy to configure! How do I use it? Download the current version (0.1) Adjust the backup.php (you're getting help by my wonderful comments) upload everything to a directory of your choice if applicable, create a cronjob to periodically execute the script And here the backup.php that calls the appropriate classes and executes the backup (also included in the download): ini_set("error_reporting", E_ALL); // include the files require_once "MySQLConfig.php"; require_once "MySQLBackup.php"; // add some databases to backup // the domain will be appended to the email subject and is also included within the sql file for identification. $cfgHost0 = new MySQLConfig("username0", "password0", … -
MySQL backup script with emailing
A while ago I found a good script for backing up a MySQL database and sending it via email to a recipient here. The script is cool, but I didn't like its structure and the fact, that you have to add the database values inline and that it can only backup a single database. For this reason I rewrote it a little and you can download it here. Features: Backup of mutliple databases Sending of backups to multiple users For every single database a mail is send and there is no file saved on the server. And wow: it's really easy to configure! How do I use it? Download the current version (0.1) Adjust the backup.php (you're getting help by my wonderful comments) upload everything to a directory of your choice if applicable, create a cronjob to periodically execute the script And here the backup.php that calls the appropriate classes and executes the backup (also included in the download): ini_set("error_reporting", E_ALL); // include the files require_once "MySQLConfig.php"; require_once "MySQLBackup.php"; // add some databases to backup // the domain will be appended to the email subject and is also included within the sql file for identification. $cfgHost0 = new MySQLConfig("username0", "password0", …