Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Running on 'file:' cache now
This site was running using locmem: caching option, which is fine for small web site. Now it runs using file:. Please let me know, if you spot any issues. I am planning to implement sql: next. -
TinyMCE 2.0RC1 is out
TinyMCE 2.0RC1 is out. Take it while it’s hot! I’ve upgraded my admin pages and it looks better than previous one (duh!). Nevertheless I see annoying flickering in FireFox. But it flickers less now. -
Something wrong with simple cache
I am not talking about multithreading problems. locmem: doesn’t have them. But it does have problems with gzip. Sometimes I see binary stuff on my screen. It looks like a gzipped web page without proper gzip encoding flag. I don’t do anything related to compression in my cache. Is it a bug in Django’s caching? Hmm… Apparently it works properly with memcache. Can it be some bug in simple: implementation, which was a base for locmem:? Weird. -
Private Dancer?
As I was going over some notes on our internal wiki, I ran across a list of rejected names for the framework that become Django: brazos superglue bodhisattva webbing boidae bohdi skoro consolidata piston physique silhouette valance anson The Python Web Framework (PWF) Tornado Publishing System Web Type Framework Pypeline super magic machine magic machine private dancer “the CMS” The Give-a-Damn machine boltdozer banister garbonzo Simon fizgig palmy cogent pith pithy pyth pythy festoon poeks lavalier clerisy bandwidth django -
Say no more! Say no more!
Being a little bit frustrated by the lack of caching options for my web site I’ve added locmem: cache to Django. It is fully multithreaded local memory-based cache, which uses reader-writer lock to do its magic. It seems to work well but I need some time to test it more. I think file: is going to be next. -
Django on Dreamhost: happy end
It looks like all kinks with Django on Dreamhost were worked out. Of course, I am referring to MySQL problem (see my previous post ) and strange stalling of long pages, which I reported to Django’s mailing list . It turned out that other people had these problem too. Jason McBrayer shared his experience . He pointed out to possible flup /fcgi.py problem. I contacted Allan Saddi — the author of flup and other Python libraries and utilities . He came to help immediately. We were able to isolate the problematic piece of software and in no time Allan made a fix. -
Django with MySQL: problem solved?
It looks like the problem is solved. Django creates one (1) connection to database and reuses it to handle requests. Multithreaded FastCGI creates threads to handle requests. These threads make requests to MySQL, which gets confused and loses its cool^H^Honnection. This process is random and compounded with multiple web requests at the same time. For example, if Google Web Accelerator decided to prefetch some pages, your web site would be hosed. -
Opera and Dojo
I decided to try how well Opera works with my site. It mostly works. You can go and see stuff but all Dojo-related code doesn’t work. Interesting that Google Maps works properly. When I switched to admin mode to edit this article, it turned out that TinyMCE doesn’t work either. But good news is Dojo and TinyMCE failed gracefully. -
More on MySQL and Django problems
I complained about instability of this site in my previous post . Now, after intensive googling, it looks like it may be related to multiple threads or forked processes using the same connection to MySQL. Apparently it can confuse MySQL. Children should create their own connections after spawning. If Django does reuse connections, it may be possible to fix it. Otherwise, CGI is the way to go. The latter solution would be slow. -
Django and MySQLdb worries
I am totally at loss. I am getting weird errors like this: OperationalError: (2013, 'Lost connection to MySQL server during query') They are pretty much random but fairly frequent. Apparently it may be caused by different MySQL timeouts, which I cannot control. It seems that in order to combat those you have to call connection.ping() periodically to reconnect. I added them to Django’s MySQL handler and … now I am getting these errors during execution of connection.ping()! Bizarre! -
Dojo: 1st impression
The best thing about Dojo 0.1: it’s quite easy to create portable widgets. Such widgets work similar to Microsoft IE’s behaviors but they are even more self-contained. Dojo widgets can work with fragments of HTML and CSS, which will be inserted during the object creation. The event system is very elaborate. Of course Dojo is more than a simple widget factory. For example I didn’t try the I/O facility yet. -
New Design 0.1 is here!
New design is here. Well, some elements of it. I had bigger ideas, but CSS didn’t work reliably, and JavaScript option was in debugging mode. So I decided to update this site now and add other planned stuff later. One reason I postponed JavaScript thingy is I want to try Dojo . It looks like a good foundation for widgets. I am going to create a couple of them at least. If it works okay, I’ll be using it in other projects as well. Stay tuned. -
The Emerging Django Job Market
A company in Cincinnati, Ohio is looking for a web developer. Check out the framework they’re using: We are developing e-commerce sites based on Python and Django framework. Experience in Python, object oriented programming, MySql, PostgreSQL, and other web programming technologies is requested. This person would also be responsible for maintaining other scripts on various websites we maintain and host. The main focus will be on e-commerce development. It’s great to see jobs emerging for this amazing little framework that has been public for just a month and a half. This one popped up on a feedster search for django in my aggregator. I can’t wait to see where we are a year from now. -
New Design 0.1
New design is coming along nicely. Thank heaven for Photoshop, POV-Ray, and digital cameras! I need to work out a few quirks and I’ll be ready to create Django templates. Additionally I’ll create some custom tags to handle non-traditional formats. -
Django: Big Integer Fields
I submitted a patch to Django Ticket #399 (request for a bigint field type). It still needs testing but works at a quick glance on mysql. Here’s a shot of them in action from the admin interface (the input is just too small and just too big respectively): Update: BigIntegerField works perfectly on PostgreSQL but because it doesn’t have an unsigned integer type (that I can find), PostitiveBigIntegerField isn’t going to make it all the way up to 18,446,744,073,709,551,615 without using an arbitrary precision NUMERIC or mapping zero to -9,223,372,036,854,775,808. Both solutions are messy and it would be a shame to have the mysql and postgres backends behave so differently. As an aside, it looks like this is already the case with mysql’s IntegerFields being UNSIGNED while Postgres just checks to make sure that the integers are positive before inserting. The best solution would probably be to employ backend-specific range checking for these monsterous numbers. That way you won’t end up out of range in PostgreSQL but you’re also not penalizing MySQL for being able to count to 18 bajillion. At this point it would be safe to drop in BigIntegerField as is (as soon as I check it out … -
Upcoming Additions
As you can see blog is already operational. I am planning to add to it Comments, Trackbacks, and RSS/Atom support. Main page will be redesigned so it would include snippets from other applications and external sources. I am planning to change look and feel of this web site. Obviously what I have now is temporary. Upcoming applications: Lunch Box 3.0, picture gallery, personal news integrator. -
Using TinyMCE with Django's Admin
Update (3/13/2011): this article is obsolete now and preserved here mostly for its historic value. Nowadays I use Dojo’s dijit.Editor as a WYSIWYG HTML editor — it is more functional and much simpler to setup and extend. Read all gory details in Using Dojo Rich Editor with Django’s Admin . I decided to add a WYSIWYG editor to my admin portion of the site. Apparently you can find some nice open source WYSIWYG editors nowadays. Probably FCKeditor, Xinha and TinyMCE are the most prominent ones. Some people already tried different editors with Django, e.g., Xinha — http://www.socialistsoftware.com/?p=10 , TinyMCE — http://www.socialistsoftware.com/?p=8 . Now it’s my turn. -
Lorem Ipsum
Everytime I need to test a text layout or text style I am typing something like "qwerty" and duplicate it many times to make a paragraph. Then paragraph got duplicated as well. But I am really bored to see qwerty and usually it doesn’t simulate real text properly. To have something more realistic I go to any news site to "borrow" some text. Unfortunately sometimes I have to hunt for suitable text because the one I found has very short or too long paragraphs. -
1st Post, 4th Time
Time and again I create 1st post just to tear the system apart and start all over again. Let’s hope that this time is the last one. -
A note to web designers
When a job listing says it requires knowledge of web standards, don’t bother applying if you haven’t changed your markup since 1998. From the web page of a designer applying for the senior designer position at World Online: <META NAME=GENERATOR CONTENT="Adobe PageMill 3.0 Mac"> Dude, don’t even bother. (If your markup is better than that and you want to work for the best online news team in the world, why not apply? -
Django Model Syntax Change
Adrian has committed the Django model syntax changes. Current models will have to be rewritten — once — but the new syntax looks a lot cleaner and I think it will reduce the learning curve for newcomers to the platform. Be sure to check out the full documentation as well as a brief screencast highlighting the changes. I will do my best to update my CRUD Generic Views tutorial as soon as possible to reflect the syntax change. Update: Here’s the updated tasks.py -
A quick comparison
The Microsoft way Windows 2003 Server, Enterprise Edition: $3,999 Visual Studio.NET, Enterprise Edition: $2,499 per developer SQL Server, Enterprise Edition: $19,999 per processor Programming in an outdated, insecure, hard to use environment: priceless. The Linux way Debian Linux: free Apache 2.0: free PostgreSQL: free Perl/PHP/Python: free Programing in a fun, modern, secure environment: priceless. -
Sera's Pancakes
For three 3 eggs 2 cups flour 3/4 teaspoon baking powder 3/4 teaspoon salt 2 tablespoons sugar 1 - 1 1/2 cup milk 3 tablespoons melted butter For four 4 eggs 2 2/3 cups flour 3/4 teaspoon baking powder 1 teaspoon salt 3 tablespoons sugar 1 3/4 - 2 1/4 cup milk 4 tablespoons melted butter Combine eggs, flour, baking power, salt, sugar and the smaller amount of milk and whisk until smooth. -
Redirects in Django
While working on the authentication bits for a feed-reader application I'm writing (more on that later), I noticed that polipo ... -
Redirects in Django
While working on the authentication bits for a feed-reader application I'm writing (more on that later), I noticed that polipo ...