It is possible to Hello World tutorial to get a small Django project dealing with Apache?
Alternatively, can anybody let me know where I have gone down the wrong path. I have went through Django tutorials and everything appears to operate not surprisingly, however they don't cover how you can really deploy the example by having an apache server. I discovered their documentation concerning how to get Django working with Apache, however i did not have luck by using it. I am on Ubuntu. Used to do
apt-get install libapache2-mod-wsgi, after which adopted the instructions around the second link above.
My /etc/apache2/httpd.conf is really a one-lining (is the fact that normal?)
WSGIScriptAlias / /home/john/programming/djangotutorial1/mysite/apache/django.wsgi
And That I produced a brand new file at /home/john/programming/djangotutorial1/mysite/apache/django.wsgi that appears such as this:
import os import sys path = '/home/john/programming/djangotutorial1' if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
And mysite the Django tutorial website that is already populated.
When of visit mywebsite.com I recieve a 500 Internal Server Error.
Since you are obtaining a 500 error, which means your internet site is a minimum of loading. List of positive actions is enable Debugging inside your configurations.py after which restart Apache. Rather than providing you with a 500 error, it'll demonstrate exactly what the real error is.
Enabling debugging is not usually suggested, consider it is simply a Hello World, it will be fine. However in a production atmosphere you are able to examine Apache's error logs to obtain the problem.