|
Hi...all,
I am using cherrypy more than 2 months, now i am having strange doubt, is it necessary we should use def index(), for our index page....(exact name index(), we can't use other names?)? One more is i want to call directly a html file, that is navigation from one html file to another html file, is it possible?(i want to call a static html file, from my another html file) instead of writing a method to call a static file... please help me to find out....Thanks in advance..... -- 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. |
|
You could use serve_file in index to return a html file and the staticdir tool for all other html files you want to link to.
EuGeNe -- follow me on http://twitter.com/3kwa On 14/05/2012, at 6:05 PM, ram_ganeshu <[hidden email]> wrote: > Hi...all, > I am using cherrypy more than 2 months, now i am having strange > doubt, is it necessary we should use def index(), for our index > page....(exact name index(), we can't use other names?)? > One more is i want to call > directly a html file, that is navigation from one html file to another > html file, is it possible?(i want to call a static html file, from my > another html file) instead of writing a method to call a static > file... > please help me to find out....Thanks in > advance..... > > -- > 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. > -- 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. |
|
In reply to this post by ram_ganeshu
ram_ganeshu wrote:
> I am using cherrypy more than 2 months, now i am having strange > doubt, is it necessary we should use def index(), for our index > page....(exact name index(), we can't use other names?)? Why would you want to? Here's the issue. Web requests need to end up with files, not directories. When a web request arrives for a directory (like "http://www.website.com/" or "http://www.website.com/folder/"), Apache rewrites that to refer to "index.html". (The exact list is in your Apache configuration files.) That's where this convention comes from. -- 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. |
|
why...in the sense, my doubt is that...so it is fixed? we have to to use index () only, for index page...
On Mon, May 14, 2012 at 11:49 PM, Tim Roberts <[hidden email]> wrote:
-- ---G.GaneshPandi--- -- 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. |
|
Not fixed - it never was broken.
As described, this business about "index.html" is a bit of pandering to an old convention. You can of course use any name as an initial or subsequent landing page. Alan -----Original Message----- From: [hidden email] on behalf of GaneshPandi Sent: Tue 15/05/2012 06:10 To: [hidden email] Subject: Re: [cherrypy-users] doubts on cherrypy why...in the sense, my doubt is that...so it is fixed? we have to to use index () only, for index page... On Mon, May 14, 2012 at 11:49 PM, Tim Roberts <[hidden email]> wrote: > ram_ganeshu wrote: > > I am using cherrypy more than 2 months, now i am having strange > > doubt, is it necessary we should use def index(), for our index > > page....(exact name index(), we can't use other names?)? > > Why would you want to? > > Here's the issue. Web requests need to end up with files, not > directories. When a web request arrives for a directory (like > "http://www.website.com/" or "http://www.website.com/folder/"), Apache > rewrites that to refer to "index.html". (The exact list is in your > Apache configuration files.) That's where this convention comes from. > > -- > 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. > > -- ---G.GaneshPandi--- -- 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. -- 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. |
|
In reply to this post by ram_ganeshu
GaneshPandi wrote:
> why...in the sense, my doubt is that...so it is fixed? we have to to > use index () only, for index page... I'm sorry, I don't understand the question. "index" is just a convention. If you are using Apache as a front-end, you can change the name of the default page using the DirectoryIndex directive in your .htaccess file. Also, remember that you aren't REQUIRED to support an index page. If you know that every request to your CherryPy site will include a page name, then you don't need index(). It all depends on what you need to provide to your users. -- 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. |
| Powered by Nabble | Edit this page |
