Aloha,

I am using webpy 03 and the webpy templates.  For css and javascript I
using prototype and yiu which are placed in my /static dir as such /
static/yiu and /static/js/prototype.js

Everything works using the webpy server but when I deploy to my
localhost apache server any js or css in the /static dir is not
found.  The /template dir is found and serving the html...but I have
no css or js files.

My apache log trys to find http://localhost/cgi-bin/index.py/static/.....

e.g. 127.0.0.1 - - [12/Dec/2008:21:27:57 -0800] "GET /cgi-bin/index.py/
static/yui/build/treeview/assets/skins/sam/treeview.css HTTP/1.1" 404
51 "$
1

I tried the following code but it did not work:

STATIC_DIRS = ('css', 'javascript', 'images', 'yui')

urls = (...'/(' + '|'.join(STATIC_DIRS) + ')/.*', 'static'...)
def mime_type(filename):
    return mimetypes.guess_type(filename)[0] or 'application/octet-
stream'
class static:
    def GET(self, static_dir):
        try:
            static_file_name = web.context.path.split('/')[-1]
            web.header('Content-type', mime_type(static_file_name))
            static_file = open('.' + web.context.path, 'rb')
            web.ctx.output = static_file
        except IOError:
            web.notfound()

So....what do I do to serve up my css and js files?  I am no expert at
apache so what should I edit in my httpd.conf file?  What is the
easiest thing to do?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to