fabiogibson / django-livesync

Django App which automatically reloads your browser when Django Development Server restarts or static files and templates are modified.
GNU General Public License v3.0
27 stars 11 forks source link

does not work if your templates are in a django app #5

Open morenoh149 opened 5 years ago

morenoh149 commented 5 years ago

I get error

$ python manage.py runserver                                                                                           
Traceback (most recent call last):                                                                                     
  File "manage.py", line 10, in <module>                                                                               
    execute_from_command_line(sys.argv)                                                                                
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()                                                                                                  
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)                                                            
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)                                                                                 
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 60, in execute
    super().execute(*args, **options)                                                                                  
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)                                                                             
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/livesync/management/commands/runserver.py", line 110, in handle
    self.start_liveserver(**options)                                                                                   
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/livesync/management/commands/runserver.py", line 107, in start_liveserver
    self._start_watchdog()                                                                                             
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/livesync/management/commands/runserver.py", line 81, in _start_watchdog
    self.file_watcher.start()                                                                                          
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/livesync/fswatcher/watcher.py", line 18, in start
    self._schedule_all()                                                                                               
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/livesync/fswatcher/watcher.py", line 12, in _schedule_all
    self.observer.schedule(handler, path, recursive=True)                                                              
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/watchdog/observers/fsevents.py", line 172, in schedule
    return BaseObserver.schedule(self, event_handler, path, recursive)                                                 
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/watchdog/observers/api.py", line 290, in schedule
    timeout=self.timeout)                                                                                              
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/watchdog/observers/fsevents.py", line 73, in __init__
    self.snapshot = DirectorySnapshot(watch.path, watch.is_recursive)                                                  
  File "/Users/harrymoreno/.local/share/virtualenvs/foo-TMIWqqTS/lib/python3.7/site-packages/watchdog/utils/dirsnapshot.py", line 206, in __init__
    st = stat(path)                                                                                                    
FileNotFoundError: [Errno 2] No such file or directory: '/Users/harrymoreno/programming/foo/bar/templates'             

my project looks like this

.
├── README.md
├── __init__.py
├── manage.py
├── mysite
├── polls
├── static
└── staticfiles

templates are in polls/templates

fabiogibson commented 4 years ago

Can you provide a little bit more details on how to reproduce this error? Just adding templates to django apps seems to work just fine over here.

morenoh149 commented 4 years ago

I could but django-livereload-server seems to work fine. I think my templates are in a different place than in your example, so there's that.