Docker & Django - what directory does localhost point to? 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 &amp;


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:


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!
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:

INSTALLED_APPS = [
    (...)
    'django.contrib.staticfiles',
]


At the end of this file

STATIC_ROOT='staticfiles'
STATIC_URL = '/static/'
STATICFILES_DIRS = [
     os.path.join(BASE_DIR, 'static'),
]


source Django manual: How to static-files