CommCareHQ 1.0 syncdb problem

Hi,

I get this when I run syncdb,

$ sudo python manage.py syncdb

Traceback (most recent call last):
File "manage.py", line 60, in
execute_manager(settings)
File
"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",
line 438, in execute_manager
utility.execute()
File
"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",
line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",
line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File
"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",
line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py",
line 35, in import_module
import(name)
File
"/usr/local/lib/python2.6/dist-packages/south/management/commands/init.py",
line 10, in
import django.template.loaders.app_directories
File
"/usr/local/lib/python2.6/dist-packages/django/template/loaders/app_directories.py",
line 23, in
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError
django.contrib.admin: cannot import name InvalidQuery

And again, couchdb is a requirement. README is insufficient. Can anybody
give any clue? I need to run CommCareHQ 1.0 on my localserver.

I'm attaching my settings.py and localsettings.py here. I tried with
local.ini setting. It at least ran syncdb with 0.9 version . But 1.0 gives
the above output. Unfortunately, there is no documentation on setting this
up.

localsettings.py (1.37 KB)

settings.py (11.2 KB)

··· -- Sincerely, Sazzad Bin Kamal

Hi Sazzad,

I have followed the README[1] successfully before (though it was
several months back) and been able to get cchq running locally. Can
you confirm that the first 5 steps went successfully? Specifically,
did everything install when you ran:

pip install -r requirements.txt

Your error ("ImportError django.contrib.admin") suggests that there is
something fishy with your django install.

Are you installing this on ubuntu? OS X? Are you using virtualenv[2]?
If not, I recommend using it so that you can ensure that the packages
you install for cchq are correct. The link should have more
information.

Brian

[1] https://github.com/dimagi/commcare-hq/blob/master/README.txt
[2] virtualenv

··· On Tue, Nov 1, 2011 at 5:21 AM, Sazzad wrote: > Hi, > I get this when I run syncdb, >> >> $ sudo python manage.py syncdb >> Traceback (most recent call last): >> File "manage.py", line 60, in >> execute_manager(settings) >> File >> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", >> line 438, in execute_manager >> utility.execute() >> File >> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", >> line 379, in execute >> self.fetch_command(subcommand).run_from_argv(self.argv) >> File >> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", >> line 261, in fetch_command >> klass = load_command_class(app_name, subcommand) >> File >> "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", >> line 67, in load_command_class >> module = import_module('%s.management.commands.%s' % (app_name, name)) >> File "/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py", >> line 35, in import_module >> __import__(name) >> File >> "/usr/local/lib/python2.6/dist-packages/south/management/commands/__init__.py", >> line 10, in >> import django.template.loaders.app_directories >> File >> "/usr/local/lib/python2.6/dist-packages/django/template/loaders/app_directories.py", >> line 23, in >> raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0])) >> django.core.exceptions.ImproperlyConfigured: ImportError >> django.contrib.admin: cannot import name InvalidQuery > > And again, couchdb is a requirement. README is insufficient. Can anybody > give any clue? I need to run CommCareHQ 1.0 on my localserver. > I'm attaching my settings.py and localsettings.py here. I tried with > local.ini setting. It at least ran syncdb with 0.9 version . But 1.0 gives > the above output. Unfortunately, there is no documentation on setting this > up. > -- > Sincerely, > Sazzad Bin Kamal > >

Hey Brian, thanks for chipping in! Your comments are spot on.

And sorry to the commcare-users list. I replied to Sazzad offline, and
forgot to cc everyone.

··· On Wed, Nov 2, 2011 at 8:38 AM, Brian DeRenzi wrote:

Hi Sazzad,

I have followed the README[1] successfully before (though it was
several months back) and been able to get cchq running locally. Can
you confirm that the first 5 steps went successfully? Specifically,
did everything install when you ran:

pip install -r requirements.txt

Your error ("ImportError django.contrib.admin") suggests that there is
something fishy with your django install.

Are you installing this on ubuntu? OS X? Are you using virtualenv[2]?
If not, I recommend using it so that you can ensure that the packages
you install for cchq are correct. The link should have more
information.

Brian

[1] https://github.com/dimagi/commcare-hq/blob/master/README.txt
[2] virtualenv

On Tue, Nov 1, 2011 at 5:21 AM, Sazzad sazzadbinkamal@gmail.com wrote:

Hi,
I get this when I run syncdb,

$ sudo python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 60, in
execute_manager(settings)
File

"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",

line 438, in execute_manager
utility.execute()
File

"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",

line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File

"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",

line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File

"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",

line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name,
name))
File
"/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py",
line 35, in import_module
import(name)
File

