login_required in urlpatterns TypeError 'tuple' object is not callable
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 /home/ 'tuple' object is not callable how to fix this? -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a0a93906-ce10-4b46-bb7a-67aa8d458a6c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How migrate a CustomUser?
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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c2d578d7-ac96-4131-a079-310799575b05%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django QuerySets, how to express EXISTS ... IN ...
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, title, content) > Tag ( name, blog_id ) > with Tag.blog_id foreign key of Blog.id > I want to select all blog entries that contain a certain set of tags. > For instance, I would express the query in SQL as: > SELECT * FROM blog_blog b WHERE EXISTS ( SELECT 1 FROM blog_tag t WHERE > t.blog_id = b.id AND lower(t.name) IN ('tag1', 'tag2', 'tag3') ); > > How to represent the same query with the Django QuerySets ? > > Thanks, > Dean De Leo > > > -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1f6e32ea-c2ec-4552-aabf-19e6840d753c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django QuerySets, how to express EXISTS ... IN ...
Your model is incorrect. Each blog has only one tag? So you have only one result per tag. Tag.objects.get(name = "Alpha").blog Em domingo, 8 de fevereiro de 2015 15:43:33 UTC-2, Dean De Leo escreveu: > > Hi, thanks for the reply. > I still get the error: > Exception Type: AttributeError Exception Value: > > 'Tag' object has no attribute 'blog_set' > > > if rawtags: > taglist = rawtags.split('/');t = Tag.objects.get(name = "Alpha"); > blogentries = t.blog_set.all()else: > blogentries = Blog.objects.all(); > > > > My Models: > > # My blogclass Blog(models.Model): > title = models.CharField(max_length=255) > content = models.TextField(max_length=1); > dateAdd = models.DateTimeField(auto_now_add=True, null=False); > dateEdit = 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: > unique_together = [("name", "blog",)] > ordering = ["name"] > > > Am I mispelling something? > > Thanks, > Dean De Leo > > > > On 08/02/15 16:55, Neto wrote: > > 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, title, content) >> Tag ( name, blog_id ) >> with Tag.blog_id foreign key of Blog.id >> I want to select all blog entries that contain a certain set of tags. >> For instance, I would express the query in SQL as: >> SELECT * FROM blog_blog b WHERE EXISTS ( SELECT 1 FROM blog_tag t WHERE >> t.blog_id = b.id AND lower(t.name) IN ('tag1', 'tag2', 'tag3') ); >> >> How to represent the same query with the Django QuerySets ? >> >> Thanks, >> Dean De Leo >> >> >> > -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/aadb6aac-ade4-4fe8-9d0b-d0a9ec74d159%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Django 1.8 ImportError: No module named formtools
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 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4e7d04cc-1ea4-488d-9359-ffaf07123231%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django 1.8 ImportError: No module named formtools
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 release note > <https://docs.djangoproject.com/en/dev/releases/1.8/#removal-of-django-contrib-formtools> > : > > The formtools contrib app has been moved into a separate package. >> *django.contrib.formtools* itself has been removed. The docs provide >> migration >> instructions >> <https://docs.djangoproject.com/en/dev/ref/contrib/formtools/#formtools-how-to-migrate> >> . >> >> The new package is available on Github >> <https://github.com/django/django-formtools/> and on PyPI. >> > > TLDR; pip install django-formtools and replace all your references to > *django.contrib.formtools* to *formtools*. > > Simon > > Le mercredi 11 mars 2015 00:33:29 UTC-4, Neto a écrit : >> >> 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 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4bc1d119-292b-4514-bce3-b2a0e9176e7e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Django 1.8 post_save without recursion
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 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d5efddeb-4c74-41dd-80ba-de90134152c6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
When I mark to delete the formset, django requires complete all fields, he does not ignore the marked form to delete.
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>>> ArticleFormSet = formset_factory(ArticleForm, can_delete=True, min_num=1, extra=0) {{ formset.management_form }} {% for form in formset %} {{ form.title }} {{ form.pub_date }} {% if formset.can_delete %} {{ form.DELETE }} {% endif %} {% endfor %} -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7ecb3486-818c-4051-84e2-168b506b5c10%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: MercadoPago Applications
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 tengo implementado MercadoPago en algunos proyectos para recibir pagos, > pero ahora en un proyecto necesito que los usuarios puedan recibir pagos de > otros usuarios y que el sitio se quede con una comisión, para ello > supuestamente está MercadoPago MarketPlace, alguien lo utilizó? > > Gracias > -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ff48e2bb-6c59-4ab0-b880-995811856618%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Using unaccent in order_by?
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...@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. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/39f1f36e-b58f-42d4-9691-8fe6eae83cb5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How to pass arguments when deleting an object? ex: object.delete(deleted_by=someone)
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 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3ed8e143-7dbd-4de1-ad6f-3b54e12cefca%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: 想用中文说清楚:我在远程工作机服务器上建立了django框架,想启动web server ,启动成功,但是无法打开127.0.0.1:8000 ,中间端口转接该怎么做
通过远程计算机,您无法打开地址?如果是这样,你应该用你的电脑的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 email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/029d94b6-7967-4921-ba3e-16c8d3fe3a01%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
RuntimeWarning: DateTimeField Task.start received a naive datetime (2014-07-21 07:39:14) while time zone support is active. RuntimeWarning)
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:14) while time zone support is active. RuntimeWarning) What is it? Any solution? -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e06f3e0f-e3f2-4c74-8161-411a668a6928%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Should I use 'locals()' or create a dictionary with the template variables? What is better?
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 this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/82e5ca4e-19af-403b-b64c-615b781532c8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How ignore tags when use makemessages?
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 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/11076dad-f1cb-461a-ac7b-ef4cead0adc5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
post_save doesn't work
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()? How I do? -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/02400078-5b4b-4f6f-a0f7-05f6cd61bee3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Question about post_save
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 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/91745299-16fe-477a-b532-f2580e806d91%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Problem with accents when filter
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) -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/04f1e13c-c685-49fd-be28-260e01f72745%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How to filter results that are not part of a ManyToManyField?
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 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bf602691-c33e-4192-a8bf-ec5d4a5e1915%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Warning with 'cycle'
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 behavior. In template: Am I doing something wrong? -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a3ecc17c-5fc9-4a30-8b27-281fc317f548%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Warning with 'cycle'
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: > > > > 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 > behavior. > > > > > > In template: > > > > > > > > Am I doing something wrong? > > Not "wrong", exactly, but you should add a `{% load cycle from future > %}` at the top of this template to make the behavior more > future-compatible. See the note at the end of the documentation for the > cycle tag: > https://docs.djangoproject.com/en/1.7/ref/templates/builtins/#cycle > > Carl > > -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d7e3f236-cc5d-46be-b247-f7c6c51c673b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How access verbose_name of a instance in template?
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" 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1eaa4aba-1fe0-49b4-a397-381047b4c72a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Error when change a CharField to IntegerField
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 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/67d68cf4-4feb-4656-b8e0-2651f9e25830%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Error when change a CharField to IntegerField
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.ProgrammingError: column "rotulo" cannot be cast > automatically to type integer HINT: Specify a USING expression to perform > the conversion. > > What is it? > -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9d3a5dae-2dc9-4654-a6c2-94e3eeb8bbe2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Strange Bug
I discovered the problem, I have a post_delete for Action that creates a log, the problem is that this log is related to the Account, and it tries to create a log for an account being deleted, this was the conflict. Unfortunately Django does not say that the problem was in post_save. Thank you, 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 > > > class Action(models.Model): > account = models.ForeignKey('Account', on_delete=models.CASCADE) > > > class Log(models.Model): > account = models.ForeignKey('Account', on_delete=models.CASCADE) > > > class ActionLog(Log): > action = models.ForeignKey('Action', on_delete=models.SET_NULL) > > > shell: > > account = Account.objects.create() > action = Action.objects.create(account=account) > ActionLog.objects.create(account=account, action=action) > account.delete() > > > error: > > insert or update on table "myapp_log" violates foreign key constraint > "myapp_log_account_id_6ea8d7a6_fk_myapp_account_id" > DETAIL: Key (account_id)=(11) is not present in table "myapp_account". > > But: > >>> Account.objects.last().id > 11 > > > Why it happen? How solve it? Is a bug? > I am using PostgreSQL 9.3 and Django 1.9.5 > -- 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/dbd254ef-6103-44cb-83de-490bacfac7f2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Django apparently can't handle that error.
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(models.Model): account = models.ForeignKey('Account', on_delete=models.CASCADE) class Log(models.Model): account = models.ForeignKey('Account', on_delete=models.CASCADE) class CarLog(Log): car = models.ForeignKey('Car', null=True, blank=True, on_delete=models.SET_NULL) @receiver(post_delete, sender=Car): def create_car_log(sender, instance, **kwargs): try: CarLog.objects.create( account=instance.account, ) except: pass Shell: >>> account = Account.objects.create() >>> car = Car.objects.create(account=account) >>> CarLog.objects.create(account=account, car=car) >>> account.delete() # when delete car will try to create a log related with that account, but... Error: insert or update on table "myapp_log" violates foreign key constraint "myapp_log_account_id_6ea8d7a6_fk_myapp_account_id" DETAIL: Key (account_id)=(11) is not present in table "myapp_account". It's happening this error rather than the exception. -- 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/30775c1b-e7e8-439d-9a6e-7cef8667c6ab%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django apparently can't handle that error.
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" >> DETAIL: Key (account_id)=(11) is not present in table "myapp_account". >> >> It's happening this error rather than the exception. >> > > The table is myapp_log, not myapp_carlog. The error isn't in the > post_delete signal you're showing up. Do you have a post_delete for Account > objects? > -- 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/92e72312-5678-428b-ad7f-360ad911ceaa%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django apparently can't handle that error.
Stephen, I am using Django 1.9.5, PostgreSQL 9.3 I do not know, maybe the order of the apps may be interfering in the way Django sorts the commands to be sent to the postgresql. INSTALLED_APPS = [ 'core', # here: Account, Log 'myapp', # here: Car, CarLog What is happening is that post_delete is trying to create a log for an account that does not exist. The exception doesn't works. This seems to be a bug. Em sábado, 23 de abril de 2016 18:28:08 UTC-3, Stephen Butler escreveu: > > Sorry, I did miss that. > > I created a quick test project 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: > >> 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" >>>> DETAIL: Key (account_id)=(11) is not present in table "myapp_account". >>>> >>>> It's happening this error rather than the exception. >>>> >>> >>> The table is myapp_log, not myapp_carlog. The error isn't in the >>> post_delete signal you're showing up. Do you have a post_delete for Account >>> objects? >>> >> -- >> 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...@googlegroups.com . >> To post to this group, send email to django...@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/92e72312-5678-428b-ad7f-360ad911ceaa%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/92e72312-5678-428b-ad7f-360ad911ceaa%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 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/02b1ab5b-d7e3-4df2-9738-9c1636e931c5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django apparently can't handle that error.
This works for you? Not for me! This error continues to ignore the exception. Even using exception continues to show django.db.utils.IntegrityError Em domingo, 24 de abril de 2016 00:52:46 UTC-3, Stephen Butler escreveu: > > Ahh, Postgres is the problem. When your exception is thrown then Postgres > aborts the rest of the transaction. That's how its transaction handling > works. Even though you ignore the exception in the myapp code, it will > still cause the transaction to abort when Django tries to call commit(). > When I was testing I was using sqlite, which behaves differently. > > See the note here: > https://docs.djangoproject.com/en/1.9/topics/db/transactions/#handling-exceptions-within-postgresql-transactions > > This works for me: > > @receiver(post_delete, sender=Car) > def create_car_log(sender, instance, **kwargs): > sid = transaction.savepoint() > try: > CarLog.objects.create( > account=instance.account, > ) > transaction.savepoint_commit(sid) > except: > transaction.savepoint_rollback(sid) > > What I don't get is that using 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 not know, maybe the order of the apps may be interfering in the way >> Django sorts the commands to be sent to the postgresql. >> >> INSTALLED_APPS = [ >> 'core', # here: Account, Log >> 'myapp', # here: Car, CarLog >> >> >> What is happening is that post_delete is trying to create a log for an >> account that does not exist. The exception doesn't works. >> This seems to be a bug. >> >> Em sábado, 23 de abril de 2016 18:28:08 UTC-3, Stephen Butler escreveu: >>> >>> Sorry, I did miss that. >>> >>> I created a quick test project 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: >>> >>>> 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" >>>>>> DETAIL: Key (account_id)=(11) is not present in table "myapp_account". >>>>>> >>>>>> It's happening this error rather than the exception. >>>>>> >>>>> >>>>> The table is myapp_log, not myapp_carlog. The error isn't in the >>>>> post_delete signal you're showing up. Do you have a post_delete for >>>>> Account >>>>> objects? >>>>> >>>> -- >>>> 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...@googlegroups.com. >>>> To post to this group, send email to django...@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/92e72312-5678-428b-ad7f-360ad911ceaa%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/django-users/92e72312-5678-428b-ad7f-360ad911ceaa%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 django-users...@googlegroups.com . >> To post to this group, send email to django...@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/02b1ab5b-d7e3-4df2-9738-9c1636e931c5%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/02b1ab5b-d7e3-4df2-9738-9c1636e931c5%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 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/9b6ded86-c084-4842-ab41-4f40624df0a6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Django apparently can't handle that error.
The right is just Account.objects.last().delete() to delete everything related to account. My project has many models related to account, and everything has log, is unfeasible be deleting the rows of each model to the end delete the account. Django needs to handle it. Em terça-feira, 26 de abril de 2016 00:58:31 UTC-3, Stephen Butler escreveu: > > Damn. It did work once, but now I can't reproduce it. But turning on SQL > logging it's clear that what's happening isn't what I said it was. > > I get a sequence essentially like this at acct.delete(): > > -- Django selecting all the things it needs to cascade/update b/c of m2m > > SELECT * FROM "myapp_car" WHERE "myapp_car"."account_id" IN (1); > > SELECT * FROM "myapp_carlog" INNER JOIN "myapp_log" ON > ("myapp_carlog"."log_ptr_id" = "myapp_log"."id") WHERE > "myapp_carlog"."car_id" IN (1); > > SELECT * FROM "myapp_log" WHERE "myapp_log"."account_id" IN (1); > > > -- Django doing the m2m DELETEs and UPDATEs > > DELETE FROM "myapp_carlog" WHERE "myapp_carlog"."log_ptr_id" IN (1); > > UPDATE "myapp_carlog" SET "car_id" = NULL WHERE > "myapp_carlog"."log_ptr_id" IN (1); > > DELETE FROM "myapp_car" WHERE "myapp_car"."id" IN (1); > > > -- This is the signal firing for Car delete > > SAVEPOINT "s140735184359424_x3"; > > SELECT "myapp_account"."id" FROM "myapp_account" WHERE > "myapp_account"."id" = 1; > > INSERT INTO "myapp_log" ("account_id") VALUES (1) RETURNING > "myapp_log"."id"; > > INSERT INTO "myapp_carlog" ("log_ptr_id", "car_id") VALUES (4, NULL); > > RELEASE SAVEPOINT "s140735184359424_x3"; > > > -- 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" IN (1); > > So as you can see, the reason the signal Exception isn't caught is because > it isn't thrown! The problem is that Django builds a list of every > DELETE/UPDATE it needs to make on CarLog and you modify CarLog afterwards. > > One way to break this race condition is to call > Car.objects.filter(account=acct).delete() first, then acct.delete(). I > think that should work, even if it is a little more verbose. Probably will > want to wrap that in a transaction.atomic(). > > > On Mon, Apr 25, 2016 at 12:46 PM, Neto > wrote: > >> This works for you? Not for me! This error continues to ignore the >> exception. >> Even using exception continues to show django.db.utils.IntegrityError >> >> Em domingo, 24 de abril de 2016 00:52:46 UTC-3, Stephen Butler escreveu: >>> >>> Ahh, Postgres is the problem. When your exception is thrown then >>> Postgres aborts the rest of the transaction. That's how its transaction >>> handling works. Even though you ignore the exception in the myapp code, it >>> will still cause the transaction to abort when Django tries to call >>> commit(). When I was testing I was using sqlite, which behaves differently. >>> >>> See the note here: >>> https://docs.djangoproject.com/en/1.9/topics/db/transactions/#handling-exceptions-within-postgresql-transactions >>> >>> This works for me: >>> >>> @receiver(post_delete, sender=Car) >>> def create_car_log(sender, instance, **kwargs): >>> sid = transaction.savepoint() >>> try: >>> CarLog.objects.create( >>> account=instance.account, >>> ) >>> transaction.savepoint_commit(sid) >>> except: >>> transaction.savepoint_rollback(sid) >>> >>> What I don't get is that using 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 not know, maybe the order of the apps may be interfering in the >>>> way Django sorts the commands to be sent to the postgresql. >>>> >>>> INSTALLED_APPS = [ >>>> 'core', # here: A
Is a good practice to put app inside another?
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 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/8f2d102b-6752-49d2-b9d8-c425f1ee0e80%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How to set default ordering to Lower case?
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 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/07398d69-2af5-4dad-9bf9-0eb32248e65f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to set default ordering to Lower case?
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 transforms in `order_by()`[2] in the future you > should be > able to define a ['name__lower'] ordering in the future but until then you > have to use a combination of `annotate()` and `order_by()` on a custom > manager: > > class PersonManager(models.Manager): > def get_queryset(self, *args, **kwargs): > queryset = super(PersonManager, self).get_queryset(*args, **kwargs) > return queryset.annotate( > name_lower=Lower('name'), > ).order_by('name_lower') > > class Person(models.Model): > name = models.CharField(_('name'), max_length=100) > > objects = PersonManager() > > Cheers, > Simon > > [1] https://code.djangoproject.com/ticket/26257 > [2] https://code.djangoproject.com/ticket/24747 > > Le lundi 6 juin 2016 19:21:32 UTC-4, Neto a écrit : >> >> 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 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/61059ffb-32d9-4bab-a932-e48732f11083%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Accessing session in Django models?
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, limit_choices_to={'user__id': session['user_id']}) -- 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/8d2b4b10-83b9-489c-b834-31ddebc0c9df%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
(Is it a bug?) TruncMonth does not work when there is "ordering" in the model Meta (Django 1.10)
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_pub'] >>> Abc.objects.annotate(month=TruncMonth('created_at')).values('month'). annotate(total=Count('id')).values('total') Without "ordering" class Abc(Base): pass >>> Abc.objects.annotate(month=TruncMonth('created_at')).values('month'). annotate(total=Count('id')).values('total') Why this happens? Is it a bug? -- 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/a32691ce-1106-4777-9743-0ea4fe8f6642%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: (Is it a bug?) TruncMonth does not work when there is "ordering" in the model Meta (Django 1.10)
Thanks! Should have a note about it on the page "database-funcions": https://docs.djangoproject.com/en/1.10/ref/models/database-functions/#trunc Em quarta-feira, 10 de agosto de 2016 17:17:31 UTC-3, Tim Graham escreveu: > > Default ordering affects aggregation queries like 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 >> 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_pub'] >> >> >> >>> Abc.objects.annotate(month=TruncMonth('created_at')).values('month'). >> annotate(total=Count('id')).values('total') >> >> >> Without "ordering" >> >> class Abc(Base): >> pass >> >> >> >>> Abc.objects.annotate(month=TruncMonth('created_at')).values('month'). >> annotate(total=Count('id')).values('total') >> >> >> Why this happens? Is it a bug? >> > -- 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/291022f5-6f49-4193-822c-1156aa5311f0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
It is a good practice to add or edit an object in the same view?
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 HttpResponse('success') render(request, 'add_edit.html', locals()) -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/77ee3182-dc25-4562-b083-e982033164c8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How access verbose_name of a field in template?
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-07 How I do it? Have some way of access verbose_name? I am using Django 1.8 -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a315acfc-569e-42c7-bd2c-fd37e9693715%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How access verbose_name of a field in template?
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 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b811a0c5-5aed-49b9-9835-3baab66a7ad6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: ajax POST request being sent as GET
$.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", > data: { > recipe: recpie > } > }) > > But the request is being sent as a GET: > > Request URL: http://127.0.0.1/api/update_measbox?recipe=MALBHDPOR > Request Method: GET > Status Code:200 OK > Remote Address:127.0.0.1:80 > > Any ideas as to why this is happening and how I can get it sent it as a > POST? > -- 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/89407d5d-da38-4361-8d15-bf91f73743a6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
EMAIL_BACKEND doesn't works with Amazon SES!?
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 = '...' EMAIL_USE_TLS = True Error: raise SMTPServerDisconnected("Connection unexpectedly closed") smtplib.SMTPServerDisconnected: Connection unexpectedly closed If I use: EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend' from https://github.com/bancek/django-smtp-ssl, works right. Code of this backend: import smtplib from django.core.mail.utils import DNS_NAME from django.core.mail.backends.smtp import EmailBackend class SSLEmailBackend(EmailBackend): def open(self): if self.connection: return False try: self.connection = smtplib.SMTP_SSL(self.host, self.port, local_hostname=DNS_NAME.get_fqdn()) if self.username and self.password: self.connection.login(self.username, self.password) return True except: if not self.fail_silently: raise What the problem with default EMAIL_BACKEND? Why I can't use him? -- 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/d71c947b-db14-4373-b412-41e5dc5a7cff%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: EMAIL_BACKEND doesn't works with Amazon SES!?
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.EmailBackend' # this is > default > EMAIL_HOST = 'email-smtp...amazonaws.com' > EMAIL_PORT = 465 > EMAIL_HOST_USER = '...' > EMAIL_HOST_PASSWORD = '...' > EMAIL_USE_TLS = True > > Error: > > raise SMTPServerDisconnected("Connection unexpectedly closed") > smtplib.SMTPServerDisconnected: Connection unexpectedly closed > > If I use: > > EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend' > > from https://github.com/bancek/django-smtp-ssl, works right. > > Code of this backend: > > import smtplib > > from django.core.mail.utils import DNS_NAME > from django.core.mail.backends.smtp import EmailBackend > > class SSLEmailBackend(EmailBackend): > def open(self): > if self.connection: > return False > try: > self.connection = smtplib.SMTP_SSL(self.host, self.port, > local_hostname=DNS_NAME.get_fqdn()) > if self.username and self.password: > self.connection.login(self.username, self.password) > return True > except: > if not self.fail_silently: > raise > > What the problem with default EMAIL_BACKEND? Why I can't use him? > -- 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/8f5643f4-043a-4233-a0c3-2ca9c05a3a33%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Django + Nginx + X-Accel-Redirect
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() response['X-Accel-Redirect'] = file_url return response *Nginx:* server { listen 80; server_name mysite.com; location /media/ { internal; alias /home/ubuntu/webapps/myapp/media/; } } -- 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/c965f092-bf02-4146-8a5f-2e5f7fef90db%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Fabric - Someone has a fabfile to build a Sentry server?
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 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/542ea33c-1c8f-4602-8735-ac1f1c38edaa%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Fabric - Someone has a fabfile to build a Sentry server?
I need a fabric to install Sentry, Redis, and configure the server with nginx template, supervisor etc. I have a Amazon Instance, and I want with a command install everything. I have following the docs, but I had problem with sentry-worker (supervisor). My server also was too slow Em terça-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 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/a6b376d4-2c3d-49ae-a71d-aab60069ffde%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
How to know which models have changed and need make migrations?
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 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/2902f9a3-e7f6-43cb-b920-eb735f7e288f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: How to know which models have changed and need make migrations?
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 in > dev, commit to source control, deploy along with the rest of the code, then > run the migrations in prod. > > -- > DR. > -- 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/547338e9-71c7-455f-9acb-75d622077246%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Why when I call a method within a middleware does not return an HttpResponse?
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: return redirect(reverse('mysite:login')) is_authenticated_user() Why it does not works? How to solve? -- 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/7a9effe3-9fd3-42ff-bfd3-5ab7ea03030e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Why when I call a method within a middleware does not return an HttpResponse?
The problem is that when happens the exception, the redirect does not work, only if I put return before is_authenticated_user(), like this: class Check(object): """ Check """ @staticmethod def process_request(request): def is_authenticated_user(): try: request.session['user'] except KeyError: return redirect(reverse('mysite:login')) return is_authenticated_user() # why I need put "return" here? Em quarta-feira, 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 >: > > 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: > > return redirect(reverse('mysite:login')) > > > > > > is_authenticated_user() > > > > > > > > Why it does not works? How to solve? > > > > -- > > 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...@googlegroups.com . > > To post to this group, send email to django...@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/7a9effe3-9fd3-42ff-bfd3-5ab7ea03030e%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/1c984bab-f08f-4355-8aa2-c6e28b5ee579%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Strange bug
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 Action(models.Model): pass shell: account = Account.objects.create() action = Action.objects.create() ActionLog.objects.create(action=action, account=account) account.delete() error: insert or update on table "myapp_log" violates foreign key constraint "myapp_log_account_id_6ea8d7a6_fk_myapp_account_id" DETAIL: Key (account_id)=(11) is not present in table "myapp_account". But: >>> Account.objects.last().id 11 Why it happen? How solve it? Is a bug? I am using PostgreSQL 9.3 and Django 1.9.5 -- 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/82096082-1fb3-4ca6-88f5-672f698506df%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Strange Bug
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) class ActionLog(Log): action = models.ForeignKey('Action', on_delete=models.SET_NULL) shell: account = Account.objects.create() action = Action.objects.create(account=account) ActionLog.objects.create(account=account, action=action) account.delete() error: insert or update on table "myapp_log" violates foreign key constraint "myapp_log_account_id_6ea8d7a6_fk_myapp_account_id" DETAIL: Key (account_id)=(11) is not present in table "myapp_account". But: >>> Account.objects.last().id 11 Why it happen? How solve it? Is a bug? I am using PostgreSQL 9.3 and Django 1.9.5 -- 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/cc86e56d-d4c7-4230-9b51-51ae19de3a01%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Strange Bug
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. > > 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) > > > class ActionLog(Log): > action = models.ForeignKey('Action', on_delete=models.SET_NULL) > > > shell: > > account = Account.objects.create() > action = Action.objects.create(account=account) > ActionLog.objects.create(account=account, action=action) > account.delete() > > > error: > > insert or update on table "myapp_log" violates foreign key constraint > "myapp_log_account_id_6ea8d7a6_fk_myapp_account_id" > DETAIL: Key (account_id)=(11) is not present in table "myapp_account". > > But: > >>> Account.objects.last().id > 11 > > > Why it happen? How solve it? Is a bug? > I am using PostgreSQL 9.3 and Django 1.9.5 > -- 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/77639ae7-30cf-4e11-a3bf-59a0885c2745%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: django-avatar image src
instead this: MEDIA_URL = os.path.realpath(PROJECT_PATH + '/media/') try: MEDIA_URL = '/media/' 2010/11/5 Sithembewena Lloyd Dube > Update: I added AVATAR_STORAGE_DIR = MEDIA_ROOT to my settings.py file. > > When I load the page, the avatar's src is > "C:/Websites/TPFRepository/projectname/media/username/image.jpg" - which is > correct. if i paste that into Windows Explorer, I do find the image. > > Still, it is not displayed on the page. What am I missing? Any help would > be appreciated. > > Thanks, > Sithu. > > > On Fri, Nov 5, 2010 at 10:58 AM, Sithembewena Lloyd Dube < > zebr...@gmail.com> wrote: > >> Hi all, >> >> I installed the django-avatar app in my project and, in a template, i have >> the {% load avatar_tags %} and {% avatar user 65 %} template tags. When I >> load the page and view source, the avatar's alt tag is correct but the image >> src is wrong. It appears relative to the template's directory instead of >> pointing to the project's media directory. Naturally, it is not found there >> and does not display. >> >> In settings.py, I have: >> >> import os >> PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) >> MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media') >> MEDIA_URL = os.path.realpath(PROJECT_PATH + '/media/') >> >> What can I do to have the image src pointing to the correct avatar >> directory (C:\Websites\ProjectRepository\projectname\media)? >> >> Thanks... >> >> -- >> Regards, >> Sithembewena Lloyd Dube >> http://www.lloyddube.com >> > > > > -- > 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 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 A. Chaves Neto Designer / U.I. Engineer MBA - Design Digital -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django 1.4 beta 1 released
Cool! =) 2012/2/16 victoria > I just wanted to let you know that we have also released a new version > of BitNami DjangoStack 1.4b1 which bundles Django 1.4b1. I hope that > will make easier to test this new version without conflicting with > your current stable environment. > > http://bitnami.org/stack/djangostack > > > On Thu, Feb 16, 2012 at 5:27 AM, James Bennett > wrote: > > Hot off the presses, it's the first Django 1.4 beta! Blog post with > > more information is here: > > https://www.djangoproject.com/weblog/2012/feb/15/14-beta-1/ > > > > > > -- > > "Bureaucrat Conrad, you are technically correct -- the best kind of > correct." > > > > -- > > 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 options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > > > -- > 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 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 in Design Digital* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ANNOUNCE: Django 1.4 released
Great! \,,/_ 2012/3/23 James Bennett > Django 1.4 is finally here! > > For details, checkout the weblog: > > https://www.djangoproject.com/weblog/2012/mar/23/14/ > > And the release notes: > > https://docs.djangoproject.com/en/dev/releases/1.4/ > > -- > 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 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 in Design Digital* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: DISTINCT ON fields is not supported by this database backend
What's your database backend? https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.distinct Note This ability to specify field names is only available in PostgreSQL. []s 2012/6/24 Marcin Tustin > DISTINCT ON fields is not supported by this database backend > > What more is there to say? Either stop using the distinct method, or switch > to another database backend. > > > On Sun, Jun 24, 2012 at 11:24 AM, upmauro wrote: > >> Please help, >> >> http://dpaste.com/762942/ >> >> Thanks alot ! >> >> -- >> 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/-/v5qIbmtR5ZwJ. >> 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. >> > > > > -- > Marcin 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 > 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 in Design Digital* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
[Off Topic] djangopackages OUT?
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 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: [Off Topic] djangopackages OUT?
Thank's Russell! 2012/8/10 Russell Keith-Magee > Yes - it appears to be out. However, http://django.opencomparison.org > is still running, and should be the same content. > > I've contacted Daniel Greenfeld; hopefully this can be resolved quickly. > > Yours, > Russ 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 > > Analysis and Systems Development - 2011 - Estácio > > Design and Implementation of Internet Environments - 2003 - FIC > > > > -- > > 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 options, visit this group at > > http://groups.google.com/group/django-users?hl=en. > > -- > 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 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 in Design Digital* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: ANN: Django REST framework 2 released.
Amazing! Good work! :) 2012/10/30 Tom Christie > Hi all, > > I'm incredibly pleased to announce the release of Django REST framework 2. > > REST framework 2 is a comprehensive reworking of the original project. > Because this is a major re-design, rather than an incremental release, > we've skipped 1.x entirely, and called this version 2. > > Some of the things it includes: > > * A completely redesigned, and really-rather-nice serialization API that > mirrors Django's Forms/ModelForms > * Ties in cleanly and simply with Django's class-based-views. > * Virtually every aspect of the design has been worked on - the end result > is beautifully decoupled and simple. > * The (seriously awesome) browsable API gets a snazzy, fresh, new theme. > * The documentation has had a ton of love, is now built from markdown > source and gets a custom bootstrap style. > > It has been an absolutely *huge* amount of work to get this over the line. > I'm very proud indeed of the result, and I'd love it if you'd take a look. > > The full announcement & documentation is available here: > http://django-rest-framework.org/topics/rest-framework-2-announcement.html > > Thank you to everyone who's contributed to the project and helped make > this happen, > > Tom > > NB. There's also a post on http://hackerne.ws/ if anyone fancies > up-voting! > > > -- > 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/-/6Sm-297NsbgJ. > 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. *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 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django 1.4 alpha 1 released
Great, very very good! \,,/_ Congratulations!!! 2011/12/23 James Bennett > Tonight as part of the 1.4 development process, we've released the > first alpha for Django 1.4. You can read all about it on the blog: > > https://www.djangoproject.com/weblog/2011/dec/22/14-alpha-1/ > > And in the release notes: > > https://docs.djangoproject.com/en/dev/releases/1.4-alpha-1/ > > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of > correct." > > -- > 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 options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Att. Mário A. Chaves Neto Programmer, Designer and U.I. Engineer MBA - Design Digital -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: {% elif %} error
https://docs.djangoproject.com/en/dev/ref/templates/builtins/#firstof 2011/12/28 Nikhil Verma > Go to this link > > https://docs.djangoproject.com/en/dev/ref/templates/builtins/ > > {% if athlete_list %} > > Number of athletes: {{ athlete_list|length }} > *{% elif athlete_in_locker_room_list %}* > > Athletes should be out of the locker room soon! > {% else %} > No athletes. > {% endif %} > > press CLTR + F and type elif you will reach there > > > > > On Wed, Dec 28, 2011 at 12:38 PM, Tsung-Hsien wrote: > >> Thank you all! >> >> I don't see the line >> "New in Django Development version." >> >> On Dec 27, 10:44 pm, Tsung-Hsien wrote: >> > Hi, >> > I want to use {% elif %} >> > my template: >> > {% if bookmark.hours %} >> > {{ bookmark.hours }} hours ago >> > {% elif bookmark.days %} >> > {{ bookmark.days }} days ago >> > {% elif bookmark.months %} >> > {{ bookmark.months }} months ago >> > {% else %} >> > {{ bookmark.years }} years ago >> > {% endif %} >> > >> > show error: >> > Invalid block tag: 'elif', expected 'else' or 'endif' >> > >> > It can work without elif, if use if...else loop. >> > >> > my django version is 1.31 >> > >> > how to solve this? >> > 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-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. >> >> > > > -- > Regards > Nikhil Verma > +91-958-273-3156 > > -- > 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 options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Att. Mário A. Chaves Neto Programmer, Designer and U.I. Engineer MBA - Design Digital -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Happy new year
Happy new year from Brasil to all djangonautics of the world. Many django projects for all! Best regards. 2012/12/31 Ariel Calzada > Happy new year from Colombia > El 31/12/2012 16:42, escribió: > > Happy new year from spain to all django lovers. >> I wish you a new year with tons of django projects. >> >> Cheers >> Cingusoft >> BlackBerry de movistar, allí donde estés está tu oficin@ >> >> -- >> 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 options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> >> -- > 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 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 in Design Digital* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: how to set template and media directory in settings?
And trying like this: >>> PROJECT_PATH = os.path.abspath(os.path.dirname(__name__)) >>> PROJECT_PATH 'C:\\Users\\Mario' >>> os.path.join(os.path.dirname(PROJECT_PATH), "..") 'C:\\Users\\..' Best regards 2013/1/11 frocco > PROJECT_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 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django CRM Tool
Very good! Ezequiel =] 2013/1/15 Ezequiel Bertti > Try this: > http://tree.io/ > > > On Tue, Jan 15, 2013 at 7:05 PM, scaphilo wrote: > >> Hi >> Well this thread is a bit outdated but as you have not had any answers >> yet. >> >> Insted of starting from scratch you could perhaps start with >> www.koalix.org >> https://github.com/scaphilo/koalixcrm >> Its open source and under BSD licsense. So you can use it, modify it and >> sell it. >> >> >> >> >> Am Samstag, 2. Juni 2012 19:00:49 UTC+2 schrieb Zeeshan Syed: >>> >>> Hey everyone, >>> >>> I've been asked to create a CRM tool using Django. Just wondering what >>> route I should take. Would it be wise to start from scratch? Should I >>> play around with Django admin and mess around with that? I've looked >>> at the django-crm project, has anyone had any experience with that? >>> >>> Any help is much appreciated. >>> >>> Thanks, >>> Zee >> >> -- >> 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/-/V9NsFL6ObhwJ. >> 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. >> > > > > -- > Ezequiel Bertti > E-Mail: eber...@gmail.com > MSN: eber...@hotmail.com > 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. > 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 in Design Digital* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: FYI: Scheduled downtime on djangoproject.com Thursday night
Thank's Jacob! 2013/1/29 kl4us > nice one, i'm new on django and i'm reading documentation all day > > Il giorno martedì 29 gennaio 2013 18:11:48 UTC+1, Jacob Kaplan-Moss ha > scritto: > >> Hey folks -- >> >> MediaTemple, our hosting provider for djangoproject.com, is going to >> be taking our server offline Thursday night while they give us more >> RAM. >> >> The window for downtime is some time between 9PM and 4AM, though the >> actual downtime itself should be less than an hour. >> >> Since most people use the site for documentation, I'll remind you that >> you can always find a mirror of Django's documentation on Read the >> Docs: http://django.readthedocs.org/**. >> >> Thanks! >> >> Jacob >> > -- > 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 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 Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] Introducing Brillixy - Django admin skin & customization kit
Very good Alexey, Congratulations! =) 2013/3/12 Tomas Ehrlich > Hi Alex, > congratulation to alpha release of your app. > > I was about to suggest you django-bootstrap-admin, django-admin-tools > and django-fluent-dashboard, but since you already know Admin tools, > could you please provide more details about your app? I took a quick > look at demo page and read Readme file at github, but it seems to me > like lightweight version of django-bootstrap-admin. > > > Anyway, I wish you good luck in future development. > > Cheers, > Tom > > > Dne Tue, 12 Mar 2013 19:58:22 +0400 > Alexey Kinyov napsal(a): > > > Hello everyone! > > > > Today we've released alpha of Brillixy https://github.com/05bit/brillixy > . > > > > This is a Django admin skin with some extras. Actually it's an > > alternative to Grapelli, Admin Tools and other apps that changes > > standard Django admin look and user experience. It's simple and > > minimal at the moment and we're going to keep it the way like that. > > > > I'm working on it with Vasily Sadovnikov and Pavel Yakovlev - they > > helped me with vision and are working on design improvevents. Thank > > you guys! > > > > Core features: > > > > - skin powered by basic Twitter Bootstrap with responsive layout + > > Awesome Font > > - easy header customization: logo & title > > - lighter nav breadcrumbs: no application index > > - custom dashboard panels > > > > It seems that most of standard admin functions are working. There're > > some issues with Django 1.4.x inlines, as I used Django 1.5 templates > > and scrips as basis. And I see we're not perfect with design and > > navigation, so we're working on that :) > > > > You're welcome to make a test-drive, and I would really appreciate any > > feedback. Please, let me know if it does fit your real projects! :) > > > > Alex K. rudyryk > > /// > > > > > > S pozdravem > Tomáš Ehrlich > > Email: tomas.ehrl...@gmail.com > Tel:+420 608 219 889 > Jabber: elv...@jabber.cz > > "Půjdu kamkoliv, pokud je to kupředu." - 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, 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/opt_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 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 http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Selecting site in admin
Do you can this in your template 2013/5/28 Victor > As a newbye I'm happily using admin. > > Now I would like to select what a user can see in the admin main page > according to its username just as a (non-working) example I would like to > follow this idea > > in admin.py > > if request.user=='victor': > admin.site.register(Categorie) > admin.site.register(Codiciiva) > admin.site.register(Magazzini) > else: > admin.site.register(Marca) > admin.site.register(Fornitori,FornitoriOption) > admin.site.register(Pazienti,PazientiOption) > admin.site.register(unita_misura) > > How can I do this? > > Ciao > Vittorio > > -- > 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 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 Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Need help on customizing my django admin page to my own new look
A path to follow: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates 2013/7/17 Rurangwa Moses > Hey guys, > I need some help on how to customize a django admin page to whole new > different look rather than the default django admin page > > Thanks > > -- > 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 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 Digital* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: Can I only have one "get_queryset" per Viewpage?
Hi, you can separate your querysets in get_context_data method. See: https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-simple/#django.views.generic.base.ContextMixin.get_context_data 2013/7/22 Pepsodent Cola > Hi, > > Can I only have one "get_queryset" for each Viewpage? > If I wanted to add another database list on the same Viewpage how would > that code look like for my Django *views.py* file? > > Example: > https://docs.djangoproject.com/en/1.5/intro/tutorial04/#amend-views > > from polls.models import Choice, Poll > > class IndexView(generic.ListView): > template_name = 'polls/index.html' > *context_object_name = 'latest_poll_list'* > > *def get_queryset(self):* > """Return the last five published polls.""" > return Poll.objects.order_by('-pub_date')[:5] > > > > I mean will "context_object_name" be able to separate between several > "get_queryset(self)"? > Because I want to have several different poll_lists on the same Viewpage. > > context_object_name = 'latest_poll_list' > > -- > 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 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 Digital* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: Can I only have one "get_queryset" per Viewpage?
Exactly @Babatundle =) 2013/7/23 Babatunde Akinyanmi > Override your get method but it's easier to override the get_context_data > method like > # From my head > def get_context_data(**kwargs): > context = super(IndexView, self).get_context_data(**kwargs) > #filter1 is already present as latest_poll_list in the context > filter2 = Word.blah() > filter3 = Word.blah_blah() > context.update({ > "filter2": filter2, > "filter3": filter3 > }) > return context > > Sent from my Windows Phone > -- > From: Pepsodent Cola > Sent: 7/22/2013 9:47 PM > To: django-users@googlegroups.com > Subject: Re: Can I only have one "get_queryset" per Viewpage? > > I'm having difficulty understanding the abstract explanations in that > documentation. > Could you or somebody else explain this, by showing by example using my > code examples? > > *views.py* > > class IndexView(generic.ListView): > template_name = 'polls/index.html' > context_object_name = *'latest_poll_list'* > > def get_queryset(self): > """ > Return the last five published polls > (not including those set to be published in the future). > """ > return Word.objects.filter( > pub_date__lte=timezone.now() > ).order_by('-pub_date')[:5] > > *### Filter 2* > #Word.objects.filter(translation='') > *### Filter 3* > #Pronunciation.objects.filter(wordfield__translation='') > > > > > *index.html* > > index.html > > {% if latest_poll_list %} > > {% for word in *latest_poll_list* %} > {{ word.wordfield > }} > {% endfor %} > > {% else %} > No polls are available. > {% endif %} > > > > How should I write my IndexView class so that Filter 1, 2 and 3 list > results are then sent to my index.html template file? > > > > > On Monday, July 22, 2013 2:03:59 PM UTC+2, macndesign wrote: >> >> Hi, you can separate your querysets in get_context_data method. >> See: >> https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-simple/#django.views.generic.base.ContextMixin.get_context_data >> >> >> 2013/7/22 Pepsodent Cola >> >>> Hi, >>> >>> Can I only have one "get_queryset" for each Viewpage? >>> If I wanted to add another database list on the same Viewpage how would >>> that code look like for my Django *views.py* file? >>> >>> Example: >>> https://docs.djangoproject.com/en/1.5/intro/tutorial04/#amend-views >>> >>> from polls.models import Choice, Poll >>> >>> class IndexView(generic.ListView): >>> template_name = 'polls/index.html' >>> *context_object_name = 'latest_poll_list'* >>> >>> *def get_queryset(self):* >>> """Return the last five published polls.""" >>> return Poll.objects.order_by('-pub_date')[:5] >>> >>> >>> >>> I mean will "context_object_name" be able to separate between several >>> "get_queryset(self)"? >>> Because I want to have several different poll_lists on the same Viewpage. >>> >>> context_object_name = 'latest_poll_list' >>> >>> -- >>> 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...@googlegroups.com. >>> To post to this group, send email to django...@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 Digital* - 2008 - FIC >> *Analysis and Systems Development* - 2011 - Estácio >> *D**esign and Implementation of Internet Environments* - 2003 - FIC >> > -- > 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@googlegroup
Re: Problem with static in Django 1.5 virtualenv
Suggestion: *Install Unipath with a:* $ pip install Unipath *and in settings file:* from unipath import Path PROJECT_DIR = Path(__file__).parent STATIC_ROOT = PROJECT_DIR.child('static') *Try in urls.py* from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns ... some imports ... urlpatterns = patterns('', ... some urls ... ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += staticfiles_urlpatterns() Good luck! 2013/8/1 Jairo Alonso Velásquez > Hi community, I posted a problem here: > > > http://stackoverflow.com/questions/18005574/django-1-5-get-404-on-static-files > > I will do it again here if somebody can help me: > > I need a little help with this, I've been searching for a solution with no > results. > > This are my settings: settings.py: > > STATIC_ROOT = '' > # URL prefix for static files.# Example: "http://media.lawrence.com/static/"; > > STATIC_URL = '/static/' > > PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) > > STATICFILES_DIRS = ( > PROJECT_ROOT + '/static/') > > Installed apps: > > INSTALLED_APPS = [ > 'django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.sites', > 'django.contrib.messages', > 'django.contrib.staticfiles', > 'django.contrib.admin', . . . > > Running with DEBUG = TRUE: > > August 01, 2013 - 16:59:44Django version 1.5.1, using settings > 'settings'Development server is running at http://127.0.0.1:8000/Quit the > server with CONTROL-C.[01/Aug/2013 16:59:50] "GET / HTTP/1.1" 200 > 6161[01/Aug/2013 16:59:50] "GET > /static/media/css/jquery-ui/ui-lightness/jquery-ui-1.10.3.custom.min.css > HTTP/1.1" 404 5904[01/Aug/2013 16:59:50] "GET > /static/media/css/bootstrap/bootstrap.css HTTP/1.1" 404 5904[01/Aug/2013 > 16:59:50] "GET /static/media/css/bootstrap/bootstrap-responsive.min.css > HTTP/1.1" 404 5904[01/Aug/2013 16:59:50] "GET /static/media/css/styles.css > HTTP/1.1" 404 5904[01/Aug/2013 16:59:50] "GET > /static/media/js/jquery/jquery-1.9.1.min.js HTTP/1.1" 404 5904[01/Aug/2013 > 16:59:50] "GET /static/media/js/bootstrap/bootstrap.min.js HTTP/1.1" 404 > 5904[01/Aug/2013 16:59:50] "GET > /static/media/js/jquery-ui/jquery-ui-1.10.3.custom.min.js HTTP/1.1" 404 > 5904[01/Aug/2013 16:59:50] "GET /static/media/js/messages.js HTTP/1.1" 404 > 5904[01/Aug/2013 16:59:50] "GET > /static/media/js/validate/jquery.validate.min.js HTTP/1.1" 404 > 5904[01/Aug/2013 16:59:50] "GET /static/media/images/FERREMOLQUES2.png > HTTP/1.1" 404 5904[01/Aug/2013 16:59:50] "GET > /static/media/js/dynamic-style.js HTTP/1.1" 404 5904 > > As a special mention I'm running Django 1.5.1 and Python 2.7.5 in a * > VIRTUALENV*. I do not know if this configuration is causing the problem > > 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 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 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 Digital* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to add a code table to this group?
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 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 http://groups.google.com/group/django-users. > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANNOUNCE] Django 1.6 and Django 1.4.10 released
Thanks for all! =) 2013/11/6 wudiweb > Thanks for all contributors > > 在 2013年11月6日星期三UTC+8下午11时09分45秒,James Bennett写道: > >> Django 1.6 and Django 1.4.10 are out today; the latter is a bugfix >> release to restore Python 2.5 compatibility in the 1.4 series. >> >> Full details are in the blog post: >> >> https://www.djangoproject.com/weblog/2013/nov/06/django-16-released/ >> > -- > 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 http://groups.google.com/group/django-users. > To view this discussion on the web visit > 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* - 2008 - FIC *Analysis and Systems Development* - 2011 - Estácio *D**esign and Implementation of Internet Environments* - 2003 - FIC -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJthOzDVtAct8gwa1g92f_865kycAnY7eBPtTerQ%3DAROpab93w%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Static files
a detail, put only: urlpatterns += staticfiles_urlpatterns() instead: if settings.DEBUG: urlpatterns += staticfiles_urlpatterns() The django treat this in URLConf. 2011/5/18 Kevin Monceaux > On Wed, May 18, 2011 at 03:03:42PM -0500, Kevin Monceaux wrote: > > > to: > > > >return render(response, 'index.html', {'form': form}) > > I should proof read more carefully. That should be: > >return render(request, 'index.html', {'form': form}) > > > > -- > > Kevin > http://www.RawFedDogs.net > http://www.WacoAgilityGroup.org > Bruceville, TX > > What's the definition of a legacy system? One that works! > Errare humanum est, ignoscere caninum. > > -- > 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 options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Att. Mário A. Chaves Neto Designer / U.I. Engineer MBA - Design Digital -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django Development Environments
Dev. Mac OS X PyCharm Virtualenv pip Mercurial (Bitbucket) debug-toolbar and extensions Prod. 1 RedHat Apache mod_wsgi Prod. 2 Debian Cherokee uwsgi 2011/6/7 Xavier Ordoquy > Hi, > > > Xavier, could you point to any resources about using buildout with > Django, virtualenv and pip? I'm assuming you're using it to deploy things > into production, right? > > I usually use virtualenv / pip for early development as it requires almost > no setup. > I prefer using buildout once the project start being mature and for > production. > > For buildout, I use djangorcecipe ( > http://pypi.python.org/pypi/djangorecipe) which will do most of the work > for me ;) > Jacob Kaplan wrote a nice article about it ( > http://jacobian.org/writing/django-apps-with-buildout/) > > As for virtualenv, you should instal virtual env wrappers that might help > you: http://pypi.python.org/pypi/virtualenvwrapper/2.7.1 > There's not much to say about it, basically it is create your env, activate > it and pip install what you need and you are good to go. > > Virtualenv is commonly used on production but I prefer buildout as all the > paths troubles are automatically handled by the buildout. On my boxes, the > server starts with: > /myapp/bin/django run_gunicorn 127.0.0.1:myport --workers=howmanyyouwant > No extra path to set or configuration to make. > > Regards, > Xavier. > > -- > 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 options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Att. Mário A. Chaves Neto Designer / U.I. Engineer MBA - Design Digital -- 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 options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Noob question: using multiple classes in a detail page's view
For that you could use the method select_related, if you want the details page has executives related to the nonprofit: e = Executive.objects.select_related().get(pk=id) Thus, there is a performance gain, it does not require database queries. 2010/12/21 Matt > I have two classes in my model: nonprofit and executive. It's a one-to- > many relationship, multiple executives for each nonprofit. > I created an index page that displays all executives and all > nonprofits. I've created detail pages for nonprofit and executive. > But when I try to link back to a nonprofit page on the executive > detail page, I get weird results and I'm not sure why. > > With the view file and template below, my index page stops properly > linking to all the executives. It stops after the number of nonprofits > in the database. > And the executive detail template is still ignoring the nonprofit > call. What am I missing? > > View: > from django.shortcuts import render_to_response, get_object_or_404 > from nonprofit.models import executive, nonprofit > > def index(request): >nonprofits = nonprofit.objects.all() >executives = executive.objects.all() >dictionaries = {'nonprofits': nonprofits, 'executives': executives} >return render_to_response('nonprofit/index.html', dictionaries) > > def detail(request, id): >n = get_object_or_404(nonprofit, pk=id) >dictionaries = {'nonprofit': n} >return render_to_response('nonprofit/detail.html', dictionaries) > > def executive_index(request): >executives = executive.objects.all() >return render_to_response('nonprofit/executive_index.html', > {'executives': executives}) > > def executive_detail(request,id): >e = get_object_or_404(executive, pk=id) >n = get_object_or_404(nonprofit, pk=id) >dictionaries = {'executive': e, 'nonprofit': n} >return render_to_response('nonprofit/executive_detail.html', > dictionaries) > > > template: > {% load humanize %} > {{ executive.name }} > > Organization: > {{ executive.nonprofit }} > Title: {{ executive.title }} > Salary: ${{ executive.salary|intcomma }} > > > > > > -- > 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+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Att. Mário A. Chaves Neto Designer / U.I. Engineer MBA - Design Digital -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
multiple settings.py
Hi I'm recently diving into Django framework and a doubt is flashing my head. If I want to develop and to deploy cloud web applications, each customer will have your singular database. In the Django approach, The database configurations are in the settings.py file. How can I do to separate a settings.py file for each customer, and their unique configurations without create a copy of my entire project? It's possible to create dinamically a settings.py file at user session or it's better keep those files existing at web root? Any help will be apreciated? Thanks in advance 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-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.
ManyToManyField using specific database
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 I am using post_migration signals with post_migrate signal callbacks. My custom command to something like above: def define_groups_auth(sender, **kwargs): admin = Group() admin.name = "Administrator" admin.save(using=kwargs['using']) perm = Permission.objects.using(kwargs['using']).get(codename='my_permission') admin.permissions.add(perm) post_migrate.connect(define_groups_auth, sender=apps.get_app_config('my_application')) When I execute ./manage.py --database=db1 for example a strange behavior occurs. The Group Administrator is created but the permission tries to be added on default database instead db1 database. hacking the "add" method i discover that it do not contains a "using" parameter. Does someone knows a work around to save this ManyToMany relation correctly on post_migrate signals? -- 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 http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/88c0f059-421f-4815-8f99-c58ced27a064%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: dear django users & fans.. i really need ur help ok
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, 21 de janeiro de 2017 17:20:34 UTC-3, Joshua Harmony Chinonso escreveu: > > My name is Joshua. I am a developer. I do most of my programming using > vb.net (visual studio). Until my new roommate introduced me to an entire > new language - python and it's web framework - django. I love the framework > frankly speaking OK. > > Friends,am so new to django..I decided to write my final year project > using django.. I have been wondering if I could ever use django (or python) > to develop a computer based assessment. someone said I could but I don't > know where to kick-off from.. I'll appreciate any help from anywhere. If > you have any topic or article on django that u think might help me startup > something, I'll also appreciate that.. Thanks all! > > -- 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/c5be1401-fb37-453e-8925-501ebd6b740c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.