我在 drupal 中遇到一个奇怪的问题。当我尝试更改_any_drupal 管理中的设置(性能下的缓存、文件系统下的临时目录、过滤器下的默认过滤器等)时,我收到一条消息,表明更改已成功保存,但值没有更改。
我不知道从哪里开始调试,因为这是一个普遍存在的问题。我已经检查了所有文件/文件夹和数据库连接的权限。看起来不错。
以前有人遇到过这样的问题吗?
编辑:drupal 日志文件中没有任何错误条目。
编辑2:我刚刚停用了每个贡献模块。我仍然无法对(例如)缓存模式进行任何更改。
我创建了一个新的 Facebook 帐户并使用手机进行了验证。我什至看到“您的手机已成功验证”。在https://www.facebook.com/confirmphone.php地址中。
所以,一切看起来都很完美。
然后,我和我的朋友成为了 Facebook 好友(他也已通过验证并已经创建了一个应用程序)。我们正在尝试从他的帐户将我添加为此 Facebook 应用程序的管理员。
尽管两者都通过电话完全验证,但他无法将我添加为该应用程序的管理员。他越来越
只有经过验证的开发人员才能添加为此应用程序的列出开发人员。有关详细信息,请参阅http://www.facebook.com/help/?faq=17580。
一直留言。
我们等了一个多小时,以防 Facebook 系统无法识别我的新验证。
事实上,我什至尝试删除电话号码并再次进行验证。
以上均无效,但仍然收到不允许我成为应用程序管理员的消息。
你可以帮帮我吗?
提前致谢
我想动态地将 a 更改CharField为 a ChoiceField,因为我希望从当前请求确定的可能性列表中选择该值。
在 a 中,ModelAdmin我可以用 做到这一点get_form(),只需说:
form.base_fields[field_name] = forms.ChoiceField(...)
Run Code Online (Sandbox Code Playgroud)
但我怎样才能对 an 做同样的事情InlineModelAdmin (TabularInline)呢?我走了一会儿get_formset(),get_fieldsets()但找不到合适的位置。
当我尝试使用以下命令访问管理控制台时
http://localhost:4848
Run Code Online (Sandbox Code Playgroud)
它说管理控制台正在加载,但不会再继续。如果我按照建议刷新页面,我会收到 HTTP 404。
Stack Overflow 上还有其他几个已回答的类似问题,但没有一个答案有帮助。因此,我将全局日志记录级别设置为 FINEST 并查看了 server.log。
我得到的第一个也是最突出的例外是:
[#|2013-05-07T11:04:52.187+0200|FINE|glassfish3.1.2|com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter|_ThreadID=81;_ThreadName=Thread-2;ClassName=com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter;MethodName=initRest;|java.io.IOException: Server returned HTTP response code: 401 for URL: http://0.0.0.0:4848/management/domain
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
at com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter.initRest(AdminConsoleAdapter.java:557)
at com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter$1.run(AdminConsoleAdapter.java:372)
Run Code Online (Sandbox Code Playgroud)
(这里是从启动 glassfish 到访问管理控制台的完整日志)
这发生在我的开发机器(Windows XP)上。尝试了几次重新安装到不同的位置。我的 JVM 来自 JDK 7u21。
在我的其他具有类似配置的开发机器(Ubuntu 13.04)上不会发生这种情况。除了操作系统之外,主要区别在于代理配置。它被设置为所有协议的代理,端口 8080,除了 localhost 之外。
我自己实在是没有答案……
编辑
其他奇怪的行为。有时(glassfish 每隔一秒重新启动一次)可以通过以下方式访问登录管理控制台
http://127.0.0.1:4848/j_security_check
Run Code Online (Sandbox Code Playgroud)
然后我可以登录并编辑其中的任何设置。当我注销时,我收到 HTTP 500:
javax.servlet.ServletException: java.lang.reflect.InvocationTargetException while attempting to process a 'beforeCreate' event for 'sun_html53'.
root cause
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'beforeCreate' event for 'sun_html53'.
root cause
java.lang.reflect.InvocationTargetException
root …Run Code Online (Sandbox Code Playgroud) 我想在管理后端仅向超级用户显示模型,而不向员工用户显示模型,这可能吗?
例子:
check which user is logged
if superuser
admin.site.register(model_1)
admin.site.register(model_2)
admin.site.register(model_3)
...
if staff_user
admin.site.register(model_1) #show only one model in the admin
Run Code Online (Sandbox Code Playgroud)
谢谢
我想在管理站点中完全隐藏来自第三方模块 ( otherapp) 的模型。
我admin.site.unregister(ModelToHide)输入了我的一个应用程序的管理员 ( myapp),但它会导致NotRegistered每个页面上出现错误。问题是之前myapp.admin加载的。 otherapp.admin
我尝试更改顺序INSTALLED_APPS,使其otherapp出现在之前myapp,但没有帮助,Django 以相反的顺序加载它们。我在其中一篇评论中读到,根据 Django 的书,顺序INSTALLED_APPS并不重要。
实际上,我创建这个问题只是为了分享我让它为我工作的方式,因为我花了一些时间来找出解决方案。希望这对某人有帮助。
我希望模型有不同的导出格式,因此其中一种格式包含其他格式中不存在的附加元数据。
我可以为这两种导出格式创建一个 ModelResource 子类,但我想允许用户从管理界面中选择它们。
它是这样的:
class IngredientColourRelation(models.Model):
ingredient = models.CharField()
colour_label = models.CharField()
metadata = models.CharField()
class IngredientColourLabelResource(resources.ModelResource):
"""Ingredient Resource class for importing and exporting."""
ingredient = resources.Field()
colour_label = resources.Field()
class Meta:
"""Meta class"""
model = IngredientColourRelation
fields = ('id', 'ingredient', 'colour_label',)
export_order = ('id', 'ingredient', 'colour_label',)
Run Code Online (Sandbox Code Playgroud)
另一个资源是这样的:
class MetadataIngredientColourLabelResource(resources.ModelResource):
"""Ingredient Resource class for importing and exporting."""
ingredient = resources.Field()
colour_label = resources.Field()
metadata = resources.Field()
class Meta:
"""Meta class"""
model = IngredientColourRelation
fields = ('id', 'ingredient', 'colour_label', 'metadata',) …Run Code Online (Sandbox Code Playgroud) 我正在使用gobuffalo框架创建一个带有 postgres 数据库的网站,并且我正在尝试找到一个好的管理仪表板来配合它。像 Rail 的ActiveAdmin这样的东西会很棒。有没有人有什么建议?
我正在使用 Django(2.0 版)作为新手,但忘记了管理员超级用户密码。我知道我可以创建另一个超级用户并更改前一个超级用户的密码。但是是否有任何程序可以知道我忘记的前一个超级用户的 RAW 密码?
我正在尝试使用 keycloak AdminAPI ( https://www.keycloak.org/docs-api/3.0/rest-api/index.html#_users_resource ) 创建用户并分配客户端角色。我收到正确的令牌,并且创建了用户但分配角色返回 404
我正在使用 Postman 连接 API:
/auth/realms/{realmName}/protocol/openid-connect/token
Content-Type application/x-www-form-urlencoded <-with parameters ofc
/auth/admin/realms/{realmName}/users
Content-Type application/json
Authorization Bearer {TOKEN}
Body:
Run Code Online (Sandbox Code Playgroud)
{
"username": "name",
"enabled": true,
"emailVerified": false,
"firstName": "first",
"lastName": "last",
"credentials": [
{
"type": "password",
"value": "newPas1*",
"temporary": false
}
]
}
Run Code Online (Sandbox Code Playgroud)
以上对我有用,但下一个不行
/auth/admin/realms/{realmName}/users/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx/role-mappings/clients/realm-management
Content-Type application/json
Authorization Bearer {TOKEN}
Body:
Run Code Online (Sandbox Code Playgroud)
{
"roles": [
{
"id": "0830ff39-43ea-48bb-af8f-696bc420c1ce",
"name": "create-client",
"description": "${role_create-client}",
"composite": false,
"clientRole": true,
"containerId": "344e7c81-e7a2-4a43-b013-57d7ed198eee"
}
]
}
Run Code Online (Sandbox Code Playgroud)
其中 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx' 是创建期间返回的用户 ID,并且存在创建客户端角色
我需要一种通过 …