Re: Advice: count hits/pageview for high traffic website

2017-03-08 Thread ludovic coues
Have you looked at an analytics solution like piwik ?

2017-03-08 6:40 GMT+01:00 carlos :
> Daniel, no i say i used django for a website with high traffic maybe 70k per
> days, but i need count visit page like
> django-hitocunts but the problems like django-hitcount is not for a website
> high traffic, the database is very slow ans the website down
>
> my question is exist any method, third party app like django-hitcount but
> for site very high traffic Or some idea to do that?
>
> cheers
>
> On Tue, Mar 7, 2017 at 6:04 PM, Daniel Bess  wrote:
>>
>> Hi Carlos,
>>
>> You email is a little unclear.  Are you suggesting I should not use Django
>> for a web backend?
>>
>> Let me know!
>>
>> Thanks,
>>
>> Daniel
>>
>> On Mar 7, 2017, at 3:38 PM, carlos  wrote:
>>
>> Hi,
>> i try used django-hitcount but really not for website high traffic
>> any advice for count visits/hits page for 60k or 100k  traffic for day
>>
>> thank any idea, link or whatever helps
>>
>> --
>> att.
>> Carlos Rocha
>>
>> --
>> 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/CAM-7rO1eRU8kNrbq1J9fmO1yTvEnqbhKp3i2YtnFO5U-oGgbLQ%40mail.gmail.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/C1AB7BB4-BBA6-4156-9826-6C68EE71DF1F%40endocrypt.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> att.
> Carlos Rocha
>
> --
> 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/CAM-7rO27%2B8aWAwrAstsvffPBFk%3DTcq29VURG_%2BbX4HdUerOTcQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 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%2BTY4vp5A14t2nH3VwoOf_sOB8d3CFUTQEtB1kwi1p0a5Fw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error running Django tutorial

2017-03-08 Thread Melvyn Sopacua
Hi,

On Tuesday 07 March 2017 01:24:02 Vanja Falck wrote:


