If I replace (for example) an image in the static files of my Django project, which I already displayed on certain pages: Is there a simple and reliable way to find these places in the code where I need to replace the path to the old image with the new one?
- solution: reply by Adam in the Django forum👌🙏
Find strings in code – explanation for VSCode and git
There are several approaches to find the respective part in your code/files.
In VSCode one has three different options to find parts in the code for replacement.
Search Icon (VSCode): find parts in your code for replacement
- use search icon in upper left corner of VSCode
- type search term into search field -> all files containing the term will be listed below
Command Palette (VSCode): find parts in your code for replacement
- use Command Palette (F1) and find the respective command (find in files)
Keyboard Shortcut (VSCode): find parts in your code for replacement
- keyboard shortcut for find in files command: CTRL + Shift + F
Git – command line
git grep <search-term>