Varud

Socially Proximate Predictions

Flower

Posts Tagged ‘python’

Install Eclipse Galileo for Django and Pinax – Part 2

Now, onto getting Pinax installed for development purposes:

I really don’t like how things have gone with Pinax installation in the past few months. I’m going to give my own take on things. Pinax has moved to GitHub and so should you.

First, create an account at GitHub. Then, fork Pinax so you have your own copy to work with. For me, I have my development version here. If you want this repository to be private, you can pay GitHub $7/month – well worth it if this is a corporate gig.

Now you can follow the Pinax directions from your own fork.

$ curl -O http://github.com/AdamN/pinax/raw/master/scripts/pinax-boot.py
$ python pinax-boot.py --development ../Documents/workspace/WhateverYouNamedProject/src/pinax
$ source ../Documents/workspace/WhateverYouNamedProject/src/pinax/bin/activate
(pinax)$ cd ../Documents/workspace/WhateverYouNamedProject/src/pinax
(pinax)$ pip install --requirement src/pinax/requirements/external_apps.txt

At this point, if you have an existing installation of Pinax on your machine, you may get an error about django-wikiapp being the wrong version. In a new command line tab, run:

pip install django-wikiapp==0.1.2

If it says it’s already installed, you may need to delete the existing django-wikiapp in the directory shown by the error in the pip install command above. Now it’s time to start a project:

(pinax)$ pinax-admin clone_project basic_project myproject

You now have a Pinax site in myproject/ directory

(pinax)$ cd myproject
(pinax)$ ./manage.py syncdb
(pinax)$ ./manage.py runserver

Now, go to your browser and navigate to http://127.0.0.1:8000

Hopefully, you now see a Pinax website in all its glory.

Install Eclipse Galileo for Django and Pinax – Part 1

Today I decided to see if I could do a proof of concept Django/Pinax deployment for an anti-fraud advertising service. Since they already use PHP for their legacy codebase and since the existing developer uses Eclipse and the Zend Plugin for debugging, I decided to use Eclipse for the proof of concept (since I have to convince that person to switch to Django).

First things first. Update your Mac to the latest and greatest software and JVM. A new JVM literally came out today so that’s what I did.

Now, go download the bleeding edge release candidate Eclipse for Java EE Cocoa Version – Galileo. Some people will probably want something else, but I say that Cocoa apps are way nicer than Carbon ones and anyway, I went with Galileo. The Java EE version has web development tools built in there which I thought would be important. Feel free to comment below with a leaner way to do this – I’m not using Java.

Now, grab the new version of Subversion (if you’re using Subversion). I got, and highly recommend, version 1.6.2. I usually don’t get the latest SVN packages but when trying 1.4.x it did not work.

Spin up Eclipse and grab some plugins. You’ll need the PyDev and Subclipse plugins. Go to Help > Install New Software, and install these:

Get the 1.6 series of Subclipse here:

http://subclipse.tigris.org/update_1.6.x

PyDev for debugging and highlighting:

http://pydev.sourceforge.net/updates/

For Subclipse, you’ll get alot of options. Just install everything (again, I’m usually lean but I tried not installing everything and had issues – I would just do it all).

Now, run through the fantastic Getting Started guide on the PyDev website. It’s written for Windows and a previous version, but you should be able to get through everything.

When you’ve gone through that, it’s time to get your existing SVN project into the project you created for PyDev above. Just right-click on the project and select ‘Import’. From there, choose SVN and import from your svn repository (if you have one – otherwise, skip this).

I will get to Pinax on the next post, when I figure it out :-)

Site Hijacked

