Django个人博客

1. requirements:

bootstrap-admin==0.3.5
  Django==1.7.7
  django-appconf==1.0.1
  django-grappelli==2.6.4
  django-staticfiles==1.2.1
  pytz==2015.2
  six==1.9.0
eclipse+pydev

Python:2.7.11

2. 目录结构:


3. setting.py

#coding:utf-8
"""
Django settings for my_site project.


For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/


For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""


# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')




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


# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'ld+(c7!=8phb(fy*isjwc9+$a3vjfcb#srp9um+m-)6yl9i9%l'


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


TEMPLATE_DEBUG = True


ALLOWED_HOSTS = ['*']




# Application definition


INSTALLED_APPS = (
    #'bootstrap_admin',
    #'django_admin_bootstrapped',
    'bootstrap_toolkit',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'article', 
)


from django.conf import global_settings
TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
    'django.core.context_processors.request',
)
BOOTSTRAP_ADMIN_SIDEBAR_MENU = True


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',
)


ROOT_URLCONF = 'my_site.urls'


WSGI_APPLICATION = 'my_site.wsgi.application'




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


DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        #'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
        'NAME': 'article',
        'USER': 'root',
        'PASSWORD': '123456',
        'HOST': '127.0.0.1',
        'PORT': '3306',
    }
}


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


LANGUAGE_CODE = 'zh-Hans'


TIME_ZONE = 'Asia/Shanghai'


USE_I18N = True


USE_L10N = True


USE_TZ = False




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


STATIC_URL = '/static/'
STATIC_ROOT = 'F:/workspace/my_site'


MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR,'media')


STATICFILES_DIRS = (
    os.path.join(BASE_DIR,'static'),
)


TEMPLATE_DIRS = (
    os.path.join(BASE_DIR,'templates'),
)




ADMINS = {


   ('link', '779140143@qq.com'),


}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值