Re: Have a problem with a first Django App due to the Web Tutoral

2015-07-10 Thread Russell Keith-Magee
Hi,

The error message by itself doesn't give us a lot to work with - it's not
an error I'd normally expect to see while doing the tutorial.

My first guess would be that there is something corrupted in your Django
install - this might happen if you've got multiple versions of Django
installed, or if you've installed one version over the top of another.

Another possibility is that there is something wrong with the 1.8.3 release
- it *should* be a stable release, and I wouldn't expect to see a bug like
the one you describe, but it's only been out for a day or two, and stranger
things have happened in the past.

So - my first suggestions:

 * Completely uninstall Django, and confirm that it's uninstalled. Or, if
you're using a virtualenv, create an entirely new one. Then re-install
Django.

 * If that doesn't work, try installing Django 1.8.2 (pip install
django==1.8.2) to see if that makes a difference.

If neither of those two work, we're going to need to see some more context
of that error message - the full error traceback, for example.

Yours,
Russ Magee %-0



On Fri, Jul 10, 2015 at 9:39 PM, Happy Data Scientist <
happydatascient...@gmail.com> wrote:

> Dear Friends !
>
> I have an error when I tried to develop my first Django App due to the Web
> Tutoral:
> https://docs.djangoproject.com/en/1.8/intro/tutorial02/
>
> The error is  "ImportError at /admin/" -- cannot import name
> 'resolve_url'" for the address "http://127.0.0.1:8000/admin/;
> The Django version is 1.8.3
>
> Could you help me to resolve this issue ?
>
> Thanks ahead
>
> --
> 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/eac824c9-4898-440a-8479-81f846574a47%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq84-Ro%2Bco-X4n%3DuQ%2Bfa97OgKmJsEZNS%3DZ4GsgNOG_f0gqCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Vaga para desenvolvedor Backend

2015-07-10 Thread Gustavo Hingel Morada
Fala galera, tudo bem?

Estou postando uma vaga aqui na empresa para desenvolvedores backend.

Somos uma empresa de tecnologia para Educação, toda baseada em meritocracia
e possuimos um ambiente bem descontraído e de alto potencial de crescimento
em Niteroi.

Atualmente estamos sediados numa mansão com piscina, churrasqueira, mesa de
sinuca, ps3 =)

Nosso plano de cargos e salarios é bem agressivo.

Estamos procurando desenvolvedores para trabalhar com o Backend das nossas
aplicações.

Conhecimentos necessários:

1) Protocolo HTTP
2) Alguma lingaugem de backend (PHP, Python ou Ruby)
3) Padrão RESTFul
4) Banco de dados relacional
5) Padrão MVC

Conhecimentos Plus:

1) Testes automatizados
2) Django
3) Django Rest Framework

Quem estiver interessado só mandar currículo para r...@wpensar.com.br e/ou
gustavo.mor...@wpensar.com.br

Grande abraço!

Gustavo Hingel Morada
LinkedIn: http://www.linkedin.com/in/gustavomorada


-- 
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/CAMMT_QZ_KfoqZuo6MUzM_imuvBNmbkfR%3Df6SZL8XMfnrpJv-oQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


TextField in Oracle: any alternatives?

2015-07-10 Thread Robert Martin
Hi all,

I have a question about best practices with storing strings in an Oracle 
DB. I've grown accustomed to using TextFields wherever possible, as I 
mainly work in Postgres and this seems to be recommended:

http://stackoverflow.com/questions/7354588/django-charfield-vs-textfield

However, I'm trying to migrate a project to Oracle and finding that my 
TextFields are now being stored as CLOBs. This is not really ideal, as I 
can't use them (easily) in SQL queries and it just seems like overkill for 
short, variable-length strings. If I weren't using Django I would store 
these as varchars, and I guess I could make them all CharFields, but I hate 
to have my models be so closely coupled to the DB.

Has anyone else come up with a more elegant solution for this? Would 
CharField(max_length=255) be a good compromise?

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b279f66f-a55f-4d23-b147-0b945b41df20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Annotations with nested Sums

