Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Configuring application settings for a Django project
Configuring application settings for a Django project -
Release 0.6.5
We just released LFS 0.6.5. This is a yet another bugfix release. Changes Bugfix: added csrftoken for rating mails (Maciej Wisniowski) Bugfix: fixed ImageWithThumbsField (Maciej Wisniowski) Updated romanian translations (olimpiu) Updated polish translations (Maciej Wisniowski) News: We have setup a GitHub mirror of LFS. The docs are running on our own domain now (still hosted on RTD) and have a new layout: http://docs.getlfs.com/ Information You can find more information and help on following locations: Documentation on PyPI Demo Releases on PyPI Source code on bitbucket.org and github. Google Group lfsproject on Twitter IRC -
HTTP Status Codes Site
During the development of Simple Site Checker I realised that it would be useful for test purposes if there is a website returning all possible HTTP status codes. Thanks to Google App Engine and webapp2 framework building such website was a piece of cake. The site can be found at http://httpstatuscodes.appspot.com. The home page provides [...] -
Modular django settings
A recurring feature of [#django][#django] is that someone asks about `settings.py`, and using a `local_settings.py` file. The standard advice is to have the following in your `settings.py`: {% highlight python %} # More settings are above here. try: from local_settings import * except ImportError: pass {% endhighlight %} This is usually the last (or one of the last) things in the file. This can be used to override settings with sane values for the local environment. However, this means that `local_settings.py` must be not in your source control system, or must not be deployed to other servers. I like keeping everything in my source control system of choice (mercurial), and currently use an hg-based deployment. In my `fabfile.py`, instead of archiving up the current structure, I use `hg` to push the main repo, and any sub-repos, and update them to the version that is displayed locally. This means I want to be able to control the content of production's `local_settings.py` equivalent. The other issue, and this was the one that came up today and gave me the idea of this post, is that someone wanted to add an app to `settings.INSTALLED_APPS` but only locally. I too have done this (still … -
Facebook open graph publishing simplified
Facebook has just enabled the open graph for 60 lucky apps. The new open graph beta allows you to post a user’s actions to their timeline. This activity is shown to the user’s friends in Facebook’s newsfeed and ticker. Furthermore your data is nicely aggregated on a user’s Facebook profile. Fashiolista’s aggregation for instance looks like this: Posting these actions on Facebook can greatly enhance the viral growth of your company. Spotify, one of the launch partners, has grown by more than 4mil active users. This blogpost explains how to use Django Facebook to integrate your Django based site with Facebook. How open graph works Before going into the code though we need to understand the basic concepts of the open graph: actions and objects. Facebook’s getting started interface explains it best: Actions are the verb, objects are what the action is applied to. You submit the data for these actions and objects to Facebook. An example would be watching (action) the movie Pan’s Labyrinth (object). Every object should be represented by a dedicated URL. For instance if you look at Chiara’s profile (object) on Fashiolista you will see the following open graph data: <meta property="og:title" content="ChiaraFerragni" /> <meta property="og:image" … -
django-cms 2.0.2 and Django 1.2 – 1.3
If you are running an old version of django-cms, you can still upgrade Django. I would strongly suggest doing this since it’s very uncomplicated. However, if you are running django-cms 2.0, you should first upgrade to 2.0.2 and run the South migrations, which is also totally uncomplicated. django-cms 1.x are most likely stuck on older versions of Django as well. I did once try to get them running on new Django versions but gave up. Basically this guide just fixes a little bug in admin/pageadmin.py and a few issues regarding a missing csrf_token in the templates. It also means that django-cms 2.0.2 becomes SSL compatible. This is not backwards-compatible, however, so if you apply this stuff, your django-cms will no longer work with Django 1.1. After upgrading to django 1.3.1 (also tested on 1.2.X btw), you need to make the following corrections manually in your django-cms installation. 1) Edit cms/admin/pageadmin.py, line 59 to say: exclude = [] 2) Edit cms/templates/admin/cms/page/plugin_change_form.html, line 77, by adding the csrf_token tag: <form id="{{ opts.module_name }}_form" action="{{ form_url }}" method="post" enctype="multipart/form-data">{% block form_top %}{% endblock %} {% csrf_token %} 2.1) Do the same in cms/templates/admin/cms/page/change_form.html, line 99: <form id="page_form" action="?language={{ language }}{%if request.GET.target %}&amp;target={{ request.GET.target … -
Forms Part 4: Formsets
Formsets make life easier when it comes to dealing with multiple forms of the same type on the same page. In this episode we will show you how to set them up, and the basics of how to save that data to the database. It is not much different from dealing with single forms. Watch Now... -
Forms Part 4: Formsets
Formsets make life easier when it comes to dealing with multiple forms of the same type on the same page. In this episode we will show you how to set them up, and the basics of how to save that data to the database. It is not much different from dealing with single forms. Watch Now... -
Dajaxproject, primera part
Una de les preguntes més recurrents en les llistes de Django, junt amb la de quin editor fer servir és la de com fer cridades AJAX i quina llibreria utilitzar. Django és agnòstic en el que fa a les llibreries javascript, tot i això la part de l'admin fa servir jQuery, però oficialment no hi ha cap llibreria especialment recomanada, Django és pot utilitzar amb qualsevol llibreria i dependrà del projecte que en triem una o altra. El problema de que no es faci cap recomanació de com integrar cridades AJAX amb Django ens dóna molta llibertat, però també te l'emperò de que no hi ha cap guia de bones pràctiques sobre com fer-ho, des d'on posar la llibreria, quin nom li hem de donar, si la posam al views.py o no. El la comunitat de codi obert quan hi ha un buid així i una necessitat ben aviat sorgeixen projectes que intenten donar una resposta. Un d'aquests projectes és el que us present en aquest article el dajaxproject. Djaxaproject són de fet dues llibreries, dajaxice i dajax, la primera podríem dir que respon a la necessitat que us comentava de fer més senzilla la comunicació asíncrona entre les aplicacions … -
Simple Site Checker
… a command line tool to monitor your sitemap links I was thinking to make such tool for a while and fortunately I found some time so here it is. Simple Site Checker is a command line tool that allows you to run a check over the links in you XML sitemap. How it works: [...] -
Quick Django Class Based View Decorator
A quick way to use decorators on Django class based views using Python metaclasses. -
Faking attributes in Python classes…
… or how to imitate dynamic properties in a class object Preface: When you have connections between your application and other systems frequently the data is not in the most useful form for your needs. If you have an API it is awesome but sometimes it just does not act the way you want and [...] -
5 open-source Python/Django apps we love
The Python/Django duet is fantastic, everyone knows that. However it can be even more awesome with these apps: 1. South This is an intelligent schema and data migration tool. If you don’t use it yet, you will want to after reading this post. Okay… but what it is exactly? When you create a Django app, you are using the “syncdb” command. After a model changes you have to delete the whole database and run “syncdb,” or manually do SQL changes directly in the database. It’s even more tragic when you already have production data. Not so fun, right? Enter our hero: “South.” Its main objectives are to provide a simple, stable and database-independent migration layer to prevent all the hassles schema changes bring to your Django applications over time. Simple example Let’s create a model in our “southtut” app: class Knight(models.Model): name = models.CharField(max_length=100) of_the_round_table = models.BooleanField() Then let’s create our first migration: $ ./manage.py schemamigration southtut --initial Creating migrations directory at '/home/andrew/Programs/litret/southtut/migrations'... Creating __init__.py in '/home/andrew/Programs/litret/southtut/migrations'... + Added model southtut.Knight Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate southtut And apply our new migration: $ ./manage.py migrate southtut Running migrations for southtut: - Migrating forwards to … -
Running sentry on DotCloud
Sentry is a realtime event logging and aggregation platform. At it’s core it specializes in monitoring errors and extracting all the information needed to do a proper post-mortum without any of the hassle of the standard user feedback loop. The main feature of sentry and the ability to send all of your application logs to one place, and then aggregate them, so that you only get one error email for the same error. This will keep your mailbox from flooding, when something goes wrong. Putting your logging server on a different server or network then your production servers is a good idea. If something goes wrong, and you can't access your servers, you can still see what errors were getting thrown before the servers started having problems. Follow these easy steps to get sentry up and running on DotCloud. Create a place to store your project $ mkdir -p ~/projects Go into the projects directory $ cd ~/projects Clone git repo from github, requires git client $ git clone git://github.com/kencochrane/sentry-on-dotcloud.git Go into the new project directory $ cd sentry-on-dotcloud Creating the virtualenv (using virtualenvwrapper, virtualenv, and pip) $ mkvirtualenv --no-site-packages --distribute sentry-on-dotcloud Install all of the Sentry requirements via pip … -
Angelo Dini is a core developer
Angelo Dini is a core developer -
django CMS 2.2 roadmap update
django CMS 2.2 roadmap update -
django CMS 2.2 release candidate 2 available
django CMS 2.2 release candidate 2 available -
Scary monsters and feature-creep
Scary monsters and feature-creep -
Security release issued
Security release issued -
django CMS 2.1.4 security release issued
django CMS 2.1.4 security release issued -
django CMS 2.2 release candidate available
django CMS 2.2 release candidate available -
django CMS 2.2 beta 1 available
django CMS 2.2 beta 1 available -
django CMS 2.1.2 released
django CMS 2.1.2 released -
django CMS 2.2 released
django CMS 2.2 released -
How to justify attending PyCon sprints
Sad that the PyCon sprints fall on business days? Wishing you could stay but the boss/client won't let you and demands you back so 'you can work'? This is how you make it so that the sprints are something your management is demanding you attend every sprint ever.Make it foremost in your mind that the wonderful thing about the PyCon sprints is that the odds are that anyone who knows anything about whatever you are doing in Python will be there.Write up a list of the things that you are finding challenging, hard, or impossible to do with Python.Now go to the boss and say something like: "Because the experts and leaders of the open source tools we are using are going to be there, I want to attend PyCon sprints. All my time at the sprints will be focused on sitting around them and working on our tools. I'll focus on things that directly impact our agency / company / organization, specifically things I wrote down on this list."If the boss says, "Why not just use IRC or email?"Then you say something like, "Well, IRC/email is not the same as sitting next to these people. I'll be so much …