Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
LittleBrownieBakers.com Launches
Little Brownie Bakers are the bakers that make Girl Scout Cookies. They required a custom CMS where they could enter info about cookies, post selling tips for parents, kids and volunteers; and generally update the world on the latest cookie news. And now they have it... The site was created in Python by myself and the team at Blenderbox using Django 1.3, South .7, Haystack (with Whoosh), django-page-cms, django-paging and django-tagging among others. This was also the first project we used django-grappelli on and it worked quite well. We'll probably use it for future projects. -
Easy Django on Windows with CherryPy
A while back I had the pleasure of integrating a Django project with a SharePoint site on IIS. I'll say this: It works. Getting isapi-wsgi working with all the crazy application pool permissions, as well as other issues, was a royal pain. I also had to switch to a standalone MySQL instance instead of SQL Server because django-mssql was causing all kinds of problems. It was also practically impossible to replicate the environment for local development. I had a trial Windows Server VM set up but would constantly run into issues in production that I hadn't seen in development (mostly related to permissions). So, the next time I had the pleasure of working with a Windows server, I decided to bypass IIS completely and instead use CherryPy. I should note that this was for a small internal business application. There are several packages out there that do this, including one I made a while back for development. The problem is that they were mostly intended to run on *nix or in development and none of them handle static media (except mine, but it's outdated and doesn't work with contrib.staticfiles). So I decided to steal the best parts of my previous … -
Mapping better – Google Maps API v3
I tend to do my Google v3 work purely in my templates. For this example I’ve got a view that will return the objects to be displayed in `object_list` in the context – same dataset as last time, only instead … Continue reading → -
Easy Django on Windows with CherryPy
A while back I had the pleasure of integrating a Django project with a SharePoint site on IIS. I’ll say this: It works. Getting isapi-wsgi working with all the crazy application pool permissions, as well as other issues, was a royal pain. I also had to switch to a standalone MySQL instance instead of SQL Server because django-mssql was causing all kinds of problems. It was also practically impossible to replicate the environment for local development. I had a trial Windows Server VM set up but would constantly run into issues in production that I hadn’t seen in development (mostly related to permissions). So, the next time I had the pleasure of working with a Windows server, I decided to bypass IIS completely and instead use CherryPy. I should note that this was for a small internal business application. There are several packages out there that do this, including one I made a while back for development. The problem is that they were mostly intended to run on *nix or in development and none of them handle static media (except mine, but it’s outdated and doesn’t work with contrib.staticfiles). So I decided to steal the best parts of my previous … -
Django in Production: Part 1 - The Stack
Everyone has their preferred way of doing things, and this is more and more true when there are many options available. In the Django world, this translates to everyone having their favourite web server, database, proxy, and so on. In spite of this, I'm going to spend some time over the next few posts describing how I deploy Django applications in production from a high-level perspective. In the first part of this series, I'll talk about the core stack which serves as the basis of the application. Gunicorn Python-based web applications have traditionally been run under Apache, using a module such as mod_python or mod_wsgi. Apache, however, can be somewhat of a resource-hog, particularly on virtual servers which often have limited memory. Also, as I'll discuss in detail later in this series, deploying code frequently to an Apache-hosted application can be troublesome. A new solution is in order. There is quite a choice of Python-based web servers for us "cool kids" to use, many of which are tested in this detailed (if a little old) benchmark by Nicholas Piël. Gunicorn offer super simple configuration, an extremely small footprint, and it's pure Python - so you can install it with a … -
Why You Need a Git Pre-Commit Hook and Why Most Are Wrong
A pre-commit hook is a piece of code that runs before every commit and determines whether or not the commit should be accepted. Think of it as the gatekeeper to your codebase. Want to ensure you didn’t accidentally leave any PDBs in your code? Pre-commit hook. Want to make sure your javascript is JSHint approved? Pre-commit hook. Want to guarantee clean, readable PEP8-compliant code? Pre-commit hook. Want to pipe all of the comments in your codebase through Strunk & White? Please don’t. The pre-commit hook is just an executable file that runs before every commit. If it exits with zero status, the commit is accepted. If it exits with a non-zero status, the commit is rejected. (Note: A pre-commit hook can be bypassed by passing the --no-verify argument.) Along with the pre-commit hook there are numerous other git hooks that are available: post-commit, post-merge, pre-receive, and others that can be found here. Why Most Pre-Commit Hooks are Wrong Be wary of the above’s example as the majority of pre-commit hooks you’ll see on the web are wrong. Most test against whatever files are currently on disk, not what is in the staging area (the files actually being committed). We avoid … -
On the Map
So far we’ve done all kinds of wearying and information – but never left a Python console. I suppose it’s time we fall into the web mapping world and look at our options. On the left of the easy-to-hard scale … Continue reading → -
Pony rider in the skyyyy… c’est le retour des djangocong YeeHa !!
Je vous préviens, tout de suite, j’aurais pu céder à la facilité et parsemer mon billet d’annonce d’image de petit poney rose, pour coller aux thèmes du poney, de django, de l’amour platonique qui anime tout ceux qui font du django ( #sharethelove nan ?? ha non pardon c’est pas la bonne conférence). Mais non, je ne vais pas me laisser aller à cela. C’est dit. Donc, pour la troisième année les Djangocongs ont lieu, à nouveau dans le sud. Mais cette année ce ne sera pas à Marseille (après tout il faut bien vous faire découvrir de nouvelles villes) mais à Montpellier pendant le week end du 14-15 avril. Du coup, le staff s’élargit et accueille : des locaux (nico et stéphane pour ne pas les nommer), véritables supermens de l’organisation, qui avec l’agilité qui les caractérisent s’occupent de tout et du reste. (Enfin c’est tout de même moi qui continue à faire les factures que les gentils sponsors vont recevoir, des sousssssss) pleins de bonnes volontés, qui ont décidés que pour la troisième, il était temps de montrer qu’eux aussi avait des biscottos sous le tee-shirt geek et ont très gentiment proposés leur aide. Un staff élargi … -
Latest Work and New Client Availability
A quick update about our latest projects and current availability. -
Code Month: Mid-Point
So, upon working on Code Month, I've realized some things I don't have in my toolkit that would have made things much, much easier. Fab scripts I already had a fab script to set up my server, which was awesome. Within a few minutes I had a patched Ubuntu server ... -
Faking it: Geospatial search without the prereqs or infrastructure
First, a public service announcement: tomorrow, Nov. 16th, is “GIS Day” which means universities all over will be holding day lectures, in most cases for free. Many of them will be over our heads since we’re but neogeographers, but inspiration can … Continue reading → -
Satchmo installation
Been playing with Satchmo today. One issue I ran into, is I installed the Trunk version of Django, which Satchmo apparently isn’t compatible with; it apparently expects Django 1.3. The easiest way to get started with a very fresh install of Satchmo is to go through the following steps. Setup and activate virtual environment: ~/projects$ virtualenv test ~/projects$ cd test ~/projects/test$ source bin/activate Make sure you have PIL installed: sudo apt-get install python-imaging Install Satchmo: ~/projects/test$ hg clone https://chris1610@bitbucket.org/chris1610/satchmo ~/projects/test$ cd satchmo ~/projects/test/satchmo$ python setup.py install Install all the other requirements: ~/projects/test/satchmo$ pip install -r scripts/requirements.txt Setup sample store /projects/test$ python source/satchmo/scripts/clonesatchmo.py /projects/test$ cd store /projects/test/store$ python manage.py runserver Then just shoot your browser to: http://localhost:8000 -
Django Suite I: Iniciar con Django.
Esta es una parte de una serie de post semanales que estaré dedicando a distintos temas de Django. El titulo Django Suitees un pequeño juego de palabras ya que el nombre del framework fue inspirado por el gran guitarrista de jazz Django Reinhardt y suite que se define como un tipo de pieza musical compuesta por varios movimientos breves. Para el primer movimiento empezaré con lo básico el inicio,no voy a realizar un tutorial de como iniciar en Django por que hay muchos ya en internet que son útiles pero debido a que muchas personas me preguntan cual es la mejor manera de iniciar con Django hago este post para guiarlos un poco sobre lo que las guías dan por hecho pero que nos pueden hacer perder algo de tiempo buscando por ahí. Sinceramente no hay bala de plata para lograr cabalgar al pony sino por que el proceso de aprendizaje varía de quien en quien, lo que si puedo decir es que Django es uno de los proyectos mejor documentadosque existen, casi todo el framework menos algunas funciones internas muy poco usadas están descritas en https://docs.djangoproject.com/ en la dirección anterior puedes navegar fácilmente todos los temas. La documentación es … -
Django Suite I: Iniciar con Django.
Esta es una parte de una serie de post semanales que estaré dedicando a distintos temas de Django. El titulo Django Suite es un pequeño juego de palabras ya que el nombre del framework fue inspirado por el gran guitarrista … Continue reading → -
Gunicorn --preload helps with non-pure-python libraries
-
Where is my user? Part 2, Browser Geolocation
As we saw last week GeoIP can be pretty inaccurate for mobile users – the exact audience we may be trying hardest to serve with a geographically aware website. But the W3C saw, or was made to see, the writing … Continue reading → -
Django CMS, Haystack, and Custom Plugins
When you need a full-text search for Django-CMS-based website, you can use Haystack and django-cms-search. The latter module ensures that all CMS Pages get indexed. One important thing to mention is that if you use any custom Plugins, search_fields need to be defined for them, so that the Pages using them are indexed properly. For example, here is an Overview plugin which makes its title and description searchable: from django.db import models from django.utils.translation import ugettext_lazy as _ from cms.models import CMSPlugin class Overview(CMSPlugin): title = models.CharField(_('Title'), max_length=200) description = models.TextField(_('Description')) url = models.URLField(_('url'), max_length=200, blank=True) search_fields = ("title", "description") def __unicode__(self): return self.title For more information check the documentation online: Haystack Django CMS django-cms-search -
Where is my user? Part 1, GeoIP
There are a a few techniques we can use to make our apps more “magical” for our end users – showing them things that we have reason to believe may be spatially relevant to them. The most reliable but least … Continue reading → -
Scaling Schema Changes
I frequently get asked how Disqus deals with schema changes. It’s a fair question, since we operate a fairly large amount of servers, but I also tend to think the answer is somewhat obvious. So let’s start with the problem of schema changes at scale (in PostgreSQL). Generally you have … -
Radius limited searching with the ORM | Neogeo ramblings with a Python twist
Radius limited searching with the ORM | Neogeo ramblings with a Python twist. Wenn ich mir das so angucke, da sind schon wirklich nette Features in GeoDjango drin. Leider habe ich derzeit kein Projekt bei dem ich es gebrauchen könnte, also nur mal für später geblogmarkt. Auf dem Blog gibts auch weitere interessante Artikel rund um GeoDjango. -
Radius limited searching with the ORM
A handy abstraction inside GeoDjango is the D object. It converts from more units than you knew existed into other units. (complete list) We’ll be using it quite a bit as we do various queries. >>> from django.contrib.gis.measure import D … Continue reading → -
How Yipit Deploys Django
If you’re managing your own servers, and you don’t use a tool like Chef, you’re crazy. It’s just that simple. We’ve been using Chef here at Yipit for about 6 months, and when I think about provisioning a new server with our old load book, I cringe. There were some pretty high upfront costs to learning Chef, especially since no one here had any real Ruby experience (Chef is written in Ruby), but the time we invested into getting set up with Chef has been 100% worth it. I’m hoping this post will help people get up and running with Django and Chef as quickly as possible. Opscode has their own django-quick-start repository, but I think it’s too complex if you’re not familiar with Chef. This tutorial will cover: Getting set up with Opscode, a hosted chef-server Installing Ruby, Chef, and some knife plugins Setting up your chef-repo and installing a Django/github quickstart cookbook Using a Python script to deploy to ec2 If you don’t understand what any of those things mean, Opscode maintains a pretty good wiki. Before We Start This tutorial makes the following assumptions about your systems: Locally, you run a Mac. Remotely, you want to use … -
Coming to DC?
Coming to DC? -
Finding the nearest with the ORM
We have data, we know how to take what our user is providing us, it’s time to stitch the two together and find things nearby. The easiest option is to simply let the database order them. >>> from django.contrib.gis.geos import … Continue reading → -
Stack Overflow a boon to stuck developers
Developing web applications is a little like learning how to ollie a skateboard. You try, and try, and try. Then you try again. And then something clicks. You land the trick. But you don't understand why. This has been my experience writing code. I know what I want to do, and through brute force I hammer away at a solution until something works. But why does it work? That's where Stack Overflow and it's wonderful community comes in. Let me be clear: I'm no computer scientist. I have a diverse background that includes public relations and journalism in addition to web development. But I know HTML, CSS and JavaScript very well. This trifecta led me into higher-level development languages like Python, and the wonderful framework Django a few years ago. Perhaps it's my tenacious journalist attitude that keeps my head beating against the wall in an attempt to solve problems. Whatever it is, I'm thankful there exists helpful communities on the web. Stack Overflow is a question and answer website where developers of any language can pose a mud-pit scenario from which they can't seem to escape. If the question is well-crafted, and tagged appropriately, answers glom like flies on …