Tuesday, March 31, 2020

Re: Associating comments with images

Add the photo id to the url - so instead of having the form like this:
<form action="{% url 'nowandthen:add_comment'%}" method="POST">

you add it like this:
 <form action="{% url 'nowandthen:add_comment' photo_id %}" method="POST">

and make sure that the photo_id variable is in the current context and that the comment view accepts an id.

Regards,

Andréas


Den tis 31 mars 2020 kl 16:58 skrev Jeff Waters <watersjg@gmail.com>:
I am creating a website where users can comment on photos in a gallery. The challenge I currently have is that Django is not able to determine which of the photos the comment 'submit' button relates to.

This is my HTML code for the photo gallery:

        <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'%}" method="POST">
                    {{ comment_form.as_p }}
                    {% csrf_token %}
                    <button type="submit" class="btn btn-primary  btn-lg">Submit</button>
                {% endif %}

How do you suggest I overcome this problem, please?

Thanks

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/cabe2b94-bf00-4394-b699-8a15d48247d2%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/CAK4qSCcYWsEjhdP%3DxLOMUeUPmeH6RssocH48L7v%3DMhHJf11-3g%40mail.gmail.com.

Re: Error loading psycopg2 module: No module named 'psycopg2'

On 1/04/2020 11:56 am, Mike Dewhirst wrote:
> On 1/04/2020 10:53 am, Umar Abdulsattar wrote:
>> Hello fellows currently i am learning django and try to build and
>> single webpage and also try to connect with postgresql but using
>> adopter psycopg2 i face some problems like i find this error
>>
>>  " File "C:\Program Files
>> (x86)\Python37-32\lib\site-packages\django\db\backends\postgresql\base.py",
>> line 24, in <module>
>>     raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
>> django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
>> module: No module named 'psycopg2'"
>
> You need to install the psycopg2 module. For Windows you need a
> pre-compiled binary. In your case it looks like the 32-bit version.
>
> Visit the very generous Christophe Gohlke's page of pre-compiled
> binary install kits for Windows at ..
>
> https://www.lfd.uci.edu/~gohlke/pythonlibs/

Maybe I should have pointed out that the install kit from that page you
probably want to download is ...

psycopg2‑2.8.4‑cp37‑cp37m‑win32.whl

The next step is to install it. Try this ...

>pip install --upgrade
%USERPROFILE%\Downloads\psycopg2‑2.8.4‑cp37‑cp37m‑win32.whl

... where %USERPROFILE% is (usually) substituted with your Windows home
directory. In my case it is C:\Users\Mike



> You should bookmark that page.
>
> Cheers
>
> Mike
>
>>
>> Kindly guide me how i can fix it .
>>
>> 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
>> <mailto:django-users+unsubscribe@googlegroups.com>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/fabd9a82-b3de-4bab-923d-5366eee2dec4%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/fabd9a82-b3de-4bab-923d-5366eee2dec4%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>
>

--
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/61aa0eb3-f71c-b9e7-c2a3-a0860ab4c088%40dewhirst.com.au.

Re: Error loading psycopg2 module: No module named 'psycopg2'

On 1/04/2020 10:53 am, Umar Abdulsattar wrote:
> Hello fellows currently i am learning django and try to build and
> single webpage and also try to connect with postgresql but using
> adopter psycopg2 i face some problems like i find this error
>
>  " File "C:\Program Files
> (x86)\Python37-32\lib\site-packages\django\db\backends\postgresql\base.py",
> line 24, in <module>
>     raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading psycopg2
> module: No module named 'psycopg2'"

You need to install the psycopg2 module. For Windows you need a
pre-compiled binary. In your case it looks like the 32-bit version.

Visit the very generous Christophe Gohlke's page of pre-compiled binary
install kits for Windows at ..

https://www.lfd.uci.edu/~gohlke/pythonlibs/

You should bookmark that page.

Cheers

Mike

>
> Kindly guide me how i can fix it .
>
> 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
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/fabd9a82-b3de-4bab-923d-5366eee2dec4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/fabd9a82-b3de-4bab-923d-5366eee2dec4%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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/e9856bf9-484a-6f7b-f735-0529fab5c61e%40dewhirst.com.au.

Error loading psycopg2 module: No module named 'psycopg2'

Hello fellows currently i am learning django and try to build and single webpage and also try to connect with postgresql but using adopter psycopg2 i face some problems like i find this error

 " File "C:\Program Files (x86)\Python37-32\lib\site-packages\django\db\backends\postgresql\base.py", line 24, in <module>
    raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'"

Kindly guide me how i can fix it .

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/fabd9a82-b3de-4bab-923d-5366eee2dec4%40googlegroups.com.

Re: Multiple Image Field in a model

This is how exactly you could solve it. Multiple FIle Upload

On Monday, September 26, 2011 at 7:32:51 PM UTC+5:30, NavaTux wrote:
Hi all,

       I have a filed(ImageField) in my model.Also I want to have
multiple ImageFields.How to have more than one ImageFields only in
django model.Is there any need to derive that ImageField as a seperate
new model which holds as a foreign key of another one?

This is my model:

class Report(models.Model):
    name = models.CharField(max_length=1024)
    data = models.TextField()
    image = models.ImageField(upload_to=settings.IMAGE_UPLOAD_PATH,
blank=True, null=True)

I need to display atleast 4 imagefields for this model object?

--
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/34bcc2f5-0a5e-4aff-85b2-78fb7cdc0c10%40googlegroups.com.

Re: CSS doesnt work deployed on Pythonanywhere

Thanks for the heads up. Will check and update the status if found.

Regards.

On Tue, Mar 31, 2020 at 2:24 PM Motaz Hejaze <trapperx.1@gmail.com> wrote:
I remember that in pythonanywhere you need to tell the platform where you app folder is and where your static folder is ... 

You can do that from your account control panel i think ..

On Tue, 31 Mar 2020, 11:07 pm Alexis Soko, <alexissoko@gmail.com> wrote:
Hi. thanks for the answer.

Yes I have an app/static/css folder with the app.css file  and {% load static %} at the beginning of the html.

On Tue, Mar 31, 2020 at 1:48 PM Aly_34_04 MR_34_04 <allaberdi16yazhanow@gmail.com> wrote:
did you load css on your static files?

On Tuesday, March 31, 2020 at 10:54:59 PM UTC+3, Alexis Soko wrote:
Really simple stuff. webpage navbar looks propper locally. But when deployed the navbar loses font and goes vertical. Checked Django and bootstrap installed versions on both,
Any thoughts? This is my first project on Django.

Thanks for your help.
Alexis.

--
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/68b20efc-b30f-4964-ba56-ff0dd2e7a6b9%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/CAPVXFAQY%2BOTVoG30xBXb%3Deqm_kGkD9W1i7S-HQ472DtSrCx3kw%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-fM6ZNnmhzHzC4eAJK9AaS2LKGgg%3DpxagUGDadn%3DLR9Og%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/CAPVXFAQYFq0M69xjctDBA7bvWVoqB1%3DQYsui%2B8xvTSWDyfQkfw%40mail.gmail.com.

Re: CSS doesnt work deployed on Pythonanywhere

I remember that in pythonanywhere you need to tell the platform where you app folder is and where your static folder is ... 

You can do that from your account control panel i think ..

On Tue, 31 Mar 2020, 11:07 pm Alexis Soko, <alexissoko@gmail.com> wrote:
Hi. thanks for the answer.

Yes I have an app/static/css folder with the app.css file  and {% load static %} at the beginning of the html.

On Tue, Mar 31, 2020 at 1:48 PM Aly_34_04 MR_34_04 <allaberdi16yazhanow@gmail.com> wrote:
did you load css on your static files?

On Tuesday, March 31, 2020 at 10:54:59 PM UTC+3, Alexis Soko wrote:
Really simple stuff. webpage navbar looks propper locally. But when deployed the navbar loses font and goes vertical. Checked Django and bootstrap installed versions on both,
Any thoughts? This is my first project on Django.

Thanks for your help.
Alexis.

