Jump to content

Recommended Posts

Posted

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.

Posted (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 by saikoscs
Posted

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?
  • Like 1
Posted

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.

Posted

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.
Posted

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?

Posted

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.

Posted

I think most people have had trouble with django connecting to sqlite. I always recommend using mysql.

Posted

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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...