From 9f29ae9d2ddc94c5723972ed72756ee57aef0e09 Mon Sep 17 00:00:00 2001
From: bmzsombi <bmzsombi@sch.bme.hu>
Date: Sun, 6 Apr 2025 21:06:33 +0200
Subject: [PATCH] asd

---
 imageuploader/imageuploader/urls.py           |   2 +-
 imageuploader/{posts => pictures}/__init__.py |   0
 .../__pycache__/__init__.cpython-313.pyc      | Bin
 .../__pycache__/admin.cpython-313.pyc         | Bin
 .../__pycache__/apps.cpython-313.pyc          | Bin
 .../__pycache__/forms.cpython-313.pyc         | Bin
 .../__pycache__/models.cpython-313.pyc        | Bin
 .../__pycache__/urls.cpython-313.pyc          | Bin
 .../__pycache__/views.cpython-313.pyc         | Bin
 imageuploader/{posts => pictures}/admin.py    |   0
 imageuploader/{posts => pictures}/apps.py     |   2 +-
 imageuploader/{posts => pictures}/forms.py    |   0
 .../migrations/0001_initial.py                |   0
 .../migrations/0002_post_banner.py            |   0
 .../migrations/0003_post_author.py            |   0
 .../migrations/0004_alter_post_author.py      |   0
 .../migrations/__init__.py                    |   0
 .../__pycache__/0001_initial.cpython-313.pyc  | Bin
 .../0002_post_banner.cpython-313.pyc          | Bin
 .../0003_post_author.cpython-313.pyc          | Bin
 .../0004_alter_post_author.cpython-313.pyc    | Bin
 .../__pycache__/__init__.cpython-313.pyc      | Bin
 imageuploader/{posts => pictures}/models.py   |   2 +-
 .../templates/posts/picture_new.html}         |   8 ++---
 .../templates/posts/picture_page.html}        |  12 ++++----
 .../templates/posts/pictures_list.html        |  23 ++++++++++++++
 imageuploader/{posts => pictures}/tests.py    |   0
 imageuploader/pictures/urls.py                |  11 +++++++
 imageuploader/pictures/views.py               |  28 ++++++++++++++++++
 .../posts/templates/posts/posts_list.html     |  23 --------------
 imageuploader/posts/urls.py                   |  11 -------
 imageuploader/posts/views.py                  |  28 ------------------
 imageuploader/templates/layout.html           |   8 ++---
 33 files changed, 79 insertions(+), 79 deletions(-)
 rename imageuploader/{posts => pictures}/__init__.py (100%)
 rename imageuploader/{posts => pictures}/__pycache__/__init__.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/__pycache__/admin.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/__pycache__/apps.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/__pycache__/forms.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/__pycache__/models.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/__pycache__/urls.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/__pycache__/views.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/admin.py (100%)
 rename imageuploader/{posts => pictures}/apps.py (84%)
 rename imageuploader/{posts => pictures}/forms.py (100%)
 rename imageuploader/{posts => pictures}/migrations/0001_initial.py (100%)
 rename imageuploader/{posts => pictures}/migrations/0002_post_banner.py (100%)
 rename imageuploader/{posts => pictures}/migrations/0003_post_author.py (100%)
 rename imageuploader/{posts => pictures}/migrations/0004_alter_post_author.py (100%)
 rename imageuploader/{posts => pictures}/migrations/__init__.py (100%)
 rename imageuploader/{posts => pictures}/migrations/__pycache__/0001_initial.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/migrations/__pycache__/0002_post_banner.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/migrations/__pycache__/0003_post_author.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/migrations/__pycache__/0004_alter_post_author.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/migrations/__pycache__/__init__.cpython-313.pyc (100%)
 rename imageuploader/{posts => pictures}/models.py (93%)
 rename imageuploader/{posts/templates/posts/post_new.html => pictures/templates/posts/picture_new.html} (60%)
 rename imageuploader/{posts/templates/posts/post_page.html => pictures/templates/posts/picture_page.html} (51%)
 create mode 100644 imageuploader/pictures/templates/posts/pictures_list.html
 rename imageuploader/{posts => pictures}/tests.py (100%)
 create mode 100644 imageuploader/pictures/urls.py
 create mode 100644 imageuploader/pictures/views.py
 delete mode 100644 imageuploader/posts/templates/posts/posts_list.html
 delete mode 100644 imageuploader/posts/urls.py
 delete mode 100644 imageuploader/posts/views.py

diff --git a/imageuploader/imageuploader/urls.py b/imageuploader/imageuploader/urls.py
index f7302ca..fc23a52 100644
--- a/imageuploader/imageuploader/urls.py
+++ b/imageuploader/imageuploader/urls.py
@@ -27,7 +27,7 @@ urlpatterns = [
     path('admin/', admin.site.urls),
     path('', views.homepage),
     path('about/', views.about),
-    path('posts/', include('posts.urls')),
+    path('pictures/', include('pictures.urls')),
     path('users/', include('users.urls'))
 ]
 
diff --git a/imageuploader/posts/__init__.py b/imageuploader/pictures/__init__.py
similarity index 100%
rename from imageuploader/posts/__init__.py
rename to imageuploader/pictures/__init__.py
diff --git a/imageuploader/posts/__pycache__/__init__.cpython-313.pyc b/imageuploader/pictures/__pycache__/__init__.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/__pycache__/__init__.cpython-313.pyc
rename to imageuploader/pictures/__pycache__/__init__.cpython-313.pyc
diff --git a/imageuploader/posts/__pycache__/admin.cpython-313.pyc b/imageuploader/pictures/__pycache__/admin.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/__pycache__/admin.cpython-313.pyc
rename to imageuploader/pictures/__pycache__/admin.cpython-313.pyc
diff --git a/imageuploader/posts/__pycache__/apps.cpython-313.pyc b/imageuploader/pictures/__pycache__/apps.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/__pycache__/apps.cpython-313.pyc
rename to imageuploader/pictures/__pycache__/apps.cpython-313.pyc
diff --git a/imageuploader/posts/__pycache__/forms.cpython-313.pyc b/imageuploader/pictures/__pycache__/forms.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/__pycache__/forms.cpython-313.pyc
rename to imageuploader/pictures/__pycache__/forms.cpython-313.pyc
diff --git a/imageuploader/posts/__pycache__/models.cpython-313.pyc b/imageuploader/pictures/__pycache__/models.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/__pycache__/models.cpython-313.pyc
rename to imageuploader/pictures/__pycache__/models.cpython-313.pyc
diff --git a/imageuploader/posts/__pycache__/urls.cpython-313.pyc b/imageuploader/pictures/__pycache__/urls.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/__pycache__/urls.cpython-313.pyc
rename to imageuploader/pictures/__pycache__/urls.cpython-313.pyc
diff --git a/imageuploader/posts/__pycache__/views.cpython-313.pyc b/imageuploader/pictures/__pycache__/views.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/__pycache__/views.cpython-313.pyc
rename to imageuploader/pictures/__pycache__/views.cpython-313.pyc
diff --git a/imageuploader/posts/admin.py b/imageuploader/pictures/admin.py
similarity index 100%
rename from imageuploader/posts/admin.py
rename to imageuploader/pictures/admin.py
diff --git a/imageuploader/posts/apps.py b/imageuploader/pictures/apps.py
similarity index 84%
rename from imageuploader/posts/apps.py
rename to imageuploader/pictures/apps.py
index b18ed0d..b38c60c 100644
--- a/imageuploader/posts/apps.py
+++ b/imageuploader/pictures/apps.py
@@ -3,4 +3,4 @@ from django.apps import AppConfig
 
 class PostsConfig(AppConfig):
     default_auto_field = 'django.db.models.BigAutoField'
