-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syncdb seems to break #1
Comments
So I've done a little more investigating. I got the code in there, but am seeing nothing at http://127.0.0.1:8000/.wellknown/host-meta/ |
oh dur. |
Add For the second problem, what's that code supposed to do? From what I can see, it registers resources that are in the database at the time that I think you could just safely delete those two lines. |
There are issues with attempting to save to the database before the tables are created. I have a fork that avoids the issue - it has a signal that's sent in the view, so none of the initialization code is called unless a well-known url is requested. It completely avoids this issue. |
to reproduce I start with no db in my django app.
I have wellknown as an app directory.
I add wellkown to my settings.py installed_apps
I add wellkown urls.py to my main urls.py
I run python manage.py syncdb
I get an error:
django.db.utils.DatabaseError: no such table: django_site
the stack includes:
File "/home/mattkatz/Projects/django-federation/wellknown/models.py", line 11, in
wellknown.register('host-meta', handler=HostMeta(), content_type='application/xrd+xml')
File "/home/mattkatz/Projects/django-federation/wellknown/resources.py", line 16, in init
hosts = getattr(settings, "WELLKNOWN_HOSTMETA_HOSTS", (Site.objects.get_current().domain,))
commenting out
from resources import HostMeta
register('host-meta', handler=HostMeta(), content_type='application/xrd+xml')
fixes this error
commenting out
for res in Resource.objects.all():
wellknown.register(res.path, content=res.content, content_type=res.content_type)
fixes the following error when running syncdb:
django.db.utils.DatabaseError: no such table: wellknown_resource
django 1.2 python 2.6
The text was updated successfully, but these errors were encountered: