Ask Your Question

Settings module is missing, how do I add it?

asked 2012-05-24 11:32:56 -0600

LordT's avatar

Hey there,

just tried to install askbot in a virtualenv environment on Ubuntu. I followed the documentation over in the docs and got to the point to do a ./bin/python syncdb after setting the db and everything. This brought up the following error message:

root@host:/srv/answers/askbot# ./bin/python syncdb
Traceback (most recent call last):
  File "", line 11, in <module>
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/core/management/", line 438, in execute_manager
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/core/management/", line 379, in execute
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/core/management/", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/core/management/", line 67, in load_command_class
    module = import_module('' % (app_name, name))
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/utils/", line 35, in import_module
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/core/management/commands/", line 7, in <module>
    from import custom_sql_for_model, emit_post_sync_signal
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/core/management/", line 6, in <module>
    from django.db import models
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/db/", line 14, in <module>
    if not settings.DATABASES:
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/utils/", line 276, in __getattr__
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/conf/", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/conf/", line 89, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'askbot.settings' (Is it on sys.path?): No module named settings

Short notice on my paths: I've got a virtualenv in /srv/answers/aksbot with askbot installed in /srv/answers/askbot as well. Hence, I run the command in the correct virtualenv, but looking at the bath, it seems like it's using the system django config in /usr/local/lib, which it shouldn't. Do I need to do anything else to get this to work?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-05-24 15:54:25 -0600

zaf's avatar

Hi. I would advise not to have your virtual environment in the same level as your sources. At least to me, it make things seem more complicated. It would be better if you have your virtualenv e.g. in /srv/answers/askbot and your project root in /srv/answers/askbot/myProject. This way, folder bin of your virtual env (with python etc.) will be outside your source files and it will be easier to realize which files are askbot's and which ones are of the virtual env.

Now to your problem. Are you sure you have run install and askbot-setup using the same python, like ./bin/python install and ./bin/askbot-setup? Also, in /srv/answers/askbot/ is there file If not, try to do your installation this way to see if there is any progress.


edit flag offensive delete link more


Thanks a lot for the quick answer, I've updated moved the project into a subdir. It worked now (not sure if it was your or Evgeny's comment that made it work)

LordT's avatar LordT  ( 2012-05-25 09:38:12 -0600 )edit

answered 2012-05-24 11:54:05 -0600

Evgeny's avatar

Hello, the parent directory /srv/answers must be in the path as well.

edit flag offensive delete link more


Thanks a lot, that together with zaf's comment did the trick. I must have screwed over my environment last night, but a new dir AND the correct setting did wonders. Thanks for the awesome support.

LordT's avatar LordT  ( 2012-05-25 09:39:05 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-05-24 11:32:56 -0600

Seen: 2,340 times

Last updated: May 24 '12