Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » fcgi, runfastcgi, parameters, docs [noob question] [RSS Feed]

#1 Dec. 22, 2010 14:40:32

Richard B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

fcgi, runfastcgi, parameters, docs [noob question]


Hi all,

I'm new to django but not new to Python. My goal is to build a web site using
django, replacing an old, tired php framework.

The django 1.2.3 tutorials were fine. I got the basics of my site working
locally, after going thru the entire tutorial. Before going any further, I
wanted to see if I could get that same basic tutorial site going on my 1and1
host. If I can't, I may have to go with drupal.

The django 1and1 site is a no go.

I've installed my own Python 2.7.1, since the default version on 1and1 is
extremely old.

1and1 does provide fcgi, by default. Indeed, my .htaccess file and mysite.fcgi
work to a point. The script is using my version of python. The .fcgi script
runs until I get to the line where I try to execute runfastcgi.

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

I'm using the docs provided with the svn version of django. In particular, this
page:
file:///work/django-trunk/docs/_build/html/howto/deployment/fastcgi.html

These docs are those issued with the version of django I'm using, and that's up
to date as of yesterday (via svn checkout).

What's the problem?

I get an error saying "method" is not defined, and "daemonize" is not defined.
Further, those parameters don't match the method in the source:

fastcgi.py:89:
def runfastcgi(argset=, **kwargs):

So, I'm trying to pass (method="threaded", daemonize="false") to a method which
expects (argset=, **kwargs). No wonder it 'splodes.

Can anyone direct me to a way to get this to work? What am I missing?

Thanks in advance


--
Richard Brosnahan


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

Offline

#2 Dec. 23, 2010 01:31:27

Karen T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

fcgi, runfastcgi, parameters, docs [noob question]


On Wed, Dec 22, 2010 at 8:52 AM, Richard Brosnahan <theb...@gmail.com>wrote:

> The .fcgi script runs until I get to the line where I try to execute
> runfastcgi.
>
> from django.core.servers.fastcgi import runfastcgi
> runfastcgi(method="threaded", daemonize="false")
>
>
>
> I get an error saying "method" is not defined, and "daemonize" is not
> defined. Further, those parameters don't match the method in the source:
>
> fastcgi.py:89:
> def runfastcgi(argset=, **kwargs):
>
>
You are passing a couple of keyword arguments to a function that accepts
keyword arguments (**kwargs), that's not a problem. Nor is not passing
argset, since the function definition includes a default value for that if
it is not passed by the caller. Specifics of the exact error message you are
getting may help someone help you; the problem is not that the provided
arguments don't match what is accepted by that function definition.

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

Offline

#3 Dec. 23, 2010 05:55:32

Shamail T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

fcgi, runfastcgi, parameters, docs [noob question]


You may want to try running your fastcgi daemon via command line,

This is the exact command that I am using at production:
python manage.py runfcgi daemonize=false method=threaded
host=127.0.0.1 port=9001

Tx

--
Shamail Tayyab
Blog:http://shamail.in/blogOn Dec 22, 6:52 pm, Richard Brosnahan <theb...@gmail.com> wrote:
> Hi all,
>
> I'm new to django but not new to Python. My goal is to build a web site using
> django, replacing an old, tired php framework.
>
> The django 1.2.3 tutorials were fine. I got the basics of my site working
> locally, after going thru the entire tutorial. Before going any further, I
> wanted to see if I could get that same basic tutorial site going on my 1and1
> host. If I can't, I may have to go with drupal.
>
> The django 1and1 site is a no go.
>
> I've installed my own Python 2.7.1, since the default version on 1and1 is
> extremely old.
>
> 1and1 does provide fcgi, by default. Indeed, my .htaccess file and
> mysite.fcgi work to a point. The script is using my version of python. The
> .fcgi script runs until I get to the line where I try to execute runfastcgi.
>
> from django.core.servers.fastcgi import runfastcgi
> runfastcgi(method="threaded", daemonize="false")
>
> I'm using the docs provided with the svn version of django. In particular,
> this page:
> file:///work/django-trunk/docs/_build/html/howto/deployment/fastcgi.html
>
> These docs are those issued with the version of django I'm using, and that's
> up to date as of yesterday (via svn checkout).
>
> What's the problem?
>
> I get an error saying "method" is not defined, and "daemonize" is not
> defined. Further, those parameters don't match the method in the source:
>
> fastcgi.py:89:
> def runfastcgi(argset=, **kwargs):
>
> So, I'm trying to pass (method="threaded", daemonize="false") to a method
> which expects (argset=, **kwargs). No wonder it 'splodes.
>
> Can anyone direct me to a way to get this to work? What am I missing?
>
> Thanks in advance
>
> --
> Richard Brosnahan

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

