Shooting myself in the head with Python, Django,Pinax

Well I decided to take some time off from working with the App-engine-patch and try Native Django,, go more mainstream so I could take advantage of more robust database and tutorials…

I’m using Python 2.62 Win 64 Eclipse 3.4 Ganymede, and trunk SVN Django 1.1

1st, one must install a Mysql driver The one in the “official library won’t work, version differences.. go here for a windows installer for Python 2.6 https://sourceforge.net/forum/forum.php?thread_id=2316047&forum_id=70460  Fwiw I’m using 32 bit versions although there is a 64 bit version available (for both Python and the Mysql driver (lower down on that thread).

You also need to add the following change manually to the Mysqldb code

About warnings:

1) file “__init__”, replace:

from sets import ImmutableSet
class DBAPISet(ImmutableSet):

with

class DBAPISet(frozenset)

2) file “converters.py”, remove:

from sets import BaseSet, Set

3) file “converters.py”, change “Set” by “set” (IMPORTANT: only two places):

line 48: return set([ i for i in s.split(‘,’) if i ])
line 128: set: Set2Str,

I hope this be useful.

Regards,

Luis Moreno

I realized That I had not been documenting myself when I blew up and was about ready to re install and realized I’d have to look every thing up again… Hence back to posting!

One of the most interesting revelations for me recently is how Python “installs” and referrers to packages and extensions. At this point I now think that all the trashing about is a bit too much on many installs. Looking in site-pkges in Libs in the Python directory I noticed several .pth files named for some of the extensions I was installing and using, the file was the module name.pth.. and contained the full path to the module… cool! So that is a mechanism that can be used to create a nice place to keep that stuff without messing up your basic Python install… good to know..

Another major revelation has been the use of revision control systems,,, It seems that it is well worthwhile to have a copy of all of the major systems on your machine. Git, SVN and Mercurial. If you checkout a copy of a system like Django,,, then when you want a update to the current version just do another checkout and your done!

Btw it turns out that even if you use TortoiseSVN as I do it is a good ides to install Silk SVN also because Tortoise does not provide command line access, which is used by some packages for automated installation/updating, in particular Pinax! So even if you don’t want command line you need to have it on your system…

If you use tagging with the 1.0 or latter Django you must use the svn version of tagging ….

Eclipse/App Engine/Bloog Part 4, The hard part

Well I had a long and frustrating week/week-end, all sort of run together. I discovered that my new site would not take even moderately long articles. This is apparently a “known problem” and it relates to exploding indexes, as somewhat explained here.

I finally got to corresponding with one of the Bloog Maintainers who had it turned out created a modified site search capability using Google Site Search. According to him  it still does not provide for longer article without some code mods that I have not yet started. But is a prerequisite. I got a copy from Git-hub, where Bloog is hosted. This required that I get and install GIT version control system. I chose to start with Windows based  Git Extensions. It still required that you install the basic GIT. It is only available in Tar format you will need 7zip to unpack although after a posting the developer has now provided a “full” option for Git extensions.

I then tried to apply the new code to my existing Bloog version as I had modified it. That required a differential editor,which I did not have Kdiff3 turned out to be a great choice. It compares entire directory structures and than lets you click through the files and selectively choose to apply a, b to your revised file. Very cool.

I then tried to fire things up, FAIL. I then went back to the Version I had just obtained and I could not get it to fire up either. I then started to look for “real” debug information. Not much available.

Eventually I downloaded PYdev for Eclipse, and that was a major improvement  my entire development environment. In fact I would go so far to say Do not attempt development for APP-Engine without Pydev!! It provides a much better editor, code outlining and a runtime environment. There are several tutorials on setting up Eclipse for app-engine. Use them!!! Supposedly it also provides breakpoints, but I have not been able to get that working yet, but the other improvements are a major joy. The Debug environment did give me better log messages. Through which I was eventually able to make some headway. I found out that the two versions had changed the DB schema slightly so I had to delete a few older records You can see and modify the local datastore using http://localhost:8080/_ah/admin/datastore and bang it all started to work. It actually took a long time to go through each step, and I still have to go back and learn each of the new tools much better.