Django project #1: Install

This is my OLD blog. I've copied this post over to my NEW blog at:

You should be redirected in 2 seconds.

I plan to do a side project in Django just to get some web programming experience. I'm not sure exactly what the site will be yet. Maybe my very own blog software with extensive tagging capabilities and maybe revision control. I also have an idea for a site to specialize in comparison searching. E.g. "python vs. ruby", "mac vs. linux", "kde vs. gnome", etc. Or, if I find someone who needs a website, I might work someone else's project. As long as I get to choose the technology. Anyways, I plan to document my steps here. I've already installed Ubuntu. Here are my steps in creating my Django website.

Install django

$ sudo apt-get install python-django

Test install

To test the install, I typed import django in the python interpreter.

$ python
Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
Alright, It worked.

Create a project

I tried to follow the Django tutorial and ran the command. However, I got the command not found error message.

$ startproject mysite
bash: command not found
I googled for the error message and found this link which said to link the file to a location in your path.
$ sudo ln -s /usr/lib/python-django/bin/ /usr/local/bin/
I tried the command again, and now got a Permission denied error.
$ startproject mysite
bash: /usr/local/bin/ Permission denied
Googling again, I found the SVN release version of the tutorial which gave instructions about the Permission denied error. (I was using the 0.96 version of the tutorial). So I changed the permissions of the file to be executable.
$ sudo chmod +x /usr/lib/python-django/bin/
I tried the command again.
$ startproject mysite
Alright, success! I got no errors.

Start the development web server

$ cd mysite
$ python runserver
Validating models...
0 errors found.

Django version 0.96, using settings 'mysite.settings'
Development server is running at
Quit the server with CONTROL-C.
Alright, it worked! I know you are excited. I visited in my browser and got a nice page affirming me of my success.

It worked!
Congratulations on your first Django-powered page.

This seems like a good stopping point. The next step is setting up the database.

No comments:


This is my *OLD* blog. I've copied all of my posts and comments over to my NEW blog at:

Please go there for my updated posts. I will leave this blog up for a short time, but eventually plan to delete it. Thanks for reading.