1
votes

I'm having some problems. I'm setting up a fabric file to create and install everything we need for our deployments. Everything so far so good. I got to the place of starting a runserver with django.

I'm forwarding the 8000 port to 8001, but whenever I try to access it from the host machine, I get a 403.

Let's get the facts:

  • DEBUG = True;
  • port forwarding 8000 to 8001 (vagrantfile);

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "name"

config.vm.network "forwarded_port", host: 8001, guest: 8000

end

I even tried with another syntax in the vagrantfile where "forwarded_port" is written :forwarded_port. No difference there.

I'm pretty sure that local_settings.py has DEBUG = True, as I logged into the machine and checked the settings file.

EDIT: oh, and runserver is being run as:

@task
def runserver():

    """Starts the default django server"""

    with virtualenv(env.virtualenv_path):

        with cd(env.source_root):
            sudo("./manage.py runserver 0.0.0.0:8000")

Do you guys have any tips on this?

1

1 Answers

0
votes

as usual, it's a problem with the code itself, not the machine itself.

Sorry!