V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  jimmyye  ›  全部回复第 5 页 / 共 7 页
回复总数  134
1  2  3  4  5  6  7  
2016-10-31 02:54:54 +08:00
回复了 lovebeyondalways 创建的主题 Python django migrate 报错
试过了,没有问题
```
class Category(models.Model):
name = models.CharField(u'文章分类', max_length=64)

def __str__(self):
return self.name


class article(models.Model):
title = models.CharField(u'标题', max_length=60)
category = models.ManyToManyField('Category', verbose_name=u'分类', blank=True)
createtime = models.DateTimeField(u'createtime', default=timezone.now)
content = models.TextField(u'内容', blank=True, null=True)
```
```
➜ temp python manage.py makemigrations
Migrations for 'core':
core/migrations/0001_initial.py:
- Create model article
- Create model Category
- Add field category to article
➜ temp python manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, core, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying core.0001_initial... OK
Applying sessions.0001_initial... OK
➜ temp
```
2016-09-23 17:21:47 +08:00
回复了 nesuk 创建的主题 macOS Sierra 的糟点
睡眠久了之后(可能休眠了),唤醒变慢了很多。
2016-09-13 18:42:59 +08:00
回复了 BigUncleLee 创建的主题 程序员 昨天程序员节,昨晚阿里员工内网刷月饼被开除
既然是员工福利,应该惩罚他们全部买下来,然后再抽奖送出去。要让他们知道自己错哪里,再去弥补,直接开除太过了。
@scott123 其实上面几个回复都提到了:
1. django 本身是同步的,如果你没有自己写异步操作或者使用第三方异步 orm ,那么整个过程就是同步的,不存在线程问题。
2. 确保没有修改 item_list ,根据你的描述, save_to_data()修改了 item_list ,所以 send_email 里的 list 才会有问题,建议不同的变量使用不同名称:比如 item=eval(item)容易混乱。
3. 如无必要,不要用 eval
同楼上,建议问问题的时候描述问题的本身,而不是先自己推测为线程问题。
item 为什么会变成 model ? item_list 不应该在 save_into_data()里被修改,如果需要保持 model 实例,应该用另一个 list :
item_instances = save_into_data(item_list)
send_email(item_lsit)
2016-07-22 14:23:14 +08:00
回复了 hxd 创建的主题 程序员 主要目的是 google hangout 流畅, 请教搭板凳累梯子的正确姿势
@tvallday 下面是我用的配置,你可以参考下,如果还是不行只能到 https://github.com/v2ray/v2ray-core/issues 发 issue 看看其他人有没有办法了。
客户端配置:

{
"log": {
"loglevel": "warning"
},
"inbound": {
"port": 1086,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": false,
"ip": "127.0.0.1"
}
},
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "服务器 IP",
"port": 8080,
"users": [
{
"id": "用户 ID",
"level": 1,
"alterId": 128
}
]
}
]
},
"streamSettings": {
"network": "kcp"
}
},
"outboundDetour": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "direct"
}
]
}
},
"transport": {
"kcpSettings": {
"uplinkCapacity": 2,
"downlinkCapacity": 50,
"congestion": false
}
}
}


服务器配置:

{
"log" : {
"access": "",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 8080,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "用户 ID",
"level": 1,
"alterId": 128
}
],
"detour": {
"to": "detour"
}
},
"streamSettings": {
"network": "kcp"
}
},
"inboundDetour": [
{
"protocol": "vmess",
"port": "8081-8090",
"tag": "detour",
"settings": {},
"allocate": {
"strategy": "random",
"concurrency": 2,
"refresh": 3
},
"streamSettings": {
"network": "kcp"
}
}
],
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "blocked"
}
]
}
},
"transport": {
"kcpSettings": {
"uplinkCapacity": 50,
"downlinkCapacity": 50,
"congestion": false
}
}
}
2016-07-22 13:46:58 +08:00
回复了 hxd 创建的主题 程序员 主要目的是 google hangout 流畅, 请教搭板凳累梯子的正确姿势
@tvallday 可能是 DNS 的问题: https://github.com/v2ray/v2ray-core/issues/106
我用 Firefox + AutoProxy Fix 和 Chrome + Proxy SwitchyOmega 都没有问题。
2016-07-21 12:43:19 +08:00
回复了 sunmonster 创建的主题 程序员 强烈吐槽传大段嵌套 JSON 格式请求,各位大神怎么看?
可以看看 Facebook 的 GraphQL : http://graphql.org
>Query responses are decided by the client rather than the server. A GraphQL query returns exactly what a client asks for and no more.
2016-07-02 23:25:38 +08:00
回复了 16500682 创建的主题 VPS Vultr 速度怎么样
新用户冲多少送多少(最多$100):
https://www.vultr.com/match/
CloudXNS :“线路细分程度(大陆)分区域(华中、华东、华南、华北、东北、西北、西南)、分省 /直辖市、其他”
https://www.cloudxns.net/Order/index.html
https://www.cloudxns.net/Index/Line.html
2016-06-26 13:36:06 +08:00
回复了 hxd 创建的主题 程序员 主要目的是 google hangout 流畅, 请教搭板凳累梯子的正确姿势
最新的 v2ray (v1.17.2) 实现了 KCP ,我测试了两个服务器,看 YouTube 分别比 ss 快了几倍了十几倍。
https://github.com/v2ray/v2ray-core/pull/170
“ TCP 连接在高延迟,高带宽,较高丢包环境下,不能有效利用带宽。目前 TCP 连接下的 VMess 协议在这种网络环境下速度缓慢,甚至出现连接超时错误。

