Skip to content
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

feat: updated docs and views #5

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ It allows users to register and create their own blogs where they can write shor
- Signals are used to create user profile when a user is created, the user profile contains additional information about a user, such as profile photo.
- `blogs` app is responsible for creating and updating blogs.

## Infrastructure
![deployment](./screenshots/deployment.png)

## Development Environment
- Clone the latest branch
```bash
Expand All @@ -35,5 +38,11 @@ DB_PORT=
```

## Screenshots
<img src="./screenshots/demo.gif" style="border-radius: 20px; display:block; margin: auto;"/>



![home](./screenshots/home.png)


![profile](./screenshots/profile.png)
4 changes: 2 additions & 2 deletions blog/templates/blog/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<article class="media content-section border mt-2 rounded p-2">
<div class="media-body">
<div class="article-metadata p-1">
<!-- <img class="rounded-circle" style="aspect-ratio: 1/1; width: 50px;" src="{{ post.author.profile.image.url }}" alt="profile_photo"> -->
{% cloudinary profile.image width=80 height=80 %}
<img class="rounded-circle" style="aspect-ratio: 1/1; width: 50px;" src="{{ post.author.profile.image.url }}" alt="profile_photo">
<!-- {% cloudinary profile.image width=80 height=80 %} -->
<a class="mr-2" href="#">{{ post.author }}</a>
<small class="text-muted">{{ post.date_posted | date:"F d, Y" }}</small>
</div>
Expand Down
Binary file added screenshots/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/deployment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions users/templates/users/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{% block content %}
<div class="content-section">
<div class="media">
<!-- <img class="rounded-circle account-img" style="width: 80px; height: 80px" src="{{ user.profile.image.url }}"> -->
{% cloudinary user.profile.image width=80 height=80%}
<img class="rounded-circle account-img" style="width: 80px; height: 80px" src="{{ user.profile.image.url }}">
<!-- {% cloudinary user.profile.image width=80 height=80%} -->
<div class="media-body pl-3">
<h2 class="account-heading">{{ user.username }}</h2>
<p class="text-secondary">{{ user.email }}</p>
Expand Down
2 changes: 1 addition & 1 deletion users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def profile(request: HttpRequest):
if request.method == "POST":
form = UploadProfilePhotoForm(request.POST, request.FILES)
if form.is_valid():
profile_photo = request.FILES["profile_photo"]
profile_photo = request.FILES["image"]
handle_profile_photo(request.user, profile_photo)
form = UploadProfilePhotoForm()
update_user = UpdateUserForm(instance=request.user)
Expand Down
Loading