Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Handling i18n in Django projects
Given the following premises: Some 3rd party apps do have translations for language that we need and some do not. Translations for some apps maybe poor or just inadequate We don't always have write access for some apps catalogs Our goal is to offer website editor access for easily managing all important translations. Example project setup As a example project let say we want to build small website with FAQ section in Slovenian and Deutsch language. To manage questions and answers we want to use django-faq app. We would include Django Admin and Rosetta applications to allow administrator to easily manage content and translations on the website. Our directory structure looks like this: example.com/ website/ custom/ settings.py urls.py requirements.txt Note that we won't copy django-faq (or any other external apps) into our project directory, as it would made it harder to receive updates and bugfixes. Beside that we don't want it to clutter our source version control system with other projects. We would rather made it available on python-path by using pip, easy_install or symlinking it to site-packages directory. Ideal workflow Looking at the faq app we notice that it already have translations for Deutsch language but not for Slovenian … -
Speed up Django testing with sqlite
Using MySql default ISAM storage type for testing in Django can be slow. To use sqlite in memory database with transactions support add this code to the end of settings.py: if 'test' in sys.argv: DATABASES = { 'default': {'ENGINE': 'django.db.backends.sqlite3'} } -
Rättigheter hos FS-Data
hej -
Rättigheter hos FS-Data
hej -
Джанго в роли микрофреймворка
Известно мнение, что Джанго не подходит для написания "наколеночных" проектиков, которым не нужно ничего особенно, кроме вывода HTML'а. Создание скелета проекта на Джанго считается работой, достаточно существенной для того, чтобы не заниматься ею ради пары функций. Мне всегда было "очевидно", что это не так, но недавно по оброненной коллегой фразе я понял, что это не значит, что это очевидно всем. Многие просто не задумываются об этом. Ну, вы знаете, как это бывает… Поэтому я хочу продемонстрировать создание Джанго-проекта минимальными усилиями. Упрощение Нужно отказаться от команды startproject. Она создаёт хороший скелет проекта с аннотированным файлом настроек, но если вы Джанго-проект видите не впервые, этим можно пренебречь. Файл manage.py — тоже не нужен, это просто локальный хелпер для django-admin.py Не нужно думать о проекте, как о контейнере для приложений, а следовательно не нужно оформлять свой код, как подключаемое приложение. Приложения — одна из самых сильных архитектурных черт Джанго, но для мелких задач эта гибкость никогда не понадобится. В итоге мы имеем что-то такое: settings.py: DEBUG = True ROOT_URLCONF = 'urls' TEMPLATE_DIRS = ['.'] urls.py: from django.conf.urls.defaults import * import views urlpatterns = patterns('', (r'^$', views.index), (r'^test/(\d+)/$', views.test), ) views.py: from django.shortcuts import render def index(request): return render(request, 'index.html', {}) def test(request, id): … -
nashvegas 0.4.1 released
A week or so ago I packaged up nashvegas 0.4.1 and thanks to Brian Rosner and Jannis Leidel there have been a good number of features added since my last blog post about nashvegas. Change Log Running ./manage.py syncdb now prompts for confirmation to prevent accidental executions. When migrations are managed by nashvegas, running syncdb can make it easy to forget to create migrations. --seed option takes an end point instead of the entire unexecuted list in the migrations folder SQL is no longer piped into your database backend client, but executed via the in process database connection object managed by Django. All migrations, including interleaved Python based migrations run in one atomic migration (backend database must support transactions obviously) Added admin interface for nashvegas's Migration model Updated --create to not output BEGIN/COMMIT statements as transaction is now managed by nashvegas not the script(s) being executed. Fixed some minor bugs Updated execution of Python migrations to use execfile instead of __import__ to avoid pyc confusion. Updated output of --execute to provide better user feedback of what is being executed. -
nashvegas 0.4.1 released
A week or so ago I packaged up nashvegas 0.4.1 and thanks to Brian Rosner and Jannis Leidel there have been a good number of features added since my last blog post about nashvegas. Change Log Running ./manage.py syncdb now prompts for confirmation to prevent accidental executions. When migrations are managed by nashvegas, running syncdb can make it easy to forget to create migrations. --seed option takes an end point instead of the entire unexecuted list in the migrations folder SQL is no longer piped into your database backend client, but executed via the in process database connection object managed by Django. All migrations, including interleaved Python based migrations run in one atomic migration (backend database must support transactions obviously) Added admin interface for nashvegas's Migration model Updated --create to not output BEGIN/COMMIT statements as transaction is now managed by nashvegas not the script(s) being executed. Fixed some minor bugs Updated execution of Python migrations to use execfile instead of __import__ to avoid pyc confusion. Updated output of --execute to provide better user feedback of what is being executed. -
django-helpdesk
A while ago I released a helpdesk tool that I use to manage support requests, under the name of Jutda Helpdesk (named after my small consulting company). The project has received a slow but steady stream of patches and bug fixes, however it's always been a little tricky to manage with a single committer over at Google Code. To make life easier for everybody involved, I've renamed the project to django-helpdesk and shifted the source code and issue management to GitHub. -
django-helpdesk
A while ago I released a helpdesk tool that I use to manage support requests, under the name of Jutda Helpdesk (named after my small consulting company). The project has received a slow but steady stream of patches and bug fixes, however it's always been a little tricky to manage with a single committer over at Google Code. To make life easier for everybody involved, I've renamed the project to django-helpdesk and shifted the source code and issue management to GitHub. I thought I'd spend a few words talking about these two changes. Firstly, the change in name. Because django-helpdesk was originally built for my own use internally at Jutda and WhisperGifts I released it under the name of "Jutda Helpdesk" when I opened the source up a few years back. There was a bit of a thought that I could release more products with a similar naming scheme, such as "Jutda Basket Weaver" and "Jutda Donut Maker". Those products never eventuated, leaving the only open-source product as "Jutda Helpdesk". This seems to have caused a bit of confusion, with people referring to the product simply as "Jutda" which does no good for either the helpdesk product or my business. … -
django-helpdesk
A while ago I released a helpdesk tool that I use to manage support requests, under the name of Jutda Helpdesk (named after my small consulting company). The project has received a slow but steady stream of patches and bug fixes, however it's always been a little tricky to manage … -
Django session key changes on every request?
Django version is 1.2.4.views.pyfrom django.http import HttpResponsefrom random import choicedef index(request): x = choice([0, 1, 2]) if x == 0: request.session['a'] = 1 elif x == 1: request.session.flush() return HttpResponse(request.session.session_key + ' ' + str(request.session.keys()) + ' ' + str(x), content_type='text/plain')session.clear() method doesn't change session key.The session key was changed when call the session.flush() method. (eg. logout())If session isn't used in request, session key was changed on every request.ref:Django | How to use sessions | Django documentation -
Los Angeles Open Source Hackathon
I want to announce the launch of our new company which we've named Cartwheel! Besides Python and Django consulting, our plan is to support local Los Angeles small business, teach classes, and host events. And our first event is a Los Angeles Open Source Hackathon on February 5th! Space is limited so RSVP before tickets run out!Open Source Hackathon at CartwheelA hackathon (or sprint if we want to be Pythonic) is where a bunch of developers get together to push various projects forward.Bring your laptop and work on any open source project that you'd like, as long as it's open source. It can be an existing open source project (e.g. Django, Python) or a new one of your own. Leave the work stuff at work! Got an existing project? Hackathons are a great place to share ideas and perhaps find additional contributors. Let me know and I'll put it in an additional blog post.New to open source? A beginning developer? We'll help you get started with open source software development and do our best match you to a project that fits what you want to do.Some projects that may be worked on:Nudge: Evite's API tool is being open sourced!django-packages: Integration with brabeion … -
First entry
Syntax highlightingfrom django.http import HttpResponsedef index(request): return HttpResponse('OK') -
4 Lessons learned about multivariate testing
Recently we did our first major multivariate test on a page using Google Website Optimizer (GWO). Our goal was to increase reader involvement by having them go to any other page on our web site. There ended up being 32 combinations of content. We wrote and open-sourced a Django application to do much of the work called django-gwo. Here are a few lessons from the first test: You can test the layout of dynamic pages Typically A/B and multivariate testing is about a static testing URL and a static goal URL. We needed to test every story URL and our goal was any other URL on our site. The tricks: Use JavaScript to tell GWO that the test is starting Use the “onclick” method on links to tell GWO that the test succeeded. Don’t include any dynamic content within the experiment sections Use <div> tags around dynamic content with an alternate <div style=”display: None”> to make it disappear. If you want to test if a dynamic content block is better in position A or position B, put it in both. Use surrounding <div> tags to make the content appear and disappear. You can manually remove combinations where the content would appear twice. Test multiple things GWO will show you the … -
Error Tracing in Sentry
-
Error Tracing in Sentry
A few weeks ago we pushed out an update to Sentry, bumping it's version to 1.6.0. Among the changes was a new "Sentry ID" value which is created by the client, rather than relying on the server. This seems like something insignificant, but it allows you to do something very powerful: trace errors... -
Announcing djeneralize
We're pleased to announce the first alpha release of a new package, djeneralize, to augment the model inheritance available in Django. djeneralize allows you to define specializations of general case models and then have these specializations returned from querying the database. For example:This allows all the fruit in the database to be returned as the specialized fruit model instances rather than general Fruit model instances. We hope this functionality will allow the grouping of content types with common fields and allow rapid access to the specific model instances so that list views can be easily built which reflect the diversity of specialized content.djeneralize handles all the database lookups that you would need to perform behind the scenes and allows the vast majority of Django query syntax to be used. It supports multiple-levels of specialization to allow querying of sub-generalizations.We are planning on integrating this work into a current project to allow fine-grained categorization of all content on the 2degrees platform and hope this will offer us all the power and flexibility we need.To get djeneralize either clone the source from github, or install it via easy_install:$ easy_install djeneralizeFurther information and full documentation is also available. -
DjangoDE 0.1 Released
I spend most of time at work building websites in Django. My editor of choice until now has been Kate with Chromium open on another screen. Most of my co-workers use VIM inside a PuTTY session to do their editing. With multicore machines with gigabytes of RAM, surely there’s a better way? I investigated the [...] -
Book: Eckart's notes - good book, critique of the outcome
Summary: good book, nice to read. Lots of good tips that I like. But at the end I was left with a sour taste because the good didn't last. The company that is the core of the book and that embodied the book's contents got sold and that was the end of line for a lot that the book tries to tell/sell. I'll include an example of something that might work at the end. Disclaimer: I know nobody that worked in any of those companies I mention, so I might be totally wrong of I might have a wrong impression. Please correct by e-mail or by adding a comment if it is the case! The book A colleague was wildly enthousiastic about the magical Eckart's notes, presumably a great book with a non-standard notebook-like look. Written by Eckart Wintzen . I didn't manage to get my hand on it as his copy was in heavy circulation: others kept grabbing it before I could lay my hand on it :-) You can't have better advertising than that :-) I planned on buying it myself but got lucky at the last Dutch django meeting as Wim gave a talk about reading books … -
Book: Eckart's notes - good book, critique of the outcome
Summary: good book, nice to read. Lots of good tips that I like. But at the end I was left with a sour taste because the good didn't last. The company that is the core of the book and that embodied the book's contents got sold and that was the end of line for a lot that the book tries to tell/sell. I'll include an example of something that might work at the end. Disclaimer: I know nobody that worked in any of those companies I mention, so I might be totally wrong of I might have a wrong impression. Please correct by e-mail or by adding a comment if it is the case! The book A colleague was wildly enthousiastic about the magical Eckart's notes, presumably a great book with a non-standard notebook-like look. Written by Eckart Wintzen . I didn't manage to get my hand on it as his copy was in heavy circulation: others kept grabbing it before I could lay my hand on it :-) You can't have better advertising than that :-) I planned on buying it myself but got lucky at the last Dutch django meeting as Wim gave a talk about reading books … -
Primer apunt del 2011
Primer apunt del 2011 Primer apunt d'aquests any. Se diu aviat quan gairebé ja ha passat un mes del 2011. Aquesta aturada per festes ha suposat també una aturada en els pots d'aquest blog. No vull dir que escriure sigui una rutina més, però sí que requereix de moments de tranquil·litat davant de l'ordinador, de reorganitzar idees, i amb les festes i amb tot el que queda pendent a l'inici d'any per mor de les festes, doncs tot s'acumula i els moments propicis per escriure al blog són molt limitats. Així que aquest primer apunt implica d'alguna manera tornar a la normalitat després de festes, posar en ordre els projectes i també fer un petit resum de l'any passat, que com a nota històrica doncs tampoc queda tan malament. Als soferts lectors ja us aviso que aquest apunt va de batalles, buabulància, projectes, ... Un sac on s'hi pot trobar de tot, bé si fa no fa com als resums anuals que fan per les teles, però sense els cops i les caigudes. Com molts sabeu el 2010 va ser l'any en que vaig deixar una feina estable a Tui España (després Hotelbes) per dedicar-me junt amb altre(s) socis a … -
DjangoSites Deployment Statistics
A long time ago I started collecting statistics from people submitting their sites to DjangoSites. I promised to collate the results one day - and here they are. -
DjangoSites Deployment Statistics
Every person that submits a site to DjangoSites gets a chance to include details about how they deployed their website: what database they use, what version of Django they use, and so on. The aggregated statistics are now online for all to see. The deployment details for individual websites are not visible. You can see the stats in a basic form along with some pretty charts on the DjangoSites website by clicking the Deployment Stats link in the navigation bar. I'd love to hear any feedback you've got, please let me know your thoughts via e-mail or Twitter -
DjangoSites Deployment Statistics
Every person that submits a site to DjangoSites gets a chance to include details about how they deployed their website: what database they use, what version of Django they use, and so on. The aggregated statistics are now online for all to see. The deployment details for individual websites are … -
Web Konferencia 2007.programfüzet.publish()
A Lisp kódok hadát némileg félretéve örömmel jelenthetem be a már korábban meghirdetett Magyarországi Web Konferencia 2007. évi állomását. A minap közzétett programfüzet híven tükrözi a rendezvényen felmutatott a PHP Konferencia-sorozat óta egyre szélesedő technológiák halmazát. Idén az Xdebug eszközt bemutató előadásom mellett az elmaradt Workshop 2.0-ra szánt, a Django AJAX-os oldalát taglaló prezentációmat is [...]