Deploying test flask API in pythonanywhereGet the data received in a Flask requestWhy does right-clicking create an orange dot in the center of the circle?Issues with Deploying Flask app on Ubuntu 14.04 VPS (Digital Ocean)Howto pythonic way to integrate pynba and Flask?Error processing Json requestFlask with mod_wsgi - Cannot call my modulesFlask POSTs with Trailing SlashFlask API TypeError: Object of type 'Response' is not JSON serializableFLASK Restful API not able to add using PUTuWSGI process 1 got Segmentation Fault _ Fail to deploy Flask App on Pythonanywhere
How do we know that black holes are spinning?
Wrong Schengen Visa exit stamp on my passport, who can I complain to?
In what state are satellites left in when they are left in a graveyard orbit?
Can I travel to European countries with the Irish passport and without destination Visa?
Is there a tool to measure the "maturity" of a code in Git?
What is the mathematical notation for rounding a given number to the nearest integer?
Why is the UK still pressing on with Brexit?
Python web-scraper to download table of transistor counts from Wikipedia
In what sequence should an advanced civilization teach technology to medieval society to maximize rate of adoption?
How to clip and draw a picture approximately?
How to be sure services and researches offered by the University are not becoming cases of unfair competition?
'Overwrote' files, space still occupied, are they lost?
Has SHA256 been broken by Treadwell Stanton DuPont?
Why are some files not movable on Windows 10?
Where is it? - The Google Earth Challenge Ep. 3
A Mainer Expression
Are there any “Third Order” acronyms used in space exploration?
Why does the speed of sound decrease at high altitudes although the air density decreases?
Impossible Scrabble Words
Isometries of convex hypersurfaces
Why is the car dealer insisting on a loan instead of cash?
Building Truncatable Primes using Nest(List), While, Fold
What does "boys rule, girls drool" mean?
Make 2019 with single digits
Deploying test flask API in pythonanywhere
Get the data received in a Flask requestWhy does right-clicking create an orange dot in the center of the circle?Issues with Deploying Flask app on Ubuntu 14.04 VPS (Digital Ocean)Howto pythonic way to integrate pynba and Flask?Error processing Json requestFlask with mod_wsgi - Cannot call my modulesFlask POSTs with Trailing SlashFlask API TypeError: Object of type 'Response' is not JSON serializableFLASK Restful API not able to add using PUTuWSGI process 1 got Segmentation Fault _ Fail to deploy Flask App on Pythonanywhere
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to deploy example flask API app given in flask document in pythonanywhere.
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
todos =
class TodoSimple(Resource):
def get(self, todo_id):
return todo_id: todos[todo_id]
def put(self, todo_id):
todos[todo_id] = request.form['data']
return todo_id: todos[todo_id]
api.add_resource(TodoSimple, '/<string:todo_id>')
if __name__ == '__main__':
app.run()
When I was testing this app locally in pycharm, I executed app successfully by sending data using
curl http://localhost:5000/todo1 -d "data=Remember the milk" -X PUT
command in pycharm terminal.
The result I got is
"todo1": "Remember the milk"
But when I tested the deployment using Postman the result I got is
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again
Parameters used in Query params in Postman are:
key:data
value:"Remember the milk"
The result got when executed the app in locally is the correct result.
What am I doing wrong?
PS:
When using the pythonanywhere I used
http://www.mydomain.pythonanywhere.com
python api flask postman pythonanywhere
add a comment
|
I'm trying to deploy example flask API app given in flask document in pythonanywhere.
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
todos =
class TodoSimple(Resource):
def get(self, todo_id):
return todo_id: todos[todo_id]
def put(self, todo_id):
todos[todo_id] = request.form['data']
return todo_id: todos[todo_id]
api.add_resource(TodoSimple, '/<string:todo_id>')
if __name__ == '__main__':
app.run()
When I was testing this app locally in pycharm, I executed app successfully by sending data using
curl http://localhost:5000/todo1 -d "data=Remember the milk" -X PUT
command in pycharm terminal.
The result I got is
"todo1": "Remember the milk"
But when I tested the deployment using Postman the result I got is
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again
Parameters used in Query params in Postman are:
key:data
value:"Remember the milk"
The result got when executed the app in locally is the correct result.
What am I doing wrong?
PS:
When using the pythonanywhere I used
http://www.mydomain.pythonanywhere.com
python api flask postman pythonanywhere
What url were you using in the second case? Of course you have to use a pythonanywhere url instead of localhost.
– Ardweaden
Mar 28 at 12:19
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used 'mydomain.pythonanywhere.com'
– nr spider
Mar 28 at 14:49
You used mydomain.pythonanywhere.com/todo1 right?
– Ardweaden
Mar 28 at 15:01
Yes @Ardweaden. The differences I made when using deployment are using my domain url and using postman to send requests.
– nr spider
Mar 29 at 1:17
Are you sure you're using the right URL? Above you confirmed that you usedmydomain.pythonanywhere.com/todo1, but you've edited your question to say that you usedwww.mydomain.pythonanywhere.com/todo1. The second URL will not work, you need to use the first one.
– Giles Thomas
Apr 1 at 19:39
add a comment
|
I'm trying to deploy example flask API app given in flask document in pythonanywhere.
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
todos =
class TodoSimple(Resource):
def get(self, todo_id):
return todo_id: todos[todo_id]
def put(self, todo_id):
todos[todo_id] = request.form['data']
return todo_id: todos[todo_id]
api.add_resource(TodoSimple, '/<string:todo_id>')
if __name__ == '__main__':
app.run()
When I was testing this app locally in pycharm, I executed app successfully by sending data using
curl http://localhost:5000/todo1 -d "data=Remember the milk" -X PUT
command in pycharm terminal.
The result I got is
"todo1": "Remember the milk"
But when I tested the deployment using Postman the result I got is
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again
Parameters used in Query params in Postman are:
key:data
value:"Remember the milk"
The result got when executed the app in locally is the correct result.
What am I doing wrong?
PS:
When using the pythonanywhere I used
http://www.mydomain.pythonanywhere.com
python api flask postman pythonanywhere
I'm trying to deploy example flask API app given in flask document in pythonanywhere.
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
todos =
class TodoSimple(Resource):
def get(self, todo_id):
return todo_id: todos[todo_id]
def put(self, todo_id):
todos[todo_id] = request.form['data']
return todo_id: todos[todo_id]
api.add_resource(TodoSimple, '/<string:todo_id>')
if __name__ == '__main__':
app.run()
When I was testing this app locally in pycharm, I executed app successfully by sending data using
curl http://localhost:5000/todo1 -d "data=Remember the milk" -X PUT
command in pycharm terminal.
The result I got is
"todo1": "Remember the milk"
But when I tested the deployment using Postman the result I got is
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again
Parameters used in Query params in Postman are:
key:data
value:"Remember the milk"
The result got when executed the app in locally is the correct result.
What am I doing wrong?
PS:
When using the pythonanywhere I used
http://www.mydomain.pythonanywhere.com
python api flask postman pythonanywhere
python api flask postman pythonanywhere
edited Mar 28 at 14:55
nr spider
asked Mar 28 at 12:16
nr spidernr spider
197 bronze badges
197 bronze badges
What url were you using in the second case? Of course you have to use a pythonanywhere url instead of localhost.
– Ardweaden
Mar 28 at 12:19
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used 'mydomain.pythonanywhere.com'
– nr spider
Mar 28 at 14:49
You used mydomain.pythonanywhere.com/todo1 right?
– Ardweaden
Mar 28 at 15:01
Yes @Ardweaden. The differences I made when using deployment are using my domain url and using postman to send requests.
– nr spider
Mar 29 at 1:17
Are you sure you're using the right URL? Above you confirmed that you usedmydomain.pythonanywhere.com/todo1, but you've edited your question to say that you usedwww.mydomain.pythonanywhere.com/todo1. The second URL will not work, you need to use the first one.
– Giles Thomas
Apr 1 at 19:39
add a comment
|
What url were you using in the second case? Of course you have to use a pythonanywhere url instead of localhost.
– Ardweaden
Mar 28 at 12:19
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used 'mydomain.pythonanywhere.com'
– nr spider
Mar 28 at 14:49
You used mydomain.pythonanywhere.com/todo1 right?
– Ardweaden
Mar 28 at 15:01
Yes @Ardweaden. The differences I made when using deployment are using my domain url and using postman to send requests.
– nr spider
Mar 29 at 1:17
Are you sure you're using the right URL? Above you confirmed that you usedmydomain.pythonanywhere.com/todo1, but you've edited your question to say that you usedwww.mydomain.pythonanywhere.com/todo1. The second URL will not work, you need to use the first one.
– Giles Thomas
Apr 1 at 19:39
What url were you using in the second case? Of course you have to use a pythonanywhere url instead of localhost.
– Ardweaden
Mar 28 at 12:19
What url were you using in the second case? Of course you have to use a pythonanywhere url instead of localhost.
– Ardweaden
Mar 28 at 12:19
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used 'mydomain.pythonanywhere.com'
– nr spider
Mar 28 at 14:49
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used 'mydomain.pythonanywhere.com'
– nr spider
Mar 28 at 14:49
You used mydomain.pythonanywhere.com/todo1 right?
– Ardweaden
Mar 28 at 15:01
You used mydomain.pythonanywhere.com/todo1 right?
– Ardweaden
Mar 28 at 15:01
Yes @Ardweaden. The differences I made when using deployment are using my domain url and using postman to send requests.
– nr spider
Mar 29 at 1:17
Yes @Ardweaden. The differences I made when using deployment are using my domain url and using postman to send requests.
– nr spider
Mar 29 at 1:17
Are you sure you're using the right URL? Above you confirmed that you used
mydomain.pythonanywhere.com/todo1, but you've edited your question to say that you used www.mydomain.pythonanywhere.com/todo1. The second URL will not work, you need to use the first one.– Giles Thomas
Apr 1 at 19:39
Are you sure you're using the right URL? Above you confirmed that you used
mydomain.pythonanywhere.com/todo1, but you've edited your question to say that you used www.mydomain.pythonanywhere.com/todo1. The second URL will not work, you need to use the first one.– Giles Thomas
Apr 1 at 19:39
add a comment
|
2 Answers
2
active
oldest
votes
You need to replace http://localhost:5000/ with the url from pythonanywhere, e.g.http://yourusername.pythonanywhere.com
That is assuming you didn't pay and configure your own domain
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used mydomain.pythonanywhere.com
– nr spider
Mar 28 at 14:40
add a comment
|
Data has to be send in 'Body' tab, not in 'Param' tab.
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55397421%2fdeploying-test-flask-api-in-pythonanywhere%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to replace http://localhost:5000/ with the url from pythonanywhere, e.g.http://yourusername.pythonanywhere.com
That is assuming you didn't pay and configure your own domain
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used mydomain.pythonanywhere.com
– nr spider
Mar 28 at 14:40
add a comment
|
You need to replace http://localhost:5000/ with the url from pythonanywhere, e.g.http://yourusername.pythonanywhere.com
That is assuming you didn't pay and configure your own domain
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used mydomain.pythonanywhere.com
– nr spider
Mar 28 at 14:40
add a comment
|
You need to replace http://localhost:5000/ with the url from pythonanywhere, e.g.http://yourusername.pythonanywhere.com
That is assuming you didn't pay and configure your own domain
You need to replace http://localhost:5000/ with the url from pythonanywhere, e.g.http://yourusername.pythonanywhere.com
That is assuming you didn't pay and configure your own domain
answered Mar 28 at 12:20
buranburan
2,5142 gold badges7 silver badges22 bronze badges
2,5142 gold badges7 silver badges22 bronze badges
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used mydomain.pythonanywhere.com
– nr spider
Mar 28 at 14:40
add a comment
|
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used mydomain.pythonanywhere.com
– nr spider
Mar 28 at 14:40
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used mydomain.pythonanywhere.com
– nr spider
Mar 28 at 14:40
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used mydomain.pythonanywhere.com
– nr spider
Mar 28 at 14:40
add a comment
|
Data has to be send in 'Body' tab, not in 'Param' tab.
add a comment
|
Data has to be send in 'Body' tab, not in 'Param' tab.
add a comment
|
Data has to be send in 'Body' tab, not in 'Param' tab.
Data has to be send in 'Body' tab, not in 'Param' tab.
answered Apr 2 at 3:31
nr spidernr spider
197 bronze badges
197 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55397421%2fdeploying-test-flask-api-in-pythonanywhere%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What url were you using in the second case? Of course you have to use a pythonanywhere url instead of localhost.
– Ardweaden
Mar 28 at 12:19
Yes I did that. Sorry if I wasn't clear. The mentioned error caused when I used 'mydomain.pythonanywhere.com'
– nr spider
Mar 28 at 14:49
You used mydomain.pythonanywhere.com/todo1 right?
– Ardweaden
Mar 28 at 15:01
Yes @Ardweaden. The differences I made when using deployment are using my domain url and using postman to send requests.
– nr spider
Mar 29 at 1:17
Are you sure you're using the right URL? Above you confirmed that you used
mydomain.pythonanywhere.com/todo1, but you've edited your question to say that you usedwww.mydomain.pythonanywhere.com/todo1. The second URL will not work, you need to use the first one.– Giles Thomas
Apr 1 at 19:39