我花了好几个小时想让这些图像显示出来。我不想在stackoverflow上发布问题,但现在看来这是最好的选择。我在stackoverflow上读过几篇文章,甚至在不同的网站上也读过几篇。我已经尝试了所有建议,但通过查看代码,我似乎没有发现任何明显的错误。在
我正在为自己制作一个个人网站,我正在制作我的博客、twitter、linkedin和github个人资料的图片链接。我试着让它既能在本地工作,又能在网上生活。我正在使用Python和googleappengine。我正在尝试将图像插入我的“关于”页面,因此主.py文件,这是一个大约的句柄。我不认为我的主.py尽管如此。请随意see the problem in action。我肯定是我的html文件做错了什么。如有任何帮助,我们将不胜感激:)
这是我的主.py文件。。。在import os
import webapp2
import jinja2
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir),
autoescape = True)
def render_str(template, **params):
t = jinja_env.get_template(template)
return t.render(params)
class BaseHandler(webapp2.RequestHandler):
def write(self, *a, **kw):
self.response.write(*a, **kw)
def render_str(self, template, **params):
params['user'] = self.user
return render_str(template, **params)
def render(self, template, **kw):
self.response.write(render_str(template, **kw))
class MainHandler(BaseHandler):
def get(self):
self.render('home_personal.html')
class AboutHandler(BaseHandler):
def get(self):
self.render('about_personal.html')
class PortfolioHandler(BaseHandler):
def get(self):
self.render('portfolio_personal.html')
class ContactHandler(BaseHandler):
def get(self):
self.render('contact_personal.html')
app = webapp2.WSGIApplication([
('/', MainHandler),
('/about', AboutHandler),
('/portfolio', PortfolioHandler),
('/contact', ContactHandler)
], debug=True)
这是我的html文件的相关部分。。。在
^{pr2}$
这是我的css文件。。。在body {
position: relative;
font-family: Helvetica, Arial, sans-serif;
font-size: 14px;
background-color: #29586F; /* tealish-blue */
margin: 0 auto;
}
#main-section-home {
width: 100%;
height: 600px;
}
#main-section-about {
position: relative;
width: 600px;
margin-right: auto;
margin-left: auto;
color: #C4D0D5;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 18px;
top: 80px;;
}
#main-section-contact {
position: relative;
width: 600px;
margin-right: auto;
margin-left: auto;
color: #C4D0D5; /* light gray */
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
font-size: 18px;
top: 80px;;
}
.questions {
font-size: 20px;
color: white;
}
#container {
height: 600px;
}
#nav {
float:left;
width:100%;
overflow:hidden;
position:relative;
height: 40px;
background-color: #29586F; /* tealish-blue */
}
#nav ul {
clear:left;
float:left;
list-style:none;
margin:0;
padding:0;
position:relative;
left:50%;
text-align:center;
line-height: 2.5em;
}
#nav ul li {
display:block;
float:left;
list-style:none;
margin:0;
padding:0;
position:relative;
right:50%;
text-transform: uppercase;
width: 130px;
font-size: 18px;
#nav ul li a {
display:block;
margin:0 0 0 1px;
padding:3px 10px;
background:#29586F; /* tealish-blue */
color: white;
text-decoration:none;
height: 40px;
}
#nav ul li a:hover {
color:#3BA6DA; /* new blue */
}
#nav ul li a.active,
#nav ul li a.active:hover {
color:#29586F; /* tealish-blue */
font-weight:bold;
}
#my-name-div {
text-transform: uppercase;
font-size: 50px;
font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
color: white;
letter-spacing: 4px;
white-space: pre;
width: 300px;
}
#my-name-div-small {
text-transform: uppercase;
font-size: 30px;
font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
color: white;
letter-spacing: 4px;
/*white-space: pre;*/
width: 300px;
}
#my-title-div {
font-size: 18px;
color: #3BA6DA; /* new blue */
letter-spacing: 2px;
font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
margin-top: 15px;
width: 300px;
}
#my-title-div-small {
font-size: 18px;
color: #3BA6DA; /* new blue */
letter-spacing: 2px;
font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
margin-top: 15px;
position: relative;
left: 15px;
width: 300px;
}
#name-and-title-wrapper {
position: relative;
left: 25%;
top: 100px;
width: 300px;
}
#name-and-title-wrapper-small {
position: relative;
left: 25%;
top: 50px;
width: 300px;
.link a {
color: #3BA6DA; /* new blue */
text-decoration: none;
}
.link a:hover {
color: white;
text-decoration: none;
}
#logos-social div {
margin: 5px;
float: left;
position: relative;
left: 65%;
}
这是我的应用程序yaml... 在application: juliandavidfarley-2
version: 1
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /stylesheets
static_dir: static
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: .*
script: main.app
libraries:
- name: webapp2
version: "2.5.2"
- name: jinja2
version: latest