Closed Northshoot closed 6 years ago
@Northshoot Huh, weird. Can you add some quck debugging? https://gist.github.com/lamby/f94302bd90e5aa0ab1d9815662c8c441/raw
sure thing
print("TEMPLATE", repr(template))
print("v", repr( v ))
print("k", repr(k))
output
TEMPLATE 'message.slack'
v {'default': '', 'required': 0}
k 'text'
I am using Django 2 and python 3.6
I changed path in setting and removed
django.template.loaders.app_directories.Loader
So the error is gone and no error is given, however messages do not get posted.
I went for the native
python-slackclient
You will need django.template.loaders.app_directories.Loader
for it to find django-slack's own internal templates -- that is a red herring and you will need to replace that :)
So, I can't reproduce this. Actually, looking at the traceback:
with open(origin.name, encoding=self.engine.file_charset) as fp:
AttributeError: 'dict' object has no attribute 'file_charset'
Why is self.engine
a dictionary? We don't set that in django-slack and I can't quite see how it could have broken it. Can you paste your entire TEMPLATES
from your settings? Something is fishy there!
@Northshoot Any luck?
hey, I dropped this library and when with the native api.
@Northshoot Aw. Perhaps could you try again quickly? This is really the only way open source software can get fixed… especially as I can't seem to reproduce this :(
@Northshoot Any luck? :)
@Northshoot Just wondering if you'd had the chance to look at this yet? Would be great to get this fixed.
Okay, there's nothing really to do here alas.. :(
i am having this same error.
`/home/henry/EvergreenApp/venv/lib/python3.7/site-packages/braces/views/_forms.py changed, reloading. Watching for file changes with StatReloader Performing system checks...
System check identified some issues:
WARNINGS: foodtaskerapp.Customer: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the FoodtaskerappConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. foodtaskerapp.Driver: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the FoodtaskerappConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. foodtaskerapp.Meal: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the FoodtaskerappConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. foodtaskerapp.Order: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the FoodtaskerappConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. foodtaskerapp.OrderDetails: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the FoodtaskerappConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'. foodtaskerapp.Restaurant: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'. HINT: Configure the DEFAULT_AUTO_FIELD setting or the FoodtaskerappConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
System check identified 6 issues (0 silenced).
You have 8 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, oauth2_provider.
Run 'python manage.py migrate' to apply them.
January 01, 2022 - 04:21:19
Django version 3.2.10, using settings 'foodtasker.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, self._kwargs)
File "/home/henry/EvergreenApp/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, *kwargs)
File "/home/henry/EvergreenApp/venv/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 138, in inner_run
handler = self.get_handler(args, options)
File "/home/henry/EvergreenApp/venv/lib/python3.7/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 27, in get_handler
handler = super().get_handler(*args, **options)
File "/home/henry/EvergreenApp/venv/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 65, in get_handler
return get_internal_wsgi_application()
File "/home/henry/EvergreenApp/venv/lib/python3.7/site-packages/django/core/servers/basehttp.py", line 45, in get_internal_wsgi_application
return import_string(app_path)
File "/home/henry/EvergreenApp/venv/lib/python3.7/site-packages/django/utils/module_loading.py", line 17, in import_string
module = import_module(module_path)
File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
`
This looks like a different bug - it is about django.conf.settings.FILE_CHARSET
. Are you using a very new version of Django?
hi lamby -- yes i am using a very new version of django
Oh, it is whitenoise
that is using the (deprecated) settings.FILE_CHARSET
setting here, so this is surely a bug there:
File "/home/henry/EvergreenApp/venv/lib/python3.7/site-packages/whitenoise/django.py", line 48, in configure_from_settings
self.charset = settings.FILE_CHARSET
@lamby is there a timeline for a fix for this?
No timeline from me. As I currently understand it, this is a bug in whitenoise
, not in django-slack...? I would speak to the whitenoise developers.
I followed simple example on from the docs, however, getting the error
template:
call