I can successfully start python and import the settings file. My
settings file only imports os.

On Nov 25, 3:01 pm, Tim Valenta <[email protected]> wrote:
> Well, does it have errors?  If you navigate to the directory where
> it's kept, can you enter the python shell and do "import settings"?
> Given all of the trouble you're having, can you verify that it imports
> successfully?  The settings module itself should have no immediate
> dependencies, unless you've placed a bunch of extra stuff in it.
>
> On Nov 25, 12:53 pm, Stodge <[email protected]> wrote:
>
> > It fails even if I delete the hg and .hg directories now. It worked a
> > few times before, but no longer. Odd.
>
> > > /usr/lib/python2.5/site-packages/django/core/management/base.py(194)run_fro
> > >  m_argv()
>
> > -> handle_default_options(options)
> > (Pdb) print options
> > {'pythonpath': None, 'verbosity': '1', 'traceback': None, 'plain':
> > None, 'settings': None}
> > (Pdb) n> 
> > /usr/lib/python2.5/site-packages/django/core/management/base.py(195)run_fro 
> > m_argv()
>
> > -> self.execute(*args, **options.__dict__)
> > (Pdb) print args
> > []
> > (Pdb) print options.__dict__
> > {'pythonpath': None, 'verbosity': '1', 'traceback': None, 'plain':
> > None, 'settings': None}
> > (Pdb) n
> > Error: Could not import settings 'indigo.settings' (Is it on sys.path?
> > Does it have syntax errors?): No module named settings
> > SystemExit: 1> 
> > /usr/lib/python2.5/site-packages/django/core/management/base.py(195)run_fro 
> > m_argv()
>
> > -> self.execute(*args, **options.__dict__)
>
> > ./manage.py shell --settings=/var/www/sites/indigo/settings.py
> > Error: Could not import settings '/var/www/sites/indigo/
> > settings.py' (Is it on sys.path? Does it have syntax errors?): No
> > module named /var/www/sites/indigo/settings.py
>
> > On Nov 25, 2:37 pm, Bill Freeman <[email protected]> wrote:
>
> > > Interesting.
>
> > > I take it that hg and hg/hooks both have __init__.py files?  Otherwise
> > > I'm not sure how django sees them.  Unless hg is also an app, listed
> > > in installed apps and has a models.py file.  That is, I don't believe that
> > > the name 'hg' has any special meaning to django.
>
> > > You might try sticking "import pdb;pdb.set_trace()" in the beginning of
> > > settings.py to see if it is at least trying to be imported.  If the 
> > > breakpoint
> > > is hit, you could "n" your way through the file to see if something is
> > > getting an exception that prevents the import from succeeding, then
> > > back up by moving the set_trace() to just before the failing item, 
> > > restart,
> > > and "s" your way into the failing item to see how it manages to depend
> > > on the presence of an "hg" directory.
>
> > > On Wed, Nov 25, 2009 at 2:18 PM, Stodge <[email protected]> wrote:
> > > > I think I have it. I'm developing a Mercurial hook in /var/www/sites/
> > > > project/hg/hooks. If I delete this directory it works. If I recreate
> > > > the directory and the hook, it fails. Guess Django is getting confused
> > > > by its existence.
>
> > > > On Nov 25, 12:56 pm, Bill Freeman <[email protected]> wrote:
> > > >> Does /var/www/sites/project/__init__.py exist?
>
> > > >> Are the files and directories readable, and the directories searchable
> > > >> (excutable)
> > > >> by the user as which the webserver runs?
>
> > > >> On Wed, Nov 25, 2009 at 12:21 PM, Stodge <[email protected]> wrote:
> > > >> > If I break the code out and write a simple python script that only
> > > >> > contains:
>
> > > >> > import sys, os
> > > >> > sys.path.append("/var/www/sites")
> > > >> > from project import settings
> > > >> > from django.core.management import setup_environ
> > > >> > setup_environ(settings)
>
> > > >> > Even this doesn't work yet as far as I can tell, it should. Any 
> > > >> > ideas?
>
> > > >> > --
>
> > > >> > You received this message because you are subscribed to the Google 
> > > >> > Groups "Django users" group.
> > > >> > To post to this group, send email to [email protected].
> > > >> > To unsubscribe from this group, send email to 
> > > >> > [email protected].
> > > >> > For more options, visit this group 
> > > >> > athttp://groups.google.com/group/django-users?hl=en.
>
> > > > --
>
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "Django users" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to 
> > > > [email protected].
> > > > For more options, visit this group 
> > > > athttp://groups.google.com/group/django-users?hl=en.
>
>

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to