Django 后台搭建
# Django settings for gameadmin project. DEBUG = True
TEMPLATE_DEBUG = DEBUG ADMINS = (
# ('Your Name', 'your_email@domain.com'),
) MANAGERS = ADMINS DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'anheisg', # Or path to database file if using sqlite3.
'USER': 'root', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
} # Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago' # Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us' SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True # If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True # Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '' # URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody.
SECRET_KEY = 't$x6qs*yixesq!0j--0_#=i!wx98bx#8op_q4#b!s)+r3kmzza' # List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
) MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
) ROOT_URLCONF = 'gameadmin.urls' TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
) INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'admin', # Uncomment the next line to enable the admin:
'django.contrib.admin', )
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover() urlpatterns = patterns('',
# Example:
# (r'^gameadmin/', include('gameadmin.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
Django 后台搭建的更多相关文章
- 使用Django快速搭建简单的数据管理后台
使用Django快速搭建简单的数据管理后台 概述 需求描述: 数据表已建好,能可视化操作增删改查,避免直接操作数据库 简版的管理系统 环境 Windows 10 x64 Python 3.6.3 (A ...
- Nginx+PostgreSQL+Django+UWSGI搭建
最近因为项目上的需要开始大量使用nginx,因此也想趁机将以前常用的django+apache的架构换成django+nginx.常见的 django webapp 部署方式采用FCGI 或 WSGI ...
- Django快速搭建博客系统
Django快速搭建博客系统 一.开发环境 Windows 7(64bit) python 3.6 https://www.python.org/ Django 2.0 https://www. ...
- Django框架(四)-- 路由控制:有名/无名分组、反向解析、路由分发、名称空间、伪静态、APPEND_SLASH、不同版本的Django区别、Django虚拟环境搭建
路由控制 一.简单路由配置 url(r'^booklist$', views.booklist) 第一个参数是正则表达式,第二个参数是视图函数 每个正则表达式前面的'r' 是可选的但是建议加上.它告诉 ...
- python web框架之django环境搭建
一.django环境搭建 https://www.djangoproject.com/download/ 下载适合自己的版本,在右边有压缩包版本的,也可以到git上去拽.我用的python27,下载的 ...
- python运维开发(十九)----Django后台表单验证、session、cookie、model操作
内容目录: Django后台表单验证 CSRF加密传输 session.cookie model数据库操作 Django后台Form表单验证 Django中Form一般有2种功能: 1.用于做用户提交 ...
- Django后台设置--遇到的问题与解决方案
1. 后台如何管理项目中的models 新建的Django工程会自动引用admin 应用,新建后台可以通过 createsuperuser 命令建立后台admin超级管理员,我遇到的第一个问题,就是如 ...
- Django 后台支持中文方法
今天遇到的一个问题,mark一下: django后台可以支持中文界面,一开始一直纠结于settings.py 中 LANGUAGE_CODE = 'en-us'中的'en-us'该更改成什么.zh-c ...
- Python之Django环境搭建(MAC+pycharm+Django++postgreSQL)
Python之Django环境搭建(MAC+pycharm+Django++postgreSQL) 转载请注明地址:http://www.cnblogs.com/funnyzpc/p/7828614. ...
随机推荐
- C#_简单Excel导入
引用程序集 Microsoft.Office.Core Microsoft.Office.Interop.Excel using System; using System.Collections.Ge ...
- CF下Split的使用
在Compact Framework 下 String的Split不能正确的处理 字符串 分割字符串 如对字符串 "abcfdef12abcedef23" 以"ef&qu ...
- SQL按照日、周、月、年统计数据
写sql语句分别按日,星期,月,季度,年统计销售额 --按日 select sum(consume),day([date]) from consume_record where year([date] ...
- ### C++总结-[类的继承]
面向对象中关于继承的总结. #@author: gr #@date: 2015-07-26 #@email: forgerui@gmail.com 一.类的隐藏 重载(overload).覆盖(ove ...
- Cocos移植到Android-使用Eclipse交叉编译打包
如果对命令行望而生畏,我们可以借助于安装有ADT插件的Eclipse工具实现交叉编译.使用Eclipse进行交叉编译,首先需要将要编译的工程导入到Eclipse的Workspace中,Workspac ...
- 【leetcode】7. Reverse Integer
题目描述: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 解题思 ...
- Poj OpenJudge 百练 2632 Crashing Robots
1.Link: http://poj.org/problem?id=2632 http://bailian.openjudge.cn/practice/2632/ 2.Content: Crashin ...
- 2014-10 u-boot make过程分析
/** ****************************************************************************** * @author Maox ...
- WinForm C#全局错误捕捉处理【整理】
static class Program { /// <summary> /// 应用程序的主入口点. /// </summary> [STAThread] static vo ...
- 解决Execwb 导致 ado崩溃的问题。
http://qc.embarcadero.com/wc/qcmain.aspx?d=61255