"/usr/local/lib/python2.6/dist-packages/south/management/commands/init.py",

line 10, in
import django.template.loaders.app_directories
File

"/usr/local/lib/python2.6/dist-packages/django/template/loaders/app_directories.py",

line 23, in
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError
django.contrib.admin: cannot import name InvalidQuery

And again, couchdb is a requirement. README is insufficient. Can anybody
give any clue? I need to run CommCareHQ 1.0 on my localserver.
I'm attaching my settings.py and localsettings.py here. I tried with
local.ini setting. It at least ran syncdb with 0.9 version . But 1.0
gives
the above output. Unfortunately, there is no documentation on setting
this
up.

Sincerely,
Sazzad Bin Kamal

Hi Brian,

Thanks for your reply. I've been able to successfully syncdb and run cchq
0.9 version. I hope I'd be able to run 1.0 instance too. I'll test it at
the pass time.

As for record, Any Django version except 2.7.5 didn't work with cchq 0.9.
I've followed the readme file that you have referred but it wasn't of any
help. The main ambiguity arises when any Django user tries to find and use
the 'settings.py' file. I got bunch of distracting files, settings.py,
localsettings.py, after git cloning. Also, following the wiki, I downloaded
local.ini file but wasn't sure what's its role. Apparently, it wasn't
taking database settings.

However, I want to explicitly mention here, for future reference, the steps
I successfully followed,

Provided that a user has all the prerequisites installed,

  1. Get a cchq 0.9/1.0 app from git. DO NOT CLONE. In my case I downloaded
    it using git's web interface.
  2. Get rapidsms old version.
  3. Untar both and put rapidsms inside cchq.
  4. Make sure you've Django 2.7.5 version.
  5. syncdb

Also all new users should note, that cchq doesn't use settings.py. Instead,
rapidsms.ini file is used where all settings.py parameters are set. You can
think this ini file as though it was settings.py. Comments in that file
were of big help too.

Enjoy :smiley:

By the way, I'm using Ubuntu, and as it is a horrible OS for developers,
I've given up the dream of using virtualenv. I worked with it on Fedora. It
was superb. But, Ubuntu, along with debian, has changed python installed
path, as such 'dist-packages' not 'site-packages' is used. virtualenv
shamelessly fails.

··· On Wed, Nov 2, 2011 at 10:40 PM, Rowena Luk wrote:

Hey Brian, thanks for chipping in! Your comments are spot on.

And sorry to the commcare-users list. I replied to Sazzad offline, and
forgot to cc everyone.

On Wed, Nov 2, 2011 at 8:38 AM, Brian DeRenzi bderenzi@gmail.com wrote:

Hi Sazzad,

I have followed the README[1] successfully before (though it was
several months back) and been able to get cchq running locally. Can
you confirm that the first 5 steps went successfully? Specifically,
did everything install when you ran:

pip install -r requirements.txt

Your error ("ImportError django.contrib.admin") suggests that there is
something fishy with your django install.

Are you installing this on ubuntu? OS X? Are you using virtualenv[2]?
If not, I recommend using it so that you can ensure that the packages
you install for cchq are correct. The link should have more
information.

Brian

[1] https://github.com/dimagi/commcare-hq/blob/master/README.txt
[2] virtualenv

On Tue, Nov 1, 2011 at 5:21 AM, Sazzad sazzadbinkamal@gmail.com wrote:

Hi,
I get this when I run syncdb,

$ sudo python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 60, in
execute_manager(settings)
File

"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",

line 438, in execute_manager
utility.execute()
File

"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",

line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File

"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",

line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File

"/usr/local/lib/python2.6/dist-packages/django/core/management/init.py",

line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name,
name))
File
"/usr/local/lib/python2.6/dist-packages/django/utils/importlib.py",
line 35, in import_module
import(name)
File

"/usr/local/lib/python2.6/dist-packages/south/management/commands/init.py",

line 10, in
import django.template.loaders.app_directories
File

"/usr/local/lib/python2.6/dist-packages/django/template/loaders/app_directories.py",

line 23, in
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError
django.contrib.admin: cannot import name InvalidQuery

And again, couchdb is a requirement. README is insufficient. Can anybody
give any clue? I need to run CommCareHQ 1.0 on my localserver.
I'm attaching my settings.py and localsettings.py here. I tried with
local.ini setting. It at least ran syncdb with 0.9 version . But 1.0
gives
the above output. Unfortunately, there is no documentation on setting
this
up.

Sincerely,
Sazzad Bin Kamal

--
Sincerely,
Sazzad Bin Kamal