Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Things going on
We are currently in a maintenance and cleanup phase of Evennia, where bugs are found and reported and things are getting more and more stable as people learn and use the new features we merged a few months back.Overall though I must say the relatively big changes we did to the infrastructure (making Evennia into a full library and making a complete overhaul of the typeclass system behind the scenes) went over with surprising smoothness. There were a flurry of things to fix immediately after the devel-branch merger but no more than expected. For the big changes it really worked very well I think, with no big disaster stories. We have a few bugs lingering in the issue tracker that need to be addressed but nothing show-stopping. I have been a bit busy with various projects off-MUD so to speak. I was contracted for making the cover and illustration for a book (this is not hobby art for once, but a professional commission which I was quite excited to be asked to do). I also author and draw a fantasy comic as part of another project.I've not been slacking off on on the MUD side though: I have written and … -
Use closure for your Django context processors
The idea with template context processors in Django is to inject some defaults thing to be available when rendering a template that is rendered with a request. I.e. instead of...: def view1(request): context = { 'name': 'View 1', 'on_dev_server': request.get_host() in settings.DEV_HOSTNAMES } return render(request, 'view1.html', context) def view2(request): context = { 'name': 'View 2', 'other': 'things', 'on_dev_server': request.get_host() in settings.DEV_HOSTNAMES } return render(request, 'view2.html', context) And in your nominal templates/base.html you might have something like this: ... <footer> <p>&copy; You 2015</p> {% if on_dev_server %} <p color="red">Note! We're currently on a dev server!</p> {% endif %} </footer> ... Instead you do this trick; in your settings.py you write down the list of defaults plus the one you want to always have available: TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", "django.template.context_processors.static", "myproject.myapp.context_processors.debug_info", ) And to accompany that you define your myprojects/myapp/context_processors.py like so: def debug_info(request): return { 'on_dev_server': request.get_host() in settings.DEV_HOSTNAMES, } So far so good. However, there's a problem with this. Two problems in fact. First problem is that when all the templates in your big complicated website renders, it's quite possible that some pages don't need everything you set up in your context processors. That might mean a heck of a … -
Use closure for your Django context processors
The idea with template context processors in Django is to inject some defaults thing to be available when rendering a template that is rendered with a request. I.e. instead of...: def view1(request): context = { 'name': 'View 1', 'on_dev_server': request.get_host() in settings.DEV_HOSTNAMES } return render(request, 'view1.html', context) def view2(request): context = { 'name': 'View 2', 'other': 'things', 'on_dev_server': request.get_host() in settings.DEV_HOSTNAMES } return render(request, 'view2.html', context) And in your nominal templates/base.html you might have something like this: ... <footer> <p>&copy; You 2015</p> {% if on_dev_server %} <p color="red">Note! We're currently on a dev server!</p> {% endif %} </footer> ... Instead you do this trick; in your settings.py you write down the list of defaults plus the one you want to always have available: TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", "django.template.context_processors.static", "myproject.myapp.context_processors.debug_info", ) And to accompany that you define your myprojects/myapp/context_processors.py like so: def debug_info(request): return { 'on_dev_server': request.get_host() in settings.DEV_HOSTNAMES, } So far so good. However, there's a problem with this. Two problems in fact. First problem is that when all the templates in your big complicated website renders, it's quite possible that some pages don't need everything you set up in your context processors. That might mean a heck of a … -
Looking for Senior/Mid-Level Developers to Change the World!
2degrees, the world's leading collaboration platform for sustainable business, are currently looking for disciplined software developers to build and maintain Python/Django applications. We're fundamentally looking for team players who are able to produce well-crafted software (e.g., elegant design, self-explanatory code), whether or not they have prior experience with our stack (which we'd consider a big plus). To learn more about the software that we build, have a look at the Free Software projects that we host on our GitHub account. Recent projects include hubspot-contacts and python-recaptcha. Telecommuting 2-3 days a week is possible, as long as the successful candidates are able to work in our Oxford office the rest of the time. To learn more about these vacancies, head over to our careers page. -
Django Performance: 4 Simple Things
Django Performance: 4 Simple Things -
Two Scoops of Django 1.8 is Out!
I'm pleased to announce the "Early Release" of the Two Scoops of Django: Best Practices for Django 1.8 PDF ebook. Co-authored with Audrey Roy Greenfeld, the 1.8 edition of Two Scoops of Django is filled to the brim with knowledge to help make Django projects better. We introduce various tips, tricks, patterns, code snippets, and techniques that we've picked up over the years. What we didn't know or weren't certain about, we found the best experts in the world and asked them for the answers. Then we packed the result into a 500+ page book. What's Next? We'll be adding more material to the 1.8 edition in the near future, hence the term, "Early Release". Everyone who buys the 1.8 ebook from us gets all 1.8 ebook updates. Once we're happy with the ebook, we'll release a print paperback edition, scheduled for mid-to-late May. We'll have a ebook/print bundle. If you buy the Early Release ebook from us, you qualify for the bundle. Order You can purchase the "Early Release" Two Scoops of Django: Best Practices for Django 1.8 PDF ebook at the Two Scoops Press store. -
Two Scoops of Django 1.8 is Out!
I'm pleased to announce the "Early Release" of the Two Scoops of Django: Best Practices for Django 1.8 PDF ebook. Co-authored with Audrey Roy Greenfeld, the 1.8 edition of Two Scoops of Django is filled to the brim with knowledge to help make Django projects better. We introduce various tips, tricks, patterns, code snippets, and techniques that we've picked up over the years. What we didn't know or weren't certain about, we found the best experts in the world and asked them for the answers. Then we packed the result into a 500+ page book. What's Next? We'll be adding more material to the 1.8 edition in the near future, hence the term, "Early Release". Everyone who buys the 1.8 ebook from us gets all 1.8 ebook updates. Once we're happy with the ebook, we'll release a print paperback edition, scheduled for mid-to-late May. We'll have a ebook/print bundle. If you buy the Early Release ebook from us, you qualify for the bundle. Order You can purchase the "Early Release" Two Scoops of Django: Best Practices for Django 1.8 PDF ebook at the Two Scoops Press store. -
Wagtail 1.0 (beta) best Django CMS?
Wagtail 1.0 (beta) best Django CMS? -
Newsletter #4
Welcome to the latest news about Two Scoops Press, PyDanny (Daniel Roy Greenfeld), and Audrey Roy Greenfeld (audreyr). Two Scoops of Django 1.8 Early Release Is Out The impossible has happened. We've decided to revise, update, and expand Two Scoops of Django for the Django 1.8 Long Term Support release. Today you can purchase the early release PDF. In mid to late May, we plan to release the print paperback version. Two Scoops of Django 1.8 Early Release PDF in our shop If you have any questions, please read the Two Scoops of Django FAQ. Into the Brambles Is Out In case you missed the news, Daniel's first fiction book is now out on Amazon. It's a dark epic fantasy novel titled Into the Brambles about the adventures of two brothers who grow apart, a goblin who rises to be king, and a noble woman who makes her own destiny. You can read more about Into the Brambles on Daniel's fiction blog. 2014-2015 Python/Django Community Efforts Here's a recap of our volunteer work. Open Source A number of the open-source projects that we maintain have reached important milestones. Cookiecutter, the popular cross-platform project templating tool created by Audrey, had its … -
Newsletter #4
Welcome to the latest news about Two Scoops Press, PyDanny (Daniel Roy Greenfeld), and Audrey Roy Greenfeld (audreyr). Two Scoops of Django 1.8 Early Release Is Out The impossible has happened. We've decided to revise, update, and expand Two Scoops of Django for the Django 1.8 Long Term Support release. Today you can purchase the early release PDF. In mid to late May, we plan to release the print paperback version. Two Scoops of Django 1.8 Early Release PDF in our shop If you have any questions, please read the Two Scoops of Django FAQ. Into the Brambles Is Out In case you missed the news, Daniel's first fiction book is now out on Amazon. It's a dark epic fantasy novel titled Into the Brambles about the adventures of two brothers who grow apart, a goblin who rises to be king, and a noble woman who makes her own destiny. You can read more about Into the Brambles on Daniel's fiction blog. 2014-2015 Python/Django Community Efforts Here's a recap of our volunteer work. Open Source A number of the open-source projects that we maintain have reached important milestones. Cookiecutter, the popular cross-platform project templating tool created by Audrey, had its … -
Newsletter #4
Welcome to the latest news about Two Scoops Press, PyDanny (Daniel Roy Greenfeld), and Audrey Roy Greenfeld (audreyr). Two Scoops of Django 1.8 Early Release Is Out The impossible has happened. We've decided to revise, update, and expand Two Scoops of Django for the Django 1.8 Long Term Support release. Today you can purchase the early release PDF. In mid to late May, we plan to release the print paperback version. Two Scoops of Django 1.8 Early Release PDF in our shop If you have any questions, please read the Two Scoops of Django FAQ. Into the Brambles Is Out In case you missed the news, Daniel's first fiction book is now out on Amazon. It's a dark epic fantasy novel titled Into the Brambles about the adventures of two brothers who grow apart, a goblin who rises to be king, and a noble woman who makes her own destiny. You can read more about Into the Brambles on Daniel's fiction blog. 2014-2015 Python/Django Community Efforts Here's a recap of our volunteer work. Open Source A number of the open-source projects that we maintain have reached important milestones. Cookiecutter, the popular cross-platform project templating tool created by Audrey, had its … -
Two Scoops of Django 1.8 is Out!
I'm pleased to announce the "early release" of the Two Scoops of Django: Best Practices for Django 1.8 PDF ebook. Co-authored with Audrey Roy Greenfeld, the 1.8 edition of Two Scoops of Django is filled to the brim with knowledge to help make Django projects better. We introduce various tips, tricks, patterns, code snippets, and techniques that we've picked up over the years. What we didn't know or weren't certain about, we found the best experts in the world and asked them for the answers. Then we packed the result into a 500+ page book. What's Next? We'll be adding more content to the 1.8 edition in the near future, hence the term, "early release". Everyone who buys the 1.8 ebook from us gets all 1.8 ebook updates. Once we're happy with the ebook, we'll release a print paperback edition, scheduled for mid-to-late May. We'll have a ebook/print bundle. If you buy the early release ebook from us, you qualify for the bundle. Order You can purchase the "early release" Two Scoops of Django: Best Practices for Django 1.8 PDF ebook at the Two Scoops Press store. -
PyCon 2015 Talks: Our Must See Picks (1/6)
Whether you couldn’t make it to PyCon this year, were busy attending one of the other amazing talks, or were simply too enthralled by the always popular “hallway track”, there are bound to be talks you missed out on. Thankfully, the PyCon staff does an amazing job not only organizing the conference for the attendees and the days of the conference, but also by producing recordings of all the talks for anyone who couldn’t attend. Even if you attended, you couldn’t have seen every talk, so these recordings are a great safety net. Because there are so many of them, I asked those who attended for suggestions. We will share our six favorites, one a week, for the next few weeks. Take some time to watch and learn from these talented speakers from Caktus staff who can’t stop talking about the great time they had in Montreal. Keynote by Jacob Kaplan-Moss Suggested by Technical Director Mark Lavin "Jacob's keynote on Sunday was amazing. He really breaks down the myth of the 10x programmer and why it hurts the tech community. Everyone should watch it. I came away from this talk thinking about how we could improve our hiring and review … -
Why did Caktus Group start Astro Code School?
Our Astro Code School is now officially accepting applications to its twelve-week Python & Django Web Development class for intermediate programmers! To kick off Astro’s opening, we asked Caktus’ CTO and co-founder Colin Copeland, who recently won a 2015 Triangle Business Journal 40 Under 40 Leadership Award, and Astro’s Director Brian Russell to reflect on the development of Astro as well as the role they see the school playing in the Django community. Why open the East Coast’s first Django and Python-focused code school? Colin: Technology is an important part of economic growth in the Triangle area and we wanted to make sure those opportunities reached as many residents as possible. We saw that there were no East Coast formal adult training programs for Django or Python, our specialities. We have experience in this area, having hosted successful Django boot camps and private corporate trainings. Opening a code school was a way to consolidate the training side of Caktus’ business while also giving back to the Triangle-area community by creating a training center to help those looking to learn new skills. Brian: Ultimately, Caktus noticed a need for developers and the lack of a central place to train them. The … -
Release 0.10.0
We just released LFS 0.10.0. Changes Adds Django 1.8 support 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 -
Caktus Group's Colin Copeland Recognized Among TBJ’s 40 Under 40
Caktus co-founder and Chief Technology Officer, Colin Copeland, is among an outstanding group of top business leaders to receive the Triangle Business Journal’s 2015 40 Under 40 Leadership Award. The award recognizes individuals for their remarkable contributions to their organizations and to the community. Colin was one of the co-founders of Caktus, started in 2007 around a second-hand Chapel Hill dining room table. Now, Caktus is the nation’s largest custom web and mobile software firm specializing in Django, an open source web framework. Caktus has built over 100 solutions that have reached more than 4 million lives. Clutch.io, a research firm, lists Caktus as one of the nation’s top web development firms. As a direct result of Colin’s guidance and vision, Caktus has built technology that not only helps business clients, but has addressed some of the most difficult global challenges facing us today: humanitarian aid for war refugees, HIV/AIDS, and open access to democracy, among others. Colin also served as UNICEF’s community coordinator for RapidSMS, a platform to build technology for developing nations quickly and freely. He used his experience as part of the Django open source community to lay the foundations of a global network of developers working … -
PyCon 2015 ReCap
The best part of PyCon? Definitely the people. This is my fifth PyCon, so I’ve had a chance to see the event evolve, especially with the fantastic leadership of Ewa Jodlowska and Diana Clarke. We were also lucky enough to work with them on the PyCon 2015 website. This year we were once again located in the Centre-Ville section of Montreal, close to lots of great restaurants and entertainment. Mark Lavin, David Ray, and Caleb Smith arrived before the official start of the conference to host a workshop on “Building SMS Applications with Django.” As avid users of RapidSMS for many of our of projects, including UNICEF’s Project Mwana and the world’s first SMS voter registration app for Libya, it was a great experience to share our knowledge. We also had a chance to work with future Django developers through the DjangoGirls Workshop this year. Karen Tracey, David Ray, and Mark Lavin served as mentors to help the mentees build their first Django app. It was wonderful to watch new programmers develop their first apps and we are looking forward to participating in similar events in the future. The conference kicked off Thursday night with a reception where we debuted … -
Now Launching: Astro Code School for Django and Python Education
Since moving to Durham in Fall 2014, we've been busy here at Caktus. We just finished renovating the first floor of our headquarters to bring the Triangle's (and East Coast's!) first Django and Python code school, Astro Code School. We're proud to say that the school is now officially open and we'll be celebrating with a public launch party on May 1st. I spoke with Colin Copeland, Caktus co-founder and Chief Technology Officer, about why Astro matters to Caktus and our region here in North Carolina: "The Triangle has seen an influx of people relocating here to be a part of a thriving technology sector. However, as business leaders, we have a responsibility to make sure innovation in the Triangle doesn’t leave people behind. For folks who have lived here and seen Durham and the rest of the Triangle evolve, we want to make sure they have the opportunity to be a part of the change. That starts with education, and that’s why we are opening the Astro Code School.” The Bureau of Labor Statistics predicts a 20% growth for web developer jobs from 2012-2022. That growth is twice the projected growth of all U.S. occupations for the same period. … -
Concurrency in Python vs GO
concurrency in Python vs GO At Pycon in Montreal few weeks ago I attended a talk that blew my mind away and got me thinking: Python concurrency from the Ground Up: LIVE! by David Beazley. The video is available on YouTube. The gist of the talk is that going from a synchronous to a concurrent program in Python requires a significant amount of leg work. The talk took a simple socket program that calculates the Fibonacci sum synchronously and tries to make it concurrent. It compares and contrasts various approachs: threads, multiple processes, and corountines. My take away was that there are a zillion ways of doing it in Python but none of them are great at taking advantage of multi cores. When I went through the process of typing the code used in his demo I decided for the fun of it to port it to Go. The first surprises for me was how similar the synchronous version is in both languages. The code and the micro benchmarks that follow should be taken with a grain of salt like always. Synchronous # synchronous.py from socket import * def fib(n): if n <= 2: return 1 else: return fib(n-1) + … -
Fast Immutable Python Deployments with Wheels
Alternate title: Pip 7 is Awesome, Here's Why A typical Python deployment looks like this: Pave the server, setting up a virtualenv and installing any pre-requisites necessary to build/install the Python requirements (compiler, development headers, etc.). To update to a new release: Update your source code Install its dependencies into the virtualenv via something like pip install -r requirements.txt This approach works, but is lacking in a few ways: Deployments are dependent on the network and availability of PyPI. "Clean" installs are prohibitively slow to do on every deploy. Because of that: You can't easily/quickly rollback to a previous release. The virtualenv will accrue cruft over time as dependencies are added/removed. Docker solves a number of these problems, but for many reasons I'm not sold on using it in production (yet). The good news is that today's release of Python's package installer, pip (version 7), will help you solve all these issues without Docker. It uses Python's wheel format to cache binary builds of the dependencies. Wheels are extremely fast, particularly for packages that require compilation (Pillow, psycopg2, lxml, etc.) "How fast?" you may ask... Well, let's look at a few examples using our fork of the Wagtail demo project … -
Release 0.9.0
We just released LFS 0.9.0. This is a bugfix release. Changes Replaced deprecated mimetype with content_type (Pigletto) Added lfs_regenerate_thumbs command (Sasha Vincic) Added links from property group property tab to properties See README.txt for more changes. 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 -
Project Repositories Have Moved to GitHub
With Google announcing last month that they are shutting down Google Code I have moved my old and unloved code repositories to GitHub. The main code base that seems to still be in use by others is the Django Full Serializer which I may split out into its own repository one day. -
Saving Data from Strava
Getting data can be easy. Effectively saving it from one source to your database can be a pain. In this video we explore a way to get data from Strava and save it to our database with as little future trouble as possible.Watch Now... -
strftime for datetime before 1900 year
Recently I’ve got an error for birthdays before 1900 year 1 ValueError: year=1890 is before 1900; the datetime strftime() methods require year >= 1900 for this code: 1 2 import datetime datetime.date(1890,7,1).strftime('%d.%m.%Y') And it’s described in the documentation The full set of format codes supported varies across platforms, because Python calls the platform C library’s strftime() function, and platform variations are common. To see the full set of format codes supported on your platform, consult the strftime(3) documentation. The exact range of years for which strftime() works also varies across platforms. Regardless of platform, years before 1900 cannot be used. One of the ways to solve this: 1 2 birthday = datetime.date(1890,7,1) '{0.day:02d}.{0.month:02d}.{0.year:4d}'.format(birthday) -
Python Praise
How I moved from PHP to Django