Latest entries
How I deploy saebyn.info
Tags: django fabric git pip python virtualenv
Sun Oct 18 11:24:57 2009A few months ago I drank the koolaid and began using git on my new projects. When I started working on this new blog site I created a git server on my VPS using gitosis. I keep my entire Django project in the repository along with all of the static media and other scripts, which is a pretty standard practice.
Every time I push changes to the gitosis server, it results in calling a hook script that pulls changes from the live branch of the repository into the live website root, and pulls changes from the master branch into the testing website root. When I want to push my changes to the live website, I simply re-base the live branch to where the master branch is at and then push that branch to the server.
The server is running Apache 2 with mod_wsgi, and I'm using Apache to serve static media for now. I wouldn't necessarily suggest serving media files like this for a higher traffic site. I'm using this same server to host a few other Django projects, not all of which use the same version of Django or other Python packages. Fortunately I came across virtualenv before I started setting all of this up. In a nutshell, virtualenv lets you have a complete set of Python modules that are installed outside of your server's main Python module directory. This allows you to have multiple sets of Python modules whose versions differ.
I didn't want to have to maintain all of these Python virtual environments manually, installing each package for each project/virtualenv by hand, so I turned to pip. pip allows me to create a “requirements.txt” file which defines which packages I want to install, either from subversion or from pypi, along with a specific revision, or an exact or minimum version.
To bring this all together I used another great piece of Python software called Fabric to handle the details of my deployment process. Here's the “fabfile” I'm using for this site: fabfile.py.
New Location
Tags: django site
Sun Jul 26 16:03:10 2009In case you haven't noticed, I've moved my blog to a new URL (http://saebyn.info). I will try to post here more frequently, and while I will continue to post content about the software development work I do, I will also be posting about my other activities and about random thoughts I have.
Besides the new URL, this site is now using Django, with the diario blogging app and the threadedcomments app. One of the articles I have planned will discuss step-by-step how I set up this blog, including how I'm using git, fabric, pip, and virtualenv to handle the deployment of changes automatically.
django-classified-ads
Tags: django | Comments: 1
Sat Feb 28 18:40:39 2009Announcing the release of django-classified-ads, which is being hosted by Google Code. For everyone who has e-mailed me about this project... here it is! All of the templates and static media (CSS, images, jQuery, and TinyMCE) from django-classifieds.zxdevelopment.com has been included in the source code repository. I've replaced some of the older custom code with existing Django applications like django-profiles, django-registration, and django-paypal.
Django-Classifieds
Tags: django | Comments: 2
Thu Jan 22 12:08:54 2009Back in July, my company was contracted to work on a new classified ad site related to the golf industry. A few weeks prior to this we had decided to take the plunge and start using Django on projects whenever possible. After a few emails back-and-forth about this project, I knew that Django would make a good base for building it.
The key feature requested for the original site was to be able to support several categories of postings, each with their own distinct fields. I used a 'Field' model to represent the different field types available for each ad category. A 'FieldValue' model was used to store the value of a specific field, and associate it with the 'Field' and 'Ad' via foreign keys.
Additional features include searching, attaching images to ads, PayPal checkout, configurable pricing options, and custom templates for listing, viewing, and editing each category of ad posting.
You can see a demo version of this software here.
I can release this as an open source application, so that others can use it to build their own classified ad sites, but before I do I need to clean up the code a bit more and get more documentation in place.
Edit: Please see the follow up post.
Django Migration
Tags: django
Thu Nov 20 11:52:59 2008I want to point out a great article by Scot Hacker, about his experiences migrating to a Django & Python based platform.
My company is in the process of a similar migration itself for similar reasons, if not quite the same background. Our new website is now written completely in Python using the Django web framework, and we are now in the process of adding some new features and content. We are also working on some new projects written using Django, which will be launched in the next month or two.