Yes Andrei..

Would anyone know  how to check what mode i'm running my app in. For e.g.
in this page, I'm told i should change my app file to have this;
def application(environ, start_response):

    status = '200 OK'
    if not environ['mod_wsgi.process_group']:
      output = 'EMBEDDED MODE'
    else:
      output = 'DAEMON MODE'
    response_headers = [('Content-Type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)
    return [output]

http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

I plugged this into my www_mock.wsgi file ... but not sure how it gets
invoked and if i should specifically call it and if so with what
parameters. Not sure if this snippet is written for django or webpy.

-Megha

On Fri, Dec 9, 2011 at 11:29 PM, andrei <andre...@gmail.com> wrote:

> Have you tried deleting all *.pyc files and restarting apache?
>
> On Dec 9, 7:01 pm, Megha Vishwanath <megha.vishwan...@gmail.com>
> wrote:
> > Looks like restarting my apache does not reload the changes in py source
> > the way my Web.py - apache - wsgi is set up. Any one had these problems
> > before?
> >
> > On Fri, Dec 9, 2011 at 8:16 AM, Megha Vishwanath <
> megha.vishwan...@gmail.com
> >
> >
> >
> >
> >
> >
> >
> > > wrote:
> > > Guess, it is not the main executable, if permissions are an indicator.
> >
> > > On Fri, Dec 9, 2011 at 8:12 AM, Megha Vishwanath <
> > > megha.vishwan...@gmail.com> wrote:
> >
> > >> No luck:
> >
> > >> Traceback (most recent call last):
> > >>   File "/home/megha/www/www_mock/www_mock.wsgi", line 46, in <module>
> > >>     sysconnection = DBUtil.getSysConnection()
> > >> AttributeError: 'module' object has no attribute 'getSysConnection'
> >
> > >> On Thu, Dec 8, 2011 at 11:57 PM, andrei <andre...@gmail.com> wrote:
> >
> > >>> Try this: touch code.wsgi (assuming code.wsgi is your main
> executable)
> >
> > >>> On Dec 8, 7:57 pm, megha <megha.vishwan...@gmail.com> wrote:
> > >>> > Hi All,
> >
> > >>> > I'm at my wit's end, trying to figure out why this is happening.
> It's
> > >>> > likely to be a "python" related misunderstanding, but I want to be
> > >>> > sure I'm using wsgi & web.py correctly as well. My question is wrt
> an
> > >>> > AttributeError when I add a new method to an existing utility
> Module,
> > >>> > because web.py is not recognizing that the source has changed.
> >
> > >>> > This is my root dir
> >
> > >>> > \www
> > >>> >    \Utility
> > >>> >       __init__.py (empty)
> > >>> >       DBUtil.py
> >
> > >>> > DBUtil.py had these contents:
> >
> > >>> > import psycopg2
> > >>> > import os
> > >>> > from ConfigParser import SafeConfigParser
> >
> > >>> > def getConnection():
> > >>> >     config = SafeConfigParser()
> > >>> >     config.read(os.path.join(os.getcwd(),'config/dbconfig.ini'))
> > >>> >     db = config.get('Database','dbname')
> > >>> >     username = config.get('Database','user')
> > >>> >     passwd = config.get('Database','passwd')
> > >>> >     dsn = "dbname="+db+" user="+username+" host='localhost'
> > >>> > password="+passwd
> > >>> >     connection = psycopg2.connect(dsn)
> > >>> >     return connection
> >
> > >>> > I had to bring in another DB connection so I added:
> >
> > >>> > def getSysConnection():
> > >>> >     config = SafeConfigParser()
> > >>> >     config.read(os.path.join(os.getcwd(),'config/dbconfig.ini'))
> > >>> >     db = config.get('SysDatabase','sysdbname')
> > >>> >     username = config.get('SysDatabase','sysuser')
> > >>> >     passwd = config.get('SysDatabase','syspasswd')
> > >>> >     dsn = "dbname="+db+" user="+username+" host='localhost'
> > >>> > password="+passwd
> > >>> >     connection = psycopg2.connect(dsn)
> > >>> >     return connection
> >
> > >>> > I know web.py supports multidb, but I don't have time to reformat a
> > >>> > lot of the existing db usage.
> >
> > >>> > So, when I add this method and recompile it with command line
> python
> > >>> > this second method getSysConnection always throws me an Attribute
> > >>> > Error. Also I was not sure if the module was set up right so I
> moved
> > >>> > DButil.py into the same directory as the wsgi file and tried
> > >>> > referencing the methods, without success.
> >
> > >>> > If I try using this util in a python shell, it works ok. Is this a
> > >>> > problem with the way I compile the modified file. If I just delete
> > >>> > the .pyc and restart apache, the .pyc isn't getting recreated
> either.
> >
> > >>> > Any response may help me here.
> >
> > >>> > Thanks
> > >>> > -Megha
> >
> > >>> --
> > >>> You received this message because you are subscribed to the Google
> > >>> Groups "web.py" group.
> > >>> To post to this group, send email to webpy@googlegroups.com.
> > >>> To unsubscribe from this group, send email to
> > >>> webpy+unsubscr...@googlegroups.com.
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/webpy?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To post to this group, send email to webpy@googlegroups.com.
> To unsubscribe from this group, send email to
> webpy+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>
>

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

Reply via email to