I'm completely new to Docker and Django and I'm having trouble getting my Docker app to serve inside Django. Currently, I'm running my docker container with this command:

docker run -it --name web -p 8000:8000 --link mysql:db -v ~/directory:/app django

where mysql and django refer to containers defined earlier.

Next, I'm using manage.py to make migrations and migrate, then serving with the following command:

mod_wsgi-express start-server --reload-on-changes --working-directory /app/voting_project /app/voting_project/voting_project/wsgi.py &

When I visit localhost:8000 in my browser, it successfully renders the HTML template, but the CSS and images which I see locally are missing.

The following errors are logged in the console: enter image description here

I've played with the structure of my directories a bit, but I can't seem to get the browser to find anything in localhost:8000/static or localhost:8000/images.

I'm assuming 8000 is mapping to somewhere weird in my local directories, but I realize this could also be caused by a number of other things. Please let me know if I'm making any obvious mistakes.

Thanks so much!

1 Answer 1


This is most likely a problem with the django configuration better fitting to stackoverflow, and not so much a devops problem.

Check the settings.py for the following entries:


At the end of this file

STATIC_URL = '/static/'
     os.path.join(BASE_DIR, 'static'),

source Django manual: How to static-files

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.