crucialfelix / django-ajax-selects

jQuery UI-powered auto-complete fields for ForeignKey, ManyToMany and text fields
Other
824 stars 248 forks source link

Documentation & example code using different urls.py #288

Closed xtlc closed 11 months ago

xtlc commented 2 years ago

Thanks for providing such an amazing package! I just started using it and had a slight hiccup as the urls.py in the example states:

urlpatterns = [path('search_form', view=views.search_form, name='search_form'),
              path('**admin/lookups/**', include(ajax_select_urls)),
              path('admin/', admin.site.urls), 
              ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

whereas the code in the readme says:

urlpatterns = [url(**r'^**ajax_select/**', include(ajax_select_urls)),
              url(r'^admin/', include(admin.site.urls)),
              ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

Probably this is a no-brainer for experienced Django devs, but it took me some time to find that mistake as I always got Not Found: /admin/lookupsajax_lookup/... prints in the terminal. #

crucialfelix commented 11 months ago

Thank you, that was incorrect. Fixed