Bare bones page may have config issues

36 views
Skip to first unread message

Jack Eisenbach

unread,
Dec 20, 2019, 9:08:02 AM12/20/19
to cherrypy-users
Hi,
I  seem to be having issues when configuring Cherrypy. I created a bare bones site that should display a jpeg from the static/images folder. It should also format the page from details provided from the static/css/style.css page. The problems I have  are: the image is not displayed and the background is not light Blue in color. I have attached the 4 files. Thanks in advance for all assistance. i've been stuck for weeks trying to resolve these issues. I have not been able to find a bare bones example using Cherrypy to do the above.
Kind regards, Please disregard my previous posts with similar question. I had some typos in them.
Jack
traffic.jpg
bb.PY
bb.config
style.css

Sviatoslav Sydorenko

unread,
Dec 20, 2019, 9:17:09 AM12/20/19
to cherryp...@googlegroups.com
Hi Jack,

I think it's best to post text directly or use something like a GitHub
Gist or a regular repository on GitHub.
It's hard to reason about things that aren't immediately visible in
the mailing list archive.
For example, one may want to add a comment to your code. It's
impossible with an attachment but it's
easy to do if there's some snippet in the previous email that can be quoted.

Here's an example:
> def hello(world):
> print(word)

The comment *here* would be that there's a typo in this line.

> return world


Also, if the source is really big, it's better to come up with a
minimal reproducer that would have way
fewer lines and rip off all the unrelated parts to help everyone focus
on important things.

пт, 20 груд. 2019 о 15:08 Jack Eisenbach <jackei...@gmail.com> пише:
> --
> You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cherrypy-users/76fec327-d637-41af-bf87-206a9cfe4ae3%40googlegroups.com.



--
Cheers,
Sviatoslav.

---
https://useplaintext.email/
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
---

Jack Eisenbach

unread,
Dec 20, 2019, 10:11:43 AM12/20/19
to cherrypy-users
Hi Sviatoslav,
I took a previous project and minimalized it as much as possible and renamed it bb.py for barebones.py. 
The lquickstart ine near the end of the file is:
cherrypy.quickstart(BB(), '/'. 'bb.config')
The bb.config file contains:

[/]
tools.sessions.on: True
path = 'C:\\workspace\\CP'


[/static]
tools.staticdir.on : True
tools.staticdir.root : "C:\\workspace\\CP\\"
tools.staticdir.dir : "/workspace/CP/static"
tools.staticfile.on = True
tools.staticfile.filename = 'C:\workspace\CP\static\css\style.css'

[/static/css]
tools.staticdir.on : True
tools.staticdir.root : "/workspace/CP/"
tools.staticdir.dir : "workspace/CP/static/css/"


I have looked at other examples and modified the above code numerous times with no success.
Do you see anything obviously wrong with the config above?
Thanks,
jack


> To unsubscribe from this group and stop receiving emails from it, send an email to cherryp...@googlegroups.com.

Tim Roberts

unread,
Dec 20, 2019, 6:28:43 PM12/20/19
to cherryp...@googlegroups.com
Your config file has some issues:

[/]
tools.sessions.on: True
path = 'C:\\workspace\\CP'


[/static]
tools.staticdir.on : True
tools.staticdir.root : "C:\\workspace\\CP\\"
tools.staticdir.dir : "/workspace/CP/static"
tools.staticfile.on = True
tools.staticfile.filename = 'C:\workspace\CP\static\css\style.css'

[/static/css]
tools.staticdir.on : True
tools.staticdir.root : "/workspace/CP/"
tools.staticdir.dir : "workspace/CP/static/css/"

That's going to make the path for requests in /static/css
"/workspace/CP/workspace/CP/static/css".  I think you just want this:

[/]
tools.sessions.on: True
path = 'C:\\workspace\\CP'
tools.staticdir.root: "C:\\workspace\\CP"

[/static]
tools.staticdir.on : True
tools.staticdir.dir : "static"

[/static/css]
tools.staticdir.on : True
tools.staticdir.dir : "static/css/"

--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.


Jack Eisenbach

unread,
Feb 14, 2020, 3:36:34 PM2/14/20
to cherrypy-users
Thanks Tim, I tried your suggested changes but I still don't see the traffic.jpg image after browsing. Is there something else I should try?
Reply all
Reply to author
Forward
0 new messages