Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-21 Thread Another Django Newbie


On Wednesday, March 21, 2012 10:29:48 AM UTC, Jani Tiainen wrote:
>
> Like this:
>
> 'default': {
>'ENGINE': '...',
>'OPTIONS': {
>   'threaded': True
>}
> }
>

Thanks again Jani, switching my question to the modwsgi group 

Regards, ADN
 

>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Whpuuwt22WEJ.
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: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-21 Thread Another Django Newbie


On Wednesday, March 21, 2012 7:18:16 AM UTC, Jani Tiainen wrote:
>
> 20.3.2012 16:45, Another Django Newbie kirjoitti:
> >
> >
> > On Tuesday, March 20, 2012 10:28:49 AM UTC, Another Django Newbie wrote:
> >
> >
> >
> > On Tuesday, March 20, 2012 10:01:36 AM UTC, Tom Evans wrote:
> >
> > On Mon, Mar 19, 2012 at 5:24 PM, Jani Tiainen 
> > wrote:
> >  > Hi,
> >  >
> >  > Since we use same setup except one part: we use mod_wsgi
> > instead of
> >  > mod_fcgi.
> >  >
> >  > (Since wsgi is considered to be defacto protocol). Could you
> > try to use it?
> >  >
> >
> > WSGI is the de-facto for hosting python in web servers. If you
> > aren't
> > running just python, it's nice to use the same hosting mechanism 
> for
> > all your apps, and fastcgi is a supported mechanism.
> >
> > OP: You mention using mod_fcgid, but you do not give us any idea 
> of
> > how you are using mod_fcgid. Configuration and error logs
> > please. FYI,
> > we run django quite happily under mod_fastcgi.
> >
> > Cheers
> >
> > Tom
> >
> >
> >
> > Hi Tom, Jani,
> >
> > Currently struggling to compile mod_wsgi, or more specifically a
> > shared library version of python - something to do with mismatched
> > 32/64 bit libraries I think.
> >
> > Here's an extract from httpd.conf.
> >
> > RewriteEngine On
> > RewriteRule ^.*/cfServer/(.*)$ /cgi-bin/django.cgi/$1 [PT]
> > 
> > Options ExecCGI
> > AddHandler fcgid-script .cgi
> > # AddHandler cgi-script .cgi
> > Require all granted
> > 
> >
> > and the relevant django.cgi
> >
> > #!/usr/local/bin/python
> > from FcgiWsgiAdapter import list_environment, serve_wsgi
> >
> > import os, sys
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'cfServer.settings'
> > os.environ['ORACLE_HOME'] = '/oracle/11gStdEd'
> >
> > from django.core.handlers.wsgi import WSGIHandler
> >
> > # use this to test that fastcgi works and to inspect the environment
> > # serve_wsgi(list_environment)
> > # use this to serve django
> > serve_wsgi(WSGIHandler())
> >
> > The "FcgiWsgiAdapter" referred to came from djangosnippets.org
> > <http://djangosnippets.org/snippets/1307/>.
> >
> > As to error logs, as I mentioned in the original post I don't see
> > anything added to any logs when this happens and there is only a
> > warning about the ssl library when apache is restarted.
> >
> > Regards, ADN
> >
> >
> >
> > *So I swapped to using WSGI with this apache config *
> >
> > WSGIScriptAlias / /home/user/python/djcode/cfServer/apache/django.wsgi
> > WSGIDaemonProcess site-1 threads=30
> > WSGIProcessGroup site-1
> >
> > 
> > AllowOverride None
> > Options None
> > Require all granted
> > 
> >
> > and this django.wsgi
> >
> > import os, sys
> > sys.path.append('/home/user/python/djcode')
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'cfServer.settings'
> > os.environ['ORACLE_HOME'] = '/oracle/11gStdEd'
> > os.environ['PYTHON_EGG_CACHE'] = '/var/www/.python-eggs'
> >
> > import django.core.handlers.wsgi
> >
> > application = django.core.handlers.wsgi.WSGIHandler()
> >
> > and I get segmentation faults (debug level tracing from apache error log)
> >
> > [Tue Mar 20 14:16:28.126341 2012] [core:notice] [pid 17487:tid
> > 47401308446624] AH00051: child pid 17490 exit signal Segmentation fault
> > (11), possible coredump in /tmp/apache2-gdb-dump
> > [Tue Mar 20 14:16:28.126385 2012] [:info] [pid 17487:tid 47401308446624]
> > mod_wsgi (pid=17490): Process 'site-2' has died, deregister and restart 
> it.
> > [Tue Mar 20 14:16:28.126394 2012] [:info] [pid 17487:tid 47401308446624]
> > mod_wsgi (pid=17490): Process 'site-2' has been deregistered and will no
> > longer be monitored.
> > [Tue Mar 20 14:16:28.126826 2012] [:info] [pid 17846:tid 47401308446624]
> > mod_wsgi (pid=17846): Starting process 'site-2' with uid=48, gid=48 and
> > threads=25.
> > [Tue Mar 20 14:16:28.127268 2012] [:info] [pid 17846:tid 47401308446624]
> > mod_wsgi (pid=17846): Initializing Python.
> >
> > Back trace

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-20 Thread Another Django Newbie


