Jump to content

Django Project Not Working


patents

Recommended Posts

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

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