seyyidibrahimgulec / hipo-internship-task Goto Github PK
View Code? Open in Web Editor NEWThis project was made as an intern task for hipolabs by using python/django.
This project was made as an intern task for hipolabs by using python/django.
/api/recipes/<recipe_id>/likes
POST
creates like.GET
list likes.DELETE
deletes like.Current method is not idempotent
. https://www.restapitutorial.com/lessons/idempotency.html
If the user opens the same recipe in 2 different tab and try to like 2 times, the first request will create a Like
, second one will delete this Like
.
Can we use two different views for creating and deleting a Like
?
We can prefer to use generic views such as CreateView
and DeleteView
.
Can you please add DELETE
functionality ?
Note: User can delete its own recipes.
Ingredient
is a part of Recipe
. They should be in the same Django App.
After that we can delete ingredients
app.
Run python<version> -m pip install flake8
to install flake8.
Example: python3.6 -m pip install flake8
From the repo's root run flake8 --install-hook git
to install pre-commit hooks for Git.
Run git config --bool flake8.strict true
to prevent you from creating a commit with these hooks.
1 - Can you please use POST
instead of GET
in rate_recipe
view ?
2 - Can you please use builtin update_or_create
method of Django in rate_recipe
? https://docs.djangoproject.com/en/2.2/ref/models/querysets/#update-or-create
You can use DRF Api Client
->
https://www.django-rest-framework.org/api-guide/testing/#apiclient
To change password, user should enter old_password
and new_password
.
When users send GET
request to /api/users/me/
endpoint, they should receive their own information.
view_count
field of Recipe
model is not used. Can you please remove this field ?
1 - Can you please rename UpdateRecipe
as UpdateRecipeView
? (Please use View
suffix for all views)
2 - Overriding form_valid
method for redirections is inappropriate. We should use get_success_url
method to determine url.
You can use reverse
method to redirect recipe detail view.
https://docs.djangoproject.com/en/2.1/ref/urlresolvers/#django.urls.reverse
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.