Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
EuroPython 2008, day 3
For me, the main theme for the third and last day of the conference was Django. Day started with a session by Honza Král about Django newforms admin, which gave me a pretty good idea what I have to do in preparing for the migration to the new admin interface. Later on the day I had many interesting discussions about varions Django-related things, including ideas about having something like Django release party here in Europe, too. Turns out there are quite a lot Djangonauts here in EuroPython, we just arent organized very well so most of us don’t know about each other. Lively after-conference discussions about career choises, Web Design and working with Django in general were definitely the high point of the conference so far. A couple of hour later on the evening, decisions about quiet evening at the Sky Bar (at the 22nd floor of the conference hotel) were forgotten and, again, we headed for the old town. This time we ended up in some night club and, well, yeah, we had a great time :) -
Introducing Django JumpToAdmin
Django JumpToAdmin displays links to admin change/delete/list pages when specified objects on a page are hovered over with the mouse. Once clicked, these links open the requested Django admin page in an iframe above the current page. Read on to see a screencast of the UI. -
Design decisions and highlights of Scripps' newest local news site
Earlier this week, the team at Scripps Interactive Newspaper Group launched a major newspaper website overhaul for the Evansville Courier & Press in Evansville, IN. This project has been brewing for almost a year, and has been a full-time responsibility for some of us for more than six months. Here are some of my favorite changes for readers -
Introducing CSS Prism, a CSS color inspector
After launching a new site at work in which colors from a previous site weren't replaced in the stylesheet, I decided to find a way to reveal all the colors used in any .css file. When I couldn't find a way, I made one. So today I'm launching CSS Prism, a CSS color spectrum inspector -
Django back on Dreamhost?
An email I received from Dreamhost indicated official support for running Django. After email correspondence with Dreamhost support, it's clear that Django is still not officially supported, but it should run better than it did before they made some recent changes. -
Hosting Subversion on Webfaction
Recent projects at work have finally led me to incorporate Subversion into my Django development workflow. Once I saw the light, I wanted to manage my personal and client projects with the same efficiency, but hesitated to sign up for SVN hosting services on my own dime. Turns out I could add SVN hosting to my existing WebFaction account. Here's how. -
The basics of creating a tumblelog with Django
On my new homepage, a combined list of my tweets, bookmarks, and user comments on my site appear underneath my latest blog entries. I use a fun bit of Django code to pull these various items together, sorted by publication date, and I'd like to share how this bit of tumblelog-like functionality works. -
Django SXSW Lunch Meetup
Hey all you Djabgo devs roaming the halls of SXSW: let's do lunch... -
Django development on OS X using a local media server
Host static media from outside of Django while developing locally. For some, this solution will be rather obvious. For anyone else, I hope this helps your workflow like it helped mine. -
Finding a Django-friendly host just got a little easier
Djangofriendly celebrated its first birthday in March. In its first year, more than 16,000 visitors came by to find and share knowledge on hosting Django applications with various hosts. To celebrate Djangofriendly's birthday, I've gone into a bit of a code sprint, the first phase of which concluded this morning as the new code went live... -
The basics of creating a tumblelog with Django (part 2)
Since posting "The basics of creating a tumblelog with Django," I've received some requests to explain how to get these tumblelog items to actually show up on my homepage. -
Posting to the Twitter API on an admin change
Posting to the Twitter API on an admin change -
Image resizing on file uploads. Doing it the easy way.
Image resizing on file uploads. Doing it the easy way. -
Working with the Django admin and legacy databases, pt.2
Working with the Django admin and legacy databases, pt.2 -
Working with the Django admin and legacy databases, pt.1
Working with the Django admin and legacy databases, pt.1 -
Working with the Django admin and legacy databases, pt.3
Working with the Django admin and legacy databases, pt.3 -
nabuco - Nomadblue Blog - First post
A whole weekend doing some fun coding has produced this brand new kid on the blogosphere. Soon I will write my first "real" post, in the meantime I can't wait to leave the URL to django-nomadblog, the django app that I built to run this weblog: http://bitbucket.org/nabucosound/django-nomadblog You will need Mercurial to clone it out. Hasta pronto! -
nabuco - Nomadblue Blog - django-nomadblog
Updated 13 Sep 2009: The current project page for django-nomadblog can be found here Here it is, the initial documentation for my first django app release, django-nomadblog. Overview This is a basic Django application implementing the most simplest form of a blog (from my point of view, of course). It has been written with an eye on keeping modularity as far as possible, so you won't find lots of goodies in the code, but just a couple of features to help you start hacking. Features A mechanism to tell the application if there's gonna be only one blog or multiple blogs and users, easily configurable via a project setting and a URL pattern. Views are split into two functions, one for the view logic and the other in charge of creating or updating the RequestContext. This enables calling the logic behind a view without rendering the response. It is better explained below. Installation Soon I'll package the whole thing and upload it to PyPi for the sake of standard installations. Mercurial checkout Install Mercurial if you don't have it yet, and clone the repository: hg clone http://bitbucket.org/nabucosound/django-nomadblog/ Symlink to the folder called nomadblog inside django-nomadblog from somewhere in your PYTHONPATH … -
nabuco - Nomadblue Blog - Context in django views, DRY, reusable apps
DRY (Don't repeat yourself) is always a good coding practice I try to follow, at least whenever deadlines allow me to do so. Even for a bunch of code bits, it helps keeping clean and modular. Talking about views, I find myself using different techniques and approaches to write a single function that centralizes all the logic and, at the same time, behave differently, depending on who is calling it. Sometimes it is good to overload the number of arguments it receives, and use them as indicators and flags to switch to the desired behavior. A simple example, widely used in lots of Django apps and projects, is to pass a template variable from the kwargs positional argument in a URLconf: url( regex=r'^$', view='list_posts', name='list_posts', kwargs={'template': 'yourtemplatepath/templates/yourtemplate.html'}, ) In your view, you receive the parameter and render either the template value passed with the 'template' parameter, or the default template otherwise: def your_view(request, template='templates/default.html'): ... return render_to_response(template, {}, context_instance=RequestContext(request)) If you want to add functionality to certain cases, instead of modifying the base view, you better create a wrapper function, which will be called before, adding all the stuff you need to execute before or after. For instance, another trivial … -
django CMS 2.1 final was just released!
django CMS 2.1 final was just released! -
nabuco - Nomadblue Blog - Tweaking URLconf (2 named URLs, 1 view)
Introduction Update: I realized I didn't fully explained the whole picture of the issue I am describing here, so I have added a few lines more in the introduction section. In a project with an application named concerts that lists concerts from european cities, consider a classic two-level URLconf where the root urls.py module "includes" (i.e. uses the include method from django.conf.urls.defaults) a second URLconf module. urls.py from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^concerts/', include('concerts.urls')) ) concerts/urls.py from django.conf.urls.defaults import * urlpatterns = patterns('concerts.views', url(regex=r'^list/$', view='my_view', name='concerts_list_all') ) Let's say you want to extend the URLconf and have two kinds of URL to call the same view, the first to display all concerts, the second for concerts in a given city: /concerts/list/ /barcelona/concerts/list/ /london/concerts/list/ /paris/concerts/list/ There are two situations we want to overcome in this scenario. First, only one view must be used, so a little bit of business logic must be implemented. The function behaves differently if it receives the location keyword argument or not: concerts/views.py def my_view(request, location=None): if location is not None: # filter concerts QuerySet by location, for example else: # query all concerts return render_to_response('base.html', {'location': location}, context_instance=RequestContext(request)) The second one is the one … -
django-rbac
I just released my first version of a Role-Based Access Control system for permissions in Django. Development code can be found in BitBucket: http://bitbucket.org/nabucosound/django-rbac/ The project's page is here First of all, I would like to show some drawbacks of Django's current permission system: Permissions are tied directly to the User model from django.contrib.auth, so you cannot use any other existing model in your application. The task of mantaining this list of permissions in the current Django system is responsibility of a superuser or some other kind of centralized entity. You can certainly assign permissions to Group model instances, but all users in this group will share the same permissions. Last, but not least, until Django v1.2 will come and ticket #11010 implemented, the permission system is model-level -- it doesn't allow granular permissions (row-level), which means you can give a user authorization to do something based on all instances of a model class, but not to a single model instance (an object). Many applications, and specially today's web applications -- which involve concepts as collaboration or content driven by the users -- need the flexibility to support delegation of permission granting to objects by other trusted agents. A clear … -
Template tags in django-rbac
It's been a month since the initial release of django-rbac and so far it turned out to be pretty useful for many people. I am therefore happy to have contributed another grain of sand to the open source Django community beach. In Django, as in any MVC oriented framework, developers have to choose which side to put the logic on: a model method or function, inside a view or in a template tag. Although many recommend putting as little logic as possible in template tags, I know sometimes it is good to have one at hand to keep a healthy equilibrium, otherwise views can grow up fat or methods can spread like lemmings in your models and managers. I have recently added two template tags to django-rbac, to request for permission at model or object_level (RBACGenericPermission or RBACPermission, respectively). For example, a template rendering a profile page for a user can decide whether or not to show some personal information at rendering time, using the if_rbac_permission tag: {% if_rbac_permission owner model_inst operation roles %} <p>Pau Casals, 45 years old, male</p> {% else %} <p>You cannot view this information</p> {% endif_rbac_permission %} I updated the app documentation, there you can find … -
Dan Carroll | Blog | Setting up a cron job to run a Django management command in a Python virtualenv
-
django-nbskel
Well it was time already to give some more code into the public domain and the community, so I decided to release my personal way of starting new django projects. I call it django-nbskel ("nb" for nomadblue and "skel" for skeleton). Development code can be found, along with my other apps, in Bitbucket: http://bitbucket.org/nabucosound/django-nbskel/ The project page is here. The purpose if this application is to contain a basic django project and help you out configure it to speed up the process of starting up a new development, be it a quick hack or a long project. I often need to produce new django projects and I don't enjoy doing repetitive things. They start basically with the same structure so with this app I can wrap all the first steps into a couple of actions. It also makes me feel secure because I always tend to forget to initialize settings, include files, import modules, and so on, so with django-nbskel I am sure I am beginning to develop upon a tested and stable code. Please be warned this is code that automates stuff for me, so you will be probably modifying it to fit your django configuration, tools, and deployment …