I'm using django-ajax-selects to select a city from my database. When typing in the field, I get a 403 error (GET method). Here's the catch, it worked yesterday, and I didn't touch anything relevant.
Console log
Forbidden (Permission denied): /lookups/ajax_lookup/city
[30/Jan/2016 15:54:01]"GET /lookups/ajax_lookup/city?term=Lyon HTTP/1.1" 403 22
My form
<form enctype="multipart/form-data" id="JobOfferForm" action="" method="POST">
{% csrf_token %}
<div class="row">
<div class="input-field col s12">
<p class="grey-text">Ville</p>
{{ jobOfferForm.city }}
</div>
</div>
<button class="btn waves-effect waves-light" name="jobOfferFormOK" type="submit">Sauvegarder</button>
</form>
Thanks in advance.
I have figured it out!
I forgot to include a
check_auth
method in myCityLookup
, so it worked only for staff users... I should have read the documentation better.Now it works!