Skip to content


Madam, I've added event badge generator code #3

merged 1 commit into from

2 participants


Please accept. PLEASE... i ll get you another Dairy Milk Silk :D

@madhuvishy madhuvishy merged commit 45ed4bc into madhuvishy:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 11, 2011
  1. Badge Generator service added

    Karthik Subramanian committed
1 badge/BadgeGen
@@ -0,0 +1 @@
+Subproject commit e08bb87c48bc3f322dd0887fc04a58192ac94c70
BIN badge/__init__.pyc
Binary file not shown.
BIN badge/forms.pyc
Binary file not shown.
BIN badge/models.pyc
Binary file not shown.
BIN badge/urls.pyc
Binary file not shown.
13 badge/
@@ -2,6 +2,7 @@
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import render_to_response
+from BadgeGen import createBadges
#from django.contrib.auth import authenticate,login
from forms import BadgeForm
# Create your views here.
@@ -12,9 +13,21 @@ def errorHandle(error):
form = BadgeForm()
return render_to_response('badge/input.html', {'error':error, 'form':form,})
+ def handle_uploaded_file(f):
+ #destination = open('./BadgeGen/sample.csv', 'wb+')
+ #for chunk in f.chunks():
+ # destination.write(chunk)
+ #destination.close()
+ ob = createBadges.BadgeMaker(f,template = "BadgeGen/badge_template_white.png",namecol = "black", fontname = "BadgeGen/arial.ttf" )
+ ob.generateBadges()
if request.method == 'POST':
form = BadgeForm(request.POST, request.FILES)
fname = request.POST['fname']
+ handle_uploaded_file(request.FILES['csvfile'])
#if form.is_valid():
return render_to_response('badge/success.html', {'fname':fname})
BIN badge/views.pyc
Binary file not shown.
Something went wrong with that request. Please try again.