Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
roomlist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
roomlist
Commits
0ad576c5
Commit
0ad576c5
authored
May 09, 2015
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PEP8 compliance
parent
516e8072
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
96 additions
and
74 deletions
+96
-74
roomlist/accounts/adapter.py
roomlist/accounts/adapter.py
+3
-4
roomlist/accounts/cas_callbacks.py
roomlist/accounts/cas_callbacks.py
+1
-0
roomlist/accounts/forms.py
roomlist/accounts/forms.py
+5
-4
roomlist/accounts/models.py
roomlist/accounts/models.py
+10
-7
roomlist/accounts/search_indexes.py
roomlist/accounts/search_indexes.py
+2
-4
roomlist/accounts/urls.py
roomlist/accounts/urls.py
+1
-1
roomlist/accounts/views.py
roomlist/accounts/views.py
+12
-6
roomlist/api/views.py
roomlist/api/views.py
+9
-3
roomlist/housing/models.py
roomlist/housing/models.py
+28
-23
roomlist/housing/room-numbers.py
roomlist/housing/room-numbers.py
+4
-3
roomlist/housing/urls.py
roomlist/housing/urls.py
+1
-2
roomlist/housing/views.py
roomlist/housing/views.py
+17
-14
roomlist/settings/urls.py
roomlist/settings/urls.py
+3
-3
No files found.
roomlist/accounts/adapter.py
View file @
0ad576c5
# standard library imports
from
datetime
import
datetime
,
timedelta
# core django imports
from
django.conf
import
settings
# core django imports
from
django.shortcuts
import
resolve_url
# third party imports
from
allauth.account.adapter
import
DefaultAccountAdapter
...
...
@@ -10,10 +9,10 @@ from allauth.account.adapter import DefaultAccountAdapter
class
AccountAdapter
(
DefaultAccountAdapter
):
def
get_login_redirect_url
(
self
,
request
):
threshold
=
90
#
seconds
threshold
=
90
#
seconds
assert
request
.
user
.
is_authenticated
()
if
(
request
.
user
.
last_login
-
request
.
user
.
date_joined
).
seconds
<
threshold
:
if
(
(
request
.
user
.
last_login
-
request
.
user
.
date_joined
).
seconds
<
threshold
)
:
url
=
'/accounts/student/'
else
:
url
=
'/accounts/student/'
...
...
roomlist/accounts/cas_callbacks.py
View file @
0ad576c5
...
...
@@ -20,6 +20,7 @@ def pfinfo(uname):
name
=
pfjson
[
'results'
][
0
][
'name'
]
return
name
.
split
(
','
)
def
create_user
(
tree
):
username
=
tree
[
0
][
0
].
text
...
...
roomlist/accounts/forms.py
View file @
0ad576c5
...
...
@@ -2,13 +2,14 @@
from
django
import
forms
# third party imports
from
crispy_forms.helper
import
FormHelper
from
crispy_forms.layout
import
Submit
,
Layout
,
Field
,
HTML
from
crispy_forms.bootstrap
import
PrependedText
,
AppendedText
,
FormActions
from
crispy_forms.layout
import
Submit
,
Layout
from
crispy_forms.bootstrap
import
PrependedText
,
AppendedText
# imports from your apps
from
.models
import
Student
# form to create student
class
StudentForm
(
forms
.
ModelForm
):
class
StudentForm
(
forms
.
ModelForm
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -28,7 +29,7 @@ class StudentForm( forms.ModelForm ):
model
=
Student
class
UserSettingsForm
(
forms
.
ModelForm
):
class
UserSettingsForm
(
forms
.
ModelForm
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
roomlist/accounts/models.py
View file @
0ad576c5
...
...
@@ -9,21 +9,23 @@ from django.core.urlresolvers import reverse
from
autoslug
import
AutoSlugField
from
allauth.socialaccount.models
import
SocialAccount
# imports from your apps
from
housing.models
import
Building
,
Room
,
Class
from
housing.models
import
Room
,
Class
class
Major
(
TimeStampedModel
):
name
=
models
.
CharField
(
max_length
=
50
)
name
=
models
.
CharField
(
max_length
=
50
)
# I believe the longest is "Government and International Politics"
def
__str__
(
self
):
return
self
.
name
def
__unicode__
(
self
):
return
unicode
(
self
.
name
)
class
Meta
:
ordering
=
[
'name'
]
class
StudentQuerySet
(
models
.
query
.
QuerySet
):
def
floor
(
self
):
return
self
.
filter
(
privacy
=
'floor'
)
...
...
@@ -47,11 +49,11 @@ class StudentQuerySet(models.query.QuerySet):
students
=
self
.
students
()
# using the function above results in UnboundLocalError excpetion
#building_students = building_students()
building_students
=
list
(
building
)
+
list
(
set
(
students
)
-
set
(
building
))
return
list
(
floor
)
+
list
(
set
(
building_students
)
-
set
(
floor
))
class
StudentManager
(
models
.
Manager
):
# this 'duplication' allows for queryset chaining
...
...
@@ -70,10 +72,11 @@ class StudentManager(models.Manager):
def
building_students
(
self
):
return
self
.
get_queryset
().
building_students
()
def
floor_building_students
(
self
):
return
self
.
get_queryset
().
floor_building_students
()
class
Student
(
TimeStampedModel
):
user
=
models
.
OneToOneField
(
User
)
# Django user includes a username, password, email, first name, and last name
...
...
@@ -118,19 +121,19 @@ class Student(TimeStampedModel):
fb_uid
=
SocialAccount
.
objects
.
filter
(
user
=
self
.
user
.
id
,
provider
=
'facebook'
)
print
(
"profile_image"
)
if
len
(
fb_uid
)
>
0
:
if
len
(
fb_uid
)
>
0
:
return
"http://graph.facebook.com/{}/picture?width=175&height=175"
.
format
(
fb_uid
[
0
].
uid
)
return
"http://www.gravatar.com/avatar/{}?s=175"
.
format
(
hashlib
.
md5
(
self
.
user
.
email
).
hexdigest
())
def
get_absolute_url
(
self
):
return
reverse
(
'detail_student'
,
kwargs
=
{
'slug'
:
self
.
slug
})
return
reverse
(
'detail_student'
,
kwargs
=
{
'slug'
:
self
.
slug
})
class
Meta
:
ordering
=
[
'user'
]
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
user
.
username
def
__unicode__
(
self
):
return
unicode
(
self
.
user
.
username
)
roomlist/accounts/search_indexes.py
View file @
0ad576c5
# standard libary imports
import
datetime
# third party imports
from
haystack
import
indexes
# imports from your apps
...
...
@@ -15,11 +13,11 @@ class StudentIndex(indexes.SearchIndex, indexes.Indexable):
# with the fields that we want to display when returning results
# search filtering
user
=
indexes
.
CharField
(
model_attr
=
'user'
)
user
=
indexes
.
CharField
(
model_attr
=
'user'
)
def
get_model
(
self
):
return
Student
def
index_queryset
(
self
,
using
=
None
):
"""When the entire index for model is updated."""
return
self
.
get_model
().
objects
.
all
()
return
self
.
get_model
().
objects
.
all
()
roomlist/accounts/urls.py
View file @
0ad576c5
...
...
@@ -2,7 +2,7 @@
from
django.conf.urls
import
patterns
,
include
,
url
# imports from your apps
from
.views
import
DetailStudent
,
UpdateStudent
,
DetailStudentSettings
,
\
DetailCurrentStudent
,
DetailCurrentStudentSettings
,
UpdateStudentMajor
DetailCurrentStudent
,
DetailCurrentStudentSettings
,
UpdateStudentMajor
urlpatterns
=
patterns
(
''
,
...
...
roomlist/accounts/views.py
View file @
0ad576c5
# core django imports
from
django.shortcuts
import
render
,
get_object_or_404
from
django.shortcuts
import
get_object_or_404
from
django.http
import
HttpResponseForbidden
from
django.views.generic
import
DetailView
,
ListView
,
UpdateView
,
UpdateView
,
Dele
teView
from
django.views.generic
import
DetailView
,
Upda
teView
# third party imports
from
braces.views
import
LoginRequiredMixin
# imports from your apps
...
...
@@ -11,7 +11,7 @@ from .models import Student
# update a student (students are *created* on first login via CAS)
class
UpdateStudent
(
LoginRequiredMixin
,
UpdateView
):
model
=
Student
fields
=
[
'room'
,
'privacy'
,]
fields
=
[
'room'
,
'privacy'
,
]
context_object_name
=
'student'
template_name
=
'updateStudent.html'
...
...
@@ -30,9 +30,10 @@ class UpdateStudent(LoginRequiredMixin, UpdateView):
else
:
return
super
(
UpdateStudent
,
self
).
get
(
request
,
*
args
,
**
kwargs
)
class
UpdateStudentMajor
(
LoginRequiredMixin
,
UpdateView
):
models
=
Student
fields
=
[
'major'
,]
fields
=
[
'major'
,
]
template_name
=
'updateStudentMajor.html'
login_url
=
'login'
...
...
@@ -41,6 +42,7 @@ class UpdateStudentMajor(LoginRequiredMixin, UpdateView):
# def get_object(self):
# return get_object_or_404(Student, pk=self.request.session['_auth_user_id'])
# details about the student
class
DetailStudent
(
LoginRequiredMixin
,
DetailView
):
model
=
Student
...
...
@@ -73,17 +75,19 @@ class DetailStudent(LoginRequiredMixin, DetailView):
# if the student's privacy is floor and the requesting user is on their floor
if
(
self
.
get_object
().
privacy
==
'floor'
)
and
onFloor
():
student_shares
=
True
# if the student's privacy is building and the requesting users is on their floor or in their building
# if the student's privacy is building and the requesting users is
# on their floor or in their building
elif
(
self
.
get_object
().
privacy
==
'building'
)
and
inBuilding
():
student_shares
=
True
# if the student's privacy is set to 'student'
elif
(
self
.
get_object
().
privacy
==
'students'
):
student_shares
=
True
return
student_shares
context
[
'shares'
]
=
shares
()
return
context
class
DetailCurrentStudent
(
LoginRequiredMixin
,
DetailView
):
model
=
Student
context_object_name
=
'student'
...
...
@@ -94,6 +98,7 @@ class DetailCurrentStudent(LoginRequiredMixin, DetailView):
def
get_object
(
self
):
return
get_object_or_404
(
Student
,
pk
=
self
.
request
.
session
[
'_auth_user_id'
])
# changeable student settings
class
DetailStudentSettings
(
LoginRequiredMixin
,
DetailView
):
model
=
Student
...
...
@@ -102,6 +107,7 @@ class DetailStudentSettings(LoginRequiredMixin, DetailView):
login_url
=
'login'
class
DetailCurrentStudentSettings
(
LoginRequiredMixin
,
DetailView
):
model
=
Student
context_object_name
=
'student'
...
...
roomlist/api/views.py
View file @
0ad576c5
# core django imports
from
django.http
import
HttpResponse
# third party imports
import
json
# imports from your apps
from
housing.models
import
Building
,
Room
# Create your views here.
def
index
(
request
):
return
HttpResponse
(
"Hello, world. You're at the RoomList index."
)
def
buildings_list
(
request
):
building_list
=
Building
.
objects
.
order_by
(
'name'
)[:
5
]
jsons
=
'{"buildings":['
...
...
@@ -16,6 +18,7 @@ def buildings_list(request):
jsons
=
jsons
[:
-
1
]
+
']}'
return
HttpResponse
(
jsons
)
def
building
(
request
,
buildingName
):
room_list
=
Room
.
objects
.
filter
(
building__name
=
''
+
buildingName
).
order_by
(
'number'
)
jsons
=
'Building does not exist'
...
...
@@ -34,6 +37,7 @@ def building(request, buildingName):
jsons
=
jsons
[:
-
1
]
+
']}'
return
HttpResponse
(
jsons
)
def
room
(
request
,
building
,
room_number
):
room_obj
=
Room
.
objects
.
filter
(
building__name
=
''
+
building
,
number
=
room_number
)
...
...
@@ -52,6 +56,7 @@ def room(request, building, room_number):
jsons
+=
']}'
return
HttpResponse
(
jsons
)
###################JASON trying to JSON in python, so confuzed:
# if room_obj:
# jsons = {'building':building, 'number':room_number, 'residents': []}
...
...
@@ -65,6 +70,7 @@ def room(request, building, room_number):
# jsons.residents[3] = 'bedD':p.bedD.__str__()
# return HttpResponse(json.dumps(jsons))
def
neighbourhood
(
request
,
nhood
):
building_list
=
Building
.
objects
.
filter
(
neighbourhood
=
''
+
nhood
).
order_by
(
'name'
)
jsons
=
'That neighbourhood has no buildings or does not exist'
...
...
roomlist/housing/models.py
View file @
0ad576c5
...
...
@@ -22,8 +22,9 @@ class Building(TimeStampedModel):
)
neighbourhood
=
models
.
CharField
(
max_length
=
100
,
choices
=
NEIGHBOURHOOD_CHOICES
,
default
=
NONE
)
#address = models.ForeignKey('Address')
default
=
NONE
)
# address = models.ForeignKey('Address')
PRINCE_WILLIAM
=
'pw'
MASONVALE
=
'mv'
...
...
@@ -42,77 +43,80 @@ class Building(TimeStampedModel):
def
get_absolute_url
(
self
):
return
reverse
(
'detail_building'
,
kwargs
=
{
'building'
:
self
.
building_name
,
'slug'
:
self
.
slug
,
'building'
:
self
.
building_name
,
'slug'
:
self
.
slug
,
})
def
__str__
(
self
):
# __unicode__ on Python 2
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
name
def
__unicode__
(
self
):
# __unicode__ on Python 2
def
__unicode__
(
self
):
# __unicode__ on Python 2
return
unicode
(
self
.
name
)
class
Meta
:
ordering
=
[
'name'
]
class
Floor
(
TimeStampedModel
):
building
=
models
.
ForeignKey
(
'Building'
)
number
=
models
.
IntegerField
()
slug
=
RandomSlugField
(
length
=
6
)
floor_num
=
AutoSlugField
(
populate_from
=
'number'
,
# unique_with='building')
)
floor_num
=
AutoSlugField
(
populate_from
=
'number'
,)
# unique_with='building')
def
get_absolute_url
(
self
):
return
reverse
(
'detail_floor'
,
kwargs
=
{
'building'
:
self
.
building
.
building_name
,
'floor'
:
self
.
floor_num
,
'slug'
:
self
.
slug
,
'building'
:
self
.
building
.
building_name
,
'floor'
:
self
.
floor_num
,
'slug'
:
self
.
slug
,
})
def
__str__
(
self
):
# __unicode__ on Python 2
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
building
.
__str__
()
+
" "
+
self
.
number
.
__str__
()
class
Meta
:
ordering
=
[
'building'
,
'number'
]
class
Room
(
TimeStampedModel
):
number
=
models
.
IntegerField
()
floor
=
models
.
ForeignKey
(
'Floor'
)
slug
=
RandomSlugField
(
length
=
6
)
room_num
=
AutoSlugField
(
populate_from
=
'number'
,
# unique_with='floor')
)
room_num
=
AutoSlugField
(
populate_from
=
'number'
,)
# unique_with='floor')
def
get_absolute_url
(
self
):
return
reverse
(
'detail_room'
,
kwargs
=
{
'floor'
:
self
.
floor
.
floor_num
,
'building'
:
self
.
floor
.
building
.
building_name
,
'room'
:
self
.
room_num
,
'slug'
:
self
.
slug
,
'floor'
:
self
.
floor
.
floor_num
,
'building'
:
self
.
floor
.
building
.
building_name
,
'room'
:
self
.
room_num
,
'slug'
:
self
.
slug
,
})
def
__str__
(
self
):
# __unicode__ on Python 2
def
__str__
(
self
):
# __unicode__ on Python 2
return
self
.
floor
.
building
.
__str__
()
+
" "
+
self
.
number
.
__str__
()
class
Meta
:
ordering
=
[
'number'
]
# buildings on campus don't have separate addresses yet
#class Address(TimeStampedModel):
# street = models.CharField(max_length=120)
# city = models.CharField(max_length=120)
# state = USStateField()
# zip_code = models.IntegerField(max_length=5)
# class Meta:
# class Meta:
# verbose_name_plural = 'addresses'
# def __str__(self): # __unicode__ on Python 2
# return self.street
class
Class
(
TimeStampedModel
):
grad_year
=
models
.
PositiveIntegerField
()
FRESHMAN
=
'FR'
...
...
@@ -130,7 +134,8 @@ class Class(TimeStampedModel):
year_in_school
=
models
.
CharField
(
max_length
=
2
,
choices
=
YEAR_IN_SCHOOL_CHOICES
,
default
=
FRESHMAN
)
class
Meta
:
class
Meta
:
verbose_name_plural
=
'classes'
def
__str__
(
self
):
# __unicode__ on Python 2
...
...
roomlist/housing/room-numbers.py
View file @
0ad576c5
# standard library imports
import
io
import
string
import
random
import
re
# from stackoverflow https://stackoverflow.com/questions/2257441/
def
slug_generator
(
size
=
6
,
chars
=
string
.
ascii_letters
+
string
.
digits
):
return
''
.
join
(
random
.
choice
(
chars
)
for
_
in
range
(
size
))
# regex to separate out building names and room numbers
def
building_or_room
(
line
):
return
False
def
get_floor_num
(
line
):
return
line
[
0
]
...
...
@@ -28,7 +29,7 @@ curFloorInBuilding = 1
for
line
in
roomNumbers
:
line
=
line
.
rstrip
(
'
\n
'
)
if
re
.
match
(
'[a-zA-Z]'
,
line
):
if
re
.
match
(
'[a-zA-Z]'
,
line
):
curFloor
+=
1
curFloorInBuilding
=
1
else
:
...
...
roomlist/housing/urls.py
View file @
0ad576c5
# core django imports
from
django.conf.urls
import
patterns
,
include
,
url
from
django.conf.urls
import
patterns
,
url
# imports from your apps
from
.views
import
ListBuildings
,
DetailBuilding
,
DetailFloor
,
DetailRoom
from
.models
import
Building
,
Floor
,
Room
urlpatterns
=
patterns
(
''
,
...
...
roomlist/housing/views.py
View file @
0ad576c5
# core django imports
from
django.views.generic
import
DetailView
,
ListView
,
CreateView
,
UpdateView
,
\
DeleteView
from
django.views.generic
import
DetailView
,
ListView
# third party imports
from
braces.views
import
LoginRequiredMixin
# imports from your apps
# imports from your apps
from
.models
import
Building
,
Floor
,
Room
from
accounts.models
import
Student
...
...
@@ -12,7 +11,7 @@ from accounts.models import Student
class
ListBuildings
(
LoginRequiredMixin
,
ListView
):
model
=
Building
queryset
=
Building
.
objects
.
all
()
# paginate_by
=
# paginate_by
context_object_name
=
'buildings'
template_name
=
'list_buildings.html'
...
...
@@ -25,12 +24,13 @@ class ListBuildings(LoginRequiredMixin, ListView):
context
[
'aquia'
]
=
Building
.
objects
.
filter
(
neighbourhood
=
'aq'
).
order_by
(
'name'
)
return
context
# building floors, other information
class
DetailBuilding
(
LoginRequiredMixin
,
DetailView
):
model
=
Building
slug_field
=
'slug__iexact'
context_object_name
=
'building'
template_name
=
'detail_building.html'
template_name
=
'detail_building.html'
login_url
=
'login'
...
...
@@ -39,16 +39,17 @@ class DetailBuilding(LoginRequiredMixin, DetailView):
context
[
'floors'
]
=
Floor
.
objects
.
filter
(
building__name
=
''
+
self
.
get_object
().
name
).
order_by
(
'number'
)
return
context
# this lists the rooms on the floor
class
DetailFloor
(
LoginRequiredMixin
,
DetailView
):
class
DetailFloor
(
LoginRequiredMixin
,
DetailView
):
model
=
Floor
context_object_name
=
'floor'
template_name
=
'detail_floor.html'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
DetailFloor
,
self
).
get_context_data
(
**
kwargs
)
#requesting_student = Student.objects.get(user=self.request.user)
#
requesting_student = Student.objects.get(user=self.request.user)
requesting_student_filter
=
Student
.
objects
.
filter
(
user
=
self
.
request
.
user
)
requesting_student
=
requesting_student_filter
[
0
]
...
...
@@ -81,15 +82,16 @@ class DetailFloor(LoginRequiredMixin, DetailView):
context
[
'notInBuilding'
]
=
not
inBuilding
()
return
context
class
DetailRoom
(
LoginRequiredMixin
,
DetailView
):
model
=
Room
context_object_name
=
'room'
template_name
=
'detail_room.html'
template_name
=
'detail_room.html'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
DetailRoom
,
self
).
get_context_data
(
**
kwargs
)
#requesting_student = Student.objects.get(user=self.request.user)
#
requesting_student = Student.objects.get(user=self.request.user)
requesting_student_filter
=
Student
.
objects
.
filter
(
user
=
self
.
request
.
user
)
requesting_student
=
requesting_student_filter
[
0
]
...
...
@@ -108,11 +110,11 @@ class DetailRoom(LoginRequiredMixin, DetailView):
return
building_status
if
onFloor
():
students
=
Student
.
objects
.
filter
(
room
=
self
.
get_object
()).
floor_building_students
()
students
=
Student
.
objects
.
filter
(
room
=
self
.
get_object
()).
floor_building_students
()
elif
inBuilding
():
students
=
Student
.
objects
.
filter
(
room
=
self
.
get_object
()).
building_students
()
students
=
Student
.
objects
.
filter
(
room
=
self
.
get_object
()).
building_students
()
else
:
students
=
Student
.
objects
.
filter
(
room
=
self
.
get_object
()).
students
()
students
=
Student
.
objects
.
filter
(
room
=
self
.
get_object
()).
students
()
context
[
'students'
]
=
students
context
[
'notOnFloor'
]
=
not
onFloor
()
...
...
@@ -122,4 +124,5 @@ class DetailRoom(LoginRequiredMixin, DetailView):
login_url
=
'/'
# deleted 'UpdateRoom' view-- that will be handled on the user's page
roomlist/settings/urls.py
View file @
0ad576c5
...
...
@@ -14,7 +14,7 @@ handle500 = TemplateView.as_view(template_name="500.html")
urlpatterns
=
patterns
(
''
,
# project-level urls
url
(
r
'^$'
,
TemplateView
.
as_view
(
template_name
=
"index.html"
),
name
=
'index'
),
url
(
r
'^$'
,
TemplateView
.
as_view
(
template_name
=
"index.html"
),
name
=
'index'
),
url
(
r
'^about/$'
,
TemplateView
.
as_view
(
template_name
=
'about.html'
),
name
=
'about'
),
url
(
r
'^privacy/$'
,
TemplateView
.
as_view
(
template_name
=
'privacy.html'
),
name
=
'privacy'
),
...
...
@@ -26,8 +26,8 @@ urlpatterns = patterns('',
url
(
r
'^search/'
,
include
(
'haystack.urls'
),
name
=
'search'
),
# login and logout
#url(r'^login/', 'cas.views.login', name='login'),
#url(r'^logout/', 'cas.views.logout', name='logout'),
#
url(r'^login/', 'cas.views.login', name='login'),
#
url(r'^logout/', 'cas.views.logout', name='logout'),
url
(
r
'^login/$'
,
'django.contrib.auth.views.login'
,
name
=
'login'
),
url
(
r
'^logout/$'
,
'django.contrib.auth.views.logout'
,
name
=
'logout'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment