Re: Totally Lost on "python manage.py runserver"

2017-04-18 Thread Scot Hacker
`pip install pysqlite2` ? 

./s

On Friday, April 14, 2017 at 5:07:06 AM UTC-7, Michael Durkin wrote:
>
> I am at a loss. My Google-Fu seems to be sub-par as I cannot find an 
> answer to what I'm looking for. 
>
> I am running Ubuntu, using Python 3.6.0 (pyenv handles different Python 
> versions for me), have installed SQLite and Apache and ran "pip install 
> django" to get Django on my machine. 
>
> I have run through the Django tutorial on installation (
> https://docs.djangoproject.com/en/1.11/topics/install/#installing-official-release)
>  
> and made it all the way to "python manage.py runserver". After running that 
> line I get the following message through the shell that I simply do not 
> understand:
>
> ~/Scripts/Django_Practice/mysite$ python manage.py runserver
> Unhandled exception in thread started by  check_errors..wrapper at 0x7f0e6c4ce730>
> Traceback (most recent call last):
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py",
>  
> line 31, in 
> from pysqlite2 import dbapi2 as Database
> ModuleNotFoundError: No module named 'pysqlite2'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py",
>  
> line 33, in 
> from sqlite3 import dbapi2 as Database
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/sqlite3/__init__.py", 
> line 23, in 
> from sqlite3.dbapi2 import *
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/sqlite3/dbapi2.py", line 
> 27, in 
> from _sqlite3 import *
> ModuleNotFoundError: No module named '_sqlite3'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/autoreload.py",
>  
> line 227, in wrapper
> fn(*args, **kwargs)
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/core/management/commands/runserver.py",
>  
> line 117, in inner_run
> autoreload.raise_last_exception()
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/autoreload.py",
>  
> line 250, in raise_last_exception
> six.reraise(*_exception)
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/six.py",
>  
> line 685, in reraise
> raise value.with_traceback(tb)
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/autoreload.py",
>  
> line 227, in wrapper
> fn(*args, **kwargs)
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/__init__.py",
>  
> line 27, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/apps/registry.py",
>  
> line 108, in populate
> app_config.import_models()
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/apps/config.py",
>  
> line 202, in import_models
> self.models_module = import_module(models_module_name)
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/importlib/__init__.py", 
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 978, in _gcd_import
>   File "", line 961, in _find_and_load
>   File "", line 950, in 
> _find_and_load_unlocked
>   File "", line 655, in _load_unlocked
>   File "", line 678, in exec_module
>   File "", line 205, in 
> _call_with_frames_removed
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/contrib/auth/models.py",
>  
> line 4, in 
> from django.contrib.auth.base_user import AbstractBaseUser, 
> BaseUserManager
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/contrib/auth/base_user.py",
>  
> line 52, in 
> class AbstractBaseUser(models.Model):
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/models/base.py",
>  
> line 124, in __new__
> new_class.add_to_class('_meta', Options(meta, app_label))
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/models/base.py",
>  
> line 330, in add_to_class
> value.contribute_to_class(cls, name)
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/models/options.py",
>  
> line 214, in contribute_to_class
> self.db_table = truncate_name(self.db_table, 
> connection.ops.max_name_length())
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/__init__.py",
>  
> line 33, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File 
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/utils.py",
>  
> line 211, in __getitem__
> backend = 

Re: Totally Lost on "python manage.py runserver"

2017-04-14 Thread ludovic coues
Have you tried "sudo apt-get install sqlite" ?
The package might be called sqlite3 or sqlite-dev or something like that

2017-04-14 6:16 GMT+02:00 Michael Durkin :
> I am at a loss. My Google-Fu seems to be sub-par as I cannot find an answer
> to what I'm looking for.
>
> I am running Ubuntu, using Python 3.6.0 (pyenv handles different Python
> versions for me), have installed SQLite and Apache and ran "pip install
> django" to get Django on my machine.
>
> I have run through the Django tutorial on installation
> (https://docs.djangoproject.com/en/1.11/topics/install/#installing-official-release)
> and made it all the way to "python manage.py runserver". After running that
> line I get the following message through the shell that I simply do not
> understand:
>
> ~/Scripts/Django_Practice/mysite$ python manage.py runserver
> Unhandled exception in thread started by  check_errors..wrapper at 0x7f0e6c4ce730>
> Traceback (most recent call last):
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py",
> line 31, in 
> from pysqlite2 import dbapi2 as Database
> ModuleNotFoundError: No module named 'pysqlite2'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py",
> line 33, in 
> from sqlite3 import dbapi2 as Database
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/sqlite3/__init__.py", line
> 23, in 
> from sqlite3.dbapi2 import *
>   File "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/sqlite3/dbapi2.py",
> line 27, in 
> from _sqlite3 import *
> ModuleNotFoundError: No module named '_sqlite3'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/autoreload.py",
> line 227, in wrapper
> fn(*args, **kwargs)
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/core/management/commands/runserver.py",
> line 117, in inner_run
> autoreload.raise_last_exception()
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/autoreload.py",
> line 250, in raise_last_exception
> six.reraise(*_exception)
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/six.py",
> line 685, in reraise
> raise value.with_traceback(tb)
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/autoreload.py",
> line 227, in wrapper
> fn(*args, **kwargs)
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/__init__.py",
> line 27, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/apps/registry.py",
> line 108, in populate
> app_config.import_models()
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/apps/config.py",
> line 202, in import_models
> self.models_module = import_module(models_module_name)
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/importlib/__init__.py",
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 978, in _gcd_import
>   File "", line 961, in _find_and_load
>   File "", line 950, in _find_and_load_unlocked
>   File "", line 655, in _load_unlocked
>   File "", line 678, in exec_module
>   File "", line 205, in
> _call_with_frames_removed
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/contrib/auth/models.py",
> line 4, in 
> from django.contrib.auth.base_user import AbstractBaseUser,
> BaseUserManager
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/contrib/auth/base_user.py",
> line 52, in 
> class AbstractBaseUser(models.Model):
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/models/base.py",
> line 124, in __new__
> new_class.add_to_class('_meta', Options(meta, app_label))
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/models/base.py",
> line 330, in add_to_class
> value.contribute_to_class(cls, name)
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/models/options.py",
> line 214, in contribute_to_class
> self.db_table = truncate_name(self.db_table,
> connection.ops.max_name_length())
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/__init__.py",
> line 33, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File
> "/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/utils.py",
> line 211, in __getitem__
> backend = load_backend(db['ENGINE'])
>   File
> 

Totally Lost on "python manage.py runserver"

2017-04-14 Thread Michael Durkin
I am at a loss. My Google-Fu seems to be sub-par as I cannot find an answer 
to what I'm looking for. 

I am running Ubuntu, using Python 3.6.0 (pyenv handles different Python 
versions for me), have installed SQLite and Apache and ran "pip install 
django" to get Django on my machine. 

I have run through the Django tutorial on installation 
(https://docs.djangoproject.com/en/1.11/topics/install/#installing-official-release)
 
and made it all the way to "python manage.py runserver". After running that 
line I get the following message through the shell that I simply do not 
understand:

~/Scripts/Django_Practice/mysite$ python manage.py runserver
Unhandled exception in thread started by .wrapper at 0x7f0e6c4ce730>
Traceback (most recent call last):
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py",
 
line 31, in 
from pysqlite2 import dbapi2 as Database
ModuleNotFoundError: No module named 'pysqlite2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py",
 
line 33, in 
from sqlite3 import dbapi2 as Database
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/sqlite3/__init__.py", 
line 23, in 
from sqlite3.dbapi2 import *
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/sqlite3/dbapi2.py", line 
27, in 
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/autoreload.py",
 
line 227, in wrapper
fn(*args, **kwargs)
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/core/management/commands/runserver.py",
 
line 117, in inner_run
autoreload.raise_last_exception()
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/autoreload.py",
 
line 250, in raise_last_exception
six.reraise(*_exception)
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/six.py",
 
line 685, in reraise
raise value.with_traceback(tb)
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/utils/autoreload.py",
 
line 227, in wrapper
fn(*args, **kwargs)
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/__init__.py",
 
line 27, in setup
apps.populate(settings.INSTALLED_APPS)
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/apps/registry.py",
 
line 108, in populate
app_config.import_models()
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/apps/config.py",
 
line 202, in import_models
self.models_module = import_module(models_module_name)
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/importlib/__init__.py", 
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 978, in _gcd_import
  File "", line 961, in _find_and_load
  File "", line 950, in _find_and_load_unlocked
  File "", line 655, in _load_unlocked
  File "", line 678, in exec_module
  File "", line 205, in 
_call_with_frames_removed
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/contrib/auth/models.py",
 
line 4, in 
from django.contrib.auth.base_user import AbstractBaseUser, 
BaseUserManager
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/contrib/auth/base_user.py",
 
line 52, in 
class AbstractBaseUser(models.Model):
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/models/base.py",
 
line 124, in __new__
new_class.add_to_class('_meta', Options(meta, app_label))
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/models/base.py",
 
line 330, in add_to_class
value.contribute_to_class(cls, name)
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/models/options.py",
 
line 214, in contribute_to_class
self.db_table = truncate_name(self.db_table, 
connection.ops.max_name_length())
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/__init__.py",
 
line 33, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/utils.py",
 
line 211, in __getitem__
backend = load_backend(db['ENGINE'])
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/site-packages/django/db/utils.py",
 
line 115, in load_backend
return import_module('%s.base' % backend_name)
  File 
"/home/durkin/.pyenv/versions/3.6.0/lib/python3.6/importlib/__init__.py", 
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File