RE: os.path.join(BASE_DIR, 'reactapp', 'src')

It seems that the source code of react app is inside the django folder, so
if src code of django is changed, react app would be rebuild!

Try keeping the src code of django and react app if different folders, that
might solve it.


Regards,
Chetan Ganji
+91-900-483-4183
ganji.che...@gmail.com
http://ryucoder.in


On Mon, Jul 20, 2020 at 12:47 PM Dave R <rasht...@gmail.com> wrote:

> Hello, I'm trying to figure out how to rebuild my React.js project (with
> Django backend) and relaunch the Django dev server if a React.js file
> changes.  The code below works, but it rebuilds React even if the only code
> changes are in Django.  Can anyone suggest how to solve this problem?
>
> import subprocess
> from django.utils.autoreload import autoreload_started
> from django.dispatch import receiver
> @receiver(autoreload_started)
> def rebuild_react_app(sender, **kwargs):
>     sender.watch_dir(os.path.join(BASE_DIR, 'reactapp', 'src'), '*')
>     subprocess.run(r'yarn --cwd ./reactapp build', shell=True)
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/13c40a08-6084-4609-8141-ddcf029c33a7n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/13c40a08-6084-4609-8141-ddcf029c33a7n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMKMUjsKeicUWpuxmWcR_s7CEhGD9Tr%3DrCJL%3D_FOvoD8yv2oDA%40mail.gmail.com.

Reply via email to