[pyar] Django en hosting compartido

Ezequiel Szturmaj ezequielsz en yahoo.com
Mie Sep 14 15:49:43 ART 2011


Muchas gracias por tu respuesta Alejandro, fue de mucha ayuda. Por las dudas
de que alguien tenga la misma duda, además hay que darle permisos al archivo
.fcgi (chmod 0755 archivo.fcgi).

¡Saludos!

El 12 de septiembre de 2011 20:34, alejandro autalan <
alejandroautalan en gmail.com> escribió:

> El lun, 12-09-2011 a las 18:03 -0300, Ezequiel Szturmaj escribió:
> > Hola gente de la lista, hace un par de días contraté los servicios de
> > deeperhost[0] para realizar un sitio con Django. El problema es que no
> > logro que Apache funcione con mis scripts (cuando accedo al sitio me
> > aparece una página predeterminada por el servidor, no la de Django).
> >
> > Configuré el archivo .htaccess y misitio.fcgi basandome en la
> > siguiente documentación:
> >
> https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache
> >
> > El .htaccess quedó:
> >
> > AddHandler fcgid-script .fcgi
> > RewriteEngine On
> > RewriteCond %{REQUEST_FILENAME} !-f
> > RewriteRule ^(.*)$ misitio.fcgi/$1 [QSA,L]
> >
> > y misitio.fcgi:
> >
> > #!/usr/bin/python
> > import sys
> > import os
> >
> > # Insert PYTHONPATH values here, including the path to your
> > application
> > sys.path.insert(0, '/home/usuario/public_html/
> > misitio/')
> > # Switch to the directory of your project. (Optional.)
> > os.chdir("/home/usuario/public_html/misitio")
> > # Provide the location of your application's settings file.
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'misitio.settings'
> >
> > from django.core.servers.fastcgi import runfastcgi
> > runfastcgi(method = "threaded", daemonize = "false", maxchildren=3,
> > minspare=0, maxspare=1)
> >
> > En /home/usuario/public_html/ están:
> > -.htaccess
> > -misitio.fcgi
> > -misitio/
> >
> > y dentro de /misitio/misitio se encuentran urls.py, etc.
> >
> >
> > Envié mis dudas al soporte del deeperhost, pero me enviaron un
> > tutorial con lo mismo que hice...
> > Si alguien tiene experiencia en ésto y me puede dar una mano, se lo
> > agradecería muchísimo!
> > Gracias!
> >
> > [0] http://www.deeperhost.net
> > _______________________________________________
> > pyar mailing list pyar en python.org.ar
> > http://listas.python.org.ar/listinfo/pyar
> >
> > PyAr - Python Argentina - Sitio web: http://www.python.org.ar/
> >
> > La lista de PyAr esta Hosteada en USLA - Usuarios de Software Libre de
> Argentina - http://www.usla.org.ar
>
>
> Holas que tal. Tengo una cuenta también en deeperhost pero con el sitio
> principal en php. Sin embargo, tengo una aplicación de prueba con django
> y configurada como muestro a continuación. Ahora mismo no recuerdo el
> por qué la configure así pero bueno, espero que la info te ayude:
>
> Directorio donde esta la App django:  /home/usuario/projects/djtest
> Dir del script: /home/usuario/public_html/cgi-bin/djtest.fcgi
> Dir del .htaccess: /home/usuario/public_html/djtest  (se accede a la app
> desde www.misitio.com.ar/djtest)
>
>
> djtest.fcgi:
> ===========
> #!/usr/bin/python
> import sys, os
>
> # Add a custom Python path.
> sys.path.insert(0, "/home/usuario/lib/python")
> sys.path.insert(0, "/home/usuario/projects")
>
> # Switch to the directory of your project. (Optional.)
> #os.chdir("/home/usuario/projects")
>
> # Set the DJANGO_SETTINGS_MODULE environment variable.
> os.environ['DJANGO_SETTINGS_MODULE'] = "djtest.settings"
>
> from django.core.servers.fastcgi import runfastcgi
> runfastcgi(method="threaded", daemonize="false")
>
>
> .htaccess:
> =========
> AddHandler fastcgi-script .fcgi
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ /cgi-bin/djtest.fcgi/$1 [QSA,L]
>
>
> Saludos.
>
>
> _______________________________________________
> pyar mailing list pyar en python.org.ar
> http://listas.python.org.ar/listinfo/pyar
>
> PyAr - Python Argentina - Sitio web: http://www.python.org.ar/
>
> La lista de PyAr esta Hosteada en USLA - Usuarios de Software Libre de
> Argentina - http://www.usla.org.ar
>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20110914/7d74499a/attachment.html>


More information about the pyar mailing list