WebFaction
Community site: login faq

Hi. I just configured my django project. And face a problem: Actually:

[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]     return real_ugettext(message)
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]   File "/home/polinom/webapps/django/lib/python2.6/django/utils/functional.py", line 55, in _curried
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]     return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]   File "/home/polinom/webapps/django/lib/python2.6/django/utils/translation/__init__.py", line 36, in delayed_loader
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]     return getattr(trans, real_name)(*args, **kwargs)
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]   File "/home/polinom/webapps/django/lib/python2.6/django/utils/translation/trans_real.py", line 276, in ugettext
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]     return do_translate(message, 'ugettext')
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]   File "/home/polinom/webapps/django/lib/python2.6/django/utils/translation/trans_real.py", line 266, in do_translate
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]     _default = translation(settings.LANGUAGE_CODE)
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]   File "/home/polinom/webapps/django/lib/python2.6/django/utils/translation/trans_real.py", line 176, in translation
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]     default_translation = _fetch(settings.LANGUAGE_CODE)
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]   File "/home/polinom/webapps/django/lib/python2.6/django/utils/translation/trans_real.py", line 159, in _fetch
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]     app = import_module(appname)
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]   File "/home/polinom/webapps/django/lib/python2.6/django/utils/importlib.py", line 35, in import_module
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1]     __import__(name)
[Fri Mar 11 20:37:07 2011] [error] [client 127.0.0.1] TemplateSyntaxError: Caught ImportError while rendering: No module named player

Looks like it cant import my app 'player'. In i added it in setings.py Than I Already trued change my urls.py sa follow:

(r'^player/','myproject.player.views.player') - does not work (r'^player/','player.views.player') -does not work

I local machine it work very well.

asked 11 Mar '11, 20:55

polinom
112
accept rate: 0%


Hi,

Here's what you need to do:

  1. Go to your apache2/conf/httpd.conf file and open it in your favorite editor.
  2. Add the path to your player module to the python-path section that looks something like this: python-path=/home/username/webapps/djangoapp/myproject:/system/python and add: python-path=/home/username/webapps/djangoapp/myproject:/home/username/webapps/djangoapp/myproject/new/path:/system/python
  3. Restart the apache server for the app

The reason this works on your local computer is probably because you are running the django dev server which plays magic with your paths and isn't the same as running as a production stack.

permanent link

answered 11 Mar '11, 21:04

klynton
1.6k1210
accept rate: 41%

So fast reply. I really appreciate it. Thanks.

(11 Mar '11, 21:29) polinom

You're very welcome! Did you get the problem fixed?

(11 Mar '11, 21:29) klynton

I'm trying. Now i get apache syntax error. I added lines as you wrote. Shoul i change thish lines:

WSGIDaemonProcess django processes=5 python-path=/home/polinom/webapps/django:/home/polinom/webapps/django/lib/python2.6 threads=1

WSGIPythonPath /home/polinom/webapps/django:/home/polinom/webapps/django/lib/python2.6

(11 Mar '11, 21:49) polinom

Hi,

Yes, you should just edit the lines already there to add the additional paths instead of adding new lines to the file.

(11 Mar '11, 21:50) klynton

Now it looks like this: WSGIDaemonProcess django processes=5 python-path=/home/polinom/webapps/django:/home/polinom/webapps/django/lib/python2.6:/home/polinom/webapps/django/myprojecutt:/system/python: threads=1 WSGIPythonPath /home/polinom/webapps/django:/home/polinom/webapps/django/lib/python2.6:/home/username/webapps/djangoapp/myproject:/home/polinom/webapps/django/myproject/polinom:/system/python

But it dont work. What directive should i exactly edit?

(11 Mar '11, 22:00) polinom

Hi,

It looks like I wasn't very clear in my post. The /system/python was just referencing the full path to the install path of python rather than what you should put there, here's what you should put here:

WSGIDaemonProcess django processes=5 python-path=/home/polinom/webapps/django:/home/polinom/webapps/django/myproject/polinom:/home/polinom/webapps/django/lib/python2.6 threads=1

WSGIPythonPath /home/polinom/webapps/django:/home/polinom/webapps/django/myproject/polinom:/home/polinom/webapps/django/lib/python2.6

then restart your apache.

(11 Mar '11, 22:06) klynton

I did it. Same result - nothing. But when i'm importing it through django.py shell it's importing normal. I stuck. Maybe can be something else?

(11 Mar '11, 22:35) polinom

Hi,

The error was:

[Fri Mar 11 22:41:23 2011] [error] [client 127.0.0.1] raise TemplateDoesNotExist(name) [Fri Mar 11 22:41:23 2011] [error] [client 127.0.0.1] TemplateDoesNotExist: 500.html

I've created that file and it is working now, meaning you're not getting any more 500 errors.

(11 Mar '11, 22:44) klynton

Sorry for confusing you. But you saw that error because I turn off my app named player. But when i turn it on - the same error what i gave you on the top.

(12 Mar '11, 00:44) polinom

I've fixed the problem. The fix was that your app needed to be named 'myproject.player' in settings.py and you were only calling player.view instead of myproject.player.view which I've fixed and your site is now working correctly.

(12 Mar '11, 00:49) klynton

Thanks a lot.

(12 Mar '11, 00:58) polinom

You're very welcome!

(12 Mar '11, 01:02) klynton
showing 5 of 12 show 7 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×27

question asked: 11 Mar '11, 20:55

question was seen: 3,020 times

last updated: 12 Mar '11, 01:02

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM