You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running django-vellum==1.4.2 (installed with pip) on both Django 1.4 and Django 1.5.
When I want to syncdb (or run any other manage.py command) from a clean install (empty database), I get an error message:
(mysite) /tmp/mysite/code $ python manage.py syncdb
DatabaseError: no such table: django_site
(mysite) /tmp/mysite/code $
This is on Django Django 1.5.4, but on Django 1.4.1 I get the full stack trace:
(mysite) /tmp/mysite/code $ python manage.py test vellum
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/tmp/mysite/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/tmp/mysite/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/tmp/mysite/lib/python2.7/site-packages/django/core/management/commands/test.py", line 49, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/tmp/mysite/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/tmp/mysite/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/tmp/mysite/lib/python2.7/site-packages/django/core/management/commands/test.py", line 72, in handle
failures = test_runner.run_tests(test_labels)
File "/tmp/mysite/lib/python2.7/site-packages/django/test/simple.py", line 380, in run_tests
suite = self.build_suite(test_labels, extra_tests)
File "/tmp/mysite/lib/python2.7/site-packages/django/test/simple.py", line 263, in build_suite
app = get_app(label)
File "/tmp/mysite/lib/python2.7/site-packages/django/db/models/loading.py", line 140, in get_app
self._populate()
File "/tmp/mysite/lib/python2.7/site-packages/django/db/models/loading.py", line 64, in _populate
self.load_app(app_name, True)
File "/tmp/mysite/lib/python2.7/site-packages/django/db/models/loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "/tmp/mysite/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/tmp/mysite/lib/python2.7/site-packages/vellum/models.py", line 15, in <module>
from vellum import settings
File "/tmp/mysite/lib/python2.7/site-packages/vellum/settings.py", line 10, in <module>
BLOG_NAME = getattr(settings, 'BLOG_NAME', Site.objects.get_current().name)
File "/tmp/mysite/lib/python2.7/site-packages/django/contrib/sites/models.py", line 25, in get_current
current_site = self.get(pk=sid)
File "/tmp/mysite/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
return self.get_query_set().get(*args, **kwargs)
File "/tmp/mysite/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
num = len(clone)
File "/tmp/mysite/lib/python2.7/site-packages/django/db/models/query.py", line 85, in __len__
self._result_cache = list(self.iterator())
File "/tmp/mysite/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator
for row in compiler.results_iter():
File "/tmp/mysite/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
for rows in self.execute_sql(MULTI):
File "/tmp/mysite/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
cursor.execute(sql, params)
File "/tmp/mysite/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 337, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: no such table: django_site
(mysite) /tmp/mysite/code $
The funny thing is that I get this message even with the BLOG_NAME setting setup. So it means the default value of the expression getattr(settings, 'BLOG_NAME', Site.objects.get_current().name) allways gets evaluated :S
Replacing the getattr by a try/except (ValueError) clause should solve the issue.
The text was updated successfully, but these errors were encountered:
I'm running django-vellum==1.4.2 (installed with pip) on both Django 1.4 and Django 1.5.
When I want to syncdb (or run any other manage.py command) from a clean install (empty database), I get an error message:
This is on Django Django 1.5.4, but on Django 1.4.1 I get the full stack trace:
The funny thing is that I get this message even with the BLOG_NAME setting setup. So it means the default value of the expression
getattr(settings, 'BLOG_NAME', Site.objects.get_current().name)
allways gets evaluated :SReplacing the getattr by a try/except (ValueError) clause should solve the issue.
The text was updated successfully, but these errors were encountered: