What's new in Django community blogs?

DSF calls for volunteers

Jan 31 2015 [Archived Version] □ Published at The Django weblog

The Django Software Foundation is looking for volunteers from the community to serve on two committees - the Grants committee, and the Code of Conduct committee.

Code of Conduct

About 2 years ago, a team of people led by Jacob Kaplan-Moss started developing a Code of Conduct for the Django community. Since that Code was delivered, the same committee has been managing the small number of complaints that have been made.

However, some concerns have been raised about the diversity of the committee - while there's a 50/50 gender split, it's currently all US citizens, and 3 of the 4 are white. There's no representation of non-US, Hispanic, African American, Aboriginal (of any origin), LGBT, or any other diversity group. It's probably not possible to represent every diversity group, but the group would benefit from having more diversity than it currently has.

The tight-knit nature of our community has also led to questions about how to handle conflicts of interest - complaints where someone on the Code of Conduct committee has close ties to the people involved in an incident, or (in a hypothetical worst case) is the subject of a complaint themselves. Our existing policies would benefit from improved procedures regarding the handling of conflicts where such conflicts exist.

A couple of members of the founding committee have also expressed an interest in standing down, so they can focus on other things.

Therefore, we're looking for 3-4 volunteers to address some immediate policy concerns, and longer term, handle reports of Code of Conduct issues.

Code of Conduct issues are obviously sensitive, and we're looking to achieve some specific goals in our representation. If you're interested in volunteer for the Code of Conduct committee, please get in touch, and tell us a little about yourself. The DSF board and the existing Code of Conduct committee will review the applicants to find the best fit. We'd also like you to suggest people in the community who you think might be good candidates, but may not see this call for help.

Grants

Given the recent success of the fundraising committee, and the impending need to organize grants for this year's DjangoCons, we're asking for volunteers to help us spend some of the money we've raised!

People on this committee will be tasked with determining who gets a financial grant from the DSF. You'll have a budget to spend; in return, you'll be required to develop a set of policies and guidelines for determining grant allocations, and manage the grant application process. There are also some possibilities of collaboration with other groups with Django-related funding goals to ensure that everyone in our community gets as much help as we can give them.

As with the Code of Conduct committee, we need 3-4 volunteers to take on a permanent role of deciding grant policies, and managing the ongoing grant application process.

Summary

If you're interested in serving on either of these committees, please get in touch. Or, if you're not interested in either of these roles, but you might be interested in volunteering in other ways, please join the DSF Volunteers mailing list.


How to Find the Performance Bottlenecks in Your Django Views?

Jan 30 2015 [Archived Version] □ Published at DjangoTricks under tags  advanced performance programming python

Once you have your Django projects running, you come to situations, when you need to optimize for performance. The rule of thumb is to find the bottlenecks and then to take action to eliminate them by more idiomatic Python code, database denormalization, caching, or other techniques.

What is a bottleneck? Literally it refers to the top narrow part of a bottle. In engineering, bottleneck is a case where the performance or capacity of an entire system is limited by a single or small number of components or resources.

How to find these parts of your code? The most trivial way is to check the current time before specific code execution and after that code execution, and then count the time difference:


from datetime import datetime
start = datetime.now()
# heavy execution ...
end = datetime.now()
d = end - start # datetime.timedelta object
print d.total_seconds() # prints something like 7.861985

However, measuring code performance for Django projects like this is inefficient, because you need a lot of such wrappers for your code until you find which part is the most critical. Also you need a lot of manual computation to find the critical parts.

Recently I found line_profiler module that can inspect the performance of the code line by line. By default, to use line_profiler for your functions, you should decorate them with @profile decorator and then to execute the script:


$ kernprof -l some_script_to_profile.py

This script will execute your script, analize the decorated function, and will save results to a binary file that can later be inspected with:


$ python -m line_profiler some_script_to_profile.py.lprof

That's quite complicated, but to use line_profiler for Django views, you can install django-devserver which replaces the original development server of Django and will output the performance calculations immediately in the shell like this:


