cx_Oracle - Django ORM - Reference Count Increase

2014-12-27 Thread Anurag Chourasia
All,

I have a Long Running Python Process that uses Django ORM against Oracle
database.

The size of the process keeps on increasing steadily.

I was profiling this process using mem_top and i find that the reference
count of one particular data type  increases continuously with
iterations.

Datatype is  [{u'time': u'0.004', u'sql': u'QUERY = u\'SELECT
"RANGE_STATUS"."I

References increased from 534 to 53295

This list seems to have almost all the queries that were executed using the
ORM

Does this mean that there is a memory leak in the cx_Oracle module or
somewhere in Django ORM?

Here is the memtop result between two iterations 10 minutes apart.

*WARNING : 27/12/2014 05:45:46 PM : *

> refs:
> 9500  {'TAPE_DRIVE_FORMAT': -1610612736, 'SLE_ERROR': 1,
> 'IMAGE_REL_I386_SEC
> 8410  [('200', '343045', 1321), ('200', '343046', 1322),
> ('200', '343047', 1
> 1578  {'logging.atexit': None, 'django.core.files.errno':
> None, 'django.test
> 1567  ['mem_top', 'mem_top', 'datetime', 'datetime', 'sys',
> 'string', 'os',
> 688  {'FILE_SYSTEM_ATTR': 2, 'GetDriveTypeW':  function GetDriveTy
> 688  {'FILE_SYSTEM_ATTR': 2, 'GetDiskFreeSpaceEx':  function GetDi
> 534  [{u'time': u'0.004', u'sql': u'QUERY = u\'SELECT
> "RANGE_STATUS"."I
> 510  {'GetDiskFreeSpaceEx':  GetDiskFreeSpaceEx>, 'SetThr
> 510  {'GetDiskFreeSpaceEx':  GetDiskFreeSpaceEx>, 'SetThr
> 370  [,
>  types:
> 8625 
> 3778 
> 3128 
> 1672 
> 1661 
> 1440 
> 1351 
> 1103 
> 888 
> 734 



*WARNING : 27/12/2014 05:54:37 PM : *

> refs:
> 53295  [{u'time': u'0.004', u'sql': u'QUERY = u\'SELECT
> "RANGE_STATUS"."I
> 9500  {'TAPE_DRIVE_FORMAT': -1610612736, 'SLE_ERROR': 1,
> 'IMAGE_REL_I386_SEC
> 8410  [('200', '343045', 1321), ('200', '343046', 1322),
> ('200', '343047', 1
> 1578  {'logging.atexit': None, 'django.core.files.errno':
> None, 'django.test
> 1567  ['mem_top', 'mem_top', 'datetime', 'datetime', 'sys',
> 'string', 'os',
> 749  ['A. HISTORY OF THE SOFTWARE',
> '==', '', 'Pyth
> 688  {'FILE_SYSTEM_ATTR': 2, 'GetDriveTypeW':  function GetDriveTy
> 688  {'FILE_SYSTEM_ATTR': 2, 'GetDiskFreeSpaceEx':  function GetDi
> 510  {'GetDiskFreeSpaceEx':  GetDiskFreeSpaceEx>, 'SetThr
> 510  {'GetDiskFreeSpaceEx':  GetDiskFreeSpaceEx>, 'SetThr
> types:
> 8625 
> 3778 
> 3130 
> 1675 
> 1661 
> 1440 
> 1351 
> 1103 
> 888 
> 734 


Please guide.

Regards,
Guddu

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


Re: Installing Django

2013-12-12 Thread Anurag Chourasia
It goes into Lib\site-packages folder.

Regards,
Anurag


On Thu, Dec 12, 2013 at 6:55 PM, Frederick Miller wrote:

> For Windows XP, should Django be installed under the Python27 folder?  Or
> should Django be on the root of the C: drive?
>
> Frederick Miller
>
> --
> 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/303094d2-2a45-4c56-bcf8-4884e97be365%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CANFgmFAcUFTx_B8mzrz1SCwoEtbMBkHC0VrGhVndXF7R-KAnEw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Need Advise on the best way to track how much time a user is logged in.....

2013-08-22 Thread Anurag Chourasia
So they will present the RFID Tag to the reader at the time of login
.and logout also? You could do this directly in Python thenCapture
the logout read (same way as login) and use the datetime module to generate
the current time and save it in the Database.

Just trying to understand what is the Django bit here?

Regards,
Anurag



On Thu, Aug 22, 2013 at 3:09 PM, <7equivale...@gmail.com> wrote:

> My users will not be able to logout by closing a browser because they have
> no such interaction with the system. They will be passing an RFID tag over
> a reader to unlock the door and clock in and a python script will handle
> the loging in and out. So if I can get the logout to time stamp a database
> entry I'll be good.
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: postgresql

2013-05-20 Thread Anurag Chourasia
Read this for a starter

http://www.postgresql.org/docs/9.2/interactive/index.html

Regards,
Guddu

On Mon, May 20, 2013 at 3:35 PM, Kakar Arunachal Service <
kakararunachalserv...@gmail.com> wrote:

> hi guyz!
> I'm new to django and python, and very new to postgresql. Can u suggest
> any books or tutorial for postgresql???
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django-auth-ldap

2013-05-15 Thread Anurag Chourasia
Glad that it worked

On Wed, May 15, 2013 at 11:52 AM, Cody Scott wrote:

> The problem was that the LDAPSearch had to start with a OU= I had it start
> with a DC=.
>
>
> On Wednesday, 15 May 2013 11:27:08 UTC-4, Cody Scott wrote:
>>
>> I have that code but where does the logging go?
>>
>> On Wednesday, 15 May 2013 11:04:33 UTC-4, Guddu wrote:
>>>
>>> Ok. Now try to get django-ldap-auth working. See if you can enable the
>>> logging handler and grab some more information.
>>>
>>> http://pythonhosted.org/**django-auth-ldap/logging.html
>>>
>>> Regards
>>> Guddu
>>>
>>> On Wed, May 15, 2013 at 10:56 AM, Cody Scott wrote:
>>>
 Ok The problem was that I had the file named ldap.py. I got it to work,
 I had to add a print to

 l.result(result)

 put I get

 a tuple of a number and an empty list

 (#, [])

  --
 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?hl=en
 .
 For more options, visit 
 https://groups.google.com/**groups/opt_out
 .



>>>
>>>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django-auth-ldap

2013-05-15 Thread Anurag Chourasia
Its just basic python logging

http://docs.python.org/2/library/logging.html

Look at logging to a file

http://docs.python.org/2/howto/logging.html#logging-advanced-tutorial

Regards,
Guddu

On Wed, May 15, 2013 at 11:27 AM, Cody Scott wrote:

> I have that code but where does the logging go?
>
>
> On Wednesday, 15 May 2013 11:04:33 UTC-4, Guddu wrote:
>
>> Ok. Now try to get django-ldap-auth working. See if you can enable the
>> logging handler and grab some more information.
>>
>> http://pythonhosted.org/**django-auth-ldap/logging.html
>>
>> Regards
>> Guddu
>>
>> On Wed, May 15, 2013 at 10:56 AM, Cody Scott wrote:
>>
>>> Ok The problem was that I had the file named ldap.py. I got it to work,
>>> I had to add a print to
>>>
>>> l.result(result)
>>>
>>> put I get
>>>
>>> a tuple of a number and an empty list
>>>
>>> (#, [])
>>>
>>>  --
>>> 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?hl=en
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django-auth-ldap

2013-05-15 Thread Anurag Chourasia
Ok. Now try to get django-ldap-auth working. See if you can enable the
logging handler and grab some more information.

http://pythonhosted.org/django-auth-ldap/logging.html

Regards
Guddu

On Wed, May 15, 2013 at 10:56 AM, Cody Scott wrote:

> Ok The problem was that I had the file named ldap.py. I got it to work, I
> had to add a print to
>
> l.result(result)
>
> put I get
>
> a tuple of a number and an empty list
>
> (#, [])
>
>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django-auth-ldap

2013-05-15 Thread Anurag Chourasia
Hi Cody

In the link that you sent i see that initialize is a valid attribute.

Also did you name your python file as ldap.py? If yes then that's the
problem i guess. Please rename it to something else and see what it gives
you.

Could you run these in a Python interpreter and tell me what does this show
you?

import ldap
print ldap.__file__

We should try to get this working first before moving to django-auth-ldap

Regards
Guddu

On Wed, May 15, 2013 at 10:17 AM, Cody Scott wrote:

> http://dpaste.org/EboQU/
>
> On Wednesday, 15 May 2013 10:09:01 UTC-4, Guddu wrote:
>
>> What does this give you?
>>
>> import ldap
>> dir(ldap)
>>
>> Regards
>> Guddu
>>
>> On Wed, May 15, 2013 at 10:04 AM, Cody Scott wrote:
>>
>>> I put that code in a separate python file and ran it without django or
>>> django-auth-ldap.
>>>
>>> l = ldap.initialize()
>>> AttributeError: 'module' object has no attribute 'initialize'
>>>
>>> so python-ldap is not installed properly?
>>>
>>> I am not able to login, no error just invalid credentials.
>>>
>>> How do I get logs from ldap? I don't have a login view I am using
>>> django's
>>>
>>> On Tuesday, 14 May 2013 17:01:44 UTC-4, Guddu wrote:


  --
>>> 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?hl=en
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django-auth-ldap

2013-05-15 Thread Anurag Chourasia
What does this give you?

import ldap
dir(ldap)

Regards
Guddu

On Wed, May 15, 2013 at 10:04 AM, Cody Scott wrote:

> I put that code in a separate python file and ran it without django or
> django-auth-ldap.
>
> l = ldap.initialize()
> AttributeError: 'module' object has no attribute 'initialize'
>
> so python-ldap is not installed properly?
>
> I am not able to login, no error just invalid credentials.
>
> How do I get logs from ldap? I don't have a login view I am using django's
>
> On Tuesday, 14 May 2013 17:01:44 UTC-4, Guddu wrote:
>>
>>
>>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django-auth-ldap

2013-05-14 Thread Anurag Chourasia
Setting up of groups is not a requirement. In my case I am searching for
group membership just to grant/deny access based on Group membership also.
I sent my settings to you just to show you how I was using sAMAccountName
for user search.

So what exactly is not working in your case? You are not able to login? Do
you have any logs to share?

Can you try a small snippet like this (replacing the variables) to see if
bind works at all?

import ldap
l=ldap.initialize('ldap://:')
who=
cred=
result=l.bind(who,cred)
l.result(result)

Regards,
Guddu

On Tue, May 14, 2013 at 3:53 PM, Cody Scott wrote:

> Do I need to set up groups? I have a setting for
>
> AUTH_LDAP_SERVER_URI
> AUTH_LDAP_BIND_DN
> AUTH_LDAP_BIND_PASSWORD
> AUTH_LDAP_USER_SEARCH
>
> AUTH_LDAP_USER_ATTR_MAP = {
> "username": "sAMAccountName",
> "email": "mail"
> }
>
> I am using a custom auth model. Maybe that is the reason it is not working?
>
> from django.db import modelsfrom django.contrib.auth.models import 
> AbstractBaseUser, PermissionsMixin, BaseUserManagerfrom django.conf import 
> settingsfrom django.utils.translation import ugettext_lazy as _
> class MyUserManager(BaseUserManager):
> def create_user(self, username, email, name, company, password=None):
> if not email:
> raise ValueError('User must have an email address')
> if not username:
> raise ValueError('User must have a username')
>
> user = self.model(
> email=MyUserManager.normalize_email(email),
> )
> user.username = username
> user.set_password(password)
> user.name = name
> user.company = company
> user.save(using=self._db)
> return user
>
> def create_superuser(self, username, email, name, company, password):
> user = self.create_user(username,
> email,
> name,
> company,
> password=password
> )
> user.is_admin = True
> user.is_manager = True
> user.is_superuser = True
> user.save(using=self._db)
> return user
> class Users(AbstractBaseUser,PermissionsMixin):
> email   = models.EmailField(verbose_name=_('email address'), 
> max_length=255,unique=True,db_index=True,)
> username= models.CharField(verbose_name=_('Username'), 
> max_length=50,blank=True,unique=True)
> name= models.CharField(verbose_name=_('Name'), 
> max_length=50,blank=True)
> company = models.CharField(verbose_name=_('Company'), 
> max_length=255,blank=True)
> is_manager  = models.BooleanField(default=False)
> is_active   = models.BooleanField(default=True)
> is_admin= models.BooleanField(default=False)
> is_customer = models.BooleanField(default=False)
> datecreated = models.DateField(auto_now=True)
>
> objects = MyUserManager()
> USERNAME_FIELD  = 'username'
> REQUIRED_FIELDS = ['name', 'company', 'email']
>
> class Meta:
> verbose_name_plural = "Users"
>
> def get_full_name(self):
> return self.email
>
> def get_short_name(self):
> return self.email
>
> def __unicode__(self):
> return self.email
>
> def get_attempts_list(self, quiz):
> attempts = []
> for attempt in self.attempts.all():
> if attempt.quiz == quiz:
> attempts.append(attempt)
> return attempts
>
> @property
> def is_staff(self):
> return self.is_admin
>
>
>
>
>  --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django-auth-ldap

2013-05-14 Thread Anurag Chourasia
Hi Cody,

I am also using a Search Bind in a similar situation as yours You could
easily use the samaccountName for User Search.

Here is what I have in settings.py to give you a clearer picture.

AUTH_LDAP_USER_SEARCH = LDAPSearchUnion(
> LDAPSearch("OU=Users,
> OU=Central,OU=IDD,DC=client,DC=corp",ldap.SCOPE_SUBTREE,
> "(sAMAccountName=%(user)s)"),
>
> LDAPSearch("OU=Users,OU=Renca_CD,OU=Locales,OU=IDD,DC=client,DC=corp",ldap.SCOPE_SUBTREE,
> "(sAMAccountName=%(user)s)"),
> )


And yes, the user in %(user)s comes from the login form.

Regards,
Guddu

On Tue, May 14, 2013 at 2:52 PM, Cody Scott wrote:

> I am trying to get django-auth-ldap working with an Active Directory LDAP
> Server.
>
> I don't understand the documentation for the Search/Bind or Direct Bind.
>
> Is 'uid' the LDAP attribute uid? My LDAP doesn't use this attribute.
>
> I tried putting 'samaccountName' an attribute that is used for logon.
>
> Where does the 'user' come from? Is that the username field from the login
> form?
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Custom view on the home page based on groups assigned to user.

2013-04-12 Thread Anurag Chourasia
Within the templates, you can show different HTML elements based on the
user attributes/group. Traditional IF checks.

Regards,
Guddu

On Fri, Apr 12, 2013 at 4:59 PM, Enator24  wrote:

> Hi I need to develop an application where I have three groups first the
> creator, second the reviewer, 3rd the Approver.
>
> I want that once the creator creates and submits the form for save, and
> reviewer logs in at his end he should be able to view all the information
> submieted and marked un-reviewed. it should be the same in case of
> approver.
>
> I want to use default django login , just want to customize the home ppage
> that user would be able to see based on his group.
>
> Please advise , it is something like workflow app. I am stuck at this
> point only.
>
> I have already looked into "request.user " approch but scene is different
> here. i just want the custom home page based on group.
>
> Thanks ,
> Enator
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django / django cms + responsive

2013-03-14 Thread Anurag Chourasia
Look at

1. Twitter Bootstrap. http://twitter.github.com/bootstrap/

2. Foundation Zurb. http://foundation.zurb.com/

Regards,
Anurag
On Mar 14, 2013 7:03 AM, "Frank Bieniek" 
wrote:

> Hi Guys,
> what are your preferred apps to turn django or django cms into a
> responsive website?
>
> What are your recipes?
>
> Thanks
> Frank
>
> --
> 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+unsubscribe@**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?hl=en
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out
> .
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: WebService WSDL

2012-06-28 Thread Anurag Chourasia
Try using gSOAP if that fits your needs.

http://www.cs.fsu.edu/~engelen/soap.html

Regards,
Guddu

On Thu, Jun 28, 2012 at 2:47 PM, Rene  wrote:

> Pessoal,
>
> Preciso montar um webservice que gere um wsdl, mas não achei algo que
> fosse mais direto na web, alguém tem um caminho para indicar.
>
> Abraço
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/LhrQCVZO12EJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Apache does not display a flash file

2012-05-10 Thread Anurag Chourasia
Could you have a look at the Error Logs as shown on the Tools --> Web
Developer --> Web Console in Firefox if u have something in there?

On Thu, May 10, 2012 at 7:43 AM, atul khairnar wrote:

> When right-clicked at the location where flash should have rendered,
> it gives error message, "Movie Not Loaded"
>
> On May 10, 10:32 am, atul khairnar  wrote:
> > Hi,
> > Recently I deployed my django project on Apache using mod_wsgi.
> > Everything is working perfect except flash. The flash (.swf file) did
> > not render on the client's browser but it works perfect while hosting
> > on django built-in development server. What may be the problem?
> >
> > I am using
> >
> > Ubuntu  : 11.04
> > Apache2  :  Apache/2.2.17
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django making box

2012-03-13 Thread Anurag Chourasia
What Javier meant in his previous message was a client application
.which of course could be a browser running on your own computer.

For a better understanding of client/server model you could review the
Wikipedia page

http://en.wikipedia.org/wiki/Client%E2%80%93server_model

Regards,
Guddu

On Tue, Mar 13, 2012 at 5:34 PM, Sophia  wrote:

> Thanks for the help, actually it should be run just on my computer not the
> client.
>
> On Tuesday, March 13, 2012 1:54:00 PM UTC-7, Javier Guerra wrote:
>>
>> On Tue, Mar 13, 2012 at 3:37 PM, Sophia  wrote:
>> > Thanks all for helping, as I told I read that tutorial, but my
>> supervisor
>> > said that I should do that with Django. He didn't mention about learning
>> > JavaScript, but is it impossible just with Django?
>>
>> django runs on the server.  if you want to do some client processing
>> you need code running on the client, typically Javascript.
>>
>> of course that code is served from a Django app, and modifying a
>> django-handled page and form, so the project in a whole is still 'done
>> with Django'.
>>
>> --
>> Javier
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/IRJ8PvQXRdEJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dropdown select box in django

2012-02-20 Thread Anurag Chourasia
This is weird

I simply copy pasted your code in my environment and it shows me a Drop
Down.

Could you save the models file again and close your browser (or even try
clearing cache) and restart your apache/django dev server whatever may be
the case and try again?

Regards,
Anurag

On Mon, Feb 20, 2012 at 9:32 PM, larry.mart...@gmail.com <
larry.mart...@gmail.com> wrote:

> I'm fairly new to django, still getting my feet wet. I want to have a
> dropdown menu (django seems to call this a select box). I read this:
>
>
> https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.choices
>
> So I did this:
>
> class EventsTable(models.Model):
>EVENT_TYPE_CHOICES = (
>('Event Created', 'EventCreated'),
>('Event Changed', 'EventChanged'),
>)
>
>message = models.CharField("Event Type", max_length=12,
> choices=EVENT_TYPE_CHOICES)
>
>
> But I get a standard text entry field where I can type in anything.
>
> I did more googling, and I read a lot of confusing stuff about having
> to use javascrpt, ajax, CSS, etc. I read some pages about using a
> ChoiceField, but that is not part of the model class (it's in the
> forms class). I'm not sure how that would be used with a class that
> inherits form models.
>
> What am I missing here? I can't imagine something as common as this
> would be hard in django. Shouldn't the first thing I did work?
>
> TIA!
> -larry
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: mod_Wsgi Problem

2012-01-04 Thread Anurag Chourasia
You will need to allow apache access to the folder where you have your wsgi
script.

Please add this in your httpd.conf and restart apache and see if it helps.


Order deny,allow
Allow from all


Regards,
Anurag

On Wed, Jan 4, 2012 at 6:52 PM, Hassan  wrote:

> i tryed
>
> WSGIScriptAlias /mysite1 "C:/mysite/django.wsgi"
> and then http://localhost:8080/mysite1
> but i keep geting this :
>
>
>
> Forbidden
>
> You don't have permission to access /mysite1 on this server.
>
> what is this , how can i fix it :
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: mod_Wsgi Problem

2012-01-04 Thread Anurag Chourasia
Could you try changing your  WSGIScriptAlias in httpd.conf

From
WSGIScriptAlias / "C:/mysite/django.wsgi"

To
WSGIScriptAlias /MYSITE "C:/mysite/django.wsgi"

And then access http:localhost:port/MYSITE and tell is the results.

Regards,
Anurag
On Jan 4, 2012 7:19 AM, "Hassan"  wrote:

> Dear ALL,
>
> i have my application in "C:/mysite"
> and i created a wsgi file in "C:/mysite" , that has  :
>
> import os
> import sys
> path = 'C:/mysite'
> if path not in sys.path:
>sys.path.append(path)
> os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
> and i added this to httpd.conf :
> WSGIScriptAlias / "C:/mysite/django.wsgi"
>
> then i restarted my apache and open the local host and got nothing it
> gives me the apache defualt page 
>
> what  to do , help me please !!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Possible interest in a webcast/presentation about Django site with 40mil+ rows of data??

2011-06-22 Thread Anurag Chourasia
I am in :-)

On Wed, Jun 22, 2011 at 11:39 AM, Ivan Aleman  wrote:

>
>
> On 22 June 2011 08:15, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>>
>> If you're interested, please reply on-list so others can see.
>>
>>
>>
> Sweet! Count me in :)
>
>
>>
>>
> --
> Iván
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to fix a column typo in django

2011-04-18 Thread Anurag Chourasia
Yes. That should be doable.

If you are on Oracle, you could manually change the Column Name using
the following Syntax (If you are on a different Database than Oracle
then the Syntax might differ but still doable).

ALTER TABLE  RENAME COLUMN  TO 

And later you could change the models.py manually to reflect the New
Column Name.

Regards,
Anurag

On Mon, Apr 18, 2011 at 7:41 PM, Kann Vearasilp <vearas...@gmail.com> wrote:
> Hi Anurag,
>
> That was one of my idea, but what if the table has already been populated
> and I don't want to lose the data in the table?
>
> Can I just change the column name manually using SQL and modify the
> models.py afterwards?
>
> Kann
>
> On Mon, Apr 18, 2011 at 4:06 PM, Anurag Chourasia
> <anurag.choura...@gmail.com> wrote:
>>
>> Hi Kann,
>>
>> Does Dropping the Table and Recreating using SyncDB work well in your
>> setup?
>>
>> Regards,
>> Anurag
>>
>> On Mon, Apr 18, 2011 at 7:30 PM, Kann <vearas...@gmail.com> wrote:
>> > Dear all,
>> >
>> > I am new to django and have question about fixing the typo i made in
>> > the models.py. For example, I created tables with typo in the column
>> > name. So, I didn't realized the mistake and run the 'python manage.py
>> > syncdb' which created the tables with the incorrect names. Later I
>> > realized the typos and made changes in the "models.py" file and run
>> > the "python manage.py syncdb" again, but it didn't fix the typo in my
>> > column names.
>> >
>> > How do i fix the mistakes in the column names after the 'syncdb' is
>> > already run?
>> >
>> > Best,
>> >
>> > Kann
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>> >
>> >
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to fix a column typo in django

2011-04-18 Thread Anurag Chourasia
Hi Kann,

Does Dropping the Table and Recreating using SyncDB work well in your setup?

Regards,
Anurag

On Mon, Apr 18, 2011 at 7:30 PM, Kann  wrote:
> Dear all,
>
> I am new to django and have question about fixing the typo i made in
> the models.py. For example, I created tables with typo in the column
> name. So, I didn't realized the mistake and run the 'python manage.py
> syncdb' which created the tables with the incorrect names. Later I
> realized the typos and made changes in the "models.py" file and run
> the "python manage.py syncdb" again, but it didn't fix the typo in my
> column names.
>
> How do i fix the mistakes in the column names after the 'syncdb' is
> already run?
>
> Best,
>
> Kann
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Not Printing stmt in for loop

2011-03-17 Thread Anurag Chourasia
This is a Python Question (not Django)

How are you populating cr? Did you check if there are any rows at all
before looping over the rows?

Regards,
Anurag

On Fri, Mar 18, 2011 at 12:07 AM, NavaTux  wrote:
> Here I ahd a piece of code to execute my custom python function
>
> just i executed via python shell ,so i used print statement to know some
> values but it does't respond anything
> May i know the reason please?
> this is the code which i executed successfully
> ">>> for i in cr:
> ... tic, mktprice,exp_date, e, ep, c, cp = i
> ... expd = datetime.strptime(exp_date, "%Y-%m-%d %H:%M:%S")
> ... cd = datetime.combine(datetime.now().date(),
> datetime.time(datetime(12,12,12,0,0,0,0))) - timedelta(days=8)
> ... datediff = expd - cd
> ... current_date = cd.strftime("%Y-%m-%d")
> ... days_to_expiry = datediff.days
> ... mktprice, e, ep, c, cp = float(mktprice), float(e), float(ep), float(c),
> float(cp), float(s), float(sp)
> ... print days_to_expiry
> ... print mktprice
> ...

>
> cr is the data that red from csv file.So i is the row from a csv file
> why it doesn't print anything?
> it is just a simple python part
> "
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: parsing SOAP request

2011-01-27 Thread Anurag Chourasia
Could you try with this

elif request.method == 'POST':
print request.raw_post_data
response = HttpResponse(mimetype='text/xml')
response.write(request.raw_post_data)
return response

Regards,
Anurag

On Thu, Jan 27, 2011 at 1:07 PM, sami nathan  wrote:
> Hi
>     Now i tried to parse the incoming request and send my response i tried
> in the following way by  just sending what request came as it as response
> (ECHO server).and i am very newbie i dont know how to parse the request. I
> used ZSI sucessfully but in that requset was handled by itself but ZSI
> application is not accepting in django
> 
> My view looks like this :
> def recive_ShortMessage(request):
>     if request.method == 'GET':
>    ref= "Process  in progress"
>    return HttpResponse(ref)
>     elif request.method == 'POST':
>     print request.POST.QueryDict
>     return HttpResponse (request.POST)
>
> But the error is
> org.apache.axis2.AxisFault:  in xml declaration
>  at [row,col {unknown-source}]: [1,13]
>
> (I am using java client)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Email

2011-01-21 Thread Anurag Chourasia
Googling for django-mailer gets me to this page

http://code.google.com/p/django-mailer/

Regards,
Anurag

On Fri, Jan 21, 2011 at 8:58 PM, hank23  wrote:

> OK what exactly is django-mailer?
>
> On Jan 19, 4:32 pm, Eduardo Cereto Carvalho 
> wrote:
> > django-mailer[1] is a nice application to have around if you're planning
> to
> > send too much emails. It queues messages and retry failled attempts.
> >
> > [1]
> >
> >
> >
> >
> >
> > On Wed, Jan 19, 2011 at 8:09 PM, Shawn Milochik 
> wrote:
> > > Whatever method you decide to use to gather the e-mail addresses is up
> to
> > > you, and depends on your needs.
> >
> > > The send_mail function accepts a list of recipients, and it doesn't
> really
> > > matter how you get them.
> >
> > > Two notes on sending e-mail, though:
> >
> > > 1. Ensure that you're sending the e-mail multiple times (once to each
> > > person) to ensure privacy. Unless, for some reason, it's fine that all
> > > recipients get the e-mail addresses of the others.
> >
> > > 2. SMTP communications are expensive, so you may want to go deeper than
> the
> > > send_mail function so you can create an SMTP connection and send
> multiple
> > > messages then include it. Otherwise you'll create a new SMTP connection
> for
> > > each message, which will take longer. Unless that's what you want.
> >
> > > Shawn
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com
> 
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
> >
> > --
> > Eduardo Cereto Carvalho- Hide quoted text -
> >
> > - Show quoted text -
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Beginner question about Postgresql

2011-01-14 Thread Anurag Chourasia
If you have installed psycopg2 then are you able to load psycopg2 from the
Python Command Prompt? Try this below and see if import works from command
line...

$ python
Python 2.5.2 (r252:60911, Dec  2 2008, 09:26:14)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>>

Regards,
Anurag

On Sat, Jan 15, 2011 at 10:37 AM, Django  wrote:

> I am using Python27, Django and wanted to us Postgresql, but I am
> having problems.
>
> When I start a new project and run syncdb for the first time I get an
> error.
>
> \postgresql_psycopg2\base.py line24."Improperly
> Configured: Error loading psycopg2 module: no medule named psycopg2"
>
> I have loaded psycopg2 so I am lost.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Just saying hi

2010-12-19 Thread Anurag Chourasia
Welcome to the community Dave.

Season's greetings to you too and everyone.

Regards
Anurag

On Sun, Dec 19, 2010 at 5:46 PM, Dave Sayer  wrote:

> Seasons Greetings,
>
> I joined the list yesterday and just wanted to say "Hi" and introduce
> myself.
>
> I'm a frontend dev who was looking for a framework to learn to enhance my
> backend skills and django seemed to fit nicely. I'm really glad I did. I
> seem to be picking it up quite well, although  it's been a pretty steep
> learning curve but I seem to be getting there.
>
> Anyway, hello and I look forward to being part of the community.
>
> Cheers,
>
> Dave
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Anurag Chourasia
Hi Armando,

To specify the Postgre password, you should set the environment variable
pointing to the pgpass file .. basically add this line to your wsgi
script (replacing with the actual location of your pgpass file of course)

*os.environ['PGPASSFILE']='/home/ap2/.pgpass'*

Let me know if it works.

Regards,
Anurag

On Sat, Dec 18, 2010 at 3:20 AM, armandoperico <armandoper...@hotmail.com>wrote:

> sorry,
> how should do to specify the password on the wsgi file ?
> this would be the best i have so far.
>
> thanks
>
>
> On Dec 17, 10:17 pm, Anurag Chourasia <anurag.choura...@gmail.com>
> wrote:
> > And did you had to provide a password for establishing that connection?
> Or
> > the .pgpass file took care of it?
> >
> > If you had to provide a password then probably that's your clue. You
> might
> > be required to specify the pgpass in mod wsgi script.
> >
> > On Sat, Dec 18, 2010 at 2:45 AM, armandoperico <
> armandoper...@hotmail.com>wrote:
> >
> >
> >
> >
> >
> >
> >
> > > yes.
> >
> > > On Dec 17, 10:04 pm, Anurag Chourasia <anurag.choura...@gmail.com>
> > > wrote:
> > > >  On this server, are you able to connect to the PostGre database
> using
> > > the
> > > > command line?
> >
> > > > psql -U myuser -h 127.0.0.1 -p 5432 -d dbname
> >
> > > > Regards,
> > > > Anurag
> >
> > > > On Sat, Dec 18, 2010 at 2:19 AM, armandoperico <
> > > armandoper...@hotmail.com>wrote:
> >
> > > > > on settings.py..
> >
> > > > > DATABASES = {
> > > > >'default': {
> > > > >'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> > > > > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or
> 'oracle'.
> > > > >'NAME': 'dbname',  # Or path to database
> > > > > file if using sqlite3.
> > > > >'USER': 'myuser',  # Not used with
> > > > > sqlite3.
> > > > >'PASSWORD': 'mypass',  # Not used with
> > > > > sqlite3.
> > > > >'HOST': '127.0.0.1',  # Set to empty
> > > > > string for localhost. Not used with sqlite3.
> > > > >'PORT': '5432',  # Set to empty string
> for
> > > > > default. Not used with sqlite3.
> > > > > }
> > > > > }
> >
> > > > > On Dec 17, 9:25 pm, Christophe Pettus <x...@thebuild.com> wrote:
> > > > > > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
> >
> > > > > > > On my local machine everything is running fine, but when i try
> to
> > > > > > > deploy to a running server with apache (mod_wsgi), i'm getting
> the
> > > > > > > following error (database related):
> >
> > > > > > > Caught OperationalError while rendering: could not connect to
> > > server:
> > > > > > > Permission denied
> > > > > > >Is the server running on host "127.0.0.1" and accepting
> > > > > > >TCP/IP connections on port 5432?
> >
> > > > > > What's your database configuration on the Apache machine?
> >
> > > > > > --
> > > > > > -- Christophe Pettus
> > > > > >x...@thebuild.com
> >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "Django users" group.
> > > > > To post to this group, send email to django-users@googlegroups.com
> .
> > > > > To unsubscribe from this group, send email to
> > > > > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> <django-users%2bunsubscr...@google groups.com>
> > > <django-users%2bunsubscr...@google groups.com>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/django-users?hl=en.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-us...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> <django-users%2bunsubscr...@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Anurag Chourasia
And did you had to provide a password for establishing that connection? Or
the .pgpass file took care of it?

If you had to provide a password then probably that's your clue. You might
be required to specify the pgpass in mod wsgi script.

On Sat, Dec 18, 2010 at 2:45 AM, armandoperico <armandoper...@hotmail.com>wrote:

> yes.
>
> On Dec 17, 10:04 pm, Anurag Chourasia <anurag.choura...@gmail.com>
> wrote:
> >  On this server, are you able to connect to the PostGre database using
> the
> > command line?
> >
> > psql -U myuser -h 127.0.0.1 -p 5432 -d dbname
> >
> > Regards,
> > Anurag
> >
> > On Sat, Dec 18, 2010 at 2:19 AM, armandoperico <
> armandoper...@hotmail.com>wrote:
> >
> >
> >
> >
> >
> >
> >
> > > on settings.py..
> >
> > > DATABASES = {
> > >'default': {
> > >'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> > > 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
> > >'NAME': 'dbname',  # Or path to database
> > > file if using sqlite3.
> > >'USER': 'myuser',  # Not used with
> > > sqlite3.
> > >'PASSWORD': 'mypass',  # Not used with
> > > sqlite3.
> > >'HOST': '127.0.0.1',  # Set to empty
> > > string for localhost. Not used with sqlite3.
> > >'PORT': '5432',  # Set to empty string for
> > > default. Not used with sqlite3.
> > > }
> > > }
> >
> > > On Dec 17, 9:25 pm, Christophe Pettus <x...@thebuild.com> wrote:
> > > > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
> >
> > > > > On my local machine everything is running fine, but when i try to
> > > > > deploy to a running server with apache (mod_wsgi), i'm getting the
> > > > > following error (database related):
> >
> > > > > Caught OperationalError while rendering: could not connect to
> server:
> > > > > Permission denied
> > > > >Is the server running on host "127.0.0.1" and accepting
> > > > >TCP/IP connections on port 5432?
> >
> > > > What's your database configuration on the Apache machine?
> >
> > > > --
> > > > -- Christophe Pettus
> > > >x...@thebuild.com
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-us...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> <django-users%2bunsubscr...@google groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Anurag Chourasia
 On this server, are you able to connect to the PostGre database using the
command line?

psql -U myuser -h 127.0.0.1 -p 5432 -d dbname

Regards,
Anurag

On Sat, Dec 18, 2010 at 2:19 AM, armandoperico wrote:

> on settings.py..
>
> DATABASES = {
>'default': {
>'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
>'NAME': 'dbname',  # Or path to database
> file if using sqlite3.
>'USER': 'myuser',  # Not used with
> sqlite3.
>'PASSWORD': 'mypass',  # Not used with
> sqlite3.
>'HOST': '127.0.0.1',  # Set to empty
> string for localhost. Not used with sqlite3.
>'PORT': '5432',  # Set to empty string for
> default. Not used with sqlite3.
> }
> }
>
> On Dec 17, 9:25 pm, Christophe Pettus  wrote:
> > On Dec 17, 2010, at 12:02 PM, armandoperico wrote:
> >
> > > On my local machine everything is running fine, but when i try to
> > > deploy to a running server with apache (mod_wsgi), i'm getting the
> > > following error (database related):
> >
> > > Caught OperationalError while rendering: could not connect to server:
> > > Permission denied
> > >Is the server running on host "127.0.0.1" and accepting
> > >TCP/IP connections on port 5432?
> >
> > What's your database configuration on the Apache machine?
> >
> > --
> > -- Christophe Pettus
> >x...@thebuild.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django vs Postgres Connection

2010-12-17 Thread Anurag Chourasia
You might want to check your wsgi script.

Looks like the environment variables that you have in there are wrong and
not allowing the import of settings.py

Regards,
Anurag

On Sat, Dec 18, 2010 at 1:32 AM, armandoperico wrote:

> Hi,
> this is the first time i try to deploy a django project and i'm not
> being able to solve a problem.
>
> On my local machine everything is running fine, but when i try to
> deploy to a running server with apache (mod_wsgi), i'm getting the
> following error (database related):
>
> Caught OperationalError while rendering: could not connect to server:
> Permission denied
>Is the server running on host "127.0.0.1" and accepting
>TCP/IP connections on port 5432?
>
> The fact is that when i try to connect to the database using psql -
> U... is working fine, so postgree is working ok, it seems to be with
> django :S
>
> Exception Location: /usr/lib/python2.6/site-packages/django/db/
> backends/postgresql_psycopg2/base.py in _cursor, line 136
>
> this is my django version (just in case): 1.2.3
>
> Anyone here has faced this problem ?
> have any ideas?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Initial Create Table Script

2010-12-03 Thread Anurag Chourasia
Yes there is.

You need to use

*./manage.py sql auth*

instead of

*./manage.py sql django.contrib.auth*

Regards,
Anurag

On Fri, Dec 3, 2010 at 5:48 PM, Tim Sawyer wrote:

> Is there a way to generate a sql script that gets the entire table
> structure required for a django project?  Including contrib.auth etc.
>
> ./manage.py sql django.contrib.auth is giving me:
>
> Error: App with label django.contrib.auth could not be found. Are you sure
> your INSTALLED_APPS setting is correct?
>
> INSTALLED_APPS = (
>'django.contrib.auth',
> ...
> )
>
> I don't have direct access to the database that I'm running against on a
> customer site - therefore I need a script to create the database.
>
> Thanks,
>
> Tim.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-02 Thread Anurag Chourasia
Hi Ian,

Can't tell you how much this helps :-)

Setting the variable using ctypes before the import of cx_Oracle does the
trick for me.

Appreciate the time you spent in helping resolve this.

Is there any Cygwin specific doc where we could include this?

Regards,
Anurag

On Fri, Dec 3, 2010 at 6:10 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote:

> On Thu, Dec 2, 2010 at 5:34 PM, Anurag Chourasia
> <anurag.choura...@gmail.com> wrote:
> > Hi Ian,
> > I just tried the ctypes solution that you mentioned in your previous
> email
> > but it does not work for me.
>
> In your transcript, it appears that Django has already been loaded
> when you call the ctypes code.  The environment variable needs to be
> set *before* cx_Oracle is imported by Django, or it won't have any
> effect.  This is why I suggested patching it into the
> django/db/backends/oracle/base.py file.
>
> Cheers,
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-02 Thread Anurag Chourasia
Hi Ian,

I just tried the ctypes solution that you mentioned in your previous email
but it does not work for me.

Below is my session transcripts.

>>> import ctypes
*>>> ctypes.CDLL('kernel32').SetEnvironmentVariableA('NLS_LANG', '.UTF8')*
*1*
>>> TerminologyMap.objects.get(term_id=8)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.5/site-packages/django/db/models/manager.py", line
132, in get
return self.get_query_set().get(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line
336, in get
num = len(clone)
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line
81, in __len__
self._result_cache = list(self.iterator())
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line
269, in iterator
for row in compiler.results_iter():
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/compiler.py",
line 672, in results_iter
for rows in self.execute_sql(MULTI):
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/compiler.py",
line 741, in 
result = iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
  File "/usr/lib/python2.5/site-packages/django/db/backends/oracle/base.py",
line 552, in fetchmany
for r in self.cursor.fetchmany(size)])
  File "/usr/lib/python2.5/site-packages/django/db/backends/oracle/base.py",
line 625, in _rowfactory
value = to_unicode(value)
  File "/usr/lib/python2.5/site-packages/django/db/backends/oracle/base.py",
line 636, in to_unicode
return force_unicode(s)
  File "/usr/lib/python2.5/site-packages/django/utils/encoding.py", line 88,
in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
django.utils.encoding.DjangoUnicodeDecodeError: 'utf8' codec can't decode
bytes in position 22-24: invalid
 data. You passed in 'Registro guardado con \xe9xito' ()

Regards,
Anurag

On Fri, Dec 3, 2010 at 4:47 AM, Ian Kelly  wrote:

> On Thu, Dec 2, 2010 at 3:23 PM, Ian Kelly  wrote:
> > Weird.  From what I can tell, this seems to have something to do with
> > Cygwin, or at least I'm able to replicate it in that environment.
> > Setting NLS_LANG in or out of process and changing the registry key
> > all have no effect.
>
> The actual problem is described here:
>
> http://rubyforge.org/forum/forum.php?thread_id=6826_id=1078
>
> and from the cx-oracle-users mailing list comes this suggestion:
>
> >>> import ctypes
> >>> ctypes.CDLL('kernel32').SetEnvironmentVariableA('NLS_LANG', '.UTF8')
>
> I've tried it, and it works.  I suggest patching the above into your
> django/db/backends/oracle/base.py file, in place of the line:
>
> os.environ['NLS_LANG'] = '.UTF8'
>
> Cheers,
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-02 Thread Anurag Chourasia
Hi Ian,

Here is the information requested by you.

$ python
Python 2.5.2 (r252:60911, Dec  2 2008, 09:26:14)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print os.environ['NLS_LANG']
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.5/UserDict.py", line 22, in __getitem__
raise KeyError(key)
KeyError: 'NLS_LANG'
>>> from django.db import connection
>>> connection.cursor()  # Initialize the connection
>>> print os.environ['NLS_LANG']
.UTF8
>>> print connection.connection.encoding
WINDOWS-1252
>>> print connection.connection.nencoding
WINDOWS-1252
>>>

Regards,
Anurag

On Fri, Dec 3, 2010 at 12:06 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote:

> On Thu, Dec 2, 2010 at 6:43 AM, Anurag Chourasia
> <anurag.choura...@gmail.com> wrote:
> > Hi Ian,
> > Yes.I set the NLS_LANG in my shell to UTF8 before trying this.
> > Query using Django model still fails (direct query using cx_Oracle works
> > fine)
> > Regards,
> > Anurag
>
> Okay, so it would appear that the client encoding is not being honored
> by Oracle for some reason.  Just to verify that Django is setting it
> correctly in the first place, would you please try the following in a
> Django shell and let me know what you get?
>
> >>> import os
> >>> print os.environ['NLS_LANG']
> >>> from django.db import connection
> >>> connection.cursor()  # Initialize the connection
> >>> print os.environ['NLS_LANG']
> >>> print connection.connection.encoding
> >>> print connection.connection.nencoding
>
> If everything is correct then the second NLS_LANG should be ".UTF8"
> and both encodings should be "UTF-8".  If that is the case then I
> think your next step should be to try the cx_Oracle mailing list.
> Perhaps Anthony or somebody else there will have some idea why
> cx_Oracle or OCI are returning strings with the wrong encoding.
>
> Otherwise, we will need to figure out why the client encoding is not
> being set correctly by Django.
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-02 Thread Anurag Chourasia
Hi Ian,

Yes.I set the NLS_LANG in my shell to UTF8 before trying this.

Query using Django model still fails (direct query using cx_Oracle works
fine)

Regards,
Anurag

On Thu, Dec 2, 2010 at 1:20 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote:

> On Wed, Dec 1, 2010 at 7:58 PM, Anurag Chourasia
> <anurag.choura...@gmail.com> wrote:
>
> > This is using cx_Oracle and it works fine
> > ===
> >>>> cx_Oracle.version
> > '5.0.3'
> >>>> cursor.execute("select to_term from terminology_map where id=316")
> >>>> cursor.fetchone()[0]
> > 'Registro guardado con \xe9xito'
>
> It's not clear to me which setting you used here.  Was this using the
> .UTF8 NLS_LANG as I requested?  If so, then in fact this is also
> coming back incorrectly, because that is not UTF-8.  If not, then
> we're comparing apples to oranges, since Django uses the .UTF8
> setting.
>
> Thanks,
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-12-01 Thread Anurag Chourasia
Hi Ian,

Thanks for the response.

With cx_Oracle(version 5.0.3), the retrieval of that field value works fine
as in my original email.

It's only when i directly use the Django models way of accessing that it
fails.

Below two examples will make it more clear.

This is using Django models and it fails
==
>>> TerminologyMap.objects.filter(id=316)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line
68, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line
83, in __len__
self._result_cache.extend(list(self._iter))
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line
269, in iterator
for row in compiler.results_iter():
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/compiler.py",
line 672, in results_iter
for rows in self.execute_sql(MULTI):
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/compiler.py",
line 741, in 
result = iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
  File "/usr/lib/python2.5/site-packages/django/db/backends/oracle/base.py",
line 552, in fetchmany
for r in self.cursor.fetchmany(size)])
  File "/usr/lib/python2.5/site-packages/django/db/backends/oracle/base.py",
line 625, in _rowfactory
value = to_unicode(value)
  File "/usr/lib/python2.5/site-packages/django/db/backends/oracle/base.py",
line 636, in to_unicode
return force_unicode(s)
  File "/usr/lib/python2.5/site-packages/django/utils/encoding.py", line 88,
in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
django.utils.encoding.DjangoUnicodeDecodeError: 'utf8' codec can't decode
bytes in position 22-24: invalid
 data. You passed in 'Registro guardado con \xe9xito' ()

This is using cx_Oracle and it works fine
===
>>> cx_Oracle.version
'5.0.3'
>>> cursor.execute("select to_term from terminology_map where id=316")
>>> cursor.fetchone()[0]
'Registro guardado con \xe9xito'

Regards,
Anurag

On Wed, Dec 1, 2010 at 10:51 PM, Ian <ian.g.ke...@gmail.com> wrote:

> On Nov 30, 8:31 pm, Anurag Chourasia <anurag.choura...@gmail.com>
> wrote:
> > On Oracle 10.2 with Character-Set set to WE8MSWIN1252,
> >
> > When using Django, I try to select a Oracle row which contains a field
> with
> > value as 'Páginas', i encounter the following error "'utf8' codec can't
> > decode bytes "
>
> The NLS_LANG setting used by Django should guarantee that the data
> comes back as UTF-8 regardless of the database character set.
>
> What version of cx_Oracle are you using?
> Is the column type VARCHAR2 or NVARCHAR2?
> What do you get if you try the following, substituting the appropriate
> values?
>
> $ export NLS_LANG=.UTF8
> $ python
> >>> import cx_Oracle
> >>> conn = cx_Oracle.connect('username/passw...@dsn')
> >>> cursor = conn.cursor()
> >>> cursor.execute("SELECT PROBLEM_COLUMN FROM TERMINOLOGY_MAP WHERE ID =
> 206")
> >>> print repr(cursor.fetchone()[0])
>
> Thanks,
> Ian
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django 1.2.3, Oracle with Character Set WE8MSWIN1252 - 'utf8' codec can't decode bytes

2010-11-30 Thread Anurag Chourasia
Hi All,

On Oracle 10.2 with Character-Set set to WE8MSWIN1252,

When using Django, I try to select a Oracle row which contains a field with
value as 'Páginas', i encounter the following error "'utf8' codec can't
decode bytes "

Here is the trace from the python command prompt.

>>> tmlist = TerminologyMap.objects.filter(id=206)
>>> tmlist
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line
68, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line
83, in __len__
self._result_cache.extend(list(self._iter))
  File "/usr/lib/python2.5/site-packages/django/db/models/query.py", line
269, in iterator
for row in compiler.results_iter():
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/compiler.py",
line 672, in results_iter
for rows in self.execute_sql(MULTI):
  File "/usr/lib/python2.5/site-packages/django/db/models/sql/compiler.py",
line 741, in 
result = iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
  File "/usr/lib/python2.5/site-packages/django/db/backends/oracle/base.py",
line 552, in fetchmany
for r in self.cursor.fetchmany(size)])
  File "/usr/lib/python2.5/site-packages/django/db/backends/oracle/base.py",
line 625, in _rowfactory
value = to_unicode(value)
  File "/usr/lib/python2.5/site-packages/django/db/backends/oracle/base.py",
line 636, in to_unicode
return force_unicode(s)
  File "/usr/lib/python2.5/site-packages/django/utils/encoding.py", line 88,
in force_unicode
raise DjangoUnicodeDecodeError(s, *e.args)
django.utils.encoding.DjangoUnicodeDecodeError: 'utf8' codec can't decode
bytes in position 1-3: invalid data. You passed in 'P\xe1ginas' ()

Please let me know if I am doing something wrong here or if there is already
a solution available for this encoding problem.

Regards,
Anurag

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.