google-code-export / evennia

Automatically exported from code.google.com/p/evennia
Other
1 stars 0 forks source link

Evennia is not working with Django 1.6 #435

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A) What steps will reproduce the problem?

1. install evennia with django 1.6
2. watch the logfile portal.log
3. browser the site and see the error message (exceptions.ImportError: No 
module named defaults)

B) What is the expected output? What do you see instead (tracebacks, error
messages)?

{{{
2013-11-17 17:59:58+0100 [-] WSGI application error
    Traceback (most recent call last):
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/python/threadpool.py", line 212, in _worker
        o = self.q.get()
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
        return self.currentContext().callWithContext(ctx, func, *args, **kw)
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/python/context.py", line 83, in callWithContext
        self.contexts.pop()
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/web/wsgi.py", line 340, in run
        self.started = True
    --- <exception caught here> ---
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/web/wsgi.py", line 315, in run
        appIterator = self.application(self.environ, self.startResponse)
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 206, in __call__
        response = self.get_response(request)
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/core/handlers/base.py", line 196, in get_response
        response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/core/handlers/base.py", line 234, in handle_uncaught_exception
        if resolver.urlconf_module is None:
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/core/urlresolvers.py", line 341, in urlconf_module
        self._urlconf_module = import_module(self.urlconf_name)
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
        __import__(name)
      File "/home/lotekevennia/srv/evennia/src/web/urls.py", line 34, in <module>
        url(r'^', include('src.web.website.urls')),
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 26, in include
        urlconf_module = import_module(urlconf_module)
      File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
        __import__(name)
      File "/home/lotekevennia/srv/evennia/src/web/website/urls.py", line 6, in <module>
        from django.conf.urls.defaults import *
    exceptions.ImportError: No module named defaults

}}}

I think that a few Django versions back, the "urls.defaults" was deprecated... 
https://groups.google.com/forum/#!msg/django-users/fMeck5zJ_Ng/P_hP99szZxAJ

C) What version/revision of Evennia are you using? On what operating
system? Give as much information as possible to make it easier for
developers to recreate the problem.
 * python2.7.5
 * django 1.6
 * virtualenv

D) Please provide any additional information or suggestions below.

https://docs.djangoproject.com/en/1.6/topics/http/urls/

I chanched in the following files in src:
 * ./web/urls.py
 * ./web/news/urls.py
 * ./web/website/urls.py

the import from:
{{{
from django.conf.urls.defaults import *
}}}

to this
{{{
from django.conf.urls import patterns, url, include
}}}

Original issue reported on code.google.com by mar...@heavy.ch on 17 Nov 2013 at 7:37

GoogleCodeExporter commented 9 years ago
But after a deleting the db and recreating everything, I got this error 
message. So maybe the above modification are not that good :-(

Starting Evennia Portal in Daemon mode (output to portal logfile).
--------------------------------------------------
 Heavy Portal (Beta-rb3044472065c+) started.
  telnet: 28759
  webserver/client-127.0.0.1: 20057
--------------------------------------------------
 Resuming initial setup from step 1.
 Creating objects (Player #1 and Limbo room) ...
Unhandled Error
Traceback (most recent call last):
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/application/app.py", line 642, in run
    runApp(config)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/scripts/twistd.py", line 23, in runApp
    _SomeApplicationRunner(config).run()
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/application/app.py", line 376, in run
    self.application = self.createOrGetApplication()
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/application/app.py", line 441, in createOrGetApplication
    application = getApplication(self.config, passphrase)
--- <exception caught here> ---
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/application/app.py", line 452, in getApplication
    application = service.loadApplication(filename, style, passphrase)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/application/service.py", line 405, in loadApplication
    application = sob.loadValueFromFile(filename, 'application', passphrase)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/twisted/persisted/sob.py", line 210, in loadValueFromFile
    exec fileObj in d, d
  File "/home/lotekevennia/srv/evennia/src/server/server.py", line 311, in <module>
    EVENNIA = Evennia(application)
  File "/home/lotekevennia/srv/evennia/src/server/server.py", line 96, in __init__
    self.run_initial_setup()
  File "/home/lotekevennia/srv/evennia/src/server/server.py", line 183, in run_initial_setup
    initial_setup.handle_setup(int(last_initial_setup_step))
  File "/home/lotekevennia/srv/evennia/src/server/initial_setup.py", line 278, in handle_setup
    setup_func()
  File "/home/lotekevennia/srv/evennia/src/server/initial_setup.py", line 55, in create_objects
    god_player = create.create_player(god_user.username, None, None, user=god_user)
  File "/home/lotekevennia/srv/evennia/src/utils/create.py", line 481, in create_player
    new_db_player.save()
  File "/home/lotekevennia/srv/evennia/src/utils/idmapper/base.py", line 169, in save
    super(SharedMemoryModel, cls).save(*args, **kwargs)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/models/base.py", line 545, in save
    force_update=force_update, update_fields=update_fields)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/models/base.py", line 573, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/models/base.py", line 654, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/models/base.py", line 687, in _do_insert
    using=using, raw=raw)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/models/manager.py", line 232, in _insert
    return insert_query(self.model, objs, fields, **kwargs)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/models/query.py", line 1511, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 898, in execute_sql
    cursor.execute(sql, params)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
    return self.cursor.execute(sql, params)
  File "/home/lotekevennia/srv/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 450, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.IntegrityError: column user_id is not unique

Failed to load application: column user_id is not unique

Original comment by mar...@heavy.ch on 17 Nov 2013 at 8:36

GoogleCodeExporter commented 9 years ago
With django 1.5.5 everything works (e.g. pip install django==1.5.5).

Original comment by mar...@heavy.ch on 24 Nov 2013 at 10:24

GoogleCodeExporter commented 9 years ago
This should be resolved with r148830d7dbbe. Further errors should be handled in 
a new issue since the server is merged with the dev-version.
.
Griatch

Original comment by griatch on 28 Nov 2013 at 4:11