[30/Jan/2015 02:26:40] "GET /quotes/json/ HTTP/1.1" 200 137
[sql] 1 queries with 0 duplicates
[profile] Total time to render was 0.01s
[profile] Timer unit: 1e-06 s

Total time: 0.001965 s
File: /Users/archatas/Projects/quotes_env/project/inspirational/quotes/views.py
Function: quote_list_json at line 27

Line # Hits Time Per Hit % Time Line Contents
==============================================================
27 def quote_list_json(request):
28 1 2 2.0 0.1 quote_dict_list = []
29 2 1184 592.0 60.3 for quote in InspirationQuote.objects.all():
30 1 1 1.0 0.1 quote_dict = {
31 1 1 1.0 0.1 'author': quote.author,
32 1 1 1.0 0.1 'quote': quote.quote,
33 1 363 363.0 18.5 'picture': quote.get_medium_picture_url(),
34 }
35 1 1 1.0 0.1 quote_dict_list.append(quote_dict)
36
37 1 42 42.0 2.1 json_data = json.dumps(quote_dict_list)
38 1 370 370.0 18.8 return HttpResponse(json_data, content_type="application/json")

The most interesting data in this table is the "% Time" column, giving an overview in percentage which lines of the Django view function are the most time-consuming. For example, here it says that I should pay the most attention to the QuerySet, the method get_medium_picture_url() and the HttpResponse object.

To setup line profiling, install line_profiler and django-devserver to you virtual environment:


(myproject_env)$ pip install line_profiler
(myproject_env)$ pip install django-devserver

Then make sure that you have the following settings in your settings.py or local_settings.py:


# settings.py
INSTALLED_APPS = (
# ...
'devserver',
)

MIDDLEWARE_CLASSES = (
# ...
'devserver.middleware.DevServerMiddleware',
)

DEVSERVER_MODULES = (
'devserver.modules.sql.SQLRealTimeModule',
'devserver.modules.sql.SQLSummaryModule',
'devserver.modules.profile.ProfileSummaryModule',

# Modules not enabled by default
'devserver.modules.profile.LineProfilerModule',
)

DEVSERVER_AUTO_PROFILE = True # profiles all views without the need of function decorator

When you execute


(myproject_env)$ python manage.py runserver

it will run the development server from django-devserver and for each visited view, it will show the analysis of code performance. I have tested this setup with Django 1.7, but it should work since Django 1.3.

Do you know any more useful tools to check for performance bottlenecks?


Account Control part 1

Jan 30 2015 [Archived Version] □ Published at GoDjango Screencasts and Tutorials

This is the first in a series of videos on creating a product which utilizes other services to help your users stay informed. We start the series with getting our users setup with an account, and giving them the ability to log in and out.
Watch Now...


New Django Team Members for January 2015

Jan 30 2015 [Archived Version] □ Published at The Django weblog

The Django team is thrilled to announce the addition of two new members.

For those who don't know them, Ola Sendecka and Ola Sitarska have been a fixture of our community for several years now.

They have organized numerous Django events in Europe (some of you still probably remember the famous Django Circus). Last year, they also started the Django Girls community which has grown immensely (so far, there have been 18 workshops in 4 continents and more are to come). More recently, they've also been instrumental in shipping the new redesign of the Django website as well as our latest fundraising campaign.

Ola Sendecka will soon be living in London, UK and works remotely for Legalsense. She's also co-organized numerous Django sprints in Krakow, Poland.

Ola Sitarska also lives in London where she makes awesome things happen at Potato. Amongst many other events, she's on the organizing committee of the upcoming DjangoCon Europe where she's focusing her efforts on diversity and outreach.

We couldn't be more grateful for their contributions and we look forward to have them share their enthusiasm and talent with the rest of the team.


Building Conda Packages for Multiple Operating Systems

Jan 30 2015 [Archived Version] □ Published at pydanny under tags  binstar conda cookiecutter packaging pypi

On the Cookiecutter project, recently we added conda to the open source packaging systems we officially support (You can find Cookiecutter on PyPI, homebrew, and apparently some Linux distros).

Creating a conda recipe from a PyPI package

Prequisites:

