nephila / djangocms-installer

Console wizard to bootstrap django CMS projects
https://djangocms-installer.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
177 stars 78 forks source link

Catch dot errors on create new project, better error message #343

Closed akoeb closed 4 years ago

akoeb commented 5 years ago

Apparently, dots are not allowed in project names, but the installer does not catch the error, neither does it return an error message that is any helpful.

Either the installer should check and catch this error itself, telling the user what to do, or at least it should forward the error message generated by django-admin.py, because that does the right thing and says says: CommandError: 'abc.de' is not a valid project name. Please make sure the name is a valid identifier.

This error seems minor, but it can cost a lot of time, if you look at the wrong places (I thought of interpreter version problems first...)

Try to create a project with a dot in its name

`

$ djangocms abc.de
Creating the project Please wait while I install dependencies If I am stuck for a long time, please check for connectivity / PyPi issues Dependencies installed Creating the project The installation has failed.


Check documentation at https://djangocms-installer.readthedocs.io


Traceback (most recent call last): File ".../djangocms/venv/bin/djangocms", line 10, in sys.exit(execute()) File ".../djangocms/venv/lib/python3.7/site-packages/djangocms_installer/main.py", line 40, in execute django.create_project(config_data) File ".../djangocms/venv/lib/python3.7/site-packages/djangocms_installer/django/init.py", line 61, in create_project output = subprocess.check_output(cmd_args, stderr=subprocess.STDOUT) File "/usr/lib/python3.7/subprocess.py", line 395, in check_output **kwargs).stdout File "/usr/lib/python3.7/subprocess.py", line 487, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['.../djangocms/venv/bin/python3', '.../djangocms/venv/bin/django-admin.py', 'startproject', 'abc.de', '.../djangocms/abc.de']' returned non-zero exit status 1.

`

cross check with underscore

