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

Install failure with --django-version=1.10 #300

Closed superduper closed 7 years ago

superduper commented 7 years ago

Install fails when --django-version=1.10 is supplied. Caused by string paths to view in urls.py. More details on urls.py compat : django release notes v1.9

Environment:

macOS Sierra (10.12.3)
Python 3.5.2

Steps to reproduce:

virtualenv venv
source venv/bin/activate
pip install djangocms-installer   
djangocms --django-version=1.10 my_project2

Error log:

$ virtualenv venv
Using base prefix '/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5'
New python executable in /private/tmp/djcmsinst2/venv/bin/python3.5
Also creating executable in /private/tmp/djcmsinst2/venv/bin/python
Please make sure you remove any previous custom paths from your /Users/dorada/.pydistutils.cfg file.
Installing setuptools, pip, wheel...done.

$ source venv/bin/activate
$ pip install djangocms-installer                                                                
Collecting djangocms-installer
  Using cached djangocms_installer-0.9.4-py2.py3-none-any.whl
Requirement already satisfied: six in ./venv/lib/python3.5/site-packages (from djangocms-installer)
Collecting dj-database-url>=0.4 (from djangocms-installer)
  Using cached dj_database_url-0.4.2-py2.py3-none-any.whl
Collecting tzlocal (from djangocms-installer)
Collecting argparse (from djangocms-installer)
  Using cached argparse-1.4.0-py2.py3-none-any.whl
Requirement already satisfied: pip in ./venv/lib/python3.5/site-packages (from djangocms-installer)
Collecting pytz (from tzlocal->djangocms-installer)
  Using cached pytz-2016.10-py2.py3-none-any.whl
Installing collected packages: dj-database-url, pytz, tzlocal, argparse, djangocms-installer
Successfully installed argparse-1.4.0 dj-database-url-0.4.2 djangocms-installer-0.9.4 pytz-2016.10 tzlocal-1.3

$ djangocms --django-version=1.10 my_project2
Creating the project
Please wait while I install dependencies
Dependencies installed
Creating the project
Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/management/base.py", line 294, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/management/base.py", line 342, in execute
    self.check()
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/management/base.py", line 374, in check
    include_deployment_checks=include_deployment_checks,
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
    issues.extend(super(Command, self)._run_checks(**kwargs))
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/management/base.py", line 361, in _run_checks
    return checks.run_checks(**kwargs)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/core/checks/urls.py", line 24, in check_resolver
    for pattern in resolver.url_patterns:
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/urls/resolvers.py", line 313, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
    return import_module(self.urlconf_name)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/private/tmp/djcmsinst2/my_project2/my_project2/urls.py", line 15, in <module>
    {'sitemaps': {'cmspages': CMSSitemap}}),
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/django/conf/urls/__init__.py", line 85, in url
    raise TypeError('view must be a callable or a list/tuple in the case of include().')
TypeError: view must be a callable or a list/tuple in the case of include().
The installation has failed.

*****************************************************************

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

*****************************************************************

Traceback (most recent call last):
  File "/private/tmp/djcmsinst2/venv/bin/djangocms", line 11, in <module>
    sys.exit(execute())
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/djangocms_installer/main.py", line 41, in execute
    django.setup_database(config_data)
  File "/private/tmp/djcmsinst2/venv/lib/python3.5/site-packages/djangocms_installer/django/__init__.py", line 389, in setup_database
    output = subprocess.check_output(command, env=env)
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/private/tmp/djcmsinst2/venv/bin/python3.5', '-W', 'ignore', 'manage.py', 'migrate']' returned non-zero exit status 1
yakky commented 7 years ago

@superduper Thanks for spotting. I opened a PR that fixes this. 0.9.5 is on the way

yakky commented 7 years ago

@superduper you can now check the release/0.9.x branch waiting for 0.9.5 release

superduper commented 7 years ago

@yakky Nice! Worked like a charm.

(venv) /t/djcmsinst2 ❯❯❯ pip install --upgrade git+https://github.com/nephila/djangocms-installer@cc22a91230c21098cc6cb29b940f408e79b6ff5f    ⏎
Collecting git+https://github.com/nephila/djangocms-installer@cc22a91230c21098cc6cb29b940f408e79b6ff5f
  Cloning https://github.com/nephila/djangocms-installer (to cc22a91230c21098cc6cb29b940f408e79b6ff5f) to /private/var/folders/ky/1ztqssv97pjgzgwmmj11tv680000gn/T/pip-xdce3yu7-build
  Running setup.py install for djangocms-installer ... done
Successfully installed djangocms-installer-0.9.4

(venv) /t/djcmsinst2 ❯❯❯ djangocms --django-version=1.10 my_project27                                                                         ⏎
Creating the project
Please wait while I install dependencies
Dependencies installed
Creating the project
System check identified some issues:

WARNINGS:
?: (1_10.W001) The MIDDLEWARE_CLASSES setting is deprecated in Django 1.10 and the MIDDLEWARE setting takes precedence. Since you've set MIDDLEWARE, the value of MIDDLEWARE_CLASSES is ignored.
Operations to perform:
  Apply all migrations: admin, auth, cms, cmsplugin_filer_file, cmsplugin_filer_folder, cmsplugin_filer_image, contenttypes, djangocms_column, djangocms_googlemap, djangocms_link, djangocms_snippet, djangocms_style, djangocms_text_ckeditor, djangocms_video, easy_thumbnails, filer, menus, sessions, sites
Running migrations:
  ....
  Applying sessions.0001_initial... OK
  Applying sites.0002_alter_domain_unique... OK
Creating admin user
All done!
Get into "/private/tmp/djcmsinst2/my_project27" directory and type "python manage.py runserver" to start your project
yakky commented 7 years ago

Thanks @superduper 0.9.5 is coming, then!