patents Posted October 11, 2017 Posted October 11, 2017 (edited) I was trying Django to work on tommy. I am following this tutorial. My directory structure is: home/└── patents/ └── public_html/ ├── db.sqlite3 ├── manage.py └── hello/ ├── .htaccess ├── dispatch.wsgi ├── __init__.py ├── settings.py ├── urls.py ├── wsgi.py └── dispatch.wsgi I am however not able to see .htacess file using cPanner filemanager. I recently created the account. Is this the reason for error? I am getting this error: Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator at webmaster@patents.heliohost.org to inform them of the time this error occurred, and the actions you performed just before this error.More information about this error may be available in the server error log.Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. Please find attached the zipfile of my project. Edited October 11, 2017 by patents
Krydos Posted October 11, 2017 Posted October 11, 2017 I am however not able to see .htacess file using cPanner filemanager.To enable hidden files go to https://tommy.heliohost.org:2083/frontend/paper_lantern/filemanager/index.html and click Settings in the top right corner. Then put a check next to hidden files, and click save. You have an extra .htaccess file located athome/ └── patents/ └── public_html/ └── .htaccessDelete or rename that one, and next the syntax is slightly wrong in your other .htaccess filehome/ └── patents/ └── public_html/ └── hello/ └── .htaccessTry this code instead:RewriteEngine On RewriteBase / RewriteRule ^(media/.*)$ - [L] RewriteRule ^(admin_media/.*)$ - [L] RewriteRule ^(dispatch\.wsgi/.*)$ - [L] RewriteRule ^(.*)$ hello/dispatch.wsgi/$1 [QSA,PT,L]The difference is you have extra hellos on the last two lines. When you create a django app on your home computer it actually creates a structure like this ─── db.sqlite3 ├── manage.py └── hello/ └── hello/ ├── __init__.py ├── settings.py ├── urls.py └── wsgi.py Notice how the wsgi.py (which becomes dispatch.wsgi on our server) is actually located in a directory with the same name as the overall app? The way you're doing it is fine too and it will work, but it's the old fashioned way of doing it back in like Django 1.5 or so.
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