Permalink
Browse files

1.0.0 version

  • Loading branch information...
1 parent 378f075 commit 2564253d6535df2f8af5ae3aa5f7015d8df9e10c @Miserlou Miserlou committed Sep 5, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 lightwrite/texts/views.py
@@ -12,10 +12,14 @@
import random
import string
+# Redirect to a random page
+# If deploying, make sure you have a REDIR in your local_settings
+# TODO: Don't redirect to already taken pads
def root(request):
wash = ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(9))
return HttpResponseRedirect(settings.REDIR + '/' + wash)
+# The main event
def write(request, wash):
if request.method == 'POST':
t = Text.objects.filter(wash=wash)
@@ -38,6 +42,7 @@ def write(request, wash):
return render_to_response('light.html', {'wash': wash,}, context_instance=RequestContext(request))
+# Get the text result
def json_get_text(request, wash):
t = Text.objects.filter(wash=wash)
if (len(t)==0):

0 comments on commit 2564253

Please sign in to comment.