LPgenerator / django-db-mailer

Django module to easily send emails/sms/tts/push using django templates stored on database and managed through the Django Admin
https://github.com/LPgenerator/django-db-mailer
GNU General Public License v2.0
255 stars 81 forks source link

django-db-mailer init breaks Django 1.11 #90

Closed Eagllus closed 7 years ago

Eagllus commented 7 years ago

Version Python==3.6.1 Django==1.11 django-db-mailer=2.3.17

It's an clean install of django-db-mailer following https://github.com/LPgenerator/django-db-mailer#installation (fixed #89 on development)

Trying any command

Eagllus > python manage.py
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/ronald/.virtualenvs/cc/lib/python3.6/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/Users/ronald/.virtualenvs/cc/lib/python3.6/site-packages/django/core/management/__init__.py", line 337, in execute
    django.setup()
  File "/Users/ronald/.virtualenvs/cc/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/ronald/.virtualenvs/cc/lib/python3.6/site-packages/django/apps/registry.py", line 116, in populate
    app_config.ready()
  File "/Users/ronald/.virtualenvs/cc/lib/python3.6/site-packages/dbmail/apps.py", line 16, in ready
    initial_signals()
  File "/Users/ronald/.virtualenvs/cc/lib/python3.6/site-packages/dbmail/__init__.py", line 146, in initial_signals
    from dbmail.signals import initial_signals as init_signals
  File "/Users/ronald/.virtualenvs/cc/lib/python3.6/site-packages/dbmail/signals.py", line 7, in <module>
    from django.contrib.sites.models import Site
  File "/Users/ronald/.virtualenvs/cc/lib/python3.6/site-packages/django/contrib/sites/models.py", line 84, in <module>
    class Site(models.Model):
  File "/Users/ronald/.virtualenvs/cc/lib/python3.6/site-packages/django/db/models/base.py", line 118, in __new__
    "INSTALLED_APPS." % (module, name)
RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

In my development environment I commented line 7 in signals.py from django.contrib.sites.models import Site

pcraston commented 7 years ago

We had the same error when using Django 1.10.4 and fixed it by adding the following to the settings.py:

gotlium commented 7 years ago

django.contrib.sites is required