-    name = 'posts'
+    name = 'pictures'
diff --git a/imageuploader/posts/forms.py b/imageuploader/pictures/forms.py
similarity index 100%
rename from imageuploader/posts/forms.py
rename to imageuploader/pictures/forms.py
diff --git a/imageuploader/posts/migrations/0001_initial.py b/imageuploader/pictures/migrations/0001_initial.py
similarity index 100%
rename from imageuploader/posts/migrations/0001_initial.py
rename to imageuploader/pictures/migrations/0001_initial.py
diff --git a/imageuploader/posts/migrations/0002_post_banner.py b/imageuploader/pictures/migrations/0002_post_banner.py
similarity index 100%
rename from imageuploader/posts/migrations/0002_post_banner.py
rename to imageuploader/pictures/migrations/0002_post_banner.py
diff --git a/imageuploader/posts/migrations/0003_post_author.py b/imageuploader/pictures/migrations/0003_post_author.py
similarity index 100%
rename from imageuploader/posts/migrations/0003_post_author.py
rename to imageuploader/pictures/migrations/0003_post_author.py
diff --git a/imageuploader/posts/migrations/0004_alter_post_author.py b/imageuploader/pictures/migrations/0004_alter_post_author.py
similarity index 100%
rename from imageuploader/posts/migrations/0004_alter_post_author.py
rename to imageuploader/pictures/migrations/0004_alter_post_author.py
diff --git a/imageuploader/posts/migrations/__init__.py b/imageuploader/pictures/migrations/__init__.py
similarity index 100%
rename from imageuploader/posts/migrations/__init__.py
rename to imageuploader/pictures/migrations/__init__.py
diff --git a/imageuploader/posts/migrations/__pycache__/0001_initial.cpython-313.pyc b/imageuploader/pictures/migrations/__pycache__/0001_initial.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/migrations/__pycache__/0001_initial.cpython-313.pyc
rename to imageuploader/pictures/migrations/__pycache__/0001_initial.cpython-313.pyc
diff --git a/imageuploader/posts/migrations/__pycache__/0002_post_banner.cpython-313.pyc b/imageuploader/pictures/migrations/__pycache__/0002_post_banner.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/migrations/__pycache__/0002_post_banner.cpython-313.pyc
rename to imageuploader/pictures/migrations/__pycache__/0002_post_banner.cpython-313.pyc
diff --git a/imageuploader/posts/migrations/__pycache__/0003_post_author.cpython-313.pyc b/imageuploader/pictures/migrations/__pycache__/0003_post_author.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/migrations/__pycache__/0003_post_author.cpython-313.pyc
rename to imageuploader/pictures/migrations/__pycache__/0003_post_author.cpython-313.pyc
diff --git a/imageuploader/posts/migrations/__pycache__/0004_alter_post_author.cpython-313.pyc b/imageuploader/pictures/migrations/__pycache__/0004_alter_post_author.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/migrations/__pycache__/0004_alter_post_author.cpython-313.pyc
rename to imageuploader/pictures/migrations/__pycache__/0004_alter_post_author.cpython-313.pyc
diff --git a/imageuploader/posts/migrations/__pycache__/__init__.cpython-313.pyc b/imageuploader/pictures/migrations/__pycache__/__init__.cpython-313.pyc
similarity index 100%
rename from imageuploader/posts/migrations/__pycache__/__init__.cpython-313.pyc
rename to imageuploader/pictures/migrations/__pycache__/__init__.cpython-313.pyc
diff --git a/imageuploader/posts/models.py b/imageuploader/pictures/models.py
similarity index 93%
rename from imageuploader/posts/models.py
rename to imageuploader/pictures/models.py
index 6aafd6b..e255e6f 100644
--- a/imageuploader/posts/models.py
+++ b/imageuploader/pictures/models.py
@@ -1,7 +1,7 @@
 from django.db import models
 from django.contrib.auth.models import User
 
-class Post(models.Model):
+class Picture(models.Model):
     title = models.CharField(max_length=75)
     body = models.TextField()
     slug = models.SlugField()
diff --git a/imageuploader/posts/templates/posts/post_new.html b/imageuploader/pictures/templates/posts/picture_new.html
similarity index 60%
rename from imageuploader/posts/templates/posts/post_new.html
rename to imageuploader/pictures/templates/posts/picture_new.html
index 637fd62..11741b0 100644
--- a/imageuploader/posts/templates/posts/post_new.html
+++ b/imageuploader/pictures/templates/posts/picture_new.html
@@ -1,16 +1,16 @@
 {% extends 'layout.html' %}
 
 {% block title %}
-   New Post
+   New Picture
 {% endblock %}
 
 {% block content %}
     <section>
