Search code examples
network-programmingiplannat

Django - accessing site from within LAN?


I have a production Django server that runs from an internal LAN. The site is accessible from outside the lan by use of a sub domain. So, something like http://app.ourdomain.com

My question is, when our office internet goes down, how would people on the same LAN as the Django server access the django app? I've tried using the IP of the server itself, like 192.168.1.140 but that doesn't work. That takes me to a "Not Found - the requested URL was not found on this server".

How would I accomplish connecting to our Django app from within the LAN?

Thanks

Edit*

Just to add some clarity: here;s some config files:

Apache sites-enabled:

VirtualHost *:443>

        SSLEngine on
        SSLProtocol all
        SSLCertificateFile /usr/local/ssl/crt/certificate.crt
        SSLCertificateKeyFile /usr/local/ssl/crt/cpm.capitalirrigation.com
        SSLCertificateChainFile /usr/local/ssl/crt/intermediate.crt
        ServerAdmin elijah@capitalirrigation.com
        ServerName https://cpm.capitalirrigation.com

        AliasMatch ^/([^/]*\.css) /srv/www/cpm/static_media/css/$1
        Alias /static_media/ /srv/www/cpm/static_media/
        Alias /static/admin/ /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/
        Alias /favicon.ico "/srv/www/cpm/static_media/img/favicon.ico"



    <Directory /srv/www/cpm/static_media/>
        Options -Indexes
        Order deny,allow
        Allow from all
    </Directory>

    WSGIScriptAlias / /srv/www/cpm/django.wsgi

And, my django.wsgi:

import os
import sys

path = '/srv/www'
if path not in sys.path:
   sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'cpm.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Solution

  • Did you try to run with the https protocol and your ip like

    https://192.168.1.140