WebFaction
Community site: login faq

Hi,

I'm trying to deploy my django app which is working locally. However, I'm getting an internal server error in my webfaction deployment. I'm thinking this is a pythonpath problem since I don't get this error on my local installation?

This is what I get in my django log:

 File ".../django/lib/python2.6/django/utils/importlib.py", line 35, in import_module
 File ".../django/mydjangoapp/tagging/__init__.py", line 3, in <module>
from tagging.managers import ModelTaggedItemManager, TagDescriptor
TemplateSyntaxError: Caught ImportError while rendering: No module named tagging.managers

It seems that there is a problem with the "tagging" app. The tagging app is in my django folder though, and it includes managers.py.

I'm thinking this might be a pythonpath problem since the app works locally? How should I change my pythonpath to add the apps that are inside my django/mydjangoapp folder?

Thanks for any help.

asked 29 Dec '10, 14:55

Rrr8
16124
accept rate: 0%


The problem was that my project wasn't in my pythonpath. I had to add it myself.

There are several ways to do this. You can read about all of the different ways here: http://docs.webfaction.com/software/python.html#importerror

What I did was add the path to my app into the "myproject.wsgi" file:

Open /home/username/webapps/djangoapp/myproject/myproject.wsgi If there is no line such as

sys.path = ['/home/username/webapps/djangoapp/myproject'] + sys.path

Add it in there.

You can add more paths of course as well, check out the documentation link for more info.

permanent link

answered 05 Jan '11, 04:22

Rrr8
16124
accept rate: 0%

Try the following:

from myproject.tagging.managers import ModelTaggedItemManager, TagDescriptor

Replace myproject with the name of your django project. If that doesn't fix it, feel free to open a support ticket and we can take a look at your application.

permanent link

answered 29 Dec '10, 14:58

aaronh ♦♦
1.3k3
accept rate: 34%

Hi, thank you for the fast reply. I tried this, but now it's giving the same error for "tagging.models". So it seems the "tagging" app doesn't work at all. I'll try to figure it out and open a support ticket if I can't get it working.

(29 Dec '10, 15:11) Rrr8

You might need to put myproject before tagging every time you import it. If you can't get it working, we'll be happy to help you if you open a support ticket.

(29 Dec '10, 15:47) aaronh ♦♦
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
×108
×97
×15

question asked: 29 Dec '10, 14:55

question was seen: 4,517 times

last updated: 05 Jan '11, 04:22

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