Django Tutorial | sqlmigrate command ending in error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Django Tutorial | sqlmigrate command ending in error

Nikhil Reddy
Hi,

I am going through this tutorial. 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 [hidden email].
To post to this group, send email to [hidden email].
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 | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Django Tutorial | sqlmigrate command ending in error

Nikhil Reddy
Can anyone kindly help me on this issue?

Thanks,
Nikhil

On Friday, 21 April 2017 18:40:43 UTC+5:30, Nikhil Reddy wrote:
Hi,

I am going through this <a href="https://docs.djangoproject.com/en/1.11/intro/tutorial02/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.11%2Fintro%2Ftutorial02%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_JnQ7ot-gxSRVTluTuqgrHliXVQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.11%2Fintro%2Ftutorial02%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_JnQ7ot-gxSRVTluTuqgrHliXVQ&#39;;return true;">tutorial. 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 [hidden email].
To post to this group, send email to [hidden email].
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/c2854687-dced-4527-90e9-2c0de618b92e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Django Tutorial | sqlmigrate command ending in error

Daniel Roseman-2
You haven't given nearly enough information to help you. You need at least to post the contents of your polls/migrations/0001_initial.py, and your DATABASES settings.
--
DR.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/1bf9059a-082f-4dcd-8f15-816ee598b9e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Django Tutorial | sqlmigrate command ending in error

Dilraj sachdev
In reply to this post by Nikhil Reddy

By this limited information, just guessing could be a problem with path of sqlite db file

D

On Friday, 21 April 2017 14:10:43 UTC+1, Nikhil Reddy wrote:
Hi,

I am going through this <a href="https://docs.djangoproject.com/en/1.11/intro/tutorial02/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.11%2Fintro%2Ftutorial02%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_JnQ7ot-gxSRVTluTuqgrHliXVQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.11%2Fintro%2Ftutorial02%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_JnQ7ot-gxSRVTluTuqgrHliXVQ&#39;;return true;">tutorial. 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 [hidden email].
To post to this group, send email to [hidden email].
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/119c18a1-4a14-4a5c-8a1c-0813cc874ccb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Django Tutorial | sqlmigrate command ending in error

Nikhil Reddy
In reply to this post by Daniel Roseman-2
Ok..Sorry about that. 

I haven't done any modifications to  polls/migrations/0001_initial.py or settings files that got created by default.  I've attached both files.
Please review.

Thanks,
NJ

On Sunday, 30 April 2017 19:30:28 UTC+5:30, Daniel Roseman wrote:
You haven't given nearly enough information to help you. You need at least to post the contents of your polls/migrations/0001_initial.py, and your DATABASES settings.
--
DR.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/6005d7e0-9c5a-46d2-a90f-9dab05dfe0e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

0001_initial.py (1K) Download Attachment
settings.py (3K) Download Attachment
Loading...