Merge branch 'dev' into dev-sxw

Nothing~
This commit is contained in:
esp
2015-08-31 20:57:36 +08:00
4 changed files with 77 additions and 60 deletions

View File

@@ -5,7 +5,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# 下面是需要自己修改的 # 下面是需要自己修改的
LOG_PATH = "LOG/" LOG_PATH = "log/"
# 注意这是web 服务器访问的地址,判题端访问的地址不一定一样,因为可能不在一台机器上 # 注意这是web 服务器访问的地址,判题端访问的地址不一定一样,因为可能不在一台机器上
DATABASES = { DATABASES = {
@@ -18,7 +18,7 @@ DATABASES = {
'NAME': 'oj_submission', 'NAME': 'oj_submission',
'ENGINE': 'django.db.backends.mysql', 'ENGINE': 'django.db.backends.mysql',
'HOST': "121.42.32.129", 'HOST': "121.42.32.129",
'POST': 3306, 'PORT': 3306,
'USER': 'root', 'USER': 'root',
'PASSWORD': 'mypwd' 'PASSWORD': 'mypwd'
} }
@@ -29,5 +29,5 @@ DEBUG = True
# 同理 这是 web 服务器的上传路径 # 同理 这是 web 服务器的上传路径
TEST_CASE_DIR = os.path.join(BASE_DIR, 'test_case/') TEST_CASE_DIR = os.path.join(BASE_DIR, 'test_case/')
DATABASE_ROUTERS = ['oj.db_router.DBRouter'] ALLOWED_HOSTS = []

View File

@@ -1 +1,37 @@
# coding=utf-8 # coding=utf-8
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# 下面是需要自己修改的
LOG_PATH = "/var/log/oj/"
# 注意这是web 服务器访问的地址,判题端访问的地址不一定一样,因为可能不在一台机器上
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': "oj",
'CONN_MAX_AGE': 0.3,
'HOST': '127.0.0.1',
'PORT': 3306,
'USER': 'root',
'PASSWORD': 'mypwd'
},
'submission': {
'NAME': 'oj_submission',
'ENGINE': 'django.db.backends.mysql',
'HOST': "127.0.0.1",
'PORT': 3306,
'USER': 'root',
'PASSWORD': 'mypwd'
}
}
DEBUG = True
# 同理 这是 web 服务器的上传路径
TEST_CASE_DIR = '/root/test_case/'
ALLOWED_HOSTS = ['*']

View File

@@ -14,15 +14,13 @@ https://docs.djangoproject.com/en/1.8/ref/settings/
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os import os
# todo 判断运行环境 # 判断运行环境
ENV = os.environ.get("oj_env", "local") ENV = os.environ.get("oj_env", "local")
if ENV == "local": if ENV == "local":
from .local_settings import * from .local_settings import *
elif ENV == "server": elif ENV == "server":
from .server_settings import * from .server_settings import *
elif ENV == "daocloud":
from .daocloud_settings import *
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -33,7 +31,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'hzfp^8mbgapc&x%$#xv)0=t8s7_ilingw(q3!@h&2fty6v6fxz' SECRET_KEY = 'hzfp^8mbgapc&x%$#xv)0=t8s7_ilingw(q3!@h&2fty6v6fxz'
ALLOWED_HOSTS = []
# Application definition # Application definition
@@ -171,3 +169,5 @@ LOGGING = {
REST_FRAMEWORK = { REST_FRAMEWORK = {
'TEST_REQUEST_DEFAULT_FORMAT': 'json' 'TEST_REQUEST_DEFAULT_FORMAT': 'json'
} }
DATABASE_ROUTERS = ['oj.db_router.DBRouter']

View File

@@ -8,71 +8,65 @@
<link rel="stylesheet" type="text/css" href="/static/css/fullpage/jquery.fullPage.css"> <link rel="stylesheet" type="text/css" href="/static/css/fullpage/jquery.fullPage.css">
<style> <style>
html, textarea, input, option, select, button { html, textarea, input, option, select, button {
font: 1em "Helvetica Neue", Helvetica, "Lantinghei SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", font: 1em "Helvetica Neue", Helvetica, "Lantinghei SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑",
"STHeiti", "WenQuanYi Micro Hei", SimSun, sans-serif; "STHeiti", "WenQuanYi Micro Hei", SimSun, sans-serif;
color: #FFF; color: #FFF;
} }
a { a {
text-decoration: none; text-decoration: none;
color: #FFF; color: #FFF;
} }
#header { #header {
position: fixed; position: fixed;
height: 30px; height: 30px;
display: block; display: block;
width: 100%; width: 100%;
background: transparent; background: transparent;
z-index: 10; z-index: 10;
padding: 20px 20px 0 20px; padding: 20px 20px 0 20px;
} }
#name { #name {
font-size: 45px; font-size: 45px;
margin-right: 20px; margin-right: 20px;
} }
#nav-left{
display: inline;
position:relative;
float: right;
margin-right: 28px;
}
.section { .section {
position: relative; position: relative;
} }
.section h1 { .section h1 {
font-size: 60px; font-size: 60px;
} }
.section h3 { .section h3 {
font-size: 30px; font-size: 30px;
font-weight: normal; font-weight: normal;
} }
.bottom-pointer { .bottom-pointer {
top: auto; top: auto;
bottom: 20px; bottom: 20px;
position: absolute; position: absolute;
left: 48%; left: 48%;
} }
.index-section-text { .index-section-text {
position: absolute; position: absolute;
top: 30%; top: 30%;
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.section-text { .section-text {
text-align: center; text-align: center;
} }
.icon { .icon {
max-height: 300px; max-height: 300px;
max-width: 300px; max-width: 300px;
} }
</style> </style>
@@ -103,20 +97,7 @@
<a href="/submissions/">提交</a>&nbsp;&nbsp; <a href="/submissions/">提交</a>&nbsp;&nbsp;
<a href="/contests/">比赛</a>&nbsp;&nbsp; <a href="/contests/">比赛</a>&nbsp;&nbsp;
<a href="/groups/">小组</a>&nbsp;&nbsp; <a href="/groups/">小组</a>&nbsp;&nbsp;
<a href="/about/">关于</a>&nbsp;&nbsp; <a href="/about/">关于</a>
<div id="nav-left">
{% if request.user.is_authenticated %}
<a href="#">{{ request.user.username }}</a>
<a href="/logout/">退出</a>
{% else %}
<a href="/login/">
登录
</a>
<a href="/register/">
注册
</a>
{% endif %}
</div>
</div> </div>
@@ -124,9 +105,9 @@
<div id="fullpage"> <div id="fullpage">
<div class="section" id="section0"> <div class="section" id="section0">
<div class="index-section-text animated bounceInUp"> <div class="index-section-text animated bounceInUp">
<h1>青岛大学在线评测平台</h1> <h1>青岛大学 Online Judge</h1>
<h3>新面貌,新的开始~</h3> <h3>面貌,新的开始~</h3>
</div> </div>
<div class="bottom-pointer">↓继续滚动~</div> <div class="bottom-pointer">↓继续滚动~</div>
</div> </div>
@@ -156,7 +137,7 @@
<div class="section-text"> <div class="section-text">
<img class="icon" id="img3" src="/static/img/index/m.png"> <img class="icon" id="img3" src="/static/img/index/m.png">
<h1>自由举办小组赛</h1> <h1>自由举办小组赛(10月上线)</h1>
<h3>内部比赛,日常作业,期末考试,通通搞定</h3> <h3>内部比赛,日常作业,期末考试,通通搞定</h3>
</div> </div>