--
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/68b20efc-b30f-4964-ba56-ff0dd2e7a6b9%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/CAPVXFAQY%2BOTVoG30xBXb%3Deqm_kGkD9W1i7S-HQ472DtSrCx3kw%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-fM6ZNnmhzHzC4eAJK9AaS2LKGgg%3DpxagUGDadn%3DLR9Og%40mail.gmail.com.

Re: CSS doesnt work deployed on Pythonanywhere

Hi. thanks for the answer.

Yes I have an app/static/css folder with the app.css file  and {% load static %} at the beginning of the html.

On Tue, Mar 31, 2020 at 1:48 PM Aly_34_04 MR_34_04 <allaberdi16yazhanow@gmail.com> wrote:
did you load css on your static files?

On Tuesday, March 31, 2020 at 10:54:59 PM UTC+3, Alexis Soko wrote:
Really simple stuff. webpage navbar looks propper locally. But when deployed the navbar loses font and goes vertical. Checked Django and bootstrap installed versions on both,
Any thoughts? This is my first project on Django.

Thanks for your help.
Alexis.

--
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/68b20efc-b30f-4964-ba56-ff0dd2e7a6b9%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/CAPVXFAQY%2BOTVoG30xBXb%3Deqm_kGkD9W1i7S-HQ472DtSrCx3kw%40mail.gmail.com.

Re: CSS doesnt work deployed on Pythonanywhere

did you load css on your static files?

On Tuesday, March 31, 2020 at 10:54:59 PM UTC+3, Alexis Soko wrote:
Really simple stuff. webpage navbar looks propper locally. But when deployed the navbar loses font and goes vertical. Checked Django and bootstrap installed versions on both,
Any thoughts? This is my first project on Django.

Thanks for your help.
Alexis.

--
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/68b20efc-b30f-4964-ba56-ff0dd2e7a6b9%40googlegroups.com.

Template Variables

I am writing a simple web app, and I am struggling to access my variable attributes in one of my templates. The get_object_or_404 method returns my customized 404 error from my content_detail.html file: "No content is available." 

Here are my files:

archive/archive/urls.py:

from django.contrib import admin
from django.urls import include, path
from django.views.generic import RedirectView
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('posts/', include('posts.urls')),
    path('admin/', admin.site.urls),
    path('', RedirectView.as_view(url='posts/', permanent=True)),] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

archive/posts/urls.py:

from django.urls import path

from . import views

app_name = 'posts'

urlpatterns = [
    path('', views.index, name='index'),
    path('<int:pk>/', views.ContentDetailView.as_view(), name='content-detail'),
]

archive/posts/models.py:

import datetime

from django.db import models
from django.utils import timezone
import uuid

class Content(models.Model):
    content_head = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')

    class Meta:
        verbose_name_plural='contents'

    def __str__(self):
        return self.content_head

    def get_absolute_url(self):
        return reverse('detail', args=[str(self.id)])