2015-07-10 Thread Marc Aymerich
Hi,
I need to do some annotations that require a nested sumation,
I have Bills that have Lines that in turn have Sublines: Bill -> Line -> SubLine
In order to calculate the total bill price I need to add all sublines
of every line, and then all lines of a bill.

queryset.annotate(
total=Sum(F('lines__total') + Sum(F('lines__sublines__total')))
)

But I get an AttributeError: 'CombinedExpression' object has no attribute 'name'

Is there any other way to perform this calculation (adding two levels
of nested totals)?.


thanks!
-- 
Marc

-- 
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/CA%2BDCN_uvafGH8DwJsV-_m50-yOf9teZMKwgAECOLSOz2jf511g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: STATIC_URL with thumbnail_url Template Tag

2015-07-10 Thread Luis Zárate
Hi, Stephanie

Your are using easy-thumbnails, right?
so, are you sure that Pillow are right installed ?

http://easy-thumbnails.readthedocs.org/en/latest/usage/

As I see your questions is same that this question
http://stackoverflow.com/questions/12956788/how-to-thumbnail-static-files


thumbnail_url is a wrapper for get-thumbnailer, so are you configure
static_root in your settings ?


http://easy-thumbnails.readthedocs.org/en/latest/usage/#get-thumbnailer



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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/CAG%2B5VyNbTgt8MweY0ZCJLGK9zKv_9kD-9NA6Az9BD7jFA5zfaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: loop a ChoiceField SelectMultiple form in the view as post

2015-07-10 Thread dk
i might simplify lol i didnt even understand.

after i validate and clean a ChoiceField how do i us it?   
does it return a directory saying whats selected?

-- 
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/5da5190f-065e-47f7-bf75-d9a1217c7526%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ORM Query question

2015-07-10 Thread Joss Ingram
Hi, 

In my models I have an event index page type, which can have child event 
pages, each event page can be tagged (using taggit), and I want to produce 
a list of distinct tags used in the events that belong to that event index 
on the index itself. I'm using the Django CMS Wagtail, but I guess this is 
really a Django ORM query question. I''ve got some code as part of my model 
which is working but I don't think it's the most efficient way of doing 
this. Still trying unlearn doing things with SQL and learn how the same 
thing should be done in Django.

My code as part of the event index class is 

@property
def event_tag_list(self):
child_events = EventPage.objects.live().descendant_of(self)
return 
Tag.objects.filter(mysite_eventpagetag_items__isnull=False).filter(mysite_eventpagetag_items__content_object_id=child_events).order_by('slug').distinct('slug')

Any feedback would be appreciated.

Thanks

Joss



-- 
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/e819245a-7885-4d56-9f9b-4bfac665f011%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Have a problem with a first Django App due to the Web Tutoral

2015-07-10 Thread Happy Data Scientist
Dear Friends !

I have an error when I tried to develop my first Django App due to the Web 
Tutoral: 
https://docs.djangoproject.com/en/1.8/intro/tutorial02/

The error is  "ImportError at /admin/" -- cannot import name 'resolve_url'" 
for the address "http://127.0.0.1:8000/admin/;
The Django version is 1.8.3

Could you help me to resolve this issue ?

Thanks ahead

-- 
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/eac824c9-4898-440a-8479-81f846574a47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1.7 to 1.8 upgrade: test suite failing

2015-07-10 Thread Tim Graham
No ideas, but if you could bisect to find the Django commit where the 
problem started to appear that will probably help.

