Fix the nginx config to work with the new snapshots. Fix the snapshot creator to correctly create the request path.

This commit is contained in:
yackob03 2013-11-18 19:17:58 -05:00
parent 84b9fdd007
commit f5e6af37cf
3 changed files with 13 additions and 9 deletions

View file

@ -4,15 +4,18 @@ import stripe
from flask import (abort, redirect, request, url_for, render_template,
make_response, Response)
from flask.ext.login import login_user, UserMixin, login_required
from flask.ext.principal import identity_changed, Identity, AnonymousIdentity
from flask.ext.login import login_user, UserMixin
from flask.ext.principal import identity_changed
from urlparse import urlparse
from data import model
from app import app, login_manager, mixpanel
from auth.permissions import QuayDeferredPermissionUser, AdministerOrganizationPermission
from auth.permissions import (QuayDeferredPermissionUser,
AdministerOrganizationPermission)
from util.invoice import renderInvoiceToPdf
from util.seo import render_snapshot
logger = logging.getLogger(__name__)
@ -54,7 +57,9 @@ def index(path):
@app.route('/snapshot/', methods=['GET'])
@app.route('/snapshot/<path:path>', methods=['GET'])
def snapshot(path = ''):
result = render_snapshot(path)
parsed = urlparse(request.url)
final_url = '%s://%s/%s' % (parsed.scheme, 'localhost', path)
result = render_snapshot(final_url)
if result:
return result