mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-29 16:41:56 +00:00
增加相关的常量的定义以及url参数
This commit is contained in:
parent
c4b02270cb
commit
6f5c9b1657
@ -14,6 +14,11 @@ class UserManager(models.Manager):
|
||||
return self.get(**{self.model.USERNAME_FIELD: username})
|
||||
|
||||
|
||||
REGULAR_USER = 0
|
||||
ADMIN = 1
|
||||
SUPER_ADMIN = 2
|
||||
|
||||
|
||||
class User(AbstractBaseUser):
|
||||
# 用户名
|
||||
username = models.CharField(max_length=30, unique=True)
|
||||
|
@ -49,6 +49,7 @@ INSTALLED_APPS = (
|
||||
'account',
|
||||
'announcement',
|
||||
'utils',
|
||||
'group',
|
||||
|
||||
'rest_framework',
|
||||
'rest_framework_swagger',
|
||||
@ -63,6 +64,7 @@ MIDDLEWARE_CLASSES = (
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'admin.middleware.AdminRequiredMiddleware'
|
||||
)
|
||||
|
||||
ROOT_URLCONF = 'oj.urls'
|
||||
|
@ -3,9 +3,11 @@ from django.conf.urls import include, url
|
||||
from django.contrib import admin
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from account.views import UserLoginAPIView, UsernameCheckAPIView, UserRegisterAPIView, UserChangePasswordAPIView, \
|
||||
EmailCheckAPIView, UserAPIView, UserAdminAPIView
|
||||
from account.views import (UserLoginAPIView, UsernameCheckAPIView, UserRegisterAPIView,
|
||||
UserChangePasswordAPIView, EmailCheckAPIView,
|
||||
UserAPIView, UserAdminAPIView)
|
||||
from announcement.views import AnnouncementAPIView, AnnouncementAdminAPIView
|
||||
from group.views import GroupAdminAPIView
|
||||
from admin.views import AdminTemplateView
|
||||
|
||||
urlpatterns = [
|
||||
@ -29,5 +31,6 @@ urlpatterns = [
|
||||
|
||||
url(r'^admin/contest/$', TemplateView.as_view(template_name="admin/contest/add_contest.html"), name="add_contest_page"),
|
||||
url(r'^problems/$', TemplateView.as_view(template_name="oj/problem/problem_list.html"), name="problem_list_page"),
|
||||
url(r'^admin/template/(?P<template_dir>\w+)/(?P<template_name>\w+).html', AdminTemplateView.as_view(), name="admin_template")
|
||||
url(r'^admin/template/(?P<template_dir>\w+)/(?P<template_name>\w+).html', AdminTemplateView.as_view(), name="admin_template"),
|
||||
url(r'^api/admin/group/$', GroupAdminAPIView.as_view(), name="group_admin_api"),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user