I’m not sure if anybody noticed, but the site was taken down for a few days because somebody defaced it.  I kind of liked the music that they put on my homepage, but after listening to the song, I had to go about fixing it.  What did I learn?

  1. Don’t use shared hosts.  In this day and age, unless you are super poor, do not use a shared host.  If you are not technically savvy, use services for specific tasks (i.e. blogger.com for a blog) so you don’t have to think about the technology/maintenance.  If you are technically savvy and you have needs that are not basic, get a server where you have root access.  AWS ec2 is awesome for this.  The cost is $75 a month though so it may be too expensive for some people (although if you can set one up – I can probably find a gig for you to make enough money to pay that $75/month – just drop me a line).
  2. Dreamhost.com, while pretty good and having good customer service, just isn’t what I need.  People have recommended gandi.net for name services and hosting if you need the cheap option for hosting.  I haven’t used it personally but knowledgeable people love them.

Oh, I don’t think I’ve done an update on platform choices either.  Here is where I stand now:

  1. MySQL 5.0.45 (I’m still contemplating PostgreSQL)
  2. Python 2.5.1
  3. Apache 2.2.9
  4. Fedora 8 (I like the Fedora/Red Hat series – Debian/Ubuntu was giving me grief).
  5. Django 1.0
  6. Pinax trunk

That was fun!  I feel very excited about the Python community.  It’s a smaller group but it’s growing fast and it has solid support out there.  In addition, it’s a rock solid language with full unicode support – I love that.

More Frameworks

It’s been a tough couple of days.  Well, I went to Providence, RI for the weekend, which isn’t tough.  However, today and Friday, Patrick and I worked on some deeper technology issues and came to some conclusions:

  1. We will use Debian Lenny.  Lenny is just about to be declared stable and Etch is simply too old for what we need.
  2. We will use pretty much the defaults on Lenny although Django will be version 1.0
  3. We will use Amazon Web Services as previously mentioned.
  4. The use of Django leads to another open issue – will we use Django at all?  Ruby/Merb is still in the running because HAML and SASS look so exciting.
  5. JQuery.

So, we still have a competition between Ruby and Python.

Frameworks and languages, oh my

Recently, I’ve begun the painful process of actually deciding what core languages and frameworks will be used for the application.  Some things are kind of obvious for everybody, and leads to my favorite phrase from my days of studying for the SAT – PoE (Process of Elimination).

One dimension to start eliminating on is the breadth of the network supporting that technology over the coming 2-3 years.  Perl is a language that is great, rock solid, and also drifting into obsolesence.  I feel bad for Perl but what are you going to do?  This also leaves out old versions of languages like PHP 4.

Another issue is licensing and money.  That cuts out Microsoft products right off the bat as well as some of the supported platforms like WebSphere.  I haven’t been a Microsoft guy for years although they’re still the only game in town for word processing and spreadsheets.

At this point, there are some things that just go along with what I’ve done before.  I’ll most certainly use a Linux flavor for the OS – either Ubuntu (which I’ve never used in production) or CentOS (which is the same as Red Hat but is free).  After having some frustrating days trying to deal with a font installation problem (of all things) on an Ubuntu server, I’m starting to consider CentOS.  Either way, it’s not much of a difference, either will do.

This operating system needs to be on a machine of some sort.  I don’t want to buy a machine and grow out of it though – I’d prefer to rent.  That leads to a slew of hosting options.  One of the big guys is Dreamhost.  I’ve worked with them on some minor projects and they’re great in alot of ways.  However, I need full control, root access, the ability to create an entirely new instance, etc…  Dreamhost won’t do.  It’s time to take advantage of the cloud so I’ve been experimenting with Amazon Web Services Elastic Compute Cloud (AWS ec2) and Simple Storage Service (S3).  For about $72/month, I can have a dedicated ‘server’ on a premium network (Amazon’s) with access to S3 which allows for such things as snapshots (backups) and getting data into a solid storage space.

This post will have to be continued – I can’t nearly finish this work so quickly.  Does anybody have thoughts?  Here’s the current plan:

  • Amazon Web Services ec2,S3, etc…
  • Linux (Ubuntu or CentOS)
  • Apache (I hadn’t really thought about anything else, possibly lighttpd)
  • Python or Ruby (PHP feels passe and there’s really no other option)
  • If Python, Django or Turbogears (probably Django because Google App Engine is using that)
  • If Ruby, Rails or Merb

I could still be convinced on alot of fronts – this is hard :-)