add views to the example project

This commit is contained in:
Gonçalo Valério 2019-11-17 22:27:40 +00:00
parent df9e4d8c61
commit be337d6017
5 changed files with 37 additions and 9 deletions

View File

@ -1,10 +1,13 @@
# -*- coding: utf-8 -*-
from django.views.generic import (
CreateView,
DeleteView,
DetailView,
UpdateView,
ListView,
)
from django.contrib.auth.views import LoginView
from django.views.generic import FormView
from .models import Address
class MoneroLoginView(LoginView):
pass
class MoneroSignUpView(FormView):
pass

View File

@ -26,6 +26,14 @@
<li>
<a href="/">Home</a>
</li>
{% if not request.user.is_authenticated %}
<li>
<a href="{% url 'test_signup' %}">Sign up</a>
</li>
<li>
<a href="{% url 'test_login' %}">Login</a>
</li>
{% endif %}
</ul>
</div>
</div>

View File

@ -0,0 +1,5 @@
{% extends 'django_cryptolock/base.html' %}
{% block content %}
{{form}}
{% endblock content %}

View File

@ -1,3 +1,8 @@
from django.conf.urls import url
urlpatterns = []
from .views import TestLoginView, TestSignupView
urlpatterns = [
url(r"login", TestLoginView.as_view(), name="test_login"),
url(r"signup", TestSignupView.as_view(), name="test_signup"),
]

View File

@ -1,3 +1,10 @@
from django.shortcuts import render
from django_cryptolock.views import MoneroLoginView, MoneroSignUpView
# Create your views here.
class TestLoginView(MoneroLoginView):
pass
class TestSignupView(MoneroSignUpView):
pass