Comments (9)
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.
Nope, there are no errors in the runserver.
I've cloned this repository.
from channels-obstruction.
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.
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.
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.
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.
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.
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.
Thanks! I appreciate the feedback! Glad you got it working, too.
from channels-obstruction.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from channels-obstruction.