Re: Python Math and Physics problem solving

2014-05-21 Thread nishant kashyap
Hi, 
I am inetrested, could you please explain more about the work and project..

Thanks,
Nishant Kashyap

On Wednesday, 21 May 2014 18:31:04 UTC+5:30, Team UK wrote:
>
> Looking for a candidate who has experience in Django Python.
>
> You must have knowledge in Python Math and Physics problem solving,
> Linear algebra,nonlinear system modeling and ANN etc.
>
>
>

-- 
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/4caabe06-bbe2-4612-9887-e8472f05573b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: URL lookup fails in apache/wsgi unless mapped to server root.

2014-05-21 Thread Kelvin Wong
Maybe

WSGIScriptAlias /awma /var/www/djangoapp/djangoapp/wsgi.py

K

On Wednesday, May 21, 2014 9:27:14 PM UTC-7, Spaceman Paul wrote:
>
> My application works fine in runserver and in apache/wsgi mapped to root, 
> but when I map wsgi to a directory, url lookups fail.
>
> E.g. 
>
> Request URL: http://server/awma/times
> ...
> ^times$ [name='times']
> ...
> The current URL, times, didn't match any of these.
>
> Every single URL in the (full) list fails (including "^$", but weirdly 
> enough /admin works fine).
>
> Again, I stress that this all works fine in runserver, and if 
> WSGIScriptAlias is mapped to the server root.
>
> I cannot make sense of this as the URL getting passed to the URL resolver 
> is correct and should match.
>
> Any suggestions?
>
> Python 2.7.  
> Django 1.6.5, but I see the same behaviour with Django 1.4.13.
>
> P.
>

-- 
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/833b116f-bfa1-4b3a-b0f0-9c70053146e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


URL lookup fails in apache/wsgi unless mapped to server root.

2014-05-21 Thread Spaceman Paul
My application works fine in runserver and in apache/wsgi mapped to root, 
but when I map wsgi to a directory, url lookups fail.

E.g. 

Request URL: http://server/awma/times
...
^times$ [name='times']
...
The current URL, times, didn't match any of these.

Every single URL in the (full) list fails (including "^$", but weirdly 
enough /admin works fine).

Again, I stress that this all works fine in runserver, and if 
WSGIScriptAlias is mapped to the server root.

I cannot make sense of this as the URL getting passed to the URL resolver 
is correct and should match.

Any suggestions?

Python 2.7.  
Django 1.6.5, but I see the same behaviour with Django 1.4.13.

P.

-- 
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/fb7d17d5-a530-4ea6-9d03-23d9d00b78e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django export the CSV file from database

2014-05-21 Thread hito koto
Sorry, It was my mistake
This is correct
This is my full  views.py:

 from datetime import datetime, time, date, timedelta
class workLog(object):
def __init__(self, name, day, attTime, leaveTime):
self.name = name
self.day = day
self.attTime = attTime
self.leaveTime = leaveTime

