Q & A

bbgo 관련 요청이나 문의 사항을 자유롭게 적어주세요. 뒤로가기
createsuperuser 생성 시 에러 발생
missio
184 0
2020-03-26 10:40:33
https://gencode.me/35/
1.212.*.*

안녕하세요 개발환경 만든다음에 슈퍼유저 생성하려고 하면 다음과 같은 에러가 나오는데 어떤문제인가 ㅠㅠ

(bbgo) root@ubuntu:~/bbgo# python manage.py createsuperuser

Traceback (most recent call last):

  File "manage.py", line 22, in <module>

    execute_from_command_line(sys.argv)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line

    utility.execute()

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/core/management/__init__.py", line 395, in execute

    self.fetch_command(subcommand).run_from_argv(self.argv)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/core/management/base.py", line 328, in run_from_argv

    self.execute(*args, **cmd_options)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 79, in execute

    return super().execute(*args, **options)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/core/management/base.py", line 366, in execute

    self.check()

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/core/management/base.py", line 395, in check

    include_deployment_checks=include_deployment_checks,

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/core/management/base.py", line 382, in _run_checks

    return checks.run_checks(**kwargs)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/core/checks/registry.py", line 72, in run_checks

    new_errors = check(app_configs=app_configs)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique

    all_namespaces = _load_all_namespaces(resolver)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces

    url_patterns = getattr(resolver, 'url_patterns', [])

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/utils/functional.py", line 48, in __get__

    res = instance.__dict__[self.name] = self.func(instance)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/urls/resolvers.py", line 588, in url_patterns

    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/utils/functional.py", line 48, in __get__

    res = instance.__dict__[self.name] = self.func(instance)

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/urls/resolvers.py", line 581, in urlconf_module

    return import_module(self.urlconf_name)

  File "/root/.pyenv/versions/3.6.6/lib/python3.6/importlib/__init__.py", line 126, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 994, in _gcd_import

  File "<frozen importlib._bootstrap>", line 971, in _find_and_load

  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 678, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "/root/bbgo/bbgo/urls.py", line 30, in <module>

    url(r'^spams/', include(('spams.urls', 'spams'), namespace='spams')),

  File "/root/.pyenv/versions/bbgo/lib/python3.6/site-packages/django/urls/conf.py", line 34, in include

    urlconf_module = import_module(urlconf_module)

  File "/root/.pyenv/versions/3.6.6/lib/python3.6/importlib/__init__.py", line 126, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 994, in _gcd_import

  File "<frozen importlib._bootstrap>", line 971, in _find_and_load

  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 678, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "/root/bbgo/spams/urls.py", line 5, in <module>

    from . import views

  File "/root/bbgo/spams/views.py", line 8, in <module>

    from django.shortcuts import get_object_or_404, render, render_to_response

ImportError: cannot import name 'render_to_response'


비추 공유
댓글 [ 1 ]
gencode.me 03-26
Django 3.0 을 설치하신 거 같네요.

pip uninstall Django
pip install Django==2.2.11 처럼 2.x 버전으로 다운 그레이드하시면 될 겁니다.