def done( self ): #make sure the user doesn't already exist u = User.by_name( self.username ) if u: msg = 'That user already exists.' self.render('signup-form.html', error_username = msg) else: u = User.register( self.username, self.password, self.email ) u.put() self.login( u ) self.redirect( "/" )
def post(self): if not User.by_name('postrwall'): u_test = User.register('postrwall', 'postrwall') u_test.put() username = self.request.get('username') password = self.request.get('password') u = User.login(username, password) if u: self.login(u) self.redirect('/Admin/') else: Utils.template2handler(self, 'admin-login.html', { 'title': 'Please Login', 'admin':True, 'error':'Incorrect Login/Password, please try again.', 'username':username })
def get(self): self.response.headers['Content-Type'] = 'text/html' self.response.out.write('Database Initialisation ... <br />') Event(name="Reggae Sun Ska", date=datetime.date(2012, 8, 3), description="Awesome Reggae Festival in Bordeaux", posterUrl="http://p.gap.free.fr/web/images_agenda/2979_1_img.jpg", webpage="http://www.reggaesunska.com/2012/", address="Bordeaux, France", price=float(50), artists=['Jimmy Cliff', 'Ayo', 'Damian Marley', 'Groundation' ], genres=['Reggae', 'Dub'], creator=User.by_name('postrwall')).put() Event(name="Szigets 2012", date=datetime.date(2012, 8, 6), description="Biggest Europeean Festival", posterUrl="http://www.spectacles.carrefour.fr/image_actualites//sziget-2012-officielle.jpg", webpage="http://www.reggaesunska.com/2012/", address="Budapest, Hungary", price=float(50), artists=['Placebo', 'The Stone Roses', 'The Ting Tings', 'Axwell', 'Korn', 'The XX'], genres=['Rock', 'Indie', 'Electro', 'Folk'], creator=User.by_name('postrwall')).put() Event(name="Bpitch Control", date=datetime.date(2012, 7, 21), description="Another party in the Berghain", posterUrl="http://www.residentadvisor.net/images/events/flyer/2012/7/de-0721-354493-19974-front.jpg", webpage="http://www.reggaesunska.com/2012/", address="Berghain, Am Wriezener Bahnhof, 10243 Berlin", price=float(10), artists=['Kiki', 'DJ Red', 'Shinedoe', 'Marcel Fengler', 'Thomas Muller'], genres=['Electro', 'Minimal'], creator=User.by_name('postrwall')).put() Event(name="Berlin Festival", date=datetime.date(2012, 9, 7), description="Yearly festival in Tempelhof", posterUrl="http://www.indiemeute.de/wp-content/uploads/2012/05/Berlin-Festival-20121.jpg", webpage="http://www.reggaesunska.com/2012/", address="Tempelhof Airport", price=float(50), artists=['The Killers', 'Paul Kalkbrenner', 'Sigur Ros', 'Franz Ferdinand', 'Kraftklub'], genres=['Electro', 'Minimal', 'Rock', 'Indie'], creator=User.by_name('postrwall')).put() Event(name="Les vieilles Charrues", date=datetime.date(2012, 7, 19), description="French festival in Britany", posterUrl="http://burnmebaby.fr/wp-content/uploads/2012/07/Vieilles-Charrues-Affiche.jpg", webpage="http://www.reggaesunska.com/2012/", address="Le Mans, France", price=float(30), artists=['Bob Dylan', 'Sting', 'Portishead', 'The Cure', 'LMFAO'], genres=['Electro', 'Minimal', 'Rock', 'Indie'], creator=User.by_name('postrwall')).put() Event(name="Open Air Berlin at Rummelsburger Bucht", date=datetime.date(2012, 8, 05), description="Awesome Open Air with Extrawelt", posterUrl="../images/de-0805-348219-47340-front.jpg", webpage="http://www.reggaesunska.com/2012/", address="Rummelsburger Bucht, Berlin, Germany", price=float(15), artists=['Extrawelt', 'Monika Kruse', 'Ruede Hagelstein', 'Sis'], genres=['Electro', 'Minimal'], creator=User.by_name('postrwall')).put() self.response.out.write('Database Initialised')