Re: Django on Hostmonster shared hosting

2009-08-04 Thread Gene

I am currently running a django site successfully on HM shared
hosting.
As far as I can tell I am using the same setup as you- except that I
haven't yet upgraded to flup 1.0.3.
It looks like your troubles are just with the path, though the WSGI
errors trouble me.

I'll let you know if my site breaks after I upgrade flup later today.

Dj Gilcrease' experience with HM troubles me as well :/

On Aug 2, 12:10 pm, Tim  wrote:
> Hello
>
> I have been trying to get Django working with Hostmonster.com shared
> webhosting with FCGI.
>
> From what I gather from the HM forums, this is possible, but I've been
> hitting some issues.
>
> I've installed Python 2.6.2 in my home directory, and by all accounts,
> its working.
>
> I've downloaded Django from SVN (revision 11375)
>
> If I create a project, and an app, I can run it by
>
> >> ~/local/bin/python manage.py runserver
>
> This gives me a server running at 127.0.0.1:8000 ..  which I can get
> to if I telnet locally (lynx is b0rked, dunno why, not really part of
> this problem here).
>
> Configure the FCGI app, and .htaccess, as described 
> athttp://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#runnin...
> and elaborated on 
> athttp://www.hostmonsterforum.com/showpost.php?p=15030=4,
> I can get it to generate an internal exception.
>
> Run the fgci script at a shell, and I get:
> timat...@host280:~/public_html/django$ ./mysite.fcgi
> WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
> WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
> WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
> WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
> Traceback (most recent call last):
>   File "/home2/timatlee/local/lib/python2.6/site-packages/
> flup-1.0.3.dev_20090716-py2.6.egg/flup/server/fcgi_base.py", line 558,
> in run
>     protocolStatus, appStatus = self.server.handler(self)
>   File "/home2/timatlee/local/lib/python2.6/site-packages/
> flup-1.0.3.dev_20090716-py2.6.egg/flup/server/fcgi_base.py", line
> 1118, in handler
>     result = self.application(environ, start_response)
>   File "/home2/timatlee/djtrunk/django/core/handlers/wsgi.py", line
> 230, in __call__
>     self.load_middleware()
>   File "/home2/timatlee/djtrunk/django/core/handlers/base.py", line
> 33, in load_middleware
>     for middleware_path in settings.MIDDLEWARE_CLASSES:
>   File "/home2/timatlee/djtrunk/django/utils/functional.py", line 269,
> in __getattr__
>     self._setup()
>   File "/home2/timatlee/djtrunk/django/conf/__init__.py", line 40, in
> _setup
>     self._wrapped = Settings(settings_module)
>   File "/home2/timatlee/djtrunk/django/conf/__init__.py", line 75, in
> __init__
>     raise ImportError, "Could not import settings '%s' (Is it on
> sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> e)
> ImportError: Could not import settings 'myproject.settings' (Is it on
> sys.path? Does it have syntax errors?): No module named
> myproject.settings
>
> ..  which is to say, it fails just the same as if I went to the
> website.
>
> mysite.fcgi looks like:
> #!/home2/timatlee/local/bin/python
> import sys, os
>
> # Add a custom Python path.
> # sys.path.insert(0, "/home/user/python")
> sys.path.insert(0, "/home2/timatlee/local/bin/python")
> sys.path.insert(0, "/home2/timatlee/local/lib/python2.6/site-packages/
> flup-1.0.3.dev_20090716-py2.6.egg")
> sys.path.insert(0, "/home2/timatlee/local/lib/python2.6")
> sys.path.insert(0, "/home2/timatlee/djcode")
> sys.path.insert(0, "/home2/timatlee/djcode/mysite")
> sys.path.insert(0, "/home2/timatlee/djtrunk")
>
> # Switch to the directory of your project. (Optional.)
> os.chdir("/home2/timatlee/djcode/mysite")
>
> # Set the DJANGO_SETTINGS_MODULE environment variable.
> os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
>
> from django.core.servers.fastcgi import runfastcgi
> runfastcgi(method="threaded", daemonize="false")
>
> myproject.settings exists in /home2/timatlee/djcode/mysite, which from
> what I can tell is on the path.
>
> If I set os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
> to be the absolute path of the file, I get the following as an error:
> ImportError: Could not import settings '/home2/timatlee/djcode/mysite/
> myproject.settings' (Is it on sys.path? Does it have syntax errors?):
> Import by filename is not supported.
>
> So if I truncate myproject.settings, I see no change.  If I make
> myproject.settings a copy of settings.py (which is what I thought this
> file was supposed to be), I'm at where I am right now.
>
> I'm sure it's something plainly obvious, but I've overlooked...
>
> Any help would be appreciated.
>
> Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 

Re: Django on Hostmonster shared hosting

2009-08-04 Thread Daniel Roseman

On Aug 3, 10:17 pm, uxp  wrote:
> On Aug 2, 4:21 pm, Daniel Roseman  wrote:
> > Maybe a silly question, but you keep talking about
> > 'myproject.settings' - do you mean this is what you've called the
> > file? That won't work at all. The settings should be called
> > settings.py, you don't need to copy/rename it. In the documentation,
> > 'myproject.settings' refers to the settings.py file in the myproject
> > module/directory.
>
> > --
> > DR.
>
> Daniel, No. The format referred to in django is "mysite.settings". The
> settings file is not named mysite.settings, it is settings.py since
> its a python file.

But you're talking about making it a 'copy' of settings.py - it
shouldn't be a copy, it should *be* settings.py. And you mentioned
using the 'absolute path' in os.environ['DJANGO_SETTINGS_MODULE'].
This refers to a *Python* path, not a file system path. So if you've
set it to the value 'myproject.settings', Python will look for the
file 'settings.py' in the 'myproject' directory in one of the
directories on your Pythonpath.

Assuming your Django code lives under /home2/timatlee/djcode/mysite,
you must then have a myproject directory underneath mysite, which
contains your settings.py. If your settings.py is actually in the
'mysite' folder, then set the DJANGO_SETTINGS_MODULE to simply
'settings'.

Also, make sure all your directories have __init__.py files in them.
--
DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django on Hostmonster shared hosting

2009-08-04 Thread Dj Gilcrease

On Sun, Aug 2, 2009 at 1:10 PM, Tim wrote:
>
> Hello
>
> I have been trying to get Django working with Hostmonster.com shared
> webhosting with FCGI.
>
> From what I gather from the HM forums, this is possible, but I've been
> hitting some issues.

I was with HM for 5 years running django for the last year, but
earlier this year they made a change to their setup that broke my
functional setup producing a very similar error (I had py25 instead of
26 though). I spoke with CS several times and they refused to do
anything to help me because they dont support django officially, so I
switched to WebFaction, price is a little more per month for less
resources, but they officially support django and are very helpful
even if you redesign your setup outside their own

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



Re: Django on Hostmonster shared hosting

2009-08-03 Thread prabhu S

in mysite.fcgi fix the settings file name.

os.environ['DJANGO_SETTINGS_MODULE'] = "mysite.settings"

Your settings file is inside a directory called "mysite". It will help
if you quickly take a look at modules documentation in python.

Also your fcgi complains about several missing parameters. It may not
work correctly without them.

WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!


On Aug 3, 10:17 pm, uxp  wrote:
> On Aug 2, 4:21 pm, Daniel Roseman  wrote:
>
>
>
>
>
> > On Aug 2, 8:10 pm, Tim  wrote:
>
> > > Hello
>
> > > I have been trying to get Django working with Hostmonster.com shared
> > > webhosting with FCGI.
>
> > > From what I gather from the HM forums, this is possible, but I've been
> > > hitting some issues.
>
> > > I've installed Python 2.6.2 in my home directory, and by all accounts,
> > > its working.
>
> > > I've downloaded Django from SVN (revision 11375)
>
> > > If I create a project, and an app, I can run it by
>
> > > >> ~/local/bin/python manage.py runserver
>
> > > This gives me a server running at 127.0.0.1:8000 ..  which I can get
> > > to if I telnet locally (lynx is b0rked, dunno why, not really part of
> > > this problem here).
>
> > > Configure the FCGI app, and .htaccess, as described 
> > > athttp://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#runnin...
> > > and elaborated on 
> > > athttp://www.hostmonsterforum.com/showpost.php?p=15030=4,
> > > I can get it to generate an internal exception.
>
> > > Run the fgci script at a shell, and I get:
> > > timat...@host280:~/public_html/django$ ./mysite.fcgi
> > > WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
> > > WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
> > > WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
> > > WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
> > > Traceback (most recent call last):
> > >   File "/home2/timatlee/local/lib/python2.6/site-packages/
> > > flup-1.0.3.dev_20090716-py2.6.egg/flup/server/fcgi_base.py", line 558,
> > > in run
> > >     protocolStatus, appStatus = self.server.handler(self)
> > >   File "/home2/timatlee/local/lib/python2.6/site-packages/
> > > flup-1.0.3.dev_20090716-py2.6.egg/flup/server/fcgi_base.py", line
> > > 1118, in handler
> > >     result = self.application(environ, start_response)
> > >   File "/home2/timatlee/djtrunk/django/core/handlers/wsgi.py", line
> > > 230, in __call__
> > >     self.load_middleware()
> > >   File "/home2/timatlee/djtrunk/django/core/handlers/base.py", line
> > > 33, in load_middleware
> > >     for middleware_path in settings.MIDDLEWARE_CLASSES:
> > >   File "/home2/timatlee/djtrunk/django/utils/functional.py", line 269,
> > > in __getattr__
> > >     self._setup()
> > >   File "/home2/timatlee/djtrunk/django/conf/__init__.py", line 40, in
> > > _setup
> > >     self._wrapped = Settings(settings_module)
> > >   File "/home2/timatlee/djtrunk/django/conf/__init__.py", line 75, in
> > > __init__
> > >     raise ImportError, "Could not import settings '%s' (Is it on
> > > sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> > > e)
> > > ImportError: Could not import settings 'myproject.settings' (Is it on
> > > sys.path? Does it have syntax errors?): No module named
> > > myproject.settings
>
> > > ..  which is to say, it fails just the same as if I went to the
> > > website.
>
> > > mysite.fcgi looks like:
> > > #!/home2/timatlee/local/bin/python
> > > import sys, os
>
> > > # Add a custom Python path.
> > > # sys.path.insert(0, "/home/user/python")
> > > sys.path.insert(0, "/home2/timatlee/local/bin/python")
> > > sys.path.insert(0, "/home2/timatlee/local/lib/python2.6/site-packages/
> > > flup-1.0.3.dev_20090716-py2.6.egg")
> > > sys.path.insert(0, "/home2/timatlee/local/lib/python2.6")
> > > sys.path.insert(0, "/home2/timatlee/djcode")
> > > sys.path.insert(0, "/home2/timatlee/djcode/mysite")
> > > sys.path.insert(0, "/home2/timatlee/djtrunk")
>
> > > # Switch to the directory of your project. (Optional.)
> > > os.chdir("/home2/timatlee/djcode/mysite")
>
> > > # Set the DJANGO_SETTINGS_MODULE environment variable.
> > > os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
>
> > > from django.core.servers.fastcgi import runfastcgi
> > > runfastcgi(method="threaded", daemonize="false")
>
> > > myproject.settings exists in /home2/timatlee/djcode/mysite, which from
> > > what I can tell is on the path.
>
> > > If I set os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
> > > to be the absolute path of the file, I get the following as an error:
> > > ImportError: Could not import settings '/home2/timatlee/djcode/mysite/
> > > myproject.settings' (Is it on 

Re: Django on Hostmonster shared hosting

2009-08-03 Thread uxp



On Aug 2, 4:21 pm, Daniel Roseman  wrote:
> On Aug 2, 8:10 pm, Tim  wrote:
>
> > Hello
>
> > I have been trying to get Django working with Hostmonster.com shared
> > webhosting with FCGI.
>
> > From what I gather from the HM forums, this is possible, but I've been
> > hitting some issues.
>
> > I've installed Python 2.6.2 in my home directory, and by all accounts,
> > its working.
>
> > I've downloaded Django from SVN (revision 11375)
>
> > If I create a project, and an app, I can run it by
>
> > >> ~/local/bin/python manage.py runserver
>
> > This gives me a server running at 127.0.0.1:8000 ..  which I can get
> > to if I telnet locally (lynx is b0rked, dunno why, not really part of
> > this problem here).
>
> > Configure the FCGI app, and .htaccess, as described 
> > athttp://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#runnin...
> > and elaborated on 
> > athttp://www.hostmonsterforum.com/showpost.php?p=15030=4,
> > I can get it to generate an internal exception.
>
> > Run the fgci script at a shell, and I get:
> > timat...@host280:~/public_html/django$ ./mysite.fcgi
> > WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
> > WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
> > WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
> > WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
> > Traceback (most recent call last):
> >   File "/home2/timatlee/local/lib/python2.6/site-packages/
> > flup-1.0.3.dev_20090716-py2.6.egg/flup/server/fcgi_base.py", line 558,
> > in run
> >     protocolStatus, appStatus = self.server.handler(self)
> >   File "/home2/timatlee/local/lib/python2.6/site-packages/
> > flup-1.0.3.dev_20090716-py2.6.egg/flup/server/fcgi_base.py", line
> > 1118, in handler
> >     result = self.application(environ, start_response)
> >   File "/home2/timatlee/djtrunk/django/core/handlers/wsgi.py", line
> > 230, in __call__
> >     self.load_middleware()
> >   File "/home2/timatlee/djtrunk/django/core/handlers/base.py", line
> > 33, in load_middleware
> >     for middleware_path in settings.MIDDLEWARE_CLASSES:
> >   File "/home2/timatlee/djtrunk/django/utils/functional.py", line 269,
> > in __getattr__
> >     self._setup()
> >   File "/home2/timatlee/djtrunk/django/conf/__init__.py", line 40, in
> > _setup
> >     self._wrapped = Settings(settings_module)
> >   File "/home2/timatlee/djtrunk/django/conf/__init__.py", line 75, in
> > __init__
> >     raise ImportError, "Could not import settings '%s' (Is it on
> > sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> > e)
> > ImportError: Could not import settings 'myproject.settings' (Is it on
> > sys.path? Does it have syntax errors?): No module named
> > myproject.settings
>
> > ..  which is to say, it fails just the same as if I went to the
> > website.
>
> > mysite.fcgi looks like:
> > #!/home2/timatlee/local/bin/python
> > import sys, os
>
> > # Add a custom Python path.
> > # sys.path.insert(0, "/home/user/python")
> > sys.path.insert(0, "/home2/timatlee/local/bin/python")
> > sys.path.insert(0, "/home2/timatlee/local/lib/python2.6/site-packages/
> > flup-1.0.3.dev_20090716-py2.6.egg")
> > sys.path.insert(0, "/home2/timatlee/local/lib/python2.6")
> > sys.path.insert(0, "/home2/timatlee/djcode")
> > sys.path.insert(0, "/home2/timatlee/djcode/mysite")
> > sys.path.insert(0, "/home2/timatlee/djtrunk")
>
> > # Switch to the directory of your project. (Optional.)
> > os.chdir("/home2/timatlee/djcode/mysite")
>
> > # Set the DJANGO_SETTINGS_MODULE environment variable.
> > os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
>
> > from django.core.servers.fastcgi import runfastcgi
> > runfastcgi(method="threaded", daemonize="false")
>
> > myproject.settings exists in /home2/timatlee/djcode/mysite, which from
> > what I can tell is on the path.
>
> > If I set os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
> > to be the absolute path of the file, I get the following as an error:
> > ImportError: Could not import settings '/home2/timatlee/djcode/mysite/
> > myproject.settings' (Is it on sys.path? Does it have syntax errors?):
> > Import by filename is not supported.
>
> > So if I truncate myproject.settings, I see no change.  If I make
> > myproject.settings a copy of settings.py (which is what I thought this
> > file was supposed to be), I'm at where I am right now.
>
> > I'm sure it's something plainly obvious, but I've overlooked...
>
> > Any help would be appreciated.
>
> > Thanks!
>
> Maybe a silly question, but you keep talking about
> 'myproject.settings' - do you mean this is what you've called the
> file? That won't work at all. The settings should be called
> settings.py, you don't need to copy/rename it. In the documentation,
> 'myproject.settings' refers to the settings.py file in the myproject
> module/directory.
>
> --
> DR.

Daniel, No. The format referred to in django is 

Re: Django on Hostmonster shared hosting

2009-08-02 Thread Daniel Roseman

On Aug 2, 8:10 pm, Tim  wrote:
> Hello
>
> I have been trying to get Django working with Hostmonster.com shared
> webhosting with FCGI.
>
> From what I gather from the HM forums, this is possible, but I've been
> hitting some issues.
>
> I've installed Python 2.6.2 in my home directory, and by all accounts,
> its working.
>
> I've downloaded Django from SVN (revision 11375)
>
> If I create a project, and an app, I can run it by
>
> >> ~/local/bin/python manage.py runserver
>
> This gives me a server running at 127.0.0.1:8000 ..  which I can get
> to if I telnet locally (lynx is b0rked, dunno why, not really part of
> this problem here).
>
> Configure the FCGI app, and .htaccess, as described 
> athttp://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#runnin...
> and elaborated on 
> athttp://www.hostmonsterforum.com/showpost.php?p=15030=4,
> I can get it to generate an internal exception.
>
> Run the fgci script at a shell, and I get:
> timat...@host280:~/public_html/django$ ./mysite.fcgi
> WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
> WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
> WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
> WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
> Traceback (most recent call last):
>   File "/home2/timatlee/local/lib/python2.6/site-packages/
> flup-1.0.3.dev_20090716-py2.6.egg/flup/server/fcgi_base.py", line 558,
> in run
>     protocolStatus, appStatus = self.server.handler(self)
>   File "/home2/timatlee/local/lib/python2.6/site-packages/
> flup-1.0.3.dev_20090716-py2.6.egg/flup/server/fcgi_base.py", line
> 1118, in handler
>     result = self.application(environ, start_response)
>   File "/home2/timatlee/djtrunk/django/core/handlers/wsgi.py", line
> 230, in __call__
>     self.load_middleware()
>   File "/home2/timatlee/djtrunk/django/core/handlers/base.py", line
> 33, in load_middleware
>     for middleware_path in settings.MIDDLEWARE_CLASSES:
>   File "/home2/timatlee/djtrunk/django/utils/functional.py", line 269,
> in __getattr__
>     self._setup()
>   File "/home2/timatlee/djtrunk/django/conf/__init__.py", line 40, in
> _setup
>     self._wrapped = Settings(settings_module)
>   File "/home2/timatlee/djtrunk/django/conf/__init__.py", line 75, in
> __init__
>     raise ImportError, "Could not import settings '%s' (Is it on
> sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> e)
> ImportError: Could not import settings 'myproject.settings' (Is it on
> sys.path? Does it have syntax errors?): No module named
> myproject.settings
>
> ..  which is to say, it fails just the same as if I went to the
> website.
>
> mysite.fcgi looks like:
> #!/home2/timatlee/local/bin/python
> import sys, os
>
> # Add a custom Python path.
> # sys.path.insert(0, "/home/user/python")
> sys.path.insert(0, "/home2/timatlee/local/bin/python")
> sys.path.insert(0, "/home2/timatlee/local/lib/python2.6/site-packages/
> flup-1.0.3.dev_20090716-py2.6.egg")
> sys.path.insert(0, "/home2/timatlee/local/lib/python2.6")
> sys.path.insert(0, "/home2/timatlee/djcode")
> sys.path.insert(0, "/home2/timatlee/djcode/mysite")
> sys.path.insert(0, "/home2/timatlee/djtrunk")
>
> # Switch to the directory of your project. (Optional.)
> os.chdir("/home2/timatlee/djcode/mysite")
>
> # Set the DJANGO_SETTINGS_MODULE environment variable.
> os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
>
> from django.core.servers.fastcgi import runfastcgi
> runfastcgi(method="threaded", daemonize="false")
>
> myproject.settings exists in /home2/timatlee/djcode/mysite, which from
> what I can tell is on the path.
>
> If I set os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
> to be the absolute path of the file, I get the following as an error:
> ImportError: Could not import settings '/home2/timatlee/djcode/mysite/
> myproject.settings' (Is it on sys.path? Does it have syntax errors?):
> Import by filename is not supported.
>
> So if I truncate myproject.settings, I see no change.  If I make
> myproject.settings a copy of settings.py (which is what I thought this
> file was supposed to be), I'm at where I am right now.
>
> I'm sure it's something plainly obvious, but I've overlooked...
>
> Any help would be appreciated.
>
> Thanks!

Maybe a silly question, but you keep talking about
'myproject.settings' - do you mean this is what you've called the
file? That won't work at all. The settings should be called
settings.py, you don't need to copy/rename it. In the documentation,
'myproject.settings' refers to the settings.py file in the myproject
module/directory.

--
DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options,