Once those are ready, create a conda recipe for Cookiecutter.

$ conda skeleton pypi cookiecutter

This will create a conda recipe, which is a directory named cookiecutter that contains several text files.

Inside the new cookiecutter recipe directory, find the meta.yaml file and change the appropriate sections to have this content:

source:
    # Change to match the most recent release
    git_tag: 0.9.1
    git_url: https://github.com/audreyr/cookiecutter.git

package:
    name: cookiecutter
    version: {{ environ['GIT_DESCRIBE_TAG'] }}

build:
    number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}

    # Note that this will override the default build string with the Python
    # and NumPy versions
    string: {{ environ.get('GIT_BUILD_STR', '') }}

Building a conda package

Use the conda recipe to build a package for my operating system (in this case, Mac OS X):

$ conda build cookiecutter

This creates a Cookiecutter conda package at ~/miniconda/conda-bld/osx-64/cookiecutter-0.9.1_BUILDNUM.tar.bz2.

Note: The official conda recipe for cookiecutter is at https://github.com/conda/conda-recipes/tree/master/cookiecutter.

Converting the conda package to other systems

Let's convert that to Windows and Linux systems:

$ conda convert ~/miniconda/conda-bld/osx-64/cookiecutter-0.9.1_BUILDNUM.tar.bz2 -p all

This creates five new directories, each with a new package. It looks something like this:

$ ls
linux-32
linux-64
osx-64
win-32
win-64

Each one of these directories contains a conda build also named cookiecutter-0.9.1_BUILDNUM.tar.bz2.

Note: I never left the Mac OSX operating system, yet I have packages that are pretty much garaunteed to work on Windows and Linux. That said, Cookiecutter is pure python and it's dependencies already have conda packages. I haven't tried this yet on anything that includes compiling C or C++, much less Fortran.

Uploading conda packages to Binstar

With these packages created, it's time to upload them to binstar, the primary conda package index.

First, register your binstar account.

Then use conda to install the binstar client:

$ conda install binstar

Finally, start uploading the new packages:

$ binstar upload linux-32/cookiecutter-0.9.1-BUILDNUM.tar.bz2
$ binstar upload linux-64/cookiecutter-0.9.1-BUILDNUM.tar.bz2
$ binstar upload osx-64/cookiecutter-0.9.1-BUILDNUM.tar.bz2
$ binstar upload win-32/cookiecutter-0.9.1-BUILDNUM.tar.bz2
$ binstar upload win-64/cookiecutter-0.9.1-BUILDNUM.tar.bz2

Check out the results of my work or take a look right below at what's on binstar:

http://pydanny.com/static/packages.png

Try installing Cookiecutter with conda!

If you have conda installed, you should be able to get Cookiecutter thus:

$ conda config --add channels https://conda.binstar.org/pydanny
$ conda install cookiecutter

Summary

Writing about how to package software is hard, so figuring this out was a bit of detective work. I think that's going to change, as the company behind conda, Continuum Analytics has stated their intentions to improve conda's documentation. Furthermore, just as many for-python cookiecutter templates include carefully researched setup.py modules for use with distutils, in 2015 I think we'll begin to see many of these templates include carefully research conda recipes and instructions.

Many thanks go to Fernando Perez for inspiring me to actually delve into conda. Travis Swicegood gave me some useful pointers. Last, but not least, none of this would have been figured out without the help of Wes Turner.

Updates

  • 2015/01/30 - Wes Turner corrected a couple typos in the conda command statements.


Astro Code School Tapped to Teach App Development at UNC Journalism School

Jan 29 2015 [Archived Version] □ Published at Caktus Blog

Our own Caleb Smith, Astro Code School lead instructor, is teaching this semester at UNC’s School of Journalism, one of the nation’s leading journalism schools. He’s sharing his enthusiasm for Django application development with undergraduate and graduate media students in a 500-level course, Advanced Interactive Development. For additional details about the course and why UNC...


Python Meeting Düsseldorf - New Videos Online

Jan 29 2015 [Archived Version] □ Published at eGenix.com News & Events

The following text is in German, since we're announcing videos available from a regional user group meeting in Düsseldorf, Germany.

