cannot curl on localhost, django server












0















I make a draft django website with django-admin startproject mysite



I go into the directory and run the server python manage.py runserver



I check localhost:8000 with my browser and it shows the default welcome page (which means it works). The server logs:



Django version 2.1.5, using settings 'course.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[29/Jan/2019 08:16:54] "GET / HTTP/1.1" 200 16348
[29/Jan/2019 08:16:54] "GET /static/admin/css/fonts.css HTTP/1.1" 200 423
[29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 200 82564
[29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 200 80304
Not Found: /favicon.ico
[29/Jan/2019 08:16:54] "GET /favicon.ico HTTP/1.1" 404 1972
[29/Jan/2019 08:16:55] "GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1" 200 81348



However, when I try to curl it with curl -v localhost:8000 it hangs forever:



* Rebuilt URL to: localhost:8000/
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET / HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.58.0
> Accept: */*
>



Here is the only line that the server logs:



[29/Jan/2019 08:27:53] "GET / HTTP/1.1" 200 16348



On local machine I can check mysite manually but without curl I do not know how to test my site on server. Anyone knows why?



I have tried many suggestion, curl with -4 option, change the port to 8080 for example, change server to 0.0.0.0, use gunicorn to serve.. the problem persists.










share|improve this question





























    0















    I make a draft django website with django-admin startproject mysite



    I go into the directory and run the server python manage.py runserver



    I check localhost:8000 with my browser and it shows the default welcome page (which means it works). The server logs:



    Django version 2.1.5, using settings 'course.settings'
    Starting development server at http://127.0.0.1:8000/
    Quit the server with CONTROL-C.
    [29/Jan/2019 08:16:54] "GET / HTTP/1.1" 200 16348
    [29/Jan/2019 08:16:54] "GET /static/admin/css/fonts.css HTTP/1.1" 200 423
    [29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 200 82564
    [29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 200 80304
    Not Found: /favicon.ico
    [29/Jan/2019 08:16:54] "GET /favicon.ico HTTP/1.1" 404 1972
    [29/Jan/2019 08:16:55] "GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1" 200 81348



    However, when I try to curl it with curl -v localhost:8000 it hangs forever:



    * Rebuilt URL to: localhost:8000/
    * Trying 127.0.0.1...
    * TCP_NODELAY set
    * Connected to localhost (127.0.0.1) port 8000 (#0)
    > GET / HTTP/1.1
    > Host: localhost:8000
    > User-Agent: curl/7.58.0
    > Accept: */*
    >



    Here is the only line that the server logs:



    [29/Jan/2019 08:27:53] "GET / HTTP/1.1" 200 16348



    On local machine I can check mysite manually but without curl I do not know how to test my site on server. Anyone knows why?



    I have tried many suggestion, curl with -4 option, change the port to 8080 for example, change server to 0.0.0.0, use gunicorn to serve.. the problem persists.










    share|improve this question



























      0












      0








      0








      I make a draft django website with django-admin startproject mysite



      I go into the directory and run the server python manage.py runserver



      I check localhost:8000 with my browser and it shows the default welcome page (which means it works). The server logs:



      Django version 2.1.5, using settings 'course.settings'
      Starting development server at http://127.0.0.1:8000/
      Quit the server with CONTROL-C.
      [29/Jan/2019 08:16:54] "GET / HTTP/1.1" 200 16348
      [29/Jan/2019 08:16:54] "GET /static/admin/css/fonts.css HTTP/1.1" 200 423
      [29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 200 82564
      [29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 200 80304
      Not Found: /favicon.ico
      [29/Jan/2019 08:16:54] "GET /favicon.ico HTTP/1.1" 404 1972
      [29/Jan/2019 08:16:55] "GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1" 200 81348



      However, when I try to curl it with curl -v localhost:8000 it hangs forever:



      * Rebuilt URL to: localhost:8000/
      * Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8000 (#0)
      > GET / HTTP/1.1
      > Host: localhost:8000
      > User-Agent: curl/7.58.0
      > Accept: */*
      >



      Here is the only line that the server logs:



      [29/Jan/2019 08:27:53] "GET / HTTP/1.1" 200 16348



      On local machine I can check mysite manually but without curl I do not know how to test my site on server. Anyone knows why?



      I have tried many suggestion, curl with -4 option, change the port to 8080 for example, change server to 0.0.0.0, use gunicorn to serve.. the problem persists.










      share|improve this question
















      I make a draft django website with django-admin startproject mysite



      I go into the directory and run the server python manage.py runserver



      I check localhost:8000 with my browser and it shows the default welcome page (which means it works). The server logs:



      Django version 2.1.5, using settings 'course.settings'
      Starting development server at http://127.0.0.1:8000/
      Quit the server with CONTROL-C.
      [29/Jan/2019 08:16:54] "GET / HTTP/1.1" 200 16348
      [29/Jan/2019 08:16:54] "GET /static/admin/css/fonts.css HTTP/1.1" 200 423
      [29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 200 82564
      [29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 200 80304
      Not Found: /favicon.ico
      [29/Jan/2019 08:16:54] "GET /favicon.ico HTTP/1.1" 404 1972
      [29/Jan/2019 08:16:55] "GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1" 200 81348



      However, when I try to curl it with curl -v localhost:8000 it hangs forever:



      * Rebuilt URL to: localhost:8000/
      * Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8000 (#0)
      > GET / HTTP/1.1
      > Host: localhost:8000
      > User-Agent: curl/7.58.0
      > Accept: */*
      >



      Here is the only line that the server logs:



      [29/Jan/2019 08:27:53] "GET / HTTP/1.1" 200 16348



      On local machine I can check mysite manually but without curl I do not know how to test my site on server. Anyone knows why?



      I have tried many suggestion, curl with -4 option, change the port to 8080 for example, change server to 0.0.0.0, use gunicorn to serve.. the problem persists.







      curl django






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 29 at 8:28







      Linh Chi Nguyen

















      asked Jan 29 at 8:21









      Linh Chi NguyenLinh Chi Nguyen

      13




      13






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I am sorry I am a turbo noob. Here is the answer to my situation:



          I run the server with python manage.py runserver and then I Ctrl+z but did not bg to background that process and I thought that it is still running so I curl localhost:8000 but it hangs.



          Today, I run the server in a terminal tab and try to curl in another tab, it works. :-p



          God forgive me.






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            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/3.0/"u003ecc by-sa 3.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%2fsuperuser.com%2fquestions%2f1399548%2fcannot-curl-on-localhost-django-server%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I am sorry I am a turbo noob. Here is the answer to my situation:



            I run the server with python manage.py runserver and then I Ctrl+z but did not bg to background that process and I thought that it is still running so I curl localhost:8000 but it hangs.



            Today, I run the server in a terminal tab and try to curl in another tab, it works. :-p



            God forgive me.






            share|improve this answer






























              0














              I am sorry I am a turbo noob. Here is the answer to my situation:



              I run the server with python manage.py runserver and then I Ctrl+z but did not bg to background that process and I thought that it is still running so I curl localhost:8000 but it hangs.



              Today, I run the server in a terminal tab and try to curl in another tab, it works. :-p



              God forgive me.






              share|improve this answer




























                0












                0








                0







                I am sorry I am a turbo noob. Here is the answer to my situation:



                I run the server with python manage.py runserver and then I Ctrl+z but did not bg to background that process and I thought that it is still running so I curl localhost:8000 but it hangs.



                Today, I run the server in a terminal tab and try to curl in another tab, it works. :-p



                God forgive me.






                share|improve this answer















                I am sorry I am a turbo noob. Here is the answer to my situation:



                I run the server with python manage.py runserver and then I Ctrl+z but did not bg to background that process and I thought that it is still running so I curl localhost:8000 but it hangs.



                Today, I run the server in a terminal tab and try to curl in another tab, it works. :-p



                God forgive me.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jan 31 at 13:02

























                answered Jan 31 at 12:53









                Linh Chi NguyenLinh Chi Nguyen

                13




                13






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • 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%2fsuperuser.com%2fquestions%2f1399548%2fcannot-curl-on-localhost-django-server%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

                    Сан-Квентин

                    8-я гвардейская общевойсковая армия

                    Алькесар