lazybird / django-carton

A simple and lightweight application for shopping carts and wish lists.
Other
274 stars 101 forks source link

ImportError: No module named 'shopping' #29

Closed unicornlox closed 6 years ago

unicornlox commented 7 years ago

hello lazybird; How can i fix the problem?(Note:python3.5, django 1.11.3 and my settings.py in 'carton','shopping','products',)

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 337, in execute
    django.setup()
  File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.5/dist-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python3.5/dist-packages/django/apps/config.py", line 94, in create
    module = import_module(entry)
  File "/usr/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 956, in _find_and_load_unlocked
ImportError: No module named 'shopping'
unicornlox commented 7 years ago

I solved the problem, I created the shopping application manually :) thanks

henryliangt commented 2 years ago

I did manage.py startapp shopping, and then I found there is no urls.py in shopping, after I created it, then, AttributeError at / 'Library' object has no attribute 'assignment_tag'

henryliangt commented 2 years ago

https://github.com/lazybird/django-carton/issues/3

then I found this answer very helpful In carton_tags.py:

@register.simple_tag(takes_context=True, name=CART_TEMPLATE_TAG_NAME) def get_cart(context, session_key=None, cart_class=Cart): ----request = context['request'] ----return cart_class(request.session, session_key=session_key)

works fine with django 3.0