Was ist das Python Meeting Düsseldorf ?

Das Python Meeting Düsseldorf ist eine Veranstaltung, die alle drei Monate in Düsseldorf stattfindet und sich an Python Begeisterte aus der Region wendet.

Bei jedem Treffen werden Vorträge gehalten und anschließend in Diskussionen vertieft. Die Meetings dauern üblicherweise ca. 2 Stunden und münden anschließend in eine Restaurant-Session.

Teilnehmer kommen aus ganz Nordrhein-Westfalen, hauptsächlich allerdings aus der näheren Umgebung.

Neue Videos

Um die Vorträge auch für andere Python Enthusiasten zugänglich zu machen, nehmen wir die Vorträge auf, produzieren daraus Videos und laden diese auf unseren PyDDF YouTube Channel hoch.

In den letzten Tagen haben wir die Videos der letzten Treffen aufgearbeitet. Insgesamt sind 34 neue Videos dazugekommen. Viel Spaß damit:

Python Meeting Düsseldorf 2015-01-20

Python Meeting Düsseldorf 2014-09-30

Python Meeting Düsseldorf Sprint 2014 (2014-09-27/28)

Python Meeting Düsseldorf 2014-07-02

Python Meeting Düsseldorf 2014-04-29

Python Meeting Düsseldorf 2014-01-21

Python Meeting Düsseldorf 2013-11-19


Die vollständige Liste aller mehr als 70 Python Meeting Videos ist über unsere Video Liste verfügbar.

Weitere Informationen

Weitere Informationen und Termine rund um das Python Meeting Düsseldorf stehen auf unserer Webseite:

              http://pyddf.de/

Viel Spaß !

Marc-Andre Lemburg, eGenix.com


Solinea is looking for a Senior Backend Engineer (Python, Django, Elasticsearch)

Jan 28 2015 [Archived Version] □ Published at Seek Nuance under tags  django jobs python uncategorized

This is my second week at Solinea, and I’m loving it! A position just opened up on our development team for a backend developer, and I wanted to share the love. :-) The company supports remote employees. Its headquarters is in Berkeley, CA, and I’m in Seattle, and I feel more connected now than, well, …

Read More


Bugfix releases issued: 1.7.4 and 1.4.19

Jan 27 2015 [Archived Version] □ Published at The Django weblog

Today we're issuing bugfix releases in the 1.7 and 1.4 release series (the latter to correct a regression in the latest security release).

Details can be found in the release notes:

The release packages and checksums are available from our downloads page, as well as from the Python Package Index. The PGP key ID used for this release is Tim Graham: 1E8ABDC773EDE252.


Django Logging Configuration: How the Default Settings Interfere with Yours

Jan 27 2015 [Archived Version] □ Published at Caktus Blog

My colleague Vinod recently found the answer on Stack Overflow to something that's been bugging me for a long time - why do my Django logging configurations so often not do what I think they should? Short answer If you want your logging configuration to behave sensibly, set LOGGING_CONFIG to None in your Django settings,...


Django Fellowship fundraising goal achieved!

Jan 27 2015 [Archived Version] □ Published at The Django weblog

YAY! Thanks to the amazing help from the Django community all over the world, we just crossed the Django Fellowship Fundraising campaign goal of US $30,000 with a significant donation from the Django Under The Hood conference and the Django Dutch Association.

You. Are. All. Awesome.

We are incredibly grateful for your continuous support and encouragement. More than 150 companies and individuals helped us to continue the Django Fellowship Program in just under 6 days. This exceeds all of our wildest expectations. The Django community is what makes all the work that the contributors and volunteers put into development of Django worthwhile. Thanks to you, we will be able to develop and maintain Django in a more stable and consistent way, with better code reviews and timely releases.

The next goal

Of course, there is always more that can be done and we don’t want to stop here. We also realize that ending this campaign just after 6 days would mean that lots of people and companies would not get an opportunity to contribute and help the cause they care about.

This is why we’ve decided to extend the goal to US $50,000, which would allow the Django Software Foundation to expand the program even further.

