Archive

Archive for March, 2010

Setting Up MySQL Server on Ubuntu

March 12th, 2010

Pretty easy first:

Read more...

Web Development

Django On Mac OSx

March 8th, 2010

Originally battling with installing Django on OSx I decided to go with my host(dream host) then after battling with them and realizing that I did alot of my development on a train with out internet access that it would really benefit me to install it on my Mac OSx Laptop and to forgot the Apache Integration, I thought this would be a synch armed with my new book I leaped into the unknown.  The instructions were pretty easy to follow:

I installed a new version of MySQL, pretty easy find out what version of OSx you’re running and if you don’t know how many bytes your processor is go with 32.

Then using basic commands from the Django website.  (I’m a big fan of svn, as i use it at work, I also see it’s down sides though) I was able to install Django and begin with the “interesting chapters” of my book.

./django-admin.py startapp mysite
./manage.py startserver(You can verify this works here, but we’ll check later)

So I trucked onwards in my book with the next command that actually set the framework and got the ball rolling.

./manage startapp blog

Then I continued defined a Model and set my database information in the settings tab.  And that’s when I hit my first road bump, I’m a trained programming not really a systems guy.  Everything I learn about sysadmins is by total accident in an attempt to do something with a programming language.

The first of two problems was python could not find the mysql driver.  This isn’t a hard problem at all.

1. Download East Install(download the egg that is the same version as python you’re running)
2. run the command “sudo sh setuptools-0.6c9-py2.4.egg ” renaming 2.4.egg to the file you’ve downloaded
3.  Run this command “easy_install MySQL-python” (This will install the mysql patch)
3.5 (At this point feel free to try the “./manage syncdb” command again it should fail
4. Open ./bash_profile or ./profile in using vim ~/.bash_profile or vim ~/.profile
5. add the following line PATH=”${PATH}:/usr/local/mysql/bin” (and “EXPORT PATH” if needed, this will allow all binary files to be added to the global link, to test this run mysql_config from wherever you are)
6. At this point you should be able to run “./manage syncdb” with no problem

If you’re following the same book as me, Python Web Development with Django, it will have you setup the admin controller for the blog site.  Once you do this and visit your blogsite you will have some error saying that “NameError: name ‘admin’ is not defined”.  In the urls.py add the following line of code “from django.contrib import admin” and you should be golden

Web Development

Valid Credit Card Numbers for Paypal Sandbox

March 5th, 2010

When testing your paypal account in the sandbox you’ll sometime need a fake credit card, and the ones supplied by Paypal do not work.
The easiest way is to login/create an account in the sandbox. When you do that goto My Account > Profile > Credit/Debit Cards.
From here create a credit card, remember the information for this credit card, and yes you can leave the Card Verification Number as 000.
And there you go, a valid credit card number. Note if you save this credit card you will not be able to save it as it will be tied to a paypal account.

Web Development