Hello
I have a question in my view fiole i have this
def myfunct()
do this...
now i need only to return a js alert message on the same page
is it possible?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
Hello and thanks for your help.
I think that i need context, i attach my test file:
from django.shortcuts import render_to_response
from off_bert.offerte.forms import RichiestaForm
from django.http import HttpResponseRedirect
def richiesta(request):
if request.method == 'POST':
form
Hello i have a POST form (not modelform) how i can save the data in
the db, and if i need to change the data before the save how i can do?
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
Iis but form.save don't work
On 19 Ago, 16:23, Daniel Roseman wrote:
> On Aug 19, 3:21 pm, luca72 wrote:
>
> > Hello i have a POST form (not modelform) how i can save the data in
> > the db, and if i need to change the data before the save how i can do?
>
> > Th
how i can get the value of the fields?
On 19 Ago, 17:45, Daniel Roseman wrote:
> On Aug 19, 3:40 pm, luca72 wrote:
>
> > Iis but form.save don't work
>
> That's true.
> --
> DR.
--~--~-~--~~~---~--~~
You received this message
Thanks for you reply.
But i have this problem i need to check a value from a field before
the validation of the form.
How i can do this.
Sorry for my stupid question but i'm very newbie
On 19 Ago, 19:44, Alex Gaynor wrote:
> On Wed, Aug 19, 2009 at 11:22 AM,luca72 wrote:
>
> >
Hello i have made this it works, but i'm sure that there is a short
way to obtain the same result can you tell me how?
def richiedi(request):
if request.method == 'POST':
form = RichiestaForm(request.POST)
if form.is_valid():
tipo = form.cleaned_data['tipo']
I don't use a modelform because one folder of my form is a
ChoiceField.
Regards
Luca
On 20 Ago, 12:52, Daniel Roseman wrote:
> On Aug 20, 10:37 am, luca72 wrote:
>
>
>
> > Hello i have made this it works, but i'm sure that there is a short
> > way to obtain t
how i can write this with the djago db api:
SELECT "column name" from "table_name" where "id"=2
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django
Thanks for your reply but i get this error:
Model object has no attribute 'values'
Thanks
On 21 Ago, 09:42, Kenneth Gonsalves wrote:
> On Friday 21 Aug 2009 1:00:32 pm luca72 wrote:
>
> > how i can write this with the djago db api:
> > SELECT "column nam
I have solved using :
Model.object.filter(id=2)values('columnname')
Thanks
Luca
On 21 Ago, 10:14, luca72 wrote:
> Thanks for your reply but i get this error:
> Model object has no attribute 'values'
>
> Thanks
>
> On 21 Ago, 09:42, Kenneth Gonsalves wrot
Thanks now it works
Luca
On 25 Ago, 15:12, Daniel Roseman wrote:
> On Aug 25, 2:07 pm, luca72 wrote:
>
> > Hello i have this:
> > errore = """
> > { alert('test_js')};
> > ""&qu
Hello i have this:
errore = """
{ alert('test_js')};
"""
return mark_safe(errore)
I get this error : AttributeError: 'SafeString' object has no
attribute 'status_code'
can you help me to write the correct one?
Thanks
Luca
--~--~-~--~~-
Hello can you tell me where i can find example how to download file
with django
Regards
Luca
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@go
I have fount an exple that show how to create a teble :
the first line is
import django_tables as tables
but i get the error that django_tables don't exist
can you tell me how to render the table
regards
Luca
--~--~-~--~~~---~--~~
You received this message becaus
hello i need to render a table where i need to separate a odd colum to
even column
my wrong idea
File Name
Size
{% for m in tutti %}
{% if {{m.id}} even %}
{% else %}
{% endif %}
Hello i have try with cherrypy but i get this error:
def scarico(request, id):
from cherrypy.lib.static import serve_file
fil_da_scar = F_d.objects.get(pk=id)
nome_file = fil_da_scar.nome_fil
return serve_file('/home/luca111/Desktop/Luca/Webframework/
off_bert/disegni/'+nome_file+
Hello in my setting fikle i have write this:
TEMPLATE_DIRS = ('/home/luca72/webapps/django/myproject/templates'
# Put strings here, like "/home/html/django_templates" or "C:/www/
django/templates".
# Always use forward slashes, even on Windows.
# Don&
i fill with user and password he
redirect me to http://www.mysite.net/admin and give me the error page
not found.
What i have to change in the configuration file to maka the redirect
correct to http://www.mysite.net/dg/my required page.
Many Thanks
Luca
On 15 Set, 17:23, luca72 wrote:
> Hello
Hello my web site is in www.mysite.net/django, so i have use the
"FORCE_SCRIPT_NAME = '/django/'" in the settings.py file.
So when i try to reach the admin site after the login he redirect my
in the correct url www.mysite.net/django/admin.
But when i try to reach others pages of the site where the
Hello i have solved using this option on the setting file:
FORCE_SCRIPT_NAME="/django/"
LOGIN_REDIRECT_URL="/django/richiedi/"
LOGIN_URL="/django/accounts/login/"
Thanks
Luca
On 18 Set, 17:49, Grant Livingston wrote:
> Would it not be better if you set your server to only execute django at
Thanks I use cherry py because i don't know how to download file with
django, can you tell me how to do it with django
regards
Luca
On 14 Set, 12:46, "J. Cliff Dyer" wrote:
> On Mon, 2009-09-14 at 07:57 -0700, luca72 wrote:
> > Hello i have try with cherrypy but i g
So i have try this:
file_da_scar = F_d.objects.get(pk=id)
nom = file_da_scar.nome_fil
return HttpResponse(open('/home/luca72/webapps/django/myproject/
disegni/'+nom+'.pdf', 'r').read(), mimetype='application/pdf')
And it open the pdf file, but if
So i have try this:
file_da_scar = F_d.objects.get(pk=id)
nom = file_da_scar.nome_fil
return HttpResponse(open('/home/luca72/webapps/django/myproject/
disegni/'+nom+'.pdf', 'r').read(), mimetype='application/pdf')
And it open the pdf file, but if
i Have solved using this:
luca = HttpResponse(open('/home/luca72/webapps/django/myproject/
disegni/'+nome, 'rb').read(), mimetype='application/octet-stream')
luca['Content-Disposition'] = 'attachment; filename='+nome
return luca
Is it ok or i
Hello i have made a base template like this:
http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
{% block title %}{% endblock %}
<
Please make your selection
http://www.pppi.com";>Go To O.F.B. Home Page
Go To Download
Draw. Page
Hello this is my model:
from django.db import models
class Per(models.Model):
dip = models.CharField(max_length=100)
data_ini = models.CharField(max_length=100)
data_fin = models.CharField(max_length=100)
mot = models.CharField(max_length=500)
data_rich= models.CharField(max_
odiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^mostro_permesso/', 'rm.remi.views.mostro_permesso'),
)
On 8 Ott, 09:07, "Bogdan I. Bursuc" wrote:
> I think we need a little more info here, post your u
the first access
> could you please post the template where you render the form, i think
> the error is there, you try to access something that isn't set yet.
>
> On Thu, 2009-10-08 at 01:28 -0700, luca72 wrote:
> > Hello this is the views file
>
> > from django.htt
Thanks
On 8 Ott, 12:54, Tom Evans wrote:
> On Thu, 2009-10-08 at 13:27 +0300, Bogdan I. Bursuc wrote:
> > I'm sorry, but i still can't figure out where the error comes.
> > Can you post your traceback from the error page ?
>
> The error comes because he misspelled 'class Meta' as 'class meta'.
>
hello
my models is this:
class Per(models.Model):
dip = models.CharField(max_length=100)
di = models.CharField(max_length=100)
df = models.CharField(max_length=100)
m = models.CharField(max_length=500)
dri = models.CharField(max_length=100)
the form is this:
class PerForm(Mod
I have try it but the field dri is show in the form
Luca
On 8 Ott, 16:06, "Mark (Nosrednakram)" wrote:
> Hello Luca,
>
>
>
> > my models is this:
> > class Per(models.Model):
> > dip = models.CharField(max_length=100)
> > di = models.CharField(max_length=100)
> > df = models.CharFi
Hello i have a small application where in the urls i have this :
(r'^scarico/(\d+)/(\w+)/$', 'sitonorme.gestnorme.views.scarico'),
the problem is that in the \w+ sometimes i have name with space li dir
one that i can't rename.
the folder that i pass for example is this:
Request URL: http://12
Hello if i use request.META['REMOTE_USER'] i get key error, but if i
use 'REMOTE_HOST' not
can you tell me how to get the user that is authenticate
I use the decorator @login_required and so the user is authenticated
correct?
Regards
Luca
--~--~-~--~~~---~--~~
You
#x27;REMOTE_USER' key in META.
>
> On Wed, Oct 14, 2009 at 5:29 PM, luca72 wrote:
>
> > Hello if i use request.META['REMOTE_USER'] i get key error, but if i
> > use 'REMOTE_HOST' not
> > can you tell me how to get the user that is authentic
Hello
i need to put in the forms.ChoiceField the value of the django
uath_user table i can do it?
how can import the table in the forms.py file
Thanks luca
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django use
hello can you explain how to solve this error:
Exception Type: TemplateSyntaxError at /vis_scar/
Exception Value: Caught an exception while rendering: Incorrect
datetime value: '%2009-10-15 15:45:59%' for column 'dataora' at row 1
He stop at line 17
8
9
10
11 Nome File
Hello i have a problem when i render with django a background image
with css:
simple css:
div#main {position: absolute; top: 20%; left: 20%; bottom: 0; right:
0; overflow:scroll; background-color: black; color:red; font-
size:medium; font-family: TimesNR, serif; font-weight: bold;background-
image
media/' and my MEDIA_URL
> set to '/site_media/', and the image has be moved or copied to be
> /home/me/djprojects/proj1/site_media/images/foo.jpg then the right
> thing to put in the css is url(/site_media/images/foo.jpg) - note that
> no quotes are used either.
>
&g
hello at all.
during the renderig of a form in any required field is write "this
field is required", how i can overwrite this or delete it.
Thanks
Luca
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-
Hello i have a project saved in my usb stick.
the image that i need to use are saved
in /media/5468-1AF4/Django/mysite/static/ (i'm under linux)
can you help me to configure the setting.py in the way that im my template
i can use in css bacground-image :url(image.jpg), actually i try to set
STA
hello my project is lacated here:
/home/
/luca72
/Scrivania
/Quintas_Disegno_definitivo
/quintas/ here i have the file manage.py ,
than i have the file settings,py here:
/home
/luca72
/Scrivania
/Quintas_Disegno_definitivo
/quintas
Thanks
i have try but with no result, i have set as follow:
MEDIA_ROOT =
'/home/luca72/Scrivania/Quintas_Disegno_definitivo/quintas/quintas/static/'
MEDIA_URL = '/static/'
STATIC_URL = ''
STATIC_ROOT = ''
STATICFILES_DIRS =
('/home/luca72/Scrivan
Hello
I have to take a page with 4 variable that can be string number or mixed
including point how i have to configure the url:
(r'^scarico/./././.','prova.views.scarico')
How i have to do it?
Thanks
Luca
--
You received this message because you are subscribed to the Google Groups
"Django u
removing @crsf_protect i get the same error
On 24 Feb, 10:34, Kenneth Gonsalves wrote:
> On Thu, 2011-02-24 at 01:20 -0800, luca72 wrote:
> > @csrf_protect
>
> try removing this
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.tech
N
>
> On Thu, Feb 24, 2011 at 3:18 PM, luca72 wrote:
> > removing @crsf_protect i get the same error
>
> > On 24 Feb, 10:34, Kenneth Gonsalves wrote:
> > > On Thu, 2011-02-24 at 01:20 -0800, luca72 wrote:
> > > > @csrf_protect
>
> > > try removin
A stupid question
mylist = ['a','b','c']
If i need to render it in a template like:
in differnt
like
a
b
c
how can i do with the {{% for %}} tag?
Thanks
Luca
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email t
hello i have define this in the url:
(r'^admin/', include(admin.site.urls)),
(r'^accounts/login/$', 'django.contrib.auth.views.login'),
(r'^mostro_prima', 'prova.test_sito.views.mostro_prima'),
(r'$', 'prova.test_sito.views.mostro_prima'),
(r'^inserisco/', 'prova.test_sito.views.ins
i have solved using:
(r'^$', 'prova.test_sito.views.mostro_prima'),
witout the ^ , for every address he show me the mostro_prima view
Thanks
Luca
On 3 Mar, 17:24, Tom Evans wrote:
> On Thu, Mar 3, 2011 at 4:00 PM, luca72 wrote:
> > hello i have define t
Hello
How i can get all the email stored in the auth_user table of the
default djanco database?
Thanks
Luca
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from
hello i have a form like this:
class Form_news(forms.Form):
messgg = forms.CharField(label = 'Messaggio',max_length=1,
widget=forms.Textarea)
and in the views i do as follow:
if request.user.is_superuser:
if request.method == 'POST':
if form.is_valid():
hello the views file is like:
def test(request):
testo = ["a","b"]
titolo = 'test'
variabile = 'one'
return render_to_response('vini.html',{'testo':testo,'titolo':titolo,
'testo':testo,'variabile':variabile,})
the template is:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
Hello
i have defined an url as:
(r'^tipi/(\w)', 'polls.views.tipi'),
the template is:
{% if variabile == "vino" %}
{% for a in lista_vini %}
{{a}}
{% endfor %}
{% endif %}
the view is:
def tipi(request,a):
if a == 'Barbaresco':
testo = ['Wine name: BARBARESCO','Region: Pie
Hello i have this configuration in settings.py
STATIC_URL = '/static_files/'
STATIC_ROOT = 'D:/prova_nuovo_sito/static_files'
INSTALLED_APPS = [
'polls.apps.PollsConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
o/en/latest/_images/how-static-files-work-apache.png.
>
> Otherwise, please explain in more detail what your deployment environment
> looks like.
>
>
> On 15/06/2022 13.08, luca72.b...@gmail.com wrote:
>
> Hello i have this configuration in settings.py
>
>
Hello i have a list like:
mylist = ['1,png','2.png',3.jpj']
in the template i do as follow:
{% for o in mylist %}
{% if "png" in o %}
{{ o }}
{% else %}
{{o}}
{% endif %}
{% endfor %}
in the template i see the file name
Hello i have this problem :
MultiValueDictKeyError at
The view is:
matricola = request.POST['matricola']
The form is:
matricola = forms.CharField(label='Matricola', required = False,
max_length=100, widget = forms.TextInput(attrs={'readonly':'readonly'}))
the template is
{{ form }}
Why i g
i have a form that is like:
class tesoffcliForm(forms.Form)
image = forms.FileField(label='Image', required = False)
art_gen = forms.CharField(label='test ', required = False ,widget =
forms.Textarea())
the view is:
def testrendering(request):
form = tesoffcliForm()
num
Hello
i have this:
{% for fieldi in formone %}
{{ fieldi.label }} {{ fieldi }}
{% if forloop.counter|divisibleby:"2" %}
{% endif %}
{% endfor %}
i need to add:
{% for fieldi in formone and for or x in lista_form %}
Hello
I have this:
{% for x in lista_form %}
{% if forloop.counter < 100 %}
{% for fieldi in formone %}
{{ fieldi.label }} {{ fieldi }}
{% endfor %}
Immagine
{% endif %}
{% if forloop.counter|divisibleb
i have this :
{% if forloop.counter < {{ variable }} %}
i have this error:
Could not parse the remainder: '{{' from '{{'
how i can solve it?
Thanks
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop rece
thanks i forgot it
Il giorno giovedì 15 ottobre 2020 alle 16:39:45 UTC+2
larry.mart...@gmail.com ha scritto:
> On Thu, Oct 15, 2020 at 7:32 AM luca72.b...@gmail.com
> wrote:
> >
> > i have this :
> > {% if forloop.counter < {{ variable }} %}
> > i have this e
Hello
In the setup file i have:
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
#STATICFILES_DIRS = [
#os.path.join(BASE_DIR, "static"),
#'/polls/static/polls',
#]
STATIC_ROOT = "F:/aflbmanager/mysite/polls/static"
MEDIA_ROOT = "F:/aflbmanager/mysite/polls/media"
In the template for load
Solved
i have add
Il giorno giovedì 11 febbraio 2021 alle 15:27:51 UTC+1
luca72.b...@gmail.com ha scritto:
> Hello
> In the setup file i have:
>
> STATIC_URL = '/static/'
> MEDIA_URL = '/media/'
>
> #STATICFILES_DIRS = [
> #os.path.join(BASE
Hello my web site is hosted on a2hosting
when i turn to False the image are not loaded.
My settings.py have this line:
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static_files')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, "static_media")
the file are located in:
Hello i have write this in a template:
{% for a in lista %}
{% endfor %}
But i get no image
if i add just a {{a}} i see that the file name is righ,
also if i direct write the file i get it
{% for a in lista %}
{% endfor %}
can you tell me what is wrong
Thanks
-
lp
Il giorno mercoledì 2 marzo 2016 11:52:05 UTC+1, Sergiy Khohlov ha scritto:
>
> original path og your image please.
> Also setting for STATIC_ROOT from setting.py send please
>
> Many thanks,
>
> Serge
>
>
> +380 636150445
> skype: skhohlov
>
> On W
Thanks now it works
Luca
Il giorno mercoledì 2 marzo 2016 14:05:24 UTC+1, Andreas Schosser ha
scritto:
>
> Hi Luca,
>
> > > height="100"
>
> Try {% static "mysite/scorr/"|add:a %}
>
> Andreas
>
> --
> Kurs 10 IT-Consulting www.kurs-10.de
> Andreas Sc
hello my view.py is like this:
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.db import models
from django.core.files.storage import FileSystemStorage
#from django.core.servers.basehttp import FileWrapper
from django.contrib.auth import authen
Hello my view is as follow
def scarico(request, data):
print(data)
.
the url is :
url(r'^scarico/(?P.+)/$', views.scarico, name='scarico'),
the form is
Norma
Azione
{% for data in lista_norme %}
{% data %}
Scarica
{%
70 matches
Mail list logo