def export_excel(request):
from staffprofile.models import Myattendance,Myleavework
response = HttpResponse(mimetype='
application/vnd.ms-excel; charset="Shift_JIS"')
response['Content-Disposition'] = 'attachment; filename=file.csv'
writer = csv.writer(response)
titles = ["No","name""),"day"),"attTime","leaveTime")]
writer.writerow(titles)
obj_all = attendance.objects.filter().values_list('user', 
'contact_date', 'contact_time').order_by("-contact_date")
lea = 
leavework.objects.filter().values_list('contact_time').order_by('-contact_date')
S = Staff.objects.all()
row = [workLog('name', i, None, None) for i in range(32)]

for att in obj_all:
day = att[2].day
log = row [day]
id = att[0]
log.name = S.filter(id = id).values("user_name")
if log.attTime is None:
log.attTime = att[2]
elif log.attTime < att[2]:
log.attTime = att[2]

for leav in lea:
day = leav[2].day
log = row [day]
if log.leaveTime is None:
log.leaveTime = leav[2]
elif log.leaveTime < leav[2]:
log.leaveTime = leav[2]

for log in row:
if log.attTime is not None:
if log.leaveTime is not None:
row.append((log.attTime, log.leaveTime))
else:
row.append(None)
else:
if log.leaveTime is not None:
row(None)

writer.writerow(row)

This is my full models.py

class Staff(models.Model):
user = models.OneToOneField(User, null=False)
user_name = models.CharField(max_length=255)
first_kana = models.CharField(max_length=255)
last_kana  = models.CharField(max_length=255)
employee_number = models.CharField(max_length=22)

def __unicode__(self):
return self.user_name

class attendance(models.Model):
user = models.ForeignKey(Staff, verbose_name = "name")
contact_date = models.DateField(verbose_name = "date", 
auto_now_add=True)
contact_time = models.TimeField(verbose_name = "time", 
auto_now_add=True)

class Meta:
ordering = ["-contact_time"]

def __unicode__(self):
return unicode(self.user)

class leavework(models.Model):
user = models.ForeignKey(Staff,  verbose_name = "name")
contact_date = models.DateField(verbose_name = "date", 
default=datetime.now)
contact_time = models.TimeField(verbose_name = "time", 
default=datetime.now)

class Meta:
ordering = ["-contact_time"]

def __unicode__(self):
  return unicode(self.user)

2014年5月22日木曜日 11時28分31秒 UTC+9 Andrew Farrell:
>
> So the error is somewhere here:
> for att in attendance:
> day = att[2].day
> But I can't see where `attendance` is defined.
> I suspect you'll have a similar error in
> for leav in leavework:
> day = leav[2].day
> But also can't see where `leavework` is defined.
>
>
> On Wed, May 21, 2014 at 10:24 PM, hito koto  > wrote:
>
>> Hello,
>>
>> I have the  errors in the following: 
>> I don't know how can i to do ?
>>
>>
>>
>>  Request Method: GET  Request URL: http://articlet/export_excel/  Django 
>> Version: 1.6.2  Exception Type: AttributeError  Exception Value: 
>>
>> 'datetime.time' object has no attribute 'date'
>>
>>  Exception Location: /var/www/article/views.py in export_excel, line 195  
>> Python 
>> Executable: /usr/bin/python  Python Version: 2.6.6  
>>
>>  
>>
>>  Traceback Switch to copy-and-paste 
>> view 
>>
>>- /usr/lib/python2.6/site-packages/django/core/handlers/base.py in 
>>get_response 
>>1. 
>>   
>>   response = wrapped_callback(request, 
>> *callback_args, **callback_kwargs)
>>   
>>   ...
>> ▶ Local vars 
>>- /var/www/articlee/views.py in export_excel 
>>1. 
>>   
>>   date = att[2].date
>>   
>>   
>>
>>  
>>
>>  
>>
>>  
>>
>>  
>>
>>  
>>
>>  
>>
>>  
>>
>>  
>>
>>  
>>
>> This is my full  views.py:
>>
>>  from datetime import datetime, time, date, timedelta
>> class workLog(object):
>> def __init__(self, name, day, attTime, leaveTime):
>> self.name = name
>> self.day = day
>> self.attTime = attTime
>> self.leaveTime = leaveTime
>>
>> def export_excel(request):
>> from staffprofile.models import Myattendance,Myleavework
>> response = HttpResponse(mimetype='application/vnd.ms-excel; 
>> charset="Shift_JIS"')
>> response['Content-Disposition'] = 'attachment; filename=file.csv'
>> writer = 

Re: Django export the CSV file from database

2014-05-21 Thread Andrew Farrell
So the error is somewhere here:
for att in attendance:
day = att[2].day
But I can't see where `attendance` is defined.
I suspect you'll have a similar error in
for leav in leavework:
day = leav[2].day
But also can't see where `leavework` is defined.


On Wed, May 21, 2014 at 10:24 PM, hito koto  wrote:

> Hello,
>
> I have the  errors in the following:
> I don't know how can i to do ?
>
>
>
>  Request Method: GET  Request URL: http://articlet/export_excel/  Django
> Version: 1.6.2  Exception Type: AttributeError  Exception Value:
>
> 'datetime.time' object has no attribute 'date'
>
>  Exception Location: /var/www/article/views.py in export_excel, line 195  
> Python
> Executable: /usr/bin/python  Python Version: 2.6.6
>
>
>
>  Traceback Switch to copy-and-paste 
> view
>
>- /usr/lib/python2.6/site-packages/django/core/handlers/base.py in
>get_response
>1.
>
>   response = wrapped_callback(request, 
> *callback_args, **callback_kwargs)
>
>   ...
> ▶ Local vars
>- /var/www/articlee/views.py in export_excel
>1.
>
>   date = att[2].date
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> This is my full  views.py:
>
>  from datetime import datetime, time, date, timedelta
> class workLog(object):
> def __init__(self, name, day, attTime, leaveTime):
> self.name = name
> self.day = day
> self.attTime = attTime
> self.leaveTime = leaveTime
>
> def export_excel(request):
> from staffprofile.models import Myattendance,Myleavework
> response = HttpResponse(mimetype='application/vnd.ms-excel;
> charset="Shift_JIS"')
> response['Content-Disposition'] = 'attachment; filename=file.csv'
> writer = csv.writer(response)
> titles = ["No","name""),"day"),"attTime","leaveTime")]
> writer.writerow(titles)
>
> S = Staff.objects.all()
> row = [workLog('name', i, None, None) for i in range(32)]
>
> for att in attendance:
> day = att[2].day
> log = logMonth[day]
> id = att[0]
> log.name = S.filter(id = id).values("user_name")
> if log.attTime is None:
> log.attTime = att[2]
> elif log.attTime < att[2]:
> log.attTime = att[2]
>
> for leav in leavework:
> day = leav[2].day
> log = logMonth[day]
> if log.leaveTime is None:
> log.leaveTime = leav[2]
> elif log.leaveTime < leav[2]:
> log.leaveTime = leav[2]
>
> for log in logMonth:
> if log.attTime is not None:
> if log.leaveTime is not None:
> row.append((log.attTime, log.leaveTime))
> else:
> row.append(None)
> else:
> if log.leaveTime is not None:
> row(None)
>
> writer.writerow(row)
>
> This is my full models.py
>
> class Staff(models.Model):
> user = models.OneToOneField(User, null=False)
> user_name = models.CharField(max_length=255)
> first_kana = models.CharField(max_length=255)
> last_kana  = models.CharField(max_length=255)
> employee_number = models.CharField(max_length=22)
>
> def __unicode__(self):
> return self.user_name
>
> class attendance(models.Model):
> user = models.ForeignKey(Staff, verbose_name = "name")
> contact_date = models.DateField(verbose_name = "date",
> auto_now_add=True)
> contact_time = models.TimeField(verbose_name = "time",
> auto_now_add=True)
>
> class Meta:
> ordering = ["-contact_time"]
>
> def __unicode__(self):
> return unicode(self.user)
>
> class leavework(models.Model):
> user = models.ForeignKey(Staff,  verbose_name = "name")
> contact_date = models.DateField(verbose_name = "date",
> default=datetime.now)
> contact_time = models.TimeField(verbose_name = "time",
> default=datetime.now)
>
> class Meta:
> ordering = ["-contact_time"]
>
> def __unicode__(self):
>   return unicode(self.user)
>
>
>  --
> 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/dcc033ee-76d7-4870-a495-1c8fb62cb047%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 

Django export the CSV file from database

2014-05-21 Thread hito koto
Hello,

I have the  errors in the following: 
I don't know how can i to do ?



 Request Method: GET  Request URL: http://articlet/export_excel/  Django 
Version: 1.6.2  Exception Type: AttributeError  Exception Value: 

'datetime.time' object has no attribute 'date'

 Exception Location: /var/www/article/views.py in export_excel, line 195  
Python 
Executable: /usr/bin/python  Python Version: 2.6.6  

 

 Traceback Switch to copy-and-paste 
view 
   
   - /usr/lib/python2.6/site-packages/django/core/handlers/base.py in 
   get_response 
   1. 
  
  response = wrapped_callback(request, *callback_args, 
**callback_kwargs)
  
  ...
▶ Local vars  
   - /var/www/articlee/views.py in export_excel 
   1. 
  
  date = att[2].date
  
  

 

 

 

 

 

 

 

 

 

This is my full  views.py:

 from datetime import datetime, time, date, timedelta
class workLog(object):
def __init__(self, name, day, attTime, leaveTime):
self.name = name
self.day = day
self.attTime = attTime
self.leaveTime = leaveTime

def export_excel(request):
from staffprofile.models import Myattendance,Myleavework
response = HttpResponse(mimetype='application/vnd.ms-excel; 
charset="Shift_JIS"')
response['Content-Disposition'] = 'attachment; filename=file.csv'
writer = csv.writer(response)
titles = ["No","name""),"day"),"attTime","leaveTime")]
writer.writerow(titles)

S = Staff.objects.all()
row = [workLog('name', i, None, None) for i in range(32)]

for att in attendance:
day = att[2].day
log = logMonth[day]
id = att[0]
log.name = S.filter(id = id).values("user_name")
if log.attTime is None:
log.attTime = att[2]
elif log.attTime < att[2]:
log.attTime = att[2]

for leav in leavework:
day = leav[2].day
log = logMonth[day]
if log.leaveTime is None:
log.leaveTime = leav[2]
elif log.leaveTime < leav[2]:
log.leaveTime = leav[2]

for log in logMonth:
if log.attTime is not None:
if log.leaveTime is not None:
row.append((log.attTime, log.leaveTime))
else:
row.append(None)
else:
if log.leaveTime is not None:
row(None)

writer.writerow(row)

This is my full models.py

class Staff(models.Model):
user = models.OneToOneField(User, null=False)
user_name = models.CharField(max_length=255)
first_kana = models.CharField(max_length=255)
last_kana  = models.CharField(max_length=255)
employee_number = models.CharField(max_length=22)

def __unicode__(self):
return self.user_name

class attendance(models.Model):
user = models.ForeignKey(Staff, verbose_name = "name")
contact_date = models.DateField(verbose_name = "date", 
auto_now_add=True)
contact_time = models.TimeField(verbose_name = "time", 
auto_now_add=True)

class Meta:
ordering = ["-contact_time"]

def __unicode__(self):
return unicode(self.user)

class leavework(models.Model):
user = models.ForeignKey(Staff,  verbose_name = "name")
contact_date = models.DateField(verbose_name = "date", 
default=datetime.now)
contact_time = models.TimeField(verbose_name = "time", 
default=datetime.now)

class Meta:
ordering = ["-contact_time"]

def __unicode__(self):
  return unicode(self.user)


-- 
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/dcc033ee-76d7-4870-a495-1c8fb62cb047%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: inspectdb and postgresql schemas support - ticket #22673

2014-05-21 Thread Russell Keith-Magee
On Thu, May 22, 2014 at 3:33 AM, Fabio Caritas Barrionuevo da Luz <
bna...@gmail.com> wrote:

> *Django not provides way to use inspectdb in a postgresql schema with name
> different of "public"*
>
> If you think this is an important feature and should be included in
> django, Please send your considerations and use cases to the topic:
>
> https://groups.google.com/forum/#!topic/django-developers/lSHrDFZM4lQ
>
> If you do not know the concept of postgresql schema, please read:
>
> ​http://www.postgresql.org/docs/9.3/static/ddl-schemas.html
>
> This is an especially useful feature if you have to deal with the legacy
> database and perhaps also for multiple-tenant
>
> This is a feature requested for 8 years[1][2].
>

To provide some perspective here -- there's no shortage of people who have
expressed an interest in this idea. What we're missing is someone to write
the code. #6148 was on the 'intended feature list' for several releases
(back when we had an intended feature list as part of our release process),
but the patch never got to a point of maturity that would allow it to be
merged into master.

So - yes, this is a worthy feature. If a working, tested, documented patch
were available, it would probably find its way into trunk reasonably
quickly. What we don't have is that patch. We need someone from the
community to contribute such a patch.

Yours,
Russ Magee %-)

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


Django - User custom field

2014-05-21 Thread Nikko Reyes


Hi I'm new to Django and I'd just like to ask what's the best way to add a 
custom profile field (e.g. companyid).

I'm reading this: https://docs.djangoproject.com/en/1.6/topics/auth/

Should I just create 2 new apps? Company App and then User Profile app?

I'm looking to use the CompanyID as a criteria / filter that will be used 
in page views.
---

- http://stackoverflow.com/questions/23791526/django-user-custom-field


-- 
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/f6883bf0-744d-48bb-af5e-7aba0a8aee8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: website statistics

2014-05-21 Thread chansonsyiddish

Yes, lots of!
I've been using google analytics for another website for a few years, 
because it was easy to use, and didn't need any technical knowledge, and 
it works ok. But since I intend now to be more in control of what goes 
on, and have time to learn, I see no reason why I should go on giving 
google all these data and not knowing what it does with it, whom it 
sells it to. Furthermore, google analytics is quite "heavy", gives me a 
lot of things I don't need, doesn't give me other things I need, and I 
can't have the data precisely as I want them.


Thanks for the suggestion anyway... other ideas?

Hélène



On 21/05/2014 20:23, Andreas Kuhne wrote:
I would use google analytics for that. Any reason why you are not 
using google analytics?


Regards,

Andréas


2014-05-21 20:15 GMT+02:00 chansonsyiddish >:


Thanks for your answer, Avraham, I will look into the logfile to
see if I can use that. I don't need any "pretty" display, just
plain visitors data, and their comportement while they visit the
website.

Is there someone else who'd have already done this sort of things,
managing directly the statistics for his/her website?

Hélène



--
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/537D02A5.20302%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


inspectdb and postgresql schemas support - ticket #22673

2014-05-21 Thread Fabio Caritas Barrionuevo da Luz
*Django not provides way to use inspectdb in a postgresql schema with name 
different of "public"*

If you think this is an important feature and should be included in django, 
Please send your considerations and use cases to the topic:

https://groups.google.com/forum/#!topic/django-developers/lSHrDFZM4lQ

If you do not know the concept of postgresql schema, please read:

​http://www.postgresql.org/docs/9.3/static/ddl-schemas.html

This is an especially useful feature if you have to deal with the legacy 
database and perhaps also for multiple-tenant

This is a feature requested for 8 years[1][2].

I think now is a good time to include it (into Django 1.8) due to the new 
migration system (by Andrew Godwin [3]) and improved support for postgresql 
(by Marc Tamlyn[4])

I think this is also valid for Oracle and MSSQL

I opened the new ticket to handle this specific feature:

https://code.djangoproject.com/ticket/22673

Excuse me for english, I'm still learning.

[1] https://code.djangoproject.com/ticket/1051
[2] https://code.djangoproject.com/ticket/6148
[3] 
https://www.kickstarter.com/projects/andrewgodwin/schema-migrations-for-django
[4] 
https://www.kickstarter.com/projects/mjtamlyn/improved-postgresql-support-in-django


-- 
Fábio C. Barrionuevo da Luz
Acadêmico de Sistemas de Informação na Faculdade Católica do Tocantins - 
FACTO
Palmas - Tocantins - Brasil - América do Sul

-- 
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/40e995cb-fe97-44ae-a3b0-255df4942a49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: The installation instructions for Windows is based on Python 3.4 But The MySQL connectors for Python are only for 2.7, 3.2 and 3.3

2014-05-21 Thread llanitedave


On Wednesday, May 21, 2014 11:40:08 AM UTC-7, Tom Evans wrote:
>
> On Wed, May 21, 2014 at 12:05 AM, Varuna Seneviratna 
>  wrote: 
> > The installation instructions for Windows is based on Python 3.4 But The 
> > MySQL connectors for Python are only for 2.7, 3.2 and 3.3 
> > What is the solution the problem? 
> > 
>
> PostgreSQL, sqlite or complain to Oracle. 


> Cheers 
>
> Tom 
>

Postgresql only supports to 3.3 as well if you're using psycopg2.  I'm not 
sure what other driver you can use in its place.  

-- 
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/ece3dcf5-d624-4f63-b081-b697a91b69bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: The installation instructions for Windows is based on Python 3.4 But The MySQL connectors for Python are only for 2.7, 3.2 and 3.3

2014-05-21 Thread Tom Evans
On Wed, May 21, 2014 at 12:05 AM, Varuna Seneviratna
 wrote:
> The installation instructions for Windows is based on Python 3.4 But The
> MySQL connectors for Python are only for 2.7, 3.2 and 3.3
> What is the solution the problem?
>

PostgreSQL, sqlite or complain to Oracle.

Cheers

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


Re: website statistics

2014-05-21 Thread Andreas Kuhne
I would use google analytics for that. Any reason why you are not using
google analytics?

Regards,

Andréas


2014-05-21 20:15 GMT+02:00 chansonsyiddish :

> Thanks for your answer, Avraham, I will look into the logfile to see if I
> can use that. I don't need any "pretty" display, just plain visitors data,
> and their comportement while they visit the website.
>
> Is there someone else who'd have already done this sort of things,
> managing directly the statistics for his/her website?
>
> Hélène
>
>
> On 21/05/2014 17:11, Avraham Serour wrote:
>
> Someone correct me if I'm wrong but I believe this is usually done outside
> the scope of django, parsing the webserver logfile or using one of those js
> analytics libraries
>
> --
> 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/537CED3D.2080603%40gmail.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/CALXYUbmmVc1pBtK%2BnjhA6%2Bs_7bmp8zD1QOHUDH0uJ2oJkbz%3D2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: website statistics

2014-05-21 Thread chansonsyiddish
Thanks for your answer, Avraham, I will look into the logfile to see if 
I can use that. I don't need any "pretty" display, just plain visitors 
data, and their comportement while they visit the website.


Is there someone else who'd have already done this sort of things, 
managing directly the statistics for his/her website?


Hélène


On 21/05/2014 17:11, Avraham Serour wrote:

Someone correct me if I'm wrong but I believe this is usually done 
outside the scope of django, parsing the webserver logfile or using one 
of those js analytics libraries


--
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/537CED3D.2080603%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: function to create objects in a given model

2014-05-21 Thread chansonsyiddish
Thanks a lot, Tom, I think this is just what I need, I will try it asap 
and see which is better, between the two solutions.


Regards,
Hélène




On 21/05/2014 19:35, Tom Lockhart wrote:
On 2014-05-21, at 9:15 AM, chansonsyiddish > wrote:



Thanks, Tom,

I'm not sure I need to use signals altogether, as I know when a Song 
is added. If I make a method in the Song model, I suppose I can 
import the model and run it in the shell? Or is there a way I could 
run it directly from the admin site?


Yes and yes.

python manage.py shell
>>> from yourapp.models import Song
>>> s = Song.objects.get(title='your title here')
>>> s.make_words()

For the admin interface, look at the actions keyword for admin 
classes. Something like


class SongAdmin(admin.ModelAdmin):
  ...
  actions = ['gen_words']
  ...
  def gen_words(self, request, queryset):
for obj in queryset:
  obj.make_words()
  pass
return
gen_words.description='Generate words for selected songs'

To do the same for all songs at once you can implement a management 
command for the command line or if in the admin GUI you will likely 
want to implement a GUI button. I'd stayed away from GUI buttons 
previously but it turns out to be pretty simple once you have one done.


hth

 - Tom




Hélène




On 21/05/2014 17:15, Tom Lockhart wrote:
On 2014-05-20, at 12:26 PM, "C. Kirby" > wrote:


I would strongly suggest you use signals 
.


This nicely enables an automatic path of execution. But if you also 
want to execute this code, say, from the admin interface or 
separately for testing then you may want to package the fundamental 
code into a method of the Song model, then run that method in the 
signal handler.


hth

- 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/537CD10A.9070307%40gmail.com 
.

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


Please consider the environment before printing this message.
*/This message may be privileged and/or confidential, and the sender 
does not waive any related rights and obligations.  Any distribution, 
use or copying of this message or the information it contains by other 
than an intended recipient is unauthorized.  If you received this 
message in error, please immediately advise me by return e-mail or 
phone.  All information, references, images, programs, source code, or 
other materials whatsoever contained in, or supplied with, this 
document are TRADE SECRETS and governed by the Uniform Trade Secrets 
Act.  User assumes all direct and consequential liabilities and costs 
that result from any unauthorized disclosure or use of this 
information./*


--
You received this message because you are subscribed to a topic in the 
Google Groups "Django users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/django-users/z416rzZ8Ih8/unsubscribe.
To unsubscribe from this group and all its topics, 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/75348526-0BC0-4153-B1C9-2DCEA95F3282%40gmail.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/537CEC37.4060502%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Many links to one function in url.py

2014-05-21 Thread Lucas Klassmann
Hi Jun,

The diference is:

With \w only one character is allowed and not allow null, like this:
/link/a/
With \w+ one or more characters is allowed and not allow null, like this:
/link/mypage/
With \w* zero or more is allowed and also null argument, like this: /link//
  (Note the double slash, django will allow urls like this)

And \d+ is same that \w+, but for only numbers.

More information, you must read Regular Expression for python:
https://docs.python.org/2/library/re.html

Cheers


On Wed, May 21, 2014 at 1:07 PM, Jun Tanaka  wrote:

> Hi Lucas,
>
> Thank you very much. It seems that I can use this. Hopefully, I can ask
> you one more question.
>
> \d+ is for a int.
> is \w+ for a string?
> What does \w* mean? I saw it.
>
> Jun
>
> 2014年5月21日水曜日 11時49分46秒 UTC+9 Lucas Klassmann:
>>
>> Hi Jun,
>>
>> Try this:
>>
>> Put only this line in urls.py
>>
>> url(r'^link/(?P<*identifier*>\d+)/$', 'project.apps.main.get'),
>>
>>
>>  And in your view, add *identifier* as argument in function:
>>
>> def get(request, *identifier*):
>> ...
>> return HttpResponse(u'Identifier %d' % *identifier*)
>>
>> Note that *identifier* is a *int* and you must use link as */link/1*
>>
>> Read more:
>> https://docs.djangoproject.com/en/dev/topics/http/urls/
>>
>> Cheers.
>>
>> --
>> Lucas Klassmann
>> Software Developer
>> Email: lucaskl...@gmail.com
>> Web site: http://www.lucasklassmann.com
>>
>  --
> 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/1fc15ca2-d8a5-4856-b14e-be5eefa9225b%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Lucas Klassmann
Desenvolvedor de Software

Email: lucasklassm...@gmail.com
Web site: http://www.lucasklassmann.com

-- 
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/CAOz50pJY2-SRatOiUnzeUHNNpV7cXLnLmCYjwJKbQy6-yWB9BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: function to create objects in a given model

2014-05-21 Thread Tom Lockhart
On 2014-05-21, at 9:15 AM, chansonsyiddish  wrote:

> Thanks, Tom,
> 
> I'm not sure I need to use signals altogether, as I know when a Song is 
> added. If I make a method in the Song model, I suppose I can import the model 
> and run it in the shell? Or is there a way I could run it directly from the 
> admin site? 

Yes and yes.

python manage.py shell
>>> from yourapp.models import Song
>>> s = Song.objects.get(title='your title here')
>>> s.make_words()

For the admin interface, look at the actions keyword for admin classes. 
Something like

class SongAdmin(admin.ModelAdmin):
  ...
  actions = ['gen_words']
  ...
  def gen_words(self, request, queryset):
for obj in queryset:
  obj.make_words()
  pass
return
gen_words.description='Generate words for selected songs'

To do the same for all songs at once you can implement a management command for 
the command line or if in the admin GUI you will likely want to implement a GUI 
button. I'd stayed away from GUI buttons previously but it turns out to be 
pretty simple once you have one done.

hth

 - Tom


> 
> Hélène
> 
> 
> 
> 
> On 21/05/2014 17:15, Tom Lockhart wrote:
>> On 2014-05-20, at 12:26 PM, "C. Kirby"  wrote:
>> 
>>> I would strongly suggest you use signals.
>> 
>> This nicely enables an automatic path of execution. But if you also want to 
>> execute this code, say, from the admin interface or separately for testing 
>> then you may want to package the fundamental code into a method of the Song 
>> model, then run that method in the signal handler.
>> 
>> hth
>> 
>> - 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/537CD10A.9070307%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Please consider the environment before printing this message.
This message may be privileged and/or confidential, and the sender does not 
waive any related rights and obligations.  Any distribution, use or copying of 
this message or the information it contains by other than an intended recipient 
is unauthorized.  If you received this message in error, please immediately 
advise me by return e-mail or phone.  All information, references, images, 
programs, source code, or other materials whatsoever contained in, or supplied 
with, this document are TRADE SECRETS and governed by the Uniform Trade Secrets 
Act.  User assumes all direct and consequential liabilities and costs that 
result from any unauthorized disclosure or use of this information.

-- 
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/75348526-0BC0-4153-B1C9-2DCEA95F3282%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What happens when secret key is lost?

2014-05-21 Thread Tim Chase
On 2014-05-21 16:44, Erik Romijn wrote:
> > Could you elaborate on how such remote-code execution would
> > happen?  
> 
> If you use Django's cookie-based sessions[1], knowledge of the
> SECRET_KEY allows an attacker to forge a cookie with session data.
> Forging sessions is bad enough, but if you combine this with
> PickleSerializer[2], that escalates to remote code execution:
> pickle is flexible but also unsafe: it's fairly simple to fabricate
> data that, when unpickled, executes particular Python code. This is
> why one must never unpickle data from an untrusted source.

I know not to (and don't) use Pickle for that reason, but if Django is
using it and trusting the SECRET_KEY to protect it, that makes perfect
sense. Thanks!

-tkc



-- 
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/20140521120129.091f9cfd%40bigbox.christie.dr.
For more options, visit https://groups.google.com/d/optout.


Re: Many links to one function in url.py

2014-05-21 Thread François Schiettecatte
You can also do something like this:

(r'^link(?Pd+)/$', 'project.apps.main.get'),

project.apps.main.get will be passed a parameter called linkID containing the 
number, and if you wanted to limit it to digits 1 through 4, you would use:

(r'^link(?P[1-4])/$', 'project.apps.main.get'),

Cheers

François

On May 21, 2014, at 12:32 PM, Tom Evans  wrote:

> On Wed, May 21, 2014 at 3:40 AM, Jun Tanaka  wrote:
>> Hi there.
>> 
>> 
>> I hope to know the solution for the following:
>> say, there are several links to one function but I would like to identify
>> which link that come from.
>> 
>> url.py looks
>> 
>>(r'^link1/$', 'project.apps.main.get'),
>>(r'^link2/$', 'project.apps.main.get'),
>>(r'^link3/$', 'project.apps.main.get'),
>>(r'^link4/$', 'project.apps.main.get'),
>> 
>> In 'get' function, how can I know which link does that come from? Later, I
>> want to get a parameter , 1, 2, 3, 4 in that function.
>> 
>> If anyone have a good idea? please teach me.
> 
> You can add arguments to send to the view in the url:
> 
> https://docs.djangoproject.com/en/1.6/topics/http/urls/#passing-extra-options-to-view-functions
> 
> Eg:
> 
> urlpatterns = patterns('',
>url(r'^link1/$', 'project.apps.main.get', { 'type': 'link1' }),
>url(r'^link2/$', 'project.apps.main.get', { 'type': 'link2' }),
>url(r'^link3/$', 'project.apps.main.get', { 'type': 'link3' }),
>url(r'^link4/$', 'project.apps.main.get', { 'type': 'link4' }),
> )
> 
> Make sure that you use the url() function rather than a raw tuple.
> 
> Cheers
> 
> 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/CAFHbX1Kjey_jLvi-GsNq0kOFU2PzsXVTx231nrOxrVBHkHsx%2BA%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8C49BDCD-F548-44D9-85A2-9E423604AF6C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Many links to one function in url.py

2014-05-21 Thread Tom Evans
On Wed, May 21, 2014 at 3:40 AM, Jun Tanaka  wrote:
> Hi there.
>
>
> I hope to know the solution for the following:
> say, there are several links to one function but I would like to identify
> which link that come from.
>
> url.py looks
>
> (r'^link1/$', 'project.apps.main.get'),
> (r'^link2/$', 'project.apps.main.get'),
> (r'^link3/$', 'project.apps.main.get'),
> (r'^link4/$', 'project.apps.main.get'),
>
> In 'get' function, how can I know which link does that come from? Later, I
> want to get a parameter , 1, 2, 3, 4 in that function.
>
> If anyone have a good idea? please teach me.

You can add arguments to send to the view in the url:

https://docs.djangoproject.com/en/1.6/topics/http/urls/#passing-extra-options-to-view-functions

Eg:

urlpatterns = patterns('',
url(r'^link1/$', 'project.apps.main.get', { 'type': 'link1' }),
url(r'^link2/$', 'project.apps.main.get', { 'type': 'link2' }),
url(r'^link3/$', 'project.apps.main.get', { 'type': 'link3' }),
url(r'^link4/$', 'project.apps.main.get', { 'type': 'link4' }),
)

Make sure that you use the url() function rather than a raw tuple.

Cheers

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


Re: function to create objects in a given model

2014-05-21 Thread chansonsyiddish

Thanks, Tom,

I'm not sure I need to use signals altogether, as I know when a Song is 
added. If I make a method in the Song model, I suppose I can import the 
model and run it in the shell? Or is there a way I could run it directly 
from the admin site?


Hélène




On 21/05/2014 17:15, Tom Lockhart wrote:
On 2014-05-20, at 12:26 PM, "C. Kirby" > wrote:


I would strongly suggest you use signals 
.


This nicely enables an automatic path of execution. But if you also 
want to execute this code, say, from the admin interface or separately 
for testing then you may want to package the fundamental code into a 
method of the Song model, then run that method in the signal handler.


hth

- 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/537CD10A.9070307%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Many links to one function in url.py

2014-05-21 Thread Jun Tanaka
Hi Lucas,

Thank you very much. It seems that I can use this. Hopefully, I can ask you 
one more question. 

\d+ is for a int. 
is \w+ for a string?  
What does \w* mean? I saw it. 

Jun

2014年5月21日水曜日 11時49分46秒 UTC+9 Lucas Klassmann:
>
> Hi Jun,
>
> Try this:
>
> Put only this line in urls.py
>
> url(r'^link/(?P<*identifier*>\d+)/$', 'project.apps.main.get'),
>
>
>  And in your view, add *identifier* as argument in function:
>
> def get(request, *identifier*):
> ...
> return HttpResponse(u'Identifier %d' % *identifier*)
>
> Note that *identifier* is a *int* and you must use link as */link/1*
>
> Read more:
> https://docs.djangoproject.com/en/dev/topics/http/urls/
>
> Cheers.
>
> -- 
> Lucas Klassmann
> Software Developer
> Email: lucaskl...@gmail.com 
> Web site: http://www.lucasklassmann.com
>  

-- 
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/1fc15ca2-d8a5-4856-b14e-be5eefa9225b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: BookMarker Project - Opening local files on localhost through Django generated pages

2014-05-21 Thread Aseem Bansal
I am running with DEBUG=TRUE so far

On Wednesday, May 21, 2014 12:10:02 AM UTC+5:30, Adam wrote:
>
>  On Tue, 2014-05-20 at 11:29 -0700, Aseem Bansal wrote: 
>
> I am working on a BookMarker project for managing my bookmarks. I was 
> creating the search page for lisitng bookmarks as per categories. I hit a 
> snag while testing it. I am unable to open locally stored webpages. I 
> understand that it is for security purposes but is it possible 
> (cross-browser way) to grant permissions for a app to open locally stored 
> files? The app can ask for permissions for this. 
>
>
> Are you running with DEBUG=True or did you set ALLOWED_HOSTS?
>
>
>   -- 
> Adam (ad...@csh.rit.edu )
>
>
>   

-- 
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/f2ff621a-d6b4-4900-85a4-95b3a3d369cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: function to create objects in a given model

2014-05-21 Thread Chansons
Thanks a lot, I'll try that.
Hélène


Le mardi 20 mai 2014 20:50:34 UTC+2, Ilya Kazakevich a écrit :
>
> Hello, 
>
> Try managers: https://docs.djangoproject.com/en/1.6/topics/db/managers/ 
>
> Ilya Kazakevich, 
> JetBrains PyCharm (Best Python/Django IDE) 
> http://www.jetbrains.com/pycharm/ 
> "Develop with pleasure!" 
>
>
> >-Original Message- 
> >From: django...@googlegroups.com  
> >[mailto:django...@googlegroups.com ] On Behalf Of Chansons 
> >Sent: Tuesday, May 20, 2014 7:10 PM 
> >To: django...@googlegroups.com  
> >Subject: function to create objects in a given model 
> > 
> >Hello everybody, 
> > 
> >I'm new to django, and writing my first app, I have a question before 
> deploying it. 
> > 
> >I need to have a function that would create or modify, according to a few 
> rules 
> >and a precise instance of a model (Song), many instances of another model 
> >(Words) at once. 
> >Writing that function is easy, my problem is, where should I put it, so 
> it's easy to 
> >use when the application will be in production? 
> >Should it be in the model layer? Or in a separate module? Will I call it 
> with the 
> >shell? Is it possible to access it via the admin site? Or any other way? 
> > 
> >I don't find anything about that in the docs, or in google, any ideas 
> will be 
> >welcome. I can be more precise if needed... 
> >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 http://groups.google.com/group/django-users. 
> >To view this discussion on the web visit 
> >
> https://groups.google.com/d/msgid/django-users/81d42f98-04da-4e8f-8c0b-3ac 
> >86601e116%40googlegroups.com 
> ><
> https://groups.google.com/d/msgid/django-users/81d42f98-04da-4e8f-8c0b-3a 
> >c86601e116%40googlegroups.com?utm_medium=email_source=footer> . 
> >For more options, visit https://groups.google.com/d/optout. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fbe173a8-cfbe-489c-bc56-e767edc914b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: website statistics

2014-05-21 Thread Avraham Serour
You'll need to know what information you need and how you want it to be
displayed.

Do you need to know how many times buttons were clicked on your website?
how many times a specific page was opened, how many times a picture was
downloaded? the average times some page was opened each day during last
week?

How do you need it displayed? A list of number? a pie chart? bar?

Someone correct me if I'm wrong but I believe this is usually done outside
the scope of django, parsing the webserver logfile or using one of those js
analytics libraries


On Wed, May 21, 2014 at 6:05 PM, Chansons  wrote:

> Hello,
>
> looking on the web, I didn't find any website statistics script written
> with python, or django.
> If some exist, where could I find them, and if not, what do I need to know
> to write my own?
>
> 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/05358942-a9f3-427c-8550-6ca160900bd9%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/CAFWa6tLF5%3DFLk6tKoh7-TfbDr-ABDcfpQgNp1kmsB-ZFinKDhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


website statistics

2014-05-21 Thread Chansons
Hello,

looking on the web, I didn't find any website statistics script written 
with python, or django.
If some exist, where could I find them, and if not, what do I need to know 
to write my own?

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/05358942-a9f3-427c-8550-6ca160900bd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What happens when secret key is lost?

2014-05-21 Thread Erik Romijn
On 20 May 2014, at 22:27, Tim Chase  wrote:
>> And yes, it is very important to keep it secret. The worst case
>> scenario for secret key leakage, in particular configurations, is
>> arbitrary remote code execution.
> 
> Could you elaborate on how such remote-code execution would happen?

If you use Django's cookie-based sessions[1], knowledge of the SECRET_KEY 
allows an attacker to forge a cookie with session data. Forging sessions is bad 
enough, but if you combine this with PickleSerializer[2], that escalates to 
remote code execution: pickle is flexible but also unsafe: it's fairly simple 
to fabricate data that, when unpickled, executes particular Python code. This 
is why one must never unpickle data from an untrusted source.

PickleSerializer was the only option in Django<1.5, default option in Django 
1.6, and non-default option in Django 1.7+, for this reason. As far as I know, 
cookie-backed sessions have never been the default in Django.

See my blog[3] for a more extensive description and a proof of concept based on 
Flask.

On 21 May 2014, at 16:03, Henning Sprang  wrote:
> As of the location where to document it, I stumbled about it in the
> "deployment checklist" part of the docs, there was only said it's
> important to keep it secret while those further questions kept
> unanswered - so when adding more info, you might also put a link on
> the deployment pages when working on it anyway.

Thanks for the suggestion, that would be useful indeed.

cheers,
Erik

[1] 
https://docs.djangoproject.com/en/1.6/topics/http/sessions/#using-cookie-based-sessions
[2] 
https://docs.djangoproject.com/en/1.6/topics/http/sessions/#session-serialization
[3] 
http://erik.io/blog/2013/04/26/proof-of-concept-arbitrary-remote-code-execution-pickle-sessions/

-- 
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/652F9C27-15F3-48BC-930E-E0E5EA766A25%40solidlinks.nl.
For more options, visit https://groups.google.com/d/optout.


Re: What happens when secret key is lost?

2014-05-21 Thread Henning Sprang
Hi Erik,

On Tue, May 20, 2014 at 8:34 PM, Erik Romijn  wrote:
> ...
> If it were used for that, that would indeed be the scenario. Fortunately, 
> it's not.

Good to know :)

> There is a current ticket open on documenting exactly this question: 
> https://code.djangoproject.com/ticket/22310. I'd worked through most of it 
> but somehow lost my changes.

Thanks for your explanations - they help a lot!
As of the location where to document it, I stumbled about it in the
"deployment checklist" part of the docs, there was only said it's
important to keep it secret while those further questions kept
unanswered - so when adding more info, you might also put a link on
the deployment pages when working on it anyway.

Let me know if you need help, e.g. proof-reading through what you will
put in the docs.

Thanks,
Henning



-- 
Henning Sprang
http://www.sprang.de

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


Python Math and Physics problem solving

2014-05-21 Thread Team UK
Looking for a candidate who has experience in Django Python.

You must have knowledge in Python Math and Physics problem solving,
Linear algebra,nonlinear system modeling and ANN etc.


-- 
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/5d790bf3-e0f0-4dc4-b0ae-242799d594c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: The Django 1.7 tees!

2014-05-21 Thread Sithembewena Lloyd Dube
Hi Russell,

Thank you! I really appreciate you bringing the campaign back :)

Kind regards,
Sithu


On Wed, May 21, 2014 at 1:35 PM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> Hi Sithu,
>
> Good news! It turns out you weren't the only person to have problems
> placing an order, so we've re-opened the campaign for one last run to make
> sure everyone who wants a shirt can get one. You can place your order here:
>
> http://teespring.com/django17-v2
>
> You have until the end of May.
>
> Yours,
> Russ Magee %-)
>
>
>
> On Thu, May 1, 2014 at 7:03 PM, Sithembewena Lloyd Dube  > wrote:
>
>> Hi Russell,
>>
>> Thank you for the feedback. I'm hoping that others may show interest so
>> that the campaign could be re-opened. I will be watching this closely :)
>>
>> Kind regards,
>> Sithu
>>
>>
>> On Thu, May 1, 2014 at 2:39 AM, Russell Keith-Magee <
>> russ...@keith-magee.com> wrote:
>>
>>> Hi Sithu,
>>>
>>> Unfortunately, we can't add orders once the campaign is closed - this is
>>> one of the features of TeeSpring as a fund raising method.
>>>
>>> We *can* relaunch the campaign, but that campaign would be independent
>>> to the original. It would have its own sales target, its own closing date,
>>> and so on.
>>>
>>> The lowest we can set the sales target is 20 shirts. I know there are
>>> about 6 other orders out there from people who missed the deadline; if
>>> there's any other interest out there (speak up in a reply if you're
>>> interested), we might consider reopening the campaign for a week.
>>>
>>> Yours,
>>> Russ Magee %-)
>>>
>>>
>>> On Wed, Apr 30, 2014 at 11:58 PM, Sithembewena Lloyd Dube <
>>> zebr...@gmail.com> wrote:
>>>
 To Whom It May Concern,

 I am devastated that I could not place an order for one of the new
 Django 1.7 tees. Now that I am ready to go, the campaign has ended on the
 merchant website.

 May I please place an order for one? I'd dearly like a memento of this
 milestone release. Pretty please? Size=small :)

 --
 Regards,
 Sithu Lloyd Dube

 --
 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/CAH-SnCB%2BVP%2BVpM3g4Uj4qP5sWfMv4%3DFvcuiNFvbYAErJknTnmw%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 http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAJxq84-mq6pnpX3WaSGrfBccE-hT1e7MY3xWRp_O62pkUpZGxw%40mail.gmail.com
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Regards,
>> Sithu Lloyd Dube
>>
>> --
>> 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/CAH-SnCDxqkEtBvUMxiKTp4%3DAhofb-1OBiNw65YccEQuCdd_Fow%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 

Re: The Django 1.7 tees!

2014-05-21 Thread Russell Keith-Magee
Hi Sithu,

Good news! It turns out you weren't the only person to have problems
placing an order, so we've re-opened the campaign for one last run to make
sure everyone who wants a shirt can get one. You can place your order here:

http://teespring.com/django17-v2

You have until the end of May.

Yours,
Russ Magee %-)



On Thu, May 1, 2014 at 7:03 PM, Sithembewena Lloyd Dube
wrote:

> Hi Russell,
>
> Thank you for the feedback. I'm hoping that others may show interest so
> that the campaign could be re-opened. I will be watching this closely :)
>
> Kind regards,
> Sithu
>
>
> On Thu, May 1, 2014 at 2:39 AM, Russell Keith-Magee <
> russ...@keith-magee.com> wrote:
>
>> Hi Sithu,
>>
>> Unfortunately, we can't add orders once the campaign is closed - this is
>> one of the features of TeeSpring as a fund raising method.
>>
>> We *can* relaunch the campaign, but that campaign would be independent to
>> the original. It would have its own sales target, its own closing date, and
>> so on.
>>
>> The lowest we can set the sales target is 20 shirts. I know there are
>> about 6 other orders out there from people who missed the deadline; if
>> there's any other interest out there (speak up in a reply if you're
>> interested), we might consider reopening the campaign for a week.
>>
>> Yours,
>> Russ Magee %-)
>>
>>
>> On Wed, Apr 30, 2014 at 11:58 PM, Sithembewena Lloyd Dube <
>> zebr...@gmail.com> wrote:
>>
>>> To Whom It May Concern,
>>>
>>> I am devastated that I could not place an order for one of the new
>>> Django 1.7 tees. Now that I am ready to go, the campaign has ended on the
>>> merchant website.
>>>
>>> May I please place an order for one? I'd dearly like a memento of this
>>> milestone release. Pretty please? Size=small :)
>>>
>>> --
>>> Regards,
>>> Sithu Lloyd Dube
>>>
>>> --
>>> 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/CAH-SnCB%2BVP%2BVpM3g4Uj4qP5sWfMv4%3DFvcuiNFvbYAErJknTnmw%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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJxq84-mq6pnpX3WaSGrfBccE-hT1e7MY3xWRp_O62pkUpZGxw%40mail.gmail.com
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Regards,
> Sithu Lloyd Dube
>
> --
> 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/CAH-SnCDxqkEtBvUMxiKTp4%3DAhofb-1OBiNw65YccEQuCdd_Fow%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq84-JH6ch%2BybtpTo15F7ZiOKNbokqJ3FGbKypaiW3Q%3DuceQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django export the CSV file of objects form databas

