saikoscs Posted June 25, 2017 Posted June 25, 2017 Hey, I just signed up and was trying to deploy my little Django project. I stumbled upon this amazing tutorial and then follow this thread and did same steps. But, I still get internal server error 500. My site : http://saikosns.heliohost.org/ Can any admin please look into this? Not sure what's the problem here. Could be .htaccess file, but I've copied the exact same settings and made changed accordingly.
Krydos Posted June 25, 2017 Posted June 25, 2017 You're seeing the disallowed host error here http://saikosns.heliohost.org/djangotest/ because you didn't edit your host in settings.py# edit domain below ALLOWED_HOSTS = ['<DOMAIN>.heliohost.org'] You need to change that to saikosns.heliohost.org or *.
saikoscs Posted June 25, 2017 Author Posted June 25, 2017 and what about this one : http://saikosns.heliohost.org/ComicPub/This is throwing 500.
Krydos Posted June 25, 2017 Posted June 25, 2017 That one the dispatch.wsgi file is missing entirely.
saikoscs Posted June 25, 2017 Author Posted June 25, 2017 But, I can see the dispatch.wsgi in the ComicPub/ComicPub directory. http://saikosns.heliohost.org/ComicPub/ComicPub/ Check the screenshot : http://i.imgur.com/apbHRIL.png
Krydos Posted June 25, 2017 Posted June 25, 2017 Your .htaccess points to /home/saikosns/public_html/ComicPub/dispatch.wsgi which doesn't exist.
saikoscs Posted June 25, 2017 Author Posted June 25, 2017 (edited) So, I have two .htaccess files. 1.) inside the ComicPub directory : RewriteEngine On RewriteBase / RewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] RewriteRule ^(ComicPub/ComicPub/dispatch\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ ComicPub/ComicPub/dispatch.wsgi/$1 [QSA,PT,L] 2.) Inside the .python_egg_cache : RewriteEngine On RewriteBase / RewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] RewriteRule ^(dispatch\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ ComicPub/ComicPub/dispatch.wsgi/$1 [QSA,PT,L] My directory structure : public_html - ComicPub (directory) - manage.py - ComicPub (directory) - .htaccess - .settings.py Which one should I be editing and is there any clear write-up regarding .htaccess file oh heliohost? Because this is a little confusing;. Edited June 25, 2017 by saikoscs
Krydos Posted June 25, 2017 Posted June 25, 2017 Which one should I be editing and is there any clear write-up regarding .htaccess file oh heliohost? Because this is a little confusing;.It is a little confusing. The .htaccess should go in /home/saikosns/public_html/ComicPub/.htaccess and it should look like this: RewriteEngine On RewriteBase / RewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] RewriteRule ^(ComicPub/dispatch\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ ComicPub/ComicPub/dispatch.wsgi/$1 [QSA,PT,L]Does that work? 1
saikoscs Posted June 26, 2017 Author Posted June 26, 2017 Hey, No, it still does not work. I'm not sure what's happening here. I checked my .htaccess. I guess you already made the changes in it because it was at the place you mentioned and had the same content.
Krydos Posted June 26, 2017 Posted June 26, 2017 Yep, your .htaccess file is in the right spot, and looks good now. The next problem I found is in your dispatch.wsgi file. It doesn't have the correct path. It should look like this sys.path.append("/home/saikosns/public_html/ComicPub") Since your running your django app in a subdirectory you need to specify that subdirectory in the path in order for it to find its modules.
saikoscs Posted June 28, 2017 Author Posted June 28, 2017 Thanks! It worked. I put up the whole website and it's pointing to it just fine. But, it's not loading the CSS and even the admin area (after trying to log in) is giving 500 ERROR. The website with the same structure works just fine on my localhost. I've changed the permissions of the directories to 777 like here. Any idea why this might be happening?
Krydos Posted June 28, 2017 Posted June 28, 2017 I'm getting directory not found http://saikosns.heliohost.org/ComicPub/ Are we talking about some other django subdirectory now?
saikoscs Posted June 28, 2017 Author Posted June 28, 2017 I fixed the issue. Seems like I had to port the admin/css files as well separately. Now, I'm facing an issue where the website cannot write to the sqlit3 db file. Trying to 777 the public_html temporarily to see if that'll fix the write problem.
Krydos Posted June 28, 2017 Posted June 28, 2017 I think most people have had trouble with django connecting to sqlite. I always recommend using mysql.
saikoscs Posted June 29, 2017 Author Posted June 29, 2017 Yes. it seems like it. I was able to get it working though. Just had to give public_html the read/write permissions.Thank you for all your help Krydos!
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