Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Show Django AdminSite fields depending on the current user
Introduction The auto-created AdminSite in Django is a nifty feature for creating an administrative view of your model classes. Somehow it is not perfect, even if you want to customized it. To guide you to my problem and solution you've to know, that I implemented the SoftDelete behaviour for model classes as described by Greg Allard. It simply adds a 'deleted' field to each model marking it as deleted if its deleted in the admin site (or in some application) but never really gets deleted from the database. So in the admin site there is this field 'deleted' displayed, if you have configured it. The Problem My project has 2 different 'usergroups', the editors and the superusers. Superusers should see the 'deleted' fields, the others not. Unfortunatly that is not possible out of the box with Django. The solution I'm not the first one struggling with the user dependent display of model fields. Luke Plant found a solution for an older version of Django dealing with the field display in the add/change view. Later he updated the thing as the Django version grew. I adapted some lines of his last code for the add/change view and wrote something new to … -
SaaS with Django and PostgreSQL
How to isolate customer's data from one another (one database per customer). -
Django settings.py for development and production
So you developed a Django web application and now need to deploy it into production, but still need to actively continue development (bugfixes, tweaks, adding and testing new features, etc.) In your development environment you probably had debugging enabled, performance settings disabled, used SQLite as your database, and other settings that make development easier and faster. But in production you need to disable debugging, enable performance, and use a real database such as MySQL or PostgreSQL, etc. Hopefully, your development environment can simulate your production environment as well, sort of staging, so your final tests prior to deployment provides the smallest delta. Sometimes you need to emulate the full production environment. Sometimes you need to emulate the full development environment. Sometimes a mixture of the two. This leads to the question, how do you seamlessly manage your development and production settings without adding overhead? It turns out there is quite a lot of discussion on how to setup Django settings.py that supports both a development and production environment, for example: Completely different settings.py files (usually you configure the webserver to add the production settings to the python path, and use the default (development) settings when using the dev webserver. By hostname By variable (PRODUCTION = True) We recently came across this issue when … -
Django settings.py for development and production
So you developed a Django web application and now need to deploy it into production, but still need to actively continue development (bugfixes, tweaks, adding and testing new features, etc.) In your development environment you probably had debugging enabled, performance settings disabled, used SQLite as your database, and other settings that make development easier and faster. But in production you need to disable debugging, enable performance, and use a real database such as MySQL or PostgreSQL, etc. Hopefully, your development environment can simulate your production environment as well, sort of staging, so your final tests prior to deployment provides the smallest delta. Sometimes you need to emulate the full production environment. Sometimes you need to emulate the full development environment. Sometimes a mixture of the two. This leads to the question, how do you seamlessly manage your development and production settings without adding overhead? It turns out there is quite a lot of discussion on how to setup Django settings.py that supports both a development and production environment, for example: Completely different settings.py files (usually you configure the webserver to add the production settings to the python path, and use the default (development) settings when using the dev webserver. By hostname By variable (PRODUCTION = True) We recently came across this issue when … -
Django-websocket parce que sans chaussettes, le web, il pue un peu des pieds
Et oui, malgré la chaleur, malgré les vacances, la plage et l'appel de starcraft 2, malgré tout cela, je reste fidèle au poste et je publie une django app du mois. Bon ok, c'est le dernier jour du mois, mais je suis encore dans les clous. Mais par contre, vu que c'est l'été, les vacances, ... -
Mark Shuttleworth on Tribalism
Mark Shuttleworth: Tribalism is when one group of people start to think people from another group are “wrong by default”. It’s the great-granddaddy of racism and sexism. And the most dangerous kind of tribalism is completely invisible: it has nothing to do with someone’s “birth tribe” and everything to do with their affiliations: where they work, which sports team they support, which linux distribution they love. […] Let’s be clear: tribalism makes you stupid. -
Django Training in the UK
Update Mar 30 2011: I have just announced dates for Django training in London. Please see the Django Training website for more details. In Autumn 2010 I will be running several Django courses throughout the UK. There will be 2 different types of courses: Django template design – 1 day – for html/css coders who [...] -
Swoop Travel Live!
Foundry's first GeoDjango site, Swoop Travel, has gone live. -
Swoop Travel Live!
I'm pleased to announce that Foundry's first web site has gone live: Swoop Travel. Swoop Travel is a GeoDjango site using PostgreSQL and PostGIS, although very little GIS functionality is in the public-facing site at the moment - it's mainly in the backend. We built this from scratch in about a month (while juggling other projects too!) are are pretty pleased with how it's turned out. This is just the first iteration and we're looking forward to expanding the site. GeoDjango is pretty awesome. As we work on the site and get more experience, I'll post some more about some of the innards: there's quite a lot of interesting stuff in the backend, particularly admin customisations like filtering dropdowns based on landmarks within geographic regions, and so on. I'll also try to talk about the production server configuration, as GeoDjango needs a slightly different WSGI configuration to the standard run-of-the-mill Django site. -
Swoop Travel Live!
I'm pleased to announce that Foundry's first web site has gone live: Swoop Travel. Swoop Travel is a GeoDjango site using PostgreSQL and PostGIS, although very little GIS functionality is in the public-facing site at the moment - it's mainly in the backend. We built this from scratch in about a month (while juggling other projects too!) are are pretty pleased with how it's turned out. This is just the first iteration and we're looking forward to expanding the site. GeoDjango is pretty awesome. As we work on the site and get more experience, I'll post some more about some of the innards: there's quite a lot of interesting stuff in the backend, particularly admin customisations like filtering dropdowns based on landmarks within geographic regions, and so on. I'll also try to talk about the production server configuration, as GeoDjango needs a slightly different WSGI configuration to the standard run-of-the-mill Django site. -
Swoop Travel Live!
I'm pleased to announce that Foundry's first web site has gone live: Swoop Travel. Swoop Travel is a GeoDjango site using PostgreSQL and PostGIS, although very little GIS functionality is in the public-facing site at the moment - it's mainly in the backend. We built this from scratch in about a month (while juggling other projects too!) are are pretty pleased with how it's turned out. This is just the first iteration and we're looking forward to expanding the site. GeoDjango is pretty awesome. As we work on the site and get more experience, I'll post some more about some of the innards: there's quite a lot of interesting stuff in the backend, particularly admin customisations like filtering dropdowns based on landmarks within geographic regions, and so on. I'll also try to talk about the production server configuration, as GeoDjango needs a slightly different WSGI configuration to the standard run-of-the-mill Django site. -
Swoop Travel Live!
I'm pleased to announce that Foundry's first web site has gone live: Swoop Travel. Swoop Travel is a GeoDjango site using PostgreSQL and PostGIS, although very little GIS functionality is in the public-facing site at the moment - it's mainly in the backend. We built this from scratch in about a month (while juggling other projects too!) are are pretty pleased with how it's turned out. This is just the first iteration and we're looking forward to expanding the site. GeoDjango is pretty awesome. As we work on the site and get more experience, I'll post some more about some of the innards: there's quite a lot of interesting stuff in the backend, particularly admin customisations like filtering dropdowns based on landmarks within geographic regions, and so on. I'll also try to talk about the production server configuration, as GeoDjango needs a slightly different WSGI configuration to the standard run-of-the-mill Django site. -
PyvaScript - Pythonic syntax for your browser
Hey, after a lot of work in the last few weeks I'm finally ready to introduce you to one of our latest projects called PyvaScript. It's a new scripting language for your client side code with a syntax inspired by our favorite language Python. :) So let's take a closer look at what Waldemar conjured up. Why? We all know the pain resulting from switching between programming languages. Writing web projects using Django means to code in Python on the server side and (mostly) to code in JavaScript on the client side. Switching between both languages leads to many bugs and forces us to think differently in each language. This becomes even worse if we first write much of the code in one of both languages over a longer period of time and then switch over to the other one. In the end the result means unnecessary work. The goal of PyvaScript is to solve this problem by giving you the possibility to use a Python like syntax as well as common functions from Python wherever that is possible on the client side too. Thus PyvaScript addresses developers who love Python while still being able to write fast code and … -
Hookbox
Hookbox (via). For most web projects, I believe implementing any real-time comet features on a separate stack from the rest of the application makes sense—keep using Rails, Django or PHP for the bulk of the application logic, and offload any WebSocket or Comet requests to a separate stack built on top of something like Node.js, Twisted, EventMachine or Jetty. Hookbox is the best example of that philosophy I’ve yet seen—it’s a Comet server that makes WebHook requests back to your regular application stack to check if a user has permission to publish or subscribe to a given channel. “The key insight is that all application development with hookbox happens either in JavaScript or in the native language of the web application itself”. -
Django Alphabet Filter Released with International Character Support
My previous post about the alphabet filter explained the first take at creating the alphabet filter. There were several issues, especially with international character sets, so we have revised the code to fix the issues and made it installable via PyPI. The Default Alphabet The default alphabet is the list of characters displayed in the admin even if there is no data for that character. As there is data, the letters of the alphabet are enabled. Any characters not in the default alphabet, but that exist in the data, are added dynamically. There is no easy way to determine what the default alphabet should be based on the language or locale. We hit several barriers while automating the default alphabet: The default character encoding (on a Mac and in English, at least) is ISO-8859-1, but Django tries to interpret it as UTF-8. The default character set includes too many characters. Some languages (I’m looking at you, Spanish) treat certain two-letter combinations as letters (e.g. ch and ll). Due to these issues, the default alphabet is now a setting named DEFAULT_ALPHABET . The default setting is the ASCII alphabet and digits. You can set the DEFAULT_ALPHABET to a string or list or tuple. If you only what the … -
Announcing djangoembed, rich media consuming and providing with Django
I'm pleased to announce the release of djangoembed, a django app for consuming and providing rich media. What is OEmbed? OEmbed is a format for allowing a rich representation of a url. If you've used Facebook you've probably seen this feature before -- linking a YouTube video will embed an actual video player in the news feed, automatically. The player is represented by some HTML, plus there may be additional metadata like the author, a link to their channel, the title of the video, or even a thumbnail. -
Integració del TVP CECA
Després de barallar-m'hi un bon grapat de dies he aconseguit integrar el TPV de CECA en una de les aplicacions que estic desenvolupant per APSL. Com en el cas de la integració amb el BBVA he de dir que la qualitat de la documentació és inversament proporcional al suport que tens dels tècnics, per a que quedi clar: la documentació és pèssima, plena de inconsistències i exemples que no funcionen. El suport dels tècnics de CECA molt bo. Poc temps per a contestat (llevat de si demanes en divendres, clar) i respostes clares i concises. Un deu! Amb la gent del BBVA el mateix, se coneix que els ha tocat bregar amb la documentació. No acab d'entendre què costa mantenir la documentació actualitzada. Si ja no es fa servir un programa per a generar la firma, llavors es refà la documentació i se'n lleva la referència. Si s'incorpora un tag obligatori nou que s'ha d'enviar, llavors s'actualitzen els exemples. Per si a algú més li serveix faig cinc cèntims del que m'he trobat i del que funciona a l'hora d'escriure aquest apunt. Generació de la firma La firma és diferent per l'enviament i per la resposta. En ambdós casos es … -
GvR on commit privileges
Guido van Rossum: Maybe we’ve been too careful with only giving commit privileges to to experienced and trusted new developers. I spoke to Ezio Melotti and from his experience with getting commit privileges, it seems to be a case of “the lion is much more afraid of you than you are afraid of the lion”. I.e. having got privileges he was very concerned about doing something wrong, worried about the complexity of SVN, and so on. -
Europython 2010 talk: Advanced Django ORM Techniques
Here are the slides from my talk at Europython 2010, Advanced Django ORM Techniques. Advanced Django ORM techniques The talk is mainly a summary of the query optimisation tricks I've previously talked about on this blog, although I did begin by explaining briefly how models, fields and relationships work behind the scenes - I'll write some of that up here at some point. I'll also be posting a longer review of Europython here, hopefully in the next few days. Update: here's the (unfortunately fairly poor-quality) video from the talk: -
Europython 2010 talk: Advanced Django ORM Techniques
Here are the slides from my talk at Europython 2010, Advanced Django ORM Techniques. Advanced Django ORM techniques The talk is mainly a summary of the query optimisation tricks I've previously talked about on this blog, although I did begin by explaining briefly how models, fields and relationships work behind the scenes - I'll write some of that up here at some point. I'll also be posting a longer review of Europython here, hopefully in the next few days. Update: here's the (unfortunately fairly poor-quality) video from the talk: -
Release: django-treebeard 1.61
django-treebeard 1.61 has been released (CHANGES). It’s in pypi so you can install it with pip or easy_install. You can get the code in the Mercurial repo. There is also a well maintained Git mirror. Please report bugs in the bug tracker. Share and enjoy. -
Django using Eclipse IDE and Pydev
I’ve been using Wingwares python IDE for Django development for almost 2 years. The Wingware IDE has been very good but I have had a few superficial annoyances with it so decided to look around and see what other IDE’s I could use. This led me to Eclipse. The first time I had a look [...] -
AlertGrid - instant notification in Python/Django
AlertGrid is an interesting online instant notifications service (written in Python/Django) that helps reacting on the custom events (server down, script error, machine stopped) by sending SMS/phone/email notification. -
twod.wsgi 1.0 is out! (Enhanced WSGI support for Django applications)
I'm very pleased to announce that twod.wsgi 1.0 has been released, after several months of production use and preview releases! No bug has been found in the release candidate and therefore the final release has the same code as the candidate one.twod.wsgi allows Django developers to take advantage of the wealth of existing WSGI software, as the other popular Python frameworks do. It won’t break you existing Django applications because it’s 100% compatible with Django and you can start using the functionality offered by this library progressively.Get it while it's hot! -
Easier custom Model Manager Chaining
Easier custom Model Manager Chaining. A neat solution to the problem of wanting to write a custom QuerySet method (.published() for example) which is also available on that model’s objects manager, without having to write much boilerplate.