Django run on Docker Toolbox with WSL









up vote
0
down vote

favorite












I try to run my django project on local machine (on which I'm using WSL) using docker without using nginx or apache but with postgres as db and simple



python manage.py runserver


It seems that Docker itself works fine, I am able to create and run containers, logs show that all is up and running, I can ssh to both container with app and database but I can't reach it via my browser.



Internet says that I need to set up propertly network on VM so I did:



enter image description here



I'm setting my envs like that



export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST=tcp://192.168.99.100:2376
export DOCKER_CERT_PATH='/path/to/mounted/dir/.docker/machine/machines/default'
export DOCKER_MACHINE_NAME="default"
export COMPOSE_CONVERT_WINDOWS_PATHS="true"


Some tutorials says that instead of DOCKER_HOST=tcp://192.168.99.100:2376 it should be DOCKER_HOST=tcp://localhost:2376 (I know that documentation says port 2375 but for some reason toolbox choose 2376 when it was installing) but with second scenario WSL is unable to find docker deamon and any command's throwing an error:



> docker info
Cannot connect to the Docker daemon at tcp://localhost:2376. Is the docker daemon running?


For a moment I thought that this might be a problem but I found many other tutorials where first config was used.



I've tried also running



python manage.py runserver 0.0.0.0:8000
python manage.py runserver 127.0.0.1:8000
python manage.py runserver 192.168.99.100:8000


I think I don't quite understand which ip is what and there is a problem but I also can't find any good answer to that.



I'm struggling with it for 2 days now so literally any hint will be priceless.



Thanks.










share|improve this question

























    up vote
    0
    down vote

    favorite












    I try to run my django project on local machine (on which I'm using WSL) using docker without using nginx or apache but with postgres as db and simple



    python manage.py runserver


    It seems that Docker itself works fine, I am able to create and run containers, logs show that all is up and running, I can ssh to both container with app and database but I can't reach it via my browser.



    Internet says that I need to set up propertly network on VM so I did:



    enter image description here



    I'm setting my envs like that



    export DOCKER_TLS_VERIFY="1"
    export DOCKER_HOST=tcp://192.168.99.100:2376
    export DOCKER_CERT_PATH='/path/to/mounted/dir/.docker/machine/machines/default'
    export DOCKER_MACHINE_NAME="default"
    export COMPOSE_CONVERT_WINDOWS_PATHS="true"


    Some tutorials says that instead of DOCKER_HOST=tcp://192.168.99.100:2376 it should be DOCKER_HOST=tcp://localhost:2376 (I know that documentation says port 2375 but for some reason toolbox choose 2376 when it was installing) but with second scenario WSL is unable to find docker deamon and any command's throwing an error:



    > docker info
    Cannot connect to the Docker daemon at tcp://localhost:2376. Is the docker daemon running?


    For a moment I thought that this might be a problem but I found many other tutorials where first config was used.



    I've tried also running



    python manage.py runserver 0.0.0.0:8000
    python manage.py runserver 127.0.0.1:8000
    python manage.py runserver 192.168.99.100:8000


    I think I don't quite understand which ip is what and there is a problem but I also can't find any good answer to that.



    I'm struggling with it for 2 days now so literally any hint will be priceless.



    Thanks.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I try to run my django project on local machine (on which I'm using WSL) using docker without using nginx or apache but with postgres as db and simple



      python manage.py runserver


      It seems that Docker itself works fine, I am able to create and run containers, logs show that all is up and running, I can ssh to both container with app and database but I can't reach it via my browser.



      Internet says that I need to set up propertly network on VM so I did:



      enter image description here



      I'm setting my envs like that



      export DOCKER_TLS_VERIFY="1"
      export DOCKER_HOST=tcp://192.168.99.100:2376
      export DOCKER_CERT_PATH='/path/to/mounted/dir/.docker/machine/machines/default'
      export DOCKER_MACHINE_NAME="default"
      export COMPOSE_CONVERT_WINDOWS_PATHS="true"


      Some tutorials says that instead of DOCKER_HOST=tcp://192.168.99.100:2376 it should be DOCKER_HOST=tcp://localhost:2376 (I know that documentation says port 2375 but for some reason toolbox choose 2376 when it was installing) but with second scenario WSL is unable to find docker deamon and any command's throwing an error:



      > docker info
      Cannot connect to the Docker daemon at tcp://localhost:2376. Is the docker daemon running?


      For a moment I thought that this might be a problem but I found many other tutorials where first config was used.



      I've tried also running



      python manage.py runserver 0.0.0.0:8000
      python manage.py runserver 127.0.0.1:8000
      python manage.py runserver 192.168.99.100:8000


      I think I don't quite understand which ip is what and there is a problem but I also can't find any good answer to that.



      I'm struggling with it for 2 days now so literally any hint will be priceless.



      Thanks.










      share|improve this question













      I try to run my django project on local machine (on which I'm using WSL) using docker without using nginx or apache but with postgres as db and simple



      python manage.py runserver


      It seems that Docker itself works fine, I am able to create and run containers, logs show that all is up and running, I can ssh to both container with app and database but I can't reach it via my browser.



      Internet says that I need to set up propertly network on VM so I did:



      enter image description here



      I'm setting my envs like that



      export DOCKER_TLS_VERIFY="1"
      export DOCKER_HOST=tcp://192.168.99.100:2376
      export DOCKER_CERT_PATH='/path/to/mounted/dir/.docker/machine/machines/default'
      export DOCKER_MACHINE_NAME="default"
      export COMPOSE_CONVERT_WINDOWS_PATHS="true"


      Some tutorials says that instead of DOCKER_HOST=tcp://192.168.99.100:2376 it should be DOCKER_HOST=tcp://localhost:2376 (I know that documentation says port 2375 but for some reason toolbox choose 2376 when it was installing) but with second scenario WSL is unable to find docker deamon and any command's throwing an error:



      > docker info
      Cannot connect to the Docker daemon at tcp://localhost:2376. Is the docker daemon running?


      For a moment I thought that this might be a problem but I found many other tutorials where first config was used.



      I've tried also running



      python manage.py runserver 0.0.0.0:8000
      python manage.py runserver 127.0.0.1:8000
      python manage.py runserver 192.168.99.100:8000


      I think I don't quite understand which ip is what and there is a problem but I also can't find any good answer to that.



      I'm struggling with it for 2 days now so literally any hint will be priceless.



      Thanks.







      django windows-subsystem-for-linux docker-toolbox






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 14:06









      kebie

      2618




      2618



























          active

          oldest

          votes











          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',
          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%2fstackoverflow.com%2fquestions%2f53239756%2fdjango-run-on-docker-toolbox-with-wsl%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2f53239756%2fdjango-run-on-docker-toolbox-with-wsl%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

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo