Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Tempate Tag for Gravatar Images
Gravatar images seem to be growing in popularity across a number of sites and the services already makes it incredibly simple to grab a profile picture there via URL. The Gravatar site itself has a number of examples on how to grab an image off of the service, as well as more detailed examples of grabbing more information. They do provide a examples for grabbing an image via Python and even a Django example which renders the image as a template note. For displays like this I generally prefer an inclusion tag since I can render the image in a template rather than having to build it each time on my own. The template tag itself is just: from django import template import urllib, hashlib from yourapp import settings # Provide Default settings so users only need to provide them in settings.py if they want to override. GRAVATAR_BASEURL = getattr(settings, "GRAVATAR_BASEURL", "http://www.gravatar.com/avatar/") GRAVATAR_DEFAULT_IMAGE = getattr(settings, "GRAVATAR_DEFAULT_IMAGE", "") GRAVATAR_SIZE = getattr(settings, "GRAVATAR_SIZE", 40) register = template.Library() def gravatar_url(email, size): """ Builds a Gravatar Image URL based on the provided email. :param email: Email address to query for a gravatar image. :param size: Size to request and render the image in pixels. """ attrs … -
Dynamic fields inside a form do not get posted
I was struggling for a bit today with dynamically creating form fields using Jquery. Whenever I was posting the form the dynamic fields were not being sent over to my Django view. After some hair pulling (and scratching!) the answer came from moving the form field inside of the table to outside of the table. -
Djangopeople.me
What is it? At it's core, djangopeople.me is a place for Django developers to register and be found based on their geographic location, whether it's by recruiters or a lonely Django developer like ourselves trying to find others close to him/her. That's the general idea behind the site. We wanted to make it clean, simple and fast. For the maps we ended up using Leaflet's open-source Javascript library. We initially started with Google Maps, but the rate limiting was too restrictive on the geocoding API for our needs and frankly, loading maps seemed very slow. So, with the project being free-to-use (and us being cheap), we looked for something else. Yahoo! Maps was the next step as they had a decent API and allowed more requests. Google currently allows 2,500 requests per day and Yahoo allows 5,000 requests (geocoding). Yahoo's maps were faster to load but we seemed to have nothing but issues with Google Chome throwing a YMAP Javascript error we could never track down. We didn't think it would be all that awesome telling Chrome users to clear their cache up to three times before the maps would load again (If you've had this issue and a have … -
Oportunidades de trabalho na Gonow
Estou desde o começo deste ano na Gonow Tecnologia, uma empresa relativamente nova, mas em fase de crescimento bastante acelerado. Com escritórios em São Paulo (localizado na Vila Olímpia) e em Santiago, Chile, a Gonow conta com um time de aproximadamente 100 profissionais, muitos participam ativamente de projetos em software livre e eventos — e são incentivados a fazer isso — o que faz parte da cultura da empresa. A empresa possui um ótimo ambiente de trabalho, onde a produtividade, troca de conhecimento, crescimento profissional e descontração são itens que fazem parte do cotidiano dos gonowers. O escritório permite um horário bem flexível de trabalho, desde que o profissional se comprometa a cumprir suas metas com qualidade e dentro dos cronogramas propostos. O ambiente é bastante inspirador, você pode trabalhar à vontade (de bermuda e chinelo, por exemplo), possui máquina de café espresso, diversas guloseimas, refrigerantes, sucos e salgadinhos — tudo pago pela empresa — além de um Wii com diversos jogos onde várias competições acontecem com frequência. Em troca desse ambiente único e inspirador, a Gonow espera um profissional motivado, comprometido, que tenha paixão pelo seu trabalho. Estou com a difícil missão de trazer profissionais realmente bons para ampliar … -
Django query on model instance's class
I have an abstract base class that is used by various other models. The problem is that I need the same method that runs a query on all instances of those models, and that the manager isn't accessible via model instances. This is the code I ended up using. def get_related(self, foo): return self.__class__.objects.filter(bar=foo) # This is the real code #def get_translation(self, language): # return self.__class__.objects.public(language=language).filter(group_id=self. group_id) -
Django query on model instance's class
I have an abstract base class that is used by various other models. The problem is that I need the same method that runs a query on all instances of those models, and that the manager isn't accessible via model instances. This is the code I ended up using. def get_related(self, foo): return self.__class__.objects.filter(bar=foo) # This is the real code #def get_translation(self, language): # return self.__class__.objects.public(language=language).filter(group_id=self. group_id) -
Django query on model instance's class
I have an abstract base class that is used by various other models. The problem is that I need the same method that runs a query on all instances of those models, and that the manager isn't accessible via model instances. This is the code I ended up using. Raw def get_related(self, foo): return self.__class__.objects.filter(bar=foo) # This is the real code #def get_translation(self, language): # return self.__class__.objects.public(language=language).filter(group_id=self. group_id) -
Django query on model instance's class
I have an abstract base class that is used by various other models. The problem is that I need the same method that runs a query on all instances of those models, and that the manager isn't accessible via model instances. This is the code I ended up using. Raw def get_related(self, foo): return self.__class__.objects.filter(bar=foo) # This is the real code #def get_translation(self, language): # return self.__class__.objects.public(language=language).filter(group_id=self. group_id) -
Django Class Based Generic API
It has been a pretty rainy weekend so I’ve decided to do some Python programming and have come up with a set of tools to help build API’s in django. I know there are a few libraries already available for building API’s in django (I’ve used and contributed to some of them) but since django [...] -
Django Class Based Generic API
It has been a pretty rainy weekend so I’ve decided to do some Python programming and have come up with a set of tools to help build API’s in django. I know there are a few libraries already available for building API’s in django (I’ve used and contributed to some of them) but since django 1.3 was released with the class based generic views then a lot of the functionality needed to create API’s is already in the framework. So I decided to just build a few extra things to make API’s easy in django by using the framework for most of the heavy lifting. I’ve made the code available on GitHub. Here are the features in a nut shell; A new generic class view called APIView which provides a mini framework for supporting different data formats for an API and providing some common API responses. A throttling decorator to limit API calls per user. Support for base64 http authentication. I’ve put basic support in for JSON requests and responses. The code acts as a good basis for a complete API in django and allows an easy way to extend it for new data formats. It makes good use of … -
Hollywood Hackathon on June 18th!
Alas, that isn't the formal name of the event, but I'm calling it that anyway. That name just rolls off the tongue, and just seems to embody my East Coast style distorted vision of the Los Angeles Python community.Anyway, this is a day long event in Hollywood for Python developers of all skill levels to come and code like fiends with either really smart people or nice people like me. The PyLadies and SoCal Piggies are organizing this event, and they even got some PSF funding for things like tables, chairs, and t-shirts.Which reminds me, please encourage the smart women of all ages in your life to attend! We'll have mentors just for them!I'll be there to:Help out as a general volunteer by setting up tables, manning registration, and answering questions.Assist a few friends on their open source projects.Work on the new Python LA website (powered by Pyramid).Finish the documentation of django-uni-form 0.8.0 if it isn't yet done.Maybe close some Packaginator tickets and pull requests.And now to open the floor to questions...I'm just starting with Python, should I come?Heck yeah! Hackathons (and sprints) are a great way to learn new skills or hone your technique by sitting alongside experienced developers who actually … -
DjangoCon Europe 2011 is now over
DjangoCon Europe 2011 is now over We all had a great time learning new things from or co-Djangonauts and we managed to get a lot of work done on Django itself, in our castle. Now it is time to relax and get some sleep. We’ll be putting the conference videos and presentations online soon. -
Django-simpleadmindoc updated
I just published major rework of Simpleadmindoc to github with a lot of changes to make writing documentation easier. Django-simpleadmindoc is a tool that helps creating documentation for editors and administrators of django based website. Simpleadmindoc is based on and produces documents for Sphinx. Main features: autodocumenting models, referencing models and fields inside documentation fast creating of skeleton documentation If there is something you would like to see, get in touch, code is on GitHub: https://github.com/bmihelac/django-simpleadmindoc -
DjangoCon Europe 2011 Slides
I gave a talk at the wonderful DjangoCon EU again this year, and the slides are now up.You can download them from http://www.aeracode.org/static/slides/dceu-2011.pdf. Hopefully, the video will be up soon. -
Documentation-driven development is the future of Django
Or is it? Don't start this conversation when you're with the wrong crowd of animals. You could get yourself into a lot of trouble. Permalink | Leave a comment » -
Teach your team some Git! Experiences of a team lead who cares.
Teaching yourself using Git is a long process, full of obstacles - just as teaching yourself anything else more complex than cooking pancakes. But it’s not enough to use Git at home, hacking some console applications for a couple of GitHub stalkers - you should use some great version-control system at your workplace. Our dev team moved to Git not so long time ago, and it was quite a difficult move. -
Sprint introduction and closing (djangocon.eu)
-
Whither Django? - Russell Keith-Magee (djangocon.eu)
-
Scalability panel (djangocon.eu)
-
Internet connectivity at the sprints
Internet connectivity at the sprints At the sprints, wifi connectivity will be available, but only using 802.11a and 802.11n in 5 GHz-only mode. MacBooks have supported this for ages, and it’s a common feature on recent laptops of other brands as well. All model iPads support it too. Some devices, like the iPhone, only support 802.11n in 2.4 GHz mode, so they will not be able to connect. If you have a laptop that does not support 802.11a or 802.11n 5 GHz, a wired network will be available. However, depending on the amount of attendees who need/want a wired network, we may end up short on patch cables. So, if you happen to have a patch cable, please bring it to the sprints. Thanks for helping out! -
Taming runtime dynamic models in django - Will Hardy (djangocon.eu)
-
Please fill out our survey
We worked hard to make the conference as enjoyable and educational as possible, however we are humans, even Remco is, and we make mistakes. This is where you come in; to make sure we learn from our mistakes and also to make sure any future DjangoCons don’t make the same please fill out this survey. -
Deploying at an unusual scale - Andrew Godwin (djangocon.eu)
-
Django on rails: getting resourceful - Zachary Voase (djangocon.eu)
-
The best and worst of django core - Alex Gaynor (djangocon.eu)