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 ….

Google App Engine Patch Django Examples

5/8/2009 update, I’ve added a link to a very rough video I gave at Barcamp Birmingham on “An Introduction to Google App Engine and App Engine Patch” (it’s there but WordPress does not like to “preview Vimeo for some reason!).

I have not posted to this Tech blog for a while but I have been continuing my learning process. I’ll try to point out some key developments for me and that may help you out.

This is already a bit out of date but illustrates some key concepts which I was having problems with as I learn Django, app-engine, app-engine patch and Python and expand my limited knowledge of css/xhtml.. (so is that enough disclaimer?!)

Many thanks to Waldemar Kornewald, author of the AppEngine Patch (AEP) and
Konrad Martin who graciously provided the screenshots of how to integrate css (and other media, in the Django lingo) into AEP, which for me was way more clear than the documentation, with my very limited understanding of basic Django concepts. Since Konrad provided this Waldemar has updated the AEP ‘Package” to include examples which also now include javascript. I have not yet had a chance to load that up and play with it but the concepts presented in these screen shots should still be very helpful to all. While Konrad provided them for download from an Appspot domain here I felt that having the screen shots available without having to download anything would be helpful to many. Konrad has added some more screenshots with some layout ideas here. (added 4/16/2009).

I cannot add much to the screen shots they are very well annotated. The original discussion is here.

You may click on the image to get a larger version, then again to get a fairly full sized version, they are in order of operation.

Free Blogging at Google App Engine Using Bloog-part 1

This project is to help me get something of some substance up on app-engine to serve as a vehicle to learn Python and app-engine at the same time. If I was only interested in putting up a blog I’d keep on trucking with WordPress.com, I love it as a great Blogging platform. I evaluated the several frameworks available and for me it came down to Bloog and cpedialog. They both have advantages but for me I just sort of liked the basic layout and description of the Bloog approach better.

Step 1: See my prior article on getting Hello World going on App_engine.

After doing the initial tutorials outlined in my earlier piece on app engine. Then download Bloog here. I was not quite ready to load up client software to get the file out of GIT “properly” so I chose to just click the download button which gives you the file only in Tar format (no zip file) so you may need an unpacker, my native windows Vista 64 extract did not work so I downloaded a (freeware) unpack program called 7 zip from here. I unzipped the folders to my Documents directory.

I decided to run it directly, so without editing anything I made up a Bat file that started app engine on my local machine. The file:”startappengine.bat” contains:”dev_appserver.py C:\Users\DadLaptop\Documents\Bloog”

I got a screen of errors when I opened my browser at http://localhost:8080/

They appeared to be the same as discribed here.

I went to Http://github.com/darwin/firepython/ and clicked on download and selected the zip file, which I then unziped to bloog/utils/external and erased the old (empty) firepython folder and renamed the resulting folder to firepython.

I re-ran the autoexec file and reloaded the local host page and bang I had a operating site, Now I’ll work on some customizations before uploading to the real app engine!!!

Found most customizations in Config.py including customizing the links on the right side. But am still looking to replace the ad space on the right with a rss feed or two. My questions to the Bloog support group are here.

Getting Started With Google App Engine-Hello World

I’m configuring this all on Vista 64. Well I finally decided to begin the learning process. I elected to use only the “Ordinary” x86 versions and not 64 bit versions. I installed the latest Python, 2.61 which according to the Python site is the continuing line from the required 2.5 for app engine (Python 2.6.1 Windows installer (Windows binary — does not include source), this could cause problems later but so far so good. I ran the Python environment stand alone to ensure that is functioned.

I then followed the tutorial. Downloaded the app engine development environment. I ran the install.  I also created the Helloworld folder in the documents folder and placed the trial Yaml and PY file inside the folder, as the tutorial required.  Then tried to run the executable according to the tutorial. I could not figure out how to do that. I rebooted, always a good idea!

Then noticed that the Google App Engine had placed an Icon on the desktop. Clicking it did not result in anything other than a window that opened and closed too fast to see. Re-reading the getting started info it came clearer to me that I had to follow the format for invoking the App Engine and specifying the location of the helloword folder.  So I opened up notepad++ and created this line, which I the entered into the Vista Search box (which I discovered also now functions as the “Run” box). >>> dev_appserver.py C:\Users\DadLaptop\Documents\Helloworld<<<

Bang, It worked!! Followed the rest of the tutorial to display “Hello World” on Localhost. Now I have to continue for the more advanced functions. Stay tuned!

I saved the command line as a .bat file and believe that I can edit the desktop icon to include the parameter for the location of the hellworld folder.