login community faq

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
[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 Mar 11 '11 at 20:55

polinom's gravatar image

polinom
12


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.

answered Mar 11 '11 at 21:04

klynton's gravatar image

klynton ♦♦
148128

So fast reply. I really appreciate it. Thanks.

(Mar 11 '11 at 21:29) polinom polinom's gravatar image

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

(Mar 11 '11 at 21:29) klynton ♦♦ klynton's gravatar image

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

(Mar 11 '11 at 21:49) polinom polinom's gravatar image

Hi,

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

(Mar 11 '11 at 21:50) klynton ♦♦ klynton's gravatar image

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?

(Mar 11 '11 at 22:00) polinom polinom's gravatar image

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.

(Mar 11 '11 at 22:06) klynton ♦♦ klynton's gravatar image

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?

(Mar 11 '11 at 22:35) polinom polinom's gravatar image

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.

(Mar 11 '11 at 22:44) klynton ♦♦ klynton's gravatar image

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.

(Mar 12 '11 at 00:44) polinom polinom's gravatar image

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.

(Mar 12 '11 at 00:49) klynton ♦♦ klynton's gravatar image

Thanks a lot.

(Mar 12 '11 at 00:58) polinom polinom's gravatar image

You're very welcome!

(Mar 12 '11 at 01:02) klynton ♦♦ klynton's gravatar image
showing 5 of 12 show all
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
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

Tags:

×642
×19

Asked: Mar 11 '11 at 20:55

Seen: 1,104 times

Last updated: Mar 12 '11 at 01:02

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited