Re: [pylons-discuss] How to resolve the add_route URLs conflict

2016-09-21 Thread Eric Lo
oops.  typo fix:

conflict by `config.add_static_view('photos', settings['photos_dir'], 
cache_max_age=3600)`

change static view name will resolved,

 `config.add_static_view('photos_static', settings['photos_dir'], 
cache_max_age=3600)`   

--  
Best Regards,
Eric Lo
https://lxneng.com (http://lxneng.com/)


On Thursday, 22 September 2016 at 10:51 AM, Eric Lo wrote:

> Thanks Michael and Mikko.  
>  
> resolved, that conflict by `config.add_static_view('photos_static', 
> settings['photos_dir'], cache_max_age=3600)`
>  
>  
>  
> --  
> Best Regards,
> Eric Lo
> https://lxneng.com (http://lxneng.com/)
>  
>  
> On Thursday, 22 September 2016 at 10:31 AM, Eric Lo wrote:
>  
> > but when i change to `config.add_route('all_photos', '/photos-all’)`, it 
> > works.  
> >  
> > --  
> > Best Regards,
> > Eric Lo
> > https://lxneng.com (http://lxneng.com/)
> >  
> >  
> > On Thursday, 22 September 2016 at 3:41 AM, Mikko Ohtamaa wrote:
> >  
> > >  
> > >  
> > > >  
> > > > open http://localhost:6543/photos/all got 404 resource not found error.
> > > >  
> > > >  
> > >  
> > >  
> > > You can also get 404 in the case you have are rendering a template and 
> > > the template cannot be found on file system.
> > > --  
> > > Mikko Ohtamaa
> > > http://opensourcehacker.com
> > > http://twitter.com/moo9000
> > >  
> > > --  
> > > You received this message because you are subscribed to the Google Groups 
> > > "pylons-discuss" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to pylons-discuss+unsubscr...@googlegroups.com 
> > > (mailto:pylons-discuss+unsubscr...@googlegroups.com).
> > > To post to this group, send email to pylons-discuss@googlegroups.com 
> > > (mailto:pylons-discuss@googlegroups.com).
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUvHZLyp5DN%2B%2B%3D8WOFpYq%3DUoiUc8ZEAeXcnhK4EOFpVQXA%40mail.gmail.com
> > >  
> > > (https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUvHZLyp5DN%2B%2B%3D8WOFpYq%3DUoiUc8ZEAeXcnhK4EOFpVQXA%40mail.gmail.com?utm_medium=email&utm_source=footer).
> > > For more options, visit https://groups.google.com/d/optout.
> >  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/34A6F7378E5B4CABBD8A37344D85AB17%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] How to resolve the add_route URLs conflict

2016-09-21 Thread Eric Lo
Thanks Michael and Mikko.  

resolved, that conflict by `config.add_static_view('photos_static', 
settings['photos_dir'], cache_max_age=3600)`



--  
Best Regards,
Eric Lo
https://lxneng.com (http://lxneng.com/)


On Thursday, 22 September 2016 at 10:31 AM, Eric Lo wrote:

> but when i change to `config.add_route('all_photos', '/photos-all’)`, it 
> works.  
>  
> --  
> Best Regards,
> Eric Lo
> https://lxneng.com (http://lxneng.com/)
>  
>  
> On Thursday, 22 September 2016 at 3:41 AM, Mikko Ohtamaa wrote:
>  
> >  
> >  
> > >  
> > > open http://localhost:6543/photos/all got 404 resource not found error.
> > >  
> > >  
> >  
> >  
> > You can also get 404 in the case you have are rendering a template and the 
> > template cannot be found on file system.
> > --  
> > Mikko Ohtamaa
> > http://opensourcehacker.com
> > http://twitter.com/moo9000
> >  
> > --  
> > You received this message because you are subscribed to the Google Groups 
> > "pylons-discuss" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to pylons-discuss+unsubscr...@googlegroups.com 
> > (mailto:pylons-discuss+unsubscr...@googlegroups.com).
> > To post to this group, send email to pylons-discuss@googlegroups.com 
> > (mailto:pylons-discuss@googlegroups.com).
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUvHZLyp5DN%2B%2B%3D8WOFpYq%3DUoiUc8ZEAeXcnhK4EOFpVQXA%40mail.gmail.com
> >  
> > (https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUvHZLyp5DN%2B%2B%3D8WOFpYq%3DUoiUc8ZEAeXcnhK4EOFpVQXA%40mail.gmail.com?utm_medium=email&utm_source=footer).
> > For more options, visit https://groups.google.com/d/optout.
>  

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/E7F0609CC16B4034B5631AE76BE5627C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] How to resolve the add_route URLs conflict

