Re: Cannot import mypackage with code in the __init__.py file

2013-06-20 Thread Bill Freeman
Well, that would explain it.  For directories the execute bit has to do
with directory traversal, rather than the execution of anything.  No
adjustment to your wsgi config can get around that.

I can't advise you about mappings between windows permissions and *nix
permissions, not what sshclient does about it, since I don't use them.  If
it's not just a matter of having the correct CACLs on the Windows side, or
configuration options to sshclient (or some explicit step you took), you
can always write a script that fixes up ownerships and permissions (will
have to be run with sudo or as root).


On Thu, Jun 20, 2013 at 2:07 PM, fred  wrote:

> OK, I found a fix but not the cause.
> The entire project is copied from W7 using sshclient.  The directories I'm
> having trouble with are not executable, when I changed that it all works.
> Now I wonder if there is something in my wsgi.conf that could be changed to
> all access to them since I don't have this problem with other django 1.3
> wsgi projects.  I posted my wsgi.conf earlier and would appreciate any
> suggestions.
>
> Fred.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cannot import mypackage with code in the __init__.py file

2013-06-20 Thread fred
OK, I found a fix but not the cause.
The entire project is copied from W7 using sshclient.  The directories I'm 
having trouble with are not executable, when I changed that it all works.  
Now I wonder if there is something in my wsgi.conf that could be changed to 
all access to them since I don't have this problem with other django 1.3 
wsgi projects.  I posted my wsgi.conf earlier and would appreciate any 
suggestions.

Fred.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




RE: Cannot import mypackage with code in the __init__.py file

