|
List Info
Thread: static file doc not work
|
|
| static file doc not work |

|
2006-12-20 16:46:03 |
gasolin gmail.com wrote:
> I found the doc "Serving static content with
CherryPy 3"
> in cherrypy wiki, http://www
.cherrypy.org/wiki/StaticContent
> the syntax
> cherrypy.quickstart(Root(), '/', config=conf)
> is not valid in CP3-rc1
Looks valid to me. Can you elaborate?
Robert Brewer
System Architect
Amor Ministries
fumanchu amor.org
--~--~---------~--~----~------------~-------~--~----~
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 http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| static file doc not work |

|
2006-12-21 01:34:29 |
Hi:
I found if I did the 3 step server start, to access
http://localhost:8080/st
atic,
it returns : "The path '/static' was not found".
if __name__ == '__main__':
current_dir = os.path.dirname(os.path.abspath(__file__))
cherrypy.config.update({'environment':
'production','log.screen':
True})
conf = {'/static' :
{'cherrypy.tools.staticdir.on' : True,
'cherrypy.tools.staticdir.dir' :
os.path.join(current_dir,
'static')}}
root = Root()
cherrypy.tree.mount(root)
cherrypy.server.quickstart()
cherrypy.engine.start()
Did I missed something?
--
Fred
--~--~---------~--~----~------------~-------~--~----~
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 http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| static file doc not work |

|
2006-12-21 04:38:24 |
On 12/20/06, gasolin gmail.com <gasolin gmail.com> wrote:
>
> Hi:
>
> I found if I did the 3 step server start, to access
> http://localhost:8080/st
atic,
> it returns : "The path '/static' was not
found".
>
>
> if __name__ == '__main__':
>
> current_dir =
os.path.dirname(os.path.abspath(__file__))
> cherrypy.config.update({'environment':
'production','log.screen':
> True})
> conf = {'/static' :
> {'cherrypy.tools.staticdir.on' : True,
> 'cherrypy.tools.staticdir.dir' :
> os.path.join(current_dir,
> 'static')}}
> root = Root()
> cherrypy.tree.mount(root)
> cherrypy.server.quickstart()
> cherrypy.engine.start()
>
>
> Did I missed something?
It looks like you are defining a config (conf) but not
passing it to
mount(). Try:
cherrypy.tree.mount(root, config=conf)
HTH,
Christian
--~--~---------~--~----~------------~-------~--~----~
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 http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| static file doc not work |

|
2006-12-21 07:46:20 |
gasolin gmail.com wrote:
> I found if I did the 3 step server start, to access
> http://localhost:8080/st
atic,
> it returns : "The path '/static' was not
found".
>
> if __name__ == '__main__':
>
> current_dir =
os.path.dirname(os.path.abspath(__file__))
> cherrypy.config.update({'environment':
'production','log.screen':
> True})
> conf = {'/static' :
> {'cherrypy.tools.staticdir.on' : True,
> 'cherrypy.tools.staticdir.dir' :
> os.path.join(current_dir,
> 'static')}}
> root = Root()
> cherrypy.tree.mount(root)
> cherrypy.server.quickstart()
> cherrypy.engine.start()
FYI, both of those issues now raise a warning by default
(turn off
production mode to run the checker on startup).
Robert Brewer
System Architect
Amor Ministries
fumanchu amor.org
--~--~---------~--~----~------------~-------~--~----~
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 http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| static file doc not work |

|
2006-12-21 08:38:28 |
Thanks, now it works with
conf = {........."tools.staticdir.*}
cherrypy.tree.mount(root, config=conf)
Another case if I want to use "config.update" to
infrom the static file
location, it fails:
conf = {........."tools.staticdir.*}
cherrypy.config.update(conf)
cherrypy.tree.mount(root)
cherrypy.server.quickstart()
cherrypy.engine.start()
Thanks for your respnse
--~--~---------~--~----~------------~-------~--~----~
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 http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
[1-5]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|