Hi,

I am going through this tutorial 
<https://docs.djangoproject.com/en/1.11/intro/tutorial02/>. When I execute the 
command: "python manage.py sqlmigrate polls 0001" it is ending in below error.

Please help resolve the issue.


*Error:*

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File 
"/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 363, in execute_from_command_line
    utility.execute()
  File 
"/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 355, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/base.py",
 line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File 
"/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/commands/sqlmigrate.py",
 line 33, in execute
    return super(Command, self).execute(*args, **options)
  File 
"/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/base.py",
 line 330, in execute
    output = self.handle(*args, **options)
  File 
"/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/core/management/commands/sqlmigrate.py",
 line 62, in handle
    sql_statements = executor.collect_sql(plan)
  File 
"/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/db/migrations/executor.py",
 line 219, in collect_sql
    with self.connection.schema_editor(collect_sql=True, 
atomic=migration.atomic) as schema_editor:
  File 
"/scratch/njakkula/NJ/py_Oracle/bugdb/triage/lib/python2.7/site-packages/django/db/backends/sqlite3/schema.py",
 line 25, in __enter__
    self._initial_pragma_fk = c.fetchone()[0]
TypeError: 'NoneType' object has no attribute '__getitem__'


*Versions:*

Python 2.7.13

Django 1.11

sqlite3 2.6.0

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/44cec79a-cc05-40bb-9a17-dd6fe454aea8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to