django-categories
django-categories copied to clipboard
sid is none when I try to migrate
Every time I try migrate for my project django==1.8.6 django-mptt==0.7.4
and I got this error log
Traceback (most recent call last):
File "/Users/hasanabuzayed/Documents/Development/workspace-jee/mix-express/manage.py", line 17, in
I got this too when attempting initial migration of the example project on Django 1.8.11.
On Django 1.9.4 it dies even earlier with:
django.db.utils.OperationalError: no such table: django_content_type
This leads me to wonder under what circumstances does the example project actually work?
What version of django-categories are you using? Is "categories" in your INSTALLED_APPS?
I was using the current HEAD at the time, which was 7f27053.
The settings file was the one from the example project, and it looks like "categories" is indeed in INSTALLED_APPS in the example settings.
Basically what I did was:
- git clone
- create virtual env
pip install -r requirements.txtcd example./manage.py migrate
@rantecki, very interesting. I'll have to try that out. We probably need to add a test to catch this, because right now all tests are passing.
I added pull request #114, this is my "scratch pad" for trying to fix this issue. It basically makes migrate work in the example app, however like the PR says, "the admin will have some bugs because of my change in categories/genericcollection.py and none of the tables needed for the Django flatpages app and the Example simpletext app will have been created.
If you undo the changes in categories/genericcollection.py, you'll get a sqlite3.OperationalError: no such table: django_content_type error.
If you undo the changes in categories/migration.py, you'll get the AttributeError: 'NoneType' object has no attribute 'startswith' error again.
I've run out of time tonight to work on this, so if anyone else has some solutions, please feel free to offer them up. :) I'm not sure when I'll have time to work on this again for awhile. :)
Did some more work this morning. Got it working in PR #114. However the fix in categories/genericcollection.py feels like a hack. It would be nice to find a better solution. It also should be noted that while the admin loads there still seems to be some bugs. I've never used the example site before so I'm not sure how it was suppose to work. Also the admin has changes a lot in Django 1.9 so I don't know which bugs may or may not have been caused by Django 1.9.