C'est difficile de le savoir comme ça, mais la première chose que je 
tenterai, c'est de rajouter :

sys.path.append('/var/development/django')

Au fichier wsgi.py et de bouger:

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

Tout en bas du fichier.

Le mar. 17 juil. 2012 09:29:46 CEST, Gabriel MACHADO a écrit :
> Bonjour,
>
> J'ai fait des développements en utilisant le serveur http intégré à
> django.
> Je voudrais maintenant héberger mon appli sur un vrai serveur web, mais
> ça ne fonctionne pas.
>
> Voici mes fichiers de configuration :
>
> /etc/nginx/nginx.conf
> [code]
>  server {
>                 listen       80;
>                 server_name  budget;
>
>                 #charset koi8-r;
>
>                 access_log  /var/log/nginx/budget/host.access.log  main;
>
>                 location / {
>                         uwsgi_pass   unix:///var/run/uwsgi.sock;
>                         include        uwsgi_params;
>
>                 }
>
>                 location /static{
>                         alias  /var/development/django/budget/static;
>                 }
>         }
> [/code]
>
> Fichier de configuration /var/development/django/budget/django.ini :
> [code]
> [uwsgi]
> socket  = /var/run/uwgsi.sock
> chdir = /var/development/django/budget
> module = wsgi:application
> pidfile=/var/run/uwgsi.pid
> vacuum=True
> max-requests=5000
> daemonize=/var/log/uwsgi/budget.log
> [/code]
>
> Fichier de configuration /var/development/django/budget/wsgi.py
> [code]
> import os
> import sys
> import django.core.handlers.wsgi
>
> application = django.core.handlers.wsgi.WSGIHandler()
> os.environ['DJANGO_SETTINGS_MODULE'] = 'budget.settings'
> sys.path.append('/var/development/django/budget')
> [/code]
>
> Mon fichier de log :
> [code]
> *** Starting uWSGI 1.2.4 (32bit) on [Tue Jul 17 09:21:13 2012] ***
> compiled with version: 4.7.1 on 14 July 2012 11:03:35
> detected number of CPU cores: 2
> current working directory: /var/development/django/budget
> writing pidfile to /var/run/uwgsi.pid
> detected binary path: /usr/bin/uwsgi
> uWSGI running as root, you can use --uid/--gid/--chroot options
> *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
> *** WARNING: you are running uWSGI without its master process manager ***
> your memory page size is 4096 bytes
> detected max file descriptor number: 1024
> lock engine: pthread robust mutexes
> uwsgi socket 0 bound to UNIX address /var/run/uwgsi.sock fd 3
> Python version: 2.7.3 (default, Apr 24 2012, 00:06:13)  [GCC 4.7.0
> 20120414 (prerelease)]
> *** Python threads support is disabled. You can enable it with
> --enable-threads ***
> Python main interpreter initialized at 0x840b5d8
> your server socket listen backlog is limited to 100 connections
> *** Operational MODE: single process ***
> WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x840b5d8
> pid: 6835 (default app)
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI worker 1 (and the only) (pid: 6835, cores: 1)
> [/code]
>
> J'ai renseigné mon fichier hosts. nginx sert bien les fichiers statiques
> (css et images etc...), mais pas les pages dynamiques.
> J'ai des erreurs 502 Bad Gateway.
>
> Qu'est ce qui ne va pas dans ma configurantion ?
> _______________________________________________
> django mailing list
> [email protected]
> http://lists.afpy.org/mailman/listinfo/django


_______________________________________________
django mailing list
[email protected]
http://lists.afpy.org/mailman/listinfo/django

Répondre à