I am playing around with Google Course Builder. It's built using Google App Engine and the webapp2 framework.
I am not very familiar with webapp2 and routing in general and I think that's the reason for my doubt. And perhaps the people who have previously worked on GCB would be able to answer this question.
I am editing a view (as in MVC). It's an HTML file. I created a hyperlink to an another view (which is an HTML file I created myself), but I am getting a 404 when I click on the link.
I tried out all possible variations to the file location.
href="views/doubts.html"
would open "localhost:8080/views/doubts.html". But it gives me a 404 even thought he file exists. I tried out all variations ("/views/doubts", just "doubts.html", "doubts" and so on).
Perhaps direct access to the views might be blocked by some other part of the application. In such a case, what is the preferred way to go about it? Do I have to create a controller which redirects or so? I have never used MVC before.
Check the app.yaml
first. The app.yaml
decide how gogole app engine response for each kind of request.
https://developers.google.com/appengine/docs/python/config/appconfig
Basically there are two ways google app engine used to response the request.
Static files are files to be served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static file handlers describe which files in the application directory are static files, and which URLs serve them.
2 . response via script https://developers.google.com/appengine/docs/python/config/appconfig#Script_Handlers
A script handler executes a Python script to handle the request that matches the URL pattern. The mapping defines a URL pattern to match, and the script to be executed. In Python 2.5, CGI is the preferred method of defining script handlers. In Python 2.7, WSGI is the preferred method. CGI works in Python 2.7, but some features of the runtime, such as concurrent requests, are available only if your app uses WSGI.
The 1) method allow user to host a simple static website without touch the webapp2
or url routing