OK, I installed the current version of web2py on my laptop and copied over
the 'init' application and a 'blog' application. I've launched the test
server and opened the blog app in my browser.
The main problem I'm having now is URL rewriting. Here's routes.py in my
blog app:
default_controller = 'default' # ordinarily set in app-specific routes.py
default_function = 'index' # ordinarily set in app-specific routes.py
#
routes_in = (
('/blog/category/$anything', '/blog/default/tag/$anything'),
('/blog/static/$anything', '/blog/static/$anything'),
('/blog', '/blog/default/index'),
('/blog/$anything', '/blog/default/post/$anything'),
)
routes_out = [(y,x) for (x,y) in routes_in]
And here's the index template of the blog:
{{ response.files.append(URL('static/css/blog.css')) }}
{{extend '../../init/views/layout.html'}}
<h1>Latest Blog Posts:</h1>
{{ for post in posts: }}
<div class="post">
<h2 class="title"><a href="{{ =URL('index',args=[post.slug]) }}">{{ =post.title
}}</a></h2>
{{ if post.thumbnail: }}
<img class=blog_thumbnail src="{{ =URL(post.thumbnail) }}" alt="{{
=post.title }}">
{{ pass }}
<p class="description">
{{ =post.meta_description }}
<a href="{{ =URL('index',args=[post.slug]) }}">More >></a>
</p>
</div>
{{ pass }}
On the old version of my blog, I would get relative URLs
'/blog/<post_slug>', but now I'm getting '/blog/default/<post_slug>'.
SImilar behavior is occurring in the top-level navigation. Has routing
behavior changed?
On Wednesday, June 12, 2019 at 3:13:38 PM UTC-5, Jim Gregory wrote:
>
> I will be moving a legacy application from my old shared host to a new
> VPS, and would like to upgrade web2py at the same time from 2.08 to the
> current version (2.18.5). How should I go about doing this? What changes
> will I need to make? I'm satisfied for now with the currently layout
> (which uses Bootstrap 2), so I don't want to change it if I don't need to.
> TIA.
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/f33e4d33-c45a-42c0-90b0-ff20ed2369bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.