Add user model, navbar, auth endpoints

master
Tait Hoyem 4 years ago
parent 4e6771e067
commit c16af75667

@ -0,0 +1,31 @@
# Generated by Django 3.1.2 on 2020-10-30 19:07
import django.contrib.auth.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='QuoteUser',
fields=[
('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='auth.user')),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
bases=('auth.user',),
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
]

@ -1,5 +1,6 @@
import json
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class CalgaryAddress(models.Model):
@ -12,4 +13,7 @@ class CalgaryAddress(models.Model):
def toDict(self):
return {
'address': self.address
}
}
class QuoteUser(User):
pass

@ -0,0 +1,9 @@
{% extends 'common/master.html' %}
{% block body %}
<h1>Login</h1>
<form method="POST">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Log In</button>
</form>
{% endblock %}

@ -1,6 +1,7 @@
from django.urls import path
from django.urls import path, include
from . import views
urlpatterns = [
path('', views.index, name='index')
path('', views.index, name='index'),
path('', include('django.contrib.auth.urls')),
]

Loading…
Cancel
Save