Environment Error when trying to use django-notification app - django

I am trying to install django-notification app[1] and I get an error when I give manage.py syncdb.
The error states: EnvironmentError: NOTIFICATIONS was not found.
I have installed django-notification using setup tools successfully. This is my stack trace.
File "C:\Tools\Python26\lib\site-packages\django\core\management\__init__.py",
line 438, in execute_manager
utility.execute()
File "C:\Tools\Python26\lib\site-packages\django\core\management\__init__.py",
line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Tools\Python26\lib\site-packages\django\core\management\base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Tools\Python26\lib\site-packages\django\core\management\base.py", line 219, in execute
self.validate()
File "C:\Tools\Python26\lib\site-packages\django\core\management\base.py", line 249, in validate
num_errors = get_validation_errors(s, app)
File "C:\Tools\Python26\lib\site-packages\django\core\management\validation.py", line 36, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\Tools\Python26\lib\site-packages\django\db\models\loading.py", line 146, in get_app_errors
self._populate()
File "C:\Tools\Python26\lib\site-packages\django\db\models\loading.py", line 61, in _populate
self.load_app(app_name, True)
File "C:\Tools\Python26\lib\site-packages\django\db\models\loading.py", line 78, in load_app
models = import_module('.models', app_name)
File "C:\Tools\Python26\lib\site-packages\django\utils\importlib.py", line 35, in import_module
__import__(name)
File "build\bdist.win32\egg\django_notifications\models.py", line 20, in <module>
File "build\bdist.win32\egg\django_notifications\backends\__init__.py", line 23, in get_available_backends
File "build\bdist.win32\egg\django_notifications\backends\__init__.py", line 90, in get_class_instance_by_key
File "build\bdist.win32\egg\django_notifications\backends\xmpp.py", line 33, in __init__
File "build\bdist.win32\egg\django_notifications\backends\__init__.py", line 5
5, in get_settings
EnvironmentError: NOTIFICATIONS was not found.
Any ideas what went wrong?
*Added settings.INSTALLED_APPS part (corrected 'django-notifications' entry to 'notification' as suggested)*
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'grappelli',
'filebrowser',
'tinymce',
'south',
'avatar',
'django.contrib.admin',
'notification',
'myproject.main',
)
[1] https://github.com/jtauber/django-notification

For whatever reason, you've decided to add django_notifications to settings.INSTALLED_APPS instead of notification. Fix this.

Related

Django Server not starting because of RestFramework

Each time i include the Django Rest Framework in my installed apps in my settings.py file, I get an error while starting my server.
The Error Message below:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File"C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner self.run()
File"C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run self._target(*self._args, **self.kwargs)
File "C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs)
File "C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run autoreload.raise_last_exception()
File "C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception raise exception[1]
File "C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management_init.py", line 375, in execute autoreload.check_errors(django.setup)()
File "C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs)
File "C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\site-packages\django_init.py", line 24, in setup apps.populate(settings.INSTALLED_APPS)
File "C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\registry.py", line 122, in populate app_config.ready()
File "C:\Users\gchukwuma\AppData\Local\Programs\Python\Python37\lib\site-packages\rest_framework\apps.py", line 10, in ready from .checks import pagination_system_check # NOQA
ValueError: source code string cannot contain null bytes
The Settings.py file:
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'base.apps.BaseConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework'
]

ModuleNotFoundError: No module named 'django_filters'

I deleted the pycache, migrations and DB of my code to start migrations again. But I realized that there might be another way to do it, so I discarded all the changes in VS code. I tried pulling the code from master, just in case. But it showed me that my branch was already up to date with master. So I ran makemigrations, but as I tried doing that, it showed me this error:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception
raise _exception[1]
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\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 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django_filters'
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 "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
utility.execute()
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\__init__.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\base.py", line 369, in execute
output = self.handle(*args, **options)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 599, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 584, in start_django
reloader.run(django_main_thread)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 299, in run
self.run_loop()
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 305, in run_loop
next(ticker)
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 345, in tick
for filepath, mtime in self.snapshot_files():
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 361, in snapshot_files
for file in self.watched_files():
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 260, in watched_files
yield from iter_all_python_module_files()
File "C:\Users\gauta\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\django\utils\autoreload.py", line 105, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
e 141, in iter_modules_and_files
resolved_path = path.resolve(strict=True).absolute()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\pathlib.py", line 1166, in resolve
s = self._flavour.resolve(self, strict=strict)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\pathlib.py", line 200, in resolve
return self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
This has happened quite a lot times, and I cant seem to find a solution to it.
How do I resolve it?
Here is my settings.py:
INSTALLED_APPS = [
'rest_framework',
'django_filters',
'dashboard.apps.DashboardConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
REST_FRAMEWORK = { 'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema' }
On doing pip freeze > requirements.txt, i see this:
asgiref==3.2.7
astroid==2.4.0
colorama==0.4.3
Django==3.0.7
django-extensions==2.2.9
django-filter==1.1.0
django-smart-selects==1.5.6
djangorestframework==3.11.0
djangorestframework-filters==0.11.1
drfdocs==0.0.11
graphviz==0.14
isort==4.3.21
lazy-object-proxy==1.4.3
mccabe==0.6.1
pydotplus==2.0.2
pylint==2.5.0
pylint-django==2.0.15
pylint-plugin-utils==0.6
pyparsing==2.4.7
pytz==2020.1
six==1.13.0
sqlparse==0.3.1
toml==0.10.0
wrapt==1.11.2
Please help!!!
Your version is very old (https://github.com/carltongibson/django-filter/tree/56eaae15e4fab97483e1353080a0c320f18c1014#requirements)
and try moving below
INSTALLED_APPS = [
'dashboard.apps.DashboardConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'django_filters',
]
Please install django-filter package and add to installed apps
pip install django-filter
Then add 'django_filters' to your INSTALLED_APPS.
INSTALLED_APPS = [
...
'django_filters',
]

ImportError: No module named skeleton.settings

I'm using django 1.8 and satchmo project. But after successful installation of satchmo project when I try to start the server it's showing me this error
`Traceback (most recent call last):
File "manage.py", line 25, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 308, in execute
settings.INSTALLED_APPS
File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/local/Cellar/python#2/2.7.16_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named skeleton.settings`
INSTALLED_APPS = (
'django.contrib.sites',
'satchmo_store.shop',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.auth',
'django.contrib.contenttypes',
#'django.contrib.comments',
'django.contrib.sessions',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'django_comments',
'registration',
'sorl.thumbnail',
'keyedcache',
'livesettings',
'l10n',
'satchmo_utils.satchmo_thumbnail',
'satchmo_store.contact',
'tax',
'tax.modules.no',
'tax.modules.area',
'tax.modules.percent',
'shipping',
#'satchmo_store.contact.supplier',
#'shipping.modules.tiered',
#'satchmo_ext.newsletter',
#'satchmo_ext.recentlist',
'product',
'product.modules.configurable',
'product.modules.custom',
'product.modules.downloadable',
'product.modules.subscription',
#'satchmo_ext.product_feeds',
#'satchmo_ext.brand',
'payment',
'payment.modules.dummy',
#'payment.modules.purchaseorder',
#'payment.modules.giftcertificate',
#'satchmo_ext.wishlist',
#'satchmo_ext.upsell',
#'satchmo_ext.productratings',
'satchmo_ext.satchmo_toolbar',
'satchmo_utils',
#'shipping.modules.tieredquantity',
#'satchmo_ext.tieredpricing',
#'debug_toolbar',
'app_plugins',
'simple',
'store.localsite',
'skeleton',
)
Here I've added to installed apps. Still, it doesn't work. Can you tell me the use of the skeleton?
Also somehow skeleton doesn't compatible with django 1.8.

type object 'ContentType' has no attribute 'objects'

I am using djangae with some third party applications like all-auth, django-invitations and django rest framework. When I hit python manage.py migrate I get the following error.
AttributeError: type object 'ContentType' has no attribute 'objects'
The full trace is following
Traceback (most recent call last):
File "manage.py", line 26, in <module>
execute_from_command_line(sys.argv)
File "/home/salman/Workspace/chaipani/lib/djangae/core/management/__init__.py", line 43, in execute_from_command_line
return _execute_from_command_line(djangae_namespace.sandbox, argv, parser=djangae_parser, **overrides)
File "/home/salman/Workspace/chaipani/lib/djangae/core/management/__init__.py", line 68, in _execute_from_command_line
return django_management.execute_from_command_line(argv)
File "/home/salman/Workspace/chaipani/lib-vendor/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/home/salman/Workspace/chaipani/lib-vendor/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/salman/Workspace/chaipani/lib-vendor/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/salman/Workspace/chaipani/lib-vendor/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/home/salman/Workspace/chaipani/lib-vendor/django/core/management/commands/migrate.py", line 227, in handle
self.verbosity, self.interactive, connection.alias, apps=post_migrate_apps, plan=plan,
File "/home/salman/Workspace/chaipani/lib-vendor/django/core/management/sql.py", line 53, in emit_post_migrate_signal
**kwargs
File "/home/salman/Workspace/chaipani/lib-vendor/django/dispatch/dispatcher.py", line 193, in send
for receiver in self._live_receivers(sender)
File "/home/salman/Workspace/chaipani/lib-vendor/django/contrib/auth/management/__init__.py", line 63, in create_permissions
ctype = ContentType.objects.db_manager(using).get_for_model(klass)
AttributeError: type object 'ContentType' has no attribute 'objects'
My installed apps:
INSTALLED_APPS = [
'djangae',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'djangae.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'djangae.contrib.security',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',
'invitations',
]
Any help anyone?

Can't restore a db from scratch on an existing Django project

I've got an existing Django 1.10 application and I want to create a new db locally from scratch.
Following these steps
$ createdb -h localhost -p 5432 -U me -w my_db # OK
$ ./manage.py migrate
I'm getting an exception
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute
django.setup()
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/contrib/admin/apps.py", line 23, in ready
self.module.autodiscover()
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
autodiscover_modules('admin', register_to=site)
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/utils/module_loading.py", line 50, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/me/workspace/myproject-django/customauth/admin.py", line 7, in <module>
from core.admin import ShopInline
File "/home/me/workspace/myproject-django/core/admin.py", line 242, in <module>
admin.site.register(Campaign, CampaignAdmin)
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 108, in register
admin_obj = admin_class(model, self)
File "/home/me/workspace/myproject-django/core/admin.py", line 104, in __init__
last_task = TaskState.objects.filter(name='core.tasks.compute_metrics', state='SUCCESS').order_by('tstamp').last()
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/db/models/query.py", line 565, in last
objects = list((self.reverse() if self.ordered else self.order_by('-pk'))[:1])
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/db/models/query.py", line 256, in __iter__
self._fetch_all()
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/db/models/query.py", line 1087, in _fetch_all
self._result_cache = list(self.iterator())
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/db/models/query.py", line 54, in __iter__
results = compiler.execute_sql()
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 835, in execute_sql
cursor.execute(sql, params)
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/me/workspace/myproject-django/venv/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "celery_monitor_taskstate" does not exist
LINE 1: ...ker_id", "celery_monitor_taskstate"."hidden" FROM "celery_mo...
Here is the relevant part of my requirements.txt
celery==4.0.2
django-celery-beat==1.0.1
django-celery-monitor==1.1.0
django-celery-results==1.0.1
And here is my in INSTALLED_APPS
INSTALLED_APPS = (
'modeltranslation',
...
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.postgres',
'django_countries',
'django_extensions',
'django.contrib.humanize',
'django_celery_results',
'django_celery_beat',
'django_celery_monitor',
...
)
I tried to do a
$ ./manage.py migrate django_celery_monitor # also tried for _results and _beat
but it throws the same error.
Ok the problem came from a piece of my code in the admin module that was trying to retrieve a TaskState during initialisation. Hence the exception was raised even before any migration could be performed.