2014-05-21 Thread hito koto
Ok, thank you!

2014年5月21日水曜日 15時04分09秒 UTC+9 Erik Cederstrand:
>
> Den 21/05/2014 kl. 05.21 skrev hito koto : 
>
>
> > Hello, 
> > 
> > I have the following errors: why append is not done? 
> > 
> > row = [[0 for i in range(5)] for i in range(31)] 
>
> Here you are creating a list of lists of 0's (a 2-dimensional matrix of 
> ints). 
>
> > for a in obj_all.filter().values_list('user_id'): 
> > row[0][0].append(a) 
>
> Here, row[0][0] points to an int. You can't append to an int. Without 
> knowing what you want to achieve, either initialize your list of lists with 
> lists instead of 0's, or do "row[0][0] += a" instead. 
>
> > for b in obj_all.filter().values_list('contact_date'): 
> > row[0][1].append(b) 
> > for c in obj_all.filter().values_list('contact_time'): 
> > row[0][2].aapend(c) 
>
> Spelling error. 
>
> Erik

-- 
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/04ec63ce-d278-43da-ad78-f7d151defd61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django export the CSV file of objects form databas

2014-05-21 Thread Erik Cederstrand
Den 21/05/2014 kl. 05.21 skrev hito koto :

> Hello,
> 
> I have the following errors: why append is not done?
> 
> row = [[0 for i in range(5)] for i in range(31)]

Here you are creating a list of lists of 0's (a 2-dimensional matrix of ints).

> for a in obj_all.filter().values_list('user_id'):
> row[0][0].append(a)

Here, row[0][0] points to an int. You can't append to an int. Without knowing 
what you want to achieve, either initialize your list of lists with lists 
instead of 0's, or do "row[0][0] += a" instead.

> for b in obj_all.filter().values_list('contact_date'):
> row[0][1].append(b)
> for c in obj_all.filter().values_list('contact_time'):
> row[0][2].aapend(c)

Spelling error.

Erik

-- 
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/E9B38CD2-1D77-4D04-888C-2AE611EF0322%40cederstrand.dk.
For more options, visit https://groups.google.com/d/optout.