"""
Django settings for example_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
import os
import sys
# Used to
sys.path.insert(0, '../../django-hitcount') # our hitcount app
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 't=d4ulc7kg99v4$d#s4ann+#&va0b2-npkq!qh19!l#_29@&$n'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog', # app to show hits
'hitcount'
)
MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'example_project.urls'
WSGI_APPLICATION = 'example_project.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'OPTIONS': {
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
'debug': DEBUG,
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
# Your stuff: custom template context processors go here
],
},
},
]
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
# DJANGO HITCOUNT SPECIFIC VARIABLES
# As of v1.1.1 this setting is no longer needed
#SESSION_SAVE_EVERY_REQUEST = True
HITCOUNT_KEEP_HIT_ACTIVE = {'minutes': 60}
HITCOUNT_HITS_PER_IP_LIMIT = 0 # unlimited
HITCOUNT_EXCLUDE_USER_GROUP = () # not used
HITCOUNT_KEEP_HIT_IN_DATABASE = {'seconds': 10}
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
写在前面 本期内容 - 基于django+hitcount的网页计数器 所需环境 - python - pycharm或vscode - django Django简介 Django 是一个开源的、基于 Python 的高级 Web 应用框架,它遵循模型-视图-模板(Model-View-Template, MVT)设计模式。诞生于2005年,最初由美国《世界在线》新闻组开发,旨在简化复杂性并加速新闻类网站的开发流程。 在 Django 中: 1. 模型(Model):负责处理应用程序的数据结构和数据库交互,通过ORM(Object-Relational Mapping)与关系型数据库如MySQL、PostgreSQL等进行连接,定义数据表结构和业务逻辑。 2. 视图(View):视图是处理用户请求的核心部分,根据接收到的HTTP请求决定展示哪些数据或执行何种操作,并将结果组织成响应返回给客户端。 3. 模板(Template):提供了一种强大的模板……
资源推荐
资源详情
资源评论
收起资源包目录
33-基于django+hitcount的网页计数器.rar (33个子文件)
33-基于django+hitcount的网页计数器
example_project
db.sqlite3 196KB
manage.py 258B
blog
__init__.py 0B
admin.py 85B
migrations
__init__.py 0B
0002_auto_20150512_1644.py 1KB
0001_initial.py 530B
__pycache__
0001_initial.cpython-312.pyc 1KB
0002_auto_20150512_1644.cpython-312.pyc 2KB
__init__.cpython-312.pyc 229B
models.py 480B
fixtures
initial_data.json 436B
templates
blog
post_ajax.html 2KB
base.html 3KB
post_detail.html 714B
index.html 905B
__pycache__
admin.cpython-312.pyc 391B
views.cpython-312.pyc 3KB
models.cpython-312.pyc 1KB
__init__.cpython-312.pyc 218B
static
vendor
bootstrap.min.css 120KB
bootstrap.min.js 36KB
bootstrap-theme.min.css 23KB
jquery-2.1.4.min.js 82KB
views.py 1KB
example_project
__init__.py 0B
wsgi.py 405B
urls.py 793B
settings.py 3KB
__pycache__
urls.cpython-312.pyc 1KB
settings.cpython-312.pyc 3KB
wsgi.cpython-312.pyc 733B
__init__.cpython-312.pyc 229B
共 33 条
- 1
资源评论
Want595
- 粉丝: 7w+
- 资源: 71
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功