variable to a template

2016-03-02 Thread 'luca72' via Django users
Hello i have write this in a template: {% for a in lista %} {% endfor %} But i get no image if i add just a {{a}} i see that the file name is righ, also if i direct write the file i get it {% for a in lista %} {% endfor %} can you tell me what is wrong Thanks -

Re: variable to a template

2016-03-02 Thread Sergiy Khohlov
original path og your image please. Also setting for STATIC_ROOT from setting.py send please Many thanks, Serge +380 636150445 skype: skhohlov On Wed, Mar 2, 2016 at 12:41 PM, 'luca72' via Django users < django-users@googlegroups.com> wrote: > Hello i have write this in a template: > {% fo

Re: How force DJANGo choice MEDIA_URL or STATIC_URL in template?

2016-03-02 Thread setivolkylany
I am solved problem next variant: in model -- @property def account_user_picture(self): if self.picture: return self.picture.url else: return settings.STATIC_URL + 'project_static/images/default-picture.png' in templates --

Re: variable to a template

2016-03-02 Thread 'luca72' via Django users
Hello Thanks for your reply STATIC_URL = '/static/' I have no static root configured But why if i write i get the image and if i write where a is the file name i can't get? The path is F:\Sito_01_03_16\test\nuovo\myproject\mysite\static\mysite\scorr Thanks for your help Il giorno me

Django 1.9 Apps aren't loaded yet

2016-03-02 Thread Larry Martell
I am developing a django app. I had the basic site running, but I had not yet created any models. I created a model, and now the server fails to start with "Apps aren't loaded yet" traceback below. Anyone know what I am doing wrong? Traceback (most recent call last): File "./manage.py", line 10

Re: Provide way to add an item during "Selecting a ForeignKey"

2016-03-02 Thread guettli
I found that django-autocomplete-light supports "Add another popup outside the admin": http://django-autocomplete-light.readthedocs.org/en/latest/addanother.html This is exactly what I was looking for :-) Am Samstag, 27. Februar 2016 14:28:27 UTC+1 schrieb guettli: > > I use django-select2

Re: Provide way to add an item during "Selecting a ForeignKey"

2016-03-02 Thread guettli
Just for the records: "add another" is one compared feature in this comparison grid: https://www.djangopackages.com/grids/g/auto-complete/ Am Mittwoch, 2. März 2016 13:12:02 UTC+1 schrieb guettli: > > I found that django-autocomplete-light supports "Add another popup outside > the admin": > > ht

Re: Django 1.9 Apps aren't loaded yet

2016-03-02 Thread Michal Petrucha
On Wed, Mar 02, 2016 at 07:05:53AM -0500, Larry Martell wrote: > I am developing a django app. I had the basic site running, but I had > not yet created any models. I created a model, and now the server > fails to start with "Apps aren't loaded yet" > > traceback below. Anyone know what I am doing

Re: variable to a template

2016-03-02 Thread Sergiy Khohlov
try to use : "{% static "mysite/scorr{{a}}" %}" Many thanks, Serge +380 636150445 skype: skhohlov On Wed, Mar 2, 2016 at 1:00 PM, 'luca72' via Django users < django-users@googlegroups.com> wrote: > Hello Thanks for your reply > > STATIC_URL = '/static/' > > I have no static root configured

Re: variable to a template

2016-03-02 Thread Andreas Schosser
Hi Luca, > height="100" Try {% static "mysite/scorr/"|add:a %} Andreas -- Kurs 10 IT-Consulting www.kurs-10.de Andreas Schosser a...@kurs-10.de Baldestraße. 14 Telefon +49 89 41615842-0 80469 Münche

Django Shell image upload _io.BufferedReader no attribute size

2016-03-02 Thread Povilas Kudriavcevas
down votefavorite My problem is that when I try to save image to my model using Django shell I get this error that I can't find solution anywere. models.py class AdImage(models.Model)

Problem uploading image Django 1.9 Python 3.5

2016-03-02 Thread Povilas Kudriavcevas
My problem is that when I try to save image to my model using Django shell I get this error that I can't find solution anywere. models.py class AdImage(models.Model): ad = models.ForeignKey(Ad) full_photo = models.ImageField(upload_to='uploads/', blank=True) I import models create AdImage

Re: variable to a template

2016-03-02 Thread 'luca72' via Django users
Thanks now it works Luca Il giorno mercoledì 2 marzo 2016 14:05:24 UTC+1, Andreas Schosser ha scritto: > > Hi Luca, > > > > height="100" > > Try {% static "mysite/scorr/"|add:a %} > > Andreas > > -- > Kurs 10 IT-Consulting www.kurs-10.de > Andreas Sc

Re: Django 1.9 Apps aren't loaded yet

2016-03-02 Thread Larry Martell
On Wed, Mar 2, 2016 at 7:37 AM, Michal Petrucha wrote: > On Wed, Mar 02, 2016 at 07:05:53AM -0500, Larry Martell wrote: >> I am developing a django app. I had the basic site running, but I had >> not yet created any models. I created a model, and now the server >> fails to start with "Apps aren't

Re: problem deploying two apps

2016-03-02 Thread frocco
That is correct, sorry for my wording. This is two separate projects that need to run on the same server. On Tuesday, March 1, 2016 at 6:17:33 PM UTC-5, James Schneider wrote: > > On Tue, Mar 1, 2016 at 8:56 AM, frocco > > wrote: > >> Hi, >> >> I followed this >> https://docs.djangoproject.com/e

Re: problem deploying two apps

2016-03-02 Thread frocco
>From your link, it looks like I am using the WSGIDaemonProcess and WSGIScriptAlias The app runs fine, but images do not render unless I remove one project. As soon as I add the second project, images do not render in static. Each project has there own static directory under project name On Wedne

Re: a question about django admin and language

2016-03-02 Thread Luis Zárate
You could write a middleware after language middleware than check if it is a admin URL and change the language to English. https://docs.djangoproject.com/en/1.9/topics/http/middleware/ https://docs.djangoproject.com/es/1.9/topics/i18n/translation/ El viernes, 26 de febrero de 2016, Will Harris

Re: Django 1.9 Apps aren't loaded yet

2016-03-02 Thread Michal Petrucha
On Wed, Mar 02, 2016 at 08:20:44AM -0500, Larry Martell wrote: > On Wed, Mar 2, 2016 at 7:37 AM, Michal Petrucha > wrote: > > On Wed, Mar 02, 2016 at 07:05:53AM -0500, Larry Martell wrote: > >> I am developing a django app. I had the basic site running, but I had > >> not yet created any models. I

django-smart-selects: ChainedManyToManyField value not selected after saving data via django admin

2016-03-02 Thread Bernardo Garcia
I am working with django-smart-selects via django admin form. The idea that I have is try a model chaining or deployment of value fields accord to previous value in a previous separate field. Accord to the first option value selected in the f

how to implement lazy settings as django setting

2016-03-02 Thread Luis Zárate
I need to implement a lazy setting like django setting that could be call globally in several apps but get his values from a model in database. I have some settings that need to be change by the admin user, so my apps expect that settings but can not loaded on django setup because needs populate w

Re: problem deploying two apps

2016-03-02 Thread frocco
I changed the second project to use STATIC_URL = *'/static1/' and the apache conf to **ALIAS /static1/* *and the images now show* On Wednesday, March 2, 2016 at 9:02:40 AM UTC-5, frocco wrote: > > From your link, it looks like I am using the WSGIDaemonProcess and > WSGIScriptAlias > The app run

Re: Absolute beginner question -- recipes

2016-03-02 Thread Simon Gunacker
Thank you James. Taking your suggestion, I solved 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

Re: Absolute beginner question -- recipes

2016-03-02 Thread Simon Gunacker
Inspired by Mike Dewhirsts suggestion on building hierachical structures, I've made up another model: class Part(models.Model): parts = models.ForeignKey('Part', null=True, blank=True, default=None, related_name='pieces') name = models.CharField(max_length=200) Then I made my view: class

GROUP BY without using aggregate function

2016-03-02 Thread marcin . j . nowak
Hello, I would like to query database with Django ORM and add GROUP BY clause without including unnecessary counting, avg, etc. I can force/hack queryset by settting qs.query.group_by=['my_column'], but this is unclean and risky. Is possible something like: MyModel.objects.filter(...).group_by

Re: variable to a template

2016-03-02 Thread raoul
Hi Luca, Did {{ a }} solve the problem? Cheers, Raoul On Wednesday, March 2, 2016 at 2:12:46 PM UTC+1, luca72 wrote: > > Thanks now it works > > Luca > > Il giorno mercoledì 2 marzo 2016 14:05:24 UTC+1, Andreas Schosser ha > scritto: >> >> Hi Luca, >> >> > > > height="100" >> >>

Re: GROUP BY without using aggregate function

2016-03-02 Thread Dan Tagg
if your aren't counting or averaging then why are you grouping? D On 2 March 2016 at 17:06, wrote: > Hello, > > I would like to query database with Django ORM and add GROUP BY clause > without including unnecessary counting, avg, etc. > I can force/hack queryset by settting qs.query.group_by=['

Re: GROUP BY without using aggregate function

2016-03-02 Thread marcin . j . nowak
On Wednesday, March 2, 2016 at 6:11:32 PM UTC+1, Dan Tagg wrote: > > if your aren't counting or averaging then why are you grouping? > > > To fast find distinct values within big dataset - some queries on some engines may be faster when using grouping. It was known technique years ago and I'm s

Re: variable to a template

2016-03-02 Thread Fred Stluka
Luca, You can't nest a variable evaluation (via {{}}) inside a tag execution {%%}. But you can put them side by side to achieve the effect you want: '{% static "mysite/scorr" %}'/{{a}}' --Fred Fred Stluka -- mailto:f...@b

Re: problem deploying two apps

2016-03-02 Thread Bernardo Garcia
Hi frocco May be this post can ve useful for you, althought instead of uwsgi use gunicorn http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/ On Tuesday, March 1, 2016 at 11:56:57 AM UTC-5, frocco wrote: > > Hi, > > I followed this > h

Handling fields with values that depend on a value from previous file

2016-03-02 Thread Bernardo Garcia
I want handling fields' values which depend on a value from another field Currently I am working with django-smart-selects but I have this problems

Re: Error running Django tutorial

2016-03-02 Thread jorrit787
Glad you got it solved!! On Monday, February 29, 2016 at 10:10:58 PM UTC+1, Mike Kipling wrote: > > I found the problem. > > When the mysite\urls.py file is created, it has this line already in it. > > from django.conf.urls import url > > The tutorial asks you to add the following lines to the fi

What are the things similar TabularInline and StackedInline?

2016-03-02 Thread setivolkylany
Just wondering, how in django so few similar things. -- 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 g

How will make OneToOne relationship in admin for my User model?

2016-03-02 Thread setivolkylany
I need create link in my admin part of site, for models AccountUser and AccountUserInfo -- My models.py -- import imghdr import string import datetime from django_countries.fields import CountryField from django.db import models from django.contr

how to implement lazy settings as django setting

2016-03-02 Thread Luis Zárate
I need to implement a lazy setting like django setting that could be call globally in several apps but get his values from a model in database. I have some settings that need to be change by the admin user, so my apps expect that settings but can not loaded on django setup because needs populate w

Re: [ANNOUNCE] Django security releases issued: 1.9.3 and 1.8.10

2016-03-02 Thread José David Ordoñez
After upgrading django 1.8.9 to 1.8.10 my i18n/setlang/ went crazy "TypeError: must be unicode not str" when using {% url 'set_language' %} by going back to 1.8.9 solved the issue. El martes, 1 de marzo de 2016, 12:50:27 (UTC-4:30), Tim Graham escribió: > > Today the Django team issued 1.9.3 and

Re: [ANNOUNCE] Django security releases issued: 1.9.3 and 1.8.10

2016-03-02 Thread Tim Graham
Please create a separate thread with some details such as a sample project with steps to reproduce the issue so we can determine if it's a problem in Django or in your application. Thanks! On Wednesday, March 2, 2016 at 8:49:03 PM UTC-5, José David Ordoñez wrote: > > After upgrading django 1.8.9

Re: Debugging DJango app on production for High CPU Usage

2016-03-02 Thread Web Architect
Hi James, Thanks for the detailed explanation. Certainly helps and I would embed logging to debug the CPU usage. Please find my comments inline: On Monday, February 29, 2016 at 2:45:41 PM UTC+5:30, James Schneider wrote: > > > On Tue, Feb 23, 2016 at 8:59 PM, Web Architect > wrote: > >> Hi, >

Re: Debugging DJango app on production for High CPU Usage

2016-03-02 Thread Web Architect
Integrated new Relic and seems to be good. Thanks for the suggestion. On Monday, February 29, 2016 at 3:20:43 PM UTC+5:30, Lloyd Dube wrote: > > New Relic. > > On Wed, Feb 24, 2016 at 6:59 AM, Web Architect > wrote: > >> Hi, >> >> We have an ecommerce platform based on Django. We are using uwsgi