Closed syabro closed 9 years ago
See #134 for discussion about loading urls.
I've already read it. I don't like the whole idea to fetch every url with request. It'll be pain in the ass on slow connections.
The proposed solution doesn't fetch urls. It just makes a request to "wrapper" view with url name and args/kwargs. The wrapper view than calls the appropriate view and returns the result.
Basically, this doesn't have any overhead compared to hard-coded urls. Right now I'm trying out some ways to implement it on angular side best.
Ah, don't get it. Seems like a nice solution
Right now urlconf in my html took 129kb when the whole page is 140kb.
Let's load it with separate request.
Something like:
<script src="{% djng_urls %} " ></script>
django-angular
generates dict with urls and calculate hash.djng-urls.%hash%.js
is exists in{{ MEDIA_URL }}/django-angular
and saves it if notdjng_urls
returns generated js urlSo it'll not be loaded every time user loads the page.