> urlpatterns = [
> url(r'ˆpolls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]

Easy to see this way. You didn't type a caret but some unicode sign that 
looks like a caret.
-- 
Melvyn Sopacua

-- 
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/2571142.lux90pYzcz%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Postgres (sqlmigrate) FK to M2M without RunPython

2017-03-08 Thread Maksym Mospanenko
Yes but I have to run on db server directly (via export sqlmigrate). 
Djando's manage.py can generate sql only for schema migrations - not for 
RunPython data migrations. 

вівторок, 7 березня 2017 р. 13:14:31 UTC+2 користувач Daniel Roseman 
написав:
>
> Schema migrations don't run on the database server, they run on the app 
> server with the rest of your Django code and communicate with the database 
> in exactly the same way. If you can run Django, you can run migrations.
> -- 
> 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/020dca84-25e5-4c36-8d27-1c83579544be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Postgres (sqlmigrate) FK to M2M without RunPython

2017-03-08 Thread Maksym Mospanenko
We don't have access to db server (only via custom django backend driver) 
in our configuration (security reasons). So we have to export raw sql for 
schema migrations manually and we can't generate sql for data migrations 
(because it is python's logic). 

вівторок, 7 березня 2017 р. 11:18:01 UTC+2 користувач Melvyn Sopacua 
написав:
>
> On Monday 06 March 2017 15:40:55 Maksym Mospanenko wrote:
>
> > Hello! I want to migrate data with schema migrations but I can't run
>
> > any python code on database server - only raw sql (postgres).
>
> > How can I move fk column data to m2m table's fk column?
>
>  
>
> On the server you can run python code:
>
> python manage.py sqlmigrate app_label migration_name |psql dbname
>
>  
>
> Or save the output, put it on db server and load it there.
>
> I don't see why though. Just run migrate on the server that runs django.
>
> -- 
>
> Melvyn Sopacua
>

-- 
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/41efb1bc-4314-4826-9bbb-262389ad2437%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Postgres (sqlmigrate) FK to M2M without RunPython

2017-03-08 Thread Melvyn Sopacua
On Wednesday 08 March 2017 03:42:31 Maksym Mospanenko wrote:
> Yes but I have to run on db server directly (via export sqlmigrate).

No, you don't.

> Djando's manage.py can generate sql only for schema migrations 
- not
> for RunPython data migrations.

But you're not *creating* migrations, you're *applying* migrations. 
Please review the difference between "makemigrations" and 
"migrate" command.

-- 
Melvyn Sopacua

-- 
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/5188763.SfP1pqUTFu%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Join with no matching primary keys

2017-03-08 Thread Melvyn Sopacua
On Tuesday 07 March 2017 10:50:24 aysha...@gmail.com wrote:
> Greetings,
> 
> I am trying to do a join on the following 2 models (tables)

Models cannot be joined. There is no Model.join(). Models are 
objects you can relate to eachother.
Once you stop thinking in database terms, the problem is easily 
solved.

Since the two models are identical, why would you use two models? 
Your problem starts with your design - rethink it.
-- 
Melvyn Sopacua

-- 
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/3775117.p8YKjnGoSi%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Advice: count hits/pageview for high traffic website

2017-03-08 Thread Vijay Khemlani
Maybe I'm missing something, but why not Google Analytics?

On 3/8/17, ludovic coues  wrote:
> Have you looked at an analytics solution like piwik ?
>
> 2017-03-08 6:40 GMT+01:00 carlos :
>> Daniel, no i say i used django for a website with high traffic maybe 70k
>> per
>> days, but i need count visit page like
>> django-hitocunts but the problems like django-hitcount is not for a
>> website
>> high traffic, the database is very slow ans the website down
>>
>> my question is exist any method, third party app like django-hitcount but
>> for site very high traffic Or some idea to do that?
>>
>> cheers
>>
>> On Tue, Mar 7, 2017 at 6:04 PM, Daniel Bess  wrote:
>>>
>>> Hi Carlos,
>>>
>>> You email is a little unclear.  Are you suggesting I should not use
>>> Django
>>> for a web backend?
>>>
>>> Let me know!
>>>
>>> Thanks,
>>>
>>> Daniel
>>>
>>> On Mar 7, 2017, at 3:38 PM, carlos  wrote:
>>>
>>> Hi,
>>> i try used django-hitcount but really not for website high traffic
>>> any advice for count visits/hits page for 60k or 100k  traffic for day
>>>
>>> thank any idea, link or whatever helps
>>>
>>> --
>>> att.
>>> Carlos Rocha
>>>
>>> --
>>> 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/CAM-7rO1eRU8kNrbq1J9fmO1yTvEnqbhKp3i2YtnFO5U-oGgbLQ%40mail.gmail.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/C1AB7BB4-BBA6-4156-9826-6C68EE71DF1F%40endocrypt.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> att.
>> Carlos Rocha
>>
>> --
>> 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/CAM-7rO27%2B8aWAwrAstsvffPBFk%3DTcq29VURG_%2BbX4HdUerOTcQ%40mail.gmail.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Cordialement, Coues Ludovic
> +336 148 743 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%2BTY4vp5A14t2nH3VwoOf_sOB8d3CFUTQEtB1kwi1p0a5Fw%40mail.gmail.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/CALn3ei358ivGswC1%3DWx%3D_VmSCjjbMvadR6GLiTnZt_%3DaBiu3EA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Redirection to SSO using Django

2017-03-08 Thread Arun S
Hi,

My Project, i would want to redirect login page to a SSO page.
and handle redirection in Django.

I am using Apache Server.

Whats the best way to implement this ?

i was reading about django - remoteusermiddleware but could'nt quite figure 
out how to handle the redirection.

Any help is appreciated.

Cheers
Arun.

-- 
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/be86285c-7e27-4792-9df2-f9703d557921%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Not Root Url for my djano app integrated with apache with mod_swgi

2017-03-08 Thread valerio orfano
Hello guys

i've been facing the following problem. I got django 1.9 integrated with 
apache 2.4+ via mod_wsgi application. i run manage.py collect and 
everythiong is fine when i use the root url.

http//10.184.2.231  it is ok and static files are served properly.

Actually i will be redirected to my django app from the link 
www.mydomain.com/nuovopatetdb 

This is my configuration 


from urls.py

from django.conf.urls import url
from . import views
urlpatterns = [
 url(r'^$', views.search_ES,name='search_ES'),
 url(r'^nuovopatentdb$', views.search_ES,name='search_ES'), 
 url(r'^download/(?P.*)$', views.send_file, name="download"),
 url(r"^documents$", views.documents,name="documents"),
   
]


from settings.py

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
WSGI_APPLICATION = 'ES_Brevetti.wsgi.application'
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'patentdb.apps.patentdbConfig',
 'mod_wsgi.server',
#'widget_tweaks',
#'haystack',
'el_pagination',
]


and from httpconf.d

Alias '/static' '/home/elastic/workspace/ES_Brevetti/static'


Order allow,deny
Allow from all

= 2.4>
Require all granted





This is an example of  my template:






The image giphy.gif cannot be server and i get the3 follwoing error:

GET http://www.uibm.gov.it/static/images/giphy.gif 404 (Not Found)

How cain i work this around?


Many many thanx for ur help

-- 
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/90e93a47-164f-4d3b-8f6e-d2c0738e90d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Logging CSRF errors and other HTTP errors by Django

2017-03-08 Thread Web Architect
Hi,

Is there a way to log CSRF errors? Like whenever an user visits my site and 
faces a CSRF error, I would like Django to log it in a file. I would like 
to know if my users are facing CSRF errors. 
Also, Can Django log HTTP error codes like 4xx or 5xx in a file? 

We are using Django 1.8.3 with uWsgi.

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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5b550f68-70ee-4da2-be05-3303d6550ae5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: field = self.model._meta.get_field(self.field_name) returns self?

2017-03-08 Thread Brandon
This bug is *still* occurring... And seems to do so in waves. But after 
fighting it again and again, something struck me.

The bug always occurs here: django/db/models/fields/reverse_related.py in 
get_related_field at line 244
So always in this function: 
def get_related_field(self):
"""
Return the Field in the 'to' object to which this relationship is 
tied.
"""
field = self.model._meta.get_field(self.field_name)
if not field.concrete:

raise exceptions.FieldDoesNotExist("No related field named '%s'" 
%
self.field_name)
return field


But specifically is it occurring *because*  self.model._meta.get_field(self.
field_name) is not returning a field (e.g. django.db.models.fields.*). 
Somehow self.model._meta.get_field(self.field_name) is returning a 
OneToOneRel object.

Should self.model._meta.get_field(self.field_name) ever return *anything* 
other than some django.db.models.fields.* object?

Cheers!
--Brandon

-- 
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/15ba1e2c-f250-47c2-8926-795463a93620%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Full domain url subfolder redirected my django application with apache with mod_wsgi

2017-03-08 Thread valerio orfano
 

I've been facing the following problem. I got django 1.9 integrated with 
apache 2.4+ via mod_wsgi application. I run manage.py collectstatic and 
everything is fine when i use the root url. http//10.184.2.231 it is ok and 
static files are served properly.

Actually i will be redirected to my django app from the link 
www.mydomain.com/nuovopatentdb

This is my configuration 

from urls.pyfrom django.conf.urls import urlfrom . import views

urlpatterns = [
url(r'^$', views.search_ES,name='search_ES'),
url(r'^nuovopatentdb$', views.search_ES,name='search_ES'), 
url(r'^download/(?P.*)$', views.send_file, name="download"),
url(r"^documents$", views.documents,name="documents"),]

#settings.py

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
WSGI_APPLICATION = 'ES_Brevetti.wsgi.application'

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'patentdb.apps.patentdbConfig',
'mod_wsgi.server',
'el_pagination',]

#httpconf.d
Alias '/static' '/home/elastic/workspace/ES_Brevetti/static'

Order allow,deny
Allow from all= 2.4>
Require all granted

This is an example of my template:




The image giphy.gif cannot be served and i get the3 follwoing error: GET 
http://www.mydomain/static/images/giphy.gif 404 (Not Found)

How can i work this around? Many many thanx for ur help

-- 
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/e2063b5e-9c9e-4802-9439-33e0c69304c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Join with no matching primary keys

2017-03-08 Thread ayshalab

Thanks for your answer, the models represent two different tables, 
identical structure but have to be segregated, there is no better design 
options to implement them. Any leads on how to do the join?

>
>  
>
> Models cannot be joined. There is no Model.join(). Models are objects you 
> can relate to eachother.
>
> Once you stop thinking in database terms, the problem is easily solved.
>
>  
>
> Since the two models are identical, why would you use two models? Your 
> problem starts with your design - rethink it.
>
> -- 
>
> Melvyn Sopacua
>

-- 
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/5f7348a8-2267-4b18-96ee-624b22f63a5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Full domain url subfolder redirected my django application with apache with mod_wsgi

2017-03-08 Thread Antonis Christofides
You say that you "run manage.py collectstatic and everything is fine when i use
the root url. |http//10.184.2.231| it is ok and static files are served
properly", and then you say that http://www.mydomain/static/images/giphy.gif
gives 404 (Not Found).

Is |http//10.184.2.231/|static/images/giphy.gif working?

If not, why are you saying that "static files are served properly"?

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 03/08/2017 04:12 PM, valerio orfano wrote:
>
>   
>
> I've been facing the following problem. I got django 1.9 integrated with
> apache 2.4+ via mod_wsgi application. I run manage.py collectstatic and
> everything is fine when i use the root url. |http//10.184.2.231| it is ok and
> static files are served properly.
>
> Actually i will be redirected to my django app from the link
> |www.mydomain.com/nuovopatentdb|
>
> This is my configuration
>
> |fromurls.py fromdjango.conf.urls importurl from.importviews urlpatterns
> =[url(r'^$',views.search_ES,name='search_ES'),url(r'^nuovopatentdb$',views.search_ES,name='search_ES'),url(r'^download/(?P.*)$',views.send_file,name="download"),url(r"^documents$",views.documents,name="documents"),]#settings.pySTATIC_URL
> ='/static/'STATIC_ROOT =os.path.join(BASE_DIR,'static')WSGI_APPLICATION
> ='ES_Brevetti.wsgi.application'INSTALLED_APPS
> =['django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','patentdb.apps.patentdbConfig','mod_wsgi.server','el_pagination',]#httpconf.dAlias'/static''/home/elastic/workspace/ES_Brevetti/static'Orderallow,deny
> Allowfromall =2.4>Requireall granted
> |
>
> This is an example of my template:
>
> ||
>
> The image giphy.gif cannot be served and i get the3 follwoing error: GET
> http://www.mydomain/static/images/giphy.gif 404 (Not Found)
>
> How can i work this around? Many many thanx for ur help
>
> -- 
> 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/e2063b5e-9c9e-4802-9439-33e0c69304c8%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/25dd2369-710f-0020-89ff-b312bd4f472f%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirection to SSO using Django

2017-03-08 Thread Jani Tiainen

Hi,

You probably need to set LOGIN_REDIRECT_URL [1] to point correct url. 
What happens next depends your SSO tools and how they handle passing 
logged in user information to your app.



[1] https://docs.djangoproject.com/en/1.10/ref/settings/#login-redirect-url


On 08.03.2017 15:26, Arun S wrote:

Hi,

My Project, i would want to redirect login page to a SSO page.
and handle redirection in Django.

I am using Apache Server.

Whats the best way to implement this ?

i was reading about django - remoteusermiddleware but could'nt quite 
figure out how to handle the redirection.


Any help is appreciated.

Cheers
Arun.
--
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/be86285c-7e27-4792-9df2-f9703d557921%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Jani Tiainen

--
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/6b84ece5-2a10-1871-0b56-2f90f7808f7f%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Join with no matching primary keys

2017-03-08 Thread Melvyn Sopacua
On Wednesday 08 March 2017 06:23:44 aysha...@gmail.com 
wrote:
> Thanks for your answer, the models represent two different 
tables,
> identical structure but have to be segregated, there is no 
better
> design options to implement them. Any leads on how to do 
the join?

Think about what the join needs to do. Find duplicates? Get all 
of them in either table?
Provide the right question and Django will do the right join.
-- 
Melvyn Sopacua

-- 
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/3577871.mfF4yOkCY7%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Redirection to SSO using Django

2017-03-08 Thread Melvyn Sopacua
On Wednesday 08 March 2017 05:26:02 Arun S wrote:

> My Project, i would want to redirect login page to a SSO 
page.
> and handle redirection in Django.

Don't solve what others already did for you:
https://djangopackages.org/packages/p/django-allauth/
-- 
Melvyn Sopacua

-- 
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/2405458.0K6hlgtTlC%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Logging CSRF errors and other HTTP errors by Django

2017-03-08 Thread Melvyn Sopacua
On Wednesday 08 March 2017 06:15:42 Web Architect wrote:

> Is there a way to log CSRF errors? Like whenever an user visits 
my
> site and faces a CSRF error, I would like Django to log it in a file.

Did you read the logging documentation[1]?

-- 
Melvyn Sopacua


[1] https://docs.djangoproject.com/en/1.10/topics/logging/

-- 
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/1998403.vVrgzPpvRl%40devstation.
For more options, visit https://groups.google.com/d/optout.


RE: Simple Join with no matching primary keys

2017-03-08 Thread Matthew Pava
Why are there no better design options to implement them?  Are the tables being 
used in another software that you have no control over?
I would just merge the two tables and use one model.

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of aysha...@gmail.com
Sent: Wednesday, March 8, 2017 8:24 AM
To: Django users
Subject: Re: Simple Join with no matching primary keys


Thanks for your answer, the models represent two different tables, identical 
structure but have to be segregated, there is no better design options to 
implement them. Any leads on how to do the join?




Models cannot be joined. There is no Model.join(). Models are objects you can 
relate to eachother.

Once you stop thinking in database terms, the problem is easily solved.



Since the two models are identical, why would you use two models? Your problem 
starts with your design - rethink it.

--

Melvyn Sopacua
--
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/5f7348a8-2267-4b18-96ee-624b22f63a5f%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/c8a3a35bdaaf421ebeda04480b91aba2%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: Error running Django tutorial

2017-03-08 Thread Daniel Bess
Hello!

Daniel

> On Mar 8, 2017, at 12:51 AM, Melvyn Sopacua  wrote:
> 
> Hi,
>  
> On Tuesday 07 March 2017 01:24:02 Vanja Falck wrote:
>  
>  
> > urlpatterns = [
> > url(r'ˆpolls/', include('polls.urls')),
> > url(r'^admin/', admin.site.urls),
> > ]
>  
> Easy to see this way. You didn't type a caret but some unicode sign that 
> looks like a caret.
> -- 
> Melvyn Sopacua
> 
> -- 
> 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/2571142.lux90pYzcz%40devstation
>  
> .
> 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/26363D1B-F3E4-4154-9AEA-4D5373930F4D%40endocrypt.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple Join with no matching primary keys

2017-03-08 Thread ayshalab
Tables are coming from different sources, for each single datetime value 
there is a different url, in order to tie up the single source data it must 
live inside its own table.

On Wednesday, March 8, 2017 at 9:11:42 AM UTC-7, Matthew Pava wrote:
>
> Why are there no better design options to implement them?  Are the tables 
> being used in another software that you have no control over?
>
> I would just merge the two tables and use one model.
>
>  
>
> *From:* django...@googlegroups.com  [mailto:
> django...@googlegroups.com ] *On Behalf Of *aysh...@gmail.com 
> 
> *Sent:* Wednesday, March 8, 2017 8:24 AM
> *To:* Django users
> *Subject:* Re: Simple Join with no matching primary keys
>
>  
>
>  
>
> Thanks for your answer, the models represent two different tables, 
> identical structure but have to be segregated, there is no better design 
> options to implement them. Any leads on how to do the join?
>
>  
>
>  
>
> Models cannot be joined. There is no Model.join(). Models are objects you 
> can relate to eachother.
>
> Once you stop thinking in database terms, the problem is easily solved.
>
>  
>
> Since the two models are identical, why would you use two models? Your 
> problem starts with your design - rethink it.
>
> -- 
>
> Melvyn Sopacua
>
> -- 
> 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 djang...@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/5f7348a8-2267-4b18-96ee-624b22f63a5f%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/a8da45de-6d08-4a04-8f08-ab28d24cc15a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


"trans" template tag using wrong language

2017-03-08 Thread Joan Perals
I have a site using Django 1.10 with German and English as available 
languages, where German is the source language. Dynamic content is 
translated with django-modeltranslation and for static strings I am using 
Django's built-in `trans` template tag.

I want Django to return the page in the visitor's preferred language. I 
have read how Django discovers language preference 

 
several times, and I think I have everything right. As I change my language 
settings in my browser, the value of the `LANGUAGE_CODE` variable when 
displayed in a template always changes accordingly, and also the dynamic 
content is always returned in the expected language by 
django-modeltranslation. The locale middleware is of course in place, and 
so are the *.po and *.mo files as well. The browser request headers also 
look fine. But *it's only the `trans` template tag that is not picking my 
browser's language preference*. Instead, *it seems to directly resort to 
the initial value of the `LANGUAGE_CODE` variable as it is originally set 
in the settings file, without going through the algorithm described in the 
link above*.

Is this known? Certainly not what I expected, and it took me a lot of 
effort to narrow down the issue.

Thanks in advance for your help,

Joan

-- 
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/40954b21-3fb9-4596-8f19-7261ed3e8172%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advice: count hits/pageview for high traffic website

2017-03-08 Thread carlos
ludovic and Vijay i need put in index page sidebar the most visits or
popular page that people saw, you understand me?

Thank ludovic I'm going to read about piwik maybe help me.

Cheers

On Wed, Mar 8, 2017 at 6:38 AM, Vijay Khemlani  wrote:

> Maybe I'm missing something, but why not Google Analytics?
>
> On 3/8/17, ludovic coues  wrote:
> > Have you looked at an analytics solution like piwik ?
> >
> > 2017-03-08 6:40 GMT+01:00 carlos :
> >> Daniel, no i say i used django for a website with high traffic maybe 70k
> >> per
> >> days, but i need count visit page like
> >> django-hitocunts but the problems like django-hitcount is not for a
> >> website
> >> high traffic, the database is very slow ans the website down
> >>
> >> my question is exist any method, third party app like django-hitcount
> but
> >> for site very high traffic Or some idea to do that?
> >>
> >> cheers
> >>
> >> On Tue, Mar 7, 2017 at 6:04 PM, Daniel Bess 
> wrote:
> >>>
> >>> Hi Carlos,
> >>>
> >>> You email is a little unclear.  Are you suggesting I should not use
> >>> Django
> >>> for a web backend?
> >>>
> >>> Let me know!
> >>>
> >>> Thanks,
> >>>
> >>> Daniel
> >>>
> >>> On Mar 7, 2017, at 3:38 PM, carlos  wrote:
> >>>
> >>> Hi,
> >>> i try used django-hitcount but really not for website high traffic
> >>> any advice for count visits/hits page for 60k or 100k  traffic for day
> >>>
> >>> thank any idea, link or whatever helps
> >>>
> >>> --
> >>> att.
> >>> Carlos Rocha
> >>>
> >>> --
> >>> 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/CAM-
> 7rO1eRU8kNrbq1J9fmO1yTvEnqbhKp3i2YtnFO5U-oGgbLQ%40mail.gmail.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/C1AB7BB4-
> BBA6-4156-9826-6C68EE71DF1F%40endocrypt.com.
> >>>
> >>> For more options, visit https://groups.google.com/d/optout.
> >>
> >>
> >>
> >>
> >> --
> >> att.
> >> Carlos Rocha
> >>
> >> --
> >> 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/CAM-7rO27%
> 2B8aWAwrAstsvffPBFk%3DTcq29VURG_%2BbX4HdUerOTcQ%40mail.gmail.com.
> >>
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> >
> > Cordialement, Coues Ludovic
> > +336 148 743 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%
> 2BTY4vp5A14t2nH3VwoOf_sOB8d3CFUTQEtB1kwi1p0a5Fw%40mail.gmail.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/CALn3ei358ivGswC1%3DWx%3D_VmSCjjbMvadR6GLiTnZt_%
> 3DaBiu3EA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
att.
Carlos Rocha

-- 
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, 

Django FormPreview: Save form data to database

2017-03-08 Thread jthewriter


Probably a simple question but having trouble implementing a form preview 
page using django-formtools. I've configured everything per the docs. I'm 
stuck on what to add to the done() method to save the data to db.


forms.py

class JobForm(ModelForm):
class Meta:
model = Job
fields = ('title', 'category', 'company', 'website','description',)
class JobFormPreview(FormPreview):
def done(self, request, cleaned_data):
# add what here to save form data as object?
return HttpResponseRedirect('/success')


urls.py

...
url(r'^jobs/new/$',
JobFormPreview(JobForm),
name='job_form'),...


Using the default templates. The form and preview both render fine, but 
obviously data doesn't save on submit. Tried self.form.save() but get an 
error save() missing 1 required positional argument: 'self'.


I appreciate any guidance.

-- 
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/a2a45d4e-d7cf-469b-9721-990488a3450f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirection to SSO using Django

2017-03-08 Thread Arun S
The Login_redirect comes into picture when SSO redirects the Login back 
with a response.
But i am still unable to redirect my Login page to the Third party page 
using django_settings.

I tried setting LOGIN_URL but, always gets redirected to the django login 
page.

Basically, using Djanog, i want to open third party Login page and then get 
redirected back to handle the response.

Cheers
Arun

On Wednesday, March 8, 2017 at 8:44:54 PM UTC+5:30, Jani Tiainen wrote:
>
> Hi,
>
> You probably need to set LOGIN_REDIRECT_URL [1] to point correct url. What 
> happens next depends your SSO tools and how they handle passing logged in 
> user information to your app.
>
>
> [1] 
> https://docs.djangoproject.com/en/1.10/ref/settings/#login-redirect-url
>
> On 08.03.2017 15:26, Arun S wrote:
>
> Hi,
>
> My Project, i would want to redirect login page to a SSO page.
> and handle redirection in Django.
>
> I am using Apache Server.
>
> Whats the best way to implement this ?
>
> i was reading about django - remoteusermiddleware but could'nt quite 
> figure out how to handle the redirection.
>
> Any help is appreciated.
>
> Cheers
> Arun.
> -- 
> 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/be86285c-7e27-4792-9df2-f9703d557921%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> Jani Tiainen
>
>

-- 
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/1268e5d1-e169-4a34-87ce-fc9914476278%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirection to SSO using Django

2017-03-08 Thread Arun S
Using the django_allauth package, i could see it supports most of the 
social accounts that can use used for redirection.
But what if i want to add a custom link within a corporate account.???

On Wednesday, March 8, 2017 at 9:10:33 PM UTC+5:30, Melvyn Sopacua wrote:
>
> On Wednesday 08 March 2017 05:26:02 Arun S wrote:
>
>  
>
> > My Project, i would want to redirect login page to a SSO page.
>
> > and handle redirection in Django.
>
>  
>
> Don't solve what others already did for you:
>
> https://djangopackages.org/packages/p/django-allauth/
>
> -- 
>
> Melvyn Sopacua
>

-- 
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/1420b92f-a799-48f1-9661-2ec0b46b6ff4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Logging CSRF errors and other HTTP errors by Django

2017-03-08 Thread Web Architect
Thanks for your response. We do use logging but missed the part of 
django.request. Thanks for pointing it. 

On Wednesday, March 8, 2017 at 9:31:21 PM UTC+5:30, Melvyn Sopacua wrote:
>
> On Wednesday 08 March 2017 06:15:42 Web Architect wrote:
>
>  
>
> > Is there a way to log CSRF errors? Like whenever an user visits my
>
> > site and faces a CSRF error, I would like Django to log it in a file.
>
>  
>
> Did you read the logging documentation 
> ?
>
>  
>
> -- 
>
> Melvyn Sopacua
>

-- 
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/da591e49-3bbb-4825-8edf-4836505e8885%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.