Domain not working without :8000 on dev

Posted April 11, 2018 6.9k views
ApplicationsUbuntu 16.04


My domain is working but not working and having - HTTP ERROR 404.

The Django dev server is running at

Appreciate anyone can help.


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers


I am using /virtualenv/bin/python runserver for now for the test purpose. I log to my droplet using ssh from my mac. I did not setup any web server. I have amended the Django as shown below:

SECURITY WARNING: don’t run with debug turned on in production!

DEBUG = True


Let me know if you need more info.


It would appear that while you’re able to access your Django instance directly on port 8000 your web server is not configured properly to proxy those connections when you are trying to access it via port 80 (the default).

Which web server are you using? Nginx or Apache?

If you can share your site configuration (/etc/nginx/sites-enabled or /etc/apache2/sites-enabled) we can likely help you make the adjustments needed to access your site on the default http port.

Once that is working you’ll likely want to change your Django setup to listen on or localhost:8000 (this way it would only be accessible through the web proxy and would no longer appear on port 8000 publicly.

  • Hi,

    I couldn’t find apache2 or nginx in the /etc/ folder. Appreciate your help.

    sudo ls /etc/
    acpi calendar dpkg hosts ldap magic nsswitch.conf protocols rmt subgid update-motd.d
    adduser.conf cloud ec2version hosts.allow magic.mime opt python rpc subgid- update-notifier
    alternatives console-setup environment hosts.deny mailcap os-release python2.7 rsyslog.conf subuid vim
    apm cron.d fonts init mailcap.order overlayroot.conf python3 rsyslog.d subuid- vmware-tools
    apparmor cron.daily fstab init.d legal manpath.config overlayroot.local.conf python3.5 screenrc sudoers vtrgb
    apparmor.d cron.hourly fuse.conf initramfs-tools libaudit.conf mdadm pam.conf python3.6 securetty sudoers.d wgetrc
    apport cron.monthly gai.conf inputrc locale.alias mime.types pam.d rc0.d security sysctl.conf X11
    apt crontab groff insserv locale.gen mke2fs.conf passwd rc1.d selinux sysctl.d xdg
    at.deny cron.weekly group insserv.conf localtime modprobe.d passwd- rc2.d services systemd xml
    bash.bashrc crypttab group- insserv.conf.d logcheck modules perl rc3.d sgml terminfo zsh
    bashcompletion dbus-1 grub.d iproute2 login.defs modules-load.d pm rc4.d shadow timezone
    completion.d debconf.conf gshadow iscsi logrotate.conf mtab polkit-1 rc5.d shadow- tmpfiles.d
    bindresvport.blacklist debian_version gshadow- issue logrotate.d nanorc pollinate rc6.d shells ucf.conf
    binfmt.d default gss lsb-release network popularity-contest.conf rc.local skel udev
    byobu deluser.conf hdparm.conf kbd ltrace.conf NetworkManager ppp rcS.d sos.conf ufw
    ca-certificates depmod.d host.conf kernel lvm networks profile resolvconf ssh updatedb.conf
    ca-certificates.conf dhcp hostname kernel-img.conf machine-id newt profile.d resolv.conf ssl update-manager



Thanks for the response. Since I am at work right now I will update this thread as soon as I get hold of my Mac at home.


This issue has been solved.