小编Mar*_*usz的帖子

使用localhost webservice连接PhoneGap

连接我的webserwisem PhoneGap(Django + TastyPie)时遇到问题.我的PhoneGap - 版本 - 3.3.0.

使用普通html调用POST或GET - 一切正常当我将项目移动到模拟器时问题开始 - 传输无法以任何方式连接.除了点击链接,"获取页面错误".

我的xml(res/xml/config.xml):

<?xml version="1.0" encoding="utf-8"?>
<!--
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the …
Run Code Online (Sandbox Code Playgroud)

xml django android tastypie cordova

6
推荐指数
1
解决办法
6424
查看次数

OperationalError:致命错误:用户"UserName"的密码验证失败

从GitHub下载项目后,尝试在本地运行它.我使用命令创建了一个数据库(我正在使用Postgres 9.1):

postgres = # CREATE NameUser django createDB WITH PASSWORD 'MyPass';
CREATE ROLE
postgres = # CREATE DATABASE DatabaseName OWNER NameUser;
CREATE DATABASE
Run Code Online (Sandbox Code Playgroud)

然后在设置文件中我有这个代码:

DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.postgresql_psycopg2'
         'NAME': 'DatabaseName',
         'USER': 'NameUser'
         'PASSWORD': 'MyPass'
         'HOST': 'localhost',
         'PORT':'',
     }
}
Run Code Online (Sandbox Code Playgroud)

命令后:./manage.py resetdb,收到:

OperationalError: FATAL: password authentication failed for user "NameUser"
FATAL: password authentication failed for user "NameUser"
Run Code Online (Sandbox Code Playgroud)

我在stackoverflow上发现原因可能是文件pg_hba.conf.更改后看起来像这样:

# Database administrative login by Unix domain socket
local   all             postgres                                md5
# "local" is for Unix …
Run Code Online (Sandbox Code Playgroud)

database authentication passwords django postgresql

5
推荐指数
1
解决办法
7191
查看次数