Re: Imports, works from directory but not from file

2009-11-12 Thread Bill Freeman
On Thu, Nov 12, 2009 at 10:33 AM, andreas schmid wrote: >> > im on a unix system and i can import it on the django shell but it makes > troubles when running the django server which doesnt make sense It may be that it won't be recognized as an app because the app directory doesn't have a models.

Re: Imports, works from directory but not from file

2009-11-12 Thread rebus_
I am not sure if i got the problem right, but this is what i think you could do. If you want to keep your views in directory: app/ views/ __init__.py <- This is where you keep your views so you don't even need to change your urls.py or anthing something_else.py <- something else A

Re: Imports, works from directory but not from file

2009-11-12 Thread andreas schmid
Bill Freeman wrote: > If that wasn't a typo, I suspect that you're going to have trouble > with having a directory > named "views.py". yes it was a typo... my dir is called 'views' > I don't know how you import anything from it unless > it is directly on > your path. > > When you say "my app is i

Re: Imports, works from directory but not from file

2009-11-12 Thread Bill Freeman
If that wasn't a typo, I suspect that you're going to have trouble with having a directory named "views.py". I don't know how you import anything from it unless it is directly on your path. When you say "my app is in the pythonpath of the environment": 1. Which directory is in the python path?

Re: Imports, works from directory but not from file

2009-11-11 Thread andreas schmid
Bill Freeman wrote: > Does your project root (I'm assuming that's the directory containing > the sub directory "app") have an __init__.py file. Does the app > directory? I'm assuming that the one you mention below is in > app/models/ . All three are required, if what you have on your > sys.path

Re: Imports, works from directory but not from file

2009-11-11 Thread Bill Freeman
Does your project root (I'm assuming that's the directory containing the sub directory "app") have an __init__.py file. Does the app directory? I'm assuming that the one you mention below is in app/models/ . All three are required, if what you have on your sys.path is just the project root. Do

Re: Imports, works from directory but not from file

2009-11-11 Thread andreas schmid
im experiencing the same problem. i started with a simple app and the modules.py was at the root of the app package, so everything was fine. now i extended the app and restructured the files in it by making a subfolder app/models and inside an __init__.py and the mymodel.py in the urls.py which i

Re: Imports, works from directory but not from file

2009-11-11 Thread Bill Freeman
I had another couple of thoughts. In the manage.py shell, try: from openid.yadis import xri xri The output will include from where it got xri. Make sure that it's coming from your lib directory, and not from some old system wide installation of openid. Instead of: from openid.as

Re: Imports, works from directory but not from file

2009-11-10 Thread Bill Freeman
Did you really mean "init.py", rather than the required "__init__.py". If so, that's wrong. I presume that the names of the files and directories are all lower case and contain no spaces or accented characters. I presume that you've checked and rechecked the spelling of the file name against th

Re: Imports, works from directory but not from file

2009-11-10 Thread When ideas fail
I used this in my settings.py to add the open id folder on my path sys.path.append(os.path.join(FILE_ROOT, 'lib', 'openid')) and on my path it say: 'C:\\TheAbeonaFile\\Python26\\Lib\\idlelib\\lib\\openid' And both the yadis file and openid file have an init.py On 10 Nov, 22:18, Bill Freeman wr

Re: Imports, works from directory but not from file

2009-11-10 Thread Bill Freeman
Which all of these directories are on your python path, and which of them have __init__.py files? Bill [Hint to answer first question: from pprint import pprint as pp import sys pp(sys.path) ] On Tue, Nov 10, 2009 at 5:12 PM, When ideas fail wrote: > > I have a folder called lib on my path a

Imports, works from directory but not from file

2009-11-10 Thread When ideas fail
I have a folder called lib on my path and in there I have a folder called openid. If i want to import things from openid i have a problem. For example if I have these 2 import statements: from openid.yadis import xri from openid.association import Association as OIDAssociation yadis is a direc