Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Released 1.0 alpha 7
-
News 01/2010
-
Release 1.0 beta 1
-
Release 1.0 beta 4
-
Release 1.0 Final
-
News 02/2010
-
10 Reasons Why You Want To Use LFC
-
Release 1.0.3
-
Dutch Django meeting: lightning talks
Connecting Django to the Multisafepay payment provider - Jan Murre They're sometimes using multisafepay for adding online payment for sites. They're quite happy with it. It is relatively simple. The payment, like with most such providers, takes place on the payment provider's website. This is often perceived as trustworthy by customers. They have an xml api. For that, they had a couple of api implementations. Not in python, though. So he investigated it and a transaction is a pretty straightforward exchange of urls and xml messages. He made a python api based on the xml structure and their own provided non-python api examples. It is not on pypi yet, but Jan Murre might put it there if there's interest. Django-fanstatic - Jan-Jaap Driessen / Boaz Leskes Jan-Jaap never uses Django, Boaz does :-) They got together to integrate fanstatic into the django world. Jan-jaap presented fanstatic at the last python usergroup meeting. It makes javascript and css resources available in python. You can just import resources in python (import js.jquery). Those resources are included in python packages, which means they can have dependencies! Just specify something like jquery.need() in your view. Fanstatic handles the injection of the css/javascript into your … -
Dutch Django meeting: lightning talks
Connecting Django to the Multisafepay payment provider - Jan Murre They're sometimes using multisafepay for adding online payment for sites. They're quite happy with it. It is relatively simple. The payment, like with most such providers, takes place on the payment provider's website. This is often perceived as trustworthy by customers. They have an xml api. For that, they had a couple of api implementations. Not in python, though. So he investigated it and a transaction is a pretty straightforward exchange of urls and xml messages. He made a python api based on the xml structure and their own provided non-python api examples. It is not on pypi yet, but Jan Murre might put it there if there's interest. Django-fanstatic - Jan-Jaap Driessen / Boaz Leskes Jan-Jaap never uses Django, Boaz does :-) They got together to integrate fanstatic into the django world. Jan-jaap presented fanstatic at the last python usergroup meeting. It makes javascript and css resources available in python. You can just import resources in python (import js.jquery). Those resources are included in python packages, which means they can have dependencies! Just specify something like jquery.need() in your view. Fanstatic handles the injection of the css/javascript into your … -
Django Fiber - Dennis Bunskoek (Dutch Django meeting)
At leukeleu / ride the pony they've made a simple, user-friendly CMS for all your Django projects. Django fiber is one app with pages, contentitems, images and files. It replaces the django flatpages app and a couple of other things like treemenus, frontendadmin and so on. It aims to complement your project, it doesn't take it over. It adds simple menus and pages where you can add simple content items. And there's front end editing and drag/drop reordering of page items. They want to have the customers edit the website themselves so they don't have to change small things all the time (and that the customer doesn't have to pay them for 15 minutes all the time). You can add /@fiber to the url and you can log in and you get an edit sidebar. The edit sidebar means it doesn't intrude that much on your regular site layout. Editable items can be edited in-place by clicking on them (you get a popup with and edit form). In the sidebar, you can have a list of prepared bits of content (like your address data) which you can drag into the page. If you change it, it is changed everywhere at … -
Django Fiber - Dennis Bunskoek (Dutch Django meeting)
At leukeleu / ride the pony they've made a simple, user-friendly CMS for all your Django projects. Django fiber is one app with pages, contentitems, images and files. It replaces the django flatpages app and a couple of other things like treemenus, frontendadmin and so on. It aims to complement your project, it doesn't take it over. It adds simple menus and pages where you can add simple content items. And there's front end editing and drag/drop reordering of page items. They want to have the customers edit the website themselves so they don't have to change small things all the time (and that the customer doesn't have to pay them for 15 minutes all the time). You can add /@fiber to the url and you can log in and you get an edit sidebar. The edit sidebar means it doesn't intrude that much on your regular site layout. Editable items can be edited in-place by clicking on them (you get a popup with and edit form). In the sidebar, you can have a list of prepared bits of content (like your address data) which you can drag into the page. If you change it, it is changed everywhere at … -
Une autre façon de gérer ses settings d'application Django
Je travaille actuellement sur une application Django que je compte publier sous licence libre, et je suis confronté au problème classique de l’exposition de la configuration au développeur via les settings de son propre projet. Classiquement, on a tendance à proposer les settings “à plat”, dans le module settings.py du projet : # settings.py MY_APP_NAME_FOO = 42 MY_APP_NAME_ENABLE_CHUCK_NORRIZ_MODE = True Et donc depuis votre appli, vous pouvez récupérer les settings utilisateur de cette façon, en leur assignant une valeur par défaut s’ils ne sont pas déclarés : # apps/myapp/foo.py from django.conf import settings FOO = getattr(settings, 'MY_APP_NAME_FOO', 42) ENABLE_CHUCK_NORRIZ_MODE = getattr(settings, 'MY_APP_NAME_ENABLE_CHUCK_NORRIZ_MODE', False) Simple, pratique, suffisant me direz vous. Oui, mais bon, c’est un petit peu verbeux à mon sens, et pas toujours souple pour gérer un catalogue de settings ainsi que leur surcharge. Et puis j’ai l’impression en préfixant systématiquement ces noms de variables de faire insulte à cette merveilleuse fonctionnalité qu’on appelle la gestion des espaces de noms (voire de refaire du PHP < 5.3, ce qui provoque chez moi des bouffées d’angoisse et entame un processus de décapilation douloureux, mais je m’égare). Qui plus est, personnellement en temps que développeur, j’aurai tendance à préférer gérer les settings … -
Django Pattern for Reporting Errors/Messages in Views Part 2: Managers
In my last post, I discussed how you can use a simple UserMessage class in your views to report simple error messages. This way, you can keep track of errors and report them to the users in a clean fashion. One thing I didn't expand upon much is how to create some manager methods to cleanly lookup model instances and report any errors to the UserMessage class. I think this approach is a little nicer than catching exceptions all over the place, because you don't have to clutter your views with try/catch blocks.In the example below, we create a custom manager that looks up a model instance of "MyModel" with the given hash. If the selected instance of "MyModel" does not exist or if some other error occurs, it writes an error message to "message" instance passed into it. You can customize this as you see fit. For example, in the code below, I pass in a "user" instance that can be used to check permissions in this method. class MyModelManager(models.Manager): # In this case, we pass in a user, a unique hash for a # "MyModel" object instance, and an optional message. def get_mymodel(self, user, mymodel_hash, message=None): mymodel = [] … -
Git-based Django deployment
If you ever used Heroku (or any similar service), you may be jealous of their straightforward way to deploy new versions of applications. At least, I am. That's why I came up with a couple of hacks to mimic their git-based deployment workflow, but for my own Django applications, served by Gunicorn. The basic idea is: your application code is contained in a Git repository, and your production deployments are as simple as a git push. Note: because we will type commands on both the client and server side, server-side commands will start by a > and client-side commands by a $. All commands are executed by a regular user. Table of contents » Prepare your serverCreate your simple Django applicationThe deployment scriptTweak your production git repositoryUnleash the green unicornAdd your changes to the production repositoryGo further Prepare your server » First of all, let's prepare the ground by installing all the software we need on our production server (for the record, I used a Lucid Vagrant box): Now that we have the software, let's create the base structure for our production website. In my configuration, I'm in my home, which is /home/vagrant/. The var directory will contain the pidfile … -
The Buddha Website Nominated for Webby Award
I'm delighted to announce that the PBS companion website for The Buddha — a site that Caktus helped build using the Django web framework — has been nominated for a Webby Award in the Religion and Spirituality category! Online voting for the People’s Voice awards is now underway and we would appreciate you voting for the site ... -
Django & postgres & SSL
I’d thought something like this is a FAQ but the db docs on postgres don’t write a bit about forcing Django to connect using SSL to the database server. After lots of googling (and finding hundreds of guides how to set up a Django with HTTPS) and finding out by try-and-error, behold the solution: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'dbname', 'USER': 'dbuser', 'PASSWORD': 'dbpassword', 'HOST': 'dbhost', 'OPTIONS': { 'sslmode': 'require', }, }, } -
Read the Docs Update
It's been a while since I last talked about Read the Docs, and there has been a lot of activity. This is an update on the latest and greatest new features. PSF Funding The biggest news that has happened is that we have been given a grant from the Python Software Foundation to help host the site. Thanks PSF! They have blogged about it, and I am grateful that they have given us support. With the funds they have offered, we have been able to make Read the Docs a lot faster, and more robust. I will outline some of the changes below. This also means we won't be going away any time soon! New Theme We have a fancy new theme for documentation on Read the Docs! If you have the 'default' theme for your project, it will show up on the build of your docs on the site. I think it is pretty great, thanks to the designers who spent their time making it awesome. A really great feature is that the new theme is mobile ready. Go ahead and view a project using it on your phone, or make your browser smaller and you will see the … -
Configuration stuff
-
Configuration stuff
I’ve had several thoughts on configuration lately. I take no credit for any of them. There will never ever be a size that fits everything. Or even anything. Ini, XML, SQL, Python (for configuration) and “format-agnostic” APIs are all the same limited-if-mandatory things. Usage of a format which can’t be edited by humans directly (or almost directly, like a SQL database) is making a huge problem for users. Usage of a format which can’t be edited by programs directly is making a huge problem for users. If your program wants to be configured before usage, you need some kind of not mandatory interactive process of doing this.1 If your program wants to be configured before usage, and your interative process of configuration is mandatory, scary, slow, uses either only GUI or only CLI, can lead to odd results or break everything, this process is wrong. Config files are good. And if your program can just talk to user about what to put in there in his partical case, your program is lovely. So we need good libraries for talking with user about how he wants to configure stuff. And these libraries can’t even try to make assumptions about how developer … -
Giving back to the community.
As part of the most recent work I’ve been doing with the project I’ve been spending a lot of time digging around and getting familiar with Django’s HttpRequest, WSGIRequest and MultiPartParser objects. One of the new changes in Django 1.3 … Continue reading → -
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 …