问题
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