Jump to content

Recommended Posts

Posted (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 Error

The 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 by patents
Posted

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 at

home/
└── patents/
    └── public_html/
        └── .htaccess
Delete or rename that one, and next the syntax is slightly wrong in your other .htaccess file

home/
└── patents/
    └── public_html/
        └── hello/
            └── .htaccess
Try 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.

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