Hébergement Web-old - Python non ajouter
... / Python non ajouter
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

Python non ajouter

Von
MOHAMED_AYMENH
Erstellungsdatum 2024-10-21 07:05:16 (edited on 2024-11-18 11:04:50) in Hébergement Web-old

Bonjour,

Je suis le propriétaire d'une société en cours de création pour mes besoins. J'ai déjà déployé mon projet utilisant Angular et Spring Boot. Le problème concerne la gestion de l'IA avec Python, notamment pour une IA de discussion, qui me renvoie une erreur 500. Je suis convaincu d'avoir correctement configuré l'ensemble, mais je souhaite vous faire part de la partie liée à Spring Boot afin de vous donner le plus de contexte possible concernant le problème.

[Unit]
Description=Application Django ecomme AI
After=network.target
[Service]
User=www-data
Group=www-data
WorkingDirectory=/var/www/ecomme/ai
ExecStart=/var/www/venv/bin/gunicorn --workers 3 --bind unix:/var/www/ecomme/ai/gunicorn.sock -m 007 ai.wsgi:application
Environment=DJANGO_SETTINGS_MODULE=ai.settings
Environment=PYTHONUNBUFFERED=1
Environment=PYTHONPATH=/var/www/ecomme
Restart=on-failure
Umask=007
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target

nginx

server {
listen 80;
server_name cognitiex.com www.cognitiex.com;

# Rediriger toutes les requêtes HTTP vers HTTPS
return 301 https://$host$request_uri;
}

server {
listen 443 ssl; # Écouter sur le port 443 pour SSL
server_name cognitiex.com; # Domaine sans www

ssl_certificate /etc/letsencrypt/live/cognitiex.com/fullchain.pem; # Chemin vers le certificat
ssl_certificate_key /etc/letsencrypt/live/cognitiex.com/privkey.pem; # Chemin vers la clé privée

return 301 https://www.cognitiex.com$request_uri; # Redirection vers www.cognitiex.com
}

server {
listen 443 ssl; # Écouter sur le port 443 pour SSL
server_name www.cognitiex.com; # Domaine avec www

ssl_certificate /etc/letsencrypt/live/cognitiex.com/fullchain.pem; # Chemin vers le certificat
ssl_certificate_key /etc/letsencrypt/live/cognitiex.com/privkey.pem; # Chemin vers la clé privée

root /var/www/ecomme/dist/accounts/browser; # Chemin vers les fichiers
index index.html index.htm;

location / {
try_files $uri $uri/ /index.html; # Sert les fichiers Angular
}
location /py/ {
proxy_pass http://unix:/var/www/ecomme/ai/gunicorn.sock;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
add_header 'Access-Control-Allow-Origin' 'https://www.cognitiex.com' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
}

location /static/ {
alias /var/www/ecomme/ai/staticfiles/; # Chemin vers vos fichiers statiques
}

# Ajouter le service des fichiers médias de Django (si nécessaire)
location /media/ {
alias /var/www/ecomme/ai/media/; # Chemin vers vos fichiers médias
}

error_page 403 /403.html; # Gestion des erreurs
location = /403.html {
internal;
}
}
erreur 500


1 Antwort ( Latest reply on 2024-10-21 15:58:42 Von
MOHAMED_AYMENH
)

Notez bien que l'administration Django fonctionne correctement, notamment pour les opérations CRUD. Cependant, dans l'application assistance qui contient des IA ayant des besoins différents, une erreur 500 est renvoyée