Skip to content

Commit

Permalink
Added delete profile
Browse files Browse the repository at this point in the history
  • Loading branch information
ysavary committed Jan 11, 2022
1 parent 0ac0cb0 commit fa92ac5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .env.localhost.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PORT=8006
DEBUG=true
ALLOWED_HOSTS=localhost

STATIC_URL=/django-static/

GOOGLE_CLIENT_SECRET=google-configs/google_client_secret.json

FACEBOOK_REDIRECT_URI=http://localhost:8000/user/facebook/oauth2callback
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=
13 changes: 13 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DEBUG=true
ALLOWED_HOSTS=localhost

STATIC_URL=/django-static/

DB_URL=postgres://postgres:postgres@postgres:5432/winds
MONGODB_URL=mongodb://mongodb:27017/winds

GOOGLE_CLIENT_SECRET=google-configs/google_client_secret.json

FACEBOOK_REDIRECT_URI=http://localhost:8000/user/facebook/oauth2callback
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ winds_mobi_admin/local_settings.py
static/
google-configs/google_client_secret.json
/volumes/
.env
.env.localhost
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ services:
profiles:
- application
ports:
- "8002:8000"
- "8006:8000"
depends_on:
- postgres
environment:
PORT: 8000
DEBUG: true
ALLOWED_HOSTS: localhost
STATIC_URL: ${STATIC_URL}
DB_URL: ${DB_URL}
MONGODB_URL: ${MONGODB_URL}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
Expand Down
6 changes: 6 additions & 0 deletions winds_mobi_user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ def get(self, request):
else:
return Response(status=status.HTTP_404_NOT_FOUND)

def delete(self, request):
mongo_db.users.delete_one({'_id': request.user})
user = User.objects.get(username=request.user)
user.delete()
return Response(status=status.HTTP_204_NO_CONTENT)


class ProfileFavorite(APIView):
"""
Expand Down

0 comments on commit fa92ac5

Please sign in to comment.