-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added some APIs and fixed some bugs #86
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the respective changes in the Readme also.
campusdiscussbackend/settings.py
Outdated
'ENGINE': 'django.db.backends.postgresql', | ||
'NAME': 'mydb', | ||
'USER': 'postgres', | ||
'PASSWORD': 'password', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the password field back to the previous manner.
@@ -3,7 +3,7 @@ | |||
""" | |||
|
|||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' | |||
EMAIL_HOST = 'mmtp.iitk.ac.in' | |||
EMAIL_HOST = 'smtp.gmail.com' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please configure it back to iitk webmail configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
comments/views.py
Outdated
@@ -46,7 +46,7 @@ def recursiveDelete(comment): | |||
|
|||
class DeleteComment(APIView): | |||
|
|||
def delete(self, request): | |||
def post(self, request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a delete request instead of a post request because you are deleting the comments.
posts/views.py
Outdated
@@ -38,7 +38,7 @@ def post(self, request): | |||
|
|||
class DeletePostView(APIView): | |||
|
|||
def delete(self, request): | |||
def post(self, request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here also.
streams/views.py
Outdated
@@ -33,11 +33,11 @@ def put(self,request): | |||
|
|||
class UnfollowStreamView(APIView): | |||
|
|||
def delete(self, request): | |||
def post(self, request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
users/views.py
Outdated
serializer = UserViewSerializer(user) | ||
return Response(serializer.data,status=status.HTTP_200_OK) | ||
except: | ||
return HttpResponse("Bad Request.",status=400) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the HttpResponses to Response with the appropriate messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
users/views.py
Outdated
serializer = UserViewSerializer(user) | ||
return Response(serializer.data,status=status.HTTP_200_OK) | ||
except: | ||
return HttpResponse("Bad Request.",status=400) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
users/views.py
Outdated
''' | ||
### | ||
request.session["username"] = username | ||
request.session.modified = True | ||
return Response(status = status.HTTP_200_OK) | ||
### | ||
''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this commented portion
users/views.py
Outdated
@@ -106,7 +236,7 @@ def put(self, request): | |||
|
|||
class UnfollowUserView(APIView): | |||
|
|||
def delete(self, request): | |||
def post(self, request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change post to delete
campusdiscussbackend/settings.py
Outdated
CORS_ORIGIN_ALLOW_ALL = True | ||
|
||
CORS_ORIGIN_WHITELIST = ( | ||
'http://localhost:3001', | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this done to solve the cors issue with the frontend? If that was only the purpose, then remove this.
One more seems fishy here. In the view by name API, the option which has been provided is to view the profile by the username of the person and not by his/her name(which by the way has certain other problems related to it). Like my username can by anything but name will be Parinay Chauhan. So, I would prefer to view users by their names and not usernames. Thus, I would suggest you to discuss these issues with the mentors. |
Added APIs to update FB link, reset password, view other users' profile using their username and roll and handle forgot password requests.
And fixed some minor bugs in
settings_email.py
.I have tested all the APIs.
EDIT: Added an API which fetches the list of all users with given name.