This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> | |
apriliarsv4fullride | |
</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script> | |
<script type="text/javascript" src="/static/js/jquery.mousewheel.js"></script> | |
<script type="text/javascript" src="/static/js/ilightbox/ilightbox.packed.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% block title %}Contact{% endblock %} | |
{% load crispy_forms_tags %} | |
{% block content %} | |
<div class='row contact'> | |
<div class='col-md-4'></div> | |
<div class='col-md-4'> | |
{% crispy_form %} | |
</div> | |
<div class='col-md-4'></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginForm(forms.Form): | |
email = forms.EmailField(required=True) | |
password = forms.CharField(required=True, widget=forms.PasswordInput(render_value=False)) | |
def __init__(self, *args, **kwargs): | |
super(LoginForm, self).__init__(*args, **kwargs) | |
self.helper = FormHelper() | |
self.helper.form_id = 'login' | |
self.helper.form_class = 'login' | |
self.helper.form_method = 'POST' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scrapy.spider import Spider | |
from scrapy.http import Request | |
from scrapy.selector import Selector | |
class CampUSA(Spider): | |
""" | |
This spider iterates through the list of states on the homepage, and plunges into each one. It then blindly clicks search to bring up ALL results for that state. | |
""" | |
name = 'camp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/create_user', methods=['GET', 'POST']) | |
def create_user(): | |
form = UserForm(request.form) | |
if request.method == 'POST' and form.validate(): | |
#to add: make sure stripe was a success | |
if User.query.filter_by(email = form.email).first() == None: | |
user = user_datastore.create_user(email=form.email.data, | |
password=encrypt_password(form.password.data), | |
active=True, | |
confirmed_at=datetime.date.today()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// This identifies your website in the createToken call below | |
Stripe.setPublishableKey('da_key'); | |
// ... | |
</script> | |
<script> | |
jQuery(function($) { | |
$('#form').submit(function(event) { | |
var $form = $(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
roles_users = db.Table('roles_users', | |
db.Column('user_id', db.Integer(), db.ForeignKey('user.id')), | |
db.Column('role_id', db.Integer(), db.ForeignKey('role.id'))) | |
class Role(db.Model, RoleMixin): | |
""" | |
Roles for determining User permissions and access levels. | |
Permission table: | |
Purchase Roverpass - Upload images, Leave Review | |
Claim Campsite - Edit page, Upload, Leave Review |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kickstart import * | |
from flask import Flask, render_template, make_response, request, redirect | |
from flask.ext.sqlalchemy import SQLAlchemy | |
import stripe, oauthlib, requests, psycopg2 | |
from campModels import * | |
from userModels import * | |
from userForms import * | |
import datetime | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="open-modal" func="camgpround/{{campground.slug}}/leave_review" class="btn btn-primary btn-style btn-md" data-target="#myModal">Leave Review</button> |
OlderNewer