Commit 43238539 authored by ale's avatar ale

rename main module

parent a50344a5
......@@ -17,6 +17,7 @@ status = {'ok': 0, 'error': 0}
def create_shortcut(n):
try:
token = 'test%010d' % n
print 'creating', token
data = urllib.urlencode({'token': token, 'url': URL})
resp = urllib2.urlopen(ENDPOINT, data)
result = resp.read()
......
......@@ -5,6 +5,7 @@ import formencode
from formencode import validators
import logging
import lrucache
import os
import time
# Some configuration. Environment variables take precedence.
......@@ -28,7 +29,7 @@ def index():
class CreateSchema(formencode.Schema):
"""Validation schema for the new shortcut form."""
_frm = secure_form.SecureFormValidator(SECURE_FORM_SECRET)
#_frm = secure_form.SecureFormValidator(SECURE_FORM_SECRET)
url = validators.URL(add_http=True, check_exists=False, require_tld=True)
token = validators.Regex(r'^[a-zA-Z0-9]{3,16}$', not_empty=False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment