Tuesday, March 31, 2020

NoReverseMatch error message - Please help

I am putting together a website which has a photo gallery where users can add comments. When I go to the photo gallery page, I get the following error message:

NoReverseMatch at /photo_feed/ Reverse for 'add_comment' with arguments '('',)' not found. 1 pattern(s) tried: ['add_comment/$']

The code for the relevant part of the HTML document is as follows:

<h2>comments</h2>
{% if not comments %}
No comments
{% endif %}
{% for x in comment %}
<div class="comments" style="padding: 10px;">
<p class="font-weight-bold">
<h4>Comment by</h4> {{ x.user }}
<span class=" text-muted font-weight-normal">
{{ x.created_on }}
</span>
</p>
{{ x.body | linebreaks }}
</div>
{% endfor %}
</div>
<div class="card-body">
{% if new_comment %}
<h2>Your comment has been posted.</h2>
{% else %}
<h3>Leave a comment</h3>
<form action="{% url 'nowandthen:add_comment' image.id %}" method="POST">
{{ comment_form.as_p }}
{% csrf_token %}
<button type="submit" class="btn btn-primary btn-lg">Submit</button>
{% endif %}
The URLs.py entry for add_comment is path('add_comment/<int: image_id>', views.add_comment, name='add_comment'). Removing the int: image_id doesn't fix the problem.

When I go into admin, no ids appear to have been generated for the photos. Could it be that the problem is that there are missing IDs? If so, how do I fix this?

The repository URL is https://github.com/EmilyQuimby/my_now_and_then.

Thank you.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bb078990-f0e1-484a-a3dc-366f018b1df6%40googlegroups.com.

Problem to make billing

Dear all, i am developing Resturat Management system. I made models for all. I made a static webpage for billing using ajax. I have beverage and dishes model. Now i need to develop, sn with is auto increment as per items, bevereage/dishes items to select and type, rate as per items, qty should type as i know it i can do, total which must be calculate as per qty * rate, sub total and discount with grand total as per table number. Can ayone help me out.

Capture.PNG



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0bd51f63-97c2-4c61-aadd-b4bf50139672%40googlegroups.com.

Re:

Search for one to one databass relationships ..
Also checkout extending user model by making a one to one realationship with profile model

On Tue, 31 Mar 2020, 11:25 am fahad rasool, <rasoolfahad630@gmail.com> wrote:
I am having a user model ( which include username,user email and password) and have another model user_detail . I want to add username column to user_ detail and want to show the details of that username who have logged in and filled the details..
How can i do this?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmBXCDeVV%3DX72zBk7ip%2B0-QXE81w88Szr43GjwBHMiPCrQ%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHV4E-euRiPmfb6Y5v9m72BtGS9%3DjByfvjNs1MpJFJcXsBy8Gw%40mail.gmail.com.
I am having a user model ( which include username,user email and password) and have another model user_detail . I want to add username column to user_ detail and want to show the details of that username who have logged in and filled the details..
How can i do this?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACqgSmBXCDeVV%3DX72zBk7ip%2B0-QXE81w88Szr43GjwBHMiPCrQ%40mail.gmail.com.

Hey can anyone help me how do I create such a gallery like spotify?

Screenshot from 2020-03-31 12-45-54.png

Screenshot from 2020-03-31 12-45-39.png

So I am doing a project where I want to upload pictures. I have done all the backends for uploading pictures, but I want to create a view for displaying those images. I want the thing to be like spotify's image gallery. First, there will be a collage of photos and after selecting a photo, a modal will appear where you can see each image.

How can I do so? any ideas will be much much appreciated.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6c690d3f-120e-4a56-a1af-fd84200a6cd5%40googlegroups.com.

Monday, March 30, 2020

Re: Extending Django admin delete confirmation page

Hi, Gagan.

Try removing the "admin:" from your instruction: `{% extends "admin/delete_confirmation.html" %}`

Here is the template with a possible blocks that you might overwrite: https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/delete_confirmation.html

Cheers.


Em seg., 30 de mar. de 2020 às 23:20, Gagan Deep <the.one.above.all.titan@gmail.com> escreveu:
Greetings,

I am wondering if it is possible to extend Django Admin's delete confirmation page. I tried the following but the received template does not exist error page.
% extends 'admin:admin/delete_confirmation.html' %}
I refer to this website which stated it is possible to do so https://book.huihoo.com/django/en/1.0/chapter17/index.html
I want to add a few custom actions which should require confirmation before proceeding. 

Thanks and Regards
Gagan Deep

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c71f8c6c-c218-4dbc-ab4f-6c5c814d5a3a%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE89-bcfPg9oTJGfy%2B4Hi1oAipJK5NTjuVkHvm9UVOM%3D0JURMw%40mail.gmail.com.

Re: HTML code not being read

Did you connect your template folder on settings.py ?

Sent from my iPhone

On Mar 30, 2020, at 11:06 PM, Aly_34_04 MR_34_04 <allaberdi16yazhanow@gmail.com> wrote:

show me your views 

On Monday, March 30, 2020 at 5:13:49 PM UTC+3, Jeff Waters wrote:
Hi

I have written some code that allows users of a website to comment on photos in a picture gallery, using a form. However, when I test the code, no comments are displayed.

It would appear that Django is not processing the following code (from my HTML file for the photo gallery), given that 'Comment by' is not displayed on screen:

            {% for comment in comments %}
            <div class="comments" style="padding: 10px;">
                <p class="font-weight-bold">
                    <h4>Comment by</h4> {{ comment.user }}
                    <span class=" text-muted font-weight-normal">
                        {{ comment.created_on }}
                    </span>
                </p>
                {{ comment.body | linebreaks }}
            </div>
            {% endfor %}

Does anyone have any suggestions as to how I can fix this, please?

Thank you.

Jeff

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/85705553-9cd4-49e2-878e-8c0a903bc79f%40googlegroups.com.