python manage.py runserver error

833 views
Skip to first unread message

Saranyoo Tiaakekalap

unread,
Jun 23, 2016, 6:30:18 AM6/23/16
to Django users
Guys - I am new to django , while running through tutorial . I found issue when first start running 'python manage.py runserver' . 


After I installed 'django' and create my first project using command 'django-admin startproject mysite' , then follow with 'python manage.py runserver' . 
I encounter error below . 
Can anyone please advise about this ? 

[root@jpetetis mysite]# python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x2b50668be500>
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/management/commands/runserver.py", line 117, in inner_run
    self.check_migrations()
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/management/commands/runserver.py", line 163, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/loader.py", line 49, in __init__
    self.build_graph()
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/loader.py", line 176, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/recorder.py", line 65, in applied_migrations
    self.ensure_schema()
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrations/recorder.py", line 56, in ensure_schema
    with self.connection.schema_editor() as editor:
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/backends/sqlite3/schema.py", line 25, in __enter__
    self._initial_pragma_fk = c.fetchone()[0]
TypeError: 'NoneType' object has no attribute '__getitem__'
[root@jpetetis mysite]#
[root@jpetetis mysite]# cd

Saranyoo Tiaakekalap

unread,
Jun 23, 2016, 9:57:14 PM6/23/16
to django...@googlegroups.com
Guys - I am new to django, need some advise .
I am trying to learn how to use django from official web, while I am running through step by step . 

Just the beginning of the first step while I try to start server I hit into issue .
There is no change in any python after start project . 
Appreciate all the advice . 

[root@jpetetis mysite]# python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
Unhandled exception in thread started by <function wrapper at 0x2b75ba622500>
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/utils/aut                            oreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/mana                            gement/commands/runserver.py", line 117, in inner_run
    self.check_migrations()
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/mana                            gement/commands/runserver.py", line 163, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat                            ions/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat                            ions/loader.py", line 49, in __init__
    self.build_graph()
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat                            ions/loader.py", line 176, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat                            ions/recorder.py", line 65, in applied_migrations
    self.ensure_schema()
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat                            ions/recorder.py", line 56, in ensure_schema
    with self.connection.schema_editor() as editor:
  File "/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/backen                            ds/sqlite3/schema.py", line 25, in __enter__

Gary Roach

unread,
Jun 24, 2016, 10:38:34 PM6/24/16
to django...@googlegroups.com
Hi Saranyoo

I noticed that you are using python 2.7 with django 1.9.7. I would check the django docs to see whether the two are compatible. You may want to switch to Python 3.5.. If you are in the manage.py directory when you fired off runserver it should have worked.

Gary R.
--
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 django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
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/CAF7bBPAP5cqVpqt824ub4kh76podidLKRZnxFrVKtHQzr4D%2BCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Luis Zárate

unread,
Jun 25, 2016, 12:02:40 AM6/25/16
to django...@googlegroups.com
Check running

python manage.py migrate

other thing, are you sure that you have a correct database setup?
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c44a8ff3-27a7-64f9-5ee2-a80d1001c03d%40verizon.net.

> For more options, visit https://groups.google.com/d/optout.
>

--
"La utopía sirve para caminar" Fernando Birri



ludovic coues

unread,
Jun 25, 2016, 5:49:23 AM6/25/16
to django...@googlegroups.com

Django 1.9.7 is compatible with python 2.
Django 1.11 is planned to be last version supporting python 2, the last version for django 1 and will be on long term support.

Only django 2 will drop support for python 2.

For the original question, the issue seems related to salute. The content of settings.python and the output of sqlite --version could help. The command might be named sqlite3

Reply all
Reply to author
Forward
0 new messages