Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:23:18+00:00 2026-06-15T10:23:18+00:00

Hi I am having problems with the template using Bottle my folder structure is

  • 0

Hi I am having problems with the template using Bottle

my folder structure is this:

|views  
 --main.tpl
 --|blog
    --home.tpl

what I want to do is this:

def home():
    return template('blog/home')  

but it won’t work

I can get it to work just calling the following:

def home():
    return template('main')     

But I want to be-able to have many different folders
I understand that I will still need to keep unique names because of the caching
and please don’t say use a different framework as this is not my choice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:23:20+00:00Added an answer on June 15, 2026 at 10:23 am

    You can try passing the template_lookup argument to the template function. template_lookup overrides the defaults .views path when looking for the template. However I believe this will only work if the name of the tempalte is not in the views folder. So if you had a /views/main.tpl and a /blog/main.tpl it would not work, every template needs a unique name. This is needed because bottle will only lookup search for tempaltes if it hasn’t found it before and stores the found ones in a dict with the tempalte name as the key. so if the templates have the same name it would use the first one.

    return template("home", template_lookup="full_path_to/views/blog/"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I´m having problems using VichUploaderBundle. Uploads files correctly, but when I write <td><img src=<img
I'm having problems using a ostream in my logger class. For some reason, the
I'm having some problems using sed in combination with html. The following sample illustrates
I'm having problems using {% ifequal s1 some text %} to compare strings with
Below is the CSS template I am using for my site. I'm just having
I'm having problem with FS controller page template. I had this Plone2 base product
im using the Devexpress ASPxGridView for a project but are having problems to populate
I want to generate a html template to a pdf file using pisa. I
I've made a class template called Queue but I'm having problems trying to instanciate
Just like the title says I am having problems combining two classes. Altough this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.