Audrey M. Roy

Art, design, Python, JavaScript, and general silliness 

My Blog Has Moved to audreymroy.com/blog/

From now on, I'll be blogging at http://audreymroy.com/blog/.  Please update your RSS readers!

Also, by the way, if you haven't signed up at consumernotebook.com yet, please do!  That's my startup :)  I've been working on Consumer Notebook with Daniel Greenfeld since November 2011.  We're in private beta now.

Posted by Audrey M Roy 

Comments [3]

Kiwi PyCon, DjangoCon US, and PyCodeConf Recap

I just got back from a long conference circuit, attending and speaking at PyCon Australia, Kiwi PyCon, DjangoCon US, and PyCodeConf.  It was a ton of work, but it was a blast.

I got to blog about PyCon Australia already, but then the time in between the other conferences was just a bit too hectic to blog.  

Kiwi PyCon 2011

I gave the opening keynote speech at Kiwi PyCon in Wellington, New Zealand. The talk was meant to be mildly provocative but in an inspiring, "go out and code" kind of way.

Kiwi PyCon 2011 - Audrey Roy Keynote Speech
View more presentations from Audrey Roy

The Pythonistas of New Zealand are amazing. I met more Twisted devs than I've ever met in my life, attended tons of hardcore Python talks by women, and ones by men too, and learned all sorts of new things. I was also blown away by the hospitality of the conference organizers, particularly Tim McNamara and Richard Shea.

After the conference, I spent a couple of days going around the countryside and southern island coastal towns with Danny. It was spectacular.

DjangoCon US 2011

I co-presented the Django Package Thunderdome with Daniel Greenfeld. Here we presented the results of a survey of the most recommended third-party packages of the Django world.

Django Package Thunderdome by Audrey Roy & Daniel Greenfeld
View more presentations from Audrey Roy

I got to attend with several of the LA PyLadies as well as others whom I knew online through IRC #pyladies and the PyLadies Sponsorship Program. Hanging out in the unofficial PyLadies welcome suite was more fun than should be allowed :)

The DjangoCon US organizers (Sean O'Connor and Steve Holden) let us get away with tons of things, including selling "Djangsta" shirts to benefit PyLadies and setting up a PyLadies welcome table beside the registration desk.

PyCodeConf 2011

I attended and spoke at the first ever PyCodeConf, a new kind of Python conference with a radically different format. Speakers are invited to speak about whatever they desire relating to the theme ("The Future of Python"), in front of a room of round tables. In between talks there are long breaks to encourage discussion. As a result, talks are edgier, and you really get to know people and possibly shape the future together.

I gave a talk about how third-party package ecosystems either form and flourish or don't form, depending on various factors. I brought up packaging patterns and anti-patterns seen in the Python package ecosystem as well as those of other languages.

Amazing Things: Third-Party Python Package Ecosystems
View more presentations from Audrey Roy

This was a conference with a superstar lineup, including many notable woman speakers whom the organizers went out of their way to invite.  It was very thoughtfully planned by the organizers of CodeConf and JSConf (Tom Preston-Werner, Chris Wanstrath, and Chris Williams), and the attention to detail really showed.  

The informal chats and bonding during the after-hours parties made this conference especially worthwhile. There's something special about talking to other developers while you're in a 14th floor swimming pool.

Summary

Overall it was thrilling to get my thoughts out there and try to inspire people all over the world. It was also quite nerve-wracking and stressful, but I'm glad I did it.

I learned tons and am already applying much of that knowledge directly to projects at work at Cartwheel Web.  If your employer doesn't already send you to Python conferences, you should ask to be sent.  You come back with experiences, connections, and knowledge that are priceless.

Filed under  //   Django   DjangoCon   Kiwi PyCon   PyCodeConf   Python   conferences  
Posted by Audrey M Roy 

Comments [4]

Thank you, PyCon AU

I managed to squeeze my personal Python wishlist into this keynote speech about diversity in Python.  

More image processing options besides what we have in PIL 1.1.7, please.  More attempts at Python in the browser. More Python packages in general.  More diversity of Python packages.  More diverse Python open-source package authors from all walks of life.  

"There should be one -- and preferably only one -- obvious way to do it" is about the design of Python as a language, not about artifically limiting the diversity of packages.  Let's tap as many untapped resources as possible and try to grow the Python package ecosphere.

Pycon Australia 2011 Keynote - Audrey Roy
View more presentations from Audrey Roy

PyCon Australia was beyond amazing.  There is something special about the atmosphere there, a feeling of openness that promotes open discussion.  There was a talk by Richard Jones evaluating/comparing Python microframeworks, and a talk by Graham Dumpleton comparing web hosting mechanisms, including comparisons of web servers.  It was great to see these types of comparison/overview talks, and I think the friendly audience was what made presenting such topics possible.

I got to host the "Women in Python" breakfast and meet many of the thirty-five women who attended the conference.

Breakfast Breakfast
Breakfast

Also, I was thrilled to see several female speakers presenting interesting Python talks: Brianna Laugher giving a talk on Zookeeper (Pylons-based conference management software powering linux.conf.au), Georgina Wilcox and Katie M. Bell giving a talk about teaching Python, and of course Mary Gardiner of the Ada Initiative giving a keynote speech about Python open-source projects (Plover, Software Carpentry, Calibre, Sugar).  

Finally, it was great to talk to Elena Williams who was inspired to get started on organizing DjangoCon AU and co-organizing PyLadies groups in Australia with Jenny Nguyen and Kathleen O'Toole.  Also, I hear that Brianna Laugher and Rhydwyn are planning to teach a women's Python workshop in Melbourne, possibly with Melbourne PUG.  And Elena and Jenny may be starting Python user groups at their universities.  It's very exciting.

Filed under  //   Diversity   PyCon   PyLadies   Python  
Posted by Audrey M Roy 

Comments [5]

How to create Sphinx docs the Python / Github / Read the Docs way

This is a full walkthrough of how to document a Python package, using https://github.com/audreyr/django-startcbv as the sample package to be documented.  It probably works for non-Python packages too.

Follow along with documenting a Python package of your own.  Or try it with one of those poor, undocumented, lonely Python packages out there!

At the command line:

Enter something like the following at the prompts:

At the command line:

Add to docs/conf.py:

Add to your .gitignore file:

Create docs/ref_startcbv.rst:

Copy and paste your installation and usage instructions from README.rst into docs/installation.rst and docs/usage.rst.  I know it's annoying.  There's no good way to symlink your Github readme content to your Read the Docs Sphinx readme content (yet). 

Add to docs/index.rst so that it looks something like:

Commit and push it all to Github:

Go to readthedocs.com and create an account.  
Go to http://readthedocs.org/dashboard/import/
Enter something like the following:

Click Submit.

Now go to your project on Github (something like https://github.com/audreyr/django-startcbv) and click Admin > Service Hooks > ReadTheDocs.  Scroll up.  Check "Active".  Click "Update Settings".  From now on, whenever you do a "git push", your readthedocs.com / rtfd.org docs will be auto-updated.

That's it.  You're done.

Note: you may have also heard of hosting your docs on http://packages.python.org/.  It's another place to host docs but requires manual updating by the PyPI staff.  Personally, I like using ReadTheDocs instead, though, because:
  • the Github hooks keep my docs up-to-date without manual intervention.  Whenever I update my .rst files, I don't have to re-upload my docs!
  • the docs are easier to find via search engines
Also, whatever you do, don't use a wiki or a blog post for your package's official docs.  Informally taking notes on your blog like this is fine, but if you're writing up docs for your Python package, take the extra step of copying and pasting the text into ReStructuredText files and generating Sphinx docs.  Why? People will be more likely to use your package, and your users will all thank you for your diligent documentation efforts.

Finally, whenever you do something complicated without documenting it, imagine the documentation donkey (a cross between the Django pony and the Shrek donkey) kicking you the next time you can't figure out how to retrace your steps.

Filed under  //   Django   Github   Python   Read The Docs   Sphinx   documentation   git  
Posted by Audrey M Roy 

Comments [0]

Call to Action: PyLadies Seattle + Sydney, AU + Wellington, NZ

PyLadies is a worldwide community of ladies and supporting gentlemen who use the Python programming language.

We are currently putting together an open-source PyLadies kit.  I hope it'll help Pythonistas in various cities start their own local chapters.  There's not much in there yet, but there will be.  We'll be putting the contents up on Read the Docs (rtfd.org) shortly.
https://github.com/pyladies/pyladies-kit

I would like to help interested Python developers (hey women & men, I'm talking to you!) start PyLadies chapters in other cities, starting with inaugural PyLadies meetups on these dates.  Email me at audreyr@pyladies.com if you will be available, and suggest a few good times:

Seattle PyLadies
July 7 or 10, 2011

Sydney, Australia PyLadies
August 19 or 24, 2011

Wellington, New Zealand PyLadies
August 29, 2011

How this works:  This is a meetup for beginner through advanced Python developers who are interested in gender diversity.  It is not a workshop.  We'll get together somewhere, ideally at a local Python company willing to step forward and host the event.  (I'll thank you with all my heart for helping improve diversity in the Python world if your company hosts.)

I'll walk you through the kit and help you build a PyLadies chapter in your city.  I have some important tips and tricks to make it happen, including:
  • Get as many ladies as possible from the first 2 or so meetups to commit to being co-organizers.  The more people feel personally invested in the group from the start, the better.  2-10 is a good number.
  • If you're a gentleman, encourage the ladies to both lead and take credit.  Step back and take a supporting volunteer role.  Empower them by letting them become known leaders.  
We'll go around the room with introductions, telling each other a bit about what we all do.  

When we're done talking and planning, we'll go out for drinks to celebrate and start building friendships with other locals who care about diversity in Python.  

There's something magical about being in a room of female Python developers, or even just being a man in a room of Python developers where 60% are experienced female devs.  As your chapter grows, you'll see "Diversity as a Dependency" (as Anna Martelli Ravenscroft puts it) begin to happen in real life.

Filed under  //   Australia   New Zealand   PyLadies   Python   Seattle  
Posted by Audrey M Roy 

Comments [1]

Documentation-driven development is the future of Django

Or is it? Don't start this conversation when you're with the wrong
crowd of animals. You could get yourself into a lot of trouble.

Filed under  //   Django   Django Pony   Python   Scared of Rabbits   Testing Goat   documentation   testing  
Posted by email 

Comments [0]

I love this boy!

I met the amazing Danny Greenfeld last year and fell madly in love.  

Here we were tangoing at PyCon 2010.

2010-02-20 23.21.30

Here we are in front of the Lawrence Journal-World headquarters in Lawrence, KS, birthplace of the Django web framework. We love Lawrence!

Me and Audrey in front of Django's birthplace

Here he was doing djymnastics around me at Djangocon 2010.  (Thanks, Shawn Rider, for making this awesome video.)

Here we were at PyCon 2011 leading the Packaginator sprint together. Danny's on the left, cut off a bit by the camera, but you can see the smile on our faces.  If you zoom in and look closely, you can see that Danny's arm is around me.

Packaginator sprinters!

We wouldn't have found each other if not for the following things and people:

  • The PyCon 2010 diversity grant.  If not for this, I would have been shy to attend PyCon.  I applied for the grant on a whim.  When I got it, I was terrified of going and not knowing anyone, but I knew I had to go.
  • Gloria W. Jacobs, whom I shared a room with at PyCon and who encouraged me to go out and meet some of the amazing people at PyCon.
  • James Bennett and his Django tutorial at PyCon 2010, where Danny and I met for the first time.
  • Barbara Shaurette, whom I recognized from following her blog/Twitter and recognizing her bright red hair from her avatar.  She introduced me to Danny and is the real main reason we met, actually!  She was super nice when I asked to see her Django pony tattoo.
  • Jennifer Leech and her impromptu PyCon 2010 tango BOF hallway track that Saturday night.  Before then, I had shaken Danny's hand but had never embraced him.  Chris Adams and Tom Brander taking photos of us at this, which turned out to be our very first date.
  • Steve Holden and his PyCon 2010 party.
  • Katie Cunningham and Chris Adams encouraging us to be together at the party.
  • Zed Shaw for teaching us Argentine tango after he heard that we liked tango, and teaching me how to do a Judo hip throw simultaneously so that I could throw him happily.
  • Honza Kral for teaching Danny how to dip me properly.
  • James Tauber, Brian Rosner, the Pinax framework and the PyCon 2010 Pinax sprint.

Filed under  //   love   DjangoCon   PyCon  
Posted by Audrey M Roy 

Comments [0]

The penguin who owns example.com

2011-04-04-example-dot-com

Episode 1 of Scared of Rabbits.  I feel sad for this poor little bird.

Filed under  //   Django   Scared of Rabbits   illustration  
Posted by Audrey M Roy 

Comments [0]

How to apply those "failed" changes from your GitHub fork queue

This is what you do to apply "Will likely not apply cleanly" changes
in your GitHub fork queue.

git remote add ddurst http://github.com/ddurst/whydjango-ideas.git
git remote update
git pull ddurst master
git status
git push

Posted by Audrey M Roy 

Comments [1]

Getting outgoing email to work in Django and Pinax

Django and Pinax common steps

(I've got Django 1.2, Pinax 0.9a1)

First, install postfix (an SMTP server) on your VPS (in my case, a Linode node or Rackspace Cloud server).
sudo apt-get install postfix

Enter "yourdomain.com" when it asks you for it.  There, now you have your own SMTP server.

Add something like this to your settings.py so that outgoing mail comes from postfix.
DEFAULT_FROM_EMAIL = 'Your Site <yourdomain-noreply@yourdomain.com>'
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'localhost'
EMAIL_HOST_USER = 'yourdomain-noreply@yourdomain.com'
EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = 25
EMAIL_SUBJECT_PREFIX = '[Your Site] '

If your site uses Django but not Pinax, you're done.  To test it, restart Apache or touch your wsgi file, then enter the following 2 lines in a "python manage.py shell" (I hope you're in your virtualenv) at the prompt:
from django.core.mail import send_mail
send_mail('Subject here', 'Here is the message.', 'from@example.com', ['to@example.com'], fail_silently=False)
...and if you got an email in your "to@example.com" account, you're all set.  

Additional Pinax steps

If your site uses Pinax, that last step probably didn't send you an email.

Pinax has an app in it called django-mailer that replaces Django's send_mail with its own queuing version.  Mail gets queued up (you can see it in your admin section's Home > Mailer > Messages) until you or a cron job run the command "python manage.py send_mail".  

Try running "python manage.py send_mail" (still in your virtualenv).  You should get an email.

Make sure you have all the Pinax apps' email settings in your settings.py.  These depend on your particular desired configuration, but the ones that should be True for sure are ACCOUNT_REQUIRED_EMAIL and ACCOUNT_EMAIL_VERIFICATION.

ACCOUNT_OPEN_SIGNUP = True
ACCOUNT_REQUIRED_EMAIL = True
ACCOUNT_EMAIL_VERIFICATION = True
ACCOUNT_EMAIL_AUTHENTICATION = False
ACCOUNT_UNIQUE_EMAIL = EMAIL_CONFIRMATION_UNIQUE_EMAIL = False
EMAIL_CONFIRMATION_DAYS = 2
EMAIL_DEBUG = DEBUG

Now, the last thing you need is a cronjob to send the queued mail every minute, and to retry the deferred mail every 20 min.  How do you create this cronjob?

"crontab -e" opens up an editor.  Enter something like the following 2 lines.  "env" is your virtualenv, "username" is the username you use for sshing into the VPS, and "myproject" is your Pinax project directory.  I have a blank line at the end of mine, which you might need.
* * * * * (cd /home/username/myproject; ../env/bin/python manage.py send_mail >> ../cron_mail.log 2>&1)
0,20,40 * * * * (cd /home/username/myproject; ../env/bin/python manage.py retry_deferred >> ../cron_mail_deferred.log 2>&1)

If you haven't picked a default editor yet, it'll give you a choice.  I like nano for this kind of thing because it behaves like a normal text editor.  Save the file and exit.  The cronjob should be automatically installed.  

Now restart Apache and try signing up for an account on your Pinax site.  You should receive an account verification email within a minute or two.  Check your Spam and All Mail folders.  You're done.

If you didn't get one, it's probably an issue with the paths specified in your cronjob or access permissions.  Make sure your virtualenv's set up properly and that the path to its Python is correct.  And make sure ../cron_mail.log and ../cron_mail_deferred.log are writeable.  Try "touch cron_mail.log" from the appropriate directory.  

Other notes

You can set up your project to use Gmail's SMTP server, but Postfix is easier.  Gmail uses a different port for SMTP than the usual port 25.  I think it's port 587.  But this only works for addresses like yourname@gmail.com. I believe.  I don't think you can do this with Google Apps for Domains.

If your Pinax site is live, don't do "python manage.py send_mail" until you've made sure the message queue is clear except for your own email address.  You could accidentally send out emails to all your users, like I did a couple of hours ago.  Those delayed confirmation emails will all have broken links and confuse your users.

Posted by Audrey M Roy 

Comments [2]