dojango-sample

A sample application how to use dojango with other reusable apps

Stars
18
Committers
1

dojango-sample

A sample application how to use dojango in combination with other reusable apps.

The following apps are used:

Installation:

It is required, that you have installed Python >= 2.5, Django >= 1.1 and PIL (Python Imaging Library) before!

  1. Installing used reusable apps

  2. Creating the database

  3. Loading data into the database

  4. Copying image data to an accessible place

  5. Starting the server and see it in action

  6. Installation of reusable apps


For this installation you need to install SVN, GIT and MERCURIAL before. Alternatively you can download the various packages directly from the above mentioned websites and place them within the "external_apps" directory.

cd [dojango-sample-dir] cd external_apps svn export https://dojango.googlecode.com/svn/trunk/dojango svn export http://django-tagging.googlecode.com/svn/trunk/tagging git clone git://github.com/pydanny/django-uni-form.git ln -s django-uni-form/uni_form . git clone git://github.com/streetcleaner/sandoval.git ln -s sandoval/movie . hg clone http://code.tabo.pe/django-treebeard/ ln -s django-treebeard/treebeard . hg clone http://bitbucket.org/jespern/django-piston ln -s django-piston/piston .

  1. Creating the database

cd [dojango-sample-dir] python manage.py syncdb

Just enter the requested information for creating an initial django user.

  1. Loading data

cd [dojango-sample-dir] python manage.py loaddata post # loading sample-data for the tree python manage.py loaddata movies # loading some sample movies python manage.py loaddata feeds # loading some information, where to get new movies from

  1. Copy image data

cd [dojango-sample-dir] tar xzvf external_apps/movie/fixtures/images.tar.gz

  1. Start the server

cd [dojango-sample-dir] python manage.py runserver

This starts the internal django development server and the application will then be available from here:

http://localhost:8000

Enjoy!

Play with dojango

For further details visit: http://code.google.com/p/dojango/wiki/DojoBuild

Doing a Dojo build

  1. Get a dojo source release

  2. Do a dojo build

  3. Enable that build for your dojango project

  4. Get a dojo source release


This is fairly simple, because downloading a specific version of Dojo is integrated into manage.py:

cd [dojango-sample-dir] python manage.py dojoload

Starts a dojo download of the version, that was defined within DOJANGO_DOJO_VERSION (should default to the latest) and places it into:

[dojango-sample-dir]/dojo-media/src/[DOJANGO_DOJO_VERSION]

Of course you now can develop your project using the Dojo source release by enabling it in your settings.py:

DOJANGO_DOJO_PROFILE = "local"

defaults to the latest version, but can be any version

that is available within src-folder

DOJANGO_DOJO_VERSION = "1.4.0"

  1. Doing a dojo build

Also the starting of a dojo build is integrated into manage.py and this project has an already setupped build profile defined, so you just have to call:

cd [dojango-sample-dir] python manage.py dojobuild

Afterwards there will be built version here:

[dojango-sample-dir]/dojo-media/release/[DOJANGO_DOJO_BUILD_VERSION]-dojango-with-dojo

  1. Enabling that build

After the build you are able to switch the Dojo environment of your whole project to it. For that you just have to manipulate your [dojango-sample-dir]/settings.py:

DOJANGO_DOJO_PROFILE = "local_release" DOJANGO_DOJO_VERSION = "[DOJANGO_DOJO_BUILD_VERSION]-dojango-with-dojo"

If you now reload the initial page on http://localhost:8000 it will require less JavaScript files.