KCP 可以更加有效的利用带宽降低延迟,很大程度上减少因为恶劣的网络环境导致的连接不稳。

通过提高代理连接的速度,可以有效的改善使用 v2ray 的体验。”
2016-06-24 09:39:35 +08:00
回复了 charlie21 创建的主题 中州韻 鼠须管输入法 傻瓜版配置 - 基于 rime_pro 增强包
谢谢楼主,输入法非常强大,配置非常好用,终于可以 say goodbye 搜狗输入法😃
2016-06-23 21:22:46 +08:00
回复了 iugo 创建的主题 程序员 微信 Android 大陆版为什么不用 Chrome WebView 而用 QQ 浏览器?
@smallthing 谢谢。因为之前没想过是默认走代理,无论如何都搜索不到相关资料,刚才通过代理关键字搜到了 http://x5.tencent.com/guide?id=2999 不知道当时有没有第 44 条。

@lzhr 只能说每个人的标准不一样。因为我是开发者,我在使用微信时发现网络问题,于是我要去看 x5 的文档?
2016-06-23 20:50:39 +08:00
回复了 iugo 创建的主题 程序员 微信 Android 大陆版为什么不用 Chrome WebView 而用 QQ 浏览器?
@smallthing 谢谢告知,真希望你没有说第一句话。你的第一句有点莫名其妙,作为微信用户发现疑似劫持行为,然后你让我“多看看 x5 的官方文档吧”?
2016-06-23 16:14:23 +08:00
回复了 iugo 创建的主题 程序员 微信 Android 大陆版为什么不用 Chrome WebView 而用 QQ 浏览器?
只有我的微信内置 X5 浏览器可能被劫持了吗?访问 ipip.net 显示的是外地 ip 。
https://v2ex.com/t/251005
2016-06-18 21:55:22 +08:00
回复了 ilikekindle 创建的主题 买买买 618 有没有完全没在狗东下单的?来报个到
发现天猫更便宜,还可以用券。
2016-06-18 14:41:51 +08:00
回复了 alonga 创建的主题 宽带症候群 江苏移动省公司的人已经疯了
广东电信也被劫持,估计全国都一样。
2016-06-14 19:15:34 +08:00
回复了 MuyouSome 创建的主题 Apple iPhone 存储空间莫名其妙就没了,求解。
@MuyouSome 一开始我观察的现象是:上传视频 1 ,失败,上传视频 2 ,失败,上传视频 1...很多次以后部分视频才慢慢上传成功,而 SS 显示的流量是已上传视频的好几倍。不过存储空间没有被耗尽。
2016-06-14 13:35:30 +08:00
回复了 MuyouSome 创建的主题 Apple iPhone 存储空间莫名其妙就没了,求解。
@MuyouSome
如果你通过配置文件启动 SS ,配置里就有"timeout"字段: https://github.com/shadowsocks/shadowsocks/wiki/Configuration-via-Config-File
如果直接命令行启动可以用"-t",详细可以通过"ssserver -h"查看:
-t TIMEOUT timeout in seconds, default: 300
1  2  3  4  5  6  7  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3803 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 30ms · UTC 04:16 · PVG 12:16 · LAX 21:16 · JFK 00:16
Developed with CodeLauncher
♥ Do have faith in what you're doing.