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

  • SEARCH
  • Home
  • 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 8509371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:24:59+00:00 2026-06-11T03:24:59+00:00

I am learning how to use Pluggable Views in Flask, since it seems that

  • 0

I am learning how to use Pluggable Views in Flask, since it seems that everyone uses them always for their advantages. I have the following file which returns an “Not Implemented Error”. I am assuming that is because I am not implementing the dispatch_request. However, according to Flask’s documentation, when using MethodView: “…if you implement a method called get() it means you will response to ’GET’ requests and the dispatch_request() implementation will automatically forward your request to that.” Meaning, I do not require dispatch_request.

from flask import Flask, render_template, request, redirect, url_for, flash
from flask.views import View, MethodView
import os

SECRET_KEY = 'some_secret_key'
DEBUG = TRUE

app = Flask(__name__)
app.config.from_object(__name__)  

class Main(View):
  def dispatch_request(self):
    return "Hello World!"

class Template(View):
  def get(self):
    return render_template('index.html')

  def post(self):
    result = eval(request.form['expression'])
    flash(result)
    return self.get()

app.add_url_rule('/', view_func=Main.as_view('main'))
app.add_url_rule('/template', view_func=Template.as_view('template'), methods=['GET', 'POST']) 

if __name__ == "__main__":
  app.run()
  • 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-11T03:25:01+00:00Added an answer on June 11, 2026 at 3:25 am

    Oops.. silly Python beginner’s mistake by me.

    I was subclassing flask.views.View instead of flask.views.MethodView. flask.views.View requires dispatch_request, and does not automatically forward HTTP requests to dispatch_request as MethdoView does, hence the error.

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

Sidebar

Related Questions

I am just learning to use Services, and am sort of stuck. I have
I'm learning to use vlad the deployer and I've got a question. Since I'm
I am learning to use mysql for rails apps, and I finally have been
I am learning to use DelgateCommand from Prism.... In my UI, I have my
I am learning to use sed and have a hypothetical requirement: bash$ cat states
I am learning to use Core Data. I have created a data model etc
I have enjoyed learning to use OpenGL under the context of games programming, and
I am learning to use Processing , and have modified one of the examples
I'm learning to use pointer to copy char array. I have the following code
I am learning to use HTML5 WebSockets and as part of that I am

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.