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 6350173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:45:42+00:00 2026-05-24T21:45:42+00:00

I am using Tornado 2.0 (Python 2.6.5) to build a simple web app. Naturally,

  • 0

I am using Tornado 2.0 (Python 2.6.5) to build a simple web app.

Naturally, my Tornado templates contain snippets of Python code. For my non-template code, I am using pychecker and pylint to check for errors, etc.

However, obviously pychecker and pylint can’t be run over the templates directly, b/c the templates are not python files proper (for non-Tornado users: they are html-like snippets w/ some control sequences and embedded python code).

So, my question is: can anyone suggest a good way to apply pychecker/pylint to the python code in these template files? Presumably this would involve extracting the code from the files.

I can hazard a few guesses as to how to do this, but I am curious if other people perceive this as a problem and what solutions they have pursued. I am still fairly new to web app design/construction so I am interested in answers guided by practical experience.

  • 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-05-24T21:45:43+00:00Added an answer on May 24, 2026 at 9:45 pm

    You need to use view class pattern to avoid cluttering your template with Python code which cannot be analyzed.

    • Create a Python class to process your view, instead of function

    • Have all “template logic” code as class methods. Your template calls them like {{ view.get_full_name }} and def get_full_name(self): return self.item.first_name + ” ” + self.item.last_name

    • Make instance out of your class

    • make call() as starting point for your processing

    • Pass “self” to your template as a context var

    Some instructions for Django, but generally all Python frameworks (Pyramid, Zope) follow the same pattern:

    Class views in Django

    “$yourframeworkname view class” should yield more tutorials in Google.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a simple python web application using the Tornado web server
I'm using the Tornado framework (Python). I have the sluggable URLs working. But I
I'm quite new to using Tornado Web as a web server, and am having
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I
I'm using the Tornado framework (Python) on GAE. I'm still kind of new to
This is my first attempt to build a json webservice using the Tornado Framework
I'm using django-on-tornado to build an application that is similar to the chat applicatoin
I'm using Tornado web server and want to take advantage of static caching for
I have a web application im currently working on in python. I'm using Django
I'm using tornado and the TwitterMixin and I use the following basic code: class

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.