Sunday, January 25, 2009
Long story short
The local site-packages directory is /usr/local/lib/python2.6/site-packages until further notice.
Porto-Sucko
Thanks for fucking shit up, port! It seems that my lxml port install also installed a shit load of other crap, including Python2.6. Oh, and it set my default python to Python2.6. Oh, and it didn't include my old site-packages directory into Python 2.6. Oh, and it doesn't use the standard Mac site-packages of /Library/Python/vers/site-packages, so now I need to copy everything over and change the PYTHONPATH to include this, too. Oh, and I have to hope that 2.6 actually fucking works this time.
And on top of that I don't even need lxml because it is a bitch to install on webfaction (see here).
I'm going to use the built-in ElementTree instead. I think it's slower, but it works for now. I hope.
And on top of that I don't even need lxml because it is a bitch to install on webfaction (see here).
I'm going to use the built-in ElementTree instead. I think it's slower, but it works for now. I hope.
Saturday, January 24, 2009
XML + XSLT = XHAPPINESS
I'm looking at changing the templating and display to an XML + XSLT = XHTML system. I think this would make display programming (which I loath) much easier and more flexible for me. The idea is that the views would produce an XML representation of the data that I was sending to the context of django's template, then use XSLT to transform this into the XHTML that gets sent to jquery.
To do this, I need the help of some libraries. Everyone seems to be in agreement that lxml is the best Python xml library, and I will admit it looks pretty easy. Of course, Django has an xml serialization, but that seems to be more for full model objects, which I may or may not need.
However, to get lxml on my mac, I need the newest libxml2 and libxslt. These are C-libraries. Mac ships with them, but they are outdated, which poses a problem because you can't easily install without creating conflicts. As per this blog's suggestion, I tried installing using MacPorts.
Which means I need to install MacPorts. MacPorts is a package installer for the mac. I installed it and had to copy over what was in ~/.profile to ~/.bash_profile since the bash one takes precedence in Terminal. With that done I used MacPorts to install libxslt and lxml. I did this with:
sudo port install libxml2
sudo port install lxslt
sudo port install py25-lxml
I don't know why I've never used a package installer before. I think I tried fink once back when I didn't know what I was doing and screwed stuff up and never went back. It was a long time ago, too. When everyone on a Mac was used to this whole 'NIX thing.
In other news, I probably will miss the Jan.30th deadline. I can't help it if my social life suddenly improves.
To do this, I need the help of some libraries. Everyone seems to be in agreement that lxml is the best Python xml library, and I will admit it looks pretty easy. Of course, Django has an xml serialization, but that seems to be more for full model objects, which I may or may not need.
However, to get lxml on my mac, I need the newest libxml2 and libxslt. These are C-libraries. Mac ships with them, but they are outdated, which poses a problem because you can't easily install without creating conflicts. As per this blog's suggestion, I tried installing using MacPorts.
Which means I need to install MacPorts. MacPorts is a package installer for the mac. I installed it and had to copy over what was in ~/.profile to ~/.bash_profile since the bash one takes precedence in Terminal. With that done I used MacPorts to install libxslt and lxml. I did this with:
sudo port install libxml2
sudo port install lxslt
sudo port install py25-lxml
I don't know why I've never used a package installer before. I think I tried fink once back when I didn't know what I was doing and screwed stuff up and never went back. It was a long time ago, too. When everyone on a Mac was used to this whole 'NIX thing.
In other news, I probably will miss the Jan.30th deadline. I can't help it if my social life suddenly improves.
Subscribe to:
Posts (Atom)