我正在尝试使用带有React-Native/Redux的firebase我需要在每次用户登录或注销时发送操作.如何从根组件调度操作?
class App extends Component {
componentWillMount() {
firebase.auth().onAuthStateChanged((user) => {
if (user) {
// Dispatch Action here
} else {
// Disptach Action here
}
});
}
render() {
const store = createStore(reducers, {}, applyMiddleware(ReduxThunk));
return (
<Provider store={store}>
<Router />
</Provider>
);
}
}
export default App;
Run Code Online (Sandbox Code Playgroud) 我正在尝试将psycopg2安装到我的virtualenv中.我试过pip我试过easy_install没有什么工作......从pip安装是更理想的选择,但它必须通过nwcell的github包来完成https://github.com/nwcell/psycopg2-windows heres the command我一直在用:
pip install git+https://github.com/nwcell/psycopg2-windows.git@win64-py34#egg=psycopg2
Run Code Online (Sandbox Code Playgroud) 我正在尝试以geojson格式序列化数据,但每当我使用时
json = serialize("geojson", coordinate.objects.all())
response = HttpResponse(json)
return response
Run Code Online (Sandbox Code Playgroud)
django给了我
SerializerDoesNotExist at/getmarkers /'geojson'
这很好用
json = serialize("json", coordinate.objects.all())
Run Code Online (Sandbox Code Playgroud)
当然,其他尝试过使用geojson序列化程序的人也遇到了同样的问题.我按照说明在文档中安装了GDAL库.有任何想法吗?似乎无法在文档中找到关于必须导入哪些模块的任何内容我已经尝试过了
from django.contrib.gis import gdal
Run Code Online (Sandbox Code Playgroud)
不会抛出错误但也无法解决我使用Django 1.8的问题
我正在编写一个脚本,使用正则表达式在页面上查找pdf链接然后下载所述链接.该脚本在我的个人目录中运行并正确命名文件,但它没有下载完整的pdf文件.pdf被拉,只有19kb,一个损坏的pdf,当它们应该是大约15mb
import urllib, urllib2, re
url = 'http://www.website.com/Products'
destination = 'C:/Users/working/'
website = urllib2.urlopen(url)
html = website.read()
links = re.findall('.PDF">.*_geo.PDF', html)
for item in links:
DL = item[6:]
DL_PATH = url + '/' + DL
SV_PATH = destination + DL
urllib.urlretrieve(DL_PATH, SV_PATH)
Run Code Online (Sandbox Code Playgroud)
url变量链接到包含所有pdf链接的页面.当您点击pdf链接时,它会转到"www.website.com/Products/NorthCarolina.pdf",它会在浏览器中显示pdf.我不确定是否因为这个我应该使用不同的python方法或模块
python ×2
django ×1
download ×1
firebase ×1
gdal ×1
geojson ×1
pdf ×1
pip ×1
powershell ×1
psycopg2 ×1
react-native ×1
reactjs ×1
redux ×1
virtualenv ×1