Reputation: 454
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.
Upvotes: 1
Views: 2685
Reputation: 11
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!
Upvotes: 1
Reputation: 454
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.
Upvotes: 1