juanky Posted September 4, 2017 Posted September 4, 2017 Hi all, Now project dependencies seems to be satisfied, my Django website is not properly configured because it is not loaded when accesing to https://inforiesgo.heliohost.org/ File .htaccess seems to be correct, I have followed the steps described in the Django wiki. I think the problem could be related to: Postgres: I created the postgres database and changed settings.py file in order to use this new database. Anyway, the creation of this database is just to create and asign it a superuser, not launching commands such as manage.py makemigrations or migrate, so the database should be empty. settings.py database configuration looks like: 'NAME': 'iniesta_inforiesgo', 'USER': 'iniesta_juanky', 'PASSWORD':*****, 'HOST':'127.0.0.1', 'PORT': '5432' static files: I made no changes related to the static files, so settings.py is the same than the one working in localhost:STATIC_URL = '/static/' Any help would be grateful.Thanks!
Krydos Posted September 4, 2017 Posted September 4, 2017 To troubleshoot missing modules I highly recommend making a simple helloworld cgi and adding each import one at a time until it throws a 500 error. You can also follow this guide https://www.helionet.org/index/topic/29544-python-27-module-request500-error-troulbeshooting/?p=133824 to use a cron to find your error, although that doesn't always work with django/flask because they are loaded through wsgi. Let us know what you find.
juanky Posted September 5, 2017 Author Posted September 5, 2017 (edited) To troubleshoot missing modules I highly recommend making a simple helloworld cgi and adding each import one at a time until it throws a 500 error. You can also follow this guide https://www.helionet.org/index/topic/29544-python-27-module-request500-error-troulbeshooting/?p=133824 to use a cron to find your error, although that doesn't always work with django/flask because they are loaded through wsgi. Let us know what you find. Thanks! I realized my project also has dependencies with modules json and datetime but these are supposed to be included in python distribution by default, so I don't think the problem is there. Anyway, this topic doesn't ask for python modules installation so maybe I didn't explain myself correctly. My doubts are related to static files and/or postgres database configuration. Is there a guide or something explaining how to configure them properly on heliohost? Edited September 5, 2017 by juanky
Krydos Posted September 5, 2017 Posted September 5, 2017 postgres database configuration. Is there a guide or something explaining how to configure them properly on heliohost?You create the username and password, and grant permissions at https://tommy.heliohost.org:2083/frontend/paper_lantern/psql/index.html Depending on what you create it will look something like this:username = iniesta_user database = iniesta_db password = <whatever> port = 5432 host = localhost My doubts are related to static filesTake a look at http://wiki.helionet.org/Django The .htaccess file is where you define your static file directories that won't be processed through dispatch.wsgiRewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] You can add as many directories as you want or change media and admin_media to whatever you want, but whatever you put in there will be served directly from apache to the browser without being processed through django. 1
juanky Posted September 6, 2017 Author Posted September 6, 2017 You create the username and password, and grant permissions at https://tommy.heliohost.org:2083/frontend/paper_lantern/psql/index.html Depending on what you create it will look something like this: username = iniesta_user database = iniesta_db password = <whatever> port = 5432 host = localhostMy database configuration seems to be correct. My doubts are related to static filesTake a look at http://wiki.helionet.org/Django The .htaccess file is where you define your static file directories that won't be processed through dispatch.wsgi RewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] You can add as many directories as you want or change media and admin_media to whatever you want, but whatever you put in there will be served directly from apache to the browser without being processed through django. my dispatch.wsgi file looks like this: import os, sys sys.path.append("/home/iniesta/public_html") from django.core.wsgi import get_wsgi_application os.environ["DJANGO_SETTINGS_MODULE"] = "inforiesgoserver.settings" application = get_wsgi_application() and .htaccess: RewriteEngine On RewriteBase / RewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] RewriteRule ^(inforiesgoserver/inforiesgo/static/.*)$ - [L] RewriteRule ^(inforiesgoserver/dispatch\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ inforiesgoserver/inforiesgoserver/dispatch.wsgi/$1 [QSA,PT,L] because the static files are in the app inforiesgo I created inside project inforiesgoserver. This configuration has been set following the http://wiki.helionet.org/Django, but only the folder structure "Index of /" is shown when I access https://inforiesgo.heliohost.org/ I can't figure out what the problem is
Krydos Posted September 7, 2017 Posted September 7, 2017 The guide is for creating a django website within a subdirectory. If you want your django site to be on the webroot you'll need to move everything down one directory. The other option is you could just set it up to redirect anyone who visits your webroot into the subdirectory.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now