List Info

Thread: Re: External Javascript & CSS




Re: External Javascript & CSS
user name
2007-09-06 15:35:32
Hi Mike,

On 9/6/07, MikeC <mcravitzatt.net> wrote:
> I realize this question is pretty basic, but my
knowledge of web
> programming in general and cherrypy specifically is,
well, pretty less
> than basic.
>
> How can I let cherrypy know where my root directory is?
I want to be
> able to specify HTML with stuff like this...
>
> ...
> <script
src="/static/javascript/MochiKit.js"
type="text/javascript">
> </script>
> ...
>
> And have cherrypy actually be able to find MochiKit.js
in the /static/
> javacript subdirectory of the directory contining my
root class.

You do this by installing a specific handler on some url in
CP. This
can be done solely in config. Look at
http://www
.cherrypy.org/wiki/StaticContent for the details.

Arnar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: External Javascript & CSS
user name
2007-09-06 15:38:29
One more thing

> On 9/6/07, MikeC <mcravitzatt.net> wrote:
...
> > And have cherrypy actually be able to find
MochiKit.js in the /static/
> > javacript subdirectory of the directory contining
my root class.

Look specifically at this particular example:

http://www.cherrypy.org/wiki/Stati
cContent#Servingfilesthroughthestaticdirtool

to see how to make it relative to your .py file containing
the root class.

Arnar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )