Django project and SVN loads older code versions

别说谁变了你拦得住时间么 提交于 2020-01-06 06:44:43

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/12578602/django-project-and-svn-loads-older-code-versions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!