Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
A Guide to Testing in Django
A Guide to Testing in Django -
Magic! Python! Django! Whee!
This blog is now run by Django. I didn’t really like Wordpress which I used before. And also I don’t like PHP anymore (I really liked it some years ago, but everything changed, when I learned Python …). When I told a friend that I wanted to switch from Wordpress to something else, he just said: «Use Django.» So I took a look at the Tutorial and was instantly thrilled. At first, I wanted to use an existing weblog app, but I also wanted to code an app for my own and since I din’t find a weblog app that I 100% liked, I just decided to write my own. So here it is (far from finished though)! Features so far: Basic post model (title, slug, pub date, modify date, status, category, HTML body) Post manager for post counts (per year, month, category (and tag)) Hierarchical category model – imho, this is the highlight of my app. Archive and Categories Some special template tags. Usage of a recursive template tag for the categories Unit- and doctests for the models and template tags Features to come: Comments Atom feeds Sidebar Static pages Trac integration for my projects Search Last.fm sidebar widget … -
Are you looking for Python and Django Work?
I've done some consulting work for a company in New York City that is looking for full time developers of all levels. They've got a solid business model, experienced and excellent leadership, and an existing team of talented developers who do things the right way. The founders and developers have been behind a bunch of things you know and love. The company is stable, well-financed, and offers full benefits.In short: they're building the dream team. They don't use dumb words like rockstar and ninja: they're looking for quietly competent developers with a taste for travel.Additional experience with CSS, JavaScript/JQuery, GIS, Git, Linux, and experience with contributing to open source projects are definite pluses.Before you apply you need to pass this little test of mine. If you fail any portion of of this test then we won't consider hiring you.Can you get to the office or are you willing to move closer? When you begin, you need to be able to get to New York City, New York every day of the week. Over time you can work out telecommuting options. Are you a solitary developer? I'll throw away any responses from recruiters and consulting firms.Bonus Question: Not a requirement but do … -
Finding which python packages are out-of-date
As your projects get bigger, they collect more and more packages. It can be a chore keeping track of which packages have been updated to fix potential bugs. We have that issue and devised a simple script to tells us which installed packages could use a bit of freshening up. You’re using pip, right? First off, this only works with pip. pip has a freeze command that lists all the installed packages. pip also understands virtualenv isolation environments, so it can list just the packages in the current virtualenv. Multiple index support Many of our packages are on PyPI, but every now and then we need to host a package on our own package index. We have an instance of chishop running for our index. We had to add XML-RPC support for this script to work (as of release 0.4.3 these additions have been merged back in). So the script needed to support multiple indexes and find the newest version between all of them. Calling the script If you execute the script without any arguments, it will default to searching PyPI. If you pass space-delimited URLs it will use those instead. For example we would call it: $ python check_for_updates.py http://opensource.washingtontimes.com/pypi/ http://pypi.python.org/pypi to search both PyPI and … -
We're hiring!
UPDATE: I completely forgot to update this post until now, but we have filled this position. We're looking for a full time developer. If you're reading this you probably know what we do, so you'll obviously need to know Django pretty well. Knowledge of PostgreSQL and devops skills are a big plus. We would prefer if you lived in Lawrence, Kansas, obviously, but a few visits here may be fine. Only because we get lonely. Lawrence is an awesome town, so don't let the surroundings (the rest of Kansas) scare you off. It's the hometown of Django and basketball. People often compare it to a smaller version of Austin or Portland, OR. For example, check out the local music happening this weekend on the great Lawrence.com. Interested? Email frank@revsys.com with your resume and code samples. Links to public repositories are ideal, also feel free to talk yourself up with respect to Open Source contributions. Docs, code, answering questions on a mailing list, your StackOverflow account, etc. are all good things to bring to our attention. We probably shouldn't need to tell you this, but if you've contributed code to Django you might want to lead with that! -
Mercurial mirror for Django stable branch 1.3
Django recently released the 1.3 version, and as such a new ‘stable’ branch was created in subversion. As I did for the 1.2 branch, there’s now a mercurial mirror, following the 1.3 branch. It is updated every (european) night. The 1.2 mirror is not removed, it is still running and maintained. The url for this [...] -
Fossgis: geodata-infrastructure and web mapping with geonode - Andreas Hocevar
Gathering data is expensive. Gathered data is worthless. Making data available is relatively cheap. Available data is valuable. So: having data available on the web is good. Keeping your data safe in some sort of data-cemetary isn't that useful. If you have to make a map, normally you'd break out your desktop GIS system. You'd get your own data and download external data and convert it. You'd do analysis and in the end make a map. The alternative is to do everything on the web. Not everything that is possible on the desktop GIS is possible/feasible on the web. Analysis, for instance, is more limited on the web. But you don't need to convert/import external data as that's assumed to be available on the web. Geonode (build with GeoServer, Django, and GeoExt) is a tool you can use for pure web-based GIS. You can upload and manage GIS data. They're big on metadata: you don't want just a dumping ground. Maps are an important content type. Maps combine the data/layers and the styles. Geonode allows many people to collaborate. For every user, you can see the data layers and the maps that he added. For every data layer, you can … -
Fossgis: geodata-infrastructure and web mapping with geonode - Andreas Hocevar
Gathering data is expensive. Gathered data is worthless. Making data available is relatively cheap. Available data is valuable. So: having data available on the web is good. Keeping your data safe in some sort of data-cemetary isn't that useful. If you have to make a map, normally you'd break out your desktop GIS system. You'd get your own data and download external data and convert it. You'd do analysis and in the end make a map. The alternative is to do everything on the web. Not everything that is possible on the desktop GIS is possible/feasible on the web. Analysis, for instance, is more limited on the web. But you don't need to convert/import external data as that's assumed to be available on the web. Geonode (build with GeoServer, Django, and GeoExt) is a tool you can use for pure web-based GIS. You can upload and manage GIS data. They're big on metadata: you don't want just a dumping ground. Maps are an important content type. Maps combine the data/layers and the styles. Geonode allows many people to collaborate. For every user, you can see the data layers and the maps that he added. For every data layer, you can … -
Writing a spider with a django-powered web interface
I'd been scrounging around for a smallish project, when I happened on the idea of writing a spider with a simple web interface. I had recently released a task queue, so I wanted to incorporate that to do the actual crawling, while a django view served up the results as they arrived in the database. The end result is a new project I'm calling django-spider, you can check it out on GitHub. This post will discuss some of the aspects of the design. -
Python Packages sprint on Sunday 4/10/2011
Want to help Python? Want to encourage PyPI to focus on being the best package index system possible and not a catalog/ratings/documentation engine? Then sprint with us on Packaginator this weekend because...We need your help!In my last blog post I mentioned Packaginator which will power the forthcoming Python Packages site. The purpose of this site is to do for Python what Django Packages does for Django. We aren't quite ready for launch, and the purpose of this post is to list what tasks remains. There is an enormous amount of outstanding work, and we want to launch as soon as possible so...Before I begin, Python Packages will have some dramatic differences from Django Packages:The 'Add Package' controls won't exist. The only way to get a package into the site is to put your package onto PyPI.At launch only approved moderators will be able to create new grids and grid features.Only approved moderators and package owners will be able to edit the target repo URLs and add/edit/remove packages on grids.Users will still be able to click the "I use this" button. Please join us!We invite you to sprint with us on Sunday, April 10, 2011. We are sprinting on Python Packages / … -
Creating a .pth file
Creating a .pth file -
Creating a .pth file
An easy way to add packages to the Python path without actually adding them to the dist / site packages is by using a pth file. All you have to do is create a new file inside of the dist / site packages folder and give it a /pth extension like this: django.pth In that file you can add the path to your Django package like this: /var/src/Django-1.2.3 The advantage of doing this is that you can keep... -
PyCon 2011 Sprint Report
I love sprints. I've yet to participate in a sprint where I didn't learn something that made a difference in my programming career. Off the top of my head some of the things I've learned include distributed version control, picking the right Python tool, JQuery, SQLAlchemy, Bazaar, Git, Mercurial, the true importance of unittests, and Python's built-in zip function. And the PyCon 2011 sprints were no different.PyCon 2011 was different in that this time I was going to co-lead a project, specifically Django Packages and the hopeful launch of Python Packages.Note: The goal of Python Packages is not to replace PyPI, but rather serve as a resource to find, evaluate, and compare packages used in the every day life of a Python. In my opinion, PyPI should be dedicated to listing and serving packages - anything else (comments, ratings, documentation, etc) just adds complexity to the project and diffuses the focus of their team.It all started with us being the second-to-last in line at the PyCon sprint announcements. At the microphone I forgot to mention a few things so I was worried that our attendance would suck. I tried to take it in good humor, but doubt worried at my … -
Cross-domain quirks in IE8
-
Django howto: Non-conflicting slugs
A while ago I was testing a Django project at work. In the project we had a Django app called Groups. To create a group, you should point the browser to www.domain.tld/group/create/ and to view a group, you had to point your browser to www.domain.tld/group/<group_slug>/. Of course a group slug is unique, so we should never have any conflicts. That is, until I decided to create a group with the slug 'create'.As expected, I was faced by the 'Create a new group'-page when I tried to view my pretty new group. When I swapped some URLs in de Groups app, everybody who tried to create a new group, was served the page of my beautiful group. Everything worked as expected, but still it was considered a bug. This was not the kind of functionality the customer was looking for. For the time being we just let it be (what are the chances the customer would create a group with the slug 'create'?), but the case kept whining in the back of my head.Until today. I decided to tackle the problem. And of course, it was easier than I thought.After entering some smart queries, Google told me that there is something … -
The penguin who owns example.com
Episode 1 of Scared of Rabbits. I feel sad for this poor little bird. Permalink | Leave a comment » -
Setting Up Your Own PyPi Server
-
Setting Up Your Own PyPi Server
Ever had problems with PyPi being unreachable? Dislike dealing with requirement.txt files just to support a git repository? For a low low price of FREE, and an hour of labor, get your very own PyPi server and solve all of your worries!Set up ChishopWe're going to jump right into this one. Sta... -
Celery, Redis and Django
Disclaimer: This is my first English post is a free translation of the original catalan post In previous posts have written about Celery and Django Celery, a system to manage queues and tasks in Python and Django. Celery in its documentation recommends RabbitMQ as message broker, that is, as the application that receives and distributes the tasks that the application sends between the different workers we have configured in our system. Once the worker has done the task it leaves the result (if we have configured to do it) to the results backend, usually it is the same one as the message broker, that is RabbitMQ acts as a message broker and as a result backend. The architecture of Celery is very powerful in the sense it allows us to scale up and down and replace the parts we need to configure the application to our needs. So we could have applications that needs some sort of message or task distribution, but they don't need to deal with the complexity nor the system requirements of RabbitMQ. With Celery we can even use a database as a message broker where could save the results, we can replace the serialization routines, the … -
Celery i Redis
En anteriors apunts he parlat ja de Celery i de Django Celery, un sistema per a la gestió de cues i tasques per Python i Django. Celery a la seva documentació recomana RabbitMQ com a gestor de missatgeria, és a dir, com a aplicació que reb i distribueix les tasques que li envia l'aplicació entre els diferents worker que tenguem al nostre sistema. Una vegada el worker ha realitzat la tasca deixa el resultat (si així ho hem indicat) al contenidor de resultats, que normalment serà el mateix que el broker de missatgeria, és a dir RabbitMQ. L'arquitectura de Celery és molt potent en tant que ens permet escalar cap a baix i substituir peces segons necessitem. Així per aplicacions que necessitin d'un sistema de distribució de tasques però no de la complexitat de RabbitMQ podem utilitzar altres sistemes de notificacions, fins i tot fer servir una base de dades. On es guarden els resultats o com es serialitzen els missatges també es pot canviar. En definitiva, encara que hi hagi una configuració recomanada per a entorns que necessitin de molta potència en el sistema de distribució de tasques i coes, podem personalitzar Celery al nostre gust i a les … -
FOSSGIS Heidelberg, here I come
At Nelen & Schuurmans we're working with geographical information a lot. Most desktop GIS usage in our office is decidedly non-open-source: arcgis. The big commercial "microsoft of GIS". On the (web)server side, everything is decidedly open source. And we use a wide range of open source tools/libraries/data. Some examples: Mapnik. Postgis. Gdal. Openstreetmap. Pyproj. Geodjango. Regarding most of them: we're using it, but our knowledge isn't very deep. At least my knowledge isn't very deep. I can render icons or a geotiff file on a mapnik map just fine, but that's hardly advanced rendering and map typography. And my postgis skills are rudimentary (a drawback partially of using object databases for 8 years with hardly any SQL in sight). Openstreetmap: we use it, but that's it. Time for improvement! So I'm going to the german-language free and open source GIS conference in Heidelberg, Germany. My German is good, at least when listening or reading. (My writing is terribly rusty, as I haven't exercised it in years and I'm unsure about the der/des/dem/den stuff). Three days of talks on a lot of different libraries, use-cases and programs. Just the thing that I need. One of my strengths is absorbing lots of … -
FOSSGIS Heidelberg, here I come
At Nelen & Schuurmans we're working with geographical information a lot. Most desktop GIS usage in our office is decidedly non-open-source: arcgis. The big commercial "microsoft of GIS". On the (web)server side, everything is decidedly open source. And we use a wide range of open source tools/libraries/data. Some examples: Mapnik. Postgis. Gdal. Openstreetmap. Pyproj. Geodjango. Regarding most of them: we're using it, but our knowledge isn't very deep. At least my knowledge isn't very deep. I can render icons or a geotiff file on a mapnik map just fine, but that's hardly advanced rendering and map typography. And my postgis skills are rudimentary (a drawback partially of using object databases for 8 years with hardly any SQL in sight). Openstreetmap: we use it, but that's it. Time for improvement! So I'm going to the german-language free and open source GIS conference in Heidelberg, Germany. My German is good, at least when listening or reading. (My writing is terribly rusty, as I haven't exercised it in years and I'm unsure about the der/des/dem/den stuff). Three days of talks on a lot of different libraries, use-cases and programs. Just the thing that I need. One of my strengths is absorbing lots of … -
Using jQuery templating ICanHaz.js with Django
When working on a Django project with an important part of the user experience based on AJAX, you better use a frontend templating language. The same way Django has a templating language that we use to populate values easing your coder’s life, jQuery has client side alternatives. One of these plugins and my personal favorite is ICanHaz.js created by @HenrikJoreteg. It’s only 4.4 Kb. ICanHaz.js syntax will be very familiar to Django devs, because a variable is defined using double curly brackets {{ variable }}. But I will not enter into details, the project has very easy to follow setup instructions and code examples. When people start using ICanHaz.js in their Django templates, they have a very hard first time trying to get it to work. The problem is simple, Django and ICanHaz.js share the same variable definition, so Django interprets the script templates, breaking them. When I found this out, I looked over the Internet until I found a fix by Eric Florenzano (@ericflo). He coded a templatetag called verbatim, that avoids that Django interprets all content within the block tag. He published it as a gist in Github. You simply have to put this within one of your … -
Django Pattern for Reporting Errors/Messages in Views
I've tried tried to find a decent way to design my Django views so that I can smoothly report errors to users. The errors that I am concerned about are errors that users encounter if they are preforming actions that are typically NOT normally encountered through normal use of the user interface. For example, if users try to directly access a URL of an object that doesn't exist, if they post incorrect values to a URL, or a required value doesn't exist in the user's session. In a utility module, I create a message class that I to store message information. While view processing is taking place, if an error takes place, this class will be used to store the error title, text, and "back" url link. core/utils.pyclass UserMessage(): def __init__(self, title="", text=[], url=None): self.title = title self.text = text if hasattr(text, '__iter__') else [text] self.url = url The view continually checks for the existance of a UserMessage instance. (In the example below, "message" variable is an instance of UserMessage) If an error condition occurs, part of the handing will be to create a new UserMessage, and the view renders an error page using the template defined by message_template_name and … -
Using jQuery templating ICanHaz.js with Django
When working on a Django project with an important part of the user experience based on AJAX, you better use a frontend templating language. The same way Django has a templating language that we use to populate values easing your coder’s life, jQuery has client side alternatives. One of these plugins and my personal favorite is ICanHaz.js created by @HenrikJoreteg. It’s only 4.4 Kb. ICanHaz.js syntax will be very familiar to Django devs, because a variable is defined using double curly brackets {{ variable }}. But I will not enter into details, the project has very easy to follow setup instructions and code examples. When people start using ICanHaz.js in their Django templates, they have a very hard first time trying to get it to work. The problem is simple, Django and ICanHaz.js share the same variable definition, so Django interprets the script templates, breaking them. When I found this out, I looked over the Internet until I found a fix by Eric Florenzano (@ericflo). He coded a templatetag called verbatim, that avoids that Django interprets all content within the block tag. He published it as a gist in Github. You simply have to put this within one of your …