Jump to content

Can't Get Django 1.11.2 Working


saikoscs

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...