From e7b168e6bc7b237686a49f40cdc8e14add359b7b Mon Sep 17 00:00:00 2001 From: Pravin030399 Date: Wed, 22 May 2024 14:49:58 +0800 Subject: [PATCH 1/8] Test update --- contacts/test/__init__.py | 0 contacts/test/test_forms.py | 50 ++++++++++++++++++++++++++++++ contacts/test/test_models.py | 32 +++++++++++++++++++ contacts/test/test_urls.py | 34 ++++++++++++++++++++ contacts/test/test_views.py | 60 ++++++++++++++++++++++++++++++++++++ contacts/tests.py | 3 -- 6 files changed, 176 insertions(+), 3 deletions(-) create mode 100644 contacts/test/__init__.py create mode 100644 contacts/test/test_forms.py create mode 100644 contacts/test/test_models.py create mode 100644 contacts/test/test_urls.py create mode 100644 contacts/test/test_views.py delete mode 100644 contacts/tests.py diff --git a/contacts/test/__init__.py b/contacts/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/contacts/test/test_forms.py b/contacts/test/test_forms.py new file mode 100644 index 0000000..8d38243 --- /dev/null +++ b/contacts/test/test_forms.py @@ -0,0 +1,50 @@ +from django.test import TestCase +from contacts.form import ContactForm +from contacts.models import Contact + +class TestContactForm(TestCase): + + def test_contact_form_valid(self): + # Positive scenario data with actual users + form_data = { + 'name': 'Mashkur', + 'email': 'Mash@hotmail.com', + 'subject': 'Complaint', + 'message': 'Less menu items' + } + + # With valid data + form = ContactForm(data=form_data) + + # Form is valid + self.assertTrue(form.is_valid()) + + def test_contact_form_invalid_missing_email(self): + # Negative scenario data with actual users + invalid_data = { + 'name': 'Mashkur', + 'email': '', + 'subject': 'Complaint', + 'message': 'Less menu items' + } + + # With invalid data missing email + form = ContactForm(data=invalid_data) + + # Form is invalid + self.assertFalse(form.is_valid()) + + def test_contact_form_invalid_missing_name(self): + # Invalid data + invalid_data = { + 'name': '', + 'email': 'Mash@hotmail.com', + 'subject': 'Complaint', + 'message': 'Less menu items' + } + + # With invalid data missing name + form = ContactForm(data=invalid_data) + + # Form is invalid + self.assertFalse(form.is_valid()) \ No newline at end of file diff --git a/contacts/test/test_models.py b/contacts/test/test_models.py new file mode 100644 index 0000000..97d855d --- /dev/null +++ b/contacts/test/test_models.py @@ -0,0 +1,32 @@ +from django.test import TestCase +from contacts.models import Contact + +class TestContactModel(TestCase): + + def test_contact_creation(self): + # Verifying input field by creating a contact + contact = Contact.objects.create( + name='Pravin Kannappan', + email='irpravin@gmail.com', + subject='Enquiry', + message='How long does it take for delivery' + ) + + # Verify if the contact was created successfully + self.assertIsNotNone(contact) + self.assertEqual(contact.name, 'Pravin Kannappan') + self.assertEqual(contact.email, 'irpravin@gmail.com') + self.assertEqual(contact.subject, 'Enquiry') + self.assertEqual(contact.message, 'How long does it take for delivery') + + def test_contact_str_representation(self): + # Verifying input field by creating a contact + contact = Contact.objects.create( + name='RajiniKanth', + email='RajiniKanth@gmail.com', + subject='Enquiry', + message='How long does it take for delivery' + ) + + # Check if the __str__ method returns the expected string representation + self.assertEqual(str(contact), 'RajiniKanth') \ No newline at end of file diff --git a/contacts/test/test_urls.py b/contacts/test/test_urls.py new file mode 100644 index 0000000..b88d786 --- /dev/null +++ b/contacts/test/test_urls.py @@ -0,0 +1,34 @@ +# from django.test import TestCase + +# # Create your tests here. +# class TestUrls (TestCase): + +# def test_list_url(self): +# assert 1==2 + +from django.test import TestCase +from django.urls import reverse, resolve +from contacts.views import ViewContactView, ViewAbouttView + +# Create your tests here. +class TestUrls_contact_us(TestCase): + + # Checks if the URL for the "view-contact" view resolves correctly + def test_view_contact_url_resolves(self): + url = reverse('contacts:view-contact') + self.assertEqual(resolve(url).func.view_class, ViewContactView) + + # Checks that the URL for the "view-about" view resolves correctly + def test_view_about_url_resolves(self): + url = reverse('contacts:view-about') + self.assertEqual(resolve(url).func.view_class, ViewAbouttView) + + # Checks if the correct template is used when accessing the view-contact URL + def test_view_contact_template(self): + response = self.client.get(reverse('contacts:view-contact')) + self.assertTemplateUsed(response, 'contact.html') + + # Checks if the correct template is used when accessing the view-about URL + def test_view_about_template(self): + response = self.client.get(reverse('contacts:view-about')) + self.assertTemplateUsed(response, 'about.html') \ No newline at end of file diff --git a/contacts/test/test_views.py b/contacts/test/test_views.py new file mode 100644 index 0000000..269b253 --- /dev/null +++ b/contacts/test/test_views.py @@ -0,0 +1,60 @@ +from django.test import TestCase, Client +from django.urls import reverse +from django.core import mail +from contacts.form import ContactForm +from contacts.models import Contact + +class TestContactView(TestCase): + + def setUp(self): + self.client = Client() + self.view_contact_url = reverse('contacts:view-contact') + self.view_about_url = reverse('contacts:view-about') + self.valid_form_data = { + 'name': 'Pravin', + 'email': 'irpravin@gmail.com', + 'subject': 'Compliment', + 'message': 'Food was good' + } + + def test_view_contact_get(self): + # Verify GET request + response = self.client.get(self.view_contact_url) + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, 'contact.html') + self.assertIsInstance(response.context['form'], ContactForm) + + def test_view_contact_post_valid_form(self): + # Verify valid POST request + response = self.client.post(self.view_contact_url, data=self.valid_form_data) + self.assertEqual(response.status_code, 302) # Redirect status code + self.assertRedirects(response, self.view_contact_url) + + # Verify that the form was saved upon sending + self.assertEqual(Contact.objects.count(), 1) + + # Verify if the an email was sent after post request + self.assertEqual(len(mail.outbox), 1) + self.assertEqual(mail.outbox[0].subject, 'Compliment') + + def test_view_contact_post_invalid_form(self): + # Verify if invalid POST request (missing required fields) + invalid_data = self.valid_form_data.copy() + invalid_data['email'] = '' # Email is required (Empty string) + response = self.client.post(self.view_contact_url, data=invalid_data) + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, 'contact.html') + self.assertFalse(response.context['form'].is_valid()) + self.assertEqual(Contact.objects.count(), 0) # No contact should be saved + self.assertEqual(len(mail.outbox), 0) # No email should be sent + +class TestAboutView(TestCase): + # Verifying by setting up client defining URL for the about view + def setUp(self): + self.client = Client() + self.view_about_url = reverse('contacts:view-about') + # Verify the response status code is 200 (indicating success), and verifies that the correct template + def test_view_about_get(self): + response = self.client.get(self.view_about_url) + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, 'about.html') \ No newline at end of file diff --git a/contacts/tests.py b/contacts/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/contacts/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. From 924af506b4f96cc769b12408dee55fa2b4b2540d Mon Sep 17 00:00:00 2001 From: Afrar Malakooth Date: Sat, 25 May 2024 11:36:46 +0800 Subject: [PATCH 2/8] Address pull request review comments --- .github/workflows/django.yml | 1 + .vscode/launch.json | 14 ++++++++++ contacts/test/test_urls.py | 34 ------------------------- contacts/{test => tests}/__init__.py | 0 contacts/{test => tests}/test_forms.py | 7 ++--- contacts/{test => tests}/test_models.py | 3 ++- contacts/{test => tests}/test_views.py | 15 +++++++---- yummy/.env.actions | 5 ++++ 8 files changed, 36 insertions(+), 43 deletions(-) create mode 100644 .vscode/launch.json delete mode 100644 contacts/test/test_urls.py rename contacts/{test => tests}/__init__.py (100%) rename contacts/{test => tests}/test_forms.py (93%) rename contacts/{test => tests}/test_models.py (95%) rename contacts/{test => tests}/test_views.py (87%) create mode 100644 yummy/.env.actions diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index e412a5f..9daa6d3 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -25,6 +25,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + ln -f -s ./yummy/.env.actions ./yummy/.env - name: Run Tests env: SECRET_KEY: ${{ secrets.SECRET_KEY }} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c16bdc9 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + "configurations": [ + { + "name": "Python Debugger: Django", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/manage.py", + "args": [ + "runserver" + ], + "django": true + } + ] +} \ No newline at end of file diff --git a/contacts/test/test_urls.py b/contacts/test/test_urls.py deleted file mode 100644 index b88d786..0000000 --- a/contacts/test/test_urls.py +++ /dev/null @@ -1,34 +0,0 @@ -# from django.test import TestCase - -# # Create your tests here. -# class TestUrls (TestCase): - -# def test_list_url(self): -# assert 1==2 - -from django.test import TestCase -from django.urls import reverse, resolve -from contacts.views import ViewContactView, ViewAbouttView - -# Create your tests here. -class TestUrls_contact_us(TestCase): - - # Checks if the URL for the "view-contact" view resolves correctly - def test_view_contact_url_resolves(self): - url = reverse('contacts:view-contact') - self.assertEqual(resolve(url).func.view_class, ViewContactView) - - # Checks that the URL for the "view-about" view resolves correctly - def test_view_about_url_resolves(self): - url = reverse('contacts:view-about') - self.assertEqual(resolve(url).func.view_class, ViewAbouttView) - - # Checks if the correct template is used when accessing the view-contact URL - def test_view_contact_template(self): - response = self.client.get(reverse('contacts:view-contact')) - self.assertTemplateUsed(response, 'contact.html') - - # Checks if the correct template is used when accessing the view-about URL - def test_view_about_template(self): - response = self.client.get(reverse('contacts:view-about')) - self.assertTemplateUsed(response, 'about.html') \ No newline at end of file diff --git a/contacts/test/__init__.py b/contacts/tests/__init__.py similarity index 100% rename from contacts/test/__init__.py rename to contacts/tests/__init__.py diff --git a/contacts/test/test_forms.py b/contacts/tests/test_forms.py similarity index 93% rename from contacts/test/test_forms.py rename to contacts/tests/test_forms.py index 8d38243..286cb3a 100644 --- a/contacts/test/test_forms.py +++ b/contacts/tests/test_forms.py @@ -2,6 +2,7 @@ from contacts.form import ContactForm from contacts.models import Contact + class TestContactForm(TestCase): def test_contact_form_valid(self): @@ -23,7 +24,7 @@ def test_contact_form_invalid_missing_email(self): # Negative scenario data with actual users invalid_data = { 'name': 'Mashkur', - 'email': '', + 'email': '', 'subject': 'Complaint', 'message': 'Less menu items' } @@ -35,7 +36,7 @@ def test_contact_form_invalid_missing_email(self): self.assertFalse(form.is_valid()) def test_contact_form_invalid_missing_name(self): - # Invalid data + # Invalid data invalid_data = { 'name': '', 'email': 'Mash@hotmail.com', @@ -47,4 +48,4 @@ def test_contact_form_invalid_missing_name(self): form = ContactForm(data=invalid_data) # Form is invalid - self.assertFalse(form.is_valid()) \ No newline at end of file + self.assertFalse(form.is_valid()) diff --git a/contacts/test/test_models.py b/contacts/tests/test_models.py similarity index 95% rename from contacts/test/test_models.py rename to contacts/tests/test_models.py index 97d855d..7fea8fb 100644 --- a/contacts/test/test_models.py +++ b/contacts/tests/test_models.py @@ -1,6 +1,7 @@ from django.test import TestCase from contacts.models import Contact + class TestContactModel(TestCase): def test_contact_creation(self): @@ -29,4 +30,4 @@ def test_contact_str_representation(self): ) # Check if the __str__ method returns the expected string representation - self.assertEqual(str(contact), 'RajiniKanth') \ No newline at end of file + self.assertEqual(str(contact), 'RajiniKanth') diff --git a/contacts/test/test_views.py b/contacts/tests/test_views.py similarity index 87% rename from contacts/test/test_views.py rename to contacts/tests/test_views.py index 269b253..98c7874 100644 --- a/contacts/test/test_views.py +++ b/contacts/tests/test_views.py @@ -4,6 +4,7 @@ from contacts.form import ContactForm from contacts.models import Contact + class TestContactView(TestCase): def setUp(self): @@ -26,7 +27,8 @@ def test_view_contact_get(self): def test_view_contact_post_valid_form(self): # Verify valid POST request - response = self.client.post(self.view_contact_url, data=self.valid_form_data) + response = self.client.post( + self.view_contact_url, data=self.valid_form_data) self.assertEqual(response.status_code, 302) # Redirect status code self.assertRedirects(response, self.view_contact_url) @@ -42,19 +44,22 @@ def test_view_contact_post_invalid_form(self): invalid_data = self.valid_form_data.copy() invalid_data['email'] = '' # Email is required (Empty string) response = self.client.post(self.view_contact_url, data=invalid_data) - self.assertEqual(response.status_code, 200) + self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, 'contact.html') self.assertFalse(response.context['form'].is_valid()) - self.assertEqual(Contact.objects.count(), 0) # No contact should be saved + # No contact should be saved + self.assertEqual(Contact.objects.count(), 0) self.assertEqual(len(mail.outbox), 0) # No email should be sent + class TestAboutView(TestCase): # Verifying by setting up client defining URL for the about view def setUp(self): self.client = Client() self.view_about_url = reverse('contacts:view-about') - # Verify the response status code is 200 (indicating success), and verifies that the correct template + # Verify the response status code is 200 (indicating success), and verifies that the correct template + def test_view_about_get(self): response = self.client.get(self.view_about_url) self.assertEqual(response.status_code, 200) - self.assertTemplateUsed(response, 'about.html') \ No newline at end of file + self.assertTemplateUsed(response, 'about.html') diff --git a/yummy/.env.actions b/yummy/.env.actions new file mode 100644 index 0000000..5d2d020 --- /dev/null +++ b/yummy/.env.actions @@ -0,0 +1,5 @@ +SECRET_KEY=3n4bu#vp^8b3=8^bq=r@0d_8j@g@^h4nu_d32x!6$8dqabnh7^ +DATABASE_URL=sqlite://:memory: + +EMAIL_HOST_USER=host_user +EMAIL_HOST_PASSWORD=host_password From 1cef6eda055bffc2474e89c29dcb7d9f5ba971a7 Mon Sep 17 00:00:00 2001 From: Afrar Malakooth Date: Sat, 25 May 2024 11:44:59 +0800 Subject: [PATCH 3/8] Upgrade GitHub Actions version and remove Run Tests env --- .github/workflows/django.yml | 9 ++------- .vscode/launch.json | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 9daa6d3..72022fd 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -16,9 +16,9 @@ jobs: python-version: ['3.10'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies @@ -27,10 +27,5 @@ jobs: pip install -r requirements.txt ln -f -s ./yummy/.env.actions ./yummy/.env - name: Run Tests - env: - SECRET_KEY: ${{ secrets.SECRET_KEY }} - DATABASE_URL: ${{ secrets.DATABASE_URL }} - EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }} - EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }} run: | python manage.py test diff --git a/.vscode/launch.json b/.vscode/launch.json index c16bdc9..4842e1d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,4 +11,4 @@ "django": true } ] -} \ No newline at end of file +} From 5794c3d7e26968784a838728b3d4c1d6dfbee84a Mon Sep 17 00:00:00 2001 From: Afrar Malakooth Date: Sat, 25 May 2024 11:50:37 +0800 Subject: [PATCH 4/8] Add back the SECRET_KEY environment variable --- .github/workflows/django.yml | 2 ++ yummy/.env.actions | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 72022fd..5c0e41e 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -27,5 +27,7 @@ jobs: pip install -r requirements.txt ln -f -s ./yummy/.env.actions ./yummy/.env - name: Run Tests + env: + SECRET_KEY: ${{ secrets.SECRET_KEY }} run: | python manage.py test diff --git a/yummy/.env.actions b/yummy/.env.actions index 5d2d020..e2aaedf 100644 --- a/yummy/.env.actions +++ b/yummy/.env.actions @@ -1,4 +1,3 @@ -SECRET_KEY=3n4bu#vp^8b3=8^bq=r@0d_8j@g@^h4nu_d32x!6$8dqabnh7^ DATABASE_URL=sqlite://:memory: EMAIL_HOST_USER=host_user From 426b1cd6b6bdb452336d53ffb8778e29652f279a Mon Sep 17 00:00:00 2001 From: Afrar Malakooth Date: Sat, 25 May 2024 11:54:15 +0800 Subject: [PATCH 5/8] Add back EMAIL_HOST_USER and EMAIL_HOST_PASSWORD env params --- .github/workflows/django.yml | 2 ++ yummy/.env.actions | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 5c0e41e..6c152f6 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -29,5 +29,7 @@ jobs: - name: Run Tests env: SECRET_KEY: ${{ secrets.SECRET_KEY }} + EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }} + EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }} run: | python manage.py test diff --git a/yummy/.env.actions b/yummy/.env.actions index e2aaedf..9171a79 100644 --- a/yummy/.env.actions +++ b/yummy/.env.actions @@ -1,4 +1 @@ DATABASE_URL=sqlite://:memory: - -EMAIL_HOST_USER=host_user -EMAIL_HOST_PASSWORD=host_password From 5441eaa910ed0daeb2f8ecad32c52cd5133de792 Mon Sep 17 00:00:00 2001 From: Afrar Malakooth Date: Sat, 25 May 2024 12:01:51 +0800 Subject: [PATCH 6/8] Add DATABASE_URL env param and remove .env.actions --- .github/workflows/django.yml | 3 ++- yummy/.env.actions | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 yummy/.env.actions diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 6c152f6..b2c4aca 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -25,11 +25,12 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - ln -f -s ./yummy/.env.actions ./yummy/.env - name: Run Tests env: SECRET_KEY: ${{ secrets.SECRET_KEY }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }} EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }} run: | + echo ${{ secrets.DATABASE_URL }} python manage.py test diff --git a/yummy/.env.actions b/yummy/.env.actions deleted file mode 100644 index 9171a79..0000000 --- a/yummy/.env.actions +++ /dev/null @@ -1 +0,0 @@ -DATABASE_URL=sqlite://:memory: From 7fa88ac7003eb70d6f7ce163639348d06702ca1d Mon Sep 17 00:00:00 2001 From: Afrar Malakooth Date: Sat, 25 May 2024 12:40:40 +0800 Subject: [PATCH 7/8] Update project requirements and settings --- requirements.txt | 1 - users/urls.py | 12 ++++++------ yummy/settings.py | 19 ++++--------------- yummy/urls.py | 7 +------ 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/requirements.txt b/requirements.txt index 89a206e..ca89885 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,5 +8,4 @@ psycopg==3.1.18 psycopg-binary==3.1.18 sqlparse==0.4.4 typing_extensions==4.11.0 -tzdata==2024.1 whitenoise==6.6.0 diff --git a/users/urls.py b/users/urls.py index 3d4b6a3..07b346f 100644 --- a/users/urls.py +++ b/users/urls.py @@ -1,6 +1,6 @@ from django.urls import path from . import views -from .views import home, RegisterView, CustomLoginView, update_user +from .views import RegisterView, CustomLoginView, update_user from django.contrib.auth import views as auth_views @@ -11,16 +11,16 @@ urlpatterns = [ path( - "profile-management", views.ViewUserProfileView.as_view(), name="view-profile" + "profile", views.ViewUserProfileView.as_view(), name="view-profile" ), - path("edit-management", update_user, name="edit-profile"), + path("profile/edit", update_user, name="edit-profile"), - path("register/", RegisterView.as_view(), name="users-register"), + path("register", RegisterView.as_view(), name="users-register"), path( - "login/", + "login", CustomLoginView.as_view( redirect_authenticated_user=True, template_name="login.html", @@ -29,5 +29,5 @@ name="login", ), - path("logout/", auth_views.LogoutView.as_view(), name="logout"), + path("logout", auth_views.LogoutView.as_view(), name="logout"), ] diff --git a/yummy/settings.py b/yummy/settings.py index c60e696..1b5386e 100644 --- a/yummy/settings.py +++ b/yummy/settings.py @@ -143,28 +143,17 @@ BASE_DIR / "static" ] -# added by mash - +# Image uploads MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/' -EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' -# ended by mash - -# added by naqibullah : if user is admin after log - - -# if user is customer -LOGIN_REDIRECT_URL = '/' - -# if the user is admin ? -# LOGIN_REDIRECT_URL = '/dashboard' - +# User authentication LOGIN_URL = 'users/login' +LOGIN_REDIRECT_URL = '/' # if the user is Customer +# LOGIN_REDIRECT_URL = '/dashboard' # if the user is Admin LOGOUT_REDIRECT_URL = '/' -# added by naqibullah finished # Default primary key field type # https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field diff --git a/yummy/urls.py b/yummy/urls.py index a6fe6ba..193cf10 100644 --- a/yummy/urls.py +++ b/yummy/urls.py @@ -23,10 +23,6 @@ from django.conf.urls.static import static -from django.contrib.auth import views as auth_views -from users.views import CustomLoginView - -from users.forms import LoginForm urlpatterns = [ path('', views.index, name='index'), @@ -38,6 +34,5 @@ path('menus/', include(('menus.urls', 'menus'), namespace='menus')), path('orders/', include(('orders.urls', 'orders'), namespace='orders')), path('contacts/', include(('contacts.urls', 'contacts'), namespace='contacts')), - + ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -# ended by mash From 39bcdbca31117f8632fb3d7385e387930a6ec25d Mon Sep 17 00:00:00 2001 From: Afrar Malakooth Date: Sat, 25 May 2024 12:52:19 +0800 Subject: [PATCH 8/8] Remove echo DATABASE_URL command --- .github/workflows/django.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index b2c4aca..acf22c6 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -32,5 +32,4 @@ jobs: EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }} EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }} run: | - echo ${{ secrets.DATABASE_URL }} python manage.py test