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;








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









share|improve this question


























  • 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 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

















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









share|improve this question


























  • 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 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













0












0








0


1






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









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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

















  • 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 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
















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












2 Answers
2






active

oldest

votes


















1
















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






share|improve this answer

























  • 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



















1
















Data has to be send in 'Body' tab, not in 'Param' tab.






share|improve this answer



























    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
    );



    );














    draft saved

    draft discarded
















    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









    1
















    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






    share|improve this answer

























    • 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
















    1
















    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






    share|improve this answer

























    • 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














    1














    1










    1









    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






    share|improve this answer













    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







    share|improve this answer












    share|improve this answer



    share|improve this answer










    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


















    • 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














    1
















    Data has to be send in 'Body' tab, not in 'Param' tab.






    share|improve this answer





























      1
















      Data has to be send in 'Body' tab, not in 'Param' tab.






      share|improve this answer



























        1














        1










        1









        Data has to be send in 'Body' tab, not in 'Param' tab.






        share|improve this answer













        Data has to be send in 'Body' tab, not in 'Param' tab.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 2 at 3:31









        nr spidernr spider

        197 bronze badges




        197 bronze badges































            draft saved

            draft discarded















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해