program tip

장고를위한 최고의 AJAX 라이브러리는 무엇입니까?

radiobox 2020. 8. 4. 07:37
반응형

장고를위한 최고의 AJAX 라이브러리는 무엇입니까? [닫은]


django에 가장 적합한 AJAX 라이브러리는 무엇입니까?
큰 자습서, 서적 및 자세한 설명서 데이터베이스가있는 것을 찾고 있습니다.
어느 것이 가장 쉬운가요? 어느 것이 초기 개발 단계에 있지만 미래에 대한 큰 약속을 보여줍니까?

안부,
크리스


나는 jQuery를 강력히 추천한다 . 그것을 구현하는 방법에 대한 몇 가지 자습서가 있습니다.

http://lethain.com/entry/2007/dec/11/two-faced-django-part-5-jquery-ajax/

http://lethain.com/entry/2007/dec/01/using-jquery-django-autocomplete-fields/

http://vincentxu.net/minimal-ajax-in-django-with-jquery-post

참고 : Microsoft는 jQuery가 ASP.NET MVC의 공식 클라이언트 측 프레임 워크가 될 것이라고 오래 전에 발표 했으므로 사용중인 서버 측 프레임 워크에 관계없이 잘 알고 있습니다.


나는 이것이 당신이 찾고있는 것이라고 생각합니다.

http://dajaxproject.com/

꽤 잘 문서화되었습니다. 간단한 API. 매우 깨끗하고 좋습니다. 내 프로젝트 중 일부에서 더 많이 사용할 계획입니다. JS 라이브러리와 무관하며 jQuery와 잘 작동합니다.

최신 정보:

다른 솔루션은 dajaxice와 유사하지만 표준 dajax는 아닙니다.

결국 그들은 대부분 동일하게 작동합니다.

  • 사전 정의 된 URL 경로를 정의 / 포함하십시오.
  • 데이터 소스로 사용될 모델 / 뷰 / 기능을 등록하십시오.
  • 즐겨.

UDATE2 :

이 조언은 매우 오래된 것입니다. 다른 솔루션을 연구해야 할 것입니다.


Django에는 라이브러리를 더 쉽게 만들거나 프레임 워크에서 더 잘 작동하는 Django가 없습니다. 뇌에 가장 잘 맞는 것을 사용하십시오.

jQuery는 Django 세계에서 더 인기가 있으며 개인적으로 사용하는 것입니다. 특히 Pinax의 많은 앱 에는 jQuery가 필요합니다. Django의 다른 공유 앱 및 코드 스 니펫 :

http://www.djangosnippets.org/tags/jquery/
http://code.google.com/p/django-ajax-validation/
http://code.google.com/p/django-todo/
http : //code.google.com/p/donita/


또한 최신 Django 서적 ( Django를 사용한 Python Web Development, Django 를 사용한 Learning Website Dev )은 자습서에서 jQuery를 사용합니다.


Checkout Dajax :

다 약스 프로젝트

장고에 사용하기 쉬운 AJAX 라이브러리

django 프로젝트 내에서 AJAX를 구현하기위한 빠르고 쉽고 가벼운 라이브러리 5 분 안에 사용할 수 있습니다.

Dajax는 파이썬을 사용하고 JS 소스 코드를 거의 사용하지 않는 웹 애플리케이션에서 비동기식 프리젠 테이션 로직을 쉽고 빠르게 개발할 수있는 강력한 툴입니다.

Prototype, jQuery, Dojo 및 mootols와 같이 가장 널리 사용되는 JS 프레임 워크를 최대 4 개까지 지원합니다.


다른 django 프로젝트에서 jquery, YUI 및 Dojo를 성공적으로 사용했습니다. django와 함께 사용하는 것이 더 낫다는 것은 아무것도 없습니다. 나는 "pythonic"(twisted-like) API 때문에 mochikit이 다른 어떤 것보다 django에 더 잘 맞는다는 jpartogy에 동의합니다. 그것은 실제로 아약스 프레임 워크에서 찾고있는 것에 달려 있습니다.

Personally I like what jQuery can do with given amounts of code but the greatest challenge in writing jQuery code is making it readable.

YUI is much more verbose than other frameworks because it sets a convention for using namespaces, but there are shortcuts to write less code and it avoids trying to make javascript look like something else.

Dojo tries to make javascript look like Java and from my experience is pretty slow. It has some nice widgets and a javascript implementation of the django templating language (which is pretty useful even outside of django projects).

I personally avoid prototype and mootools because they can break other javascript code (or vice versa).

If you are new to javascript and ajax I'd recommend jQuery because it's the easiest to start with. But I don't expect any js framework to be integrated with django mostly because there's really no need for that.


+1 to Soviut and Daniel for good answers. Jquery is a nice framework. Besides Pinax a couple other "big" Django applications use it: Satchmo and Review Board (which switched from another framework... mootools IIRC).

Also popular is rolling your own Javascript without using any framework, for example the Django admin.

The only other suggestion I might make is that, if you are a very experienced Pythonhead, then you might like mochikit which comes under some criticism for being too 'pythonic'. It seems to be the framework of choice for Turbogears but I personally haven't seen any Django projects using it.


Okay this might be subjective because the definition of 'best' can mean different to each individual. But since you are working with Django, that means you will get your hands down with Python syntax. One notable Javascript library that doesn't get exposed too much is Mochikit. The good thing about it is it has syntax that is familiar to Python programmer (because the creator is a Python programmer). It has quite nicely written down documentation as well. TurboGears out-of-the-box supports Mochikit.


If you need to work with AJAX in your django projects with very little setup and simple to use, my offer is:

django-ajax (Github, Pypi)

Fast, flexible and easy to use AJAX libraries for django projects. Contains ajax decorator, ajax middleware, shortcuts and more.


The phrase "Best AJAX Library" is highly subjective and depends on personal preferences, existing know how, requirements of the work etc. etc.

While I prefer jQuery for (almost) everything, I know some people whio swear by Dojo or ExtJS. There might be case where you want to use jQuery but requirements might be dictate that you use ExtJS.

All said. Use jQuery. jQuery rocks ;)


Django doesn't really tie in with the client side. Use whatever you're comfortable with. Django plays well with everything in that area, because you just write it in the templates.

참고URL : https://stackoverflow.com/questions/511843/what-is-the-best-ajax-library-for-django

반응형