[10115] | 1 | waeup.diazo |
---|
| 2 | =========== |
---|
| 3 | |
---|
| 4 | Diazo support for waeup.kofa. |
---|
| 5 | |
---|
| 6 | Diazo 'masquerades' running sites. In our case it gives nearly |
---|
| 7 | unstyled Kofa sites a nice look, injects twitter bootstrap and more. |
---|
| 8 | |
---|
| 9 | Prerequisites: |
---|
| 10 | |
---|
| 11 | You need git installed locally. Also libxslt-dev, libxml-dev, a C |
---|
| 12 | compiler like gcc, etc. No Windows(tm) support. |
---|
| 13 | |
---|
| 14 | In short: |
---|
| 15 | |
---|
| 16 | 1) Create a virtual environment (Python 2.6 or 2.7) and activate it:: |
---|
| 17 | |
---|
| 18 | $ virtualenv sandbox27 |
---|
| 19 | $ source sandbox27/bin/activate |
---|
| 20 | |
---|
| 21 | 2) Build diazo and all the stuff in here:: |
---|
| 22 | |
---|
| 23 | (sandbox27)$ python bootstrap.py |
---|
[10856] | 24 | |
---|
| 25 | If you get an error message about:: |
---|
| 26 | |
---|
| 27 | AttributeError: 'NoneType' object has no attribute 'location' |
---|
| 28 | |
---|
| 29 | then you have to install the Python `distribute` package. This is |
---|
| 30 | not a big thing, when operating in a virtual environment:: |
---|
| 31 | |
---|
| 32 | (sandbox27)$ pip install --upgrade distribute |
---|
| 33 | |
---|
| 34 | Finally, fetch packages and configure everything by:: |
---|
| 35 | |
---|
[10115] | 36 | (sandbox27)$ ./bin/buildout |
---|
| 37 | |
---|
| 38 | This also creates a runnable Grok instance in src/waeup.kofa. |
---|
| 39 | |
---|
[10856] | 40 | |
---|
[10115] | 41 | 3) Start some grok instance on port 8080 and create a kofa instance |
---|
| 42 | named `app`. You can use, for instance, the stuff in src/:: |
---|
| 43 | |
---|
| 44 | (sandbox27)$ cd src/waeup.kofa |
---|
| 45 | (sandbox27)$ python bootstrap.py |
---|
| 46 | (sandbox27)$ ./bin/buildout |
---|
| 47 | (sandbox27)$ ./bin/kofactl start |
---|
| 48 | |
---|
| 49 | Now login on http://localhost:8080/ (grok/grok) and create an |
---|
| 50 | instance called `app`. |
---|
| 51 | |
---|
| 52 | 4) Start diazo:: |
---|
| 53 | |
---|
| 54 | (sandbox27)$ cd ../../ |
---|
| 55 | (sandbox27)$ ./bin/paster serve --reload kofaproxy.ini |
---|
| 56 | |
---|
| 57 | Watch the results on http://localhost:8000/. |
---|
| 58 | |
---|
| 59 | The results shown can be modified in kofa/base.xml and |
---|
| 60 | kofa/theme.html. Changes should be reflected immediately, if you |
---|
| 61 | started the diazo paster process with the ``--reload`` option. |
---|
| 62 | |
---|
| 63 | The machine whose output we want to filter is set in |
---|
| 64 | `kofaproxy.ini`. In this file we also tell where twitter bootstrap and |
---|
| 65 | static resources reside (and many more things). |
---|
| 66 | |
---|
| 67 | To shutdown Diazo press CTRL-D, to stop Grok change to the |
---|
| 68 | src/waeup.kofa dir and run:: |
---|
| 69 | |
---|
[10123] | 70 | (sandbox27)$ ./bin/kofactl stop |
---|
[10115] | 71 | |
---|
[10123] | 72 | Serving Content As-is |
---|
| 73 | --------------------- |
---|
[10115] | 74 | |
---|
[10123] | 75 | The local `raw.ini` paster configuration sets up a Diazo server that |
---|
| 76 | doesn't actually use Diazo:: |
---|
| 77 | |
---|
| 78 | $ ./bin/paster serve raw.ini |
---|
| 79 | |
---|
| 80 | This might make sense during migration of an existing site to Diazo. |
---|
| 81 | |
---|
| 82 | |
---|
[10115] | 83 | Have fun. |
---|
| 84 | |
---|