python - Django Polls App: OperationalError: attempt to write a read only database -
i going through tutorial on django website. got error while trying create choice object.
>>> q.choice_set.create(choice_text='not much', votes=0) traceback (most recent call last): file "<console>", line 1, in <module> file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/fields/related.py", line 714, in create return super(relatedmanager, self.db_manager(db)).create(**kwargs) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/manager.py", line 92, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/query.py", line 372, in create obj.save(force_insert=true, using=self.db) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/base.py", line 589, in save force_update=force_update, update_fields=update_fields) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/base.py", line 617, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/base.py", line 698, in _save_table result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/base.py", line 731, in _do_insert using=using, raw=raw) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/manager.py", line 92, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/query.py", line 921, in _insert return query.get_compiler(using=using).execute_sql(return_id) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/models/sql/compiler.py", line 921, in execute_sql cursor.execute(sql, params) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/backends/utils.py", line 81, in execute return super(cursordebugwrapper, self).execute(sql, params) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/backends/utils.py", line 65, in execute return self.cursor.execute(sql, params) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/utils.py", line 94, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/backends/utils.py", line 65, in execute return self.cursor.execute(sql, params) file "/library/python/2.7/site-packages/django-1.7.8-py2.7.egg/django/db/backends/sqlite3/base.py", line 485, in execute return database.cursor.execute(self, query, params) operationalerror: attempt write readonly database >>>
i dont understand seems problem. tried changing permissions "db.sqlite3" file 777.
thank in advance.
you have change permissions directory database file in too.
Comments
Post a Comment