error with docker-compose and django












1















I am trying to get started with docker and django. I followed the directions of docker-compose and created an image with a simple requirements.txt.



I now want to actually build out my app more and add templates and actual code.



1) i installed some modules on the host machine and added them to the requirements.txt file



2) i run (again) docker-compose run web django-admin.py startproject exampleproject. All my new requirements get downloaded but then i get this error:



/code/manage.py already exists, overlaying a project or app into an existing directory won't replace conflicting files



I am using the exact Dockerfile and docker-compose.yml as here:
http://docs.docker.com/compose/django/



how am i supposed to update the container/image with new templates/views &c and new modules as i am developing my app?



am i using docker wrong?



thanks.










share|improve this question























  • have you removed the container before trying to run docker-compose again?

    – mh00h
    Oct 2 '15 at 1:03











  • I needed to remove the manage.py from the directory where i had my project - i thought it would just update with new requirements but i think if i wanted to do that i would have to restart the project all over again. I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch

    – user1139675
    Oct 2 '15 at 13:51
















1















I am trying to get started with docker and django. I followed the directions of docker-compose and created an image with a simple requirements.txt.



I now want to actually build out my app more and add templates and actual code.



1) i installed some modules on the host machine and added them to the requirements.txt file



2) i run (again) docker-compose run web django-admin.py startproject exampleproject. All my new requirements get downloaded but then i get this error:



/code/manage.py already exists, overlaying a project or app into an existing directory won't replace conflicting files



I am using the exact Dockerfile and docker-compose.yml as here:
http://docs.docker.com/compose/django/



how am i supposed to update the container/image with new templates/views &c and new modules as i am developing my app?



am i using docker wrong?



thanks.










share|improve this question























  • have you removed the container before trying to run docker-compose again?

    – mh00h
    Oct 2 '15 at 1:03











  • I needed to remove the manage.py from the directory where i had my project - i thought it would just update with new requirements but i think if i wanted to do that i would have to restart the project all over again. I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch

    – user1139675
    Oct 2 '15 at 13:51














1












1








1








I am trying to get started with docker and django. I followed the directions of docker-compose and created an image with a simple requirements.txt.



I now want to actually build out my app more and add templates and actual code.



1) i installed some modules on the host machine and added them to the requirements.txt file



2) i run (again) docker-compose run web django-admin.py startproject exampleproject. All my new requirements get downloaded but then i get this error:



/code/manage.py already exists, overlaying a project or app into an existing directory won't replace conflicting files



I am using the exact Dockerfile and docker-compose.yml as here:
http://docs.docker.com/compose/django/



how am i supposed to update the container/image with new templates/views &c and new modules as i am developing my app?



am i using docker wrong?



thanks.










share|improve this question














I am trying to get started with docker and django. I followed the directions of docker-compose and created an image with a simple requirements.txt.



I now want to actually build out my app more and add templates and actual code.



1) i installed some modules on the host machine and added them to the requirements.txt file



2) i run (again) docker-compose run web django-admin.py startproject exampleproject. All my new requirements get downloaded but then i get this error:



/code/manage.py already exists, overlaying a project or app into an existing directory won't replace conflicting files



I am using the exact Dockerfile and docker-compose.yml as here:
http://docs.docker.com/compose/django/



how am i supposed to update the container/image with new templates/views &c and new modules as i am developing my app?



am i using docker wrong?



thanks.







python django docker docker-compose






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 2 '15 at 0:55









user1139675user1139675

174315




174315













  • have you removed the container before trying to run docker-compose again?

    – mh00h
    Oct 2 '15 at 1:03











  • I needed to remove the manage.py from the directory where i had my project - i thought it would just update with new requirements but i think if i wanted to do that i would have to restart the project all over again. I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch

    – user1139675
    Oct 2 '15 at 13:51



















  • have you removed the container before trying to run docker-compose again?

    – mh00h
    Oct 2 '15 at 1:03











  • I needed to remove the manage.py from the directory where i had my project - i thought it would just update with new requirements but i think if i wanted to do that i would have to restart the project all over again. I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch

    – user1139675
    Oct 2 '15 at 13:51

















