Entries Tagged ‘Python’:

How to Add Locations to Python Path for Reusable Django Apps

In my
previous post I talk about reusable apps, but I don’t really explain it that much. If you have an app that might be useful in another project, it’s best to not refer to the project name in the application so you don’t have to search and remove it when adding to another project. [...]

Getting Basecamp API Working with Python

I found
one library that was linked everywhere, but it wasn’t working for me. I was always getting 400 Bad Request when using it. Chris Conover was able to get the following code working.

import urllib2
 
protocol = ‘https://’
url = ‘example.com’
command = ‘/projects.xml’
headers = {’Accept’ : ‘application/xml’,
‘Content-type’ : ‘applications/xml’}
username = ‘x’
password = ‘y’
 
# Setup password stuff
passman [...]

How to Write Django Template Tags

Template tags can be useful for making your applications more reusable by other projects. For this example I will be adding to the
books project that I started in a previous post. Also, I’ve bundled the
example files into a google code project.
Start off by creating a folder called templatetags in your app directory and [...]

How to Write Reusable Apps for Pinax and Django

Pinax is a collection of reusable django apps that brings together features that are common to many websites. It allows developers to focus on what makes their site unique. Here is an example of adding your own functionality to Pinax. It will also be an example of writing a reusable app since every individual app [...]

Django Settings Site Domain example.com

It took me a while to figure out how to change from the default, example.com. Maybe it should have been obvious, but I was looking in all the wrong places and every search I did wouldn’t come up with an answer. As I discovered, it isn’t a setting in the settings.py file. It’s something that [...]