Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Dallas Django 1.1 Sprint
Djangonauts of Dallas rejoice! We are joining forces to have our very first Django Sprint event for the upcoming 1.1 release. For more info: When: Saturday, April 18, 2009 at 9:00am to Sunday, April 19, 2009 at 5:00pm Where: Cohabitat 2517 Thomas Ave. Dallas, TX Facebook Event Page: http://www.facebook.com/event.php?eid=81320026376&ref=nf -
Hooray for standards
Hey, look, it’s a new W3C site. Hm: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Ooh, XHTML… $ curl -sI http://beta.w3.org/ | grep 'Content-Type' Content-Type: text/html; charset=utf-8 Heh. -
Easier Translations with django-rosetta
I just found out about this Django application called django-rosetta that uses the Google AJAX Language API to suggest translations for translatable strings in your project. Even more interesting is the admin-like interface it creates to enter translations directly from a browser - and it doesn’t need any database tables, everything is directly written to translation files. I didn’t try it out yet, but if it works as advertised, it could become one of my default applications. Visit the bookmark » -
Building Better Web Services With Django (Part 1)
Building a RESTful webservice is pretty straight-forward with Django, but in many cases you want to have both a human readable website and a machine readable api. A lot of websites solve this problem by using www.x.com as the human site, an api.x.com as the machine site. They also will typically have different structures to [...] -
Django Site of the Week: The A.V. Club
It's been a while, but the Django Site of the Week is back. This week I spoke to Tom Tobin, developer at satire news site The Onion, about their Django-powered site The A.V. Club. Originally a Drupal website, Tom and his team converted the site to Django over a period odds three months. So how do they handle a million unique views a month? Read the article to find out. -
Django Site of the Week - The A.V. Club
For various reasons I haven't been able to post a Django Site of the Week for quite a while now, which is a little embarrassing. I've had this little interview sitting in my inbox for over a month, and I've only just been able to write it up and get it published. Just about everybody online has come across The Onion at some stage. Whether you have interpreted a satirical news story as the truth, or just read it for a laugh, The Onion is a staple of online publishing. A less-satirical yet still enjoyable feature of The Onion is The A.V. Club. Originally part of the printed Onion newspaper and then a PHP-powered Drupal based website, The A.V. Club is now running on Django - and the team who built it love Django to bits. This week, I spoke to Tom Tobin, web developer at The Onion. We discussed how they built the A.V. Club website, how they manage with a million unique visitors a month, and what their plans are for the future of The Onion's online presence. You can read the interview and leave your comments at the Django Site of the Week Website. -
Django Site of the Week - The A.V. Club
For various reasons I haven't been able to post a Django Site of the Week for quite a while now, which is a little embarrassing. I've had this little interview sitting in my inbox for over a month, and I've only just been able to write it up and get … -
Signal vs overriding save
I'm a big fan of signals and wonder why people are so adverse to using them, preferring overriding save instead. -
Django - autoryzacja przez Clickpass - tutorial
Clickpass umożliwia proste logowanie użytkowników za pomocą kont które już posiadają w innych systemach, np. hotmail, yahoo, google, facebook, aim, clickpass lub OpenID. Zasadę działania opisywałem w poprzednim poście. Teraz pokaże jak zaimplementować to w Django. Korzystam z aplikacji która ostatnio udostępniło washingtontimes, a mianowicie django-clickpass. Jest to aplikacja która bardzo upraszcza wykorzystanie clickpass w django. Instalacja Zainstaluj django-openid: svn co http://django-openid.googlecode.com/svn/trunk/django_openid django_openid Zainstaluj paczkę python OpenID 2.2.1 - http://openidenabled.com/files/python-openid/packages/python-openid-2.2.1.tar.gz. Szczegółowe instrukcje znajdziesz tutaj: http://www.openidenabled.com/python-openid/ Dodaj django_openid do Twoich INSTALLED_APPS. Zainstaluj django-clickpass: svn co http://opensource.washingtontimes.com/projects/public/django-clickpass/trunk/clickpass clickpass Dodaj clickpass do Twoich INSTALLED_APPS. Do głównych urls.py dodaj from clickpass.consumer import ClickPassConsumer Dodaj (r'^openid/(.*)', ClickPassConsumer()), do Twoich urlpatterns w urls.py: Przykład urls.py, do dodaniu ClickPassConsummer: from clickpass.consumer import ClickPassConsumer urlpatterns = patterns('', (r'^admin/(.*)', admin.site.root), (r'^moja_aplikacja/', include('moj_projekt.moja_aplikacja.urls')), (r'^openid/(.*)', ClickPassConsumer()), ) Dodaj clickpass.consumer.ClickPassConsumer do MIDDLEWARE_CLASSES gdzieś po django.contrib.sessions.middleware.SessionMiddleware, np: Przykład: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'clickpass.consumer.ClickPassConsumer', 'django_openid.consumer.SessionConsumer', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware', ) W szablonach możesz dodać przycisk clickpass za pomoca template tag'a clickpass_button_large* lub clickpass_button_small. {% load clickpass %} {% if user.is_anonymous %} Zaloguj się {% clickpass_button_small %} {% else %} Zalogowano jako: {{user.first_name}} {{user.last_name}} {% endif %} Możesz także napisać kilka domyślnych szablonów które używa django-openid. Szablony są w katalogu: django_openid/templates/django_openid Konfiguracja konta clickpass Załóż tzw. … -
Django/Dojo Stammtisch in Berlin
For the second time Django enthusiasts are meeting in Berlin on Wednesday, the 15th April, 2009 at 19:30. Find all the details here. And since I will be in Berlin this time, I just simply redeclare this to “Django/Dojo Stammtisch” instead of just “Django Stammtisch” :-). I hope all the djangoers are ok with that (I requested permission in #django-de). It just makes things easier to also meet some dojo people in Berlin. I will also have some cool new dojango stuff to show off! So if AJAX, JavaScript and Dojo people are around, it would be cool to meet you there and chat about what’s hot and how the beer is. Please add yourself to the attendees list on doodle. And thanks again to the Berlin djangoers for organizing this, I am looking forward to it. -
The Django Deployment Survey - How Are You Hosting Django Websites?
According to the official Django Documentation, there are around a half-dozen documented and supported ways of deploying Django in production environments. The recommended way these days is with Apache and mod_wsgi, but there are still a whole bunch of decisions that one must make when it comes to making their Django project public. One of the great things about running DjangoSites is that it has exposed me to a number of fantastic Django-powered websites. Each of these is unique in one way or another, but they are all running Django. How they use it, though, is anybodies guess. So what are our peers doing? There are proponents for and against each of the different pieces of the Django Deployment puzzle. What operating system should be used? BSD, Linux or Windows? What Database system should be used? Postgres, MySQL, or something else? Which web server software? Apache, nginx, or one of the many python-powered web servers? Which method should I use? mod_python, FastCGI, or something else? Which version of Django? Do I stick to a release, or try and keep up with SVN? To see what our Django-using peers are doing, I am starting a survey of Django website deployment methods. … -
The Django Deployment Survey - How Are You Hosting Django Websites?
According to the official Django Documentation, there are around a half-dozen documented and supported ways of deploying Django in production environments. The recommended way these days is with Apache and mod_wsgi, but there are still a whole bunch of decisions that one must make when it comes to making their … -
A Django deployment guide for Ubuntu
There's a time when every Django developer has to think about deployment scenarios, when I first did it last year I thought that a setup involving Lighty, Apache, mod_proxy and mod_python was a good choice but my first approach was not the best. I put Apache as the front server, handling requests for Django generated pages and passing, via mod_proxy, requests for static content to Lighty on the back. A setup where Apache had to work even for files that wasn't supposed to serve was a very bad idea. After many helpful comments and some more reading I realized that it was better having the server for static content on the front and Apache, which still talks to Django, on the back. I replaced Lighty with nginx, which according to many seems to be more stable, and opted for mod_wsgi instead of mod_python to make Apache talk to Django. mod_wsgi has a lower memory overhead and it's suitable for high performance sites. There's no need for mod_proxy on Apache anymore as nginx is the one in charge of the proxy work now. This is an easy to follow and very focused guide for developers who know how to handle their … -
A Django deployment guide for Ubuntu
January 2012 update: I use and recommend gunicorn and Nginx for Django projects now. There's a time when every Django developer has to think about deployment scenarios, when I first did it last year I thought that a setup involving Lighty, Apache, mod_proxy and mod_python was a good choice but my first approach was not the best. I put Apache as the front server, handling requests for Django generated pages and passing, via mod_proxy, requests for static content to Lighty on the back. A setup where Apache had to work even for files that wasn't supposed to serve was a very bad idea. After many helpful comments and some more reading I realized that it was better having the server for static content on the front and Apache, which still talks to Django, on the back. I replaced Lighty with nginx, which according to many seems to be more stable, and opted for mod_wsgi instead of mod_python to make Apache talk to Django. mod_wsgi has a lower memory overhead and it's suitable for high performance sites. There's no need for mod_proxy on Apache anymore as nginx is the one in charge of the proxy work now. This is an easy … -
Django like templates in Javascript
Here's a quick ‘n’ dirty Javascript function I hacked together that provides Django-like template substitution. function sformat(template, data) { return template.replace(/{{(.*?)}}/g, function(m, n) { return eval('data.'+n); }); } Used something like this: sformat("Hello, {{ name }}!", {name:"World"}); Which returns the following string: Hello, World! Alas, it doesn't support anything other than substitution. If you need anything more advanced (loops etc), you should investigate Javascript template engines. -
Django like templates in Javascript
Here's a quick ‘n’ dirty Javascript function I hacked together that provides Django-like template substitution. function sformat(template, data) { return template.replace(/{{(.*?)}}/g, function(m, n) { return eval('data.'+n); }); } Used something like this: sformat("Hello, {{ name }}!", {name:"World"}); Which returns the following string: Hello, World! Alas, it doesn't support anything other than substitution. If you need anything more advanced (loops etc), you should investigate Javascript template engines. -
Django like templates in Javascript
Here's a quick ‘n’ dirty Javascript function I hacked together that provides Django-like template substitution. function sformat(template, data) { return template.replace(/{{(.*?)}}/g, function(m, n) { return eval('data.'+n); }); } Used something like this: sformat("Hello, {{ name }}!", {name:"World"}); Which returns the following string: Hello, World! Alas, it doesn't support anything other than substitution. If you need anything more advanced (loops etc), you should investigate Javascript template engines. -
Nowa wersja bloga - czyli jak stworzyłem bloga marzeń
Przez ostatni czas przepisywałem tego bloga na django 1.0. Gdy pisałem go około 1.5 roku temu, miałem małe pojęcie o django i python, teraz gdy nabrałem trochę doświadczenia z django i python'em, postanowiłem sobie napisać swojego bloga marzeń. Ktoś mógł by powiedzieć po co pisać bloga od podstaw, przecież można skorzystać z jakiegoś gotowca, jednak ja to traktuje jako takie poletko doświadczalne, miejsce gdzie mogę poeksperymentować z nowymi bibliotekami, narzędziami itd. Pozwala to na nauczenie się czegoś nowego, na co nie koniecznie ma się czas podczas co dziennej pracy zawodowej oraz przekazanie zdobytej wiedzy społeczności. Mój nowy blog posiada następujące funkcje: Autoryzacja wykorzystując django-clickpass django-clickpass jest jednym z projektów ostatnio udostępnionych przez washingtontimes. Implementuje mechanizm autoryzacji clickpass. Clickpass pozwala na logowanie z hotmail, yahoo, google, facebook, aim, clickpass lub OpenID. Zasada działania: Wejście na stronę Przycisk Clickpass ładuje uzupełniony formularz zawierający OpenID użytkownika Użytkownik klika w przycisk Jeżeli logujemy się pierwszy raz, clickpass zapyta czy mamy już konto w jednym z popularnych serwisów, jeżeli tak, to przekieruje do autoryzacji w tym serwisie, następnie wygeneruje OpenID i skojarzy je z serwisem który wybraliśmy. OpenID jest wysłane bezpośrednio przez Clickpass do twojej strony Następuje proces autoryzacji OpenID jak przy zwykłym OpenID Dzięki … -
Using dynamic themes in django
I’ve been working on a django blogger clone. It has many interesting features includding email blogging, gadgets, followers, many authors per blog, feed agregation, fully customizable colors and themes. This time I want to write how do we (I was working with a classmate) solved the problem of dynamic themes. First we wanted the themes to be dynamic that means the site administrator can add or edit themes using the django administration site. First we created a model called Theme class Theme(models.Model): name = models.CharField(max_length=40, unique=True) description = models.TextField(blank=True) slug = models.SlugField(max_length=50, unique=True, editable=False) base_html = models.FileField(upload_to=upload_to('themes/')) style_css = models.FileField(upload_to=upload_to('themes/'), blank=True, null=True) preview = models.ImageField(upload_to=upload_to('themes/')) def __unicode__(self): return '%s' % self.name The name, description, preview and slug fields are obvious. We included a base_html file wich is supoused to be a base template used for all the weblog templates. A css style file is also needed for styling the weblog. Many themes require adicional images so we created another model like this: class ImageTheme(models.Model): theme = models.ForeignKey(Theme) image = models.ImageField(upload_to=upload_to_image('themes/')) We expected each base.html to declare a content, and a sidebar block. So this blocks are used in the weblog templates to display the information. The trick is to pass … -
Django Toronto Meetups
Tonight was the latest in a series of get togethers among Django developers in the Toronto area. We have been doing these for the past few months, since October 2008, and even though our numbers haven’t grown much, I am pretty sure there are other Djangonauts in Toronto who would be interested. We are planning to do monthly scheduled meetings with proper presentations at the Linux Caffe first Wednesday of every month. So join the mailing list and let’s start organizing! Visit the bookmark » -
Schema Migrations with South
For the past few months, I have been trying out the different schema migration tools for Django. At first, the obvious choice seemed like django-evolution. It was the oldest and the most mature project, and after watching the schema evolution panel from DjangoCon 2008, it was also the one that made most sense in terms of architecture. After working with django-evolution in a few projects though, I found that it did not work well in practice. I have recently been testing South, and it seems like the better choice. I had a few big issues with django-evolution: Inability to go backwards or forwards, or to be able to skip migrations (or mutations as it calls them) Inability to use custom fields that require additional parameters Lack of integration with syncdb (if someone in the team accidentally does a syncdb, it fails) I love how clever evolution can be when guessing the modifications to a model, but I don’t think what’s needed from a migration tool is cleverness. I needed a tool that gave me the freedom to do whatever I wanted, while making my job easier by managing all the changes. I have been playing around with South for the … -
Lessons Learned: Google App Engine + App Engine Patch + Django + Boto
Update: Mitch Garnaat from CloudRight has pointed out that you can actually set the policy of the S3 file in the set_contents_from_file call instead of making another roundtrip request into S3 (and saving you some coin). Thanks Mitch! Btw, I’m using App Engine Patch 1.0 and Boto 1.6a. Sorry I haven’t updated my blog in a few weeks months, but I’ve been a little busy. With that said, along with Erlang, I’ve been playing around with Google App Engine, App Engine Patch (for Django support), and the Boto library (for Amazon S3 support). After not having touched Python code in a few months, I wanted to document some of my lessons learned to help over developers who may be in a similar boat. Lessons learned If you’re upgrading the App Engine Patch, make sure you don’t have the App Engine library installed in a hidden directory Uploading bulk data changed ever so slightly If you’re not running off of Boto’s trunk, you’ll need to patch your Boto installation to work with App Engine. Make sure the App Engine library isn’t installed in a hidden directory Apparently, Google’s SDK 1.1.9 doesn’t like to rely on files that won’t be uploaded with … -
Django and mod_wsgi
Finally, Django’s recommended deployment method switched from mod_python to mod_wsgi. Updated docs are now online. Visit the bookmark » -
Django talk at FOSSLC Summercamp/Geocamp 2009
I will be giving an introductory Django talk at The Free and Open Source Software Learning Centre (FOSSLC) Summercamp/Geocamp 2009 Conference. The conference is taking place on May 13, 14, and 15 at Algonquin College, Ottawa, Ontario, Canada, and early bird pricing is available until April 5. -
Google Gets Into VC Business
Recently all the major news papers have covered the same story. Google is getting into the VC space. Its nice to know the company that saved the web is now saving the VC market. Although I expected some new cool social investment platform instead of a simple. "We’ve got $100 Million to [...]