मैं अजगर की दुनिया के लिए अपेक्षाकृत नया हूं, लेकिन यह बहुत सीधे आगे लगता है।मैं इस Google ऐप इंजन कोड को कैसे अनुकूलित कर सकता हूं?
गूगल मुझ पर चिल्ला कि इस कोड अनुकूलित करने की आवश्यकता है है:
class AddLinks(webapp.RequestHandler):
def post(self):
# Hash the textarea input to generate pseudo-unique value
hash = md5.new(self.request.get('links')).hexdigest()
# Seperate the input by line
allLinks = self.request.get('links').splitlines()
# For each line in the input, add to the database
for x in allLinks:
newGroup = LinkGrouping()
newGroup.reference = hash
newGroup.link = x
newGroup.put()
# testing vs live
#baseURL = 'http://localhost:8080'
baseURL = 'http://linkabyss.appspot.com'
# Build template parameters
template_values = {
'all_links': allLinks,
'base_url': baseURL,
'reference': hash,
}
# Output the template
path = os.path.join(os.path.dirname(__file__), 'addLinks.html')
self.response.out.write(template.render(path, template_values))
डैशबोर्ड मुझे बता रहा है कि यह CPU के एक टन का उपयोग कर रहा है।
मुझे सुधारों को कहां देखना चाहिए?
हाँ, ListProperties एक शांत सुविधा का समर्थन नहीं। यदि आप LinkGrouping.gql ("जहां लिंक = 1", "http://www.google.com") करते हैं, तो यह उन सभी समूहों को वापस कर देगा जिनके पास उनकी सूची में 'http://www.google.com' है। –