Django release 1.5: 'url' requires a non-empty first argument. The syntax changed in Django 1.5

后端 未结 6 404
遥遥无期
遥遥无期 2020-12-02 10:02

I started using Django release 1.5 and got a problem with my old code:

{{post.title}}<

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 10:12

    To exclude folder of .git and to avoid error's MacOS added empty quotes to option -i ''. Example:

    find . -path '*/.git*' -prune -o -type f -print0 | xargs -0 sed -i '' 's/ url \([^" >][^ >]*\)/ url "\1"/g'
    

    But I like this approach (MacOS):

    grep '{% url' -lrZ . | xargs -0 sed -i '' 's/ url \([^" >][^ >]*\)/ url "\1"/g'
    

提交回复
热议问题