darklow / django-suit

Modern theme for Django admin interface
http://djangosuit.com/
Other
2.33k stars 704 forks source link

ModuleNotFoundError: No module named 'django.contrib.admin.templatetags.admin_static' #759

Closed agusmakmun closed 3 years ago

agusmakmun commented 4 years ago

I'm trying to install this django==suit-0.2.28 for django==3.0.5, but I have an error.

ModuleNotFoundError: No module named 'django.contrib.admin.templatetags.admin_static'

I recomended you to support multiple django versions;

try:
    from django.contrib.admin.templatetags.admin_static import static
except ImportError:
    from django.templatetags.static import static
(env-siap) ➜  siap-backend git:(versioning) pip install django-suit
Collecting django-suit
  Downloading django_suit-0.2.28-py2.py3-none-any.whl (402 kB)
     |████████████████████████████████| 402 kB 3.6 kB/s 
Installing collected packages: django-suit
Successfully installed django-suit-0.2.28
(env-siap) ➜  siap-backend git:(versioning) ✗ ./manage.py collectstatic
Traceback (most recent call last):
  File "./manage.py", line 21, in <module>
    main()
  File "./manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/home/agus/envs/env-siap/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/home/agus/envs/env-siap/lib/python3.7/site-packages/django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "/home/agus/envs/env-siap/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/agus/envs/env-siap/lib/python3.7/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/home/agus/envs/env-siap/lib/python3.7/site-packages/django/contrib/admin/apps.py", line 24, in ready
    self.module.autodiscover()
  File "/home/agus/envs/env-siap/lib/python3.7/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/home/agus/envs/env-siap/lib/python3.7/site-packages/django/utils/module_loading.py", line 47, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/home/agus/envs/env-siap/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/agus/envs/env-siap/lib/python3.7/site-packages/suit/admin.py", line 8, in <module>
    from suit.widgets import NumberInput, SuitSplitDateTimeWidget
  File "/home/agus/envs/env-siap/lib/python3.7/site-packages/suit/widgets.py", line 6, in <module>
    from django.contrib.admin.templatetags.admin_static import static
ModuleNotFoundError: No module named 'django.contrib.admin.templatetags.admin_static'
mbrksntrk commented 4 years ago

I'm trying to install this django==suit-0.2.28 for django==3.0.5, but I have an error.

same here, Since django.contrib.staticfiles.templatetags was removed in version 3, i think suit doesn't support django 3.

amureki commented 4 years ago

Greetings fellows!

This was fixed in https://github.com/darklow/django-suit/commit/3f96430ded2deee3016e7ed58619b751115853a0#diff-2472dfd85537f7c91be3519330c6a40e but that commit is placed under v2 development branch (not released on PyPI): https://github.com/darklow/django-suit/tree/v2

You can try to switch to this version by installing it via GitHub directly and see if it works for you:

pip install https://github.com/darklow/django-suit/tarball/v2

However, I am not sure if there is an active development happening ATM, last commit was on 10 Jan 2020.

@darklow do you think we can expect any movements soon?

Thanks!

mbrksntrk commented 4 years ago

This was fixed in 3f96430#diff-2472dfd85537f7c91be3519330c6a40e but that commit is placed under v2 development branch (not released on PyPI): https://github.com/darklow/django-suit/tree/v2

Thank you for your reply, I tried this, I works!

thmsrmbld commented 4 years ago

Hey @mbrksntrk - what was the process you took to install that specific commit from the working version? Would love to get this working my side.

ladmerc2 commented 4 years ago

@thmsrmbld pip install https://github.com/darklow/django-suit/tarball/v2

thmsrmbld commented 4 years ago

Ahh you installed the whole v2, awesome, thanks.

jeevankc17 commented 4 years ago

How to install all version 3 ?

asimejaz14 commented 3 years ago

Greetings fellows!

This was fixed in 3f96430#diff-2472dfd85537f7c91be3519330c6a40e but that commit is placed under v2 development branch (not released on PyPI): https://github.com/darklow/django-suit/tree/v2

You can try to switch to this version by installing it via GitHub directly and see if it works for you. However, I am not sure if there is an active development happening ATM, last commit was on 10 Jan 2020.

@darklow do you think we can expect any movements soon?

Thanks!

Worked perfectly, thanks!!!

AliHassanUOS commented 3 years ago

pip install https://github.com/darklow/django-suit/tarball/v2

install it for resolve this error

AliHassanUOS commented 3 years ago

@thmsrmbld pip install https://github.com/darklow/django-suit/tarball/v2

Thank You

Khosiyat commented 3 years ago

1111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111

Does anyone know solution for this problem, pls........?