Commit ae0a1aa9 authored by BERJON Matthieu's avatar BERJON Matthieu

Add of webapp and login views

I added the webapp view that just list the name of the apps. I added as
well a login view. Unfortunately the hashes of the password recorded in
the database do not match with the base django algorithm and people
can't identify themselves at the moment.
Signed-off-by: BERJON Matthieu's avatarMatthieu Berjon <matthieu.berjon@inria.fr>
parent 2591cfb2
......@@ -130,10 +130,12 @@ STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'djangobower.finders.BowerFinder', # add this
'compressor.finders.CompressorFinder', # add this
'compressor.finders.CompressorFinder',
)
COMPRESS_PRECOMPILERS = (
('text/x-scss', 'django_libsass.SassCompiler'),
)
LOGIN_REDIRECT_URL = 'poc_home'
LOGOUT_REDIRECT_URL = 'poc_home'
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from . import views
urlpatterns = [
url(r'^$', views.index),
url(r'^$', views.index, name="poc_home"),
url(r'^users/', views.user),
url(r'^webapps/', views.list_webapps, name='list_webapps'),
url(
r'^login/$',
auth_views.login,
{'template_name': 'login.html'},
name='login'),
url(r'^logout/$', auth_views.logout, name='logout'),
url(r'^signup/', views.signup, name='signup'),
]
from django.shortcuts import render
from django.contrib.auth.models import User
from .models import Webapp
def index(request):
......@@ -11,3 +12,16 @@ def user(request):
# quotas = Quota.objects.all()
users = User.objects.all()
return render(request, "user.html", locals())
def list_webapps(request):
webapps = Webapp.objects.all()
return render(request, "webapps.html", locals())
def login(request):
pass
def signup(request):
pass
{% extends 'base.html' %}
{% block title %}Login{% endblock %}
{% block content %}
<h2>Login</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Login</button>
</form>
{% endblock %}
{% extends "base.html" %}
{% block title %}Webapps{% endblock %}
{% block content %}
<ul>
{% for webapp in webapps %}
<li>{{ webapp.name }}</li>
{% endfor %}
</ul>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment