Git Product home page Git Product logo

Comments (9)

codyparker avatar codyparker commented on June 3, 2024

Hello,

Do you see any errors in your runserver terminal or in the browser console? Also, did you clone this repository or are you working on the tutorial in the blog post?

from channels-obstruction.

gauravkulkarni96 avatar gauravkulkarni96 commented on June 3, 2024

Nope, there are no errors in the runserver.
I've cloned this repository.

from channels-obstruction.

codyparker avatar codyparker commented on June 3, 2024

I've just tested cloning it fresh and going through the steps I listed and it worked for me. I did forget one step and just added it to the project description, which is to run webpack to build the JS packages. But I would think you would have received a Django template error.

Did you run webpack in your terminal?
Also, are there any errors in your browser console to give us a clue?

from channels-obstruction.

gauravkulkarni96 avatar gauravkulkarni96 commented on June 3, 2024

yes I did run webpack
Yes, Theres this error in the console http://localhost:8080/current-user/?format=json Failed to load resource: net::ERR_CONNECTION_REFUSED

from channels-obstruction.

codyparker avatar codyparker commented on June 3, 2024

Are you running the server on port 8080? I believe the React components may be hard-coded to call out on that port in this example project.

If you are on port 8080, what happens when you try to hit the error's URL directly?

from channels-obstruction.

gauravkulkarni96 avatar gauravkulkarni96 commented on June 3, 2024

Oh.. I wasn't running it on 8080. But when I did now, I'm getting this in the console : XMLHttpRequest cannot load http://localhost:8080/current-user/?format=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8080' is therefore not allowed access.

This is what I get if I directly go to the error URL {"id":null,"username":"","groups":[]}

from channels-obstruction.

codyparker avatar codyparker commented on June 3, 2024

OK, thanks. I've updated the project instructions to include running on port 8080. The blog post that walks you through the project uses that port, but I just didn't make it dynamic in the example project. I may update that soon so that any port works.

Now, the error you're getting is probably because your browser is using http://127.0.0.1:8080 and trying to communicate to http://localhost:8080 as the backend. It thinks you're attempting to connect to a different domain. Make sure the browser is also using localhost:8080 and you should be good-to-go.

from channels-obstruction.

gauravkulkarni96 avatar gauravkulkarni96 commented on June 3, 2024

Yes It worked!!
Thankyou so much! I was struggling on this from past 2 days.
By the way the tutorial is just awesome. Thankyou for that.

from channels-obstruction.

codyparker avatar codyparker commented on June 3, 2024

Thanks! I appreciate the feedback! Glad you got it working, too.

from channels-obstruction.

Related Issues (5)

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.