add accounts templates

This commit is contained in:
Fred Pauchet 2015-09-18 16:13:46 +02:00
parent 8dfee988a8
commit 8f3014479e
10 changed files with 48 additions and 72 deletions

View File

@ -60,7 +60,7 @@ ROOT_URLCONF = 'asap.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': ['templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@ -106,3 +106,5 @@ LOCALE_PATHS = ('locale',)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
STATIC_URL = '/static/'
LOGIN_REDIRECT_URL = '/'

View File

@ -15,7 +15,10 @@ Including another URLconf
"""
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url('^accounts/', include('django.contrib.auth.urls')),
url(r'^about/', TemplateView.as_view(template_name="about.html")),
]

View File

@ -2,35 +2,39 @@
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Context',
fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=255)),
],
),
migrations.CreateModel(
name='Project',
fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=255)),
],
),
migrations.CreateModel(
name='Task',
fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('description', models.CharField(max_length=2000)),
('contexts', models.ManyToManyField(to='todo.Context')),
('project', models.ForeignKey(to='todo.Project')),
('priority', models.CharField(choices=[('A', 'Highest'), ('B', 'Medium'), ('C', 'Low')], null=True, max_length=1)),
('assignee', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
('contexts', models.ManyToManyField(to='potatoe.Context')),
('projects', models.ManyToManyField(to='potatoe.Project')),
],
),
]

View File

@ -1,19 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('todo', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='task',
name='priority',
field=models.CharField(max_length=1, null=True, choices=[('A', 'Highest'), ('B', 'Medium'), ('C', 'Low')]),
),
]

View File

@ -1,22 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('todo', '0002_task_priority'),
]
operations = [
migrations.AddField(
model_name='task',
name='assignee',
field=models.ForeignKey(to=settings.AUTH_USER_MODEL, default=1),
preserve_default=False,
),
]

View File

@ -1,23 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('todo', '0003_task_assignee'),
]
operations = [
migrations.RemoveField(
model_name='task',
name='project',
),
migrations.AddField(
model_name='task',
name='projects',
field=models.ManyToManyField(to='todo.Project'),
),
]

View File

@ -1,3 +1 @@
from django.shortcuts import render
# Create your views here.

1
templates/about.html Normal file
View File

@ -0,0 +1 @@
blabla

0
templates/base.html Normal file
View File

View File

@ -0,0 +1,32 @@
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% else %}
<p>Please login to see this page.</p>
{% endif %}
{% endif %}
<form method="post" action="{% url 'django.contrib.auth.views.login' %}">
{% csrf_token %}
<table>
<tr>
<td>{{ form.username.label_tag }}</td>
<td>{{ form.username }}</td>
</tr>
<tr>
<td>{{ form.password.label_tag }}</td>
<td>{{ form.password }}</td>
</tr>
</table>
<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
{# Assumes you setup the password_reset view in your URLconf #}
<p><a href="{% url 'password_reset' %}">Lost password?</a></p>