mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-02-06 21:20:32 +03:00
121 lines
4.9 KiB
HTML
121 lines
4.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="description" content="Django-rest-auth demo">
|
|
<meta name="author" content="Tivix, Inc.">
|
|
|
|
<title>Starter Template for Bootstrap</title>
|
|
|
|
<!-- Latest compiled and minified CSS -->
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
|
|
|
<!-- Optional theme -->
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
|
|
|
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
<!--[if lt IE 9]>
|
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
|
<![endif]-->
|
|
</head>
|
|
|
|
<body role="document">
|
|
|
|
<div class="navbar navbar-inverse" role="navigation">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand" href="/">django-rest-auth demo</a>
|
|
</div>
|
|
<div class="collapse navbar-collapse">
|
|
<ul class="nav navbar-nav">
|
|
<li class="active"><a href="/">Demo</a></li>
|
|
<li><a target="_blank" href="http://django-rest-auth.readthedocs.org/en/latest/">Documentation</a></li>
|
|
<li><a target="_blank" href="https://github.com/Tivix/django-rest-auth">Source code</a></li>
|
|
</ul>
|
|
</div><!--/.nav-collapse -->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="container theme-showcase" role="main">
|
|
<!-- Nav tabs -->
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
<li class="active"><a href="#signup" role="tab" data-toggle="tab">Signup</a></li>
|
|
<li><a href="#email-verification" role="tab" data-toggle="tab">E-mail verification</a></li>
|
|
</ul>
|
|
|
|
<!-- Tab panes -->
|
|
<div class="tab-content">
|
|
<div class="tab-pane active" id="signup">
|
|
<div class="row">
|
|
<!-- Signup form -->
|
|
<form class="form-horizontal" role="form">
|
|
<div class="form-group">
|
|
<label for="username" class="col-sm-2 control-label">Username</label>
|
|
<div class="col-sm-10">
|
|
<input name="username" type="text" class="form-control" id="username" placeholder="Username">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="password1" class="col-sm-2 control-label">Password</label>
|
|
<div class="col-sm-10">
|
|
<input name="password1" type="password" class="form-control" id="password1" placeholder="Password">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="password2" class="col-sm-2 control-label">Repeat password</label>
|
|
<div class="col-sm-10">
|
|
<input name="password2" type="password" class="form-control" id="password2" placeholder="Repeat password">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-sm-offset-2 col-sm-10">
|
|
<button type="submit" class="btn btn-default">Sign up</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="row api-response">
|
|
</div>
|
|
</div>
|
|
<div class="tab-pane" id="email-verification">E-mail verification</div>
|
|
</div>
|
|
</div>
|
|
<!-- Bootstrap core JavaScript
|
|
================================================== -->
|
|
<!-- Placed at the end of the document so the pages load faster -->
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
|
<script type="text/javascript">
|
|
|
|
var print_response = function(selctor, data){
|
|
console.log(data);
|
|
$(selctor).html("API Response:<br/>Status code: " + data.status + ' ' + data.statusText + '<br/>Content: ' + data.responseText);
|
|
}
|
|
|
|
$().ready(function(){
|
|
$('#signup button[type=submit]').click(function(){
|
|
$.post( "/rest-auth/registration/", $('#signup form').serialize())
|
|
.always(function(data){
|
|
print_response('#signup .api-response', data);
|
|
});
|
|
return false;
|
|
});
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|