-        <h1>New Post</h1>
-        <form class="form-with-validation" action="{% url 'posts:new-post' %}" method="post" enctype="multipart/form-data">
+        <h1>New Picture</h1>
+        <form class="form-with-validation" action="{% url 'posts:new-picture' %}" method="post" enctype="multipart/form-data">
             {% csrf_token %} 
             {{ form }}
-            <button class="form-submit">Add Post</button>
+            <button class="form-submit">Add Picture</button>
         </form>
     </section>
 {% endblock %}
\ No newline at end of file
diff --git a/imageuploader/posts/templates/posts/post_page.html b/imageuploader/pictures/templates/posts/picture_page.html
similarity index 51%
rename from imageuploader/posts/templates/posts/post_page.html
rename to imageuploader/pictures/templates/posts/picture_page.html
index b2e965d..d828673 100644
--- a/imageuploader/posts/templates/posts/post_page.html
+++ b/imageuploader/pictures/templates/posts/picture_page.html
@@ -1,21 +1,21 @@
 {% extends 'layout.html' %}
 
 {% block title %}
-    {{ post.title }}
+    {{ picture.title }}
 {% endblock %}
 
 {% block content %}
     <section>
         <img 
             class="banner"
-            src="{{ post.banner.url }}"
-            alt="{{ post.title }}"
+            src="{{ picture.banner.url }}"
+            alt="{{ picture.title }}"
         />
         <h1>
-            {{ post.title }}
+            {{ picture.title }}
         </h1>
-        <p>{{ post.date }}</p>
-        <p>{{ post.body }}</p>
+        <p>{{ picture.date }}</p>
+        <p>{{ picture.body }}</p>
         
     </section>
 {% endblock %}
