[Cherokee] uWSGI with Django, the configuration doesn't allow to append slash on urls.

13 views
Skip to first unread message

Mario César Señoranis Ayala

unread,
Sep 28, 2010, 12:03:50 PM9/28/10
to cherokee-project.com
Hi all,

I setup a Django project with uWsgi.

Using the wizard with this config xml file:

<uwsgi>
<pythonpath>/home/django/apps/sonrisas3/sonrisas</pythonpath>
<pythonpath>/home/django/apps/sonrisas3</pythonpath>
<pidfile>/home/django/apps/sonrisas3/var/run/sonrisas_no.pid</pidfile>
<app mountpoint="/">
<script>wsgi_handler</script>
</app>
<listen>100</listen>
<master />
<socket-timeout>5</socket-timeout>
<processes>4</processes>
</uwsgi>

The project starts great, but without appending slash to url's

If I go http://smilesofthestreet.no/admin it raises a view, and not
http://smilesofthestreet.no/admin/

For demonstrations:

Using fastcgi, here → http://creat1va.com/~sonrisas/admin # Here it
redirects to /admin/
Using uwsgi, here → http://smilesofthestreet.no/admin # Here not

Both with the same settings and same code.

any hints why it's happening?


--
Mario César Señoranis Ayala

_______________________________________________
Cherokee mailing list
Cher...@lists.octality.com
http://lists.octality.com/listinfo/cherokee

Roberto De Ioris

unread,
Sep 28, 2010, 1:33:31 PM9/28/10
to cher...@cherokee-project.com

> Hi all,
>
> I setup a Django project with uWsgi.
>
> Using the wizard with this config xml file:
>
> <uwsgi>
> <pythonpath>/home/django/apps/sonrisas3/sonrisas</pythonpath>
> <pythonpath>/home/django/apps/sonrisas3</pythonpath>
> <pidfile>/home/django/apps/sonrisas3/var/run/sonrisas_no.pid</pidfile>
<app mountpoint="/">
> <script>wsgi_handler</script>
> </app>
> <listen>100</listen>
> <master />
> <socket-timeout>5</socket-timeout>
> <processes>4</processes>
> </uwsgi>

Try substituting the block

<app mountpoint="/">
<script>wsgi_handler</script>
</app>

with only

<module>wsgi_handler</module>


--
Roberto De Ioris
http://unbit.it

--
Roberto De Ioris
http://unbit.it

Mario César Señoranis Ayala

unread,
Sep 28, 2010, 3:54:41 PM9/28/10
to cher...@lists.octality.com
On 28/09/10 13:33, Roberto De Ioris wrote:
> Try substituting the block
>
> <app mountpoint="/">
> <script>wsgi_handler</script>
> </app>
>
> with only
>
> <module>wsgi_handler</module>

Thank you,

I did and I have the same result.

--
Mario César Señoranis Ayala

_______________________________________________

Esteban Feldman

unread,
Sep 28, 2010, 4:50:39 PM9/28/10
to Mario César Señoranis Ayala, cher...@lists.octality.com
For me works out of the box using the same kind of configuration

<app mountpoint="/">
        <script>django_wsgi</script>
    </app>


2010/9/28 Mario César Señoranis Ayala <marioce...@gmail.com>



--
Chant Hare Krishna and Be Happy

Eka

Mario César Señoranis Ayala

unread,
Sep 28, 2010, 6:41:47 PM9/28/10
to Esteban Feldman, cher...@lists.octality.com
On 28/09/10 16:50, Esteban Feldman wrote:
For me works out of the box using the same kind of configuration

<app mountpoint="/">
        <script>django_wsgi</script>
    </app>


2010/9/28 Mario César Señoranis Ayala <marioce...@gmail.com>
 On 28/09/10 13:33, Roberto De Ioris wrote:
Try substituting the block

<app mountpoint="/">
 <script>wsgi_handler</script>
</app>

with only

<module>wsgi_handler</module>

Thank you,

I did and I have the same result.

I create again all the vserver, here is the new config file

<uwsgi>
    <pythonpath>/home/sonrisas/apps/sonrisas3/sonrisas</pythonpath>
    <pythonpath>/home/sonrisas/apps/sonrisas3</pythonpath>
    <pidfile>/home/sonrisas/apps/sonrisas3/var/run/sonrisas_no.pid</pidfile>
    <module>wsgi_handler</module>

    <listen>100</listen>
    <master />
    <socket-timeout>5</socket-timeout>
    <processes>4</processes>
</uwsgi>

the python module:

import os
import django.core.handlers.wsgi

os.environ['DJANGO_SETTINGS_MODULE'] = 'sonrisas.settings'

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

The vserver has a rule for the / directory with the uwsgi handler, I also try using the default handler, so. I am quite lost, as the fastcgi instance is running ok, why this not ?

Roberto De Ioris

unread,
Sep 29, 2010, 12:08:07 AM9/29/10
to Esteban Feldman, cher...@lists.octality.com

> For me works out of the box using the same kind of configuration
>
> <app mountpoint="/">
> <script>django_wsgi</script>
> </app>


Yes this is perfectly valid, i got a mistake in the first response.

The problem is with the "check file" option in the cherokee configuration.

It must be disabled.


--
Roberto De Ioris
http://unbit.it

Mario César Señoranis Ayala

unread,
Sep 29, 2010, 1:32:10 AM9/29/10
to - General Mailing List
On 29/09/10 00:08, Roberto De Ioris wrote:
>> > For me works out of the box using the same kind of configuration
>> >
>> > <app mountpoint="/">
>> > <script>django_wsgi</script>
>> > </app>
> Yes this is perfectly valid, i got a mistake in the first response.
>
> The problem is with the "check file" option in the cherokee configuration.
>
> It must be disabled.

Thank you !

that solve the problem :-)

--
Mario César Señoranis Ayala

_______________________________________________

Reply all
Reply to author
Forward
0 new messages