Git Product home page Git Product logo

onthefly's People

Contributors

baranbartu avatar jayvdb avatar reduxionist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

onthefly's Issues

TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType'

This is not happening locally in dev, but is happening on production - both are using redis:alpine docker. It appears to be occurring for any setting, and there are no stored settings yet. Two different places where it occurs.

  File "/usr/local/lib/python3.6/site-packages/oscar/apps/dashboard/menu.py", line 14, in get_nodes
    all_nodes = create_menu(settings.OSCAR_DASHBOARD_NAVIGATION)
  File "/usr/local/src/django-onthefly/onthefly/monkey_patch.py", line 19, in __getattr__
    return self.backend.get_value(name)
  File "/usr/local/src/django-onthefly/onthefly/backend/__init__.py", line 58, in get_value
    value = self.get(name)
  File "/usr/local/src/django-onthefly/onthefly/backend/redis_backend.py", line 17, in get
    return json.loads(dumped)
  File "/usr/local/lib/python3.6/json/__init__.py", line 348, in loads
    'not {!r}'.format(s.__class__.__name__))
TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType'
[04:49:56][ERROR] django.request log.py:log_response:228 | Internal Server Error: /admin/onthefly-settings/
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.6/contextlib.py", line 52, in inner
    return func(*args, **kwds)
  File "/usr/local/lib/python3.6/site-packages/django/utils/decorators.py", line 142, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/contrib/admin/sites.py", line 223, in inner
    return view(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py", line 158, in get
    context = self.get_context_data(**kwargs)
  File "/usr/local/src/django-onthefly/onthefly/admin.py", line 20, in get_context_data
    'onthefly_settings': settings.get_onthefly_settings
  File "/usr/local/src/django-onthefly/onthefly/monkey_patch.py", line 36, in get_onthefly_settings
    return self.backend.values()
  File "/usr/local/src/django-onthefly/onthefly/backend/redis_backend.py", line 37, in values
    all_values[field] = json.loads(values[i])
  File "/usr/local/lib/python3.6/json/__init__.py", line 348, in loads
    'not {!r}'.format(s.__class__.__name__))
TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType'

git grep --context 4 ONTHEFLY settings.py

REDIS_ENDPOINT = 'redis:6379'
if 'onthefly' in INSTALLED_APPS:
    ONTHEFLY = {
        'BACKEND': 'onthefly.backend.redis_backend.RedisBackend',
        'OPTIONS': {'URL': f'redis://{REDIS_ENDPOINT}/15'},
    }

UI

Nice idea. The UI however is in need of some work.

So far I have found only one other app which comes close to this functionality, and it needed a bit of work in order to integrate with third-party apps. idlesign/django-siteprefs#25

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.