- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经安装了 django 并且似乎可以工作 it worked page
我想启用管理页面,但不起作用,[它显示“它有效”页面]
我有:取消注释了管理应用程序的 settings.py 中的行,
# Django settings for micopiloto project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'thadb', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # 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 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 = ''
# 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.
SECRET_KEY = '2&g_&k=+^(0t)1xf82m^=#0u6v1e!)nn7ixq*+2^h%4$mwlrsm'
# 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 = 'micopiloto.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',
'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',
'portfolio'
)
# 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,
},
}
}
并取消注释 urls.py 中的必要行
from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'micopiloto.views.home', name='home'),
# url(r'^micopiloto/', include('micopiloto.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'^admin/', include(admin.site.urls)),
)
那么我缺少什么来拥有我的管理页面?
谢谢!
编辑:python.VERSION = (1, 3, 0, '最终', 0)
最佳答案
Django 无法加载您的 url 文件(这就是它认为您没有配置任何 url 的原因)。
从您的 INSTALLED_APPS
中,您的网站似乎被命名为 micopiloto
,而不是您的应用 - 您确定 micopiloto. views.home
是您的 View 的正确路径吗?
如果您已经创建了应用程序,请确保您的网址指向该应用程序,而不是网站;如果您还没有创建应用程序,则应该先创建应用程序。
关于python - Django 管理站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10066397/
最近我用 php 建立了一个网站,但他们的旧网站都是 HTML 格式的。所以现在我不知道使用 .htaccess 将所有这些旧链接重定向到新站点(可能将所有带有 HTML 的链接重定向到主域)的最佳方
我创建了一个新的 WordPress 网站,它是我旧网站的更名版本。它有一个新的域和一个新的设计。除此之外,其他一切都是相同的,包括内容和链接结构。现在我想完全重定向旧链接。与旧帖子一样,标签和类别
我想使用 WatiN测试我正在开发的网站的功能。理想情况下,我会在测试开始运行之前以编程方式部署网站 (asp.net MVC3),然后在每次测试之前刷新数据。这可能吗? 最佳答案 在此处阅读有关使用
我们的网站使用我们自己定制的 session 状态管理,与 ASP.NET session 状态分开。但是由于少数特殊页面使用 SQL Server Reporting Services,我们还需要启
不久前我看到一个网站,其中有 JavaScript/HTML/CSS 栏目,下面有实际代码的样子。有点像 jsFiddle,但它有用户示例和演示。有谁知道这个网站的名字吗?我到处都找不到它!谢谢! 最
我们的核心数据库出现问题,该数据库已由前一天的备份数据库恢复。 此后,网站工作正常,但我们在发布任何更改时遇到问题。一旦点击发布按钮,“发布正在初始化..”消息就会持续很长时间。截至“发布开始/结束”
我们的核心数据库出现问题,该数据库已由前一天的备份数据库恢复。 此后,网站工作正常,但我们在发布任何更改时遇到问题。一旦点击发布按钮,“发布正在初始化..”消息就会持续很长时间。截至“发布开始/结束”
Maven 不仅仅是一款项目构建和依赖管理工具,它还能够聚合项目信息,促进项目团队间地交流。POM 中可以包含各种项目信息,例如:项目描述、SCM 地址、许可证信息,开发者信息等。用户可以使用 Mav
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭上个月。 Improve this ques
您知道哪些网站正在使用 Silverlight?此信息将帮助我们决定何时采用 Silverlight 平台。 这些网站应该是面向公众的并且被认为是高流量的。 (每月至少 300,000 次点击)。 我
我尝试通过 VS2017 中的发布上下文菜单将我的 .net 核心站点部署到 Azure,偶尔(大约三分之一的部署),我收到以下错误。 Web deployment task failed. (Web
我为 20 个不同的国家/地区创建了一个包含 20 个站点(每个站点一个不同的域)的 Django 项目。这些站点共享所有内容:代码库、数据库、网址、模板等。 他们唯一不共享的是我在每个站点设置文件中
如何将商店页面添加到我使用 jekyll 和基础构建的网站? 任何自动化平台/方法都可以做到这一点。 谢谢。 最佳答案 您可以使用 snipcart .有一个blog post和一个 demo sit
我部署了一个服务结构集群,域为 foo.northcentralus.cloudapp.azure.com 它具有单一节点类型和单一公共(public) IP 地址/负载均衡器。 假设我部署了以下
我不是一个大的typ3 专家,也无法访问我正在使用的typ3 实例中的typoscript 选项(这是一个非常大的站点,我没有这样做的授权)。所以我希望这个问题适合 stackoverflow(如果没
我们正在对我们的 Drupal 站点进行性能调整。 我们正在使用 Siege 来衡量性能(作为 drupal 访问者)。 环境: Nginx + FastCGI + Memcache Siege 运行
我搜索了 SO、SU 和 SP.SE寻求解决方案,但找不到我需要的东西。我正在寻找一个解决方案,它可能是一个脚本或一些其他非编码方法/工具。 我正在尝试编写一个脚本(供其他人使用)或某种其他形式的自动
我有一个 Django 站点,它使用本地化中间件与 gettext 和 trans/blocktrans 模板标签相结合,根据用户代理字符串中的首选语言向访问者显示不同的页面(这似乎是在 Django
我是 Drupal 新手。是否可以设置所有内容并在服务器上部署 Drupal?我的意思是像放入内容、设置模块等...,然后将它们全部放到生产服务器上? 最佳答案 当然。 复制所有文件 编辑数据库凭证(
我想将以下行添加到我的 head.html仅在运行时 jekyll serve本地: 如果可能的话,我正在考虑使用一些简单的液体检查。 最佳答案 当你做 jekyll serve本地默认 {{
我是一名优秀的程序员,十分优秀!