diff --git a/asap/local_settings.py b/asap/local_settings.py index 41d6b37..bdb592c 100644 --- a/asap/local_settings.py +++ b/asap/local_settings.py @@ -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 = '/' diff --git a/asap/urls.py b/asap/urls.py index 22f441a..72e8aa9 100644 --- a/asap/urls.py +++ b/asap/urls.py @@ -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")), ] diff --git a/potatoe/migrations/0001_initial.py b/potatoe/migrations/0001_initial.py index a0eaa61..c46fa35 100644 --- a/potatoe/migrations/0001_initial.py +++ b/potatoe/migrations/0001_initial.py @@ -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')), ], ), ] diff --git a/potatoe/migrations/0002_task_priority.py b/potatoe/migrations/0002_task_priority.py deleted file mode 100644 index 2a58f12..0000000 --- a/potatoe/migrations/0002_task_priority.py +++ /dev/null @@ -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')]), - ), - ] diff --git a/potatoe/migrations/0003_task_assignee.py b/potatoe/migrations/0003_task_assignee.py deleted file mode 100644 index 461a69b..0000000 --- a/potatoe/migrations/0003_task_assignee.py +++ /dev/null @@ -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, - ), - ] diff --git a/potatoe/migrations/0004_auto_20150708_1549.py b/potatoe/migrations/0004_auto_20150708_1549.py deleted file mode 100644 index 76996df..0000000 --- a/potatoe/migrations/0004_auto_20150708_1549.py +++ /dev/null @@ -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'), - ), - ] diff --git a/potatoe/views.py b/potatoe/views.py index 91ea44a..2536b37 100644 --- a/potatoe/views.py +++ b/potatoe/views.py @@ -1,3 +1 @@ from django.shortcuts import render - -# Create your views here. diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 0000000..d35e62f --- /dev/null +++ b/templates/about.html @@ -0,0 +1 @@ +blabla diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/registration/login.html b/templates/registration/login.html new file mode 100644 index 0000000..7cc8daa --- /dev/null +++ b/templates/registration/login.html @@ -0,0 +1,32 @@ +{% if form.errors %} +

Your username and password didn't match. Please try again.

+{% endif %} + +{% if next %} + {% if user.is_authenticated %} +

Your account doesn't have access to this page. To proceed, + please login with an account that has access.

+ {% else %} +

Please login to see this page.

+ {% endif %} +{% endif %} + +
+{% csrf_token %} + + + + + + + + + +
{{ form.username.label_tag }}{{ form.username }}
{{ form.password.label_tag }}{{ form.password }}
+ + + +
+ +{# Assumes you setup the password_reset view in your URLconf #} +

Lost password?