`

$ djangocms abc_de Creating the project Please wait while I install dependencies If I am stuck for a long time, please check for connectivity / PyPi issues Dependencies installed Creating the project Operations to perform: Apply all migrations: admin, auth, cms, contenttypes, djangocms_column, djangocms_file, djangocms_googlemap, djangocms_link, djangocms_picture, djangocms_snippet, djangocms_style, djangocms_text_ckeditor, djangocms_video, easy_thumbnails, filer, menus, sessions, sites Running migrations: Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying sites.0001_initial... OK Applying cms.0001_initial... OK Applying cms.0002_auto_20140816_1918... OK Applying cms.0003_auto_20140926_2347... OK Applying cms.0004_auto_20140924_1038... OK Applying cms.0005_auto_20140924_1039... OK Applying cms.0006_auto_20140924_1110... OK Applying cms.0007_auto_20141028_1559... OK Applying cms.0008_auto_20150208_2149... OK Applying cms.0008_auto_20150121_0059... OK Applying cms.0009_merge... OK Applying cms.0010_migrate_use_structure... OK Applying cms.0011_auto_20150419_1006... OK Applying cms.0012_auto_20150607_2207... OK Applying cms.0013_urlconfrevision... OK Applying cms.0014_auto_20160404_1908... OK Applying cms.0015_auto_20160421_0000... OK Applying cms.0016_auto_20160608_1535... OK Applying cms.0017_pagetype... OK Applying cms.0018_create_pagenode... OK Applying cms.0019_set_pagenode... OK Applying cms.0020_old_tree_cleanup... OK Applying cms.0021_auto_20180507_1432... OK Applying cms.0022_auto_20180620_1551... OK Applying djangocms_column.0001_initial... OK Applying djangocms_column.0002_auto_20160915_0818... OK Applying filer.0001_initial... OK Applying filer.0002_auto_20150606_2003... OK Applying filer.0003_thumbnailoption... OK Applying filer.0004_auto_20160328_1434... OK Applying filer.0005_auto_20160623_1425... OK Applying filer.0006_auto_20160623_1627... OK Applying djangocms_file.0001_initial... OK Applying djangocms_file.0002_auto_20151202_1551... OK Applying djangocms_file.0003_remove_related_name_for_cmsplugin_ptr... OK Applying djangocms_file.0004_set_related_name_for_cmsplugin_ptr... OK Applying djangocms_file.0005_auto_20160119_1534... OK Applying djangocms_file.0006_migrate_to_filer... OK Applying djangocms_file.0007_adapted_fields... OK Applying djangocms_file.0008_add_folder... OK Applying djangocms_file.0009_fixed_null_fields... OK Applying djangocms_file.0010_removed_null_fields... OK Applying djangocms_file.0011_auto_20181211_0357... OK Applying djangocms_googlemap.0001_initial... OK Applying djangocms_googlemap.0002_auto_20160622_1031... OK Applying djangocms_googlemap.0003_auto_20160825_1829... OK Applying djangocms_googlemap.0004_adapted_fields... OK Applying djangocms_googlemap.0005_create_nested_plugins... OK Applying djangocms_googlemap.0006_remove_fields... OK Applying djangocms_googlemap.0007_reset_null_values... OK Applying djangocms_googlemap.0008_removed_null_fields... OK Applying djangocms_googlemap.0009_googlemapmarker_icon... OK Applying djangocms_link.0001_initial... OK Applying djangocms_link.0002_auto_20140929_1705... OK Applying djangocms_link.0003_auto_20150212_1310... OK Applying djangocms_link.0004_auto_20150708_1133... OK Applying djangocms_link.0005_auto_20151003_1710... OK Applying djangocms_link.0006_remove_related_name_for_cmsplugin_ptr... OK Applying djangocms_link.0007_set_related_name_for_cmsplugin_ptr... OK Applying djangocms_link.0008_link_attributes... OK Applying djangocms_link.0009_auto_20160705_1344... OK Applying djangocms_link.0010_adapted_fields... OK Applying djangocms_link.0011_fixed_null_values... OK Applying djangocms_link.0012_removed_null... OK Applying djangocms_link.0013_fix_hostname... OK Applying djangocms_picture.0001_initial... OK Applying djangocms_picture.0002_auto_20151018_1927... OK Applying djangocms_picture.0003_migrate_to_filer... OK Applying djangocms_picture.0004_adapt_fields... OK Applying djangocms_picture.0005_reset_null_values... OK Applying djangocms_picture.0006_remove_null_values... OK Applying djangocms_picture.0007_fix_alignment... OK Applying djangocms_picture.0008_picture_use_responsive_image... OK Applying djangocms_snippet.0001_initial... OK Applying djangocms_snippet.0002_snippet_slug... OK Applying djangocms_snippet.0003_auto_data_fill_slug... OK Applying djangocms_snippet.0004_auto_alter_slug_unique... OK Applying djangocms_snippet.0005_set_related_name_for_cmsplugin_ptr... OK Applying djangocms_snippet.0006_auto_20160831_0729... OK Applying djangocms_snippet.0007_auto_alter_template_helptext... OK Applying djangocms_style.0001_initial... OK Applying djangocms_style.0002_set_related_name_for_cmsplugin_ptr... OK Applying djangocms_style.0003_adapted_fields... OK Applying djangocms_style.0004_use_positive_small_integer_field... OK Applying djangocms_style.0005_reset_null_values... OK Applying djangocms_style.0006_removed_null_fields... OK Applying djangocms_style.0007_style_template... OK Applying djangocms_text_ckeditor.0001_initial... OK Applying djangocms_text_ckeditor.0002_remove_related_name_for_cmsplugin_ptr... OK Applying djangocms_text_ckeditor.0003_set_related_name_for_cmsplugin_ptr... OK Applying djangocms_text_ckeditor.0004_auto_20160706_1339... OK Applying djangocms_video.0001_initial... OK Applying djangocms_video.0002_set_related_name_for_cmsplugin_ptr... OK Applying djangocms_video.0003_field_adaptions... OK Applying djangocms_video.0004_move_to_attributes... OK Applying djangocms_video.0005_migrate_to_filer... OK Applying djangocms_video.0006_field_adaptions... OK Applying djangocms_video.0007_create_nested_plugin... OK Applying djangocms_video.0008_reset_null_values... OK Applying djangocms_video.0009_removed_null_values... OK Applying djangocms_video.0010_videoplayer_parameters... OK Applying easy_thumbnails.0001_initial... OK Applying easy_thumbnails.0002_thumbnaildimensions... OK Applying filer.0007_auto_20161016_1055... OK Applying filer.0008_auto_20171117_1313... OK Applying filer.0009_auto_20171220_1635... OK Applying filer.0010_auto_20180414_2058... OK Applying filer.0011_auto_20190418_0137... OK Applying menus.0001_initial... OK Applying sessions.0001_initial... OK Applying sites.0002_alter_domain_unique... OK Creating admin user All done!

`

yakky commented 5 years ago

@akoeb thanks for reporting this.

We do our own set of checks and I added the "." in #345

django-admin errors are fully reported with --verbose option, but I changed this to always return them by default

yakky commented 5 years ago

@akoeb version 1.1.1 with fix has been released

yakky commented 4 years ago

Fixed with 1.1.1 release with check added by #345