Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django-admin command error while project creation

Tags:

django

After upgrading to django 1.9 and tried creating new project.Getting following error How should i solve this?

After upgrading to django 1.9 and creating new project following error occurred CommandError: /home/shaastr/ehgg/manage.py already exists, overlaying a project or app into an existing directory won't replace conflicting files

like image 877
Deepak Gupta Avatar asked Feb 17 '16 18:02

Deepak Gupta


People also ask

Why Django admin command is not working?

command not found: django-admin django-admin should be on your system path if you installed Django via pip . If it's not in your path, ensure you have your virtual environment activated and you can try running the equivalent command python -m django .

How do I find my Django admin?

Run django-admin help to display usage information and a list of the commands provided by each application. Run django-admin help --commands to display a list of all available commands. Run django-admin help <command> to display a description of the given command and a list of its available options.

What does Django admin Startproject do?

at the end of the django-admin startproject command: (env) $ django-admin startproject <projectname> . The dot skips the top-level project folder and creates your management app and the manage.py file right inside your current working directory. You might encounter this syntax in some online Django tutorials.


4 Answers

I think you have 2 versions of django installed, and both are being called when trying to start the project.

Try running pip uninstall django twice, if it runs both time then this was what was going on. Obviously, pip install django afterwards to get it working again

like image 157
user3081159 Avatar answered Oct 08 '22 21:10

user3081159


I had the same problem after using pip to install django 1.10 over an older version. I used pip to uninstall and manually deleted the leftover django folder in the site-packages folder. re-installed using pip, and now it is working with no problem.

like image 22
moti Avatar answered Oct 08 '22 21:10

moti


I am also working with docker containers. I had this problem where it said that manage.py already exists in the workdirectory (that I made through the Dockerfile file) when I tried to restart the process of making a container after deleting the old one.

It did not show me where the workdirectory was made and hence could not delete the manage.py as pointed out in the error.

The solution that worked was I changed the service name in my yml file and gave the command with new servicenm docker-compose run servicenm django-admin.py startproject projectnm directory

like image 31
Doc Avatar answered Oct 08 '22 21:10

Doc


remove manage.py then re-run your django-admin startproject command, it will work

like image 30
unamed Avatar answered Oct 08 '22 22:10

unamed