Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Add your questions for the panels
Add your questions for the panels We have set up Google moderators for the scalability panel and core developers panel where you can add your own questions and vote on the questions that have already been added. -
DjangoZoom.com Review
This is part five in my series on django hosting services. Previously, I looked at ep.io, apphosted.com, gondor.io, dotcloud.com and now I'm looking at DjangoZoom.com. DjangoZoom.com is the brain child of Nate Aune and Shimon Rura and is based in Boston, Massachusetts. It was founded in 2010 at StartupWeekend Boston and was a finalist in the MassChallenge. Their office is in the Dogpatch Labs space for startups in Cambridge, Massachusetts. They are currently still in a closed beta, but they were nice enough to send me an invite to check it out. Normally when I check out a service for the first time, I look over the documentation to see what it can do, and what it can't do, and what I need to do in order to get my app up and running. DjangoZoom has a nice collection of documents that help guide you through the process of getting your application up and running on their platform. You need to be logged in, in order to read the documents, so I won't be able to link to any documents here, but if you are lucky enough to get an invite to DjangoZoom, I would check out the documents first, … -
Django-urlcrypt, après les contes c’est l’url de la crypte.
Voila, comme dit dans le billet précédent, je vais donc faire deux billets de django app de mai, ça m’apprendra à être en retard. Donc la deuxième django app du mois sera django-urlcrypt. Une petite précision avant d’aller plus loin, c’est une des toutes premières fois où je vais parler d’une app sans avoir fait plus que la tester sur un projet de test, sans avoir d’idée précise de où ni comment je vais l’utiliser ‘en vrai’. 1- Où on le trouve, comment on l’installe, tout ça quoi (et la doc) ? Alors on le trouve soit sur sa page pypi soit sur sa page github. Pour l’installation là encore, les trois moyens habituels : par easy_install pip un petit git clone des familles La doc, là c’est comme l’app précédente, elle est limitée au contenu de la page de pypi ou au fichier Readme.rst. Bon alors c’est vrai que la doc est suffisante pour comprendre comment l’app marche, mais sur une app qui est aussi ‘sensible’, une bonne lecture du code ne fait pas de mal (c’est d’ailleurs ce que j’ai fait quand j’ai commencé à faire joujou avec). 2- Mais au fait, à quoi ça sert ? En … -
Django-countries ,l’app garantie sans cowboy ni rodéo. djangoApp de mai 1 sur 2
Il va falloir que je me surveille .. parce qu’encore une fois je publie ma django app du mois un peu en retard. Pas grand chose, juste 4 jours.. Mais ça commence comme ça et après on finit par ne plus tenir de rythme du tout. Du coup, pour marquer, le coup, je publierais deux django app du mois de mai, même si je les publie en juin. Et pour commencer, django-countries. C’est d’ailleurs assez rigolo parce que je parlais il y a peu de moyen de gérer les pays, avec une liste de choix existantes, etc.. et op, je tombe sur django-countries. 1- Où on le trouve, comment on l’installe, tout ça quoi (et la doc) ? Vous trouverez django-countries soit sur sa page pypi soit sur sa page bitbucket. Pour l’installation, vous avez les trois moyens désormais classique : un easy_install un pip install un bon vieux hg clone La doc elle se limite à : la page pypi le readme du repository Sachant que dans les deux cas, le contenu est le même. Mais vu la simplicité de l’app, cela suffit amplement. 2- Mais au fait, à quoi ça sert ? L’app rajoute tout simplement un nouveau … -
Munin-like dashboard for Django websites
Django-utils has a pluggable dashboard app for building munin-like graphs. -
Wordpress to Django: Designing Compatible URLs in urls.py
As I mentioned in my previous post, there are a few fairly easy strategies for maintaining the stable URLs for your content when migrating from WordPress to a local Django driven blog. Django allows you a high level of control over URL formats so it's fairly simple to design them to be compatible with WordPress URLs. Additionally WordPress has been around long enough that the standard URL re-write formats follow suggested best practices for content, so bringing your Django URLs in alignment with that is not only useful for migrating content but good practice overall. That said the two most common formats for URLs in WordPress are: http://<domain>/<4 digit year>/<1 or 2 digit month/<1 or 2 digit day/<slug>/ so for example the URL for the previous post linked above is... http://www.flagonwiththedragon.com/2011/06/01/wordpress-to-django-strategies-dealing-with-WordPress-querystring-urls/ The next most common format for URLs is similar and differs mostly in how months are abbreviated: http://<domain>/4 digit year>/<3 char month>/<1 or 2 digit day>/<slug>/ So an example of the same URL above in this format would be... http://www.flagonwiththedragon.com/2011/jun/01/wordpress-to-django-strategies-dealing-with-WordPress-querystring-urls/ Designing urls.py in Django to accomodate this is simply: # URL format where month format is abbreviated character format. url(r'^(?P\d{4})/(?P\w{3})/(?P\d{1,2})/(?P[0-9A-Za-z-]+)/$', 'post_detail_alt'), url(r'^(?P\d{4})/(?P\w{3})/(?P\d{1,2})/$', 'post_day_alt'), url(r'^(?P\d{4})/(?P\w{3})/$', 'post_month_alt'), # URL format where … -
Getting prepaid mobile internet in NL
Getting prepaid mobile internet in NL UPDATE: when you register for the extra € 5 credit on My Vodafone, enter a (fake) Dutch address. One attendee was refused for registration when entering a foreign address, and was then refused for registration because his number was supposedly already registered. Coming to DjangoCon from abroad? Mobile roaming is usually expensive, so if you want to use internet on your phone, it’s best to get a Dutch prepaid SIM card. For € 7.50, you can get 1 GB data. Tethering is technically not allowed, but they probably don’t actively check for this. The only option with acceptable pricing are two different SIM types from Vodafone. Note: I have not tested these instructions myself. Use them at your own risk. This is all based on the Dutch Vodafone website. If you find any issues with them, please let me know :) What to buy Buy either one of these SIM cards: Vodafone Prepaid SIM only Meerwaarderen (€ 7.50). This includes € 10 credit but does not include any data. Not available in microsim. Vodafone Prepaid Smartphone Sim Only 1GB (€ 20). This includes € 10 credit and a 1 GB data package. Also available … -
Django "view-permissions" for related objects
You have a model A with a relation to another model B. In the Django admin, you have full permissions for model A and none for model B. However, if you create a new object for model A, you need to select a related object from model B. Tough luck: Permission denied! -
Allow squid/mod_wsgi to pass the HTTP_AUTHORIZATION header to Apache
-
Using Fabric to update a remote svn checkout with ssh public key authentication
-
Using mysql load data infile with django
-
Angelo Dini is a core developer
Angelo Dini is a core developer -
Using the Django-Pagination app in Django 1.3
Like many Djangonaughts I use django-pagination as my primary means to page results on lists pages and between the differences on the original Google project page(1.0.5 is the last downloadable version), what appears to be the same project migrated to GitHub and the PyPi (1.0.7 is the pip install version) site for the project, things can get confusing. I'm probably the only person confused by this but it appear that the GitHub site is the most up to date and it appears to be in sync with the pip install version. Life signs overall are dubious on the project though with no updates having come since early 2010 and several (what seem to be) reasonable pull requests sitting in the project queue. One gotcha I wanted to point out in the PyPI readme file is the directions for TEMPLATE_CONTEXT_PROCESSORS: According to the project documentation, in settings.py you should set: TEMPLATE_CONTEXT_PROCESSORS= ( "django.core.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.request" ) This can cause some problems in Django 1.3 however since the default TEMPLATE_CONTEXT_PROCESSORS have changed, in particular to support the new features for serving static media. So to include for pagination to work and to keep the default template context processors you should instead set: … -
Free bikes
Free bikes The City of Amsterdam is offering participants of DjangoCon a free bike for the duration of the conference. You can collect a voucher on monday during lunch. -
Test static resources in Django tests
At Mozilla we use jingo-minify to bundle static resources such as .js and .css files. It's not a perfect solution but it's got some great benefits. One of them is that you need to know exactly which static resources you need in a template and because things are bundled you don't need to care too much about what files it originally consisted of. For example "jquery-1.6.2.js" + "common.js" + "jquery.cookies.js" can become "bundles/core.js" A drawback of this is if you forget to compress and prepare all assets (using the compress_assets management command in jingo-minify) is that you break your site with missing static resources. So how to test for this?[367 more words] -
Test static resources in Django tests
At Mozilla we use jingo-minify to bundle static resources such as .js and .css files. It's not a perfect solution but it's got some great benefits. One of them is that you need to know exactly which static resources you need in a template and because things are bundled you don't need to care too much about what files it originally consisted of. For example "jquery-1.6.2.js" + "common.js" + "jquery.cookies.js" can become "bundles/core.js" A drawback of this is if you forget to compress and prepare all assets (using the compress_assets management command in jingo-minify) is that you break your site with missing static resources. So how to test for this?[367 more words] -
Test static resources in Django tests
At Mozilla we use jingo-minify to bundle static resources such as .js and .css files. It's not a perfect solution but it's got some great benefits. One of them is that you need to know exactly which static resources you need in a template and because things are bundled you don't need to care too much about what files it originally consisted of. For example "jquery-1.6.2.js" + "common.js" + "jquery.cookies.js" can become "bundles/core.js" A drawback of this is if you forget to compress and prepare all assets (using the compress_assets management command in jingo-minify) is that you break your site with missing static resources. So how to test for this?[367 more words] -
Test static resources in Django tests
At Mozilla we use jingo-minify to bundle static resources such as .js and .css files. It's not a perfect solution but it's got some great benefits. One of them is that you need to know exactly which static resources you need in a template and because things are bundled you don't need to care too much about what files it originally consisted of. For example "jquery-1.6.2.js" + "common.js" + "jquery.cookies.js" can become "bundles/core.js" A drawback of this is if you forget to compress and prepare all assets (using the compress_assets management command in jingo-minify) is that you break your site with missing static resources. So how to test for this?[367 more words] -
JavaScript Libraries Statistics
-
Django models ForeignKey and custom admin filters…
… or how to limit dynamic foreign key choices in both edit drop-down and admin filter. The problem: Having a foreign key between models in django is really simple. For example: Unfortunately in the real live the choices allowed for the connection are frequently limited by some application logic e.g. you may add answers only [...] -
Conference available on Guidebook
Conference available on Guidebook Guidebook is a mobile app for your iPhone or Android phone and can store information of any conference, such as the schedule, sponsor information and a map of the venues. You need to have an internet connection to download the conference information but once it’s downloaded, you can access it offline. Handy when you are from abroad! Grab it here and look for the DjangoCon Europe 2011 guide once it’s installed. -
Updates to the django-utils task queue
After several months of running the task queue bundled with django-utils, I decided to re-evaluate certain aspects of the design. This post describes those changes. -
Wordpress to Django: Strategies Dealing with Wordpress Querystring URLs
Stable URLs are the foundation of valuable information on the web. As Tim Berners-Lee eloquently described it "Cool URIs Don't Change" and I thought I'd address a few strategies and code I'm using in MetaRho for maintaining stable URLs for content migrating from Wordpress. Wordpress Querystring URLs By default Wordpress uses querystrings for accessing content, passing the internal ID number of the post through the 'p' attribute like so... http://<domain name>/index.php?p=<post id> So for example calling post id 1 on mydomain.com would look like. http://www.mydomain.com/index.php?p=1 Since best practice for Cool URIs and in Django is to use real URLs instead of Querystrings this presents a small problem. The easiest solution I found is to simply implement a decorator in Django that I put on the default index view to watch for incoming WordPress querystring URLs and query some extra field on the model for blog posts that holds the original WordPress ID number. Note I do NOT try to maintain ID numbers between posts as the better practice is to keep these opaque from the user. I use the common strategy of keeping a one to many Model related to my posts to contain key value pairs for extra data. In … -
Django comparison grid
Comparison grid django application allows creating comparison grids, attaching arbitary content types to grids and editing grid content through django admin interface. If there is something you would like to see, get in touch – or just fork it on GitHub, add the feature (with docs and tests, preferably!) and send me a pull request: https://github.com/bmihelac/django-comparison-grid And here are two screenshots. Admin interface: Example output: -
Django Class-based Views
Since the release of Django 1.3, developers can choose to use class-based views in their web apps. Since the announcement of class-based views, there has been said a lot about them. As with all changes, there are pros and cons, people who are excited and people who are disappointed. I, and I guess a lot of people with me, are excited by the class-based views, but disappointed by the documentation Django gives with them. Time to try to clear things up.What do I like about Django's class-based views?Well, to start with: consistency. It might sound a bit lame, but I think it's a great thing that, following models and forms, views are now also part of the class-based club. I somehow always thought it was weird to write your forms and models in a class, but your views in a function. This weird feeling is now gone. Lucky me.Secondly: consistency. Again? Yes, again, because you can now force your own code to be more consistent, by using subclassing. You can, for example, write your own superclass view template and let all your other views subclass it.And last: Subclassing. I found it hard to find an example to make my point, …