parent
ebde6b6271
commit
dcf7dd31d3
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
|
||||
"""
|
||||
@version: ??
|
||||
@author: liangliangyy
|
||||
@license: MIT Licence
|
||||
@contact: liangliangyy@gmail.com
|
||||
@site: https://www.lylinux.org/
|
||||
@software: PyCharm
|
||||
@file: forms.py
|
||||
@time: 2017/3/7 下午8:58
|
||||
"""
|
||||
|
||||
from django.contrib.auth.forms import forms
|
||||
from django.forms import widgets
|
||||
|
||||
|
||||
class RequireEmailForm(forms.Form):
|
||||
email = forms.EmailField(label='电子邮箱', required=True)
|
||||
oauthid = forms.IntegerField(widget=forms.HiddenInput, required=False)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(RequireEmailForm, self).__init__(*args, **kwargs)
|
||||
self.fields['email'].widget = widgets.EmailInput(attrs={'placeholder': "email", "class": "form-control"})
|
||||
@ -1,13 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
class OAuthTet(TestCase):
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
|
||||
from oauth.oauthmanager import WBOauthManager
|
||||
from django.conf import settings
|
||||
settings.OAHUTH['sina']
|
||||
manager=WBOauthManager(client_id=settings.OAHUTH['sina']['appkey'],client_secret=settings.OAHUTH['sina']['appsecret'],callback_url=settings.OAHUTH['sina']['callbackurl'])
|
||||
@ -0,0 +1,46 @@
|
||||
{% extends 'share_layout/base_account.html' %}
|
||||
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<h2 class="form-signin-heading text-center">Binding E-mail account</h2>
|
||||
|
||||
<div class="card card-signin">
|
||||
{% if picture %}
|
||||
<img class="img-circle profile-img" src="{{ picture }}" alt="">
|
||||
{% else %}
|
||||
<img class="img-circle profile-img" src="{% static 'blog/img/avatar.png' %}" alt="">
|
||||
{% endif %}
|
||||
<form class="form-signin" action="" method="post">
|
||||
{% csrf_token %}
|
||||
{% comment %}<label for="inputEmail" class="sr-only">Email address</label>
|
||||
<input type="email" id="inputEmail" class="form-control" placeholder="Email" required autofocus>
|
||||
<label for="inputPassword" class="sr-only">Password</label>
|
||||
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>{% endcomment %}
|
||||
{{ form.non_field_errors }}
|
||||
{% for field in form %}
|
||||
{{ field }}
|
||||
{{ field.errors }}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">Submit</button>
|
||||
|
||||
{% comment %}
|
||||
<div class="checkbox">
|
||||
<a class="pull-right">Need help?</a>
|
||||
<label>
|
||||
<input type="checkbox" value="remember-me"> Stay signed in
|
||||
</label>
|
||||
</div>
|
||||
{% endcomment %}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p class="text-center">
|
||||
<a href="{% url "account:login" %}">Sign In</a>
|
||||
</p>
|
||||
|
||||
</div> <!-- /container -->
|
||||
{% endblock %}
|
||||
Loading…
Reference in new issue