Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSexual Potatoes
12,051 PointsHow do I view what's on the "preview" button of the Workspace in my browser?
I'm trying to run the project on my computer instead of in Workspace, since it simulates a real environment.
4 Answers
Alfonso S
793 PointsThis may be bad advice but if you're getting the "disallowed host" message, you can go into settings.py and look for a variable called ALLOWED_HOSTS, it's an empty list.
Put the string "0.0.0.0" into that list and run the server again, it should work.
Simin Hajizadeh
3,072 PointsI am using other workspace instead of what you use, I can't preview my URL, I wrote ['0.0.0.0'] in setting.py but it does'nt work. would you please help me how I can preview my URL?
Sameer Zahid
5,967 PointsType that in the browser. I'm using a virtualenv, and didn't know how to view it either. I think the above is equivalent to saying: "server is localhost and port is 8000", but I'd appreciate someone with more experience to comment on this.
Haydar Al-Rikabi
5,971 PointsAs Sameer has mentioned, you can try: http://127.0.0.1:8000/ The following will yield the same result: http://localhost:8000/
Moin shamsi
7,579 PointsMoin shamsi
7,579 PointsI have the same problem and added the above address of "0.0.0.0" to ALLOWED_HOSTS, but it doesn't work. The message on my browser is: " Firefox canβt establish a connection to the server at 0.0.0.0.
I stopped my antivirus and firewall also, but still can not load the page! Does anyone can help please?