CommandError: 'learning_log's not a valid project name. Please make sure the name is a valid identifier

Question:

I am working on the Python Crash Course Virtual Environment (Ch. 18) project and I am running into an error.

django-admin.py startproject learning_log.

” CommandError: ‘learning_log.’ is not a valid project name. Please make sure the name is a valid identifier. “

With my virtual environment activated I am receiving this error when I try to start the new django project. I have done this project in the past but when I came back to run it again, I am getting this error and I don’t know why. Any feedback would be appreciated.

Asked By: phast

||

Answers:

My guess is that the error is caused by the . in the end of the project name. Tried the same and got the same error. Try to specify a different name (without a dot).

The same applies to app names, so, for example

python manage.py startapp second_app/

will give a similar error.

Answered By: Roman Nakutnyi

Just add a space after learning_log and then place the point/period ;
Ex :- django-admin.py startproject learning_log .

Answered By: Uthpraanu

You just remove ‘.’ at the end and run below command.

django-admin.py startproject learning_log

  • No space is required at the end of the line. As per PEP-8 guide, you should only use lower case letters, and ‘_'(underscore) to create a project.
  • Do not provide iphen(-) or space or other special symbols to create a project.
Answered By: Ravi Pullagurla

Keep the space between learning_log and .:

django-admin.py startproject learning_log .
Answered By: Utsab Dahal
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.