The images are now working also.
here's the way it's configured:
directory build explained in previous message
[/]
tools.staticdir.root =
"/Users/mendes/Documents/verza/python/
scripts/endUser/data"
[/css]
tools.staticdir.on = True
in the application itself the following code exists
current_dir =
os.path.dirname(os.path.abspath(__file__))
cherrypy.config.update(os.path.join(os.path.dirname(__file__
),'app.conf'))
conf = {'/css': {'tools.staticdir.on': True,
'tools.staticdir.dir':
os.path.join(current_dir, 'data', 'css')}}
cherrypy.quickstart(EndUserSupport(),config=conf)
with this all the files that are in directory css will be
presented on
the html file
hope someone else can use this.
richard
On Oct 18, 8:22 am, cyclopsvs <mendes... gmail.com> wrote:
> A small response for people who are dealing with the
same problems.
> I figured out a part of the solution.
>
> the directory is build in the following way
>
> endUser
> endUserSupport.py
> data
> css
> style.css
> images.jpeg
>
> i altered the config file just a bit,
> instead of all the content that was in there containing
the static
> paths i replaced them with
>
> [/]
> tools.staticdir.root =
"/Users/mendes/Documents/verza/python/
> scripts/endUser/data"
>
> [/style.css]
> tools.staticfile.on = True
> tools.staticfile.filename =
"/Users/mendes/Documents/verza/
> python/scripts/endUser/data/css/style.css"
>
> in my endUserSupport.py itself the following code
exists
>
> current_dir =
os.path.dirname(os.path.abspath(__file__))
>
>
cherrypy.config.update(os.path.join(os.path.dirname(__file__
),'app.conf'))
> conf = {'/css/style.css':
{'tools.staticfile.on': True,
>
> 'tools.staticfile.filename': os.path.join(current_dir,
'data', 'css',
> 'style.css')}}
>
> this code will present the html file with css styling
althought i
> still have a problem with the images called from the
css file those
> aren't presented yet.
> if someone has the answer how to present these images i
would really
> like to know.
>
> in the meantime i will keep trying to play around and
see if i can
> figure it out myself.
>
> richard
>
> cyclopsvs wrote:
> > Hello All,
>
> > after my last post i really figured i could
present a working example
> > to the project manager.
> > unfortunatly i ran into trouble once again. I
looked at the
> > documentation about html pages which yield css
styling but didn't
> > really understand.
>
> > the thing that happens at this moment is that i
see the css style
> > sheet content instead of the html file content
with the css style.
>
> > my config file is constructed the following way:
>
> > server.socket_host =
"10.47.0.95"
> > server.socket_port = 8083
> > server.thread_pool = 100
>
> > tools.staticdir.root =
"/Users/mendes/Documents/verza/python/
> > scripts/endUser/"
> > tools.staticfile.on = True
> > tools.staticfile.filename =
"/Users/mendes/Documents/verza/
> >
python/scripts/endUser/templates/images/style.css"
>
> > server.ssl_certificate =
"/Users/mendes/Documents/verza/
> > python/scripts/endUser/keys/10.47.0.1.crt"
> > server.ssl_private_key =
"/Users/mendes/Documents/verza/
> > python/scripts/endUser/keys/10.47.0.1.key"
>
> > in my application i use the following syntax
>
> > import os.path
>
> >
cherrypy.config.update(os.path.join(os.path.dirname(__file__
),'app.conf'))
> >
cherrypy.quickstart(EndUserSupport(),config='app.conf')
>
> > and i try to present a html file by using
cherrytemplate in the
> > following way
>
> > return
renderTemplate(file='templates/index.htm')
>
> > My first question is about the
cherrypy.config.update is this really
> > necesarry to call upon because i don't really
update anything at this
> > moment ?
>
> > The other and most important question for me is
about the presentation
> > of the html file.
>
> > at this moment i get the content from the css
file
> > ( tools.staticfile.filename path ) what do i have
to do to present the
> > html file with the css styling ?
>
> > thanks in advance for you assistance,
>
> > regards,
>
> > richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|