Repository: django-extensions/django-extensions

Issue:
validate_template raised false problems 
Since 1.9.8 I got this problem on our internal ci system but the files exists on the server on the path.
Locally there is no error raised.


```
/home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django/contrib/auth/templates/registration/password_reset_subject.txt: TemplateDoesNotExist /home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django/contrib/auth/templates/registration/password_reset_subject.txt
/home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django_extensions/templates/django_extensions/widgets/foreignkey_searchinput.html: TemplateDoesNotExist /home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django_extensions/templates/django_extensions/widgets/foreignkey_searchinput.html
/home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django_extensions/templates/django_extensions/graph_models/label.dot: TemplateDoesNotExist /home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django_extensions/templates/django_extensions/graph_models/label.dot
/home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django_extensions/templates/django_extensions/graph_models/digraph.dot: TemplateDoesNotExist /home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django_extensions/templates/django_extensions/graph_models/digraph.dot
/home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django_extensions/templates/django_extensions/graph_models/relation.dot: TemplateDoesNotExist /home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django_extensions/templates/django_extensions/graph_models/relation.dot
CommandError: 5 errors found
```


Discussion:
I assume you mean `validate_template` ?

Interesting that `password_reset_subject.txt` template for `Django` cannot be found, while there no errors for other templates in the `django` package.

Did you check if the files actually exists in the CI build ?
Yes I meant `validate_templates` and the files exist in the file system.

```bash
django@dev:~/instances/django $ 
file /home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/impersonate/templates/impersonate/list_users.html
/home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/impersonate/templates/impersonate/list_users.html: HTML document, ASCII text

django@dev:~/instances/django $ 
ls /home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/impersonate/templates/impersonate/
list_users.html  search_users.html
```
@Azd325 it did not complain about those files right ?

Does `/home/django/.virtualenvs/abb38d6f6e8bbb5c224330bba0513c93/lib/python2.7/site-packages/django/contrib/auth/templates/registration/password_reset_subject.txt` exsists ?

And can you confirm that moving back to version `1.9.7` solves the problem ?
Yes the files exists and if I downgrade to 1.9.7 the problem is gone.

Resolving patch:
diff --git a/django_extensions/management/commands/validate_templates.py b/django_extensions/management/commands/validate_templates.py
--- a/django_extensions/management/commands/validate_templates.py
+++ b/django_extensions/management/commands/validate_templates.py
@@ -85,7 +85,7 @@ def handle(self, *args, **options):
                     if self.ignore_filename(filename):
                         continue
 
-                    filepath = os.path.realpath(os.path.join(root, filename))
+                    filepath = os.path.join(root, filename)
                     if verbosity > 1:
                         print(filepath)
                     try:


Test patch: