diff --git a/main/about/__pycache__/__init__.cpython-310.pyc b/main/about/__pycache__/__init__.cpython-310.pyc index 9a2c9cc27d7fc148ac61c76e2b565448b015a694..b7372bf62b4092de5e5544d4c9465fdc8dbdf135 100644 Binary files a/main/about/__pycache__/__init__.cpython-310.pyc and b/main/about/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/about/__pycache__/admin.cpython-310.pyc b/main/about/__pycache__/admin.cpython-310.pyc index a50c5aef0ab2e4a714b50b7e48351a577a386683..5e42b4d98aaeafa8457fae12e747549ae7fbd5cc 100644 Binary files a/main/about/__pycache__/admin.cpython-310.pyc and b/main/about/__pycache__/admin.cpython-310.pyc differ diff --git a/main/about/__pycache__/apps.cpython-310.pyc b/main/about/__pycache__/apps.cpython-310.pyc index 31f21267a0ed04a81d6087a499bd0abab0cc254a..02906cd001417a0adbeeb5544bae0d433909d1b4 100644 Binary files a/main/about/__pycache__/apps.cpython-310.pyc and b/main/about/__pycache__/apps.cpython-310.pyc differ diff --git a/main/about/__pycache__/models.cpython-310.pyc b/main/about/__pycache__/models.cpython-310.pyc index 6e102fd9cf2bb542aaf5297462569d2eac42b870..72873607b06ae14ec48abf39c286d6f01c172491 100644 Binary files a/main/about/__pycache__/models.cpython-310.pyc and b/main/about/__pycache__/models.cpython-310.pyc differ diff --git a/main/about/__pycache__/urls.cpython-310.pyc b/main/about/__pycache__/urls.cpython-310.pyc index 65b67f7f7adef270c8b0beba3fb1d957bf32006b..279cce169240c0131af83cc2faee114f3d755ad8 100644 Binary files a/main/about/__pycache__/urls.cpython-310.pyc and b/main/about/__pycache__/urls.cpython-310.pyc differ diff --git a/main/about/__pycache__/views.cpython-310.pyc b/main/about/__pycache__/views.cpython-310.pyc index 98f6cbb481a71f9ac88c5bde28710a3766ea2f97..c4ea154f79edad15ba950f9beec6e8acc6f3c24d 100644 Binary files a/main/about/__pycache__/views.cpython-310.pyc and b/main/about/__pycache__/views.cpython-310.pyc differ diff --git a/main/about/migrations/__pycache__/__init__.cpython-310.pyc b/main/about/migrations/__pycache__/__init__.cpython-310.pyc index 5df2c65d9cdeeadb3b0993ee9ae2e89573a4dbf8..bd5d2a845017d0927a29a31d65314650e391542a 100644 Binary files a/main/about/migrations/__pycache__/__init__.cpython-310.pyc and b/main/about/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/contact/__pycache__/__init__.cpython-310.pyc b/main/contact/__pycache__/__init__.cpython-310.pyc index 095806e2ef51d90e9c18580ec55aa7b3e9f01393..e465fd91dab3a4ea86c09413ee1b74df78c62299 100644 Binary files a/main/contact/__pycache__/__init__.cpython-310.pyc and b/main/contact/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/contact/__pycache__/admin.cpython-310.pyc b/main/contact/__pycache__/admin.cpython-310.pyc index 54a3f890236a08a003fed0015aa669d2e217d599..e1f0f3d9f86682ae3f2883553080910a4ae9b93c 100644 Binary files a/main/contact/__pycache__/admin.cpython-310.pyc and b/main/contact/__pycache__/admin.cpython-310.pyc differ diff --git a/main/contact/__pycache__/apps.cpython-310.pyc b/main/contact/__pycache__/apps.cpython-310.pyc index 4c76ea14c805d967f50a0877bea1d56e40e9e675..629d2b90621696ac954409ac34d5cce1c394ad67 100644 Binary files a/main/contact/__pycache__/apps.cpython-310.pyc and b/main/contact/__pycache__/apps.cpython-310.pyc differ diff --git a/main/contact/__pycache__/forms.cpython-310.pyc b/main/contact/__pycache__/forms.cpython-310.pyc index c98c429250a2a85b88e203047da35fd5af95b61f..32c577cacec1e8d6a59fc583f16581f537266d36 100644 Binary files a/main/contact/__pycache__/forms.cpython-310.pyc and b/main/contact/__pycache__/forms.cpython-310.pyc differ diff --git a/main/contact/__pycache__/models.cpython-310.pyc b/main/contact/__pycache__/models.cpython-310.pyc index 6083842b57278191e901a0004e1f151c97499dc4..a83992b0e73dae2bbc300e446b44aa8910b81674 100644 Binary files a/main/contact/__pycache__/models.cpython-310.pyc and b/main/contact/__pycache__/models.cpython-310.pyc differ diff --git a/main/contact/__pycache__/urls.cpython-310.pyc b/main/contact/__pycache__/urls.cpython-310.pyc index 2ad4208e2ab08017b25a6def5a41c16a66fd15a4..7d506f8f7b3a80fa335280fe78c69dd5766df946 100644 Binary files a/main/contact/__pycache__/urls.cpython-310.pyc and b/main/contact/__pycache__/urls.cpython-310.pyc differ diff --git a/main/contact/__pycache__/views.cpython-310.pyc b/main/contact/__pycache__/views.cpython-310.pyc index 6d4150ae933bd78b1356f8505adc3c9cf322bfb1..7dff95195748390d8af93819cccc77b247722352 100644 Binary files a/main/contact/__pycache__/views.cpython-310.pyc and b/main/contact/__pycache__/views.cpython-310.pyc differ diff --git a/main/contact/migrations/__pycache__/0001_initial.cpython-310.pyc b/main/contact/migrations/__pycache__/0001_initial.cpython-310.pyc index 45f0051d38724f5aa86297cf9d70e507e6669528..b65895d2ddb56fa42231334ac8124e1529eec6d0 100644 Binary files a/main/contact/migrations/__pycache__/0001_initial.cpython-310.pyc and b/main/contact/migrations/__pycache__/0001_initial.cpython-310.pyc differ diff --git a/main/contact/migrations/__pycache__/__init__.cpython-310.pyc b/main/contact/migrations/__pycache__/__init__.cpython-310.pyc index 493a86f53abab72d58b1ed2489879564204c9e17..d124418a6f60cbe8b8f87fe09410af62bf4f1324 100644 Binary files a/main/contact/migrations/__pycache__/__init__.cpython-310.pyc and b/main/contact/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/db.sqlite3 b/main/db.sqlite3 index 1e696f51d5fdc1bb6880a407770f32bf2a033ba4..b87e071cd2c8fc89b3b21cf4cb8ef6c1cce2ea22 100644 Binary files a/main/db.sqlite3 and b/main/db.sqlite3 differ diff --git a/main/main/__pycache__/__init__.cpython-310.pyc b/main/main/__pycache__/__init__.cpython-310.pyc index 0598f46cfe9d56f2b024e9aadbdba29bd4ec2dd7..a7b4f2af51582b6dffb2fc8e8f80daa94b49f908 100644 Binary files a/main/main/__pycache__/__init__.cpython-310.pyc and b/main/main/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/main/__pycache__/settings.cpython-310.pyc b/main/main/__pycache__/settings.cpython-310.pyc index 0ce0346be01a24913b4e515cefb302a54f716009..9f03706486e4e54654532284532ec2d5d7be9258 100644 Binary files a/main/main/__pycache__/settings.cpython-310.pyc and b/main/main/__pycache__/settings.cpython-310.pyc differ diff --git a/main/main/__pycache__/urls.cpython-310.pyc b/main/main/__pycache__/urls.cpython-310.pyc index 0d0cc04f843200e97a015d07d5f32595486ec335..f3195dd554c9b148625f0e45390e0befa769be57 100644 Binary files a/main/main/__pycache__/urls.cpython-310.pyc and b/main/main/__pycache__/urls.cpython-310.pyc differ diff --git a/main/main/__pycache__/wsgi.cpython-310.pyc b/main/main/__pycache__/wsgi.cpython-310.pyc index fcb19ca90a77719a3568cc2fd659c4970f98fd23..800af7d9ee844402caedd20d6d80ce42830959f8 100644 Binary files a/main/main/__pycache__/wsgi.cpython-310.pyc and b/main/main/__pycache__/wsgi.cpython-310.pyc differ diff --git a/main/postSection/__pycache__/__init__.cpython-310.pyc b/main/postSection/__pycache__/__init__.cpython-310.pyc index 3b8a1ee273b37525530128cadf1cc03c29820024..a85215995511ebea2676cd559fb5e46504a49b49 100644 Binary files a/main/postSection/__pycache__/__init__.cpython-310.pyc and b/main/postSection/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/postSection/__pycache__/admin.cpython-310.pyc b/main/postSection/__pycache__/admin.cpython-310.pyc index b865f54cce08ac4814dc371d3dfcaac36a27daf5..6499614809642c49ea956d203f365c089b1c2381 100644 Binary files a/main/postSection/__pycache__/admin.cpython-310.pyc and b/main/postSection/__pycache__/admin.cpython-310.pyc differ diff --git a/main/postSection/__pycache__/apps.cpython-310.pyc b/main/postSection/__pycache__/apps.cpython-310.pyc index 9fa644a677926a85ccf71930894d065384af9753..d5e92e2d88ec6261d99530af37ea385046ee061d 100644 Binary files a/main/postSection/__pycache__/apps.cpython-310.pyc and b/main/postSection/__pycache__/apps.cpython-310.pyc differ diff --git a/main/postSection/__pycache__/forms.cpython-310.pyc b/main/postSection/__pycache__/forms.cpython-310.pyc index 95d2357ccb659b69421e8093646b0f12227a988a..19e8bdfdb887191c0ff85e8e392aaf4de4812f05 100644 Binary files a/main/postSection/__pycache__/forms.cpython-310.pyc and b/main/postSection/__pycache__/forms.cpython-310.pyc differ diff --git a/main/postSection/__pycache__/models.cpython-310.pyc b/main/postSection/__pycache__/models.cpython-310.pyc index 9c0151c03beceb0584e1c8c7f4f53b6f9b3ac445..a339426d35f58dee3313e8fc7b5be2a31accc486 100644 Binary files a/main/postSection/__pycache__/models.cpython-310.pyc and b/main/postSection/__pycache__/models.cpython-310.pyc differ diff --git a/main/postSection/__pycache__/urls.cpython-310.pyc b/main/postSection/__pycache__/urls.cpython-310.pyc index b3b8d67a2d13f8897f3fb7617fe6e8b0a6c4f9cd..fc480378643e579d6e73049d0e2caf563d44ae85 100644 Binary files a/main/postSection/__pycache__/urls.cpython-310.pyc and b/main/postSection/__pycache__/urls.cpython-310.pyc differ diff --git a/main/postSection/__pycache__/views.cpython-310.pyc b/main/postSection/__pycache__/views.cpython-310.pyc index 97b0a8e26a3fe539e524011f0048fd8b2e6dc953..1595db3ff9ad0ae325dcabd35cd2acf5aa82c97c 100644 Binary files a/main/postSection/__pycache__/views.cpython-310.pyc and b/main/postSection/__pycache__/views.cpython-310.pyc differ diff --git a/main/postSection/migrations/__pycache__/0001_initial.cpython-310.pyc b/main/postSection/migrations/__pycache__/0001_initial.cpython-310.pyc index 683d90d3b7cbec96dc65d6e8946ab0d59f0fbb0a..3a2b5dcd15690de8e11d7df307e30e263cbe3b8a 100644 Binary files a/main/postSection/migrations/__pycache__/0001_initial.cpython-310.pyc and b/main/postSection/migrations/__pycache__/0001_initial.cpython-310.pyc differ diff --git a/main/postSection/migrations/__pycache__/0002_comments_post_delete_contact_and_more.cpython-310.pyc b/main/postSection/migrations/__pycache__/0002_comments_post_delete_contact_and_more.cpython-310.pyc index 777e1044b9afc4927d4b49314082d140fa39f7f9..1db1316f4fb432381e3cc05400b3dd0930991ea3 100644 Binary files a/main/postSection/migrations/__pycache__/0002_comments_post_delete_contact_and_more.cpython-310.pyc and b/main/postSection/migrations/__pycache__/0002_comments_post_delete_contact_and_more.cpython-310.pyc differ diff --git a/main/postSection/migrations/__pycache__/0003_remove_post_postsection_postid_f30fee_idx_and_more.cpython-310.pyc b/main/postSection/migrations/__pycache__/0003_remove_post_postsection_postid_f30fee_idx_and_more.cpython-310.pyc index 9a2c23a28516d610a635c2429f2ca9f98f316b4d..5f486b259ef2aa1500c4480549f7a6102fc3e49b 100644 Binary files a/main/postSection/migrations/__pycache__/0003_remove_post_postsection_postid_f30fee_idx_and_more.cpython-310.pyc and b/main/postSection/migrations/__pycache__/0003_remove_post_postsection_postid_f30fee_idx_and_more.cpython-310.pyc differ diff --git a/main/postSection/migrations/__pycache__/0004_remove_post_postsection_id_db0f9d_idx.cpython-310.pyc b/main/postSection/migrations/__pycache__/0004_remove_post_postsection_id_db0f9d_idx.cpython-310.pyc index 9c0154c9aa852da879dc4b997a94548483a72c95..c4bd93c0b60ecbd6962ed934a31b1c2b8f055a68 100644 Binary files a/main/postSection/migrations/__pycache__/0004_remove_post_postsection_id_db0f9d_idx.cpython-310.pyc and b/main/postSection/migrations/__pycache__/0004_remove_post_postsection_id_db0f9d_idx.cpython-310.pyc differ diff --git a/main/postSection/migrations/__pycache__/0005_comment_post_created_at_post_updated_at_and_more.cpython-310.pyc b/main/postSection/migrations/__pycache__/0005_comment_post_created_at_post_updated_at_and_more.cpython-310.pyc index 4c60d11a7aae3f32bb521c355a68a2fe20088eae..bfd378816fb55d85dfe702c137966d2f1dc24fb5 100644 Binary files a/main/postSection/migrations/__pycache__/0005_comment_post_created_at_post_updated_at_and_more.cpython-310.pyc and b/main/postSection/migrations/__pycache__/0005_comment_post_created_at_post_updated_at_and_more.cpython-310.pyc differ diff --git a/main/postSection/migrations/__pycache__/0006_alter_post_image.cpython-310.pyc b/main/postSection/migrations/__pycache__/0006_alter_post_image.cpython-310.pyc index b87688ab35ec4960f659bb389cc9c0b356ad38fc..3d14e92dd26981fd91aa2e7afa65d66e0d11b2d2 100644 Binary files a/main/postSection/migrations/__pycache__/0006_alter_post_image.cpython-310.pyc and b/main/postSection/migrations/__pycache__/0006_alter_post_image.cpython-310.pyc differ diff --git a/main/postSection/migrations/__pycache__/0007_alter_post_image.cpython-310.pyc b/main/postSection/migrations/__pycache__/0007_alter_post_image.cpython-310.pyc index 651a71b7019bbcb360a0b2ff6f532b560990310a..1eb2919ec03dc095c1e5756f1533634c601286c3 100644 Binary files a/main/postSection/migrations/__pycache__/0007_alter_post_image.cpython-310.pyc and b/main/postSection/migrations/__pycache__/0007_alter_post_image.cpython-310.pyc differ diff --git a/main/postSection/migrations/__pycache__/0008_rename_description_comment_content_comment_post.cpython-310.pyc b/main/postSection/migrations/__pycache__/0008_rename_description_comment_content_comment_post.cpython-310.pyc index 7b12bb1786e998daecf86cdbb97ca986fcfe4b0d..ef25ed63399a52e753c6c224551d2a3eed73d2cc 100644 Binary files a/main/postSection/migrations/__pycache__/0008_rename_description_comment_content_comment_post.cpython-310.pyc and b/main/postSection/migrations/__pycache__/0008_rename_description_comment_content_comment_post.cpython-310.pyc differ diff --git a/main/postSection/migrations/__pycache__/__init__.cpython-310.pyc b/main/postSection/migrations/__pycache__/__init__.cpython-310.pyc index ac2f45dfcb45927fa378be82bce6077a24ac4a27..253f660b775e59c82cb3b6839c1ea0b3b9d3bb8e 100644 Binary files a/main/postSection/migrations/__pycache__/__init__.cpython-310.pyc and b/main/postSection/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/postSection/templates/postSection/postIndex.html b/main/postSection/templates/postSection/postIndex.html index c485c8f412f9371e5b5c60e23874b86003d3136f..93c7e017debbbbbcc39dbf01ecad945df36a597e 100644 --- a/main/postSection/templates/postSection/postIndex.html +++ b/main/postSection/templates/postSection/postIndex.html @@ -1,15 +1,31 @@ {% extends 'base.html' %} {% block content %} <h1>Post List</h1> - <table style="width:100%"> + <!-- <table style="width:100%"> <tr> <th>Image</th> <th>Description</th> <th>Created</th> <th>Author</th> - </tr> - {% for post in post_list %} - <tr> + </tr> --> + {% for post in post_list|slice:"0:20" %} + <div class="post-container"> + <div class="post-box"> + <div class="post-details-box"> + <h2 class="author">{{ post.author }}</h2> + <a href="{% url 'postSection:post_detail' post.id %}"> + <img src="{{ post.image.url }}" alt="Post Image" class="max-image-size-details"> + </a> + <p>{{ post.created_at }}</p> + <p class="post-title">{{ post.description }}</p> + <div class="treats-section"> + <p>Treats: <span id="treats-count">{{ post.treats }}</span></p> + <button id="add-treat-btn">Give Treat</button> + </div> + </div> + </div> + </div> + <!-- <tr> <td> {% if post.image and post.image.url %} <a href="{% url 'postSection:post_detail' post.id %}"> @@ -22,10 +38,10 @@ <td>{{ post.description | truncatechars:25 }}</td> <td>{{ post.created_at }}</td> <td>{{ post.author }}</td> - </tr> + </tr> --> {% endfor %} - </table> + <!-- </table> <hr/> <input type="button" onclick="location.href='{% url 'postSection:newPost' %}';" value="New Post" /> - + --> {% endblock content %} \ No newline at end of file diff --git a/main/postSection/urls.py b/main/postSection/urls.py index d304ddcfa3b57c7203574063138fe6a48185d9d0..6dfda9e73cc6ddc57ac8044167f974628b336bf1 100644 --- a/main/postSection/urls.py +++ b/main/postSection/urls.py @@ -10,6 +10,7 @@ urlpatterns = [ path('<int:pk>/', views.postDetailView.as_view(), name='post_detail'), # specific post path('delete/<int:nid>', views.delete_view, name = 'post_delete'), #to delete a post path('', views.index_view, name='post_index'), + path('feed', views.feed_view, name='feed'), path('newPost/', views.newPostView, name='newPost'), path('<int:pk>/add_comment/', views.add_comment_view, name='add_comment'), path('delete-comment/<int:comment_id>/', views.delete_comment, name='delete_comment'), diff --git a/main/postSection/views.py b/main/postSection/views.py index 9c6ae54d9a8b6f5b2fb9f9e0a3c46f650652842a..fd4d9aa2dab5ab873a5884857658836ddab59f01 100644 --- a/main/postSection/views.py +++ b/main/postSection/views.py @@ -99,6 +99,14 @@ def index_view(request): return render(request, "postSection/postIndex.html", context) +def feed_view(request): + all_posts = sorted(post.objects.all(), key=lambda p:(p.created_at), reverse=True) + valid_posts = [] + for post_item in all_posts: + if post_item.image and default_storage.exists(post_item.image.name): + valid_posts.append(post_item) + return render(request, "postSection/postIndex.html", {'post_list':valid_posts}) + @login_required def delete_view(request, nid): obj= get_object_or_404(post, id=nid) diff --git a/main/profile/__pycache__/__init__.cpython-310.pyc b/main/profile/__pycache__/__init__.cpython-310.pyc index 767980c02780121b25dafe8719192316e72cfba8..fce2f7a0c7428cbbdf36c1d157762f2f66374f20 100644 Binary files a/main/profile/__pycache__/__init__.cpython-310.pyc and b/main/profile/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/profile/__pycache__/admin.cpython-310.pyc b/main/profile/__pycache__/admin.cpython-310.pyc index 551d5fa6850abb5ae5f806ee557b7b6ec0e963e8..3ddecaaed4738f49a78e8cea4392fc2937e90d1e 100644 Binary files a/main/profile/__pycache__/admin.cpython-310.pyc and b/main/profile/__pycache__/admin.cpython-310.pyc differ diff --git a/main/profile/__pycache__/apps.cpython-310.pyc b/main/profile/__pycache__/apps.cpython-310.pyc index 8863f814a0747933f26a2f8a77a39b11caf1d2a5..8969b68bec3946b7718f41fa0473b6a1596bb8f6 100644 Binary files a/main/profile/__pycache__/apps.cpython-310.pyc and b/main/profile/__pycache__/apps.cpython-310.pyc differ diff --git a/main/profile/__pycache__/forms.cpython-310.pyc b/main/profile/__pycache__/forms.cpython-310.pyc index 3b5a584aa46f978828b31ec894878721fbc9c5ca..0833b765b45a078e46443aaaad49f57dbefd0931 100644 Binary files a/main/profile/__pycache__/forms.cpython-310.pyc and b/main/profile/__pycache__/forms.cpython-310.pyc differ diff --git a/main/profile/__pycache__/models.cpython-310.pyc b/main/profile/__pycache__/models.cpython-310.pyc index 6958e15c31956ed80351fee6e21f09f40b31b814..5fce0770b364be0caffe8875ac3787eaf9c4a498 100644 Binary files a/main/profile/__pycache__/models.cpython-310.pyc and b/main/profile/__pycache__/models.cpython-310.pyc differ diff --git a/main/profile/__pycache__/urls.cpython-310.pyc b/main/profile/__pycache__/urls.cpython-310.pyc index ef23f7abcaedd981d4c1e9b41eac3804387f1238..d5d2df77168b94a94b30009cfbc046a66a0b0e10 100644 Binary files a/main/profile/__pycache__/urls.cpython-310.pyc and b/main/profile/__pycache__/urls.cpython-310.pyc differ diff --git a/main/profile/__pycache__/views.cpython-310.pyc b/main/profile/__pycache__/views.cpython-310.pyc index 5aeaa669e2ca7c4b34c79cf3420c6e168af7a3fd..5684cb80f7891d2ddafb7dfdbf1a2b44ce582ef9 100644 Binary files a/main/profile/__pycache__/views.cpython-310.pyc and b/main/profile/__pycache__/views.cpython-310.pyc differ diff --git a/main/profile/migrations/__pycache__/0001_initial.cpython-310.pyc b/main/profile/migrations/__pycache__/0001_initial.cpython-310.pyc index 7588243d6505bbd7af3d111b035497883f772160..4cf0213824331bc9a798218b2d6c97af5e391a5a 100644 Binary files a/main/profile/migrations/__pycache__/0001_initial.cpython-310.pyc and b/main/profile/migrations/__pycache__/0001_initial.cpython-310.pyc differ diff --git a/main/profile/migrations/__pycache__/0002_interest_profile_delete_userprofile.cpython-310.pyc b/main/profile/migrations/__pycache__/0002_interest_profile_delete_userprofile.cpython-310.pyc index 691088e2034f01a455a611517fdc81f30842b456..f97fd15b6aac8f007031f957972ac21959487044 100644 Binary files a/main/profile/migrations/__pycache__/0002_interest_profile_delete_userprofile.cpython-310.pyc and b/main/profile/migrations/__pycache__/0002_interest_profile_delete_userprofile.cpython-310.pyc differ diff --git a/main/profile/migrations/__pycache__/__init__.cpython-310.pyc b/main/profile/migrations/__pycache__/__init__.cpython-310.pyc index b163ace43f6ccb04a6a9fb2206482805ea64bd3b..d687f453a19a1012fd5bfdac1b0ff5416efb31b7 100644 Binary files a/main/profile/migrations/__pycache__/__init__.cpython-310.pyc and b/main/profile/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/profile/urls.py b/main/profile/urls.py index 393d52a7180b7adf05d1b053b2c6629bdbd52425..629d418038414803b357e4fa422d0c2471b93baa 100644 --- a/main/profile/urls.py +++ b/main/profile/urls.py @@ -6,7 +6,7 @@ from . import views urlpatterns = [ path('', view_profile, name='view_profile'), - path('view', view_profile, name='view_profile'), + path('view/<str:username>', view_profile, name='view_profile'), path('edit', edit_profile, name='edit_profile'), - path('user/<str:username>/', views.user_posts, name='user_posts'), + # path('user/<str:username>/', views.user_posts, name='user_posts'), ] \ No newline at end of file diff --git a/main/profile/views.py b/main/profile/views.py index 82a8ab30a5cf73ce80a760c69e679dd0218cf604..9017eff8de3034b34ec33f9507036826f8cd1be8 100644 --- a/main/profile/views.py +++ b/main/profile/views.py @@ -53,8 +53,3 @@ def edit_profile(request): form = ProfileForm(instance=profile, initial={'username': request.user.username}) return render(request, 'profile/edit_profile.html', {'form': form}) - -def user_posts(request, username): - # Query all posts made by the user - user_posts = post.objects.filter(author__username=username) - return render(request, 'profile/user_posts.html', {'user_posts': user_posts, 'username': username}) diff --git a/main/register/__pycache__/__init__.cpython-310.pyc b/main/register/__pycache__/__init__.cpython-310.pyc index 0c692bb651fc17b89219264f49956ea6accd6071..4a83ff106a2756c721545145176b8ffab611e4fb 100644 Binary files a/main/register/__pycache__/__init__.cpython-310.pyc and b/main/register/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/register/__pycache__/admin.cpython-310.pyc b/main/register/__pycache__/admin.cpython-310.pyc index 3875ac45b2f73baf315b90cfa7a94d48d51facfd..e8ae14f3481648965df5f87dd6ace3b17263f791 100644 Binary files a/main/register/__pycache__/admin.cpython-310.pyc and b/main/register/__pycache__/admin.cpython-310.pyc differ diff --git a/main/register/__pycache__/apps.cpython-310.pyc b/main/register/__pycache__/apps.cpython-310.pyc index b0b55c6812a95473df7f48308b85c31b8337deed..8861d4f783b051c124790d57af7437b5dbd46f2d 100644 Binary files a/main/register/__pycache__/apps.cpython-310.pyc and b/main/register/__pycache__/apps.cpython-310.pyc differ diff --git a/main/register/__pycache__/forms.cpython-310.pyc b/main/register/__pycache__/forms.cpython-310.pyc index f35348d1c4f0e99b188340b484331a30222df2fe..4ecfa190d17c7151df3a572034ac41f065369411 100644 Binary files a/main/register/__pycache__/forms.cpython-310.pyc and b/main/register/__pycache__/forms.cpython-310.pyc differ diff --git a/main/register/__pycache__/models.cpython-310.pyc b/main/register/__pycache__/models.cpython-310.pyc index 5f19f17076f39f0b342690460797b0a1730908bb..b265e3bb05c6accfc3c7f2128e6c0204e561805f 100644 Binary files a/main/register/__pycache__/models.cpython-310.pyc and b/main/register/__pycache__/models.cpython-310.pyc differ diff --git a/main/register/__pycache__/urls.cpython-310.pyc b/main/register/__pycache__/urls.cpython-310.pyc index a6e886c5775730925382e6b48ac06a9fc981c6f4..ed7ebb72feff56b7cfb7c4b1887805a8d0eb79f8 100644 Binary files a/main/register/__pycache__/urls.cpython-310.pyc and b/main/register/__pycache__/urls.cpython-310.pyc differ diff --git a/main/register/__pycache__/views.cpython-310.pyc b/main/register/__pycache__/views.cpython-310.pyc index 06fe8c0297b3a7431bbd55ca984e02cb37d34d07..8a0fca72e711071215ef568efd74e5f5100086a6 100644 Binary files a/main/register/__pycache__/views.cpython-310.pyc and b/main/register/__pycache__/views.cpython-310.pyc differ diff --git a/main/register/migrations/__pycache__/0001_initial.cpython-310.pyc b/main/register/migrations/__pycache__/0001_initial.cpython-310.pyc index 86cd0347d8eb4e9c0e2716bcd1e5154d1029e9b8..77daabfd0554e77ce4f2b1c20991d9b2f36ab728 100644 Binary files a/main/register/migrations/__pycache__/0001_initial.cpython-310.pyc and b/main/register/migrations/__pycache__/0001_initial.cpython-310.pyc differ diff --git a/main/register/migrations/__pycache__/__init__.cpython-310.pyc b/main/register/migrations/__pycache__/__init__.cpython-310.pyc index 23b02254146e7f9ce29c3beb8f362b839ae452e0..d63509e96846eec0330ee9a56e64a07737db1012 100644 Binary files a/main/register/migrations/__pycache__/__init__.cpython-310.pyc and b/main/register/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/main/templates/base.html b/main/templates/base.html index 0901dfd1c4fa1452b705323d38b50b31173e852c..399ee7cdb430f3829e6f7eaef525436792436659 100644 --- a/main/templates/base.html +++ b/main/templates/base.html @@ -25,7 +25,7 @@ </div> <div class="navbar-right"> <a href="{% url 'welcome' %}">Home</a> - <a href="#">Search</a> + <a href="{% url 'postSection:feed' %}">Feed</a> <a href="{% url 'postSection:newPost' %}">Add Photos</a> <a href="{% url 'view_profile' %}">Profile</a> <a href="{% url 'contact' %}">Contact</a>