On 2 December 2012 02:36, Chris Johnston <chrisjohns...@ubuntu.com> wrote:

> It has been tried on a debian system and fails to work there as well.
>

Was this a stable or unstable system? It works for me on Debian/stable
(Python 2.6) and Debian/unstable (Python 2.7).

What version of Ubuntu? I have also had it working on Ubuntu Precise.

What is suppose to happen, is on installation postinst
runs update-python-modules which should set up symlinks for your python
environment. Maybe this isn't working for some reason? i.e.

# ls -l /usr/lib/pymodules/python2.7/django_tables2/*.py
lrwxrwxrwx 1 root root 46 Dec  1 23:59
/usr/lib/pymodules/python2.7/django_tables2/__init__.py ->
/usr/share/pyshared/django_tables2/__init__.py
lrwxrwxrwx 1 root root 44 Dec  1 23:59
/usr/lib/pymodules/python2.7/django_tables2/config.py ->
/usr/share/pyshared/django_tables2/config.py
lrwxrwxrwx 1 root root 44 Dec  1 23:59
/usr/lib/pymodules/python2.7/django_tables2/models.py ->
/usr/share/pyshared/django_tables2/models.py
lrwxrwxrwx 1 root root 42 Dec  1 23:59
/usr/lib/pymodules/python2.7/django_tables2/rows.py ->
/usr/share/pyshared/django_tables2/rows.py
lrwxrwxrwx 1 root root 44 Dec  1 23:59
/usr/lib/pymodules/python2.7/django_tables2/tables.py ->
/usr/share/pyshared/django_tables2/tables.py
lrwxrwxrwx 1 root root 43 Dec  1 23:59
/usr/lib/pymodules/python2.7/django_tables2/utils.py ->
/usr/share/pyshared/django_tables2/utils.py
lrwxrwxrwx 1 root root 43 Dec  1 23:59
/usr/lib/pymodules/python2.7/django_tables2/views.py ->
/usr/share/pyshared/django_tables2/views.py

What happens if you run python manually and type in "import
django_tables2"? This is what I get, note the stack tries seems to indicate
it can find the components perfectly. I would expect if I had a Django app
on this machine (I don't), I could get it to work perfectly without the
Django error.

andean:/home/brian# python
Python 2.7.3 (default, Sep  9 2012, 17:41:34)
[GCC 4.7.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django_tables2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/django_tables2/__init__.py", line 3,
in <module>
    from .tables  import Table
  File "/usr/lib/pymodules/python2.7/django_tables2/tables.py", line 4, in
<module>
    from django.db.models.fields     import FieldDoesNotExist
  File "/usr/lib/python2.7/dist-packages/django/db/__init__.py", line 11,
in <module>
    if DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/usr/lib/python2.7/dist-packages/django/utils/functional.py", line
184, in inner
    self._setup()
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 40,
in _setup
    raise ImportError("Settings cannot be imported, because environment
variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.
>>>

-- 
Brian May <br...@microcomaustralia.com.au>

Reply via email to