Re: How to fix "plural forms expression could be dangerous"

2017-05-21 Thread Martin Brochhaus
Thanks for the reply, Tom.

Inserting those values does indeed make the error go away, but I am still 
left with the issue that on each deployment, when I run `./manage.py 
makemessages`, it overwrites that line with the faulty one and my site is 
left in a broken state.

Anyone knows how to prevent this line from being overwritten all the time?

On Thursday, May 18, 2017 at 7:22:04 PM UTC+8, Tom Evans wrote:
>
> You need to change INTEGER and EXPRESSION for the correct values. I 
> believe for zh you want "nplurals=1; plural=0;" 
>
> Cheers 
>
> Tom 
>
> On Thu, May 18, 2017 at 7:41 AM, Martin Brochhaus 
>  wrote: 
> > Hi everyone, 
> > 
> > in my project, I am generating my .po files like this: 
> > 
> > python manage.py makemessages --ignore=node_modules/* 
> --ignore=*migrations/* 
> > --ignore=*tests/* --ignore=__init__.py --ignore=submodules/* 
> > --ignore=fabfile* -l zh_CN 
> > 
> > Usually this results in the following line being added to my `django.po` 
> > file: 
> > 
> > "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 
> > 
> > When this line is in the file and when I switch the language to Chinese, 
> I 
> > will get this error: 
> > 
> > ValueError at /zh-cn/ 
> > plural forms expression could be dangerous 
> > 
> > When I delete that line and run `./manage.py compilemessages`, 
> everything 
> > seems to work fine, but this is obviously can't be a good solution and 
> would 
> > mess up my deployment workflow quite a bit. 
> > 
> > So my question is: Why does this line pop up in my .po file? What if I 
> > change that expression to something valid, would it be overwritten with 
> that 
> > same faulty expression again when I run makemessages? What would a 
> correct 
> > expression look like for Chinese? 
> > 
> > Best regards, 
> > Martin 
> > 
> > -- 
> > 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/5db9fbc1-9f59-4947-a214-0af82c8c4458%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/da9576dd-88d4-42be-af30-b52c6eee181c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Simon Charette
> Performance-wise, do you know if it's any different than running over my 
Adult objects and for each one of them running a separate query looking for 
their oldest son & daughter? Or is it the same and it just looks better?

It should perform better as everything will be performed in a single query
by the database.

The equivalent SQL is along

SELECT adult.*,
(SELECT dob FROM child WHERE adult_id = adult.id AND gender = 'M' ORDER 
BY dob LIMIT 1) AS oldest_son_dob,
(SELECT dob FROM child WHERE adult_id = adult.id AND gender = 'F'  
ORDER BY dob LIMIT 1) AS oldest_daughter_dob
FROM adult;

Cheers,
Simon

Le dimanche 21 mai 2017 11:08:37 UTC-4, Yo'av Moshe a écrit :
>
> Thanks, never heard of Subqueries before! It's time to upgrade to Django 
> 1.11 I guess.
>
> Performance-wise, do you know if it's any different than running over my 
> Adult objects and for each one of them running a separate query looking for 
> their oldest son & daughter? Or is it the same and it just looks better?
>
> Thanks again.
>
>
>
> On Sunday, 21 May 2017 17:53:25 UTC+3, Simon Charette wrote:
>>
>> Hello Yo'av,
>>
>> You'll want to use subqueries for this[0].
>>
>> from django.db.models import OuterRef, Subquery
>>
>> children = 
>> Child.objects.filter(adult=OuterRef('pk')).order_by('dob').values('dob')
>>
>> Adult.objects.annotate(
>> oldest_son_dob=Subquery(children.filter(gender='M')[:1]),
>> oldest_daughter_dob=Subquery(children.filter(gender='F')[:1]),
>> )
>>
>> Note that I haven't tried the above code myself so it might required 
>> adjustments.
>>
>> Cheers,
>> Simon
>>
>> [0] 
>> https://docs.djangoproject.com/en/1.11/ref/models/expressions/#subquery-expressions
>>
>> Le dimanche 21 mai 2017 10:41:44 UTC-4, Yo'av Moshe a écrit :
>>>
>>> Hey Djangoists!
>>> I can't get my head around this and I'm not sure if it's even possible.
>>>
>>> Let's say I have an "Adult" object and a "Child" object. Every Child 
>>> belongs to an Adult, and has a gender which is either "M" or "F", and also 
>>> a "dob" field with their date of birth. I want to get a list of all adults 
>>> annotated with the dob of their oldest son, and the dob of their oldest 
>>> daughter.
>>>
>>> How am I to do this?
>>>
>>> I tried something like this:
>>> Adult.objects.annotate(
>>>oldest_son_dob=Case(
>>>When(children__gender="M", then=F('children__dob')),
>>>default=None,
>>>output_field=DateField(),
>>>)
>>> )
>>>
>>> # ... same for daughter
>>>
>>>
>>> but I'm not sure where to tell Django that I only want it to pick the 
>>> oldest child, and so right now it duplicates the adult object for every 
>>> child it has.
>>>
>>> Does Django support this kind of query?
>>>
>>> I'm using PosgresSQL FWIW.
>>>
>>> Thank you so much
>>>
>>> Yo'av
>>>
>>

-- 
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/9e0d71fd-9c90-4eed-926c-7f28d25ee939%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Building correct queryset

2017-05-21 Thread Горобец Дмитрий
Andrew, your solution works great for one brand. But I have more than one.

суббота, 20 мая 2017 г., 0:20:18 UTC+5 пользователь Andrew Beales написал:
>
> brand = Brand.objects.get(title='mybrand')
> products = Product.objects.filter(brand=brand).order_by('-score')[:4]
>
> ...gets you the top 4 products in order for the brand
>
> On Friday, May 19, 2017 at 10:32:49 AM UTC+1, Горобец Дмитрий wrote:
>>
>> Hello. I have these two models. I have to show 4 or less products on a page 
>> for each brand ordered by score. Please, help construct correct queryset.
>>
>>
>>
>> class Brand(models.Model):
>> title = models.CharField(
>> verbose_name='Название бренда',
>> max_length=64,
>> unique=True,
>> db_index=True,
>> error_messages={
>> 'unique': 'Бренд с таким именем уже существует.'
>> }
>> )
>>
>> slug = AutoSlugField(
>> verbose_name='Адрес страницы бренда',
>> populate_from='title',
>> editable=True,
>> unique=True,
>> slugify=custom_slugify,
>> db_index=True
>> )
>>
>> owner = models.OneToOneField(
>> to=settings.AUTH_USER_MODEL,
>> verbose_name='Владелец',
>> on_delete=models.PROTECT,
>> )
>>
>>
>> score = models.DecimalField(
>> verbose_name='Рейтинг бренда',
>> blank=True,
>> null=True,
>> max_digits=19,
>> decimal_places=18,
>> )
>>
>>
>>
>> class Product(models.Model):
>> title = models.CharField(
>> verbose_name='Название изделия',
>> max_length=255,
>> db_index=True,
>> )
>>
>> slug = AutoSlugField(
>> verbose_name='Адрес страницы изделия',
>> populate_from='title',
>> editable=False,
>> unique_with='brand',
>> slugify=custom_slugify,
>> db_index=True,
>> )
>>
>> brand = models.ForeignKey(
>> to=Brand,
>> verbose_name='Бренд',
>> related_name='products',
>> on_delete=models.CASCADE,
>> )
>>
>>
>>

-- 
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/8d486975-7f0d-40e1-82e3-64bc5259b518%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sqlite3 table not found

2017-05-21 Thread James Schneider
On May 21, 2017 8:49 AM,  wrote:


Hi,

I'm fairly new to Django and I'm very much still in the learning process.



I'm using Django 1.10.3 on a project and have just added some new models.
When I run the server and enter a URL to visit one of my views, I get an
error, an excerpt of which is shown below:

File "/home/jja/testenv3.5/lib/python3.5/site-packages/
django/db/backends/sqlite3/base.py", line 337, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: siggy_siggytemplate

I would like to look at the SQL tables and it looks like 'python manage.py
sql' is a command that could do the job, but whichh is no longer available.
Is this correct?

Is there an alternative command that I can run?\


I believe you're looking for the 'dbshell' command, which will open the
sqlite shell for you.


I would like to look at the tables to see if I can figure out why the table
'siggy_siggytemplate' was not generated. BTW, my project is 'siggy' and my
model is 'SiggyTemplate' so I think this would cause generation of the
table
'siggy_siggytemplate'.


Did you run the 'makemigrations' and 'migrate' commands? That pair of
commands will apply your changes to the DB schema.

-James

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


sqlite3 table not found

2017-05-21 Thread jjanderson52000

Hi,

I'm fairly new to Django and I'm very much still in the learning process.



I'm using Django 1.10.3 on a project and have just added some new models. 
When I run the server and enter a URL to visit one of my views, I get an 
error, an excerpt of which is shown below:

File 
"/home/jja/testenv3.5/lib/python3.5/site-packages/django/db/backends/sqlite3/base.py",
 
line 337, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: siggy_siggytemplate

I would like to look at the SQL tables and it looks like 'python manage.py 
sql' is a command that could do the job, but whichh is no longer available. 
Is this correct?

Is there an alternative command that I can run?\

I would like to look at the tables to see if I can figure out why the table 
'siggy_siggytemplate' was not generated. BTW, my project is 'siggy' and my 
model is 'SiggyTemplate' so I think this would cause generation of the 
table 
'siggy_siggytemplate'.

Jim Anderson

-- 
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/f0899f11-f9f8-4ce9-886b-86d934f0c41a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Internship

2017-05-21 Thread ludovic coues
you can put you're resume on your website

2017-05-19 10:42 GMT+02:00 Mannu Gupta :
>
>
> On Wednesday, May 17, 2017 at 3:25:42 PM UTC-4, mark wrote:
>>
>> A couple of comments..
>>
>> 1. This list is not for job hunting. Learn how to post correctly on email
>> lists. In this instance, you need an OT (Off Topic) at the start of your
>> subject line as this is a list for asking technical questions about Django.
>> More people will want to help you if you respect the purpose of each email
>> list you post on.
>
>
> I reallly want to aplozgize for my mistake and will never repeat it next
> time.I also want to thanks for your time to write about the mistakes.
>>
>>
>> 2. No one will sign in to Google drive to see your resume. It should be
>> readable on your web site in both plain text and pdf (NOT downloads).
>
>
> So is there anything that you suggest rather than google drive to upload the
> resume such that is will directly open in browser ?
>>
>>
>> 3. Never tell a prospective employer that you hate something ("...and just
>> hates Front-end ."). Always tell them what you have accomplished, what you
>> are good at and what you enjoy doing. Always be open minded about learning
>> new things/technologies/etc until you have a lot more experience, many more
>> accomplishments, and at least a hint of gray hair. ;)
>
>
> Again thanks for the suggestion and now i have changed the intro part :)
>>
>>
>> 4. If you are going to post the code you wrote, then you better be sure it
>> is golden. functions.php has no comments, poor style, and I have no idea
>> what it does. Not the code I want to have in my products. Learn how to write
>> code that others can easily support, then post that code to your web site so
>> others will be impressed. There are all sorts of style guides for php,
>> python, java, etc. Learn them and apply them to the code you publish for
>> others to see (actually all your code).
>>
>> 5. Not sure what all these courses are listed on your site. Did you take
>> them? If so, then they should be in your resume and not here. If you are
>> just trolling the web for content, don't make me guess what it is and don't
>> make me look at them. You are making yourself look very undesirable as a
>> candidate for an internship by just adding fluff to your github account. Get
>> rid of it. If you are just starting out and don't have a lot of projects,
>> that is OK. Showing me one project where you really excelled  (eg see #4) is
>> far better than a lot of poorly done projects with irrelevant fluff
>> surrounding them.
>
>
> Now I have pinned the good projects that i have done, now it is looking
> better.Previously I did now know the feature of pinned repository on github.
>>
>>
>> Good luck!
>>
>> Mark
>>
>> On Wed, May 17, 2017 at 11:55 AM, Mannu Gupta 
>> wrote:
>>>
>>> Hi everyone,
>>>
>>> I have been learning on Django for around 6+ months, Now looking for a
>>> internship based on it .If anyone know about any internship offer then
>>> please let me know.
>>>
>>> My Website :- http://theparadoxer02.github.io
>>> Github:-  http://github.com/theparadoxer02
>>>
>>> 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...@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/f9a00b76-81b3-414b-a53a-84ab2c43a8cf%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/b21e9037-0a3e-4c36-8d5e-8f0787223c03%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Ludovic Coues
+33 6 14 87 43 42

-- 
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/CAEuG%2BTZ%3DV5Y4R8%3D6oDn4%2Bt5Kd_%2BudhQ8ks9T0hwSjHOgiJsJUQ%40mail.gmail.com.
For more options, visit 

Re: Where is all the time going?

2017-05-21 Thread James Schneider
On May 21, 2017 5:50 AM, "Bernd Wechner"  wrote:

I'm a tad stuck with a slow performing form, like 30s to load, totally
studding, on a high specced local dev machine.

It's a generic CreateView, and the Django Toolbar reports this:


The relevant code for your view, form, template, and model would be super
helpful. Without those, all of this profiling information doesn't have much
meaning.

-James

-- 
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/CA%2Be%2BciWJwNNc2h%3DDL9uiqtMCHfweavCnfnYUc3t2o8M%3D0Qj2-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Yo'av Moshe
Thanks, never heard of Subqueries before! It's time to upgrade to Django 
1.11 I guess.

Performance-wise, do you know if it's any different than running over my 
Adult objects and for each one of them running a separate query looking for 
their oldest son & daughter? Or is it the same and it just looks better?

Thanks again.



On Sunday, 21 May 2017 17:53:25 UTC+3, Simon Charette wrote:
>
> Hello Yo'av,
>
> You'll want to use subqueries for this[0].
>
> from django.db.models import OuterRef, Subquery
>
> children = 
> Child.objects.filter(adult=OuterRef('pk')).order_by('dob').values('dob')
>
> Adult.objects.annotate(
> oldest_son_dob=Subquery(children.filter(gender='M')[:1]),
> oldest_daughter_dob=Subquery(children.filter(gender='F')[:1]),
> )
>
> Note that I haven't tried the above code myself so it might required 
> adjustments.
>
> Cheers,
> Simon
>
> [0] 
> https://docs.djangoproject.com/en/1.11/ref/models/expressions/#subquery-expressions
>
> Le dimanche 21 mai 2017 10:41:44 UTC-4, Yo'av Moshe a écrit :
>>
>> Hey Djangoists!
>> I can't get my head around this and I'm not sure if it's even possible.
>>
>> Let's say I have an "Adult" object and a "Child" object. Every Child 
>> belongs to an Adult, and has a gender which is either "M" or "F", and also 
>> a "dob" field with their date of birth. I want to get a list of all adults 
>> annotated with the dob of their oldest son, and the dob of their oldest 
>> daughter.
>>
>> How am I to do this?
>>
>> I tried something like this:
>> Adult.objects.annotate(
>>oldest_son_dob=Case(
>>When(children__gender="M", then=F('children__dob')),
>>default=None,
>>output_field=DateField(),
>>)
>> )
>>
>> # ... same for daughter
>>
>>
>> but I'm not sure where to tell Django that I only want it to pick the 
>> oldest child, and so right now it duplicates the adult object for every 
>> child it has.
>>
>> Does Django support this kind of query?
>>
>> I'm using PosgresSQL FWIW.
>>
>> Thank you so much
>>
>> Yo'av
>>
>

-- 
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/b3a4222d-622b-4399-a704-8d9961d23c36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Simon Charette
Hello Yo'av,

You'll want to use subqueries for this[0].

from django.db.models import OuterRef, Subquery

children = 
Child.objects.filter(adult=OuterRef('pk')).order_by('dob').values('dob')

Adult.objects.annotate(
oldest_son_dob=Subquery(children.filter(gender='M')[:1]),
oldest_daughter_dob=Subquery(children.filter(gender='F')[:1]),
)

Note that I haven't tried the above code myself so it might required 
adjustments.

Cheers,
Simon

[0] 
https://docs.djangoproject.com/en/1.11/ref/models/expressions/#subquery-expressions

Le dimanche 21 mai 2017 10:41:44 UTC-4, Yo'av Moshe a écrit :
>
> Hey Djangoists!
> I can't get my head around this and I'm not sure if it's even possible.
>
> Let's say I have an "Adult" object and a "Child" object. Every Child 
> belongs to an Adult, and has a gender which is either "M" or "F", and also 
> a "dob" field with their date of birth. I want to get a list of all adults 
> annotated with the dob of their oldest son, and the dob of their oldest 
> daughter.
>
> How am I to do this?
>
> I tried something like this:
> Adult.objects.annotate(
>oldest_son_dob=Case(
>When(children__gender="M", then=F('children__dob')),
>default=None,
>output_field=DateField(),
>)
> )
>
> # ... same for daughter
>
>
> but I'm not sure where to tell Django that I only want it to pick the 
> oldest child, and so right now it duplicates the adult object for every 
> child it has.
>
> Does Django support this kind of query?
>
> I'm using PosgresSQL FWIW.
>
> Thank you so much
>
> Yo'av
>

-- 
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/837f340c-6020-4932-a971-c4dee0e2bbf9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Annotate an object with the value of a filtered, related object's attribute

2017-05-21 Thread Yo'av Moshe
Hey Djangoists!
I can't get my head around this and I'm not sure if it's even possible.

Let's say I have an "Adult" object and a "Child" object. Every Child 
belongs to an Adult, and has a gender which is either "M" or "F", and also 
a "dob" field with their date of birth. I want to get a list of all adults 
annotated with the dob of their oldest son, and the dob of their oldest 
daughter.

How am I to do this?

I tried something like this:
Adult.objects.annotate(
   oldest_son_dob=Case(
   When(children__gender="M", then=F('children__dob')),
   default=None,
   output_field=DateField(),
   )
)

# ... same for daughter


but I'm not sure where to tell Django that I only want it to pick the 
oldest child, and so right now it duplicates the adult object for every 
child it has.

Does Django support this kind of query?

I'm using PosgresSQL FWIW.

Thank you so much

Yo'av

-- 
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/23ef9a3e-36f6-4c70-a3ea-3ff102db2e3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to config Django for Oracle RAC mode

2017-05-21 Thread hu huaxuan
Dear django-users,


We have two kinds of web servers. One is based on Java(tomcat + spring boot), 
while another is based on Python(Django).

Recently we changed our Oracle db to RAC mode, which theJava server can 
successfully connect to it by following config:

jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=177.177.50.112)
 
(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=177.177.50.113)(PORT=1521))(LOAD_BALANCE=NO)(FAILOVER=YES))(CONNECT_DATA=(SERVICE_NAME=aldb)(SERVER=DEDICATED)))

However for Django server, we can't find a proper way to config such 
connection. Anyone has experience to config Oracle RAC for Django?

Below is our old config which currently works well on non-RAC mode as a 
reference:

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'devdb',
'USER': 'devuser',
'HOST': '177.177.50.110',
'PASSWORD': 'devpassword',
'PORT': '1521',
'CONN_MAX_AGE': 60 * 60 * 24 * 30 * 3,
}
}


Regards,

Felix Hu

-- 
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/DM5PR13MB1018FD45A1ABB6C8D4DCD14ABFFB0%40DM5PR13MB1018.namprd13.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channels Error: WebSocket connection to 'ws://openchat.us:24711/' failed: WebSocket is closed before the connection is established.

2017-05-21 Thread James Schneider
On May 20, 2017 8:33 PM, "djangorobert"  wrote:

hi james im going off of andrew godwins django channels example on github
the multi chat example and using Webfactions hosting services.
im  getting the error of the websocket being closed
I know your saying to maybe chaning it to wss instead of ws do you mean to
change it in the javascript that is in the django channels github for
multichat js file ?


TBH, I have no idea. I've never worked with channels. I was speaking more
from a broader web application experience and typical HTTP calls.

I highly doubt any code changes in the actual library are needed.

Does the Django runserver console  notice the incoming connection? It may
provide a clue or traceback. A brief overview of the docs indicates that
the Django processes proxies the connection to the channels workers, do is
imagine something would come up there. Beyond that I can't be much help.

-James

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