On Tuesday, March 20, 2012 10:28:49 AM UTC, Another Django Newbie wrote:
>
>
>
> On Tuesday, March 20, 2012 10:01:36 AM UTC, Tom Evans wrote:
>>
>> On Mon, Mar 19, 2012 at 5:24 PM, Jani Tiainen  wrote:
>> > Hi,
>> >
>> > Since we use same setup except one part: we use mod_wsgi instead of
>> > mod_fcgi.
>> >
>> > (Since wsgi is considered to be defacto protocol). Could you try to use 
>> it?
>> >
>>
>> WSGI is the de-facto for hosting python in web servers. If you aren't
>> running just python, it's nice to use the same hosting mechanism for
>> all your apps, and fastcgi is a supported mechanism.
>>
>> OP: You mention using mod_fcgid, but you do not give us any idea of
>> how you are using mod_fcgid. Configuration and error logs please. FYI,
>> we run django quite happily under mod_fastcgi.
>>
>> Cheers
>>
>> Tom
>>
>
>
> Hi Tom,  Jani,
>
> Currently struggling to compile mod_wsgi, or more specifically a shared 
> library version of python - something to do with mismatched 32/64 bit 
> libraries I think.
>
> Here's an extract from httpd.conf.
>
> RewriteEngine On
> RewriteRule ^.*/cfServer/(.*)$ /cgi-bin/django.cgi/$1 [PT]
> 
> Options ExecCGI
> AddHandler fcgid-script .cgi
> # AddHandler cgi-script .cgi
> Require all granted
> 
>
> and the relevant django.cgi
>
> #!/usr/local/bin/python
> from FcgiWsgiAdapter import list_environment, serve_wsgi
>
> import os, sys
> os.environ['DJANGO_SETTINGS_MODULE'] = 'cfServer.settings'
> os.environ['ORACLE_HOME'] = '/oracle/11gStdEd'
>
> from django.core.handlers.wsgi import WSGIHandler
>
> # use this to test that fastcgi works and to inspect the environment
> # serve_wsgi(list_environment)
> # use this to serve django
> serve_wsgi(WSGIHandler())
>
> The "FcgiWsgiAdapter" referred to came from 
> djangosnippets.org<http://djangosnippets.org/snippets/1307/>
> .
>
> As to error logs, as I mentioned in the original post I don't see anything 
> added to any logs when this happens and there is only a warning about the 
> ssl library when apache is restarted.
>
> Regards, ADN
>


*So I swapped to using WSGI with this apache config *

WSGIScriptAlias / /home/user/python/djcode/cfServer/apache/django.wsgi
WSGIDaemonProcess site-1 threads=30
WSGIProcessGroup site-1


AllowOverride None
Options None
Require all granted


and this django.wsgi

import os, sys
sys.path.append('/home/user/python/djcode')
os.environ['DJANGO_SETTINGS_MODULE'] = 'cfServer.settings'
os.environ['ORACLE_HOME'] = '/oracle/11gStdEd'
os.environ['PYTHON_EGG_CACHE'] = '/var/www/.python-eggs'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

and I get segmentation faults (debug level tracing from apache error log)

[Tue Mar 20 14:16:28.126341 2012] [core:notice] [pid 17487:tid 
47401308446624] AH00051: child pid 17490 exit signal Segmentation fault 
(11), possible coredump in /tmp/apache2-gdb-dump
[Tue Mar 20 14:16:28.126385 2012] [:info] [pid 17487:tid 47401308446624] 
mod_wsgi (pid=17490): Process 'site-2' has died, deregister and restart it.
[Tue Mar 20 14:16:28.126394 2012] [:info] [pid 17487:tid 47401308446624] 
mod_wsgi (pid=17490): Process 'site-2' has been deregistered and will no 
longer be monitored.
[Tue Mar 20 14:16:28.126826 2012] [:info] [pid 17846:tid 47401308446624] 
mod_wsgi (pid=17846): Starting process 'site-2' with uid=48, gid=48 and 
threads=25.
[Tue Mar 20 14:16:28.127268 2012] [:info] [pid 17846:tid 47401308446624] 
mod_wsgi (pid=17846): Initializing Python.

Back trace on core file ...

Core was generated by `/usr/local/apache2/bin/httpd -k start'.
Program terminated with signal 11, Segmentation fault.
#0  0x0036422cb2e6 in poll () from /lib64/libc.so.6
(gdb) bt
#0  0x0036422cb2e6 in poll () from /lib64/libc.so.6
#1  0x2b1c7a05dd79 in apr_poll (aprset=0x7fff13f01e40, num=1,
nsds=0x7fff13f01e94, timeout=0) at poll/unix/poll.c:120
#2  0x2b1c7d5166d3 in wsgi_daemon_main (p=0x1257a138, daemon=0x12696218)
at mod_wsgi.c:11330
#3  0x2b1c7d51851f in wsgi_start_process (p=0x1257a138, 
daemon=0x12696218)
at mod_wsgi.c:11969
#4  0x2b1c7d518f50 in wsgi_start_daemons (pconf=0x1257a138,
ptemp=, plog=,
s=) at mod_wsgi.c:12181
#5  wsgi_hook_init (pconf=0x1257a138, ptemp=,
plog=, s=) at mod_wsgi.c:13755
#6  0x00444c2c in ap_run_post_config (pconf=0x1257a138,
plog=0x125df538, ptemp=0x125a5348, s=0x125a3508) at config.c:101
#7  0x00428734 in main (argc=3, argv=0x7fff13f02498) at main.c:765



Using WSGI briefly solved the original problem, in that I could see the 
complete admin page that was previously truncated but now nothing works - I 
ge

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-20 Thread Another Django Newbie


On Tuesday, March 20, 2012 10:01:36 AM UTC, Tom Evans wrote:
>
> On Mon, Mar 19, 2012 at 5:24 PM, Jani Tiainen  wrote:
> > Hi,
> >
> > Since we use same setup except one part: we use mod_wsgi instead of
> > mod_fcgi.
> >
> > (Since wsgi is considered to be defacto protocol). Could you try to use 
> it?
> >
>
> WSGI is the de-facto for hosting python in web servers. If you aren't
> running just python, it's nice to use the same hosting mechanism for
> all your apps, and fastcgi is a supported mechanism.
>
> OP: You mention using mod_fcgid, but you do not give us any idea of
> how you are using mod_fcgid. Configuration and error logs please. FYI,
> we run django quite happily under mod_fastcgi.
>
> Cheers
>
> Tom
>


Hi Tom,  Jani,

Currently struggling to compile mod_wsgi, or more specifically a shared 
library version of python - something to do with mismatched 32/64 bit 
libraries I think.

Here's an extract from httpd.conf.

RewriteEngine On
RewriteRule ^.*/cfServer/(.*)$ /cgi-bin/django.cgi/$1 [PT]

Options ExecCGI
AddHandler fcgid-script .cgi
# AddHandler cgi-script .cgi
Require all granted


and the relevant django.cgi

#!/usr/local/bin/python
from FcgiWsgiAdapter import list_environment, serve_wsgi

import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'cfServer.settings'
os.environ['ORACLE_HOME'] = '/oracle/11gStdEd'

from django.core.handlers.wsgi import WSGIHandler

# use this to test that fastcgi works and to inspect the environment
# serve_wsgi(list_environment)
# use this to serve django
serve_wsgi(WSGIHandler())

The "FcgiWsgiAdapter" referred to came from 
djangosnippets.org
.

As to error logs, as I mentioned in the original post I don't see anything 
added to any logs when this happens and there is only a warning about the 
ssl library when apache is restarted.

Regards, ADN

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/uJNwanmADZIJ.
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: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-19 Thread Another Django Newbie


On Thursday, March 15, 2012 1:05:53 PM UTC, Another Django Newbie wrote:
>
> Hi, 
>
> I've just started playing with django this week and was following the 
> example in the Django Book. 
>
> I created an example of my own, based on the models.py in the book and 
> tested it with manage.py runserver. All worked OK, but when I try it 
> in apache one of my admin pages is truncated - a number of fields are 
> left off and there is no Save button. The exact number of fields 
> truncated depends on whether I use Add from the main page or from the 
> Add page of another field (so that the affected page is a pop-up) 
>
> Apache 2.4.1 
> mod_fcgid 2.3.6 
> django 1.3.1 
> Python 2.7.2 
> cx-Oracle 5.1.1 
>
> Has anyone seen this behaviour? I've looked in apache and django logs 
> but don't see anything recorded when the page loads. Any ideas greatly 
> appreciated. 
>
> Thanks.


Bump  I've had no luck with this and would still appreciate some 
pointers! I've tried re-arranging the order of statements in my model code 
without any improvement.




 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/asZ5sigBBuQJ.
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.



Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-15 Thread Another Django Newbie
Hi,

I've just started playing with django this week and was following the
example in the Django Book.

I created an example of my own, based on the models.py in the book and
tested it with manage.py runserver. All worked OK, but when I try it
in apache one of my admin pages is truncated - a number of fields are
left off and there is no Save button. The exact number of fields
truncated depends on whether I use Add from the main page or from the
Add page of another field (so that the affected page is a pop-up)

Apache 2.4.1
mod_fcgid 2.3.6
django 1.3.1
Python 2.7.2
cx-Oracle 5.1.1

Has anyone seen this behaviour? I've looked in apache and django logs
but don't see anything recorded when the page loads. Any ideas greatly
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.