Once we reach the goal of US $50,000, we will focus on making the program sustainable by making it easy for everyone to create a smaller recurring donation and fill the Django heart with pixels of love on a monthly basis. This will allow the Foundation to carry on with the work without contributing a significant resources and time for fundraising campaign every quarter.

Help us spread the word

Despite an amazing effort coming from the whole community, we know that our message hasn't reached everyone yet. And there are a lot more Django users and companies that can help us make it happen. So please, talk to the companies you work for and let us know how we can help them. There are always alternative ways to donate or partner with the Django Software Foundation. We would be more than happy to find a solution that works for everyone and we’re very open to hear your thoughts. Get in touch with us here.


We’re launching a Django code school: Astro Code School

Jan 26 2015 [Archived Version] □ Published at Caktus Blog

One of the best ways to grow the Django community is to have more high-quality Django developers. The good news is that we’ve seen sharply increasing demand for Django web applications. The challenge that we and many other firms face is that there’s much higher demand than there is supply: there aren’t enough high-quality Django...


[Django CMS] Adding plugins inside plugins programatically

Jan 23 2015 [Archived Version] □ Published at Programmer blog under tags  add backend cms django html

I have a task to migrate a website. Old one is plain HTML and new one is Django CMS. I have a script that parses an HTML page from old website in to CMS page and places it into proper place.
Task is to migrate all the page content (that is a CMS TextPlugin) into an interlinked pages setup. Like we have text

<p>blah blah </p><a href="/page/url">Text</a><p> some other text</p>

And I need to change it into CMS LinkPlugin that is nested inside of the TextPlugin. It have become a common standard in the Django CMS world now. Note we need to have a LinkPlugin because of the requirement to interlink pages.
E.g. <a href="/page/url"> is a link to CMS Page object.

The solution is divided into two major parts. First we need to have the link plugin added to a placeholder of the text plugin. It must also be nested by the TextPlugin, like Django CMS admin web UI would do.  So our plugin would look somehow like this in the CMS Page admin:
And the second is modifying the Text Plugin instance itself with placing Link plugin placeholders instead of <a></a> tags we have there.
In this particular example we have a placeholder named "content" and a page containing only one TextPlugin with text in it. We need to modify that text.
First we need to create an instance of a CMSPlugin that is attached to a proper placeholder and is nested in our TextPlugin instance. Creating a Link plugin (an instance of a configuration for that CMS plugin in practice) is a next step to achieve this.
That will be the part 2 of this article. Coming soon.





Why I Love Technical Blogging

Jan 23 2015 [Archived Version] □ Published at Caktus Blog

I love writing blog posts, and today I’m setting out to do something I’ve never tried before: write a blog post about writing blog posts. A big part of our mission at Caktus is to foster and help grow the Python and Django development communities, both locally and nationally. Part of how we’ve tried to...


Why you should donate to the Django fellowship program

Jan 23 2015 [Archived Version] □ Published at Greg Taylor under tags  django programming python

Disclaimer: I do not represent the Django Software Foundation in any way, nor has anything below been endorsed by the DSF. The following opinions are my own, unsolicited rambling.

If you hadn’t been looking for it specifically, you may have missed it. The Django Softare Foundation is running a fundraising effort for the new Django Fellowship program. It sounds like they’re still trying to figure out how to get the word out, so I wanted to do what I could to tell you why you should chip in.

This particular blog post is going to focus on encouraging (peer-pressuring) commercial Django users in particular, though enthusiasts are welcome to read along!

Humble beginnings

Django is free and open source. Just provide the expertise and the infrastructure and you can build just about whatever web powered contraption you’d like. So you end up doing just that.

Your first stop is the Django tutorial, written and maintained by a community of volunteers (just like the rest framework itself). You stumble along, slowly at first. Perhaps you find yourself frustrated at times, or maybe things move along at a faster pace. In no time, you’ve got "Hello World!" rendering, and here comes a business idea!

One hundred lines of code turns into a thousand, then five thousand, and beyond. You start seeing signups, and revenue begins to trickle in. You toil away at your codebase, making improvements and dealing with the "accidental features" that crept in during one of your late night dev sessions.

