Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Django runserver not working in build machine

Richard_Campen April 29, 2020

I am attempting to run a Django application using the `runserver` management command in a pipelines build machine. I am doing this so that I can perform some testing that requires a running django instance.

 

When I run the runserver command and tell it to run on `0.0.0.0:8000` it does not show the normal startup information, and if I run it with nohup and then try to curl `0.0.0.0:8000` on the build machine I get the error `0curl: (7) Failed to connect to 0.0.0.0 port 8000: Connection refused`.

I can successfully get the django app running with the same commands in a local version of the docker image the build machine uses, so it seems to be something specific to running on the build machine. I have also tried switching up the port it is running on to see if that resolves it but to no avail.

My pipeline looks like:

feature/automate-ui-tests:
- step:
name: Run UI tests
caches:
- node
- pip
script:
- apt-get update && apt-get install -y firefox chromium-browser libcurl4-openssl-dev libssl-dev
- pip3 install virtualenv
- virtualenv -p python3 venv
- . venv/bin/activate
- pip install -r app/test-requirements.txt
- export TZ='Pacific/Auckland'
- nvm install
- npm install
- nohup npm run start &
- python app/manage.py migrate --verbosity=3 --settings=app.settings.test-ui
- python app/manage.py createcachetable --verbosity=3 --settings=app.settings.test-ui
- nohup python app/manage.py runserver 0.0.0.0:8000 --verbosity=3 --settings=app.settings.test-ui & # this step is where I have an issue.
- npm run test-ui -- all -r spec,xunit:./app/test-reports/testcafe.xml
services:
- postgres
- redis

Any thoughts? The other management commands like `migrate` and `createcachetable` work fine so it seems to be specific to `runserver`.

 

Cheers,

1 answer

0 votes
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 20, 2020

@Richard_Campen thank you for the question.

Can you share more output from runserver since you run it with verbosity 3, in the case without nohup using?

Perhaps, this way we will be able to help

Cheers,

Galyna

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events