I have this class:
class View(object):
def main_page(self, extra_placeholders = None):
file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
placeholders = { 'site_name' : 'pypular' }
# If we passed placeholders vars, append them
if extra_placeholders != None:
for k, v in extra_placeholders.iteritems():
placeholders[k] = v
My problem in the code above is the if statement
As you can see, the function takes an argument(extra_placeholders) which is a dict.
If i don't pass a parameter to main_page(),
if extra_placeholders == None:
return 'i executed'
runs fine. however,
if extra_placeholders != None:
return 'i cause error'
does not work. it causes a 500 internal server error. Why?