Hello. Thank you, I got it working! wooooooo :D
On Tuesday, March 1, 2022 at 2:11:17 PM UTC [email protected] wrote:

> Hello. You need a corresponding URL for your link that's why you're 
> getting reverse error:
>
> path('add/anime/<user>/<pk>/', views.MYVIEW, name='url-to-my-view'>
>
> and then return redirect to your success_url after your enter the data, 
> not return render.
>
> On Monday, February 28, 2022 at 12:00:19 PM UTC-6 [email protected] 
> wrote:
>
>> Hi there. I have a system whereby users are recommended anime, and I want 
>> it so when they see anime on the website they can press a button on any 
>> anime shown, which will then add it to their 'UserList' which is a saved 
>> list that they can go back to and see whenever they want. 
>>
>> I figure the button just needs to associate the anime.id with the POST 
>> request, and then add it to the user that is logged ins 
>> user.userlist.anime_in_list but I can't get it to work.
>>
>> Currently my terminal is displaying the error
>>
>> Method Not Allowed (POST): /anime/
>>
>> Method not allowed: /anime/
>>
>> when the button is pressed
>>
>>
>> A code break down for my models.py, views.py etc. is available on this 
>> reddit post:
>>
>>
>> https://www.reddit.com/r/djangolearning/comments/t3jwo0/how_to_add_an_object_to_a_users_list_without/
>>
>> Thanks for any help I'm so stuck and I think it's probably simple!
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/37bacbbf-aedc-4578-aef5-86c3eddec421n%40googlegroups.com.

Reply via email to