Django项目和SVN加载旧代码版本 [英] Django project and SVN loads older code versions

查看:91
本文介绍了Django项目和SVN加载旧代码版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能解释它,但Django + SVN代码版本控制加载旧的错误版本的文件,每次我在我正在工作的网站上刷新。



所以如果我在两天之前更改了一个文件(从那以后做了大量的提交),它现在就会出现。下一次我刷新一天前的另一个变化。



我使用的是:Django 1.4,Apache,SVN

解决方案

这与SVN无关,我使用git并有同样的问题。 Apache将缓存一定量的网站。



删除所有 *。pyc 文件并重新启动apache。 p>

我有一些(Ubuntu)别名设置来帮助我这样做。

 #服务
#重新启动apache2
alias apre ='sudo服务apache2优雅'

#删除文件
#删除所有* .pyc文件
alias pydel ='find。 -type f -name* .pyc-exec rm -f {} \;'

#组合
#删除所有* .pyc文件,然后重新启动apache2
别名pyre ='pydel&&& apre'

或者使用 runserver 开发在Django项目中保存文件时,将会接收更改。


I can't explain it but Django + SVN for code version control loads older buggy versions of files every time i hit refresh on the web site I'm working on.

So if I changed something in a file 2 days ago (made lots of commits since then) it will show up now. Next time I hit refresh another change from a day ago appears.

I'm using: Django 1.4, Apache, SVN

解决方案

This is not to do with SVN, I use git and have the same issue. Apache will cache a certain amount of your site.

Delete all *.pyc files and restart apache.

I have a number of (Ubuntu) aliases set up to help me do this.

# Services
# Restart apache2
alias apre='sudo service apache2 graceful'

# Delete files
# Delete all *.pyc files
alias pydel='find . -type f -name "*.pyc" -exec rm -f {} \;'

# Combinations
# Delete all *.pyc files then restart apache2
alias pyre='pydel && apre'

Alternatively develop using runserver as this will pick up changes when you save a file within your Django project.

这篇关于Django项目和SVN加载旧代码版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