You could have built your business on one of any number of frameworks, but you chose Django. You like how it’s a very productive way to build a web app. You appreciate how it’s not impossible to find Django developers to work with you. There are probably some things you don’t like, but you might not have the time to work on fixing them yourself. You’re just busy shipping and growing.

But it could be better still!

You’re happily using Django, it serves you well. There are a few things you’d love to see fixed or improved, but you don’t really have the time or expertise to contribute directly. As luck would have it, all of the Django core developers have day jobs themselves. Things would progress much more quickly if we had someone working full-time on Django…

Enter: Django Fellowship Program. The idea is to fund at least one Django developer to work for the DSF part or full-time for a while. During this fellowship, said developer sets aside some or all of their other responsibilities to focus on improving Django. The DSF, in turn, pays the developer a fair (but low rate) for their work.

As per the Tim Graham’s recent retrospective blog post, we’ve see some huge leaps forward for the project during these fellowships. These are periods of focus and rapid improvement that everyone (including your business) benefit from.

The only problem is that we’re not going to see the benefits of this program unless it gets (and stays) funded. A well-funded fellowship program could mean one (or more) developers working on Django full-time at any given point in time. That would be huge for the project (and you and I).

Why you should donate

As a business, we are donating to the fellowship program to see one of our critical components improved. Due to the fellowship application process, you can be assured that your money will be paying a capable, trusted developer to get things done.

Consequently, you can view a donation to the Django Fellowship program as an investment with an almost assuredly positive return. If you are making money with Django, consider making a (potentially tax-deductible) investment in what may be the foundation of your business.

At the end of the first full day of fund-raising, there are precious few commercial donors listed in the "Django Heroes" leaderboard. Let’s help change that!

If you don’t hold the purse strings at your business, get in touch with someone who does and tell them about this investment with near-guaranteed returns.


django-planet aggregates posts from Django-related blogs. It is not affiliated with or endorsed by the Django Project.

Social Sharing

Feeds

Tag cloud

admin administration adsense advanced ajax apache api app appengine app engine apple aprendiendo python architecture articles asides audrey authentication automation backup bash basics bitbucket blog blog action day blogging book books buildout business cache capoeira celery celerycam celerycrawler challenges cherokee choices class-based-views cliff cloud cms code codeship coding command community computer configuration continuous deployment continuous integration couchdb coverage css custom d data database databases db debian deploy deployment deployment academy developers development devops digitalocean django djangocon django-nose django-readonly-site django-rest-framework django-tagging django templates documentation dojango dojo dotcloud dreamhost dughh eclipse education email encoding english error events extensions fabric facebook family fashiolista fedora field file filter fix flash flask form forms friends fun gae gallery games geek general gentoo gis git github gnome google google app engine gunicorn hack hackathon hacking hamburg haskell heroku holidays hosting howto how-to how-tos html http i18n image imaging indifex install intermediate internet ios iphone java javascript jobs journalism jquery json justmigrated linear regression linkedin linode linux mac machine learning mac os x math memcached mercurial meta migration mirror misc model models mod_wsgi mongodb months mozilla multi-language mvc mysql nelenschuurmans newforms news nginx nosql ogólne open source open-source orm osx os x ottawa paas performance philosophy php pi pil pinax pip piston planet plone plugin pony postgis postgres postgresql ppoftw presentation private programmieren programming programming &amp; internet project projects pycon pygrunn pyladies pypi pypy python python3 quick tips quora rabbitmq rails rant ratnadeep debnath redis refactor release request resolutions rest reusable app review rtnpro ruby science script scripting security server setup simple smiley snaking software software development south sphinx sql ssh ssl static storage supervisor svn sysadmin tag talk nerdy to me tastypie tdd techblog technical technology template templates template tags test testing tests tip tools tornado transifex travel tumbles tutorial tutorials twitter twoscoops typo3 ubuntu uncategorized unicode unittest unix usergroup uwsgi uxebu virtualenv virtualenvwrapper web web 2.0 web design &amp; development webdev web development webfaction whoosh windows wordpress work workshop znc