2016-09-21 Thread Eric Lo
but when i change to `config.add_route('all_photos', '/photos-all’)`, it works. 
 

--  
Best Regards,
Eric Lo
https://lxneng.com (http://lxneng.com/)


On Thursday, 22 September 2016 at 3:41 AM, Mikko Ohtamaa wrote:

>  
>  
> >  
> > open http://localhost:6543/photos/all got 404 resource not found error.
> >  
> >  
>  
>  
> You can also get 404 in the case you have are rendering a template and the 
> template cannot be found on file system.
> --  
> Mikko Ohtamaa
> http://opensourcehacker.com
> http://twitter.com/moo9000
>  
> --  
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to pylons-discuss+unsubscr...@googlegroups.com 
> (mailto:pylons-discuss+unsubscr...@googlegroups.com).
> To post to this group, send email to pylons-discuss@googlegroups.com 
> (mailto:pylons-discuss@googlegroups.com).
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUvHZLyp5DN%2B%2B%3D8WOFpYq%3DUoiUc8ZEAeXcnhK4EOFpVQXA%40mail.gmail.com
>  
> (https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUvHZLyp5DN%2B%2B%3D8WOFpYq%3DUoiUc8ZEAeXcnhK4EOFpVQXA%40mail.gmail.com?utm_medium=email&utm_source=footer).
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/6B42FBC7517B40FA86AB484A0169DE35%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] How to resolve the add_route URLs conflict

2016-09-21 Thread Mikko Ohtamaa
open http://localhost:6543/photos/all got 404 resource not found error.
>

You can also get 404 in the case you have are rendering a template and the
template cannot be found on file system.
-- 
Mikko Ohtamaa
http://opensourcehacker.com
http://twitter.com/moo9000

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUvHZLyp5DN%2B%2B%3D8WOFpYq%3DUoiUc8ZEAeXcnhK4EOFpVQXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [pylons-discuss] How to resolve the add_route URLs conflict

2016-09-21 Thread Michael Merickel
There are several reasons you can get a 404. Have you tried enabling
notfound debugging[1] or using the pviews command-line to see what you get?
You can also enable route match debugging explicitly to see if it's an
issue with routes, but likely it's not anything to do with the code you've
pasted.

[1]
http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#debugging-not-found-errors

On Wed, Sep 21, 2016 at 10:56 AM, lxneng  wrote:

> Hi,
>
>
> after upgrade to pyramid 1.7.3, these route will conflict:
>
> # photos
> config.add_route('photos', '/photos')
> config.add_route('all_photos', '/photos/all')
> config.add_route('all_photos_pagination', '/photos/all/{page:\d+}')
> config.add_route('photos_album', '/photos/albums/{id:\d+}',
>  factory=factories.AlbumFactory)
> config.add_route('photos_album_new', '/photos/albums/new')
> config.add_route('photos_album_edit', '/photos/albums/{id:\d+}/edit',
>  factory=factories.AlbumFactory)
> config.add_route(
> 'photos_album_upload', '/photos/albums/{id:\d+}/upload',
> factory=factories.AlbumFactory)
>
> open http://localhost:6543/photos/all got 404 resource not found error.
>
> envs:
>
> python = 3.5.1
> pyramid = 1.7.3
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-discuss+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/pylons-discuss/10740ccc-ae03-42ad-959a-f7b4b6c80c1d%
> 40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwGkwhKg0cuOBEQFpz_C4gVpAF_iyeCPFaq8QYttjfdb%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[pylons-discuss] How to resolve the add_route URLs conflict

2016-09-21 Thread lxneng


Hi,


after upgrade to pyramid 1.7.3, these route will conflict:

# photos
config.add_route('photos', '/photos')
config.add_route('all_photos', '/photos/all')
config.add_route('all_photos_pagination', '/photos/all/{page:\d+}')
config.add_route('photos_album', '/photos/albums/{id:\d+}',
 factory=factories.AlbumFactory)
config.add_route('photos_album_new', '/photos/albums/new')
config.add_route('photos_album_edit', '/photos/albums/{id:\d+}/edit',
 factory=factories.AlbumFactory)
config.add_route(
'photos_album_upload', '/photos/albums/{id:\d+}/upload',
factory=factories.AlbumFactory)

open http://localhost:6543/photos/all got 404 resource not found error.

envs:

python = 3.5.1
pyramid = 1.7.3

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/10740ccc-ae03-42ad-959a-f7b4b6c80c1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.