Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Facebook Connect - Django integration on filmaster.com
Integrating Facebook users with external website using Facebook Connect and Django -
Django: Testing Views
Although I usually begin writing tests for models, if I had to pick only one component to test I would pick The View. That is because testing views will give you the best coverage for a typical Django application. If your apps are not project specific you need to decouple tests from project particulars. While [...] -
Django and Google App Engine
Reading Jacob Kaplan-Moss's post Snakes on the Web my first thought was - why hasn't he mentioned Google App Engine? To be fair to Jacob, the GAE sdk when launched was pretty underwhelming but GAE is the ugly duckling that could very well grow into a swan. If Django is for 'perfectionists with deadlines' then GAE might be said to be for 'perfectionists with aspirations'. The growth of Django -
Произвести впечатление любой ценой
Вы когда-нибудь задумывались каким таким магическим образом джанговская админка сияет своим синим стилем в только что созданном проекте? Ведь одна из самых больших проблем у новичков в Джанге - это наладить отдачу статики в проекте, но её даже не надо настраивать чтобы правильно заработала админка! Это потрясающий маркетинговый ход - встроить глубоко во внутрь фреймворка костыль лишь для того, чтобы у человека, первый раз читающего и делающего туториал (или просто первый проект), уже на втором шаге случился культурный шок от админки, а точнее от её полу-магического появления и внешнего вида. Есть устоявшееся мнение, что у Джанги реальные проблемы с PR'ом и продвижением в массы. Что мол не кричат разработчики и члены сообщества, что вот она какая крутая и что всем надо ею пользоваться. Так у нас свой путь - не надо бить во все колокола, а лишь в нужных местах сгладить углы и сделать вхождение новых людей плавным и беззаботным. Благими намерениями - дорога в ад! Проза в том, что медиа админки в runserver хендлится специальной WSGI мидлвариной. Причем даже в основном хендлере есть проверка на наличие в урле префикса медии админки и подавлении нотификации о запросе в консоле - чтобы не пугало неподготовленное сознание!:-) Всё это чревато, т.к. кто-то … -
South 0.6.1
South 0.6.1 is now available for public consumption; it fixes quite a few bugs.If you want to see what's been fixed, have a gander at the Release Notes - there's a few significant bugs that have been fixed, including problems with SQLite, GeoDjango, and M2M fields.Sorry for the short but sweet post - I'm in the process of writing my talk for DjangoCon! I'm giving a talk about South, with both a good grounding for those who haven't grokked migrations yet, as well as some tips on more advanced usage. Come watch it on Tuesday morning! -
Snakes on the Web
A talk given at PyCon Argentina and PyCon Brazil, 2009. Web development sucks. It’s true: web development, at its worst, is difficult, repetitive, and boring. The tools we have suck. At best, they make web development slightly less painful, but we’re a long way from making web development awesome. The history of web development tools is a history of trying to solve this problem. It’s a history of asking, “how can we make this suck less? -
First things to do on a Django project...
Call them best practices if you like, but here's the things I do when starting a new Django project. -
zoe.vc is back
Finally we made it to the new server. Unfortunatly all special characters are broken, but I'll fix that later. And hopefully I'll have same time to post new content -
Django ... an outlier
While analyzing the development activity and code metrics for over 240 of the most actively developed FLOSS projects, guess which project popped out? Yes Django! Its an outlier in terms of its activity. It’s influencing the results of my statistical analysis more than any other project as per the Cook’s distance diagnostic index. Let me bring your attention to the lonely dot that is close to the value 1 at the top right corner. I missed it at first, but noticed it when I looked at the sorted values. This is telling us that at least among the sample that I have ,Python, C and C++ based actively developed FLOSS projects, Django (including its community) is quite unique. I leave you with the graph of sorted Cook’s D values from my analysis: Click to Enlarge Image -
Formulários elegantes com Django
Não poupo críticas ao Django, este excelente framework em Python tem me ajudado a concluir todos meus projetos relacionados a web, se tornou o padrão de desenvolvimento da Trianguli, empresa onde trabalho. O lema do Django “The web framework for perfectionists with deadlines” faz muito sentido e tem auxiliado muito a Trianguli a cumprir seus deveres para com seus clientes. Confesso que nunca gostei muito dos módulos de formulários (forms) do Django, sempre optei em fazer meu formulários na mão para adapta-los melhor ao layout e não correr riscos de ter algum resultado inesperado de layout, mas os formulários são uma mão na roda para validação e até melhorar a segurança do site. Outro dia estava realizando uma pesquisa rotineira e acabei encontrando o Uni-Form, um conjunto de CSS e JavaScript (depende do jQuery) que cria formulários de uma maneira mais elegante, incluindo sua validação. O Uni-Form é altamente personalizável e seu código está muito bem elaborado e validado via W3C. Pesquisando mais um pouco, encontrei o django-uni-form, que faz a integração do Uni-Form ao Django, permitindo seu uso rapidamente em um projeto Django existente, com poucas modificações no código. O django-uni-form pode substituir o modelo de formulários do Django … -
A Civilized Way Display Lots Of Data
Django is a civilized way to build web applications. Pagination is a civilized way to display lots of data. There are still people developing websites with tens of thousands of items crammed in a single page. Even if you use JavaScript to paginate client-side, never ending download results in poor user experience. Django has pagination [...] -
Primeros pasos con geodjango
Este es un minitutorial "expreso" para probar geodjango en debian testing con postgres 8.3, postgis y django 1.1Pues lo primero es instalar los "juguetes":$ apt-get install postgis postgresql-8.3 postgresql-plpython-8.3 $ apt-get install python2.5 python-psycopg2 python-django ipython $ apt-get install gdal-bin python-gdal Ahora debemos configurar un poco postgres asi:Debemos volvernos root y luego el usuario postgres$ su $ su postrgres$ psql template1Este úlrimo comando nos conecta a postgres como el usuario postgres (el root del servidor de bases de datos), luego configuramos una plantilla para postigs (esto lo hacemos una sola vez)template1=# ALTER USER postgres WITH PASSWORD 'postgres';ALTER ROLETemplate1=# \qLuego:$ cd /tmp$ wget http://geodjango.org/docs/create_template_postgis-debian.sh$ bash create_template_postgis-debian.shEsto nos crea la plantilla template_postgis, ahora volvemos a postgres: $ createdb -T template_postgis geodjangoSalimos de postgres y del usuario root.Ahora creamos un projecto y la app:$ djano-admin startproject geodjango$ cd geodjango$ python manage.py startapp world Luego editamos el settings de nuestro proyecto con el editor de nuestra preferencia (sugerencia rapida gedit)$ gedit settings.py &Dejamos las siguientes variables así DATABASE_ENGINE = 'postgresql_psycopg2' DATABASE_NAME = 'geodjango' # Or path to database file if using sqlite3.DATABASE_USER = 'postgres' # Not used with sqlite3.DATABASE_PASSWORD = 'postgres' # Not used with sqlite3.DATABASE_HOST = 'localhost'LANGUAGE_CODE = 'es'INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', … -
Probably Site Downtime
Howdy! As I'm moving the domain to a new server these days it could be possible that zoe.vc isn't reachable for some hours or even days. So don't be confused - everything will be alright after the movement is finished. Comments are disabled meanwhile. Thanks for your understanding! -
Annoying things about Django
Annoying things about Django -
Making tabularinline's collapse in Django 1.0
Django 1.0 admin doesn't treat inlined objects quite the same as normal fields. One quirk is setting a tabularinline to be collapsed by default. The solution is to make a new template and set the formset to have class=collapse. diff templates/admin/collapsed_tabular_inline.html /usr/share/python-support/python-django/django/contrib/admin/templates/admin/edit_inline/tabular.html 5c5< <fieldset class="module collapse">---> <fieldset class="module">and setting the template in admin.py class MyModelnline(admin.TabularInline): model = MyModel template = 'admin/collapsed_tabular_inline.html' Permalink | Leave a comment » -
La taberna esta casi lista www.lataberna.pe
He venido trabajando con algunos amigos en un site peruano www.lataberna.pe para un pub . La verdad el site esta orientado por su simplicidad, hemos tenido muchas peleas sobretodo por cuestiones de diseño. Aunque no estoy del todo contento con el acuerdo final, creo que se acerca bastante a lo que yo buscaba. El site [...] -
IPAddressField Indexing Problem in PostgreSQL
Indexing Django's IPAddressField field will be ignored in PostgreSQL. Why? Django forces a HOST function when querying such a field, as a result having PostgreSQL ignoring the existing index. Temporary Solution? 1. Create the IP address field in your DB Table with the appropriate type (in PostgreSQL it is INET), and index it right there. 2. Don't use IPAddressField in your models.py, use a standard CharField instead: ip = models.CharField(max_length=20)Just make sure to use the right data type in your DB. Postgres INET stores IP data much like an Integer. Storing IP data as string will take slightly more space and cause performance penalty. -
Сципион
Люций Корнелий Сципион по прозвищу Бородатый жил в Древнем Риме порядка трёх сотен лет до нашей эры. Был он не самым безвестным человеком. Сначала военачальником, довольно успешным, выигравшим несколько известных битв. А к концу жизни дослужился до должности консула. Но помимо прочего, был он ещё и цензором. Дойдя до наших дней, слово "цензор" утратило большую часть своих первоначальных значений, и сейчас означает человека, который не пускает к публикации материалы, подвергающие опасности текущий государственый строй. Однако в Древнем Риме основной работой цензора был, как ни странно, ценз. Под цензом понимался всего навсего учёт граждан республики с их имуществом, общественным положением и родом деятельности. По-современному говоря -- перепись населения. Надо сказать, что тогдашние цензоры к этой части своей работы относились без особого трепета, и точность данных этих переписей была довольно условной. Вроде как сейчас. Но вот этот самый Сципион Бородатый был известен как раз тем, что действительно этим занимался, и провёл довольно точную перепись. И вот вслед за римлянином Цицероном, именем которого я назвал свой форум, я решил взять имя Сципион (Scipio) для своего следующего интересного проекта. Это OpenID-консумер для Джанго, который умеет регистрировать пользователей (буквально вести перепись) и хранить информацию о их лояльности или нелояльности. Проект Scipio Сразу самое важное: страница … -
Сципион
Люций Корнелий Сципион по прозвищу Бородатый жил в Древнем Риме порядка трёх сотен лет до нашей эры. Был он не самым безвестным человеком. Сначала военачальником, довольно успешным, выигравшим несколько известных битв. А к концу жизни дослужился до должности консула. Но помимо прочего, был он ещё и цензором. Дойдя до наших дней, слово "цензор" утратило большую часть своих первоначальных значений, и сейчас означает человека, который не пускает к публикации материалы, подвергающие опасности текущий государственый строй. Однако в Древнем Риме основной работой цензора был, как ни странно, ценз. Под цензом понимался всего навсего учёт граждан республики с их имуществом, общественным положением и родом деятельности. По-современному говоря — перепись населения. Надо сказать, что тогдашние цензоры к этой части своей работы относились без особого трепета, и точность данных этих переписей была довольно условной. Вроде как сейчас. Но вот этот самый Сципион Бородатый был известен как раз тем, что действительно этим занимался, и провёл довольно точную перепись. И вот вслед за римлянином Цицероном, именем которого я назвал свой форум, я решил взять имя Сципион (Scipio) для своего следующего интересного проекта. Это OpenID-консумер для Джанго, который умеет регистрировать пользователей (буквально вести перепись) и хранить информацию о их лояльности или нелояльности. Проект Scipio Сразу самое важное: страница … -
Сципион
Люций Корнелий Сципион по прозвищу Бородатый жил в Древнем Риме порядка трёх сотен лет до нашей эры. Был он не самым безвестным человеком. Сначала военачальником, довольно успешным, выигравшим несколько известных битв. А к концу жизни дослужился до должности консула. Но помимо прочего, был он ещё и цензором. Дойдя до наших дней, слово "цензор" утратило большую часть своих первоначальных значений, и сейчас означает человека, который не пускает к публикации материалы, подвергающие опасности текущий государственый строй. Однако в Древнем Риме основной работой цензора был, как ни странно, ценз. Под цензом понимался всего навсего учёт граждан республики с их имуществом, общественным положением и родом деятельности. По-современному говоря — перепись населения. Надо сказать, что тогдашние цензоры к этой части своей работы относились без особого трепета, и точность данных этих переписей была довольно условной. Вроде как сейчас. Но вот этот самый Сципион Бородатый был известен как раз тем, что действительно этим занимался, и провёл довольно точную перепись. И вот вслед за римлянином Цицероном, именем которого я назвал свой форум, я решил взять имя Сципион (Scipio) для своего следующего интересного проекта. Это OpenID-консумер для Джанго, который умеет регистрировать пользователей (буквально вести перепись) и хранить информацию о их лояльности или нелояльности. Проект Scipio Сразу самое важное: страница … -
Custom Admin Views and Reversing Django Admin URLs
Custom Admin Views and Reversing Django Admin URLs -
FrOSCon 2009
Vergangenes Wochenende - am 22. und 23. August 2009 - fand in St. Augustin die FrOSCon statt. Für die FrOSCon war es (soweit ich weiß) das vierte Jahr, ich war zum ersten Mal dabei. Die FrOSCon ist eine zweitägige Konferenz zu den Themen Freie Software und Open Source. Neben einem sehr umfangreichen "offiziellen" Vortragsprogramm gibt es auch noch eine Reihe von sog. Projekträumen, in denen einzelne Open Source Projekte ihre eigenen Vorträge organisieren. In diesem Jahr gab es zum ersten Mal einen eigenen Projektraum für das Django Projekt. Zuerst gab es am Samstag von Markus Zapke-Gründemann im Hauptprogramm einen Django Vortrag, welcher viele Hörer anzog und später gab es dann im Django Projektraum noch den Vortrag "Django - lessons learned from a management perspective" von Jirka Schäfer und den Vortrag "Dojo and Django - The perfect couple" von Tobias von Klipstein. Beide Vorträge haben trotz der abgelegenen Lage des Django Projektraums viele Zuhörer angelockt. Auch zwischen den Vorträgen war der Django Projektraum gut besucht. Teilnehmer aus den Vorträgen konnten Fragen stellen und ergänzende Informationen erhalten und natürlich kam es auch zu spannenden Diskussionen zwischen den Entwicklern, die bereits aktiv mit Django arbeiten. Django Projektraum auf der FrOSCon Alles in Allem … -
Pinax setup on WebFaction Part 2
I scrapped everything I did in part 1 and followed this pretty much exactly: http://code.pinaxproject.com/wiki/DetailedPinaxWebfaction/ (note: I spent several hours trying to get my setup to work before I deleted everything and started from scratch following the DetailedPinaxWebfaction procedure. I recommend that you do the same if you're struggling. However, this may be outdated shortly as the Pinax folks are hard at work on the new release.) What I did differently from DetailedPinaxWebfaction: - Used Pinax-0.7beta3, not beta2 - Used Django-1.0.3, not 1.0.2 - mysql insted of postgresql in myproject/local_settings.py - Made slight variations to my ~/webapps/pinax07server/apache2/conf/httpd.conf: ServerRoot "/home/insert_user_account_here/webapps/pinax07server/apache2" LoadModule dir_module modules/mod_dir.so LoadModule env_module modules/mod_env.so LoadModule log_config_module modules/mod_log_config.so LoadModule mime_module modules/mod_mime.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule wsgi_module modules/mod_wsgi.so KeepAlive Off Listen 37968 LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined CustomLog logs/access_log combined ServerLimit 2 WSGIPythonPath /home/insert_user_account_here/webapps/pinax07server/pinax-env/lib/python2.5/site-packages/ WSGIScriptAlias / /home/insert_user_account_here/webapps/pinax07server/myproject/deploy/pinax.wsgi LoadModule alias_module modules/mod_alias.so WSGIDaemonProcess pinaxWSGI user=insert_user_account_here group=insert_user_account_here threads=25 python-path=/home/insert_user_account_here/webapps/pinax07server/pinax-env/lib/python2.5/site-packages WSGIProcessGroup pinaxWSGI NameVirtualHost 127.0.0.1:insert_your_port_here ServerName insert_your_domain_here.com WSGIScriptAlias / /home/insert_user_account_here/webapps/pinax07server/myproject/deploy/pinax.wsgi ErrorLog "logs/myproject_2009_05_06.log" SetHandler none Alias /site_media /home/insert_user_account_here/webapps/static Permalink | Leave a comment » -
My notes on installing Pinax 0.7rc1 and integrating my Django art catalog app into it
This post is a mess and mainly for my own personal records. I've been up all night installing Pinax v0.7rc1, integrating my Django art cataloguing app with one of the Pinax sample projects, and trying to deploy it on Webfaction. I installed Pinax 0.7rc1 locally as per the "development version" instructions on their documentation site. Installation notes: - Install virtualenv and virtualenvwrapper before pinax, if you haven't already - When you create the pinax-env directory, do it inside of ~/.virtualenvs/- I ran into a dependency conflict - I had simplejson 1.9.2 installed, and it wanted 2.0.9. I removed the old one via synaptic and then deleted the old egg. When I tried rerunning the Pinax script that installs all the external dependencies, it completed successfully. Then, I cloned their sample social networking website social_project and played with the site (at localhost:8000). Its admin site at localhost:8000/admin also worked as expected. This is great, I thought. I was kind of surprised that I got it working so fast. The trick is to read every word of the installation docs carefully - I was running into problems until I forced myself to stop skimming the instructions over. Next, I decided to integrate … -
Logical Delete Support in Django
I have had a small set of functionality that I have copied to several projects and thought it was time to abstract it out as its own pluggable Django app. Thus, a new django app has been released onto the public -- django-logicaldelete. Check it out and let me know what you think! Here is the README.md copied for your reading pleasure: Django Logical Delete This is a small and simple app that I threw together to get some reuse out of something I do in nearly every project and every model I create. It's too easy for good data to get deleted and it be unrecoverable. It's also too easy to fix this by overriding the model's delete() method and just flagging records as deleted and then leveraging Django's Managers to override default behavior so that logically deleted items are not returned in querysets. There are two exceptions however, that I have found useful to this rule. In the admin I like to see everything with an indicator of whether or not it has been deleted, with the ability to filter down to just active records, (or deleted for that matter). I still think it is a valid request …