Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Class Based Views Part 3: DetailView and template_name Shortcut
The DetailView is an important class based view since it allows us to show off details of our data instead of just bits here and there. It is also very simple to use and will save you time. In this video you are also going to see a nice little shortcut with your templates to save you from writing a couple of extra lines.Watch Now... -
Class Based Views Part 3: DetailView and template_name Shortcut
The DetailView is an important class based view since it allows us to show off details of our data instead of just bits here and there. It is also very simple to use and will save you time. In this video you are also going to see a nice little shortcut with your templates to save you from writing a couple of extra lines.Watch Now... -
Mozilla Webdev’s Beer and Tell: April 16, 2012
In case you missed last month’s blog post, a Beer and Tell is a monthly Mozilla Webdev gettogether involving cool hacks and malted beverages. We try to structure it like a series of lightning talks and — because all work and no play makes web developers go crazy — some of us have a beer during. Some of the East Coast folks drink scotch instead, but it’s OK because it’s after 5pm in Toronto by then. We didn’t record this Beer and Tell (my bad!), but I thought I’d share what was presented. It was pretty gaming-focused and quite cool. Django Stats Admin Created by Michael Kelly, this nifty little app allows you to visualize any of your Django models with datetime fields in the Django Admin. It uses the flot JS library to create pretty charts and lets you specify date ranges. Michael’s currently working on abstracting the app out into a library that can be used with any Django app. Lisp -> DCPU-16 Compiler James Long, our resident Lisp champion, started off by telling us about 0x10c and the DCPU-16 assembly language in the game. It’s pretty cool stuff for gamers who are language geeks too. Of course, … -
Yet another tutorial for building a blog using Python and Django - part 5
In this instalment I’ll be showing you how we can make our blogging engine a little nicer to look at by adding some CSS and images, as well as expanding on Django’s templating system. First of all, let’s add some CSS to our blog. When developing a web app with Django, you should place static files such as stylesheets and images in a folder inside your app (not project) folder called static. My project is called DjangoBlog, and my app is called blogengine, so all my static content should go in DjangoBlog/blogengine/static/. Here’s the stylesheet, which I’ve saved as style.css: body { background-color: #f0f0f0; font-family: Arial, Helvetica, sans-serif; } #main { width: 800px; height: 100%; margin: 50px auto; } ul#pageList { margin: 0px; padding: 10px 0px 10px 0px; } ul#pageList li { display: inline; margin-right: 10px; font-size: 18px; } .post, .page { width: 600px; padding: 20px; margin-bottom: 20px; background-color: #ffffff; } In the same folder, I have a PNG icon for an RSS feed, and if you had some JavaScript files you wanted to use (such as a copy of jQuery), you would put them here too. Note that there’s nothing to stop you creating subfolders within /static, and in … -
Ginger Tech Stack
-
Ginger Tech Stack
Click here to see this post in it's natural habitat and to watch and leave comments. For our latest product, Ginger, we wanted to marry the real-time functionality we needed with the traditional Django stack we know and love. After some false starts and falling on our faces in the beginning, we ended with a stack we’re happy with and think will serve us well moving forward. Back-end This is our bread-and-butter. It’s Django and PostgreSQL running with Gunicorn behind Nginx. The biggest difference between this and your typical Django site is that it mainly serves as a REST API consumed by the front-end. We are using traditional Django views in a few places like login, logout, and user profiles, but the rest of the views are handled by the front-end. Using Django, we were able to quickly build the nuts-and-bolts parts of our site that didn’t require any special real-time functionality. A few of the important libraries we’re using: tastypie for building the REST API haystack backed by solr for search celery backed by Redis for task queueing misaka and pygments for text formatting easy-thumbnails and PIL for image thumbnailing Front-end Our front-end uses Backbone.js to handle most of … -
Django 1.4 admin image issues with S3 backed static files
This is going to be kind of obscure, but hopefully it helps someone. My current default setup for using S3 backed static files for Django broke when I upgraded to 1.4. The affect was that the admin media paths had been URL encoded so "/" was replaced with "%2F". https://s3.amazonaws.com/bucket_name/admin%2Fcss%2Fbase.css This caused images referenced in the css to fail because relative paths were interpreted (in Chrome at least) as being relative to the last unescaped slash instead of to /css. This also caused horizontal filters to fail as well. The Source The problem was exposed by a change in Django 1.4. Since Django no longer uses ADMIN_MEDIA_PREFIX, the storage system gets involved in creating the urls for the admin site media. I had been using a combination of the S3 Python library and django-storages. Django storages is basically doing the right thing, though it does have an opportunity to unescape the paths it gets from S3. The escaping itself is contained S3 library for Python, but I elected to take a different route to work around it. Solution My solution was to bypass the problem and switch S3Boto backend for django-storages. I have been using Boto for SES based email … -
Python Deployment Anti-Patterns
Deploying web applications is hard. No shiny continuous deployment talk and no DevOps coolness can change that. Or to use DevOp Borat’s words: “Is all fun and game until you are need of put it in production.“ There are some mistakes I see people doing again and again so I’d like to address them here. This article is also laying ground for the second part where I’ll describe the way we deploy Python applications. My background Before I start preaching, let me tell you a bit about me and what I do in order to give you some perspective from which I’m writing. I work for a German web hoster and domain registrar. And I’m deploying Python based applications all the time. Most parts of our infrastructure are built using Python. And those that aren’t, will be eventually. The sizes range from tiny glue to mission-critical APIs. We have legacy Pylons, new Pyramid, some Django and a lot of Twisted apps. And everything is seasoned with a hint of Celery. So if I say “application”, I don’t mean just some Django CRUD front end. Python lives in all layers here. And all layers have to be deployed somehow. Deploying so … -
Release 0.7.1
We just released LFS 0.7.1. This is a yet another bugfix release of the 0.7 branch. Changes Bugfix: fixed display prices for properties (Maciej Wi?niowski) Bugfix: fixed TinyMCE for several browsers (Maciej Wi?niowski) Bugfix: display credit card fields if the type of the selected payment method is credit card; issue: #191 Bugfix: fixed sorting of actions; issue #192 (Maciej Wi?niowski) Bugfix: fixed typos in docs; issue #193 Added: added documentation for Price Calculation field; issue #188 Updated: Polish translations (Maciej Wi?niowski) Information You can find more information and help on following locations: Documentation on PyPI Demo Releases on PyPI Source code on bitbucket.org and github. Google Group lfsproject on Twitter IRC LFS on EuroPython 2012 We are sprinting on this year's EuroPython in Florence. Don't hesitate to join us, see https://ep2012.europython.eu/p3/sprints/ and LFS sprint topics for more. -
Release 0.6.14
We just released LFS 0.6.14. This is a yet another bugfix release of the 0.6 branch. Changes Bugfix: fixed display prices for properties (Maciej Wisniowski) Bugfix: fixed TinyMCE for several browsers (Maciej Wisniowski) Bugfix: display credit card fields if the type of the selected payment method is credit card; #issue: 191 Information You can find more information and help on following locations: Documentation on PyPI Demo Releases on PyPI Source code on bitbucket.org and github. Google Group lfsproject on Twitter IRC LFS on EuroPython 2012 We are sprinting on this year's EuroPython in Florence. Don't hesitate to join us, see https://ep2012.europython.eu/p3/sprints/ and LFS sprint topics for more. -
First presentation of Skeltrack
I spent the first half of this week in the beautiful city of Évora, where I was born. The occasion was the Semana da Ciência e Técnologia (Science and Technology Week) of the University of Évora to which I was invited. I also ended up giving the organization a hand by asking Thomas Perl (the restless mind behind gPodder) and Lucas Rocha (well known GNOME developer now using his powers in Mozilla) who kindly accepted. Having participated in the organization of events during the University, I’m always happy to see these initiatives taking place. It was also great to spend a couple of days with the folks at my University and meet with old friends. About the talks, Thomas gave an overview of gPodder and the infrastructure used to manage the project. Lucas gave a really nice talk about what Mozilla is, what it does and why you should care; because of it, I ended up installing Firefox Mobile nightly build for Android and it has improved a LOT. My friend Luís Rodrigues (no blog because he’s a badass) talked about CERN, where he works. What an amazing place! He talked about how much CERN uses Python and Django to … -
LearnScripture.net launched
I've launched a new Bible memorization service, LearnScripture.net. It was inspired by the great language learning website memrise.com, and by a series that I was doing on Jesus' use of the Bible. I designed it with my congregation in mind, so it's child friendly, and also mobile-phone friendly, as well as being socially-oriented. Another unique selling point is good support for learning extended passages, rather than just individual verses. It's Django-powered, of course, and there are tons of people to thank. I'd particularly like to thank the many people who worked on Django ticket 2879 - live server support which landed in Django 1.4 - they are listed here, and especially Julien Phalip who pushed it through. My site uses a lot of javascript, and I think it simply wouldn't have been possible without being able to have Selenium tests integrated into my Django test suite. Unlike memrise.com, who, according to their faq have no idea how they are going to make money, I decided to make this a paid service, so it will hopefully support itself and support me a bit too (I'm in a small church, so currently have to supplement my salary with freelance programming work). You … -
django-sphinxdoc 1.1
Most Python projects use Sphinx for their documentation. And many (most?) Python powered websites use Django as framework. So there might be some people who use both Sphinx and Django. If you belong to this group and want to integrate the documentation of your projects into your Django powered website, django-sphinxdoc might be the app you’re searching for. Django-sphinxdoc can build and import your Sphinxdocumentation and provides views for browsing and searching it. You can see django-sphinxdoc in action be reading its documentation. What’s new in this version? [NEW] Support static and download files. [NEW] Additional context to search view so that project information is available in the template. [CHANGE] Updated some templates [FIX] Fixed a bug with the updatedoc command and ~ in paths. [FIX] Include all module index files. [FIX] Improved indexing behaviour [FIX] Improved behaviour when building the docs. You can find django-sphinxdoc in the Cheese Shop or at Bitbucket. -
django-sphinxdoc 1.1
Most Python projects use Sphinx for their documentation. And many (most?) Python powered websites use Django as framework. So there might be some people who use both Sphinx and Django. If you belong to this group and want to integrate the documentation of your projects into your Django powered website, django-sphinxdoc might be the app you’re searching for. Django-sphinxdoc can build and import your Sphinxdocumentation and provides views for browsing and searching it. You can see django-sphinxdoc in action be reading its documentation. What’s new in this version? [NEW] Support static and download files. [NEW] Additional context to search view so that project information is available in the template. [CHANGE] Updated some templates [FIX] Fixed a bug with the updatedoc command and ~ in paths. [FIX] Include all module index files. [FIX] Improved indexing behaviour [FIX] Improved behaviour when building the docs. You can find django-sphinxdoc in the Cheese Shop or at Bitbucket. -
django-sphinxdoc 1.0
Most Python projects use Sphinx for their documentation. And many (most?) Python powered websites use Django as framework. So there might be some people who use both Sphinx and Django. If you belong to this group and want to integrate the documentation of your projects into your Django powered website, django-sphinxdoc might be the app you’re searching for. Django-sphinxdoc can build and import your Sphinxdocumentation and provides views for browsing and searching it. You can see django-sphinxdoc in action be reading its documentation. What’s new in this version? You can now search the documentation (via Haystack). New management command updatedoc for importing and building JSON files from your documentation and updating Haystack’s search index. New model Document for JSON files. Renamed the App model to Project What’s planned for the future? Allow users to comment the documentation. You can find django-sphinxdoc in the Cheese Shop or at Bitbucket. -
Micawber, a python library for extracting rich content from URLs
OEmbed is a simple, open API standard for embedding rich content and retrieving content metadata. The way OEmbed works is actually kind of ingenious, because the only things a consumer of the API needs to know are the location of the OEmbed endpoint, and the URL to the piece of content they want to embed. YouTube, for example, maintains an OEmbed endpoint at youtube.com/oembed. Using the OEmbed endpoint, we can very easily retrieve the HTML for an embedded video player along with metadata about the clip: GET https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=nda_OSWeyn8 Response: { "provider_url": "https://www.youtube.com/", "title": "Leprechaun in Mobile, Alabama", "type": "video", "html": "<iframe width=\"459\" height=\"344\" src=\"https://www.youtube.com/embed/nda_OSWeyn8?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>", "thumbnail_width": 480, "height": 344, "width": 459, "version": "1.0", "author_name": "botmib", "thumbnail_height": 360, "thumbnail_url": "https://i.ytimg.com/vi/nda_OSWeyn8/hqdefault.jpg", "provider_name": "YouTube", "author_url": "https://www.youtube.com/user/botmib" } The oembed spec defines four types of content along with a number of required attributes for each content type. This makes it a snap for consumers to use a single interface for handling things like: youtube videos flickr photos hulu videos slideshare decks and many more A quick note on embed.ly If you click that last link in the list it will send you to http://embed.ly/ -- a service that launched a year or so … -
Micawber, a python library for extracting rich content from URLs
OEmbed is a simple, open API standard for embedding rich content and retrieving content metadata. The way OEmbed works is actually kind of ingenious, because the only things a consumer of the API needs to know are the location of the OEmbed endpoint, and the URL to the piece of content they want to embed. YouTube, for example, maintains an OEmbed endpoint at youtube.com/oembed. Using the OEmbed endpoint, we can very easily retrieve the HTML for an embedded video player along with metadata about the clip: GET https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=nda_OSWeyn8 Response: { "provider_url": "https://www.youtube.com/", "title": "Leprechaun in Mobile, Alabama", "type": "video", "html": "<iframe width=\"459\" height=\"344\" src=\"https://www.youtube.com/embed/nda_OSWeyn8?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>", "thumbnail_width": 480, "height": 344, "width": 459, "version": "1.0", "author_name": "botmib", "thumbnail_height": 360, "thumbnail_url": "https://i.ytimg.com/vi/nda_OSWeyn8/hqdefault.jpg", "provider_name": "YouTube", "author_url": "https://www.youtube.com/user/botmib" } The oembed spec defines four types of content along with a number of required attributes for each content type. This makes it a snap for consumers to use a single interface for handling things like: youtube videos flickr photos hulu videos slideshare decks and many more A quick note on embed.ly If you click that last link in the list it will send you to http://embed.ly/ -- a service that launched a year or so … -
Micawber, a python library for extracting rich content from URLs
A while ago I wrote about an awesome API for retrieving metadata about URLs called oembed. I'm writing to announce a new project I've been working on called micawber, which is very similar but with a cleaner API and not restricted to django projects. -
Micawber, a python library for extracting rich content from URLs
OEmbed is a simple, open API standard for embedding rich content and retrieving content metadata. The way OEmbed works is actually kind of ingenious, because the only things a consumer of the API needs to know are the location of the OEmbed endpoint, and the URL to the piece of content they want to embed. YouTube, for example, maintains an OEmbed endpoint at youtube.com/oembed. Using the OEmbed endpoint, we can very easily retrieve the HTML for an embedded video player along with metadata about the clip: GET https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=nda_OSWeyn8 Response: { "provider_url": "https://www.youtube.com/", "title": "Leprechaun in Mobile, Alabama", "type": "video", "html": "<iframe width=\"459\" height=\"344\" src=\"https://www.youtube.com/embed/nda_OSWeyn8?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>", "thumbnail_width": 480, "height": 344, "width": 459, "version": "1.0", "author_name": "botmib", "thumbnail_height": 360, "thumbnail_url": "https://i.ytimg.com/vi/nda_OSWeyn8/hqdefault.jpg", "provider_name": "YouTube", "author_url": "https://www.youtube.com/user/botmib" } The oembed spec defines four types of content along with a number of required attributes for each content type. This makes it a snap for consumers to use a single interface for handling things like: youtube videos flickr photos hulu videos slideshare decks and many more A quick note on embed.ly If you click that last link in the list it will send you to http://embed.ly/ -- a service that launched a year or so … -
Micawber, a python library for extracting rich content from URLs
OEmbed is a simple, open API standard for embedding rich content and retrieving content metadata. The way OEmbed works is actually kind of ingenious, because the only things a consumer of the API needs to know are the location of the OEmbed endpoint, and the URL to the piece of content they want to embed. YouTube, for example, maintains an OEmbed endpoint at youtube.com/oembed. Using the OEmbed endpoint, we can very easily retrieve the HTML for an embedded video player along with metadata about the clip: GET https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=nda_OSWeyn8 Response: { "provider_url": "https://www.youtube.com/", "title": "Leprechaun in Mobile, Alabama", "type": "video", "html": "<iframe width=\"459\" height=\"344\" src=\"https://www.youtube.com/embed/nda_OSWeyn8?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>", "thumbnail_width": 480, "height": 344, "width": 459, "version": "1.0", "author_name": "botmib", "thumbnail_height": 360, "thumbnail_url": "https://i.ytimg.com/vi/nda_OSWeyn8/hqdefault.jpg", "provider_name": "YouTube", "author_url": "https://www.youtube.com/user/botmib" } The oembed spec defines four types of content along with a number of required attributes for each content type. This makes it a snap for consumers to use a single interface for handling things like: youtube videos flickr photos hulu videos slideshare decks and many more A quick note on embed.ly If you click that last link in the list it will send you to http://embed.ly/ -- a service that launched a year or so … -
Schedule announced
I'm delighted to announce the talk schedule for DjangoCon Europe 2012. We have an exciting line-up of speakers and topics, on everything from helping provide data to relief agencies after a disaster to securing your Django sites, and I cannot wait for the conference to start.We received many excellent proposals covering a wide range of Django-related topics. It wasn't possible to include them all, so if yours was not selected, please do consider presenting a shorter version of it as a lightning talk.Lightning talks A lightning talk is delivered in a compact, highly-concentrated five-minute package. It's an art-form in itself, and a good lightning talk will have the conference buzzing with excitement.The lightning talks will be organised during the conference itself, so feel free to think up some good topics for them to be ready at the conference to sign up. -
Down the rabbit hole, profiling your Python code - Remco Wendt
-
Class Based Views Part 2: ListView and FormView
The ListView and FormView class based generic views are the first look we have at generic views with some power behind them which can really save us some code. The ListView is great for showing content and paginating said content with very little effort. While the FormView is great for dealing with class based forms without having to deal, to much, with the underlying request itself.Watch Now... -
Class Based Views Part 2: ListView and FormView
The ListView and FormView class based generic views are the first look we have at generic views with some power behind them which can really save us some code. The ListView is great for showing content and paginating said content with very little effort. While the FormView is great for dealing with class based forms without having to deal, to much, with the underlying request itself.Watch Now... -
Project Mwana in MobileActive
This past week, Project Mwana was a featured article on the site MobileActive. Project Mwana is a RapidSMS application that connects rural health clinic workers in Zambia and Malawi to HIV testing centers, increasing the collection and turn around time for results to over 50%. Tobias worked with the UNICEF Innovation team on the ground in Zambia and Malawi to assist with the systems architecture and training local developers to maintain the system. The RapidSMS platform allows the application to be easily scalable at a very affordable cost, making it one of the most efficient ways to connect people and send data between people. By the end of 2012, the goal is to have 250 clinics in Malawi using Project Mwana and complete coverage in Zambia by three years.