Discussion:
[bottlepy] Bottle GAE cookies issue
Ehbraheem
2016-06-07 12:07:16 UTC
Permalink
Am having issues with using the
bottle.set_cookie()
function with my app engine instance. It is a dummy app that am using to
practice using bottle.
I read a post here relating to my problem but it could not solve my
problem.
This is the code causing all the error
@bottle.post('/signup')
def register():
username = bottle.request.forms.get('username')
password = bottle.request.forms.get('password')
email = bottle.request.forms.get('email')
verify = bottle.request.forms.get('verify')
errors = {'username':username,'email':email}
if validate_signup(username,password,verify,email,errors):

if not users.add_user(username,password,email):
errors['username_error'] = "User already Exist"
return bottle.template('signup',errors)
session_id = sessions.start_session(username)
print session_id
bottle.response.set_cookie('session', session_id, path='/')
bottle.redirect('/welcome')
else:
print "User did not validate"
return bottle.template('signup',errors)


I can upload my file here if anybody care to help me with getting better
with bottle
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sebastian Bassi
2016-06-07 17:04:42 UTC
Permalink
you should post your error (trace), would be easier to help.
Post by Ehbraheem
Am having issues with using the
bottle.set_cookie()
function with my app engine instance. It is a dummy app that am using to
practice using bottle.
I read a post here relating to my problem but it could not solve my
problem.
This is the code causing all the error
@bottle.post('/signup')
username = bottle.request.forms.get('username')
password = bottle.request.forms.get('password')
email = bottle.request.forms.get('email')
verify = bottle.request.forms.get('verify')
errors = {'username':username,'email':email}
errors['username_error'] = "User already Exist"
return bottle.template('signup',errors)
session_id = sessions.start_session(username)
print session_id
bottle.response.set_cookie('session', session_id, path='/')
bottle.redirect('/welcome')
print "User did not validate"
return bottle.template('signup',errors)
I can upload my file here if anybody care to help me with getting better
with bottle
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Non standard disclaimer: READ CAREFULLY. By reading this email,
you agree, on behalf of your employer, to release me from all
obligations and waivers arising from any and all NON-NEGOTIATED
agreements, licenses, terms-of-service, shrinkwrap, clickwrap,
browsewrap, confidentiality, non-disclosure, non-compete and
acceptable use policies ("BOGUS AGREEMENTS") that I have
entered into with your employer, its partners, licensors, agents and
assigns, in perpetuity, without prejudice to my ongoing rights and
privileges. You further represent that you have the authority to release
me from any BOGUS AGREEMENTS on behalf of your employer.
Google ads remover words: suicide, murder
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ehbraheem
2016-06-19 19:40:49 UTC
Permalink
Should I upload my project folder so you can take a look at it. Am pretty
new to bottle
Post by Ehbraheem
Am having issues with using the
bottle.set_cookie()
function with my app engine instance. It is a dummy app that am using to
practice using bottle.
I read a post here relating to my problem but it could not solve my
problem.
This is the code causing all the error
@bottle.post('/signup')
username = bottle.request.forms.get('username')
password = bottle.request.forms.get('password')
email = bottle.request.forms.get('email')
verify = bottle.request.forms.get('verify')
errors = {'username':username,'email':email}
errors['username_error'] = "User already Exist"
return bottle.template('signup',errors)
session_id = sessions.start_session(username)
print session_id
bottle.response.set_cookie('session', session_id, path='/')
bottle.redirect('/welcome')
print "User did not validate"
return bottle.template('signup',errors)
I can upload my file here if anybody care to help me with getting better
with bottle
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Victor Zambrano
2016-06-21 21:30:35 UTC
Permalink
Well i am not an expert, but i will try to explain what i learnerd. First,
stick to the simple examples from http://bottlepy.org/docs/dev/index.html:

from bottle import route, run, template

@route('/hello/<name>')
def index(name):
return template('<b>Hello {{name}}</b>!', name=name)

run(host='localhost', port=8080)

Now if you import the objects request and responde, you can use them...
from bottle import request, response, etc. . . .

@route('/path', method="POST")
def my_handler():
x = request.forms.get('anydata')



set_cookie() is a method of the response object, so....

response.set_cookie(parameters here)

And to get cookie is a method of the request object right ?

request.get_cookie(parameters here)
Post by Ehbraheem
Am having issues with using the
bottle.set_cookie()
function with my app engine instance. It is a dummy app that am using to
practice using bottle.
I read a post here relating to my problem but it could not solve my
problem.
This is the code causing all the error
@bottle.post('/signup')
username = bottle.request.forms.get('username')
password = bottle.request.forms.get('password')
email = bottle.request.forms.get('email')
verify = bottle.request.forms.get('verify')
errors = {'username':username,'email':email}
errors['username_error'] = "User already Exist"
return bottle.template('signup',errors)
session_id = sessions.start_session(username)
print session_id
bottle.response.set_cookie('session', session_id, path='/')
bottle.redirect('/welcome')
print "User did not validate"
return bottle.template('signup',errors)
I can upload my file here if anybody care to help me with getting better
with bottle
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...