Jump to content

arvy

Members
  • Posts

    6
  • Joined

  • Last visited

arvy's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. You rock, Krydos! The website with DjangoCMS is now working! (well to run correctly I have to lower the number of MySQL connections it needs or make SQLite work, but it's a different subject) Thanks for the help!
  2. Ok, figured it out! My issue was that I had to convert to ASCII the output. The following dispatcher code block works quite well and outputs the errors: #!/usr/bin/python3.6 import os, sys, logging application = None try: dirName = os.path.abspath(os.path.dirname(__file__) + '/..') sys.path.insert(1, dirName) sys.path.insert(1, dirName + "/libs") from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stantoine.settings") application = get_wsgi_application() except Exception as e: err = e def _application(env, start_response): global err start_response('200 OK', [('Content-Type','text/html')]) return [b"Error: ", str(err).encode('ascii')] application = _application I do sys.path.insert to use my own libraries before the global ones... I'm trying to use python packages that I copied in my project libs directory. Of course, it would fail for binaries. However it works with the container ndegardin/apache-wsgi:django I created to experiment with that: https://hub.docker.com/r/ndegardin/apache-wsgi/tags/ (that's an Alpine, but it has all the python extensions listed on your https://krydos.heliohost.org/cgi-bin/modules36.py page). Now, I can tell that my error is: Error: libjpeg.so.8: cannot open shared object file: No such file or directory It is related to the Python package Pillow, which needs the libjpeg, libpng, libjpeg-dev, libpng-dev, and zlib packages (maybe the names are bit different on the Heliohost Linux distribution)... So... would it be possible to have the python Pillow >=3.0 package installed, with its required libraries? Should I open a different post? Thanks!
  3. Thanks for the answer Krydos But adding a stantoine segment to the URL doesn't give better results. Also, I defined a subdomain: dev.centrestantoine.heliohost.org /public_html/stantoine So I was expecting the .htaccess to be relative to the /public_hmtl/stantoine directory. Also I had the feeling the .htaccess was fine because I get the right Django messages when I call the dispatcher instead of the hello world. For now I'll create a new subdomain a do some tests with the Django sample... I'll be happy when I'll make this helloworld work. Currently, I get a DNS error on both subdomains, I suppose I have to wait for them to be propagated. I notice also that you added the python 3.6 missing shebang, I thought about it recently, maybe that's the reason why things didn't behave as I expected. Well, thanks for the help so far, I'll try to understand some things with the test subdomain by myself and post again if I feel I have no more things to experiment with. Woops! The DNS not responding is due to the fact I'm dumb I'm often typing heliohost.com instead of heliohost.org...
  4. Hi Krydos, Well, my question was not really related to Django but to WSGI solely. But yes, I followed the guide and it worked. With my project, I can fall on a Django message stating that there are no route patterns, if I empty the "urls.py" file. So I consider that the Django setup is correct. Now, I have other errors 500 and would like to be able to know what's behind without pinging you every two minutes. The reason why I tried to put a try/except block (as described at the bottom of this Heliohost wiki page: http://wiki.helionet.org/Solving_Internal_Server_Errors) But the "except" code doesn't seem to work. And even a simple WSGI hello world doesn't (error 500, I don't know what's behind). What I do on my side goes a little beyond running Django, because I also try to run DjangoCMS (by embedding the Python libs in the project). For that, I reproduced your setup (well something close) on a Docker image, and the project worked locally. But I get the error 500 on Heliohost, so I would like to catch the exceptions to know what is different with my Docker container. Thanks for your help!
  5. Hi, I'm trying to deploy a Django website on Tommy, deployed in /home/arvy/public_html/stantoine, associated with the domain http://dev.centrestantoine.heliohost.org (subdomain alias). I get an error 500. I'm pretty sure my .htaccess configuration is right, because it returns a 404 error if I comment all the lines of this file. I was trying to add a try/catch block to display the error message, and sort it out by myself, but I realize that even a simple hello world block doesn't work: def application(environ, start_response): status = '200 OK' output = 'Hello World!\n' response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] I'm rather new in Python, so maybe I'm wrong with something. Any idea about the error 500 that occurs when trying to play that? The following code works on a local Apache + embedded WSGI configuration. Also, the standard code (what is currently commented in the dispatch.wsgi file) also works locally. Thanks for your help!
  6. username: arvy host: tommy domain: centrestantoine.heliohost.org Sorry, I've connected too much times by FTP with wrong credentials because I tried to use CodeShip to send github code through FTP (continuous deployment). And I didn't use the proper login in my CodeShip conf, so it retried many times by itself... I promise I'll be careful!
×
×
  • Create New...