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 !

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
anonymous user
asked 13 years ago

Comments

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 13 years ago, answered 13 years ago
link

Comments

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 !

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
AlexP's avatar
23
AlexP
answered 13 years ago
link

Comments

Sorry, try directory that is one level above the askbot_stm in the command.
Evgeny's avatar Evgeny (13 years ago)
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 (13 years ago)
It gives me the same result.
AlexP's avatar AlexP (13 years ago)
see more comments