Re: I can't print a queryset value.

2018-01-03 Thread 1351552...@qq.com
This will work:
>>> for id in Review.objects.values_list('id',flat=True):
...   print('ID:%d' % id)
...
ID:1
ID:2
ID:3
ID:4
ID:5
ID:6

and i don't know what you say in ur problem2


wblueboat
 
From: karlnaflnest
Date: 2018-01-03 15:20
To: Django users
Subject: I can't print a queryset value.
I am trying to pass a queryset value as an argument to a method but it won't 
proceed; it shows no error. And I tried printing it like this:
for id in Review.objects.values_list('id', flat=True):print("ID: " + id)
Output:
1

However, it worked and looped when I changed it to this:
for id in Review.objects.values_list('id', flat=True):print(id)
Output:
1
2
3
4
5


My other problem is when using a queryset value in my method:

This works:
insert_to_db(id)

But this does not:
insert_to_db(id, result)


Any help would be greatly 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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/8003bf92-c580-4d10-9e42-d4fade579bd9%40googlegroups.com.
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/5a4cacd7.8a61650a.e2f79.0bb6SMTPIN_ADDED_BROKEN%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re: how to design custom forms in django with bootstrap

2016-06-21 Thread 1351552...@qq.com

u need read how to use css file by django 
:https://docs.djangoproject.com/en/1.9/intro/tutorial06/ 
before this u need download bootstrap in ur location disk,and add 
in the  of ur html.


ww
 
From: Ikram Ulhaq
Date: 2016-06-21 05:02
To: Django users
Subject: Re: how to design custom forms in django with bootstrap

sir i want to design a custom form in django that will store data in 
database...i done this with built in django forms but i can't be able to design 
with bootstarp or css. data not inserted if i create my own custom form like 




Email address

  




Email address

  



some button




Email address

aa

  


On Monday, June 20, 2016 at 4:56:29 PM UTC+5, Ikram Ulhaq wrote:
Hi everyone!
i am new in django and want to design custom form in bootstarp that can use to 
send data to database.i made form successfully but values not inserted in 
database.please help

-- 
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 post to this group, send email to django-users@googlegroups.com.
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/0872af0f-c81f-42f9-998f-89a60ec390aa%40googlegroups.com.
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/201606220844433196233%40qq.com.
For more options, visit https://groups.google.com/d/optout.


initial costom field in modelform

2016-06-30 Thread 1351552...@qq.com
hi everyone:

i defined tbls  customer and salesorder in my db, 
i want to show the customer name in my form but want not to save it in 
salesorder tbl,
how can i initial it for gui?
my code is :
#model
class Customer(models.Model):
name=models.CharField(max_length=40)
abbreviation=models.CharField(max_length=20)

class SalesOrder(models.Model):
customer=models.ForeignKey(Customer,related_name='by_customer',on_delete=models.CASCADE)

#form
class SalesOrderForm(forms.ModelForm):
customer_name=forms.CharField(required=False,widget=forms.TextInput(attrs={'readonly':''}))
class Meta:
model=SalesOrder
fields = ['customer','customer_name',]

thanks



1351552...@qq.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 post to this group, send email to django-users@googlegroups.com.
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/201607011405183921218%40qq.com.
For more options, visit https://groups.google.com/d/optout.


deploy django with nginx

2016-07-15 Thread 1351552...@qq.com
hi everyone:

I am tring to deploy my site by nginx and uwagi
in my project yaohang,i have these files:

#yaohang_uwsgi.ini
[uwsgi] 
socket = :8001 
chmod-socket= 664
master = true 
module = yaohang_uwsgi 
processes = 8 
listen = 120 
enable-threads = true 
daemonize = /home/wangwei/yaohang/yaohang_uwsgi.log 
pidfile = /home/wangwei/yaohang/yaohang_uwsgi.pid 
pythonpath = /home/wangwei/yaohang/ 
pythonpath = /home/wangwei/yaohang/yaohang_uwsgi 
pythonpath = /home/wangwei/yaohang/yaohang 
buffer-size = 32768 
reload-mercy = 8 
vacuum = true

#yaohang_uwsgi.py
import os 
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "yaohang.settings") 

from django.core.wsgi import get_wsgi_application 
application = get_wsgi_application()

#yaohang_uwsgi.conf
server { 
listen  8000;
server_name192.168.70.32; # this is my server's addr
charset UTF-8; 

client_max_body_size 75M; 

location / { 
include uwsgi_params; 
uwsgi_pass 127.0.0.1:8001; 
uwsgi_read_timeout 2; 
}
location /static { 
expires 30d; 
autoindex on; 
add_header Cache-Control private; 
alias /home/wangwei/yaohang/static/; 
} 
}   

run nginx and 
>>uwsgi --http 192.168.70.32:8001 --wsgi-file yaohang_uwsgi.py

and then by my client browser:192.168.70.32:8000
it show:502 Bad Gateway

and with the message in file /var/log/nginx/error.log :
connect() to unix:///home/wangwei/yaohang/yaohang.sock failed (13: Permission 
denied) while connecting to upstream, client: 192.168.71.3, server: 
192.168.70.32, request: "GET / HTTP/1.1", upstream: 
"uwsgi://unix:///home/wangwei/yaohang/yaohang.sock:", host: "192.168.70.32:8000"

who can tell me where is wrong?

thank you!

wblueboat
 

-- 
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 post to this group, send email to django-users@googlegroups.com.
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/201607151847061918789%40qq.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django soap client

2019-04-15 Thread 1351552...@qq.com
django is a framework, it is worked in different way with php, read the lesson 
in doc is the best way to undstand it.



wblueboat
 
From: oka M
Date: 2019-04-12 13:45
To: Django users
Subject: Django soap client
Hai All,

Im php programer and i want to migration from php to pyhton in specific i want 
to use django for my webapps;

i have question 

how to import zeep module to my djanggo apps?

can give me example for my php code to django

http://localhost:8082/ws/live.php?wdslchace';
$client = new nusoap_client($url, true);

$proxy = $client->getProxy();

$username = 'username';
$password = 'password';

$result = $proxy ->GetToken($username, $password);

$token = $result;

?>

thanx
-- 
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 post to this group, send email to django-users@googlegroups.com.
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/69dc3b5c-ff62-473c-9143-ec65268431a5%40googlegroups.com.
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/5cb52505.1c69fb81.217ec.9510SMTPIN_ADDED_BROKEN%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.


how to use admin view as part of app

2017-09-06 Thread 1351552...@qq.com
hello 

I want use a admin edit view in my app,when edit done ,it will back to admin 
list view, how can it back to my app.listview.



wblueboat

-- 
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 post to this group, send email to django-users@googlegroups.com.
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/59b0bd03.d34f810a.f435d.14b5SMTPIN_ADDED_BROKEN%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.


Re:

2019-12-03 Thread 1351552...@qq.com
r u mean u want to display the response?



wblueboat
 
From: vaneet bawa
Date: 2019-11-27 16:35
To: django-users
Subject: 
can someone please tell me that how I can display the message on the url from 
which I am getting the response
-- 
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/CAKubXnycx%3DqU2h4SgRJ%3D_HEXbSqfbJ8ii2TbVQVzYGzcT9m7Qg%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/5de6fbe9.1c69fb81.8ef74.2debSMTPIN_ADDED_BROKEN%40gmr-mx.google.com.


Re: Django- Display PDf document in an Iframe or Pdf VIewer

2019-12-03 Thread 1351552...@qq.com
hi:
1、the pdf file is static file,u can write the url in html to show it.
2、if u want to show it in half of web page,u can use  with fixed width and 
height besides iframe.



wblueboat
 
From: 'Lucas Gärtner' via Django users
Date: 2019-11-25 22:29
To: Django users
Subject: Django- Display PDf document in an Iframe or Pdf VIewer
Hello everyone!

I just signed up here, so maybe this thread is wrong in this group. 

The problem is as follows:

I need to display a PDF document in a half of a web application.
I tried it first with Iframe and now today with pdf.js.
Nothing helped. Do you have any idea? 
It is only showing the pdf, not more.

I am using django: 2.1.10 and Python 3.7.1

Hope you have some good recommendations!

Have a nice day!
Lucas
-- 
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/8304b914-3861-4c33-8948-87f9baeaf27f%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5de6fd70.1c69fb81.8e64c.0da3SMTPIN_ADDED_BROKEN%40gmr-mx.google.com.