Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use "-" in django project name

Tags:

django

While I am trying to create a new project in Django I got this error

command used : django-admin startproject test-service

'test-service' is not a valid project name. Please make sure the name is a valid identifier.

Then I tried with django-admin startproject test_service and it is working. Can you please confirm whether i can use dash in project name. I am planning to do a uniq naming convention for upcoming projects also.

like image 321
Edhu Avatar asked Oct 16 '25 00:10

Edhu


1 Answers

No, you cannot use a hyphen in the project or app name passed to startproject or startapp.

The name must be a valid identifier, this is verified by calling the function str.isidentifier. The Python docs contain the definition of a valid identifier here

like image 112
Iain Shelvington Avatar answered Oct 18 '25 15:10

Iain Shelvington



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!