Mozillazg's Blog
  • Home
  • Archives
  • About me
  • Archives

[django]修复 bad character range 异常

Date Tue 26 February 2013 Category django Tags python / django

出现 bad character range 异常, 是因为程序某个地方的正则表达式写错了, 不是一个有效的正则表达式。

比如正则 [_-\d] 就是一个无效的正则,会报 bad character range 异常。 将正则修改为 [-_\d] 使之成为一个有效的正则,就可以修复该异常。

参考

  • django - "bad character range" exception? - Stack Overflow
more ...

[django]在模板中对变量作减法操作

Date Mon 25 February 2013 Category django Tags django / python

我们知道可以使用内置过滤器 add 对变量做加法操作:

{{ 3|add:"1" }}   # 4

其实,add 也可以做减法操作:

{{ 3|add:"-1" }}  # 2

参考

  • Variable subtraction in django templates - Stack Overflow
more ...

[英语]I am about to do something

Date Mon 25 February 2013 Category english Tags 英语

I am about to do something

我正好要做某事,我准备做某事。

I was about to leave.
我正好要离开。

I am about to do this

参考

  • 英語趣談 Fun of English: I was about to leave.
more ...

  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • »
  • Social

    • 豆瓣
    • Fork me on GitHub
    • About Me
    • 翻译的漫画
    • Atom Feed
    • RSS Feed
  • Recent Posts

    • [译][漫]Cyanide & Happiness #3943:害怕
    • [译][漫]Cyanide & Happiness #2325:五
    • [译][漫]Cyanide & Happiness #1476:大力水手
    • [译][漫]Cyanide & Happiness #1342:没有你我没法活
    • [译][漫]Cyanide & Happiness #3635:胡子
  • Categories

    • comics
    • database
    • django
    • english
    • firefox
    • flask
    • git
    • go
    • linux
    • mongodb
    • others
    • peewee
    • python
    • tornado
    • web
    • windows
  • GitHub Repos

    • .github

    • alibabacloud-oidc-auth

      GitHub Action for authenticating to Alibaba Cloud with GitHub Actions OIDC tokens.

    • alibabacloud-oidc-auth-example-ack-set-context

    • alibabacloud-oidc-auth-example-acr-scan

    • alibabacloud-oidc-auth-example-acr-login

  • Links

    • Pelican
    • Python.org
    • Jinja2

© 2015 mozillazg · Powered by pelican-bootstrap3, Pelican, Bootstrap

Creative Commons License "Mozillazg's Blog" by mozillazg is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where indicated otherwise.

Back to top