Commit ee4e9723 authored by Jason D Yeomans's avatar Jason D Yeomans
Browse files

added accounts app

parent 6b3b0500
from django.contrib import admin
# Register your models here.
from django.db import models
# Create your models here.
from django.test import TestCase
# Create your tests here.
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# login and logout
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'index.html'}, name='logout'),
)
from django.shortcuts import render
# Create your views here.
......@@ -47,6 +47,7 @@ class Address(models.Model):
def __str__(self): # __unicode__ on Python 2
return self.street
class Class(models.Model):
year_int = models.IntegerField()
FRESHMAN = 'FR'
......@@ -66,8 +67,11 @@ class Class(models.Model):
def __str__(self): # __unicode__ on Python 2
return self.year_int
class Student(models.Student):
class Student(models.Model):
user = models.OneToOneField(User)
# Django user includes a username, password, email, first name, and last name
room = models.OneToOneField(Room)
# class = models.OneToOneField(Class)
def __str__(self): # __unicode__ on Python 2
return self.user.username
from django.conf.urls import patterns, include, url
from roomlist import views
from housing import views
from django.contrib import admin
admin.autodiscover()
......
from django.views.generic import TemplateView
from django.conf.urls import patterns, include, url
from django.contrib import admin
......@@ -6,15 +7,12 @@ admin.autodiscover()
urlpatterns = patterns('',
# project-level urls
# url(r'^$', index.html
url(r'^$', TemplateView.as_view( template_name="index.html" ), name='index'),
# url(r'^$', about.html
# login and logout
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'),
url(r'logout/$', 'django.contrib.auth.views.logout', {'template_name': 'index.html'}, name='logout'),
# app-level urls
url(r'^housing/', include('housing.urls')),
url(r'^accounts/', include('accounts.urls')),
# alternate interfaces
url(r'^api/', include('api.urls')),
......
......@@ -24,6 +24,7 @@
</label>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
<input type="hidden" name="next" value="/" />
</form>
{% 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