\ No newline at end of file
diff --git a/imageuploader/pictures/templates/posts/pictures_list.html b/imageuploader/pictures/templates/posts/pictures_list.html
new file mode 100644
index 0000000..b17308e
--- /dev/null
+++ b/imageuploader/pictures/templates/posts/pictures_list.html
@@ -0,0 +1,23 @@
+{% extends 'layout.html' %}
+
+{% block title %}
+    Pictures
+{% endblock %}
+
+{% block content %}
+    <section>
+    <h1>Pictures</h1>
+
+    {% for picture in pictures %}
+        <article class="post">
+            <h2>
+                <a href="{%  url 'pictures:page' slug=picture.slug %}">
+                    {{ picture.title }}
+                </a>
+            </h2>
+            <p>{{ picture.date }} by {{ picture.author }}</p>
+            <p>{{ picture.body }}</p>
+        </article>
+    {% endfor %}
+</section>
+{% endblock %}
\ No newline at end of file
diff --git a/imageuploader/posts/tests.py b/imageuploader/pictures/tests.py
similarity index 100%
rename from imageuploader/posts/tests.py
rename to imageuploader/pictures/tests.py
diff --git a/imageuploader/pictures/urls.py b/imageuploader/pictures/urls.py
new file mode 100644
index 0000000..2ea0e73
--- /dev/null
+++ b/imageuploader/pictures/urls.py
@@ -0,0 +1,11 @@
+from django.contrib import admin
+from django.urls import path
+from . import views
+
+app_name = "pictures"
+
+urlpatterns = [
+    path("", views.pictures_list, name="list"),
+    path('new-picture/', views.picture_new, name="new-picture"),
+    path("<slug:slug>", views.picture_page, name="page")
+]
\ No newline at end of file
diff --git a/imageuploader/pictures/views.py b/imageuploader/pictures/views.py
new file mode 100644
index 0000000..e5818e1
--- /dev/null
+++ b/imageuploader/pictures/views.py
@@ -0,0 +1,28 @@
+from django.shortcuts import render, redirect
+from .models import Post
+from django.contrib.auth.decorators import login_required
+from . import forms
+
+
+
+def pictures_list(request):
+    pictures = Post.objects.all().order_by('-date')
+    return render(request, 'posts/posts_list.html', {'pictures': pictures})
+
+
+def picture_page(request, slug):
+    picture = Post.objects.get(slug=slug)
+    return render(request, 'pictures/picture_page.html', {'picture': picture})
+
+@login_required(login_url="/users/login/")
+def picture_new(request):
+    if request.method == 'POST': 
+        form = forms.CreatePost(request.POST, request.FILES) 
+        if form.is_valid():
+            newpicture = form.save(commit=False) 
+            newpicture.author = request.user 
+            newpicture.save()
+            return redirect('pictures:list')
+    else:
+        form = forms.CreatePost()
+    return render(request, 'pictures/picture_new.html', { 'form': form })
\ No newline at end of file
diff --git a/imageuploader/posts/templates/posts/posts_list.html b/imageuploader/posts/templates/posts/posts_list.html
deleted file mode 100644
index 1fd39c2..0000000
--- a/imageuploader/posts/templates/posts/posts_list.html
+++ /dev/null
@@ -1,23 +0,0 @@
-{% extends 'layout.html' %}
-
-{% block title %}
-    Posts
-{% endblock %}
-
-{% block content %}
-    <section>
-    <h1>Posts</h1>
-
-    {% for post in posts %}
-        <article class="post">
-            <h2>
-                <a href="{%  url 'posts:page' slug=post.slug %}">
-                    {{ post.title }}
-                </a>
-            </h2>
-            <p>{{ post.date }} by {{ post.author }}</p>
-            <p>{{ post.body }}</p>
-        </article>
-    {% endfor %}
-</section>
-{% endblock %}
\ No newline at end of file
diff --git a/imageuploader/posts/urls.py b/imageuploader/posts/urls.py
deleted file mode 100644
index 930f131..0000000
--- a/imageuploader/posts/urls.py
+++ /dev/null
@@ -1,11 +0,0 @@
-from django.contrib import admin
-from django.urls import path
-from . import views
-
-app_name = "posts"
-
-urlpatterns = [
-    path("", views.posts_list, name="list"),
-    path('new-post/', views.post_new, name="new-post"),
-    path("<slug:slug>", views.post_page, name="page")
-]
\ No newline at end of file
diff --git a/imageuploader/posts/views.py b/imageuploader/posts/views.py
deleted file mode 100644
index 8676287..0000000
--- a/imageuploader/posts/views.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from django.shortcuts import render, redirect
-from .models import Post
-from django.contrib.auth.decorators import login_required
-from . import forms
-
-
-
-def posts_list(request):
-    posts = Post.objects.all().order_by('-date')
-    return render(request, 'posts/posts_list.html', {'posts': posts})
-
-
-def post_page(request, slug):
-    post = Post.objects.get(slug=slug)
-    return render(request, 'posts/post_page.html', {'post': post})
-
-@login_required(login_url="/users/login/")
-def post_new(request):
-    if request.method == 'POST': 
-        form = forms.CreatePost(request.POST, request.FILES) 
-        if form.is_valid():
-            newpost = form.save(commit=False) 
-            newpost.author = request.user 
-            newpost.save()
-            return redirect('posts:list')
-    else:
-        form = forms.CreatePost()
-    return render(request, 'posts/post_new.html', { 'form': form })
\ No newline at end of file
diff --git a/imageuploader/templates/layout.html b/imageuploader/templates/layout.html
index a3f76b8..d248ac0 100644
--- a/imageuploader/templates/layout.html
+++ b/imageuploader/templates/layout.html
@@ -21,11 +21,11 @@
             <span role="img" aria-label="About" title="About">😀</span>
         </a> | 
         {% if user.is_authenticated %}
-            <a href="{% url 'posts:list' %}">
-                <span role="img" aria-label="Posts" title="Posts">📰</span>
+            <a href="{% url 'pictures:list' %}">
+                <span role="img" aria-label="pictures" title="pictures">📰</span>
             </a> | 
-            <a href="{% url 'posts:new-post' %}">
-                <span role="img" aria-label="New Post" title="New Post">🆕</span>
+            <a href="{% url 'pictures:new-picture' %}">
+                <span role="img" aria-label="New picture" title="New picture">🆕</span>
             </a> | 
             <form class="logout" action="{% url 'users:logout' %}" method="post">
                 {% csrf_token %} 
-- 
GitLab