I am learning Django and wanted to test hosting it on an Ubuntu computer I have. I decided to serve it with Apache and mod_wsgi. I got most things working, but I have one thing puzzling me. I can access the website only from my external IP address, not from say 127.0.0.1 or my 192.168.x.x address.
My django.conf file in /etc/apache2/sites-available is
<VirtualHost *:80>
WSGIScriptAlias / /home/username/project
ServerName my_external_ip
Alias /media/ /home/username/project/media
Alias /static/ /home/username/project/static
<Directory /home/username/project>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
If I set ServerName to 127.0.0.1 then the page only loads from there. Also I should add, it doesn't exactly "not load" when I access from other locations, it just shows an Apache page titled "Index of /" with no contents.
What is stopping Apache serving pages in all cases, and how can I make it serve pages as 127.0.0.1 etc..? Is there a better way I should host it?