I'm Try to Open local demo image and save to test.jpg
but i getting error like this
the local image open browser using url "http://127.0.0.1:8000/media/demo.jpg"
Traceback (most recent call last):
File "E:\django and flutter projects\env\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "E:\django and flutter projects\env\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "E:\django and flutter projects\env\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "E:\django and flutter projects\env\lib\site-packages\django\views\generic\base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "E:\django and flutter projects\env\lib\site-packages\rest_framework\views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "E:\django and flutter projects\env\lib\site-packages\rest_framework\views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "E:\django and flutter projects\env\lib\site-packages\rest_framework\views.py", line 480, in raise_uncaught_exception
raise exc
File "E:\django and flutter projects\env\lib\site-packages\rest_framework\views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "E:\django and flutter projects\rto\rc\views.py", line 20, in get
img =Image.open('http://127.0.0.1:8000/media/demo.jpg',mode="r")
File "E:\django and flutter projects\env\lib\site-packages\PIL\Image.py", line 2953, in open
fp = builtins.open(filename, "rb")
OSError: [Errno 22] Invalid argument: 'http://127.0.0.1:8000/media/demo.jpg'
This is Simple view.py
class PrintRC(APIView):
def get(self,req):
img =Image.open('http://127.0.0.1:8000/media/demo.jpg',mode="r")
img.save('test.jpeg')
print('Success')
return Response('hello')
class PrintRC(APIView):
def get(self,req):
path = Path('media/demo.jpg')
img =Image.open(path,mode="r")
img.save('test.jpeg')
print(img)
return Response('hello')
Related
The problem
I'm trying to send a Djoser user's activation email using django-mailer.
However, I receive the following error:
TL;DR:
TypeError: cannot pickle '_io.BufferedReader' object
FULL:
Traceback (most recent call last):
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/viewsets.py", line 125, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/mixins.py", line 19, in create
self.perform_create(serializer)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/djoser/views.py", line 144, in perform_create
settings.EMAIL.activation(self.request, context).send(to)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/templated_mail/mail.py", line 78, in send
super(BaseEmailMessage, self).send(*args, **kwargs)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/core/mail/message.py", line 298, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/mailer/backend.py", line 15, in send_messages
messages = Message.objects.bulk_create([
^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/mailer/backend.py", line 16, in <listcomp>
Message(email=email) for email in email_messages
^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/db/models/base.py", line 554, in __init__
_setattr(self, prop, value)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/mailer/models.py", line 150, in _set_email
self.message_data = email_to_db(val)
^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/mailer/models.py", line 94, in email_to_db
return base64_encode(pickle.dumps(email)).decode('ascii')
^^^^^^^^^^^^^^^^^^^
TypeError: cannot pickle '_io.BufferedReader' object
Internal Server Error: /api/auth/users/
Traceback (most recent call last):
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/viewsets.py", line 125, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/rest_framework/mixins.py", line 19, in create
self.perform_create(serializer)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/djoser/views.py", line 144, in perform_create
settings.EMAIL.activation(self.request, context).send(to)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/templated_mail/mail.py", line 78, in send
super(BaseEmailMessage, self).send(*args, **kwargs)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/core/mail/message.py", line 298, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/mailer/backend.py", line 15, in send_messages
messages = Message.objects.bulk_create([
^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/mailer/backend.py", line 16, in <listcomp>
Message(email=email) for email in email_messages
^^^^^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/django/db/models/base.py", line 554, in __init__
_setattr(self, prop, value)
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/mailer/models.py", line 150, in _set_email
self.message_data = email_to_db(val)
^^^^^^^^^^^^^^^^
File "/Users/joaoalbuquerque/pyenv/versions/3.11.0/envs/garvy/lib/python3.11/site-packages/mailer/models.py", line 94, in email_to_db
return base64_encode(pickle.dumps(email)).decode('ascii')
^^^^^^^^^^^^^^^^^^^
TypeError: cannot pickle '_io.BufferedReader' object
Libraries and versions used (Python 3.11):
"djangorestframework==3.14.0",
"dj-database-url==1.0.0",
"psycopg2-binary==2.9.5",
"django-cors-headers==3.13.0",
"gunicorn==20.1.0",
"pyjwt==2.6.0",
"python-dotenv==0.21.0",
"djoser==2.1.0",
"djangorestframework-simplejwt==4.8.0",
"django-mailer==2.1",
What I've already tried:
I found this related issue on Djoser's Github. However resolution support with django-mailer in version 2.1 didn't work around here.
Related issue: https://github.com/sunscrapers/djoser/issues/609
I use geopy to convet a coordinate into an address in order to get the name of the country and this is my code :
def convert_latandlong_to_address(self):
geolocator = Nominatim(user_agent="miz")
location = geolocator.reverse(self.lat+","+self.lng,timeout=10)
address = location.raw['address']
return address
it works fine but i realized that after several requests it returns 502 error :
geopy.exc.GeocoderServiceError: Non-successful status code 502
and this is full traceback:
Traceback (most recent call last):
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/geopy/geocoders/base.py", line 360, in _call_geocoder
result = self.adapter.get_json(url, timeout=timeout, headers=req_headers)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/geopy/adapters.py", line 373, in get_json
resp = self._request(url, timeout=timeout, headers=headers)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/geopy/adapters.py", line 401, in _request
raise AdapterHTTPError(
geopy.adapters.AdapterHTTPError: Non-successful status code 502
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/rest_framework/decorators.py", line 50, in handler
return func(*args, **kwargs)
File "/home/admin1/mizbanproject/location/preferlocation/api/views.py", line 15, in get_prefer_locations
address = location_obj.convert_latandlong_to_address()
File "/home/admin1/mizbanproject/location/preferlocation/api/utils.py", line 27, in convert_latandlong_to_address
location = geolocator.reverse(self.lat+","+self.lng,timeout=10)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/geopy/geocoders/nominatim.py", line 359, in reverse
return self._call_geocoder(url, callback, timeout=timeout)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/geopy/geocoders/base.py", line 378, in _call_geocoder
self._adapter_error_handler(error)
File "/home/admin1/envs/myvenv/lib/python3.8/site-packages/geopy/geocoders/base.py", line 392, in _adapter_error_handler
raise exc_cls(str(error)) from error
geopy.exc.GeocoderServiceError: Non-successful status code 502
and after a few seconds or minutes when i run the code again it works i can't figure out what causes this problem and how can i prevent it ?
I used virtual env to host my python project on to the local host but
when visit my localhost, the website is IOError at /gobot/dcae3db9ad68d046e97d503da41a068aed8663feec28882d94
[Errno 13] Permission denied: '/home/ubuntu/autobot/nohup.out'
Why am I getting this error ? Please help.
Internal Server Error:
/gobot/dcae3db9ad68d046e97d503da41a068aed8663feec28882d94
Traceback (most recent call last):
File "/home/ubuntu/autobot/myproject/myprojectenv/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 42, in inner
response = get_response(request)
File "/home/ubuntu/autobot/myproject/myprojectenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/ubuntu/autobot/myproject/myprojectenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/ubuntu/autobot/myproject/myprojectenv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/home/ubuntu/autobot/myproject/myprojectenv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 67, in _wrapper
return bound_func(*args, **kwargs)
File "/home/ubuntu/autobot/myproject/myprojectenv/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/home/ubuntu/autobot/myproject/myprojectenv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 63, in bound_func
return func.__get__(self, type(self))(*args2, **kwargs2)
File "/home/ubuntu/autobot/gobot/views.py", line 360, in dispatch
return generic.View.dispatch(self, request, *args, **kwargs)
File "/home/ubuntu/autobot/myproject/myprojectenv/local/lib/python2.7/site-packages/django/views/generic/base.py", line 88, in dispatch
return handler(request, *args, **kwargs)
File "/home/ubuntu/autobot/gobot/views.py", line 352, in get
I'm trying to do a simple graph query in neo4j from python. My query looks like
def do_query(self):
graph = Graph(settings.NEO4J_CONNECTION_STRING)
query = 'MATCH (n:SomeNode) WHERE n.id = ' + id + ' RETURN n'
data = graph.cypher.execute(query)
but when I run it in a Django REST handler, I get the following error
Traceback (most recent call last):
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/rest_framework/views.py", line 466, in dispatch
response = self.handle_exception(exc)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/rest_framework/views.py", line 463, in dispatch
response = handler(request, *args, **kwargs)
File "/Users/me/Development/app/search/api/views.py", line 351, in get
results = graph_queries.do_query(user_id)
File "/Users/me/Development/app/app/graph_queries.py", line 43, in do_query
data = graph.cypher.execute(query)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/py2neo/core.py", line 661, in cypher
metadata = self.resource.metadata
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/py2neo/core.py", line 213, in metadata
self.get()
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/py2neo/core.py", line 258, in get
response = self.__base.get(headers=headers, redirect_limit=redirect_limit, **kwargs)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/py2neo/packages/httpstream/http.py", line 966, in get
return self.__get_or_head("GET", if_modified_since, headers, redirect_limit, **kwargs)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/py2neo/packages/httpstream/http.py", line 943, in __get_or_head
return rq.submit(redirect_limit=redirect_limit, **kwargs)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/py2neo/packages/httpstream/http.py", line 433, in submit
http, rs = submit(self.method, uri, self.body, self.headers)
File "/Users/me/.virtualenvs/app/lib/python2.7/site-packages/py2neo/packages/httpstream/http.py", line 302, in submit
raise ValueError("Unsupported URI scheme " + repr(uri.scheme))
ValueError: Unsupported URI scheme None
I'm not really sure where to begin. I'm pretty confident the connection to Neo4J is good, and the handler is being invoked correctly as shown in the traceback. Is there something wrong with my query?
Turns out the problem was I was using import settings rather than from django.conf import settings, which meant I wasn't reading the correct setting.
The following code is in a library
self.env = Environment(loader=PackageLoader('netjsonconfig.backends.openwrt', 'templates'),
trim_blocks=True)
The library is used by a consumer app, if the library is installed via python setup.py develop the consumer app works correctly while if the library is installed via pip the consumer app crashes with the following traceback (see failing build on travis):
Traceback (most recent call last):
File "/home/travis/build/openwisp/django-netjsonconfig/django_netjsonconfig/tests/test_device_admin.py", line 33, in test_download_config
response = self.client.get(path)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/client.py", line 503, in get
**extra)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/client.py", line 304, in get
return self.generic('GET', path, secure=secure, **r)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/client.py", line 380, in generic
return self.request(**r)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/test/client.py", line 467, in request
six.reraise(*exc_info)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/utils/six.py", line 686, in reraise
raise value
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/core/handlers/base.py", line 149, in get_response
response = self.process_exception_by_middleware(e, request)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/core/handlers/base.py", line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/django/contrib/admin/sites.py", line 244, in inner
return view(request, *args, **kwargs)
File "/home/travis/build/openwisp/django-netjsonconfig/django_netjsonconfig/admin.py", line 52, in download_view
device.backend_instance.generate(device.name)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/netjsonconfig-0.3.1-py3.4.egg/netjsonconfig/backends/openwrt/openwrt.py", line 104, in generate
uci = self.render()
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/netjsonconfig-0.3.1-py3.4.egg/netjsonconfig/backends/openwrt/openwrt.py", line 77, in render
additional_output = renderer.render()
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/netjsonconfig-0.3.1-py3.4.egg/netjsonconfig/backends/base.py", line 41, in render
template = self.env.get_template(template_name)
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/Jinja2-2.8-py3.4.egg/jinja2/environment.py", line 812, in get_template
return self._load_template(name, self.make_globals(globals))
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/Jinja2-2.8-py3.4.egg/jinja2/environment.py", line 774, in _load_template
cache_key = self.loader.get_source(self, name)[1]
File "/home/travis/virtualenv/python3.4.2/lib/python3.4/site-packages/Jinja2-2.8-py3.4.egg/jinja2/loaders.py", line 235, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: system.uci
It seems that it's looking templates in ./templates and it obviously doesn't work. I think I've not understood TemplateLoaders in Jinja very well. What am I doing wrong?
When you pip install netjsonconfig it does not include a templates folder along side the python code. Looks like a setup.py issue.
(venv)Josh:netjsonconfig$ find .
.
./__init__.py
./backends
./backends/__init__.py
./backends/base.py
./backends/openwisp
./backends/openwisp/__init__.py
./backends/openwisp/openwisp.py
./backends/openwisp/schema.py
./backends/openwrt
./backends/openwrt/__init__.py
./backends/openwrt/openwrt.py
./backends/openwrt/renderers.py
./backends/openwrt/schema.py
./backends/openwrt/timezones.py
./exceptions.py
./schema.py
./utils.py
./version.py