-
-
Save anonymous/4150673 to your computer and use it in GitHub Desktop.
view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@view_config(route_name='sign_up', renderer='forumapp:templates/sign_up.mako', permission=NO_PERMISSION_REQUIRED) | |
def signup(request): | |
db = request.db | |
import pdb; pdb.set_trace() | |
if request.POST.get("submit", False): | |
user = User(username=request.POST['username'], | |
password=request.POST['password'], | |
email=request.POST['email'], | |
age=request.POST['age']) | |
db.add(user) | |
db.commit() | |
return HTTPFound('/sucess') | |
return{} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="POST" action="/signup" style="text-align:center"> | |
<table border=1px id="signup_form"> | |
<tr> | |
<td><label for="username">username | |
<input name="username" type="text"/></label></td> | |
<tr> | |
<td><label for="password">password | |
<input name="password" type="password"/></label></td> | |
<tr> | |
<td><label for="email">email | |
<input name="email" type="text"/></label></td> | |
<tr> | |
<td><label for="age">age | |
<input name="age" type="text"/></label></td> | |
<tr> | |
<td><input name="submit" type="submit" value="submit"/></td> | |
</tr> | |
</table> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment