Django

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

http://www.djangoproject.com/

On this site:

Installing Django on Windows
The Django PageView Application
Serving Multiple Hosts from a Single Django Instance
Some Notes on Moving the Zone to Django

Installing Django on Windows in less than 5 minutes #

Assuming you have Python 2.4 or Python 2.5, exemaker, and the svn Subversion command-line client.

Python 2.4 #

In a command line window, do:

cd C:\Python24\Lib\site-packages
svn co http://code.djangoproject.com/svn/django/trunk/django

cd django\bin
exemaker django-admin.py

Install pysqlite 2 (for sqlite 3) from http://www.initd.org/tracker/pysqlite. The latest stable version should work fine (currently 2.0.5).

Python 2.5 #

In a command line window, do:

cd C:\Python25\Lib\site-packages
svn co http://code.djangoproject.com/svn/django/trunk/django

cd django\bin
exemaker django-admin.py

Setting up Django #

Create a work directory, and use django-admin to create a project directory in there.

mkdir c:\mytest
cd c:\mytest
django-admin startproject myproject

Edit the DATABASE_ENGINE and DATABASE_NAME entries in the settings.py file:

cd myproject
notepad settings.py

Set the variables to:

DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'mydata.db'

(If you want, you can tweak other parameters at the same time. See comments in the file for details.)

Start the server:

python manage.py runserver

Click here to check that the server is running.

That’s it!

The next step is to read the Django tutorial. Get to work!

(to set up a deployment stack, with apache and a real database server, some more work is needed. this article shows you how to do that.)

 

Comment:

I have installed all of the applications required to run Django on windows, and I cannot get Django to work properly. site-packages dir does not work in DOS. I needed to change it to: sitepack in order to read the directory. python 2.4 django pysqlite subversion when I try to run the django-admin I get an error in DOS: Traceback (most recent call last): File "C:\PYTHON24\LIB\SITEPACK\DJANGO\BIN\django-admin.py" , line 5, in ? from django.core import management ImportError: No module named django.core Can anyone assist me with this in what is going on here? I assume the windows django is not stable yet. Thanks for any advice, help, or tips, really want to get django rolling!

Posted by Jason w3 (2006-10-31)

(Please don't post support questions to this site; this is not a discussion forum. To get help with Django, use a real support forum.)

Im afraid I have no idea what Python distribution you're using that requires you to install things under "SITEPACK" and uses uppercase for all directory names; the real Python 2.4 distributions for Windows from python.org definitely have a site-packages directory. And Django works perfectly fine if you use a python.org distribution. I suggest double-checking your installation; if you still cannot get things to work with a proper Python install, ask on the Django forums (see the sidebar on this page for links) /F

Comment:

Exemaker just says it cannot find Python. Do I have to do it in a special folder? Some instructions are missing in this article. :(

Posted by Sonja the noob (2007-02-20)

Is python itself in the path? If not, you'll either have to tweak the exemaker.py script (see the table under "Details" on the exemaker page), or fix the system's path (see the Python FAQ for details) /F

A Django site. this page was rendered by a django application in 0.02s 2008-05-12 06:56:43.836860. hosted by webfaction.