class ContentInstance(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    content = models.ForeignKey(Content, on_delete=models.SET_NULL, null=True)
    content_body = models.TextField()

    def __str__(self):
        return f'{self.id}, {self.content.pub_date}'

archive/posts/views.py:

from django.shortcuts import render, get_object_or_404

from .models import Content, ContentInstance
from django.views import generic

def index(request):
    archive_list = Content.objects.order_by('-pub_date')[:5]
    context = {'archive_list': archive_list}
    return render(request, 'posts/index.html', context)

class ContentDetailView(generic.DetailView):
    model = Content

def content_detail_view(request, primary_key):    
    content = get_object_or_404(Content, pk=primary_key)
    return render(request, 'posts/detail.html', context={'content':content})

archive/posts/templates/posts/index.html:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Title</title>
</head>
<body>
  <h1>Heading</h1>
     {% if archive_list %}
     <ul>
      {% for content in archive_list %}
        <li><a href="/posts/{{ content.id }}/">{{ content.content_head }}</a>({{ content.pub_date }})</li>
      {% endfor %}
      </ul>
      {% else %}
      <p>No content is available.</p>
      {% endif %}
</body>
</html>

archive/posts/templates/posts/content_detail.html:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Title</title>
</head>
<body>
  <h1>Heading</h1>
     <ul>
     {% if content %}
       {% for contentinstance in content.contentinstance_set.all %}
        <li>{{ content.pub_date }}</li>
       <li>{{content.content_body}}</li>
       {% endfor %}
     {% else %}
     <li>No content is available</li> 
     {% endif %}
     </ul>
</body>
</html>

--
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/b86505fd-b149-48fd-a01f-b3938cb2b880%40googlegroups.com.

Re: Django authentication micro service Rest API utilization

Read about jwt token refresh and interceptors in spa

On Tue, 31 Mar 2020, 11:00 pm crack studio, <sajjadkhanafridi58@gmail.com> wrote:
Hello Everyone,

I want to implement and integrate different, separately Django service. 
Suppose I have these two different projects.

1. Authentication rest API ( user can register, login, email verification, create JWT token on login, refresh token, etc)
2. Frontend Project: This is the project with one application:
  • userapp: This app is responsible for providing HTML templates e.g registers a new user, login user, etc using authentication rest API. Currently, i have a local database to store and verify the token. Suppose, when a user logged in. The authentication API will provide me a jwt token and this token will be stored in my local database. For the first time when a user logged in, I have the user id, so I can use this id to check the user token (expiry date). But the problem is that how i keep the user identity until the user signout? What strategy and what functionality of Django should be used to keep track of the current user information because of on this identity I can check the token lifetime? 
I need help and suggestion!

Thanks

--
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/c37cbb43-5871-436e-86c7-d4d2ad887f4b%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/CAPjsHcF8X4OPdVjFewfT125Yd2D78avi481PwiGxkSF0z27nFA%40mail.gmail.com.

Re: Django Testing

Good day,

I hope this (https://docs.djangoproject.com/en/3.0/intro/tutorial05/#writing-our-first-test) can help, its part of the Django tutorials.

On Tue, Mar 31, 2020 at 4:35 PM ekong, emmanuel <ekong.emmanuel@lmu.edu.ng> wrote:
I'm having the same difficulty... 

On Tue, 31 Mar 2020 at 3:32 PM, Abrar Ahmad <gangsterabrar1000@gmail.com> wrote:
Hello Sir 
I have trouble in learnig Testing tutorial of Djanog Documentation.
Can any one tell me what is the main concept of learnign test and how can we learn it in easiest way.
I am waiting for reply

--
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/6e807ef4-09b6-459d-9d7f-ddb42931c4d9%40googlegroups.com.

Disclaimer
This e-mail is intended solely for the named recipient. The information contained in this message is strictly confidential.
  • If you are not the named recipient, you are hereby notified that any use, dissemination or reproduction of this document and or its content is prohibited and may be deemed unlawful.
  • If you are not the named recipient of this e-mail, please notify the sender by a return e-mail and delete all copies of it from your computer and mail.
Any views expressed in this e-mail are those of the individual sender, except where the sender specifically states them to be those of Landmark University, to whom no liability shall be attached whatsoever.

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/CAAP9wcyqaBJLLdc86wkSOtiNoCUDuQVHOh7mpPtCnCmRAbtRxw%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/CANDnEWfZuDeX7_0tvSdVY3-gWxdhinwyMGYQE3_ftri7e3OmjA%40mail.gmail.com.

CSS doesnt work deployed on Pythonanywhere

Really simple stuff. webpage navbar looks propper locally. But when deployed the navbar loses font and goes vertical. Checked Django and bootstrap installed versions on both,
Any thoughts? This is my first project on Django.

Thanks for your help.
Alexis.

--
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/cb265266-fbd9-442c-84f6-c1826abcdc62%40googlegroups.com.

Django authentication micro service Rest API utilization

Hello Everyone,

I want to implement and integrate different, separately Django service. 
Suppose I have these two different projects.

1. Authentication rest API ( user can register, login, email verification, create JWT token on login, refresh token, etc)
2. Frontend Project: This is the project with one application:
  • userapp: This app is responsible for providing HTML templates e.g registers a new user, login user, etc using authentication rest API. Currently, i have a local database to store and verify the token. Suppose, when a user logged in. The authentication API will provide me a jwt token and this token will be stored in my local database. For the first time when a user logged in, I have the user id, so I can use this id to check the user token (expiry date). But the problem is that how i keep the user identity until the user signout? What strategy and what functionality of Django should be used to keep track of the current user information because of on this identity I can check the token lifetime? 
I need help and suggestion!

Thanks

--
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/c37cbb43-5871-436e-86c7-d4d2ad887f4b%40googlegroups.com.

Re: NoReverseMatch error message - Please help

Sometimes the error can be from your url.py or even views.py and also make sure no typo. Check each on e of the above carefully. Hopefully you might see the bug.

Cheers

On Tue 31. Mar 2020 at 18.06, Jeff Waters <watersjg@gmail.com> wrote:
Thanks Ryan.

I've just tried that, but I still get an error message.

By the way, is it definitely .id and not _id? I've seen both, and Django docs says: 'Behind the scenes, Django appends "_id" to the field name to create its database column name, which makes me wonder if it might be _id.

Incidentally, I've also tried amending the relevant URL path to path('add_comment/<int:p.image_id>', views.add_comment, name='add_comment') - with underscore and with a dot before the id - but that doesn't work.

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/4473f031-abfa-428a-8804-debaf5a41c93%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/CAAipwd_Bjw%2BajNSVfyKcO5f27i2oxEmHoppnun2sA399eqcVxg%40mail.gmail.com.

Re: NoReverseMatch error message - Please help

Thanks Ryan.

I've just tried that, but I still get an error message.

By the way, is it definitely .id and not _id? I've seen both, and Django docs says: 'Behind the scenes, Django appends "_id" to the field name to create its database column name, which makes me wonder if it might be _id.

Incidentally, I've also tried amending the relevant URL path to path('add_comment/<int:p.image_id>', views.add_comment, name='add_comment') - with underscore and with a dot before the id - but that doesn't work.

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/4473f031-abfa-428a-8804-debaf5a41c93%40googlegroups.com.

Associating comments with images

I am creating a website where users can comment on photos in a gallery. The challenge I currently have is that Django is not able to determine which of the photos the comment 'submit' button relates to.

This is my HTML code for the photo gallery:

<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'%}" method="POST">
{{ comment_form.as_p }}
{% csrf_token %}
<button type="submit" class="btn btn-primary btn-lg">Submit</button>
{% endif %}

How do you suggest I overcome this problem, please?

Thanks

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/cabe2b94-bf00-4394-b699-8a15d48247d2%40googlegroups.com.

Re: Looking for Django developers to work on a new and an existing project with our team

Yes sir I am also interested,
I am quite new to it,
But curious to learn a lot from you guys

On Tue, Mar 31, 2020, 8:16 PM Saswat Ray <ray.saswat2@gmail.com> wrote:

On Tue, Mar 31, 2020 at 7:10 PM Juan J. Moreno Piña <prof.juanj.moreno@gmail.com> wrote:
available now, I'm located remote
Juan
Teaching to learn
Trading to survive
*M.Sc. Juan J. Moreno*
En Venezuela (Maracaibo)
Skype:studiom2j
Tel (Italy): +39 02320628565






El lun., 30 de mar. de 2020 a la(s) 07:56, Satish Pal (satishpal456@gmail.com) escribió:
Hi 

I have total of 2 years of experience and I am interested to join your team.
please check my Linkedin profile https://www.linkedin.com/in/satish-kumar-2230b3158/

Thanks in Advance.

On Mon, Mar 30, 2020 at 8:51 AM Phako Perez <13.phakman@gmail.com> wrote:
Hi,

I'm also interested to join your team, have 3+ years working with python 
Currently I'm teaching python to a group in order them to improve theirs career 

Thanks in advance 

Sent from my iPhone

On 29 Mar 2020, at 20:48, chinna <chittiboina.premkumar@gmail.com> wrote:


Hi,

I am Premkumar having 3 years of experience in web and rest api development using python and Django. I would like to join your team

On Sun, Mar 29, 2020 at 11:26 PM Lax Nayak <lnayak@qlytics.com> wrote:
I am looking for a django developer who has expertise in building enterprise grade solutions. 


--
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/f93f06b0-883c-4477-9d73-cc429a43380d%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/CAG%3DmdoCaGy%3DTWh0CY04_TBo8uG__4UWnd8sfWYLOZ8fapfZ%3DCA%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/5C30197E-FCE7-4BE8-B169-4E9E74F4EBF3%40gmail.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/CALzNJXmFb3cSFpEmYs2yB502x%2BB9DtNkDT_L2hqxvmvTPx08jA%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/CAMf5KvxLjfvMEPJZ6j3PTruMpho34FOW3HaLOECfbkGQFV%2B6zA%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/CAEhPkLFtrnrw39q6jP5R536BzbivfbE8KTOHjjyaJzbdSUG1WA%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/CAAmOWVwzWwf6bHedvCBw7bnSBy77rM%2BdMT7D72jZszLDTnBLGw%40mail.gmail.com.

Re: NoReverseMatch error message - Please help

Based on the rest of your template from the github link, looks like:

{% url 'nowandthen:add_comment' image.id %}

...should instead be:

{% url 'nowandthen:add_comment' p.image.id %}

On 3/31/20 7:08 AM, Jeff Waters wrote:
> 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/6e0854a3-ae89-d1a7-8fcf-98fbbadc9a3e%40fattuba.com.

Re: Looking for Django developers to work on a new and an existing project with our team


On Tue, Mar 31, 2020 at 7:10 PM Juan J. Moreno Piña <prof.juanj.moreno@gmail.com> wrote:
available now, I'm located remote
Juan
Teaching to learn
Trading to survive
*M.Sc. Juan J. Moreno*
En Venezuela (Maracaibo)
Skype:studiom2j
Tel (Italy): +39 02320628565






El lun., 30 de mar. de 2020 a la(s) 07:56, Satish Pal (satishpal456@gmail.com) escribió:
Hi 

I have total of 2 years of experience and I am interested to join your team.
please check my Linkedin profile https://www.linkedin.com/in/satish-kumar-2230b3158/

Thanks in Advance.

On Mon, Mar 30, 2020 at 8:51 AM Phako Perez <13.phakman@gmail.com> wrote:
Hi,

I'm also interested to join your team, have 3+ years working with python 
Currently I'm teaching python to a group in order them to improve theirs career 

Thanks in advance 

Sent from my iPhone

On 29 Mar 2020, at 20:48, chinna <chittiboina.premkumar@gmail.com> wrote:


Hi,

I am Premkumar having 3 years of experience in web and rest api development using python and Django. I would like to join your team

On Sun, Mar 29, 2020 at 11:26 PM Lax Nayak <lnayak@qlytics.com> wrote:
I am looking for a django developer who has expertise in building enterprise grade solutions. 


--
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/f93f06b0-883c-4477-9d73-cc429a43380d%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/CAG%3DmdoCaGy%3DTWh0CY04_TBo8uG__4UWnd8sfWYLOZ8fapfZ%3DCA%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/5C30197E-FCE7-4BE8-B169-4E9E74F4EBF3%40gmail.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/CALzNJXmFb3cSFpEmYs2yB502x%2BB9DtNkDT_L2hqxvmvTPx08jA%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/CAMf5KvxLjfvMEPJZ6j3PTruMpho34FOW3HaLOECfbkGQFV%2B6zA%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/CAEhPkLFtrnrw39q6jP5R536BzbivfbE8KTOHjjyaJzbdSUG1WA%40mail.gmail.com.

Re: Django Testing

I'm having the same difficulty... 

On Tue, 31 Mar 2020 at 3:32 PM, Abrar Ahmad <gangsterabrar1000@gmail.com> wrote:
Hello Sir 
I have trouble in learnig Testing tutorial of Djanog Documentation.
Can any one tell me what is the main concept of learnign test and how can we learn it in easiest way.
I am waiting for reply

--
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/6e807ef4-09b6-459d-9d7f-ddb42931c4d9%40googlegroups.com.

Disclaimer
This e-mail is intended solely for the named recipient. The information contained in this message is strictly confidential.
  • If you are not the named recipient, you are hereby notified that any use, dissemination or reproduction of this document and or its content is prohibited and may be deemed unlawful.
  • If you are not the named recipient of this e-mail, please notify the sender by a return e-mail and delete all copies of it from your computer and mail.
Any views expressed in this e-mail are those of the individual sender, except where the sender specifically states them to be those of Landmark University, to whom no liability shall be attached whatsoever.

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/CAAP9wcyqaBJLLdc86wkSOtiNoCUDuQVHOh7mpPtCnCmRAbtRxw%40mail.gmail.com.

Django Testing

Hello Sir 
I have trouble in learnig Testing tutorial of Djanog Documentation.
Can any one tell me what is the main concept of learnign test and how can we learn it in easiest way.
I am waiting for reply

--
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/6e807ef4-09b6-459d-9d7f-ddb42931c4d9%40googlegroups.com.

Re: Looking for Django developers to work on a new and an existing project with our team

available now, I'm located remote
Juan
Teaching to learn
Trading to survive
*M.Sc. Juan J. Moreno*
En Venezuela (Maracaibo)
Skype:studiom2j
Tel (Italy): +39 02320628565






El lun., 30 de mar. de 2020 a la(s) 07:56, Satish Pal (satishpal456@gmail.com) escribió:
Hi 

I have total of 2 years of experience and I am interested to join your team.
please check my Linkedin profile https://www.linkedin.com/in/satish-kumar-2230b3158/

Thanks in Advance.

On Mon, Mar 30, 2020 at 8:51 AM Phako Perez <13.phakman@gmail.com> wrote:
Hi,

I'm also interested to join your team, have 3+ years working with python 
Currently I'm teaching python to a group in order them to improve theirs career 

Thanks in advance 

Sent from my iPhone

On 29 Mar 2020, at 20:48, chinna <chittiboina.premkumar@gmail.com> wrote:


Hi,

I am Premkumar having 3 years of experience in web and rest api development using python and Django. I would like to join your team

On Sun, Mar 29, 2020 at 11:26 PM Lax Nayak <lnayak@qlytics.com> wrote:
I am looking for a django developer who has expertise in building enterprise grade solutions. 


--
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/f93f06b0-883c-4477-9d73-cc429a43380d%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/CAG%3DmdoCaGy%3DTWh0CY04_TBo8uG__4UWnd8sfWYLOZ8fapfZ%3DCA%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/5C30197E-FCE7-4BE8-B169-4E9E74F4EBF3%40gmail.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/CALzNJXmFb3cSFpEmYs2yB502x%2BB9DtNkDT_L2hqxvmvTPx08jA%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/CAMf5KvxLjfvMEPJZ6j3PTruMpho34FOW3HaLOECfbkGQFV%2B6zA%40mail.gmail.com.

Re: How do I create a GEO management system using django as back-end and react as front-end?


On Thu, 12 Mar 2020 at 09:55, Philip Mitchell <tmitchellb007@gmail.com> wrote:
I want to work on a project where a user is able to mark and locate objects on a map as in the https://www.openstreetmap.org/
I don't know how to go about it, I have tried GeoDjango but I haven't found a way to create the APIs yet

--
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/299f9cd0-bb93-470c-89bb-7af8949d39bf%40googlegroups.com.


--
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don't drive species to extinction

2) Don't destroy a habitat that species rely on.

3) Don't change the climate in ways that will result in the above.

}<(((*>

--
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/CABCjzWpzGKYLLPeJhTN9AU0FVZoBJozzeA59kzNmJ_skeB4X5g%40mail.gmail.com.

Re: NoReverseMatch error message - Please help

Hi Jeff,

On 31/03/2020 14.08, Jeff Waters wrote:
> 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/$']
>

Trailing slashes are part of the path, so "/foobar/" is not the same as
"/foobar".

Hopefully that should give you a hint to what is most likely the cause
of your problem.

Kind regards,

Kasper Laudrup

--
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/860f1f56-b008-f38b-3b01-8ff985f5d88f%40stacktrace.dk.

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.