Answer the question
In order to leave comments, you need to log in
How to authorize android app in django-rest-framework?
There is a url for authorization through the rest, but even there csrfmiddlewaretoken is requested. Accordingly, a simple transfer of login and password does not work.
<form method="post" role="form" action="/api-auth/login/">
<input type="hidden" value="KLJVW0Zf1CXOaBrG4mp3NVrf7AJHw9iO" name="csrfmiddlewaretoken">
<input type="hidden" value="" name="next">
<div class="clearfix control-group " id="div_id_username">
<div class="form-group">
<label for="id_username">Username:</label>
<input type="text" value="qwe" required="" id="id_username" class="form-control textinput textInput" autocorrect="off" autocapitalize="off" maxlength="100" name="username">
</div>
</div>
<div class="clearfix control-group " id="div_id_password">
<div class="form-group">
<label for="id_password">Password:</label>
<input type="password" required="" id="id_password" class="form-control textinput textInput" autocorrect="off" autocapitalize="off" maxlength="100" name="password">
</div>
</div>
<div style="border: none" class="well well-small text-error">Please enter a correct Email and password. Note that both fields may be case-sensitive.</div>
<div class="form-actions-no-box">
<input type="submit" id="submit-id-submit" class="btn btn-primary form-control" value="Log in" name="submit">
</div>
</form>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question