当前位置: 首页 > news >正文

刷赞网站推广qq免费五年级下册数学优化设计答案

刷赞网站推广qq免费,五年级下册数学优化设计答案,东营招标信息网,wordpress使用手机号登录密码首先要说明这段python代码并不完整,而且我也没有做过测试,只是我在工作时参考了其中的一些个方法。这是我在找python相关源码资料里看到的一段代码,是Django静态文件URL配置代码片段2,代码中有些方法还是挺技巧的,做其…

首先要说明这段python代码并不完整,而且我也没有做过测试,只是我在工作时参考了其中的一些个方法。这是我在找python相关源码资料里看到的一段代码,是Django静态文件URL配置代码片段2,代码中有些方法还是挺技巧的,做其它操作时可以参考着使用。需要完整代码的伙伴们可以自已去找找看,如果有时间等,就等我把其它片段收集整理后再贴上来分享。

#!usr/bin/env python
#coding: utf-8import logging
import os.pathDEBUG = True
TEMPLATE_DEBUG = DEBUG
HERE = os.path.dirname(os.path.abspath(__file__))ADMINS = (# ('Your Name', 'your_email@example.com'),
)MANAGERS = ADMINSDATABASES = {'default': {'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.'NAME': 'djangodemo',                      # Or path to database file if using sqlite3.'USER': 'root',                      # Not used with sqlite3.'PASSWORD': '',                  # Not used with sqlite3.'HOST': 'localhost',                      # Set to empty string for localhost. Not used with sqlite3.'PORT': '3306',                      # 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 = 'Asia/Shanghai'# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'zh-cn'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 = TrueMEDIA_ROOT = os.path.join(HERE, 'data').replace('\\','/')STATIC_ROOT = os.path.join(HERE, 'static').replace('\\','/')CAPTCHA_FONT=os.path.join(HERE,'static/Vera.ttf')# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
#MEDIA_ROOT = ''# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/media/'# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
#STATIC_ROOT = ''# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/", "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'# Additional locations of static files
STATICFILES_DIRS = (# Put strings here, like "/home/html/static" or "C:/www/django/static".# Always use forward slashes, even on Windows.# Don't forget to use absolute paths, not relative paths.
)# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder','django.contrib.staticfiles.finders.AppDirectoriesFinder',
#   'django.contrib.staticfiles.finders.DefaultStorageFinder',
)# Make this unique, and don't share it with anybody.
#www.iplaypy.com
SECRET_KEY = '3d5&166r)l@xd4zc-a$iuw3nkyi99ee4!k3bjhy)ly1i8pc*b9'
#UPLOAD SETTINGS
FILE_UPLOAD_TEMP_DIR = os.path.join(HERE, 'data/upload/').replace('\\', '/')
FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.MemoryFileUploadHandler","django.core.files.uploadhandler.TemporaryFileUploadHandler",)
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
# for user upload
ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff')
# unit byte
ALLOW_MAX_FILE_SIZE = 1024 * 1024
# 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 = 'urls'TEMPLATE_DIRS = (os.path.join(HERE,'templates'),
)TEMPLATE_CONTEXT_PROCESSORS = (  "django.core.context_processors.auth", "d
2000
jango.core.context_processors.request","django.core.context_processors.media", 
) 
INSTALLED_APPS = ('django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.sites','django.contrib.messages','django.contrib.staticfiles',# Uncomment the next line to enable the admin:'django.contrib.admin',# Uncomment the next line to enable admin documentation:'django.contrib.admindocs','blog','account','news','photo','rbac',
)# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {'version': 1,'disable_existing_loggers': False,'handlers': {'mail_admins': {'level': 'ERROR','class': 'django.utils.log.AdminEmailHandler'}},'loggers': {'django.request': {'handlers': ['mail_admins'],'level': 'ERROR','propagate': True,},}
}
#mail
EMAIL_HOST = 'smtp.gmail.com'                   #邮件smtp服务器
EMAIL_PORT = '25'                                        #端口
EMAIL_HOST_USER = 'code***@gmail.com'  #邮件账户
EMAIL_HOST_PASSWORD = '*********'      #密码
EMAIL_USE_TLS = False

Python代码片段之Django静态文件URL的配置:

#!usr/bin/env python
#coding: utf-8
from django.conf.urls.defaults import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()urlpatterns = patterns('',# Examples:# url(r'^$', 'djangodemo.views.home', name='home'),# url(r'^djangodemo/', include('djangodemo.foo.urls')),# Uncomment the admin/doc line below to enable admin documentation:# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),# Uncomment the next line to enable the admin:url(r'^$', 'account.views.index',name="index"),url(r'^admin/', include(admin.site.urls)),url(r'^blog/', include('blog.urls')),url(r'^account/', include('account.urls')),url(r'^news/', include('news.urls')),url(r'^photo/', include('photo.urls')),url(r'^rbac/', include('rbac.urls')),url(r'^static/(?P<path>.*)$','django.views.static.serve',{'document_root':settings.STATIC_ROOT}),url(r'^media/(?P<path>.*)$','django.views.static.serve',{'document_root': settings.FILE_UPLOAD_TEMP_DIR}),
)

http://www.hrbkazy.com/news/51041.html

相关文章:

  • ps做电商网站流程图设计公司网站模板
  • 计算机培训线上一对一网络优化工作内容
  • 一个新手如何做网站网站的网站建设
  • 做推广秒杀网站百度站长平台网站提交
  • 浙江网站建设推广seo交流网
  • nginx 一个独立ip 建立2个独立网站 2个域名青岛网站设计公司哪家好
  • 阿克苏地区住房和城乡建设局网站营销宣传策划方案
  • 无锡响应式网站网络推广外包业务销售
  • 广州网站优化关键词排名国际新闻今日头条
  • 河南平台网站建设哪里有网络营销知名企业
  • 网站虚拟空间作用网络推广外包怎么样
  • 有没有专门做牛仔的网站全网营销国际系统
  • wordpress手机登录seo搜索引擎优化工资薪酬
  • 马鞍山市住房城乡建设委官方网站电商自学网
  • 小程序是怎么制作出来的seo模拟点击有用吗
  • 柳州网站开发关键词优化排名软件哪家好
  • 最新任免名单最新移动网站如何优化排名
  • 无锡网络公司网站建设国际实时新闻
  • 南宁网站建设公司排名日本搜索引擎
  • 模板网站有利于优化广州推广优化
  • 游戏平台网站制作大连网站建设费用
  • 门户网站开发项目的风险北京网络推广公司
  • 做视频推广有哪几个网站百度法务部联系方式
  • 沈阳做网站的公司排名免费网站站长查询
  • 怎样做自己的小说网站企业推广策划书
  • 品牌网站要这么做网易游戏推广代理加盟
  • 做网站推广业务怎么样站长之家收录查询
  • 政府网站免费模板psd百度网讯科技客服人工电话
  • 关于集团网站建设的网站推广的常用方法有哪些?
  • 家政服务网站做推广有效果吗上热门最火标题