Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lijie3721 committed Sep 30, 2015
0 parents commit 65fd700
Show file tree
Hide file tree
Showing 1,480 changed files with 424,672 additions and 0 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions .idea/CrazyEye.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/dictionaries/jieli.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,010 changes: 1,010 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Empty file added CrazyEye/__init__.py
Empty file.
Binary file added CrazyEye/__init__.pyc
Binary file not shown.
176 changes: 176 additions & 0 deletions CrazyEye/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
#_*_coding:utf-8_*_
"""
Django settings for CrazyEye project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os,datetime
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'suv(+n%(x)z-d*e82vrhqgxxzx@)s%ke-)v527mx0d@x4ii1y3'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
'suit',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'web',
'debugtools',


)

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'CrazyEye.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ["%s/%s" %(BASE_DIR,'templates'),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',

],
},
},
]

WSGI_APPLICATION = 'CrazyEye.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'CrazyEyes',
'HOST': '',
'PORT':3306,
'USER':'root',
'PASSWORD': ''
}
}


# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'en-us'

#TIME_ZONE = 'Asia/Shanghai'
TIME_ZONE = 'Asia/Shanghai'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/

STATIC_URL = '/static/'
STATICFILES_DIRS = (
"%s/%s" %(BASE_DIR, "statics"),
)

LOGIN_URL = '/login/'
SESSION_EXPIRE_AT_BROWSER_CLOSE = True

MaxTaskProcesses = 4
MultiTaskScript = '%s/%s'%(BASE_DIR,'backend/multitask.py')

RSA_PRIVATE_KEY_FILE = '%s/%s'%(BASE_DIR,'var/rsa_key/id_rsa')


Welcome_msg = '''
|-------\033[32;1m[Welcome login OldBoy Auditing server]\033[0m-------|
| Version : 0.1 |
| Author : Alex Li |
| QQ Group: 29215534 |
|----------------------------------------------------|\n\n'''


FileUploadDir = 'uploads'

WebSSH = ['localhost',4200]


#for django admin customaztion


TEMPLATE_CONTEXT_PROCESSORS = TCP + (
'django.core.context_processors.request',
)
# Django Suit configuration example
SUIT_CONFIG = {
# header
'ADMIN_NAME': 'CrazyEye管理后台',
# 'HEADER_DATE_FORMAT': 'l, j. F Y',
# 'HEADER_TIME_FORMAT': 'H:i',

# forms
'SHOW_REQUIRED_ASTERISK': True, # Default True
# 'CONFIRM_UNSAVED_CHANGES': True, # Default True

# menu
# 'SEARCH_URL': '/admin/auth/user/',
# 'MENU_ICONS': {
# 'sites': 'icon-leaf',
# 'auth': 'icon-lock',
# },
# 'MENU_OPEN_FIRST_CHILD': True, # Default True
'MENU_EXCLUDE': ('auth.group',),
# 'MENU': (
# 'sites',
# {'app': 'auth', 'icon':'icon-lock', 'models': ('user', 'group')},
# {'label': 'Settings', 'icon':'icon-cog', 'models': ('auth.user', 'auth.group')},
# {'label': 'Support', 'icon':'icon-question-sign', 'url': '/support/'},
# ),

# misc
# 'LIST_PER_PAGE': 15
}
Binary file added CrazyEye/settings.pyc
Binary file not shown.
46 changes: 46 additions & 0 deletions CrazyEye/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""CrazyEye URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin

from web import views,api_urls


urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^$',views.dashboard ),
url(r'^hosts/$',views.hosts, name='host_list' ),
url(r'^hosts/multi/$',views.hosts_multi),
url(r'^hosts/crontab/$',views.crontab),
url(r'^multi_task/log/deatail/(\d+)/$',views.multi_task_log_detail,name='multi_task_log_detail'),
url(r'^hosts/multi/filetrans$',views.hosts_multi_filetrans),
url(r'^api/',include(api_urls)),
url(r'^personal/',views.personal,name='personal'),
url(r'^user_audit/(\d+)/$',views.user_audit, name='user_audit'),
url(r'^logout/',views.logout,name='logout'),




url(r'^login/$',views.login,name='login'),

#url(r'^account/login/$',views.account_auth),
url(r'^accounts/profile/$',views.personal),

#test below
url(r'^register/$', views.register),
url(r'^articles/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/$', views.article_detail,{'test':'haa'})
]
Binary file added CrazyEye/urls.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions CrazyEye/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for CrazyEye project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CrazyEye.settings")

application = get_wsgi_application()
Binary file added CrazyEye/wsgi.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions backend/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#_*_coding:utf-8_*_
__author__ = 'jieli'
Binary file added backend/__init__.pyc
Binary file not shown.
22 changes: 22 additions & 0 deletions backend/db_conn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#Author: Alex Li
import sys,os

basedir = '/'.join(__file__.split("/")[:-2])
sys.path.append(basedir)

sys.path.append('%s/CrazyEye' %basedir)
os.environ['DJANGO_SETTINGS_MODULE'] ='CrazyEye.settings'
import django
django.setup()

'''#for windows platform only
cur_dir = os.path.split(os.path.abspath(__file__))[0].split('\\')[:-1]
base_dir = '\\'.join(cur_dir)
sys.path.append(base_dir)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "auto_cmdb.settings")
'''

#from web import models
#print models.Hosts.objects.all()

Binary file added backend/db_conn.pyc
Binary file not shown.
Empty file added backend/demo.log
Empty file.
7 changes: 7 additions & 0 deletions backend/global_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#_*_coding:utf-8_*_

import os,sys

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CrazyEye.settings")
base_dir = '/'.join(os.path.abspath(os.path.dirname(__file__)).split("/")[:-1])
sys.path.append(base_dir)
Binary file added backend/global_settings.pyc
Binary file not shown.
Loading

0 comments on commit 65fd700

Please sign in to comment.