etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.2k stars 129 forks source link

[SOLVED] AttributeError: 'module' object has no attribute 'register' #145

Closed alzearafat closed 8 years ago

alzearafat commented 8 years ago

Hi,

I have one issue with django-watson 1.2.0. I'm using Django 1.8.7.

_Traceback : _

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 328, in execute
    django.setup()
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 115, in populate
    app_config.ready()
  File "/home/zea/Riset/Django-Project/gogotrip_env/gogotrip/trip_app/apps.py", line 8, in ready
    watson.register(trip)
AttributeError: 'module' object has no attribute 'register'

Apps.py

from django.apps import AppConfig
import watson

class TripAppConfig(AppConfig):
    name = "trip_app"
    def ready(self):
        trip = self.get_model("trip")
        watson.register(trip)

**init.py**

default_app_config = 'trip_app.apps.TripAppConfig'

Now I must revert back to prev version (1.1.9).

Any help would be appreciated, thank you very much :)

etianen commented 8 years ago

There were some backwards-incompatible change introduced in 1.2.0. Check the changelog.

https://github.com/etianen/django-watson/blob/master/CHANGELOG.markdown#120---03122015

On Mon, 14 Dec 2015 at 09:27 Alzea Arafat notifications@github.com wrote:

Hi,

I have one issue with django-watson 1.2.0. I'm using Django 1.8.7.

_Traceback : _

Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 354, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 328, in execute django.setup() File "/usr/local/lib/python2.7/dist-packages/django/init.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 115, in populate app_config.ready() File "/home/zea/Riset/Django-Project/gogotrip_env/gogotrip/trip_app/apps.py", line 8, in ready watson.register(trip) AttributeError: 'module' object has no attribute 'register'

Apps.py

from django.apps import AppConfig import watson

class TripAppConfig(AppConfig): name = "trip_app" def ready(self): trip = self.get_model("trip") watson.register(trip)

init.py

default_app_config = 'trip_app.apps.TripAppConfig'

Now I must revert back to prev version (1.1.9).

Any help would be appreciated, thank you very much :)

— Reply to this email directly or view it on GitHub https://github.com/etianen/django-watson/issues/145.

alzearafat commented 8 years ago

Hi @etianen Thank you for fast response. Ah, I see... So I need to upgrade to Django 1.9?

Thank you

etianen commented 8 years ago

Not necessarily. The backwards-incompatible changes were made in order to support Django 1.9. You need to change your import code, as detailed in the changelog. On Wed, 16 Dec 2015 at 03:43, Alzea Arafat notifications@github.com wrote:

Hi @etianen https://github.com/etianen Thank you for fast response. Ah, I see... So I need to upgrade to Django 1.9?

Thank you

— Reply to this email directly or view it on GitHub https://github.com/etianen/django-watson/issues/145#issuecomment-164980624 .

alzearafat commented 8 years ago

Hi,

Thank you @etianen , I'll mark this as solved :)

Thank you