python - Django 1.9 + Photologue: no such column -
i using django 1.9+ photologue 3.x build photo gallery web app.
when trying add photo or gallery, returns 'no such column exception'
request method: request url: http://127.0.0.1:8000/admin/photologue/gallery/ django version: 1.9.5 exception type: operationalerror exception value: no such column: photologue_gallery.slug exception location: //anaconda/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 323 python executable: //anaconda/bin/python python version: 2.7.12
then have checked model file , view file.
in model.py
@python_2_unicode_compatible class gallery(models.model): date_added = models.datetimefield(_('date published'), default=now) title = models.charfield(_('title'), max_length=250, unique=true) slug = models.slugfield(_('title slug'), unique=true, max_length=250, help_text=_('a "slug" unique url-friendly title object.')) description = models.textfield(_('description'), blank=true) is_public = models.booleanfield(_('is public'), default=true, help_text=_('public galleries displayed ' 'in default views.')) photos = sortedmanytomanyfield('photologue.photo', related_name='galleries', verbose_name=_('photos'), blank=true) sites = models.manytomanyfield(site, verbose_name=_(u'sites'), blank=true) objects = galleryqueryset.as_manager()
it seems right. since django 1.9, no more syncdb
or clear sql methods
available. , tried migrate/makemigrations, sqlmigrates , none of them works.
my idea rebuild sql table how achieve this, or other approaches solve issue?
thank you.
edit1: tried flush
command flush data in db, still not working.
edit2: tried inspectdb
command, got
class photologuegallery(models.model): id = models.integerfield(primary_key=true) # autofield? date_added = models.datetimefield() title = models.charfield(unique=true, max_length=100) title_slug = models.charfield(unique=true, max_length=50) description = models.textfield() is_public = models.booleanfield() tags = models.charfield(max_length=255) class meta: managed = false db_table = 'photologue_gallery'
does mean 'slug' field in model doesn't match actual field 'title_slug' in database?
although syncdb
command has removed django 1.9
there python manage.py migrate appname --run-syncdb
command.
which sync model database.
Comments
Post a Comment