Mar 042017
 

Django logo

If you’ve created any forms at all using the Django web framework then you should already be familiar with Django’s CSRF middleware and the protection it provides web site’s against cross site forgery request attacks. When the middleware is active, and unless the view has this protection overridden, any form POSTed will be expected to contain a hidden field named csrfmiddlewaretoken the value of which is expected to match a similarly named field in a CSRF cookie attached to the user. Because this value is specific to a user and constantly changing as well, testing the output of webpages with forms against what is expected is difficult. What follows is the solution I am using in Django 1.10.

Continue reading »

Jan 212017
 

Python Logo

I am excited this evening. Why? Because I am finally getting back to some real Python development. While I have recently coded up some GIMP plug-ins, I haven’t really taken the time to properly set up my Python environment since making the switch from OS X to Ubuntu in December.  Now I’ve got some Django programming to do, but before I can start installing any third party packages, I’ll need to install pip, the de facto package management system for installing and managing Python packages. Think of pip being to Python as apt is to Ubuntu. The main repository for Python software is PyPi, the Python Package Index.

Continue reading »

Jan 042017
 

GIMP logo

In my last post, I briefly explained GIMP‘s scripting and plug-in system and the two most common ways to program custom extensions and scripts: Script-Fu and Python-Fu. Script-Fu, being the older of the two options, is well documented and the more widely used of the two. Not because I love the road less traveled, but because I love Python, I have chosen Python-Fu, a set of Python modules that serve as a wrapper for libgimp, as my platform for extending GIMP.

This post (and any I hopefully follow up with) are meant to track my progress as I learn my way around Python-Fu. Even while writing relatively simple scripts I have encountered gotchas and conflicting information about how to do things. Hopefully some of what I’ve discovered scouring both the web and Python source code will save other developers the time and frustration I’ve already paid.

Continue reading »

Dec 092016
 

GIMP logo

For several years now, Adobe Photoshop has been the sole reason that I have continued to run Mac OS X. During that time, I have done the majority of my work in an Ubuntu instance running in a Parallels virtual machine. I’ve finally bitten the bullet and installed Ubuntu as the primary operating system on my MacBook Pro. I couldn’t be more pleased with how the transition has gone, and I regret not doing it earlier.

Continue reading »

Feb 022016
 
Learning Python Book Cover Learning Python
Mark Lutz
Computers
O'Reilly Media; Fifth Edition edition (July 6, 2013)
July 6, 2013
1594

Get a comprehensive, in-depth introduction to the core Python language with this hands-on book. Based on author Mark Lutz's popular training course, this updated fifth edition will help you quickly write efficient, high-quality code with Python. It's an ideal way to begin, whether you're new to programming or a professional developer versed in other languages. Complete with quizzes, exercises, and helpful illustrations, this easy-to-follow, self-paced tutorial gets you started with both Python 2.7 and 3.3 - the latest releases in the 3.X and 2.X lines-plus all other releases in common use today. You'll also learn some advanced language features that recently have become more common in Python code.