have you removed the container before trying to run docker-compose again?

– mh00h
Oct 2 '15 at 1:03





have you removed the container before trying to run docker-compose again?

– mh00h
Oct 2 '15 at 1:03













I needed to remove the manage.py from the directory where i had my project - i thought it would just update with new requirements but i think if i wanted to do that i would have to restart the project all over again. I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch

– user1139675
Oct 2 '15 at 13:51





I needed to remove the manage.py from the directory where i had my project - i thought it would just update with new requirements but i think if i wanted to do that i would have to restart the project all over again. I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch

– user1139675
Oct 2 '15 at 13:51












2 Answers
2






active

oldest

votes


















1














I needed to remove the manage.py from the directory where i had my project (the directory where the docker-compose.yml is in).



I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch.






share|improve this answer































    0














    Sorry for the late addition but I thought it might help someone. I had also encountered this same problem and inspite of removing manage.py from the folder where my .yml and Dockerfile existed, it gave me same error.



    I have no idea where it made the code directory which had the manage.py file. But I worked around it presently by changing the service name in the yml file and restarting the project with the new service name.



    docker-compose run newservicenm django-admin.py startproject projectname directoryname


    This worked as a new container!






    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/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%2f32899014%2ferror-with-docker-compose-and-django%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














      I needed to remove the manage.py from the directory where i had my project (the directory where the docker-compose.yml is in).



      I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch.






      share|improve this answer




























        1














        I needed to remove the manage.py from the directory where i had my project (the directory where the docker-compose.yml is in).



        I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch.






        share|improve this answer


























          1












          1








          1







          I needed to remove the manage.py from the directory where i had my project (the directory where the docker-compose.yml is in).



          I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch.






          share|improve this answer













          I needed to remove the manage.py from the directory where i had my project (the directory where the docker-compose.yml is in).



          I guess once you start a project, you install new requirements on the container itself and add them to requirements.txt for the next time you build your project from scratch.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 2 '15 at 13:53









          user1139675user1139675

          174315




          174315

























              0














              Sorry for the late addition but I thought it might help someone. I had also encountered this same problem and inspite of removing manage.py from the folder where my .yml and Dockerfile existed, it gave me same error.



              I have no idea where it made the code directory which had the manage.py file. But I worked around it presently by changing the service name in the yml file and restarting the project with the new service name.



              docker-compose run newservicenm django-admin.py startproject projectname directoryname


              This worked as a new container!






              share|improve this answer






























                0














                Sorry for the late addition but I thought it might help someone. I had also encountered this same problem and inspite of removing manage.py from the folder where my .yml and Dockerfile existed, it gave me same error.



                I have no idea where it made the code directory which had the manage.py file. But I worked around it presently by changing the service name in the yml file and restarting the project with the new service name.



                docker-compose run newservicenm django-admin.py startproject projectname directoryname


                This worked as a new container!






                share|improve this answer




























                  0












                  0








                  0







                  Sorry for the late addition but I thought it might help someone. I had also encountered this same problem and inspite of removing manage.py from the folder where my .yml and Dockerfile existed, it gave me same error.



                  I have no idea where it made the code directory which had the manage.py file. But I worked around it presently by changing the service name in the yml file and restarting the project with the new service name.



                  docker-compose run newservicenm django-admin.py startproject projectname directoryname


                  This worked as a new container!






                  share|improve this answer















                  Sorry for the late addition but I thought it might help someone. I had also encountered this same problem and inspite of removing manage.py from the folder where my .yml and Dockerfile existed, it gave me same error.



                  I have no idea where it made the code directory which had the manage.py file. But I worked around it presently by changing the service name in the yml file and restarting the project with the new service name.



                  docker-compose run newservicenm django-admin.py startproject projectname directoryname


                  This worked as a new container!







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 15 '18 at 19:29









                  ltd9938

                  9641823




                  9641823










                  answered Nov 15 '18 at 18:49









                  DocDoc

                  1




                  1






























                      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%2f32899014%2ferror-with-docker-compose-and-django%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

                      List item for chat from Array inside array React Native

                      Thiostrepton

                      Caerphilly