Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proutes does not show static routes #1180

Closed
mmerickel opened this issue Oct 31, 2013 · 9 comments · Fixed by #1488
Closed

proutes does not show static routes #1180

mmerickel opened this issue Oct 31, 2013 · 9 comments · Fixed by #1488

Comments

@mmerickel
Copy link
Member

No description provided.

@marioidival
Copy link

captura de tela 2014-02-25 as 15 43 33

@mmerickel
Copy link
Member Author

There is a difference between static views and a route tagged as static. See the documentation about config.add_route(..., static=True) for more info.

@marioidival
Copy link

in my project is put as config.add_static_view(), he can return an static url... your report bug is about route tagged as view?

@mmerickel
Copy link
Member Author

I know it's confusing but in pyramid's jargon a "static route" is something that is not used for matching incoming requests, and exist only to help generate urls by name. Static views on the other hand are used to serve up static content from the filesystem.

@latteier
Copy link
Contributor

Since static routes aren't matched against when a request comes in, then I think it's reasonable not to display them in proutes.

Also external routes aren't shown by proutes, which also seems reasonable to me.

@sontek
Copy link
Member

sontek commented Dec 26, 2014

With #1488 instead of showing:

__static/       /static/*subpath               <function <pyramid.static.static_view object at 0x2257750> at 0x2265aa0>
__static2/      /static2/*subpath              <function <pyramid.static.static_view object at 0x2257810> at 0x2265cf8>
__pdt_images/   /pdt_images/*subpath           <function <pyramid.static.static_view object at 0x2257910> at 0x2265ed8>

It will now show:

__static/                  /static/*subpath            dummy_starter:static/                                   *                  
__static2/                 /static2/*subpath           /var/www/static/                                        *                  
__pdt_images/              /pdt_images/*subpath        pyramid_debugtoolbar:static/img/                        *                  

which I think is much better and probably fixes this bug

@sontek
Copy link
Member

sontek commented Dec 26, 2014

@mmerickel disregard my last comment, just not realized you were talking static=True and not add_static_view.

@sontek
Copy link
Member

sontek commented Dec 26, 2014

if not static:
self.routelist.append(route)

The offender that makes it not show up

@sontek
Copy link
Member

sontek commented Dec 26, 2014

@mmerickel Ok, as of 582c2ed proutes now supports static routes:

proutes development.ini
Name                         Pattern                            View                            Method    
----                         -------                            ----                            ------    
foo                          http://example.com/bar.aspx        <unknown>                       * 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants