Mico Siahaan wrote:
> I am making a website using Webkit + Cheetah Template. I want the
> directory structure to be like this:
> 
> web:
>     | - application (this directory was made using MakeAppWorkDir.py)
>           |- Lib
>           |- MyContext
>     |- templates
>     |- css
>     |- images
>     |- flash

First, I suggest putting all static content in one separate directory:

web:
     | - application (this directory was made using MakeAppWorkDir.py)
           |- Lib
           |- MyContext
           | - Static
               |- templates
               |- css
               |- images
               |- flash


If all these static content belongs to your application, you should make 
it a subdirectory of your Webware working directory ("application") as 
indicated above, otherwise you can put it directly below "web" or use an 
already existing htdocs folder instead of "Static".

Then, you should choose a default context. You can either make 
"MyContext" the default context, then you must prefix your static 
content in the URL with something like "/static/", or you can choose 
your Static folder as the default, then you must prefix your Webware app 
context with something like "/app/".

In the first case, you would set

Contexts = { 'static': 'Static', 'default': 'MyContext'}

or you can also create contexts for all your static categories:

Contexts = { 'css': 'Static/css', ... 'default': 'MyContext'}

in the second case

Contexts = { 'app': 'MyContext', 'default': 'Static'}

Now you can already test your application with the built-in webserver.

Then, you should configure Apache to serve the static content instead of 
Webware. In the first case, you would need mod_rewrite, the second case 
is straightforward, but you will need a redirect if the front page shall 
be dynamic already.

See also the various recipes in the Webware Wiki,
http://wiki.w4py.org/webware-recipes
http://wiki.w4py.org/modrewrite-recipes

Hope that helps.

-- Chris







-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to