First time here? Check out the FAQ!
0

No module named askbot_stm.urls

I just tried to put my askbot site online, but I get the following error :

Environment:


Request Method: GET
Request URL: ___

Django Version: 1.3
Python Version: 2.6.4
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.humanize',
 'django.contrib.sitemaps',
 'askbot',
 'askbot.deps.django_authopenid',
 'south',
 'askbot.deps.livesettings',
 'keyedcache',
 'robots',
 'django_countries',
 'djcelery',
 'djkombu']
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'askbot.middleware.anon_user.ConnectToSessionMessagesMiddleware',
 'askbot.middleware.pagesize.QuestionsPageSizeMiddleware',
 'askbot.middleware.cancel.CancelActionMiddleware',
 'askbot.deps.recaptcha_django.middleware.ReCaptchaMiddleware',
 'django.middleware.transaction.TransactionMiddleware',
 'askbot.middleware.view_log.ViewLogMiddleware',
 'askbot.middleware.spaceless.SpacelessMiddleware')


Traceback:
File "/opt/python2.6/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
  101.                             request.path_info)
File "/opt/python2.6/lib/python2.6/site-packages/django/core/urlresolvers.py" in resolve
  250.             for pattern in self.url_patterns:
File "/opt/python2.6/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_url_patterns
  279.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/opt/python2.6/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_urlconf_module
  274.             self._urlconf_module = import_module(self.urlconf_name)
File "/opt/python2.6/lib/python2.6/site-packages/django/utils/importlib.py" in import_module
  35.     __import__(name)

Exception Type: ImportError at /
Exception Value: No module named askbot_stm.urls

askbot_stm in my project name, and there is definitely a file names urls.py in the root folder. Does anyone have an idea on how to solve this ?

Thank you !

anonymous user
asked 2011-05-24 12:17:31 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

Hi, it's either because you do not have __init__.py (even empty) in the askbot_stm directory, or this directory is not on the python system path.

There is an environment variable that you can use, called PYTHONPATH.

PYTHONPATH=/path/to_dir_above_askbot_stm
export PYTHONPATH
Evgeny's avatar
13.2k
Evgeny
updated 2011-05-24 14:23:54 -0600, answered 2011-05-24 12:43:36 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

The __init__.py file is there.

And I just wrote the two commands you gave me in a terminal, but I still have the error. Or should I put them in a file ?

Thank you for your help !

AlexP's avatar
23
AlexP
answered 2011-05-24 13:23:35 -0600
edit flag offensive 0 remove flag delete link

Comments

Sorry, try directory that is one level above the askbot_stm in the command.
Evgeny's avatar Evgeny (2011-05-24 13:26:51 -0600) edit
It gives me the same result. But I juste notice that my wsgi was not the same as the one in the documentation. So I replace it, and now it work perfectly ! My bad ... I'm sorry for wasting your time. And thank you for your help !
AlexP's avatar AlexP (2011-05-24 13:37:43 -0600) edit
It gives me the same result.
AlexP's avatar AlexP (2011-05-24 13:37:45 -0600) edit
add a comment see more comments