how to add bootstrap, css, images ,js into google app engine?
Tags: javascript,css,twitter-bootstrap,google-app-engine,python-2.7
Problem :
I have created the web application using bootstrap.I uploaded it to the google app engine.My problem is ,it doesn't show any images,js or css i have added.Please help me. My folder structure is like below.
-myapp
-css
-js
-images
-fonts
-index.html
-otherfiles.html....
I edited the app.yaml as below
application: website-example
version: 1
runtime: python
api_version: 1
default_expiration: "7d"
handlers:
- url: /(.*\.(gif|png|jpg|ico|js|css|swf|xml))
static_files: \1
upload: (.*\.(gif|png|jpg|ico|js|css|swf|xml))
- url: /(.*\.html)
static_files: \1
upload: index.html
- url: /.*
script: main.p
I edited the main.py as below.
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class IndexHandler(webapp.RequestHandler):
def get(self):
if self.request.url.endswith('/'):
path = '%sindex.html'%self.request.url
self.redirect(path)
def post(self):
self.get()
application = webapp.WSGIApplication([('/.*', IndexHandler)], debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()
Please help me.I can't figure this out.
Solution :
For your case, I'd use something more like:
application: website-example
version: 1
runtime: python
api_version: 1
default_expiration: "7d"
handlers:
- url: /css
static_dir: css
- url: /js
static_dir: js
- url: /img
static_dir: images
- /index.html
static_files: index.html
upload: index\.html
- url: /.*
script: main.py
The basic idea behind the static dirs for css, js and images is that everything under those dirs will be served statically, whenever the request url starts with those urls (so, you can serve things like /img/sub_dir/foo.png)
For the static html, I used a single file example, but you could as well put them in a separate dir and serve statically from there
CSS Howto..
I believe this is what is needed. HTML <footer> <div class="top"> </div> <div class="center"> </div> <div class="bottom"> </div> </footer> CSS footer { position: relative; width: 100%; min-height: 200px; } footer...
Use transform-origin: -webkit-transform-origin: 0% 50%on .flipper. Just watch compatibility. caniuse.com doesn't list transform-origin. Remember vendor prefixing.
Two answers, depending on what issue you're exactly facing. First case: The background isn't repeating at all Assuming you're using a CSS background-image to render your background, use background-repeat: repeat-x;...
input[type=submit][value=Delete] You're chaining selectors. Each step narrows your search results: input finds all inputs. input[type=submit] narrows it to submits, while input[type=submit][value=Delete] narrows it to what you need....
Have you tried?: .label { display: block; margin: auto; margin-bottom: 5px; text-align: left; color: #333; font-size:12px; width:150px; font-style:normal !important; } The !important annotation should override the style....
If the image is inside the field try float:left; padding-left:5px; Hope I helped, or else paste your code at http://jsfiddle.net/...
This would work <img src='images/35067.png' onerror='this.src="images/default.png"'/> ...
Before a rails app is deployed to production mode, all of your assets (css, javascripts and images) are usually precompiled and placed in the public directory, which is where your...
Check this out... (inspired by this) Fiddle CSS: ul.leaders { max-width: 40em; padding: 0; overflow-x: hidden; list-style: none } ul.leaders li:before { float: left; width: 0; white-space: nowrap; content:". ....
Web browsers are designed to add default styling to page elements even without that styling being explicity mentioned in the page's stylesheet. In order to change this default behavior, you...
I did some small tricks in css and jquery as follows., CSS Part : <style type="text/css"> .new-child { background:none !important; } .born-child { background:#d0dafd !important; } </style> jQuery Part :...
You need to add the relevant browser/vendor prefixes, the -webkit- part in your CSS specifically targets webkit browsers like chrome, by adding similar styles without this part it will work...
Using CSS gradients you could achieve this effect. Just be sure that the blend part has the correct "stops" setting. A great generator of CCS graidents: http://www.colorzilla.com/gradient-editor/ You can see...
You can change the display property for your form form { display:inline-block; } The demo http://jsfiddle.net/TT7BC/3/ Remember it will display side by side if they can fit into his parent...
You can achieve it with attribute starts with selector and next() function, $("div[id^=flip]").click(function() { $(this).next("div[id^=panel]").stop().slideToggle("slow"); }); DEMO I have answered the question in the way you asked above. But using...
You cannot select this with css3. I would do it another way: first select all nodes and then override level2: div.orgChart div.node { background-image: Something here that should be used...
What you are looking for is something like wow.js Use the wow.js plugin (Click here for documentation) Add the css <link rel="stylesheet" href="css/animate.css"> Add the script and activate the script....
.MyParentCSSClass div.MyCSSClass:hover { background-color: none; } This will overwrite the background color given by div.MyCSSClass:hover. if you are keeping MyParentCSSClass div.MyCSSClass:hover empty as MyParentCSSClass div.MyCSSClass:hover {}, it will not overwrite...
That's because you pass to css method an object containing property property. In this case it's better to pass two arguments to css method: function changeProperty(mine , property , value){...
Basically the css you will use in javaFX in an ordinary .css file so: 1)Right click on src folder 2)New->File->(Give it a name).css->Finish But: That is the way to create...
Your code is perfect. The only issue that was found/caught by the jsfiddle was the broken img tag. Tip! If you can't get the image to load, then you can...
Let me argue for something even simpler: 1: One CSS: .day { color: black; background-color: white; } .night { color: white; background-color: black; } .day #content { color: blue; }...
Sadly, you can't do this with CSS. Luckily, you can use CSS precompilers to do this for you (examples: LESS & Sass). To be more precise, you could use Mixins...
seems you have to also style the 'context-menu'. it worked by adding: .context-menu { -fx-background-color: #3c3f41; -fx-border-color: #555555; -fx-border-style: solid; -fx-border-width: 1px; } This and this answers on SO helped...
The css3 method described in the other solution is ideal, but you could use the table-cell method. Like this: http://jsfiddle.net/h7Htk/
The following CSS will force the vertical sidebar to appear, even on pages that are shorter than the viewport height. This will prevent the horizontal shift that you're noticing. html...
Because the applied CSS depends on the position of the node in the tree (e.g. #foo > li applies only to direct descendants of #foo with tagName li), you first...
This is an answer in it's simplest form, this will make input fields 30% of parents width. input { width: 30%; } ...
for putting this tag between head tag it's works: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> ...
You can use a Definition List for this: HTML <dl> <dt>Where ABC is</dt> <dd>the Actual Before Calculation</dd> <dt>A is</dt> <dd>the total population of the US</dd> <dt>XYB is</dt> <dd>the percentage that...