[Flask] Unexpected result when running flask application

Cravan savageapple850 at gmail.com
Wed Jun 19 00:42:31 EDT 2019


 

 

From: cool kid <savageapple850 at gmail.com>
Date: Wednesday, 19 June 2019 at 12:08 PM
To: Frost Ming <mianghong at gmail.com>
Subject: Re: [Flask] Unexpected result when running flask application

 

Dear Frost,

                Sorry, but im a beginner at coding and am not so familiar, hence I require more elaboration. Although you mentioned that I returned early, I embedded my search.html within a link in my movies.html page, and im trying to use my info down in the search function, hence I have completely no idea where to put my search.html render template. Kindly refer to the updated code. Btw the movie page still doesn’t load after I replaced the argument.

 

From: Frost Ming <mianghong at gmail.com>
Date: Wednesday, 19 June 2019 at 11:48 AM
To: cool kid <savageapple850 at gmail.com>
Subject: Re: [Flask] Unexpected result when running flask application

 

In the search view function, you returned early so the logic below is never touched.

In the movie view function, why did you drop the `movie_title` argument?

 

The solutions lie in the above statement and don't ask for them again, please.

 

 

Cravan <savageapple850 at gmail.com> 于2019年6月19日周三 上午11:35写道:

However, I have changed with both your suggestions for movie=movie and request.args, but it still isn’t working.

 

From: Frost Ming <mianghong at gmail.com>
Date: Wednesday, 19 June 2019 at 11:34 AM
To: cool kid <savageapple850 at gmail.com>
Subject: Re: [Flask] Unexpected result when running flask application

 

The root cause is the solution itself, IMO it is clear enough.

 

Just pass `movie=movie` to `render_template`, you must have forgotten it?

 

Cravan <savageapple850 at gmail.com> 于2019年6月19日周三 上午11:31写道:

 

Thank you Frost, may I know how to rectify this?

Cravan

From: Frost Ming <mianghong at gmail.com>
Date: Wednesday, 19 June 2019 at 11:23 AM
To: cool kid <savageapple850 at gmail.com>
Subject: Re: [Flask] Unexpected result when running flask application

 

You didn't pass any movie data to the view template.

 

Cravan <savageapple850 at gmail.com> 于2019年6月19日周三 上午10:56写道:

Hi all,

                I am experiencing an unexpected result when I try to run my flask application. The movie.html page prints out nothing except those in the <h1>. This appears on my webpage:

I want it to print out all the stuff related to the movie in my sql table, e.g. year, runtime etc. How should I modify my code then? Also, when trying out search.html, it prints method not allowed for the requested URL. How should I rectify this?

Cravan

_______________________________________________
Flask mailing list
Flask at python.org
https://mail.python.org/mailman/listinfo/flask

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0009.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 48240 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 24643 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 37848 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0005.png>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0010.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0011.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0012.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0013.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0014.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0015.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0016.html>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0017.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: users.sql
Type: application/octet-stream
Size: 83 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.py
Type: text/x-python-script
Size: 2905 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/flask/attachments/20190619/edf1deff/attachment-0001.bin>


More information about the Flask mailing list