title: ajax request to pyramid returns Origin is not allowed by Access-Control-Allow-Origin
body: <p>I am working with python pyramid and basically I have defined a route like this:</p>
  
  <pre><code>config.add_route('metaschemaxml', '/metaschema/{id}/xml')
  </code></pre>
  
  <p>The view mapping metashemaxml is like this:</p>
  
  <pre><code>@view_config(route_name='metaschemaxml', renderer='string')
  def metaxml_view(request):
    schema = request.matchdict['id']
    urlparams = request.query_string
    urlparams.strip()
    required = 0
    for x in urlparams.split(','):
        if "required=1" in x:
            required = 1
    rxml = '&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;eroot&gt;&lt;/eroot&gt;'
  
    try:
        tags = DBSession.query(mtemplatexelem_model).filter(mtemplatexelem_model.template_id == int(schema)).order_by(mtemplatexelem_model.xelem_id).all()
        rxml = getXMLFromQuery(tags, required)
    except DBAPIError:
        return Response("Error in DB", content_type='text/plain', status_int=500)
  
    return Response(rxml, content_type='text/xml', charset='utf8')
  </code></pre>
  
  <p>All works well if for example I call:</p>
  
  <pre><code>http://localhost:6543/metaschema/1/xml
  </code></pre>
  
  <p>But if I do the same request by Ajax I get:</p>
  
  <pre><code>XMLHttpRequest cannot load http://172.26.16.28:6543/metaschema/1/xml. Origin http://localhost is not allowed by Access-Control-Allow-Origin.
  </code></pre>
  
  <p>What do I need to do to allow the ajax request in pyramid?</p>
  
  <p>Thanks,
  Carlos</p>