On Friday, July 10, 2015 at 7:21:37 AM UTC-4, tom.sz...@eporta.com wrote:
>
> Hi,
>
> I've recently tried upgrading from Django 1.7.6 to 1.8.3 but haven't been 
> able to get my test suite to pass.
>
> My main problem is that all of the tests pass when run individually, but 
> when run as an entire test suite, many arbitraily fail due to an 
> *InterfaceError: 
> connection already closed*:
>
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", 
> line 838, in execute_sql
> cursor = self.connection.cursor()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", 
> line 164, in cursor
> cursor = self.make_cursor(self._cursor())
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", 
> line 137, in _cursor
> return self.create_cursor()
>   File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 
> 97, in __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", 
> line 137, in _cursor
> return self.create_cursor()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py"
> , line 212, in create_cursor
> cursor = self.connection.cursor()
> InterfaceError: connection already closed
>
>
>
> I was previously using psycopg2.6 with Postgres 9.3 and have tried 
> upgrading to psycopg2.6.1 with Postgres 9.4, but this hasn't helped.
>
> Forcing all my TestCase classes to inherit from SimpleTestCase resolves 
> this issue, but inheriting from SimpleTestCase isn't something that I wish 
> to do.
>
> Any help would be much appreciated.
>
> Thanks,
>
> Tom
>

-- 
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/02f8f67e-6019-4497-8255-7b22731c95af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Recommend guide to setting up a production server with Django and Python 3

2015-07-10 Thread Daniel Roseman
On Friday, 10 July 2015 12:42:32 UTC+1, Christian Kleineidam wrote:
>
> Is there a recommended guide to set up a new Django enviroment with Python 
> 3?
> It seems like the official guide on https://docs.djangoproject.com/en/1.8/ 
> tells me to use a decidated server instead of letting django run the server 
> itself but doesn't tell me how.
>

That guide has a whole section on deployment, starting here: 
https://docs.djangoproject.com/en/1.8/howto/deployment/
--
Daniel. 

-- 
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/52653393-03cf-48bb-b344-f8e1a6dd5939%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Recommend guide to setting up a production server with Django and Python 3

2015-07-10 Thread Timothy W. Cook
This is a couple of years old but I used it for a template and it works
great.

http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/


On Fri, Jul 10, 2015 at 8:42 AM, Christian Kleineidam <
christian.kleinei...@gmail.com> wrote:

> Is there a recommended guide to set up a new Django enviroment with Python
> 3?
> It seems like the official guide on https://docs.djangoproject.com/en/1.8/
> tells me to use a decidated server instead of letting django run the server
> itself but doesn't tell me how.
>
> --
> 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/97f71409-0e46-497f-b193-77ee65a98dfb%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


Timothy Cook
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
MLHIM http://www.mlhim.org

-- 
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/CA%2B%3DOU3UVPBt6q_2GRH4PLJ%3DXbQ_MW7sk1J0PV1%2B7zRPXF2da1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Recommend guide to setting up a production server with Django and Python 3

2015-07-10 Thread Christian Kleineidam
Is there a recommended guide to set up a new Django enviroment with Python 
3?
It seems like the official guide on https://docs.djangoproject.com/en/1.8/ 
tells me to use a decidated server instead of letting django run the server 
itself but doesn't tell me how.

-- 
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/97f71409-0e46-497f-b193-77ee65a98dfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


1.7 to 1.8 upgrade: test suite failing

2015-07-10 Thread tom . szpytman
Hi,

I've recently tried upgrading from Django 1.7.6 to 1.8.3 but haven't been 
able to get my test suite to pass.

My main problem is that all of the tests pass when run individually, but 
when run as an entire test suite, many arbitraily fail due to an 
*InterfaceError: 
connection already closed*:

  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", 
line 838, in execute_sql
cursor = self.connection.cursor()
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", 
line 164, in cursor
cursor = self.make_cursor(self._cursor())
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", 
line 137, in _cursor
return self.create_cursor()
  File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 97, 
in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/backends/base/base.py", 
line 137, in _cursor
return self.create_cursor()
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py"
, line 212, in create_cursor
cursor = self.connection.cursor()
InterfaceError: connection already closed



I was previously using psycopg2.6 with Postgres 9.3 and have tried 
upgrading to psycopg2.6.1 with Postgres 9.4, but this hasn't helped.

Forcing all my TestCase classes to inherit from SimpleTestCase resolves 
this issue, but inheriting from SimpleTestCase isn't something that I wish 
to do.

Any help would be much appreciated.

Thanks,

Tom

-- 
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/ab94c115-ab7d-4468-8b15-b49b0cd7a876%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.