Mailing List Archive

Django URL mapping...
I have a Django application that I want to expose through Cherokee. The Django app works correctly with manage.py runserver. But currently, Cherokee can't seem to find any of the URLs. I am new to web server configuration, so please forgive blatantly obvious lacks of knowledge.

The Django app is called 'triagedb'. The project resides in the /var/www/triagedb directory. Currently I have a virtual server configured with the nickname, NurseTriage. It has a directory type rule associated with the /var/www/ directory. Below that is a rule for the triagedb application. The handler for it is SCGI and has a typical entry for a Django application. I have tried it with both no optional home directory and a home directory of /var/www/triagedb. You can see it in the Cherokee vserver config file I've included below.

All traffic from the triagedb app must go over SSL. Right now the rules in Cherokee seem to be working properly, but the virtual server claims there is no content associated with it.

So I guess the question is, how do I make Cherokee recognize and launch my Django app when someone hits the /NurseTriage/triagedb portion of the URL.

System Info:
Ubuntu/64 2.6.32-33
Cherokee 1.0.14-1
Django 1.1.1-2ubuntu1.3

And my Cherokee config:

config!version = 001000014
server!bind!1!port = 80
server!bind!1!tls = 0
server!bind!2!port = 443
server!bind!2!tls = 1
server!bind!3!port = 8080
server!bind!3!tls = 0
server!group = www-data
server!ipv6 = 1
server!keepalive = 1
server!keepalive_max_requests = 500
server!panic_action = /usr/share/cherokee/cherokee-panic
server!pid_file = /var/run/cherokee.pid
server!server_tokens = full
server!timeout = 15
server!tls = libssl
server!user = www-data
vserver!10!directory_index = index.html
vserver!10!document_root = /var/www
vserver!10!error_writer!filename = /var/log/cherokee/cherokee.error
vserver!10!error_writer!type = file
vserver!10!logger = combined
vserver!10!logger!access!buffsize = 16384
vserver!10!logger!access!filename = /var/log/cherokee/cherokee.access
vserver!10!logger!access!type = file
vserver!10!nick = default
vserver!10!rule!5!encoder!gzip = allow
vserver!10!rule!5!handler = server_info
vserver!10!rule!5!handler!type = just_about
vserver!10!rule!5!match = directory
vserver!10!rule!5!match!directory = /about
vserver!10!rule!4!document_root = /usr/lib/cgi-bin
vserver!10!rule!4!handler = cgi
vserver!10!rule!4!match = directory
vserver!10!rule!4!match!directory = /cgi-bin
vserver!10!rule!3!document_root = /usr/share/cherokee/themes
vserver!10!rule!3!handler = file
vserver!10!rule!3!match = directory
vserver!10!rule!3!match!directory = /cherokee_themes
vserver!10!rule!2!document_root = /usr/share/cherokee/icons
vserver!10!rule!2!handler = file
vserver!10!rule!2!match = directory
vserver!10!rule!2!match!directory = /icons
vserver!10!rule!1!handler = common
vserver!10!rule!1!handler!iocache = 1
vserver!10!rule!1!match = default
vserver!10!ssl_certificate_file = /var/www/server_crt.pem
vserver!10!ssl_certificate_key_file = /var/www/server_key.pem
vserver!20!document_root = /var/www/media
vserver!20!nick = media
vserver!20!rule!40!handler = streaming
vserver!20!rule!40!handler!rate = 1
vserver!20!rule!40!handler!rate_boost = 10
vserver!20!rule!40!handler!rate_factor = 0.5
vserver!20!rule!40!match = and
vserver!20!rule!40!match!left = extensions
vserver!20!rule!40!match!left!extensions = mp3,ogv,flv,mov,ogg,mp4,webm
vserver!20!rule!40!match!right = bind
vserver!20!rule!40!match!right!bind!1 = 3
vserver!20!rule!30!document_root = /usr/share/cherokee/themes
vserver!20!rule!30!handler = file
vserver!20!rule!30!match = directory
vserver!20!rule!30!match!directory = /cherokee_themes
vserver!20!rule!20!document_root = /usr/share/cherokee/icons
vserver!20!rule!20!handler = file
vserver!20!rule!20!match = directory
vserver!20!rule!20!match!directory = /icons
vserver!20!rule!10!handler = common
vserver!20!rule!10!match = default
vserver!30!document_root = /var/www
vserver!30!nick = NurseTriage
vserver!30!rule!40!document_root = /var/www/triagedb
vserver!30!rule!40!encoder!gzip = 1
vserver!30!rule!40!handler = scgi
vserver!30!rule!40!handler!balancer = round_robin
vserver!30!rule!40!handler!balancer!source!10 = 11
vserver!30!rule!40!handler!check_file = 0
vserver!30!rule!40!handler!error_handler = 1
vserver!30!rule!40!match = and
vserver!30!rule!40!match!left = directory
vserver!30!rule!40!match!left!directory = /triagedb
vserver!30!rule!40!match!right = tls
vserver!30!rule!40!only_secure = 1
vserver!30!rule!30!document_root = /usr/share/cherokee/themes
vserver!30!rule!30!handler = file
vserver!30!rule!30!match = directory
vserver!30!rule!30!match!directory = /cherokee_themes
vserver!30!rule!20!document_root = /usr/share/cherokee/icons
vserver!30!rule!20!handler = file
vserver!30!rule!20!match = directory
vserver!30!rule!20!match!directory = /icons
vserver!30!rule!10!handler = common
vserver!30!rule!10!match = default
vserver!30!ssl_certificate_file = /var/www/server_crt.pem
vserver!30!ssl_certificate_key_file = /var/www/server_key.pem
source!11!host = 127.0.0.1:44945
source!11!interpreter = python /var/www/triagedb/manage.py runfcgi protocol=scgi host=127.0.0.1 port=44945
source!11!nick = Django 11
source!11!type = interpreter

Thanx in advance:

Brian
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: Django URL mapping... [ In reply to ]
Hello Brian,

On Fri, Aug 26, 2011 at 1:38 AM, Brian Myers <tarkawebfoot@gmail.com> wrote:

> I have a Django application that I want to expose through Cherokee. The
> Django app works correctly with manage.py runserver. But currently, Cherokee
> can't seem to find any of the URLs. I am new to web server configuration, so
> please forgive blatantly obvious lacks of knowledge.


I'd recommend you to use
CHEROKEE_TRACE<http://www.cherokee-project.com/doc/dev_debug.html>.
It is a server introspection facility that usually comes quite useful while
performing this kind of setups.

--
Greetings, alo
http://www.octality.com/