Quick-Install Django

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article
Posted by John
on Sunday, 28 December 2008

Django

Developed four years ago by a fast-moving online-news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high-performing, elegant Web applications quickly.

Install Latest

Install Guide

svn co http://code.djangoproject.com/svn/django/trunk/ django
cd django
sudo python setup.py install

Check installed ok by doing,

python
import django

If the library was imported ok then Django's installed fine.

Create Project
cd ..
django-admin.py startproject mysite

Creates a new project called mysite

Check the development webserver runs ok with...

cd mysite
python manage.py runserver
..or run on different port
python manage.py runserver 8080
More
Django on Nginx

Quick Link, prefer Nginx over Apache or Lighty so will want to have it under this from day one.

Bazaar - Python-based VCS

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article
Posted by John
on Monday, 22 December 2008

Toronto Zoo

Bazaar is a Python-based distributed versioning system, really simple lightweight and works under and with pretty much anything.

More here but to get it installed on your mac with macports just run...

sudo port selfupdate
sudo port install bzr

After it's installed and activated tell it who you are so it knows where all these changes are coming from in the future.

bzr whoami "John Doe <john.doe@gmail.com>"

You can check that's worked via

bzr whoami

Which should output who you told it you were,

Putting things under Bazaar

Next up it's real simple to start getting things stored under Bazaar, if you've used things like Mercurial or GIT then this should be a walk in the park,

First off navigate to the project you want to put under it then init a new Bazaar repository.

bzr init

Next up add all the files you want into the repos via,

bzr add .

...this'll add everything in the current directory you're in into the repository

Next up commit your files,

bzr commit -m 'initial code'

Should go smoothly listing all that you've done and give you a revision number (in this case 1).

You can then check the log for what's occured via,

bzr log

Which will show you the history, timestamps, user names & emails and messages posted so you can quickly see how things are evolving; and being Python it's pretty fast.

More here

Like most others, your repository is kept under a hidden system directory .bzr, find it easily with,

ls -a

However unlike others it doesn't mind what you put in it and will pack them tightly so it doesn't consume too much space, plus you can use it against any storage medium, current version at time of writing 1.1

Linux Package Commands + Wajig

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article
Posted by John
on Saturday, 20 December 2008
Aptitude or Apt-Get

Was asked this recently, as far as I know the only core difference is Aptitude has a better way of handling dependencies when you remove a package; cleans up better. In all you should try to switch to Aptitude where possible, if you've installed a package with Aptitude then when you remove it via Aptitude it'll know about any dependencies it has to check for or orphaned packages.

Update and Upgrade
apt-get update
apt-get -u upgrade

aptitude update
aptitude safe-upgrade
Install Package
apt-get install gedit
aptitude install gedit
Remove Package (keep config files)
apt-get remove gedit
aptitude remove gedit
Remove Package Completely
apt-get --purge remove gedit
aptitude purge gedit
Upgrade Package
apt-get install gedit
List Possible Upgrades
apt-get upgrade gedit
Show Package Info
dpkg --info gedit*.deb | less
List All Packages
dpkg -l
Check if Package install plus Info
dpkg -l | grep -i 'gedit'
List files owned by package
dpkg -L gedit
List files inside Package
dpkg --contents gedit*.deb
Find out who owns this Package
dpkg -S /bin/netstat
Check if Package installed and it's Status
dpkg -s gedit| grep Status
Show Dependencies for a Package
apt-cache depends mysql-server
Wajig

Wajig is a Linux tool that combines a lot of the abilities within apt-*, aptitude and dpkg into one command. Written in Python it handles normal users and super-user privileges & can be installed with...

apt-get install wajig
aptitude install wajig

More info here

EveryBlock - whats going down in the hood?

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article
Posted by John
on Saturday, 19 April 2008

everyblock

Good site to use when planing your next vacation, flack jackets optional.

Built with Python and powered by the PostGreSql database engine it's certainly an advanced webapp, with custom maps built specifically for the job using a number of open-source tools like MapNik & TileCache it's no slowcoach to technology; good work!

Learning Python

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article
Posted by John
on Wednesday, 07 November 2007

I have to try, I know my brain will explode if I add another language in there but I love to play.

Resources

Python Web Apps

Notes

Mod_Python: Plugin to speed up rendering performance