Changes between Initial Version and Version 1 of DjangoOnAStick


Ignore:
Timestamp:
Dec 22, 2006, 3:44:37 AM (18 years ago)
Author:
Lllama
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DjangoOnAStick

    v1 v1  
     1== Django On a Stick ==
     2
     3As a little experiment in ducking corporate build policies I've installed Django on my USB stick. It's a 2Gb monster so I haven't really been too careful about file sizes etc. It's weighing in at about 100 Mb but that includes the following:
     4
     5 * Python 2.5
     6 * Django
     7 * Apache with mod_python
     8 * OpenSSL
     9 * Load of unix tools (including Subversion)
     10
     11It's fairly simple to do yourself but there were a few gottchas. This is all done for Windows btw.
     12
     13Firstly install Python. Just point the installer at the USB stick and let it do it's stuff. It'll put a load of stuff in the registry but things will work elsewhere as well. (If you've got Python installed on your system the the installer won't work. You can just copy across your python25 directory and give that a go).
     14
     15Install all your Python extras such as PIL. The installers for these will pick up the stick installation and put their magic where needed.
     16
     17Install Apache. Just point the installer at the stick.
     18
     19Install an appropriate mod_python [http://nicolas.lehuen.com/download/mod_python/ from here]. Point it at the stick and the Apache installation. Add the following line to the httpd.conf in the Apache 'conf' directory:
     20
     21{{{
     22LoadModule python_module modules/mod_python.so
     23}}}
     24
     25Download and install Subversion [http://subversion.tigris.org/ from here].
     26
     27Create a directory for the source code. You can put this in your site-packages directory but I created a separate place to put it 'just in case'.
     28
     29Install the latest trunk:
     30
     31{{{
     32svn co http://code.djangoproject.com/svn/django/trunk/ your_new_directory
     33}}}
     34
     35Add the directory to your sys.path. Create a 'python.pth' file in your python25 directory and add the path to your Django source. Mine looks like this:
     36
     37{{{
     38\Documents\development\django_src
     39}}}
     40
     41Create a setup.bat on the stick and change the following to point at your paths.
     42
     43{{{
     44set PYTHONHOME=\path_to\python25
     45set PATH=%PATH%;\path_to\python25;\path_to\svn\bin;\path_to\django_src\django\bin;\path_to\apache\bin
     46}}}
     47
     48Try running {{{httpd -t}}} and see whether your httpd.conf is valid. If it is then you're done! Follow the mod_python installation [http://www.djangoproject.com/documentation/modpython/ instructions] and set yourself up a new project.
     49
     50NOTE: No database has been installed but Python 2.5 comes with sqlite3 so configure your Django project to use it.
     51
Back to Top