static files, making all files and sub directories in a directory available?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

static files, making all files and sub directories in a directory available?

René Dudfield

hi,

is there a way to make all files and sub directories in a directory
available?


Is there a way *without* specifying each file and sub directory to
cherrypy?  I need this, as I'm adding files and sub directories after
cherrypy starts up.



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

Reply | Threaded
Open this post in threaded view
|

Re: static files, making all files and sub directories in a directory available?

Andrew Maizels
I think it just works.

On Mon, Dec 15, 2008 at 6:01 PM, illume <[hidden email]> wrote:

hi,

is there a way to make all files and sub directories in a directory
available?


Is there a way *without* specifying each file and sub directory to
cherrypy?  I need this, as I'm adding files and sub directories after
cherrypy starts up.



cheers,




--
Do not complain to us about your MAKO defying natural laws and proper physics. Physics is for the weak. You are not weak. You are strong.

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

Reply | Threaded
Open this post in threaded view
|

directory listings? Re: static files, making all files and sub directories in a directory available?

René Dudfield

hi,

Is there a way to do directory listings?




ah!  Serving files does appear to work for sub directories.  It cached
the 404 error, after reloading the page it worked fine.

current_dir = os.path.dirname(os.path.abspath(__file__))
some_conf = {"/" : {'tools.staticdir.root': os.path.join(current_dir),
                           },
                    'static' : {'tools.staticdir.on': True,
                                 'tools.staticdir.dir': 'static'}
                    }


However, there's no directory listings.  Is there an option to enable
that?



cheers,


Andrew Maizels wrote:

> I think it just works.
>
> On Mon, Dec 15, 2008 at 6:01 PM, illume <[hidden email]> wrote:
>
> >
> > hi,
> >
> > is there a way to make all files and sub directories in a directory
> > available?
> >
> >
> > Is there a way *without* specifying each file and sub directory to
> > cherrypy?  I need this, as I'm adding files and sub directories after
> > cherrypy starts up.
> >
> >
> >
> > cheers,
> > >
> >
>
>
> --
> Do not complain to us about your MAKO defying natural laws and proper
> physics. Physics is for the weak. You are not weak. You are strong.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: directory listings? Re: static files, making all files and sub directories in a directory available?

Tim Roberts

illume wrote:

> Is there a way to do directory listings?
>
> ah!  Serving files does appear to work for sub directories.  It cached
> the 404 error, after reloading the page it worked fine.
>
> current_dir = os.path.dirname(os.path.abspath(__file__))
> some_conf = {"/" : {'tools.staticdir.root': os.path.join(current_dir),
>                            },
>                     'static' : {'tools.staticdir.on': True,
>                                  'tools.staticdir.dir': 'static'}
>                     }
>
> However, there's no directory listings.  Is there an option to enable
> that?
>  

It's trivial to write such a thing yourself.

On the other hand, why not just pass that job off to Apache, which has
that kind of functionality built-in?

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.


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

Reply | Threaded
Open this post in threaded view
|

Re: directory listings? Re: static files, making all files and sub directories in a directory available?

René Dudfield

Hi,

I hacked up something workable.  I just thought there might be
something available that did directory listings already.  Doesn't look
like there is.

Just don't want to have to install+configure apache, when cherrypy
seems to be able to do the job ok.


cu,




On Dec 16, 11:40 am, Tim Roberts <[hidden email]> wrote:

> illume wrote:
> > Is there a way to do directory listings?
>
> > ah!  Serving files does appear to work for sub directories.  It cached
> > the 404 error, after reloading the page it worked fine.
>
> > current_dir = os.path.dirname(os.path.abspath(__file__))
> > some_conf = {"/" : {'tools.staticdir.root': os.path.join(current_dir),
> >                            },
> >                     'static' : {'tools.staticdir.on': True,
> >                                  'tools.staticdir.dir': 'static'}
> >                     }
>
> > However, there's no directory listings.  Is there an option to enable
> > that?
>
> It's trivial to write such a thing yourself.
>
> On the other hand, why not just pass that job off to Apache, which has
> that kind of functionality built-in?
>
> --
> Tim Roberts, [hidden email]
> Providenza & Boekelheide, Inc.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---