Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy aren't my css commands being processed in my html file after I render the html file using Google App Engine?
    primarykey
    data
    text
    <p>So I have a basic form in my application that I am hosting using Google App Engine. When I type in a particular query, say 'CN', I want the CN.html file to be rendered. I have redirected my path and stuff, and used if-else to allow CN.html file to be rendered when 'CN' is queried. However, all the inline CSS commands inside the CN.html are not considered, and all I get redirected to when I query 'CN' is to the basic HTML document void of all the CSS commands. Also, the images are not displayed.</p> <p>Now, I have put the CN.html file in a folder called 'templates' in my directory and all the images in a folder called 'images'.</p> <p>NOTE- 'templates' and 'images' also contain the html file of my front page and their images respectively. I don't think it should be a problem, though, right?</p> <p>Here, check the live example of my problem yourself:</p> <p>go to www.deploymentapp.appspot.com and search for 'Computer Networks'.</p> <p>So what seems to be the problem?</p> <hr> <p>EDIT(Including all the source code files for better understanding)</p> <p>CN.html</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Computer Network&lt;/title&gt; &lt;link rel = "stylesheet" href = "/stylesheets/cn.css" type = "text/css"&gt; &lt;/head&gt; &lt;body&gt; &lt;div id='cn'&gt; &lt;img src = "/images/CN.jpg" width = '300px' height = '400px'&gt; &lt;/div&gt; &lt;div id = 'cn_heading'&gt; &lt;h1&gt;&amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbspComputer Networks&lt;/h1&gt; &lt;p class = 'pname'&gt;by Andrew Tanenbaum&lt;/p&gt; &lt;/div&gt; &lt;div id = 'buy'&gt; &lt;a href = '#'&gt;&lt;img src = '/images/buy-now.jpg' width = '300px' height = '100px'&gt;&lt;/a&gt; &lt;div id = 'details'&gt; &lt;p&gt;Authored by : Andrew S. Tanenbaum, David J. Wetherall&lt;/p&gt; &lt;p&gt;Publisher : Pearson &lt;/p&gt; &lt;p&gt;Price : Rs. 550 (Inclusive of taxes)&lt;/p&gt; &lt;/div&gt; &lt;div id = 'description'&gt; &lt;p&gt;&lt;h3&gt;&amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp COMPUTER NETWORKS 5TH EDITION&lt;/h3&gt; Computer Networks, Fifth Edition, is the ideal introduction to the networking field. This bestseller reflects the latest networking technologies with a special emphasis on wireless networking, including 802.11, 802.16, Bluetooth&amp;trade, and 3G cellular, paired with fixed-network coverage of ADSL, Internet over cable, gigabit Ethernet, MLPS, and peer-to-peer networks. Notably, this latest edition incorporates new coverage on 3G mobile phone networks, Fiber to the Home, RIFD, delay-tolerant networks, and 802.11 security, in addition to expanded material on Internet routing, multicasting, congestion control, quality of service, real-time transport, and content distribution. Tanenbaum takes a structured approach to explaining how networks work from the inside out. He starts with an explanation of the physical layer of networking, computer hardware and transmission systems then works his way up to network applications. Salient Features &lt;ul&gt; &lt;li&gt;Wireless networks (802.12 and 802.16)&lt;/li&gt; &lt;li&gt;The 3G networks used by smart phones&lt;/li&gt; &lt;li&gt;RFID and sensor networks&lt;/li&gt; &lt;li&gt;Content Distribution using CDNs&lt;/li&gt; &lt;li&gt;Peer-to-peer networks&lt;/li&gt; &lt;li&gt;Real-time media (from stored, streaming, and live sources)&lt;/li&gt; &lt;li&gt;Internet telephony (voice over IP)&lt;/li&gt; &lt;li&gt;Delay-tolerant networks&lt;/li&gt; &lt;/ul&gt; &lt;/p&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>CN.css</p> <pre><code>#cn { margin-top : 50px; margin-left : 50px; box-shadow : 5px 5px 5px black; width : 300px; } #cn_heading { margin-top : -448px; margin-left : 425px; } .pname { font-style : italic; } #buy { margin-top : 370px; margin-left : 50px; } #details { margin-left : 425px; margin-top : -450px; } #description { margin-left : 425px; margin-top : 20px; } </code></pre> <p>.yaml file</p> <pre><code>application: deploymentapp version: 1 runtime: python27 api_version: 1 threadsafe: yes handlers: - url: /favicon\.ico static_files: favicon.ico upload: favicon\.ico - url: /images static_dir: images - url: /stylesheets/ static_dir: stylesheets - url: .* script: main.app libraries: - name: webapp2 version: "2.5.2" - name: jinja2 version: latest </code></pre> <p>here's the handler which handles what happens when 'Computer Networks' is queried:</p> <pre><code>class CNHandler(webapp2.RequestHandler): def write(self, *a, **kw): self.response.out.write(*a, **kw) def render_str(self, template, **params): t = jinja_env.get_template(template) return t.render(params) def render(self, template, **kw): self.write(self.render_str(template, **kw)) def get(self): self.render("CN.html") </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload