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

page parameters #147

Open
eddyizm opened this issue Sep 13, 2020 · 0 comments
Open

page parameters #147

eddyizm opened this issue Sep 13, 2020 · 0 comments

Comments

@eddyizm
Copy link

eddyizm commented Sep 13, 2020

I've been reading the docs and have been able to mostly bake a site successfully. However I'm having an issue on passing page parameters to the baking view.

Original View that works in the regular runserver command

class auto(View):
    def get(self, request):
        return render(
        request,
        'app/auto.html',
        {
            'title':'Auto Insurance',
            'message': 'generic message',
            'year':datetime.now().year,
        }
        )

I use this bakery view

class AutoTemplateView(BuildableTemplateView):
    build_path = 'auto.html'
    template_name = 'app/auto.html'

The settings has the view and the page is being generated successfully outside of the title and message are blank

BAKERY_VIEWS = (
    'app.views.HomeTemplateView',
    'app.views.AutoTemplateView',
)

html template

      <div class="col-sm-8 col-sm-offset-2">
            <h3 class="title-one"> {{ title }}</h3>
              <h4>{{ message }}</h4>
         </div>

and bakery html output :

<div class="col-sm-8 col-sm-offset-2">
            <h3 class="title-one"> </h3>
              <h4></h4>
         </div>

I can't imagine this is an actual bug but what am I missing?

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

No branches or pull requests

1 participant