How to deploy my django project into the web server.


On Jul 4, 2019 10:28 PM, "Joe Reitman" <[email protected]> wrote:

> I would suggest not using locals(). You only have three variables to pass
> through to your template.
>
>
>
> On Wednesday, July 3, 2019 at 6:26:22 PM UTC-5, Tosin Ayoola wrote:
>>
>> Good day guyz
>> sorry i'm working on a django e-commerce project which i am new to, and
>> i'm stuck, i wan have a page that will display the list of all for the list
>> of all products under a particular category, which i have checked out on
>> stackoverflow, i tried every suggestion and yet since not working below is
>> my code hoping anyone can lead mr in d right direction
>>
>> ##View
>>
>> def index(request):
>> products = Product.objects.all()
>> category = get_list_or_404(Category)
>> cat = Category.objects.filter(pk = id)
>> return render(request, 'shop/index.html', locals())
>>
>> ##product_list Page
>> <h2>Categories</h2>
>> {% if cat %}
>> <ul>
>> {% for c in cat %}
>> <li>
>> <a href="{% url 'product-list' %}"> {{c.name}}</a>
>> </li>
>> {% for product in cat.get_product %}
>> <p> {(product.name}}</p>
>> {% endfor %}
>> {% endfor %}
>> </ul>
>> {% else %}
>> <p> There's no item category yet
>> {% endif %}
>> </div>
>>
>>
>>
>> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/a69930ce-32f0-420d-a5ff-b44e65e87918%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a69930ce-32f0-420d-a5ff-b44e65e87918%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABWAz%3D1KUbMxND1YFjEKpXmA-DwP-dnYhphVUmumwn8cuexbMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to