Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
9. Form Processing in the Code-Sharing Application
This is part 9 of a series of posts on James Bennett's excellent Practical Django Projects. The table of contents and explanation can be found here The chapter is the first serious coverage of forms. As Django 1.x has been released there is no old and newforms just forms, so on p171 and p176 and wherever else from django import newforms as forms is used, just use from django import forms. There -
Mark Ramm: Django and learning from Zope 2
Mark Ramm gave an interesting talk (now up on youtube) at DjangoCon about learning from the experiences of Zope 2. As someone who hit the Z productivity wall after developing a site with Zope 2 I really appreciated what he had to say but disagree with the reasons for the decline of Zope 2 and what it means for Django. The first part of the talk he summarizes as:"basically an argument that -
Django Tabbed Admin
A while ago i was playing with the excellent pinax (django-hotclub) project and i felt like the admin index page was kind-of overwhelming due to all the different apps listed in it. So i put a simple app together that has one template tag and a slight modification of the "admin/index.html" template to create simple tabs in the django admin interface. To minimize my effort ;-) i used jquery and ui.tabs.js to create the tabs at runtime. With one mandatory tab called "main" (changeable in settings.py), which contains all apps not mapped to a specific tab, and an attribute in settings called "ADMIN_TABS" that maps different apps to different tabs. It's still more-or-less a proof-of-concept applicatio, but it shows how easy these kinds of modifications can be in the django admin interface. Screenshots Mercurial repository Afterthoughts: I would like to extend this to something like shown in the Gondola screencast by Peter Baumgartner at a later time where a specific tab can also short-cut to common usage patterns. -
Django -> Plone: Light Bulbs, differences, irks
[This continues from my first post about my Django-to-Plone odyssey.] I now understand more of Plone‘s underlying concepts. I can’t yet create a non-trivial Plone site from scratch in a reasonable amount of time, but I’m getting closer. I’ve read some of, and have temporarily put aside, Professional Plone Development. I’ve read a few of the on-line tutorials [...] -
Simplifying Django Template Extensions
Simplifying Django Template Extensions -
DjangoCon Sessions: Video
The DjangoCon sessions are now up on YouTube. -
DjangoCon Sessions: Video
The DjangoCon sessions are now up on YouTube. -
DjangoCon Sessions: Video
The DjangoCon sessions are now up on YouTube. -
8. A Social Code-Sharing Site
This is part 8 of a series of posts on James Bennett's excellent Practical Django Projects. The table of contents and explanation can be found here Building and testing the models for the snippets app is fairly straightforward. The only changes you need to make are to separate out your admin classes into the separate admin.py file which I've shown previously, so type up all the code up to p154 -
4. A Django-Powered Weblog
Creating the Weblog Application This is part 4 of a series of posts on James Bennett's excellent Practical Django Projects. The table of contents and explanation can be found here. Before we start going through the Weblog app, you may want to have a look at my post on Django tests. This will help sort out any basic errors you make typing up examples. In this section of the book James gives -
Gotchas about Fixtures for Initial Data
One part of Django testing environment is fixtures. They are pre-prepared datasets to fill into the database before running tests. Django uses a separate database for running tests, but the fixtures from the files initial_data.* are also loaded into the main database when you synchronize it.I make fixtures for my application like this:python manage.py dumpdata --format=json --indent=4 myapp > apps/myapp/fixtures/initial_data.json The initial data is read out from apps/myapp/fixtures/initial_data.json and written to the main or the test database when I synchronize the databasepython manage.py syncdbor when I run the testspython manage.py test myappFixtures are great for deploying standard data like predefined categories, lists of countries and languages, default flatpages, default navigation, default user groups, and so on. However, you should be very cautious with them while developing.When I create new models, it's common practice to me to sync db so that the new database tables are created and the database schema reflects the models. Just after creation of new tables all fixtures called initial_data from all applications will be loaded. N.B. The fixtures from initial_data overwrite all existing data while synchronizing database. So if you have some important data that differs from the defaults, better make some database backup before syncing … -
Atualizando projetos para Django 1.0
Fiquei bastante sumido durante as duas últimas semanas. Estou me dedicando em adaptar alguns projetos para o Django 1.0, versão muito esperada que foi lançada recentemente. Por serem projetos de produção, optei por sempre respeitar e seguir as versões estáveis do Django, mesmo sabendo que existe um comprometimento grande por parte dos desenvolvedores em relação a estabilidade e segurança das versões em SVN. Em laboratório, mantenho as duas versões (a estável e a SVN, utilizada para testar novas features e avaliar as melhorias). O bom de fazer essa atualização de código é aproveitar a oportunidade e colocar em prática um ‘code refactoring‘, otimizando as aplicações e aproveitando a oportunidade para corrigir bugs e padronizar diversas funções. O Django 1.0 tem várias novidades e muda muita coisa em relação ao 0.96, por isso nem sempre um código feito para a versão 0.96 vai funcionar de primeira na 1.0, mas a adaptação vale a pena, pois a nova versão está sensacional. Como eu já estava acompanhando as evoluções através do SVN, a migração não está sendo difícil porque já sei tudo que mudou, mas no meu caso é demorada porque diversos pontos das aplicações que mantenho são complexas e dependem de outras … -
Japanese books about Django and Python
When looking for English books in a bookstore i came across the programming section of the 8 story book store and i could not resist to take a look and see if i could find any Python or Django books there. Look at my picture from what i've found here: http://trbs.net/photos/python-django-books-in-japanese/ Regretfully these where only about two bookshelves worth of Python books. Compare that too one full cabinet of Ruby and Rails books, one cabinet for Perl, a hole alley of Java books, an alley for c and c++ and lastly an alley for php/asp/vb/c# and other some other languages. *I'd even found some scheme, lisp and cobolt books in there :) * Worthy to note was that the Microsoft languages section was far less in total then i'd expected. While on the other hand a relatively minor language like Ruby had far more. Ofcourse japan is the homeland of Ruby so that might explain it's high number of books ;) (On a site note; probably the only people that could have invented such a syntax horrible language are the Japanese. Of-course I'm purposely forgetting about Perl here) Anyways i did not want to withhold u guys of these pictures, … -
django, nginx, memcached – the dynamic trio
Inspired by this article I decided to find out if the same technique can be exploited in my current project which is developed in django. My first problem was to come up with a viable cache key scheme since simply using the full request URI as suggested in the article wouldn’t work for me because my site renders a different version of a navigation menu depending on the authentication state of current the user. After weighing in the advantages and disadvantages between the super clean variant of factoring the session cookie and all other cookies into the memcached key and a less heavy weight method that would only append a server supplied abstract “page version” field to the request URI, I went for the latter. My resulting nginx virtual host config was looking like this: ?View Code APACHE1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 # define application servers upstream backend { server 127.0.0.1:8080 weight=1; } server { listen 80; server_name domain.com; access_log /var/log/nginx/domain.com.log; location … -
Oddaj swój głos na Django!
Równo tydzień temu odbył się konkurs na napisanie najlepszej aplikacji w 24h. W konkurencji wzięło udział 15 drużyn. Było dostępnych wiele technologii, od PHP (i jego frameworków takich jak CakePHP), poprzez Javę i Ruby on Rails. Można było również korzystać z Django. Taki konkurs... -
Make “easy_install PIL” work
Make “easy_install PIL” work -
Django cheat sheet
With the release of Django 1.0, we have released a completely updated version of our highly popular cheat sheet. -
Wapi 0.2.1 and django-oauthsp 0.2 released
I've finally managed to solve all known issues in django-oauthsp, so it's time to release 0.2. Wapi 0.2.1 is also here, fixing a small bug in the JSON formatter and updated to match a small API change in django-oauthsp. wapi-0.2.1.zip django-oauthsp-0.2.zip -
Dojo namespacing with dojango
This article describes, how you can create your own dojo namespace within a reusable django application when using dojango. It should give you an idea, where you place your javascript files and how you could structure your dojo namespace directory. When using dojango, where you are able to switch the source of dojo (a remote CDN or a local version), there are several things to consider when creating your own namespace. First I’ll explain how dojo uses namespaces and how you can preload files with it and afterwards i’ll describe how you setup a django project using dojango and adding your own django app with its own dojo namespace. Explaining the Dojo Loader It is important to understand, how dojo loads files and how dojo utilizes their namespace structure before creating your own one. At the beginning there is the dojo base system, that is loaded via a script tag in your page and which enables the dojo namespace on your page: 1234<script type="text/javascript" src="/path-to-dojo-dir/dojo/dojo.js" djConfig="parseOnLoad: true, isDebug: false"> </script> As you maybe already know, dojo comes with the two other namespaces dijit (layout and form widgets) and dojox (extensions for dojo and experimental stuff) and … -
Blog refresh
As you may or may not have noticed, I've refreshed my blog. It now runs on Django 1.0 and has a simpler layout. In the process I've managed to break my feeds, resulting in giving everyone doubly-escaped content. Sorry about that! Of course, the layout is horribly broken in IE7 (I can't even imagine what IE6 looks like!). I'll probably fix it at some point, but it's not a priority... Please let me know if you find broken links or things that don't make sense! Comments -
clean_pyc and compile_pyc in Django-extensions
I recently added two new commands to the django-extensions project. clean_pyc, removes all compiled python bytecode files from your project directory compile_pyc, compiles all python files to bytecode files in your project directory These are handy shortcuts to what you would normally do with something like "$ find -name "*.py[co]" -delete" or python's compileall import. The main added advantage is a little piece of code that checks the correct working directory. So it will only compile or delete files in your project root, even if you call manage.py from somewhere else. One other thing to note is that you will always see files being deleted when you call "$ ./manage.py clean_pyc -v" this is because when manage.py gets loaded python will compile files in your project root which are then in turn deleted by the command ;-) Check it out at: http://code.google.com/p/django-command-extensions/ -
Shifting Bits: Another Django Blog Engine
Tonight I released/open-sourced ShiftingBits. This blog is still on WordPress, but I believe I am close to having the all the features I need/require to make the migration possible. I pretty much stole a bunch from Brian Rosner's oebfare code base so if any of it looks familiar, that's where I copied a lot of this from. Thanks, Brian! If you are wanting to move from a WordPress blog to your own Django-based site, you might be able to save some time with this blog engine. This is exactly the path I am taking. I am using: mootools 1.2 -- JavaScript library awesomeness blueprint -- CSS framework wmd -- Live markdown preview for comments prettify -- Really cool syntax highlighter Feature Summary: Basic blog post mode driven using generic date based views with redirects so that the WordPress url date format (numbered month versus the prettier and django default of short month name) get mapped properly so that none of your links break. WordPress to Django Migration Script Tagging via django-tagging Comments via the new django.contrib.comments and using the live markdown preview editor, wmd. Full RSS feeds (both latest feeds and by tag) Left to To: Implement an XML-RPC interface … -
Shifting Bits: Another Django Blog Engine
Tonight I released/open-sourced ShiftingBits. This blog is still on WordPress, but I believe I am close to having the all the features I need/require to make the migration possible. I pretty much stole a bunch from Brian Rosner's oebfare code base so if any of it looks familiar, that's where I copied a lot of this from. Thanks, Brian! If you are wanting to move from a WordPress blog to your own Django-based site, you might be able to save some time with this blog engine. This is exactly the path I am taking. I am using: mootools 1.2 -- JavaScript library awesomeness blueprint -- CSS framework wmd -- Live markdown preview for comments prettify -- Really cool syntax highlighter Feature Summary: Basic blog post mode driven using generic date based views with redirects so that the WordPress url date format (numbered month versus the prettier and django default of short month name) get mapped properly so that none of your links break. WordPress to Django Migration Script Tagging via django-tagging Comments via the new django.contrib.comments and using the live markdown preview editor, wmd. Full RSS feeds (both latest feeds and by tag) Left to To: Implement an XML-RPC interface … -
6. Templates for the Weblog
Writing the Link Model This is part 6 of a series of posts on James Bennett's excellent Practical Django Projects. The table of contents and explanation can be found here. Read through and implement the all the templates up to p111 where the book covers Custom Tags. If you try running your base site at http://localhost:8000/weblog/ you'll probably get some template errors so we need to go back -
Django 1.0 Released
Congratulations everybody Django 1.0 has landed Thanks for all the hard work of the Django core team !!!