Offline

#4 Dec. 23, 2010 18:24:15

b.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

fcgi, runfastcgi, parameters, docs [noob question]


Both answers are VERY helpful, and point out how unhelpful my original
question was stated.

Karen, I admit to being a knucklehead. Thanks for reminding me :-)

Shamail Tayyab, I'm not running via command line, using manage.py.
I've created my own script, following instructions found in the docs
provided with the source:
file:///work/django-trunk/docs/_build/html/howto/deployment/fastcgi.html

So, running from the command line, I get essentially the same error I
get when running via http.

Here's a snippet of my code. I was walking thru with the debugger, but
it was not helpful, yet. I'll put some breakpoints inside fastcgi.py,
perhaps.
try:
socketPath = basePath + "/djgosite2/mysite2.sock"
errLogFilePath = basePath + "/djgosite2/mysite2.err"
# pdb.set_trace()
runfastcgi(method ="threaded", protocol ="fcgi", daemonize =
"false", socket = socketPath, errlog = errLogFilePath, debug = True)
djLogger.debug("right after calling runfastcgi (in try block)")
except Exception as excpt:
djLogger.debug("Exception raised because of something...")
djLogger.debug(excpt)
except:
djLogger.debug("unexpected error")
djLogger.debug( sys.exc_info())
print "Unexpected error:", sys.exc_info()

Here's the error:
Unexpected error: <type 'exceptions.SystemExit'>

I think I need to call the hosting service to see if they can send me
their error logs. I can only look at access logs. My own logger might
be helpful if I add some logging to fastcgi.py.

In any case, THANKS VERY MUCH for the help!


On Dec 23, 12:55 am, Shamail Tayyab <pleoma...@gmail.com> wrote:
> You may want to try running your fastcgi daemon via command line,
>
> This is the exact command that I am using at production:
> python manage.py runfcgi daemonize=false method=threaded
> host=127.0.0.1 port=9001
>
> Tx
>
> --
> Shamail Tayyab
> Blog:http://shamail.in/blog>
> On Dec 22, 6:52 pm, Richard Brosnahan <theb...@gmail.com> wrote:
>
>
>
> > Hi all,
>
> > I'm new to django but not new to Python. My goal is to build a web site
> > using django, replacing an old, tired php framework.
>
> > The django 1.2.3 tutorials were fine. I got the basics of my site working
> > locally, after going thru the entire tutorial. Before going any further, I
> > wanted to see if I could get that same basic tutorial site going on my
> > 1and1 host. If I can't, I may have to go with drupal.
>
> > The django 1and1 site is a no go.
>
> > I've installed my own Python 2.7.1, since the default version on 1and1 is
> > extremely old.
>
> > 1and1 does provide fcgi, by default. Indeed, my .htaccess file and
> > mysite.fcgi work to a point. The script is using my version of python. The
> > .fcgi script runs until I get to the line where I try to execute runfastcgi.
>
> > from django.core.servers.fastcgi import runfastcgi
> > runfastcgi(method="threaded", daemonize="false")
>
> > I'm using the docs provided with the svn version of django. In particular,
> > this page:
> > file:///work/django-trunk/docs/_build/html/howto/deployment/fastcgi.html
>
> > These docs are those issued with the version of django I'm using, and
> > that's up to date as of yesterday (via svn checkout).
>
> > What's the problem?
>
> > I get an error saying "method" is not defined, and "daemonize" is not
> > defined. Further, those parameters don't match the method in the source:
>
> > fastcgi.py:89:
> > def runfastcgi(argset=, **kwargs):
>
> > So, I'm trying to pass (method="threaded", daemonize="false") to a method
> > which expects (argset=, **kwargs). No wonder it 'splodes.
>
> > Can anyone direct me to a way to get this to work? What am I missing?
>
> > Thanks in advance
>
> > --
> > Richard Brosnahan

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

Offline

  • Root
  • » Django
  • » fcgi, runfastcgi, parameters, docs [noob question] [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support