rancavil / tornado-openshift-quickstart Goto Github PK
View Code? Open in Web Editor NEWTornado Web Server git repository for OpenShift with Python 3.3
Tornado Web Server git repository for OpenShift with Python 3.3
When i completed all steps in tutorial, app doesn't work. I get Internal Server Error when open url of my new app.
@rancavil I set up the application and it's working fine when I open the url in my browser. It displays
Congrats you have Tornado Web Server running on OpenShift!!!
Enjoy!!!
But I don't think that CORS is enabled there. Because when I try to read the page using XMLHttpRequest
in javascript, it says
XMLHttpRequest cannot load http://XXX.rhcloud.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://XYZ.com' is therefore not allowed access.
Can you please help me regarding this? We need to reconfigure the server and allow Cross Origin Access.
Changed the if statement in application.py to
if 'OPENSHIFT_REPO_DIR' in os.environ:
settings = {
'static_path' : os.path.join(os.environ['OPENSHIFT_REPO_DIR'], 'wsgi/static'),
'template_path' : os.path.join(os.environ['OPENSHIFT_REPO_DIR'], 'wsgi/templates'),
'debug': True,
}
handlers = [(r"/()$", tornado.web.StaticFileHandler, {'path':os.path.join(os.environ['OPENSHIFT_REPO_DIR'], 'wsgi/static/index.html')}),
(r"/(.*)", tornado.web.StaticFileHandler, {'path':os.path.join(os.environ['OPENSHIFT_REPO_DIR'], 'wsgi/static/')}),]
else:
settings = {
'static_path' : os.path.join(os.getcwd(), 'wsgi/static'),
'template_path' : os.path.join(os.getcwd(), 'wsgi/templates'),
'debug': True,
}
handlers = [(r"/()$", tornado.web.StaticFileHandler, {'path':os.path.join(os.getcwd(), 'wsgi/static/index.html')}),
(r"/(.*)", tornado.web.StaticFileHandler, {'path':os.path.join(os.getcwd(), 'wsgi/static/')}),]
But I am getting 404 Error.
It works when I run wsgi.py locally.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.