Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Extensions versioning a third option follow Django
After my previous post http://trbs.net/blog/2012/09/19/django-extensions-version-010-or-10/ and the many positive reactions I would like to suggest a third option. I didn't include this before because I wasn't yet sure if it would be a good option. But after some more thinking and reading Christophe31's suggestion which is very similar I think we should look seriously at the option :-) The idea is that we make Django Extensions follow the Django version numbers closely. This would mean bumping the version number to 1.4. With this scheme we would commit to the following in Django Extensions: * Django-Extensions 1.4 is compatible with Django 1.4 and it's deprecation timeline. * Django-Extensions will deprecate and update code on par with Django. (This would help us fix aka remove the tons of legacy/backwards compatibility hacks in the codebase) * A new version with bumped version number is released as soon as possible after a Django release. For a user it should be intuitive and clear that you should match the major version numbers of Django-Extensions to whatever version of Django you are using. This also solves questions like what version will support Python-3 or PyPy or deprecates using feature X. Some details would still need to … -
REST API creation with django-tastypie
django-tastypie is probably the best at the moment tool for REST API creation in Django applications. The code is on github and documentation is on readthedocs.org. With tastypie it's easy to create REST API that will allow easy web access to data stored in models - get, update, edit or delete. In this article I'll show some basic usage of tastypie. -
Load Testing with JMeter: Part 3 - Replaying Apache Logs
A while ago, I wrote a couple of blog entries about load testing with JMeter. I promised a third entry covering how to use JMeter to replay Apache logs and roughly recreate production load, but I never followed through with it. Today, I intend to rectify this grievous error. -
Django Extensions version 0.10 or 1.0
We are getting close to releasing a new version of Django Extensions to PyPi which means it's about time to bump the version number once again. Right now our version number is at 0.9 so the question becomes what do we use next ? We can go and continue to increment with +0.1 which will make this the 1.0 release. The thing for me with Django Extensions is that it's more a continuous process then something with 'stable' releases. What I mean is that as a collection of extensions there is really no such thing as a 'stable api/abi' as there is in a framework codebase like Django itself. So I don't mind either way. We can call it 1.0 and just increment that as long as we don't make any radical or major changes to the code base. Or just continue with the 0.x numbering for the time being. Please put your vote and/or thoughts about this in a comment at: https://github.com/django-extensions/django-extensions/issues/241 -
django CMS 2.3.2 released
-
Load Testing with JMeter: Part 3 - Replaying Apache Logs
Click here to see this post in it's natural habitat and to watch and leave comments. A while ago, I wrote a couple of blog entries about load testing with JMeter (Part 1 and Part 2). I promised a third entry covering how to use JMeter to replay Apache logs and roughly recreate production load, but I never followed through with it. Today, I intend to rectify this grievous error. Parsing your Apache Logs There is more than one way to do this, but my preferred method is to use a simple Python script to do some filtering of the Apache log file you want to use and to output the desired urls as a tidy CSV file. I am using the ‘apachelog’ module for this (also available as a gist): #!/usr/bin/env python """ Requires apachelog. `pip install apachelog` """ from __future__ import with_statement import apachelog import csv import re import sys from optparse import OptionParser STATUS_CODE = '%>s' REQUEST = '%r' USER_AGENT = '%{User-Agent}i' MEDIA_RE = re.compile(r'\.png|\.jpg|\.jpeg|\.gif|\.tif|\.tiff|\.bmp|\.js|\.css|\.ico|\.swf|\.xml') SPECIAL_RE = re.compile(r'xd_receiver|\.htj|\.htc|/admin') def main(): usage = "usage: %prog [options] LOGFILE" parser = OptionParser(usage=usage) parser.add_option( "-o", "--outfile", dest="outfile", action="store", default="urls.csv", help="The output file to write urls to", metavar="OUTFILE" ) parser.add_option( "-f", "--format", … -
Load Testing with JMeter: Part 3 - Replaying Apache Logs
A while ago, I wrote a couple of blog entries about load testing with JMeter (Part 1 and Part 2). I promised a third entry covering how to use JMeter to replay Apache logs and roughly recreate production load, but I never followed through with it. Today, I intend to rectify this grievous error. Parsing your Apache Logs There is more than one way to do this, but my preferred method is to use a simple Python script to do some filtering of the Apache log file you want to use and to output the desired urls as a tidy CSV file. I am using the ‘apachelog’ module for this (also available as a gist): #!/usr/bin/env python """ Requires apachelog. `pip install apachelog` """ from __future__ import with_statement import apachelog import csv import re import sys from optparse import OptionParser STATUS_CODE = '%>s' REQUEST = '%r' USER_AGENT = '%{User-Agent}i' MEDIA_RE = re.compile(r'\.png|\.jpg|\.jpeg|\.gif|\.tif|\.tiff|\.bmp|\.js|\.css|\.ico|\.swf|\.xml') SPECIAL_RE = re.compile(r'xd_receiver|\.htj|\.htc|/admin') def main(): usage = "usage: %prog [options] LOGFILE" parser = OptionParser(usage=usage) parser.add_option( "-o", "--outfile", dest="outfile", action="store", default="urls.csv", help="The output file to write urls to", metavar="OUTFILE" ) parser.add_option( "-f", "--format", dest="logformat", action="store", default=r'%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"', help="The Apache log format, copied … -
Goodbye django
It’s time to move on, on from Django to something else. I want to have a site that needs none or very little caretaking. Even if Gondor, Heroku et al make my work as a programmer much easier, but it’s not enough, I want things to be even easier. So I’m ditching Django and moving this blag to Pelican, a static site generator written in Python. Don’t worry, I will still use Django at work and for other projects, not just this one. -
Automated deployment with Ubuntu, Fabric and Django
A few months ago I started to play with Fabric and the result was a simple script that automates the creation of a new Django project. In the last months I continued my experiments and extended the script to a full stack for creation and deployment of Django projects. As the details behind the script like the project structure that I use and the server setup are a bit long I will keep this post only on the script usage and I will write a follow up one describing the project structure and server. So in a brief the setup that I use consist of Ubuntu as OS, Nginx as web server and uWSGI as application server. The last one is controlled by Upstart. The script is available for download at GitHub. In a wait for more detailed documentation here is a short description of the main tasks and what they do: startproject:<project_name> Creates a new virtual environment Installs the predefined packages(uWSGI, Django and South)) Creates a new Django project from the predefined template Creates different configuration files for development and production environment Initializes new git repository Prompts the user to choose a database type. Then installs database required packages, … -
Using vagrant for developing on OSX: why
All the years that I've used a mac, I've been doing my programming on the mac itself. OSX itself is a unix system, so that's fine. And with macports (or fink or that other one that I've forgotten) I can easily install the bunch of extra utilities that I need. When I worked with plone, this worked really well. The only external dependencies that you had to deal with were PIL (so: libjpeg-dev and friends) and sometimes lxml's libxslt/libxml dependencies. Especially lxml could give you grief on OSX, but with the use of the z3c.recipe.staticlxml recipe everything was fine. Django, which I work with now, is likewise easy to install and develop for on OSX. That is, until you get to geodjango. And we're using a whole lot of geo stuff in our websites, so you need a whole geo stack. Geos, gdal, mapnik. And often numpy and scipy. And spatialite instead of the bundled-with-python sqlite. All of this is just a big sudo apt-get install .... on ubuntu, but on OSX it is grief. I managed to get it working most of the time: I tried the kyngchaos packages first. Collecting everything and getting everything working with the right … -
Github filename convention for contributor information
I just saw a github blog post about contributing guidelines. If you place a CONTRIBUTING.txt (or .rst, or .md etc) in the root of your github repository, github will show a link to that file when someone adds an issue to the bug tracker (or when opening a pull request). Seems like a reasonable suggestion! So I tried it out in one of my open source projects. My main goals: I want it to sound friendly and welcoming. We actually want feedback and bug reports. Just sending an email is often easier and nicer. Especially if you just want to ask a question instead of adding a full-blown issue. When you're about to fix something yourself, I want to float a link to the developer information right in your face. How to run the tests. Explanation of the dependencies that are needed. That sort of stuff. So... this is my first try. Do you've got comments or tips? Do you think github's idea is handy? -
Nodejsconf 2012 Workshop - Conference - Hackathon ready for a 3-days Nodejs experience?
Nodejsconf 2012 Workshop - Conference - Hackathon ready for a 3-days Nodejs experience? (italian version below) The International European Node.js Conference, second edition, will be held on Saturday, November 10th in Brescia, Italy. Tickets are on sale: http://nodejsconf.it/#secIscrizione. Hurry up before they sell out like last year! We organized also two Node.js workshops the day before the conference, Friday November 9th. A beginner level workshop by Golo Roden and an advanced workshop by CleanCode (Gabriele Lana - Federico Galassi) http://nodejsconf.it/#secWorkshop Call for papers is open till Thursday September 20th and the final schedule will go online Tuesday September 25th. We would like to thank our bronze sponsors Ideato, CleanCode, the silver sponsor Incode, the gold sponsors Sintattica, Nearform and the platinum sponsors Libero Cloud and Microsoft Azure. We are also organizing an hackathon after the conference with TalentGarden, jsDay and Libero Cloud. Stay tuned, more info to come in the next days! The Libero Cloud platform will be used during the hackaton. The best hacks will be awarded with prizes and you can start using the Libero Cloud platform right now! You can get a 50€ voucher here. You also can try Windows Azure for free and the preview of Windows Azure Mobile … -
Nodejsconf 2012 Workshop - Conference - Hackathon ready for a 3-days Nodejs experience?
Nodejsconf 2012 Workshop - Conference - Hackathon ready for a 3-days Nodejs experience? body,.backgroundTable{ background-color:#eeeeee; } #contentTable{ border:0px none #000000; margin-top:10px; } .headerTop{ background-color:#26292e; border-top:0px none #000000; border-bottom:0px none #FFCC66; text-align:center; padding:0px; } .adminText{ font-size:10px; color:#333333; line-height:200%; font-family:Helvetica; text-decoration:none; } .headerBar{ background-color:#26292e; border-top:0px none #333333; border-bottom:0px none #FFFFFF; padding:0px; } .headerBarText{ color:#333333; font-size:30px; font-family:Helvetica; font-weight:normal; text-align:left; } .postcardBarText{ color:#333333; font-size:30px; font-family:Helvetica; font-weight:normal; text-align:center; } .title{ font-size:24px; font-weight:bold; color:#4A8797; font-family:Helvetica; line-height:150%; } .subTitle{ font-size:14px; font-weight:bold; color:#000000; font-style:normal; font-family:Helvetica; } .defaultText{ font-size:12px; color:#333333; line-height:150%; font-family:Helvetica; background-color:#FFFFFF; padding:20px; border:0px none #FFFFFF; } .footerRow{ background-color:#26292e; border-top:0px none #FFFFFF; padding:20px; } .footerText{ font-size:10px; color:#666666; line-height:100%; font-family:Helvetica; } a,a:link,a:visited{ color:#17488a; text-decoration:underline; font-weight:normal; } .headerTop a{ color:#26292e; text-decoration:none; font-weight:normal; } .footerRow a{ color:#465F5D; text-decoration:underline; font-weight:normal; } body,.backgroundTable{ background-color:#26292e; } (italian version below) The International European Node.js Conference, second edition, will be held on Saturday, November 10th in Brescia, Italy. Tickets are on sale: http://nodejsconf.it/#secIscrizione. Hurry up before they sell out like last year! We organized also two Node.js workshops the day before the conference, Friday November 9th. A beginner level workshop by Golo Roden and an advanced workshop by CleanCode (Gabriele Lana - Federico Galassi) http://nodejsconf.it/#secWorkshop Call for papers is open till Thursday September 20th and the … -
Forget print(), Use pdb Instead
How often do you use print statements to display output in your manage.py runserver process to help debug something? This was my go-to method of debugging for a long time. Then I was introduced to pdb. This is so much better and useful, especially when you have situations where you have to do a lot of things in your web application in order to reproduce the conditions you are trying to debug. Using pdb and the interactive debugger is as simple as putting: import pdb; pdb.set_trace() on the line that you want to start the debug session on. When you do this and you hit that line in the execution of your application, you'll see a prompt that looks like this in your manage.py runserver output: > /Users/paltman/dev/mywebsite/mywebsite/profiles/views.py(29)profiles_list() -> if request.user.is_superuser: (Pdb) From here you can issue single letter commands like n, c, or s, which stand or Next, Step Into, or Continue. Next (n) will simply take you to the next line of execution within the current context. Step Into (s) will jump a level deeper (if it makes sense), for example it will step into a function call being made instead of just executing it and returning the … -
django CMS 2.3.2 RC1 released
-
Thoughts after attending Djangocon
The Caktus team attending and having a great time at Djangocon! It's been one week since I posted my wrap-up of the first day at Djangocon, and although I didn't get the chance to cover each day individually I wanted to post a quick conference wrap up. Overall, the talks that I attended were consistently informative and engaging. The consensus of the Caktus team was that everyone attended talks that they walked away from with valuable knowledge or a new approach to developing. The after party events were well attended and due to the centralized location of the conference, it was very easy to try out a few different restaurants and socialize with our fellow conference goers. Djangocon continues to be one of the most enjoyable conferences that Caktus attends and we are already excited about next year! -
Thoughts after attending Djangocon
Click the image to view the entire gallery of the Caktus Team having a blast! It's been one week since I posted my wrap-up of the first day at Djangocon, and although I didn't get the chance to cover each day individually I wanted to post a quick conference wrap up. Overall, the talks that I attended were consistently informative and engaging. The consensus of the Caktus team was that everyone attended talks that they walked away from with valuable knowledge or a new approach to developing. The after party events were well attended and due to the centralized location of the conference, it was very easy to try out a few different restaurants and socialize with our fellow conference goers. Djangocon continues to be one of the most enjoyable conferences that Caktus attends and we are already excited about next year! -
DjangoCon 2012 Recap
DjangoCon 2012 Recap -
Suporte experimental ao Python 3
Suporte experimental ao Python 3 -
Suporte experimental ao Python 3
Suporte experimental ao Python 3 -
Migrating django.contrib.comments to Disqus
As of today I am using Disqus for comments on this site. This meant that I had to migrate the old comments (which used django.contrib.comments) to Disqus. Here’s a short description of how I did this. Obviously I’m not the first one doing this. As a matter of fact, the article Bye-bye django.comments, hello Disqus by Daniel Roseman provided a very good tip: use django-disqus. I just did not use the disqus-export command. Here’s what I did: I installed the app as described in the instructions. I added the required template tags to my templates and removed the old code to show the comments and the comment form. To migrate the old comments I created an additional feed to export the comments as WXR. In Disqus I imported the XML from the feed as a generic WXR. It was a smooth ride (it just took a little over 24 hours for the import to actually finish) and one less thing to do when I move to a static blog based on Acrylamid. -
Einladung zur Django-UserGroup Hamburg am 12. September
Das nächste Treffen der Django-UserGroup Hamburg findet am Mittwoch, den 12.09.2012 um 19:30 statt. Dieses Mal treffen wir uns wieder in den Räumen der CoreMedia AG in der Ludwig-Erhard-Straße 18 in 20459 Hamburg (3.OG). Da wir in den Räumlichkeiten einen Beamer zur Verfügung haben hat jeder Teilnehmer die Möglichkeit einen kurzen Vortrag (Format: Lightning Talks oder etwas länger) zu halten. Konkrete Vorträge ergeben sich erfahrungsgemäß vor Ort. Eingeladen ist wie immer jeder der Interesse hat sich mit anderen Djangonauten auszutauschen. Eine Anmeldung ist nicht erforderlich. Weitere Informationen über die UserGroup gibt auf unserer Webseite www.dughh.de. -
My Thoughts on DjangoConUS 2012
As I'm sitting in DCA with an hour delayed flight, I thought I should share some of my thoughts to my first DjangoCon, which was actually my first technical conference of any sort. In no particular order, I'll discuss the event categorically. These views are from my point of view as an attendee. Location Washington, D.C. (well, Arlington, VA technically) seemed like a fine location. I was able to arrive a couple days early and visit some of the national monuments and museums. This was a pretty cool experience because I've never been to D.C. before. Seeing all the the iconic sights of my nation's capitol was very interesting. I really enjoyed the Smithsonian museums that I had time to go to which included American History, Air and Space, and the American Indian Museum. All three of these venues had some awesome collections, all paid for by American tax dollars too, so you might as well go see them! The Hyatt Crystal City was an excellent hotel, the rooms were modern and clean, the ballrooms and conference areas fit our needs fine, although the Track 2 room was a bit on the smaller side. The catered lunches (via the Hyatt … -
Dissecting Phonegap's architecture
Apache Cordova is a open source cross-platform framework for building native mobile applications using HTML, CSS and JavaScript. It started off as Phonegap, a project of Nitobi Software before it was acquired by Adobe Systems. The code for the platform was donated to the Apache Software foundation and is currently being incubated as "Apache Cordova". Phonegap is now a distribution of Apache Cordova (analogous to Ubuntu being a Linux distribution) brought to you by Adobe. Since Apache Cordova is licensed under the permissive Apache Software License, Adobe Phonegap may technically be integrated with proprietary software (though there's no evidence for the same yet). This post is not going to discuss how to build a cross-platform mobile app using Phonegap and if you are here expecting that, you are better off checking their docs. In this post, we are going to see how Phonegap apps work ie how the javascript component is able to communicate with the native APIs and vice-versa. The Cordova guys have taken a lot of pain keep a consistent JS interface on the client side but underneath there is a large divergence between each platform. We are going to discuss the architectures of android and iOS since … -
Real-timify Django with SockJS
In yesterdays DjangoCon BDFL Keynote Adrian Holovaty called out that Django needs a Real-Time story. Well, here's a response to that: django-sockjs-tornado Immediately after the keynote I went and found a comfortable chair and wrote this app. It's basically a django app that allows you to run a socketserver with manage.py like this: python manage.py socketserver Now, you can use all of SockJS to write some really flashy socket apps. In Django! Using Django models and stuff. The example included shows how to write a really simple chat application using Django models. check out the whole demo here If you're curious about SockJS read the README and here's one of many good threads about the difference between SockJS and socket.io. The reason I could write this app so quickly was because I have already written a production app using sockjs-tornado so the concepts were familiar. However, this app has (at the time of writing) not been used in any production. So mind you it might still need some more love before you show your mom your django app with WebSockets.