login.html 2.85 KB
{% extends 'layout.html' %}
{% block content %}
<!--이것을 써줘야 socicalaccount기능을 사용할수있음.-->
    {%load socialaccount %}
    {% providers_media_js %}
    {% load static %}
    {% static 'blog/img/naver_login_green.png' as naver_button %}
    {% static 'blog/img/naver_login_white.png' as naver_button_hover %}
    {% static 'blog/img/google_login_normal.png' as google_button %}
    {% static 'blog/img/google_login_preesed.png' as google_button_hover %}
    <div class="col-md-8 col-md-offset-2">
        <div class="panel panel-default">
            <div class="panel-heading">로그인</div>
            <div class="panel-body">
                <form class="form-horizontal" role="form" method="POST" action="/login/">
                    <div class="form-group">
                        <div class="col-md-12">
                            <label for="userid">아이디</label>
                            <input id="userid" type="userid" class="form-control" name="username" required autofocus>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <label for="password">비밀번호</label>
                            <input id="password" type="password" class="form-control" name="password" required>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <button type="submit" class="btn btn-success">
                                로그인
                            </button>
                            <button class="btn btn-success" onclick="location.href='/register/';">
                                회원가입
                            </button>
                        </div>
                        <a href="{% provider_login_url 'naver' %}">
                            <img src="{{ naver_button }}"
                                 onmouseover="this.src='{{ naver_button_hover }}'"
                                 onmouseleave="this.src='{{ naver_button }}'"height="34">
                        </a>
                        <br>
                        <a href="{% provider_login_url 'google' %}">
                            <img src="{{ google_button }}"
                                 onmouseover="this.src='{{ google_button_hover }}'"
                                 onmouseleave="this.src='{{ google_button }}'"height="34">
                        </a>
                        <br>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12 text-center">
                            <h5>{{ message }}</h5>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endblock %}