Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: users

Django setup/URL problem

 

 

Cherokee users RSS feed   Index | Next | Previous | View Threaded


public at openinformation

Jul 5, 2009, 12:42 PM

Post #1 of 3 (560 views)
Permalink
Django setup/URL problem

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everybody,

Cherokee is becoming my server of choice and I am currently trying to
use it with Django.

My test setup follows the documentation closely
(http://www.cherokee-project.com/doc/cookbook_django.html), and I get to
the Django welcome page without problems. But Cherokee/Django ignore all
URL patterns and always return this welcome page, for any URL I enter.

It does not seem to be a Django problem - my testapp is very simple and
it (and the Django admin) runs perfectly when I use the development
server that is included with Django.

More specific setup info:

- - the django project lives in a subfolder of the default virtual server,
/test

- - the Information source is setup as described in the manual and seems
to work fine (can I confirm this somehow?)

- - in the default virtual server, a directory handler for the /test
directory is set up, using the SCGI handler as described in the
documentation. This seems to work fine as well, as I see the Django
welcome page when accessing 127.0.0.1/test

Despite all this, any URL below 127.0.0.1/test/ just returns the Welcome
page. It also doesn't throw errors when I enter non-existent URLs, even
though debug_info is enabled in Django.

I found this thread from August 2008, which seemed to address a similar
problem:
http://lists.octality.com/pipermail/cherokee/2008-August/008801.html

However, none of the workarounds discussed in there works.

Does anybody have an idea what is wrong? Just let me know if you need
more information.

Thanks in advance, and thanks for Cherokee in general, I like it very
much so far!

Saludos,
Gregor
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpRAhEACgkQepJNjKMaIWXJXQCfTy6llZTncxARfIAeFIZkPqk1
kykAnA0InKQcYQYB6Ir+M/IGhzR2Dwok
=8+fV
-----END PGP SIGNATURE-----
_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


public at openinformation

Jul 6, 2009, 3:54 AM

Post #2 of 3 (539 views)
Permalink
Re: Django setup/URL problem [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Despite all this, any URL below 127.0.0.1/test/ just returns the Welcome
> page. It also doesn't throw errors when I enter non-existent URLs, even
> though debug_info is enabled in Django.

Nevermind, I found the (my) mistake:

I did not realize that the fcgi server process, once launched by
Cherokee, exists independently. So when I change some Django code (e.g.
URL patterns), I have to reload this process - which cannot be done by
restarting cherokee.

As it took me some while to figure out how to do this, here is my
current solution:

- - ps ax -> to find the pid of the python process which is in charge of
the fcgi process

- - kill -9 "pid-of-python-process"

That's it, the fcgi process is restarted (with the changed code) the
next time a request is made to a Django-governed URL.

Two little questions remain:

- - at the end of the Cherokee Danfo documentation
(http://www.cherokee-project.com/doc/cookbook_django.html) there is an
example for deploying "your Django application directly instead of
through manage.py" - does this mean the fcgi reload will be
automatically done when restarting Cherokee? And could someone explain
the setup in more detail?

- - the Django docs suggest adding "pidfile=django.pid" as a parameter
when starting the fcgi server, so it is easier to kill
(http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#examples).
When I add this parameter in the Cherokee admin information source, I
get a 503 error for the URLs that are supposed to be handled by Django.
What can be the reason for this?

Saludos,
Gregor
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpR1+sACgkQepJNjKMaIWUezwCeLvnCJWvuviTnxw3Razb1ADSq
GmAAn1ov5Z0Zk9W2Jb6qDo8OknwvIuvy
=X3+C
-----END PGP SIGNATURE-----
_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


listas at enelserver

Jul 6, 2009, 7:08 AM

Post #3 of 3 (544 views)
Permalink
Re: Django setup/URL problem [In reply to]

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>> Despite all this, any URL below 127.0.0.1/test/ just returns the Welcome
>> page. It also doesn't throw errors when I enter non-existent URLs, even
>> though debug_info is enabled in Django.
>
> Nevermind, I found the (my) mistake:
>
> I did not realize that the fcgi server process, once launched by
> Cherokee, exists independently. So when I change some Django code (e.g.
> URL patterns), I have to reload this process - which cannot be done by
> restarting cherokee.
>
> As it took me some while to figure out how to do this, here is my
> current solution:
>
> - - ps ax -> to find the pid of the python process which is in charge of
> the fcgi process
>
> - - kill -9 "pid-of-python-process"
>
> That's it, the fcgi process is restarted (with the changed code) the
> next time a request is made to a Django-governed URL.
>

or you can use the manage.py runserver to develop or edit your code
this way every modification is noticed by django


or you can launch the your django process with the parameter :

daemonize=false

this way you can just CRTL-C and relaunch on every modification




Saludos

Leonel


_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee

Cherokee users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.