guys help me please, page doesn't open image

2020-03-06 Thread Aly_34_04 MR_34_04


[image: Capture.JPG]
Enter code here...
#django templates

{% extends 'base.html' %}
{% block content %}
Products

{% for product in products %}


  
  
{{product.name}}
$ {{product.price}}
add to card
  


{% endfor %}

{% endblock %}...


#python code

class Product(models.Model):
name = models.CharField(max_length=50)
price = models.FloatField()
image = models.FileField()



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a9354269-5866-4332-9acb-a0b558501d0d%40googlegroups.com.


Re: guys help me please, page doesn't open image

2020-03-06 Thread Aly_34_04 MR_34_04
it doesn't work, I tried(
[06/Mar/2020 15:01:39] "GET /products/ HTTP/1.1" 200 1719
Not Found: /products/3.png
[06/Mar/2020 15:01:39] "GET /products/3.png HTTP/1.1" 404 2137

 

On Friday, March 6, 2020 at 2:35:52 PM UTC+3, Omkar Parab wrote:
>
> {{ product.image.url }} 
>
> On Fri, Mar 6, 2020, 4:50 PM Aly_34_04 MR_34_04  > wrote:
>
>> [image: Capture.JPG]
>> Enter code here...
>> #django templates
>>
>> {% extends 'base.html' %}
>> {% block content %}
>> Products
>> 
>> {% for product in products %}
>> 
>> 
>>   
>>   
>> {{product.name}}
>> $ {{product.price}}
>> add to card
>>   
>> 
>> 
>> {% endfor %}
>> 
>> {% endblock %}...
>>
>>
>> #python code
>>
>> class Product(models.Model):
>> name = models.CharField(max_length=50)
>> price = models.FloatField()
>> image = models.FileField()
>>
>>
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/a9354269-5866-4332-9acb-a0b558501d0d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/a9354269-5866-4332-9acb-a0b558501d0d%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/509b5541-dfbb-43a8-a3b9-5e4c56807fbe%40googlegroups.com.


guys django form doesn't appear, what could I do?

2020-03-30 Thread Aly_34_04 MR_34_04


[image: Capture.JPG]
template:
  


  Bildiris bermek




  

  
Modal title

  ×

  
  

{% csrf_token %}
{{ form }}

  
  
Close
Save changes
  

  




Gözlet






django form:

from django import forms
from .models import Post


class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = '__all__'


def __init__(self, *args, **kwargs):
super().__init__(*args,**kwargs)
for field in self.fields:
self.fields[field].widget['class'] = 'form-control'



django views:

from django.shortcuts import render
from .models import Post
from .forms import PostForm


def add_post(request):
if request.method == 'POST':
form = PostForm(request.POST)
if form.is_valid():
form.save()
template = 'home.html'
context = {'form': PostForm(),}
return render(request,template,context)

-


django urls

from django.urls import path
from .import views

urlpatterns = [
path('',views.home, name="home"),
path('detail/',views.detail_page, name="detail"),
path('',views.add_post, name="home"),
]




django models:

from django.db import models


class Post(models.Model):
title = models.CharField(max_length=50)
date = models.DateTimeField(auto_now=True)
text = models.TextField()


class Meta:
ordering = ('-date',)


def __str__(self):
return self.title



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fa7e9ab5-974a-4752-be7d-b60b31277f88%40googlegroups.com.


Re: HTML code not being read

2020-03-30 Thread Aly_34_04 MR_34_04
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 %}
> 
> 
> Comment by {{ comment.user }}
> 
> {{ comment.created_on }}
> 
> 
> {{ comment.body | linebreaks }}
> 
> {% 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+unsubscr...@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.


Re: CSS doesnt work deployed on Pythonanywhere

2020-03-31 Thread Aly_34_04 MR_34_04
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+unsubscr...@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.


Could not parse the remainder: '='dashboard'' from 'section='dashboard''

2019-11-22 Thread Aly_34_04 MR_34_04


[image: Capture.JPG]



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e6791666-dfbe-4e46-8c8c-33b710f59cfe%40googlegroups.com.


Re: Could not parse the remainder: '='dashboard'' from 'section='dashboard''

2019-11-22 Thread Aly_34_04 MR_34_04
how can I solve it?


On Friday, November 22, 2019 at 10:04:41 PM UTC+3, Aly_34_04 MR_34_04 wrote:
>
> [image: Capture.JPG]
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9e18310f-2fdf-4102-b672-a4fde4307709%40googlegroups.com.


Re: Could not parse the remainder: '='dashboard'' from 'section='dashboard''

2019-11-22 Thread Aly_34_04 MR_34_04
nothing changed(


On Fri, Nov 22, 2019 at 10:05 PM Larry Martell 
wrote:

> ==
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACwCsY7OWN9erkXXkXiaOeSARkQgLY13CG%2BscCXEihDiTAGnFQ%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJwZndeKPHLLbjaA2vEnb4gfYXzDYUNdXQPJ2rAWFuht1iHSfA%40mail.gmail.com.