Wednesday, April 29, 2020

filebrowser-no-grappelli error

Can anyone please suggest a line of enquiry to track this down?

One urls.py works in dev (no include() ) but not in production and the
other vice versa.

TTBOMK everything else is the same. Python 3.6, Django 2.2 but Ubuntu
18.04 in production versus Windows 10 dev. If the OS is the problem it
will be the first time I've seen the platform being the cause so I'm
discounting that difference.

Thanks

Mike

In development I have ...

from filebrowser.sites import site as fbsite

urlpatterns = [

    re_path(r'^admin/filebrowser/', fbsite.urls), ...

... which works. But in production it generates a 500 error and Apache
error log says ...

[Thu Apr 30 02:10:59.134900 2020] [wsgi:error] [pid 30201:tid
140579681842944] [client 43.***.***.***:59151] ValueError: not enough
values to unpack (expected 3, got 2), referer: https://www.****.com/login/


In production I have ...

from filebrowser.sites import site as fbsite

urlpatterns = [

    re_path(r'^admin/filebrowser/', include(fbsite.urls)), ...


... which works. But in development it generates ...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\urls\conf.py", line
17, in include
    urlconf_module, app_name = arg
ValueError: too many values to unpack (expected 2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\python36\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\python36\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\utils\autoreload.py",
line 54, in wrapper
    fn(*args, **kwargs)
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\core\management\commands\runserver.py",
line 117, in inner_run
    self.check(display_num_errors=True)
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\core\management\base.py",
line 390, in check
    include_deployment_checks=include_deployment_checks,
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\core\management\base.py",
line 377, in _run_checks
    return checks.run_checks(**kwargs)
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\core\checks\registry.py",
line 72, in run_checks
    new_errors = check(app_configs=app_configs)
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\core\checks\urls.py",
line 40, in check_url_namespaces_unique
    all_namespaces = _load_all_namespaces(resolver)
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\core\checks\urls.py",
line 57, in _load_all_namespaces
    url_patterns = getattr(resolver, 'url_patterns', [])
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\utils\functional.py",
line 80, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\urls\resolvers.py",
line 584, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\utils\functional.py",
line 80, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\urls\resolvers.py",
line 577, in urlconf_module
    return import_module(self.urlconf_name)
  File "C:\python36\lib\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 "D:\Users\mike\envs\xxct3\train\train\urls.py", line 49, in <module>
    re_path(r'^admin/filebrowser/', include(fbsite.urls)),
  File
"D:\Users\mike\envs\xxct3\lib\site-packages\django\urls\conf.py", line
27, in include
    'provide the namespace argument to include() instead.' % len(arg)
django.core.exceptions.ImproperlyConfigured: Passing a 3-tuple to
include() is not supported. Pass a 2-tuple containing the list of
patterns and app_name, and provide the namespace argument to include()
instead.


pip freeze in production ...

acme==0.31.0
apparmor==2.12
asn1crypto==0.24.0
attrs==17.4.0
Automat==0.6.0
bleach==3.1.0
blinker==1.4
certbot==0.31.0
certbot-apache==0.31.0
certifi==2018.1.18
chardet==3.0.4
CIRpy==1.0.2
click==6.7
cloud-init==19.4
colorama==0.3.7
command-not-found==0.3
ConfigArgParse==0.11.0
configobj==5.0.6
constantly==15.1.0
cryptography==2.1.4
distro-info===0.18ubuntu0.18.04.1
Django==2.2.12
django-csp==3.6
django-filebrowser-no-grappelli==3.7.8
django-referrer-policy==1.0
django-tinymce4-lite==1.7.5
docutils==0.14
future==0.15.2
httplib2==0.9.2
hyperlink==17.3.1
idna==2.8
incremental==16.10.1
Jinja2==2.10
josepy==1.1.0
jsmin==2.2.2
jsonpatch==1.16
jsonpointer==1.10
jsonschema==2.6.0
keyring==10.6.0
keyrings.alt==3.0
language-selector==0.1
LibAppArmor==2.12
MarkupSafe==1.0
mock==2.0.0
ndg-httpsclient==0.4.4
netifaces==0.10.4
oauthlib==2.0.6
olefile==0.45.1
PAM==0.4.2
parsedatetime==2.4
pbr==3.1.1
Pillow==6.0.0
psycopg2==2.7.4
pwned-passwords-django==1.3.1
pyasn1==0.4.2
pyasn1-modules==0.2.1
pycrypto==2.6.1
Pygments==2.2.0
pygobject==3.26.1
PyICU==1.9.8
PyJWT==1.5.3
pyOpenSSL==17.5.0
pyRFC3339==1.0
pyserial==3.4
python-apt==1.6.5+ubuntu0.2
python-augeas==0.5.0
python-debian==0.1.32
pytz==2019.1
pyxdg==0.25
PyYAML==3.12
requests==2.21.0
requests-toolbelt==0.8.0
requests-unixsocket==0.1.5
roman==2.0.0
SecretStorage==2.3.1
service-identity==16.0.0
six==1.12.0
sqlparse==0.3.0
ssh-import-id==5.7
stripe==2.30.0
systemd-python==234
Twisted==17.9.0
ufw==0.36
unattended-upgrades==0.1
urllib3==1.22
webencodings==0.5.1
zope.component==4.3.0
zope.event==4.2.0
zope.hookable==4.0.4
zope.interface==4.3.2

pip freeze in dev ...

bleach==3.1.4
certifi==2020.4.5.1
chardet==3.0.4
coverage==5.1
Django==2.2.12
django-debug-toolbar==2.2
django-filebrowser-no-grappelli==3.7.8
django-tinymce4-lite==1.7.5
docutils==0.16
idna==2.7
jsmin==2.2.2
Pillow==5.1.1
psycopg2==2.7.4
pwned-passwords-django==1.4
pytz==2019.3
requests==2.23.0
six==1.11.0
sqlparse==0.3.0
stripe==2.46.0
urllib3==1.23
webencodings==0.5.1

The reason the installations vary is because we don't use venv in
production.



...

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/009f79f0-9e15-e758-f606-873d2c6eee99%40dewhirst.com.au.

No comments:

Post a Comment