shell (5)

Quickly Start a Django Project

There are many things I like to do when starting a django project. I started to compile those in a script I’m using. The gist is linked below.

New Django

# Author: Abdallah Deeb 
# Requirements: python, pip, virtualenv, virutalenvwrapper, git
# Edit the following 2 lines
if [ -n "$2" ]
if [ -n "$1" ]

source `which` 

echo "Starting a new Django project: $PROJECTNAME"
# Make a virtualenv
mkvirtualenv $PROJECTNAME

# Install latest django and start the project/app
pip install django startproject $PROJECTNAME

# conf is much nicer than projname
replace $PROJECTNAME conf -- conf/ conf/ conf/
chmod +x

# Initialize and use git
git init
git add .
git commit -a -m 'initial commit'

and the raw gist download

Similar Posts:

CLI blogging with Postie (via postie)

Bookmark this category
Another blogging test using the postie plugin

Similar Posts:

Quick Note

Testing the previous entry, and quick-blogging from the shell

Similar Posts:

    None Found

Dave’s Notepad

We were chatting in the morning and my colleague Dave said:

echo “blog post about distro choice” | mail -s “blog post”
that’s my ‘notepad’. 🙂

I thought that was pretty useful, but tried to make it easier by creating a bash alias. Turns out it’s better to use a bash function instead. (see this note). So my ‘jot’ function is:
function jot() { echo "$1" | mail -s "$2"; }

I also noticed, that emails sent from my laptop were not reaching. It seems Ubuntu comes with Exim4 as a default MTA. I’m not too familiar with Exim, so I used the occasion to learn a new trick.

I might use this for micro-blogging next… let me go set it up 🙂

Similar Posts:

Moving SVN repository

I moved the svn repository from my laptop to the server for easier deployment of
Here are the commands I used:

on laptop:
svnadmin dump /var/svn/repos/ > home-repository.dmp
gzip home-repository.dmp
scp -P39227 home-repository.dmp.gz mybox.server.xx:/home/myuser

on server:
mkdir -p /var/svn/repos
gunzip home-repository.dmp.gz
cd /var/svn/repos/
svnadmin load /var/svn/repos < /home/myuser/home-repository.dmp

again on laptop:
edited ~/.subversion/config:
sshtunnel = ssh -p 39227

svn switch --relocate file:///var/svn/repos/ svn+sshtunnel://mybox.server.xx/var/svn/repos/

And check it's all good (in the working copy directory):
svn up
svn info

Piece of cake 🙂

Similar Posts: