Hi, I'm using login_required in url patterns but it does an error:
urls.py
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
urlpatterns = patterns('',
url(r'^home/', login_required(include('home.urls'))),
)
error:
TypeError at
I'm using syncdb to the class CustomUser(AbstractUser), my Django is 1.7,
how can I user migrate to a customuser?
--
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
t
mytag = Tag.objects.get(id=1)
mytag.blog_set.all()
Em domingo, 8 de fevereiro de 2015 14:30:25 UTC-2, Dean De Leo escreveu:
>
> Hello,
> I am trying to find how to filter the entries of my blog by a set of
> tags, using the Django models.
> In particular there are two relations:
> Blog (id, ti
t = models.DateTimeField(auto_now=True);
>
> class Meta:
> ordering = ['-id']
>
> class Tag(models.Model):
> name = models.CharField(max_length=255, null=False)
> blog = models.ForeignKey('Blog', null=False)
>
> class Meta:
>
I'm trying to use form wizard but when I put 'django.contrib.formtools', in
INSTALLED_APPS appear on my terminal 'ImportError: No module named
formtools'
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop r
Hi Simon,
pip install django-formtools doesn't work.
Could not find any downloads that satisfy the requirement django-formtools
Em quarta-feira, 11 de março de 2015 03:12:06 UTC-3, Simon Charette
escreveu:
>
> Hi Neto,
>
> Here's an excerpt from the Django 1.8
What is the best way to avoid recursion when using post_save?
@receiver(post_save, sender=Person)
def do(sender, instance, *args, **kwargs):
instance.ok = True
instance.save()
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscri
When I mark to delete the formset, django requires complete all fields, he
does not ignore the marked form to delete. How do I solve this? I wanna
that django delete the form marked or ignore him.
from django.forms.formsets import formset_factory>>> from myapp.forms import
ArticleForm>>> Articl
Franciso, faça sua pergunta no Django Brasil, pode ser mais fácil conseguir
uma resposta https://groups.google.com/forum/#!forum/django-brasil
Em terça-feira, 28 de abril de 2015 14:16:26 UTC-3, Francisco Roldan
escreveu:
>
> Buenas tardes, alguien integró MercadoPago Applications a Django?
> Yo
In Django 1.8 can use order_by(Lower('name')), has the order by unaccent
too?
--
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...@googlegro
I want to pass an argument to delete an object, that argument will be
handled by the signal.
Car.objects.get(pk=1).delete(deleted_by=someone)
models:
@receiver(post_delete, sender=Car)
def ref_person(sender, instance, **kwargs):
who_deleted = ?
How do I get this argument?
--
You rec
通过远程计算机,您无法打开地址?如果是这样,你应该用你的电脑的IP要访问。
--
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 emai
Hi guys, I need a help here:
*settings.py*
TIME_ZONE = 'America/Sao_Paulo'
*view.py:*
task = Task.objects.get(id=id)
task.start = request.GET['task_start']
tarefa.save()
Terminal:
RuntimeWarning: DateTimeField Task.start received a naive datetime
(2014-07-21 07:39
Using 'locals ()' would slow page loading? What is better?
--
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
I have the following line:
Olá a todos bem-vindos ao site!
After using makemessages is generated the following lines in the '.po' file:
msgid "Olá a todos, bem-vindo!"
msgstr ""
I repeat the span tag? Or is there a method to not appear in the
translation file?
--
You received this message be
I'm trying to do a post_save but he doesn't work, I am using*
objects.create()*:
*views:*
Usuario.objects.create(name='')
*models:*
@receiver(models.signals.post_save, sender=Usuario)
def auto_abc(sender, instance, **kwargs):
...
Why my post_save doesn't work with objects.create()?
I'm using post_save but he is in loop:
@receiver(models.signals.post_save, sender=Cars)
def auto_num_on_save(sender, instance, **kwargs):
my code
instance.save()
How do I save changes without calling post_save again?
--
You received this message because you are subscribed to the Go
I want to filter results with and without accents, but Django can not do
it.
In my database has the word "áéíóú", but when I do:
People.objects.filter (name__icontains = 'aeiou')
Returns nothing. Django how to return the result with and without accent?
(I am using PostgreSQL and Django 1.7
Hello,
I have it model:
class People(models.Model):
> children = models.ManyToManyField('self', blank=True, null=True)
I want to filter the first of each family tree. *Knowing that children can
have children
How I do it?
People.objects.filter()
--
You received this message because
Hi, im using template tag 'cycle' (in Django version 1.7.1,) and is showing
it in my terminal:
RemovedInDjango18Warning: 'The `cycle` template tag is changing to escape
> its arguments; the non-autoescaping version is deprecated. Load it from the
> `future` tag library to start using the new be
Thanks
Em domingo, 2 de novembro de 2014 02h05min42s UTC-2, Carl Meyer escreveu:
>
> On 11/01/2014 01:36 PM, Neto wrote:
> > Hi, im using template tag 'cycle' (in Django version 1.7.1,) and is
> > showing it in my terminal:
> >
> > RemovedInDjang
How access verbose_name of a instance in template?
I have:
car = Car.objects.get(pk=1)
In my template:
{{ car.color.??? }} {{ car.color }}
I wanna print the verbose_name, i want to it:
Color: red
--
You received this message because you are subscribed to the Google Groups
"Django users" gro
I changed a CharField to IntegerField and when I did ./manage.py migrate,
appeared the message on terminal:
django.db.utils.ProgrammingError: column "rotulo" cannot be cast
automatically to type integer HINT: Specify a USING expression to perform
the conversion.
What is it?
--
You received
before was empty, but I deleted the column and remade, thanks
Em terça-feira, 30 de dezembro de 2014 11h52min14s UTC-2, Neto escreveu:
>
> I changed a CharField to IntegerField and when I did ./manage.py migrate,
> appeared the message on terminal:
>
> django.db.utils.Programmi
, and Erick excuse my lack of kindness, I'm a little stressed.
Em sexta-feira, 22 de abril de 2016 01:59:25 UTC-3, Neto escreveu:
>
> I'm trying to delete but it's happening a strange error.
>
> models:
> class Account(models.Model):
> pass
>
>
>
Hi, I am trying to delete an Account that delete in cascade others objects,
but I have a post_delete in Car model that create a Log that have relation
with this Account.
The django apparently can not handle the error. How to solve this?
Models:
class Account(models.Model):
pass
class Car(
Stephen, CarLog is inheriting Log.
Em sábado, 23 de abril de 2016 17:14:57 UTC-3, Stephen Butler escreveu:
>
> Look a little closer at the error message:
>
> Error:
>>
>> insert or update on table "myapp_log" violates foreign key constraint
>> "myapp_log_account_id_6ea8d7a6_fk_myapp_account_id"
>
in 1.9 and ran your sample. It works fine
> for me. The delete() returns that it deleted 4 objects: the Account, Car,
> Log, and CarLog. There's something else in your project that is causing the
> error.
>
> On Sat, Apr 23, 2016 at 3:42 PM, Neto
> > wrote:
>
>&g
ing a "with transaction.atomic()" inside the
> try block should do the same thing. But it's not. Maybe someone else knows?
>
> On Sat, Apr 23, 2016 at 10:19 PM, Neto > wrote:
>
>> Stephen, I am using Django 1.9.5, PostgreSQL 9.3
>> I do no
t;
>
> -- Outside the signal, more cascades
>
> DELETE FROM "myapp_log" WHERE "myapp_log"."id" IN (1);
>
> -- Finally, delete the account, where we blow up
>
> DELETE FROM "myapp_account" WHERE "myapp_account"."id&q
My project has several apps, some of them depend on others, it is ok to add
for example 3 apps within another app?
--
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
It does not works:
from django.db.models.functions import Lower
class Person(models.Model):
name = models.CharField(_('name'), max_length=100)
class Meta:
ordering = [Lower('name')]
--
You received this message because you are subscribed to the Google Groups
"Django user
Thanks
Em terça-feira, 7 de junho de 2016 01:21:09 UTC-3, Simon Charette escreveu:
>
> Hi Neto,
>
> Ordering by expression (order_by(Lower('name')) is not supported yet but
> it's
> tracked as a feature request[1].
>
> If we manage to allow transfor
I have a field with *limit_choices_to*, and want it to be only filtered
items related the account ('ID') user. How can I do this?
Example (Does not work):
class Car(models.Model):
user = models.ForeignKey(User)
color = models.CharField(max_length=200)
typeo = models.ForeignKey(Typeo,
I'm trying to get number of records per month, but Django does not return
correctly when there is "ordering" in class Meta Model.
I have the Abc model, with 4 records made this month, look what happens
(Django 1.10, PostgreSQL):
class Abc(Base):
class Meta:
ordering = ['-date_p
e that:
> https://docs.djangoproject.com/en/stable/topics/db/aggregation/#interaction-with-default-ordering-or-order-by
>
> On Wednesday, August 10, 2016 at 3:44:33 PM UTC-4, Neto wrote:
>>
>> I'm trying to get number of records per month, but Django does not return
>>
Hi, It is a good practice to add or edit an object in the same view or is
it better to separate?
*For example:*
def add_edit(request, id=None):
form = MyForm(request.POST or None)
if request.method == 'POST':
if form.is_valid():
form.save()
return HttpResp
How access verbose_name of a field in template?
I have an object:
p = Person.objects.get(pk=1)
and I wanna access same verbose_name in template like it:
{{ p.name.__verbose_name }}: {{ p.name }}
{{ p.birth_date.__verbose_name }}: {{ p.birth_date }}
*result:*
Name: Maria
Birth date: 1990-04-0
If is to do that way, I prefer to do manually. I would like to access the
direct verbose_name the template. Is possible that the "Django developers"
could do this?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group
$.post( "ajax/test.html", function( data ) {
$( ".result" ).html( data );
});
Em terça-feira, 15 de dezembro de 2015 20:25:12 UTC-2, larry@gmail.com
escreveu:
>
> I am sending an ajax POST request like this:
>
> $.ajax({
> url: url,
> method: 'POST',
> dataType: "json",
>
I'm trying to send emails with Amazon SES, but when I use default
EMAIL_BACKEND raise error:
Config:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # this is
default
EMAIL_HOST = 'email-smtp...amazonaws.com'
EMAIL_PORT = 465
EMAIL_HOST_USER = '...'
EMAIL_HOST_PASSWORD = '...'
EMA
Thanks guys, 587 worked
Em segunda-feira, 28 de março de 2016 21:56:12 UTC-3, Neto escreveu:
>
> I'm trying to send emails with Amazon SES, but when I use default
> EMAIL_BACKEND raise error:
>
> Config:
>
> EMAIL_BACKEND = 'django.core.mail.backends.smtp.Ema
How do I access protected directories using Django? I have the following
configuration but is not working, there is always page 404 when I try to
access the directory.
*Django:*
def test(request):
file_url = 'http://mysite.com/media/users/avatar.png'
response = HttpResponse()
respon
I need to build a server using nginx to run sentry, I needed a routine to
install all the necessary packages, and configure the server.
I am using Ubuntu, Nginx, Django.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this g
-feira, 5 de abril de 2016 15:54:07 UTC-3, Neto escreveu:
>
> I need to build a server using nginx to run sentry, I needed a routine to
> install all the necessary packages, and configure the server.
> I am using Ubuntu, Nginx, Django.
>
--
You received this message because you are su
In my localhost is everything migrated, but in production have "Run
'manage.py makemigrations' to make new migrations, and then re-run
'manage.py migrate' to apply them."
How to know which models have changed and need make migrations? Exist a
command to know?
--
You received this message becau
I know, but in production is showing the message that I have to do
makemigrations.
I need a command to know what models need to makemigrations
Em quinta-feira, 7 de abril de 2016 14:50:54 UTC-3, Daniel Roseman escreveu:
>
> You shouldn't ever need to make migrations in production. You make them i
Hi,
I have a middleware that checks whether the user is logged in.
class Check(object):
"""
Check
"""
@staticmethod
def process_request(request):
def is_authenticated_user():
try:
request.session['user']
except KeyError:
eira, 20 de abril de 2016 14:58:03 UTC-3, 술욱 زولوكْ escreveu:
>
> What's the value of request.session['user'] when user is not logged in?
>
> My guess is it's an instance of AnonymousUser.
>
> 2016-04-20 11:43 GMT-03:00 Neto >:
> >
I'm trying to delete but it's happening a strange error.
models:
class Account(models.Model):
pass
class Log(models.Model):
account = models.ForeignKey('Account', on_delete=models.CASCADE)
class ActionLog(Log):
action = models.ForeignKey('Action', on_delete=models.SET_NULL)
class
I'm trying to delete but it's happening a strange error.
models:
class Account(models.Model):
pass
class Action(models.Model):
account = models.ForeignKey('Account', on_delete=models.CASCADE)
class Log(models.Model):
account = models.ForeignKey('Account', on_delete=models.CASCADE)
Erick, *ActionLog* is inheriting *Log*. Please, pay attention before
commenting, and see that the error has nothing to do with what you said.
Em sexta-feira, 22 de abril de 2016 01:59:25 UTC-3, Neto escreveu:
>
> I'm trying to delete but it's happening a strange error.
>
--
> Regards,
> Sithembewena Lloyd Dube
> http://www.lloyddube.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe fr
t; --
> 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 this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For mor
, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA in Design Digital* - 2008 - FIC
*Analysis and Systems Development* - 2011 - Estácio
*D**esign and Implementation of Internet
arcin Tustin
> Tel: 07773 787 105
>
>
> --
> 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 this group, send email to
http://www.djangopackages.com/ out?
--
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA in Design Digital* - 2008 - FIC
*Analysis and Systems Development* - 2011 - Estácio
*D**esign and Implementation of Internet Environments* - 2003 - FIC
--
You received this
ss Magee %-)
>
> On Fri, Aug 10, 2012 at 7:43 PM, Mário Neto wrote:
> > http://www.djangopackages.com/ out?
> >
> > --
> > Att. Mário Araújo Chaves Neto
> > Programmer, Designer and U.I. Engineer
> >
> > MBA in Design Digital - 2008 - FIC
> &g
s.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
--
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA
e Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com
cr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Regards
> Nikhil Verma
> +91-958-273-3156
>
> --
> You received this message because you are subscribed to the G
> 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 this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more op
PATH = os.path.join(os.path.dirname(__file__))
>
--
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA in Design Digital* - 2008 - FIC
*Analysis and Systems Development* - 2011 - Estácio
*D**esign and Implementation of Internet Environments* - 2003 - FIC
--
You
; Cel: (21) 9188-4860
>
> VÁ PARA BÚZIOS!!!
> http://www.agh.com.br/
> Ane Guest House
>
> --
> 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.
t this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA in Design Digital* - 2008 - FIC
*Analysis and Systems Develo
J. London
>
> --
> 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, se
ving 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/op
p, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA in Design Di
m.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
ished polls."""
>>> return Poll.objects.order_by('-pub_date')[:5]
>>>
>>>
>>>
>>> I mean will "context_object_name" be able to separate between several
>>> "get_queryset(self)"?
>>> Be
;
> Any help would be appreciate
>
> Thanks.
>
> *EDIT: When I off VIRTUALENV and install proper version of Django and the
> project's dependencies, My project works well, without any issue. . .
> statics are shown as it should*
>
>
> --
> You received this mess
Paste your code in http://dpaste.com and share the link in this group
Em 22/08/2013 12:42, "Gerd Koetje" escreveu:
> In many posts i submit django code.
> I tried to use the < c o d e > < / c o d e > tag but it doesnt format it
> very nicely
> Is there a other tags to use?
>
> --
> You received
it
> https://groups.google.com/d/msgid/django-users/b1715b43-ca4c-4c17-8863-beca7501fcdd%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*MBA in Design Digital* -
quot; group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
Att.
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 this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more opti
ma }}
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubsc
ance
João Dias de Carvalho Neto
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/AedIU8JdetoJ.
To post to this group, send email to django-u
Hi all,
I have an application with Django with database routers. Basically I got
the request path, split it to get subdomain name and set the database by
this way.
I do not use default database, so I do not migrate it.
This route action It's working very well but I am still facing trouble when
Dear friend,
First of all, welcome to the Django community.
I recommend you to complete the Django tutorial
(https://docs.djangoproject.com/en/1.10/intro/tutorial01/).
If you have time, buy and complete the book Django Unleashed
(https://django-unleashed.com/).
Good luck,
Florencio
Em sábado, 2
79 matches
Mail list logo