You're right, @logdog. The tutorial is contradictory in this regard. This minimal setup worked for me (other files are not required):
$ tree public_html
public_html
├── django_test
│ ├── __init__.py
│ ├── dispatch.wsgi
│ ├── settings.py
│ ├── urls.py
│ ├── views.py
│ └── wsgi.py -> dispatch.wsgi
└── .htaccess
Files' content (__init__.py is empty): .htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(django_test/dispatch\.wsgi/.*)$ - [L]
RewriteRule ^(.*)$ django_test/dispatch.wsgi/$1 [QSA,PT,L]
dispatch.wsgi
import os, sys
# Change "username_on_heliohost" to the actual username
sys.path.append('/home/username_on_heliohost/public_html')
# More portable version
#from pathlib import Path
#sys.path.append(str(Path(__file__).parent.parent))
from django.core.wsgi import get_wsgi_application
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_test.settings'
application = get_wsgi_application()
settings.py
SECRET_KEY = 'CHANGE THIS!'
ALLOWED_HOSTS = ['*']
ROOT_URLCONF = 'django_test.urls'
urls.py
from django.urls import path
from . import views
urlpatterns = [
path('', views.index),
]
views.py
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, World!")
Hope it helps