[Fixed]-Django-admin command error while project creation

16πŸ‘

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

πŸ‘€user3081159

2πŸ‘

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.

πŸ‘€moti

2πŸ‘

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

πŸ‘€Doc

1πŸ‘

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

πŸ‘€unamed

0πŸ‘

Make sure that if you have deleted (rm -r) β€œyour Django project_name” to also delete (rm) the manage.py corresponding deleted project python file in the same repository.

πŸ‘€Fredus

0πŸ‘

sudo pip uninstall django
sudo rm /usr/local/lib/python2.7/dist-packages/django/ -rf
sudo pip install django==1.10

This resolved my problem.

πŸ‘€hotbaby

0πŸ‘

You need to define another directory for your new project. Not /ehgg directory.
It seems though you are creating a new project inside your old project.
And this error clearly state that, there is old setting i.e β€œmanage.py” for your old project. Since every time a new settings manage.py created for your new project.

I hope it’s clear to you.
Thank you.

πŸ‘€Bipul Kumar

0πŸ‘

Check whether the project name is correct or not. Django avoids
hypens (-) in project names.

0πŸ‘

It can happen due to two reasons:

  1. You are trying to create a new folder with the exiting folder name.
  2. You have previously deleted a folder with this name. Deleted it for some reason. But again trying to create package with this name.

To resolve this follow

  1. Rename the manage.py from your project folder.

  2. Go to <%System Path%>/PycharmProjects/<%Your Project Name%>/.idea/workspace.xml

edit this file β€œworkspace.xml” and then search with the package name you are trying to create.
delete that line and save the file.
Now try to run the command again.

I hope this helps.

Regards,

πŸ‘€Vinit Kumar

Leave a comment