Monday, December 30, 2019

Re: angular setup for django (routes not working)

Hi,

You can't have the routes for the frontend and the backend. For example:

/clients/1/ in urls.py and in the angular routes. Then it all goes back to who gets the route first. 

For this example the frontend should have:
/clients/:id/

and the backend should:
/api/clients/id/

Regards,

Andréas


Den sön 29 dec. 2019 kl 14:39 skrev nitish kumar <vullinitish@gmail.com>:
we have a web app which is hosted in apache mod_wsgi.

I am trying to update some of the app functionality/UI with angular 8.

everything works of but angular routes are not working , which is important for single-page app




On Friday, 27 December 2019 20:50:42 UTC+5:30, lemme smash wrote:
you doing something strange.
usually, when you want to setup angluar with django, you just using `ng serve` to handle all the interface, and just use django for data and api. it's not a good idea to render angular app with django

On Thursday, December 26, 2019 at 4:05:14 PM UTC+3, nitish kumar wrote:
Hi 


I am trying to integrate angular8 with Django (2.2.4).


Django side:

URL and view will load angular 'index.html'

angular:

some router-links.
based on URL pattern page is getting loaded.


problem statement:

if host only angular code using 'ng serve' router-link only load's particular component instead of loading all links in the index.html file
but when I host in Django router-link is loading the entire page again (i can see this in developers tools network tab)

can some please help..

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/37f1e12f-c6fd-4f83-bb3e-086e05e7a801%40googlegroups.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK4qSCcfMEPfkcc2a7N2DhGaVBVM9au9BKv%3Dybwv1horv_Kdvg%40mail.gmail.com.

No comments:

Post a Comment