#33890: call_command('startproject', 'project_name', '.') raises CommandError
'project_name'
-------------------------------------+-------------------------------------
               Reporter:  piscvau    |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Core       |        Version:  4.0
  (Management commands)              |       Keywords:  call_command raises
               Severity:  Normal     |  exception
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 call_command ('startproject', 'project_name', '.') shoud create a project
 named 'project_name' in the current directory.

 to reproduce the bug :
 from django.core import management
 from pathlib import Path
 project_name = Path.cwd().stem
 management.call_command('startproject', project_name, '.')

 This raises the exception

 django.core.management.base.CommandError: <project_name>  conflicts with
 the name of an existing Python module and cannot be used as a project
 name. Please try another name.

 This is because the initial directory of the python script is in
 sys.module.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33890>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018264defe6f-2e63c5cb-28d4-4013-ac42-03f3a59970b4-000000%40eu-central-1.amazonses.com.

Reply via email to