2013-06-20 Thread Sells, Fred
Yes, the files exist and they have read access and are owned by apache.  I do 
use a symlink of "current" to point to my actual project directory to 
facilitate testing.  I ported this from 1.3 by creating a new 1.5 project and 
then moving the contents of the old to the new.  The error looks like this:
Python Path:(this is the actual data, I simplified structure in my earlier 
posts.

['/var/www/mdsdeploy/current/AccNewMdsServer',
 '/usr/lib/python26.zip',
 '/usr/lib/python2.6',
. . .

 My wsgi.conf looks like this :

WSGIScriptAlias /mdsapi 
/var/www/mdsdeploy/current/AccNewMdsServer/AccNewMdsServer/wsgi.py


WSGIPythonPath /var/www/mdsdeploy/current
WSGIPythonPath /var/www/mdsdeploy/current/AccNewMdsServer

WSGIScriptReloading On

#commented the following out until I get it to work.
#WSGIReloadMechanism Process
#WSGIDaemonProcess djangoapps processes=2 threads=15 
python-path=/home/mdsdeploy/current:/home/mdsdeploy/current/AccNewMdsServer
#WSGIProcessGroup djangoapps
LogLevel info
WSGISocketPrefix /var/run/wsgi



Order allow,deny
Allow from all




Order allow,deny
Allow from all



Order allow,deny
Allow from all




Order allow,deny
Allow from all



-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Tom Evans
Sent: Thursday, June 20, 2013 4:50 AM
To: django-users@googlegroups.com
Subject: Re: Cannot import mypackage with code in the __init__.py file

On Wed, Jun 19, 2013 at 7:51 PM, fred  wrote:
> I'm upgrading to django 1.5.1 on CentOs 6.4 with python 2.6.6  
> although I'm developing on a W7 with the django debug server.
>
> I am getting executing my view.py and most of the modules it uses.  
> But in one scenario, the import fails, see directory outline below
>
> NewMdsServer
>|___NewMdsServer
>   |___settings.py
>   |___wsgi.py
>   |___ ...
>|___app
> |___views.py
> |___mymodule.py
> |___mypackage
>|___  __init__.py
>|___  x.py
>|___  y.py
>
> I have code in the __init__.py which then imports x, y, etc

Do the files NewMdsServer/NewMdsServer/__init__.py and 
NewMdsServer/app/__init__.py exist?

Cheers

Tom

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cannot import mypackage with code in the __init__.py file

2013-06-20 Thread Tom Evans
On Wed, Jun 19, 2013 at 7:51 PM, fred  wrote:
> I'm upgrading to django 1.5.1 on CentOs 6.4 with python 2.6.6  although I'm
> developing on a W7 with the django debug server.
>
> I am getting executing my view.py and most of the modules it uses.  But in
> one scenario, the import fails, see directory outline below
>
> NewMdsServer
>|___NewMdsServer
>   |___settings.py
>   |___wsgi.py
>   |___ ...
>|___app
> |___views.py
> |___mymodule.py
> |___mypackage
>|___  __init__.py
>|___  x.py
>|___  y.py
>
> I have code in the __init__.py which then imports x, y, etc

Do the files NewMdsServer/NewMdsServer/__init__.py and
NewMdsServer/app/__init__.py exist?

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




RE: Cannot import mypackage with code in the __init__.py file

2013-06-19 Thread Sells, Fred
Thanks Bill, I've tried all but the __future__ option.  I'll give it a try.

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Bill Freeman
Sent: Wednesday, June 19, 2013 3:03 PM
To: django-users
Subject: Re: Cannot import mypackage with code in the __init__.py file

Have you tried
   import app.mypackage
or
from app import mypackage
Or, from within views.py or mymodule.py, if you have done
from __future__ import absolute_imports
then try
  import .mypackage
(There is a period before "mypackage" on that line.)

On Wed, Jun 19, 2013 at 2:51 PM, fred 
mailto:fred.se...@adventistcare.org>> wrote:
I'm upgrading to django 1.5.1 on CentOs 6.4 with python 2.6.6  although I'm 
developing on a W7 with the django debug server.

I am getting executing my view.py and most of the modules it uses.  But in one 
scenario, the import fails, see directory outline below

NewMdsServer
   |___NewMdsServer
  |___settings.py
  |___wsgi.py
  |___ ...
   |___app
|___views.py
|___mymodule.py
|___mypackage
   |___  __init__.py
   |___  x.py
   |___  y.py

I have code in the __init__.py which then imports x, y, etc

I cannot seem to import mypackage from views or other modules at the same 
level.  I've tried multiple variants as shown below and sys.path includes the 
directory above app.
from app import mypackage  -- "No module named mypackage"
import mypackage  -- "No module named ..
import app.mypackage -- ditto

The really strange thing is I could swear this was working last week  before I 
got pulled off onto another project for a few days.  I'm the only one using 
this server and I have root access.  I've tried google, but cannot find a 
phrase that gives me anything useful.  I would really appreciate some advice on 
what I'm doing wrong.

Thanks,

Fred.
--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users%2bunsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cannot import mypackage with code in the __init__.py file

2013-06-19 Thread fred
a quick update,  if I use >python manage.py shell   everything works as I 
would expect, no problems.
also I tried removing all code from my __init__.py (yes I'm grasping at 
straws) and that did not help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cannot import mypackage with code in the __init__.py file

2013-06-19 Thread Bill Freeman
Have you tried

   import app.mypackage

or

from app import mypackage

Or, from within views.py or mymodule.py, if you have done

from __future__ import absolute_imports

then try

  import .mypackage

(There is a period before "mypackage" on that line.)


On Wed, Jun 19, 2013 at 2:51 PM, fred  wrote:

> I'm upgrading to django 1.5.1 on CentOs 6.4 with python 2.6.6  although
> I'm developing on a W7 with the django debug server.
>
> I am getting executing my view.py and most of the modules it uses.  But in
> one scenario, the import fails, see directory outline below
>
> NewMdsServer
>|___NewMdsServer
>   |___settings.py
>   |___wsgi.py
>   |___ ...
>|___app
> |___views.py
> |___mymodule.py
> |___mypackage
>|___  __init__.py
>|___  x.py
>|___  y.py
>
> I have code in the __init__.py which then imports x, y, etc
>
> I cannot seem to import mypackage from views or other modules at the same
> level.  I've tried multiple variants as shown below and sys.path includes
> the directory above app.
> from app import mypackage  -- "No module named mypackage"
> import mypackage  -- "No module named ..
> import app.mypackage -- ditto
>
> The really strange thing is I could swear this was working last week
> before I got pulled off onto another project for a few days.  I'm the only
> one using this server and I have root access.  I've tried google, but
> cannot find a phrase that gives me anything useful.  I would really
> appreciate some advice on what I'm doing wrong.
>
> Thanks,
>
> Fred.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Cannot import mypackage with code in the __init__.py file

2013-06-19 Thread fred
I'm upgrading to django 1.5.1 on CentOs 6.4 with python 2.6.6  although I'm 
developing on a W7 with the django debug server.

I am getting executing my view.py and most of the modules it uses.  But in 
one scenario, the import fails, see directory outline below

NewMdsServer
   |___NewMdsServer
  |___settings.py
  |___wsgi.py 
  |___ ...
   |___app
|___views.py
|___mymodule.py
|___mypackage
   |___  __init__.py
   |___  x.py
   |___  y.py

I have code in the __init__.py which then imports x, y, etc

I cannot seem to import mypackage from views or other modules at the same 
level.  I've tried multiple variants as shown below and sys.path includes 
the directory above app.
from app import mypackage  -- "No module named mypackage"
import mypackage  -- "No module named ..
import app.mypackage -- ditto

The really strange thing is I could swear this was working last week  
before I got pulled off onto another project for a few days.  I'm the only 
one using this server and I have root access.  I've tried google, but 
cannot find a phrase that gives me anything useful.  I would really 
appreciate some advice on what I'm doing wrong.

Thanks,

Fred.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.