GithubHelp home page GithubHelp logo

Comments (8)

apocalypse2012 avatar apocalypse2012 commented on August 24, 2024 1

Found it! In the Nginx section of your tutorial: https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/#nginx
...there is a test link near the end of the section. This test link is to prove app operation through the nginx routing. At the point at which this link is presented, /admin is still the only valid url.
Here is the link as presented in the tutorial section...
http://localhost:1337/
If I were more experienced I would have likely caught it without even thinking about it. More over, I might have just not clicked the link, finished the tutorial without checking, and by the time I got to it, the link would have been good. As it is, it was just enough to send me flailing.

from django-on-docker.

mjhea0 avatar mjhea0 commented on August 24, 2024

Often, when you get a page not found like that, the underlying issue is with the application that you're trying to serve up not Nginx. I would focus time on figuring out if there is something wrong with the Django application, in other words. Have you looked at the Docker logs? If you expose the Django application itself via ports--

ports:
   - 8000:8000

--can you view the app from port 8000?

from django-on-docker.

apocalypse2012 avatar apocalypse2012 commented on August 24, 2024

from django-on-docker.

mjhea0 avatar mjhea0 commented on August 24, 2024

I'm not sure. I just tested it out and it works on my machine. (I'm on a mac).

test.mp4

Test it out in the same way. If it works, then you may have missed something in the tutorial. If it doesn't, then it may be an environment specific issue. What kind of machine are you on? I've updated this tutorial 3 or 4 times in the past few years, so it's been tested a number of times.

from django-on-docker.

apocalypse2012 avatar apocalypse2012 commented on August 24, 2024

from django-on-docker.

mjhea0 avatar mjhea0 commented on August 24, 2024

Yes

from django-on-docker.

apocalypse2012 avatar apocalypse2012 commented on August 24, 2024

OK, trying this out again. The issue is not exactly as I reported before. Nginx does appear to be running. Its just giving me 404s. For some reason its not getting through to the app. Likewise, I cannot bring up the app by accessing port 8000. Not sure if this is for the same reason or if because port 8000 on the web app is not built with the expose flag instead of the ports flag and now is only supposed to be visible from other Dockers. Either way, the Nginx instance does not appear to be routing to it.
My only apparent variance from the source code in this project is that I have not yet added static files. It is otherwise the same as best as I can tell. Don't know why Nginx does not want to route to the app.

from django-on-docker.

apocalypse2012 avatar apocalypse2012 commented on August 24, 2024

I'm sorry. For some reason, my iPad was not showing me your test.mp4 video, so I did not see the instructions you left. I reproduced your test case from git download and it works fine. I don't know what I missed or skipped in the following the tutorial. Doing a file by file diff to try to track it down.
Will follow up...

from django-on-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.