Re: Dream 11

2022-09-07 Thread Anurag Agarwal
Please contact @RishavPant or @RohitSharma

On Wed, Sep 7, 2022, 19:36 Vineet Kothari 
wrote:

> Hi,
> I want to create a web app like dream 11 any hint will be appreciated.
>
> Thanks & Regards,
> Vineet Kothari
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAcansv2Spew7DLv2dp8igo6EaLTginV%2BgSmudXVX88%3DpvsrPQ%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOuTKWKFjJ8tm8a_G6oedkdJTQZ_GEEatsUk2ZTuZvBgJm5oRw%40mail.gmail.com.


Re: __init__() got an unexpected keyword argument 'on delete' when make migrations

2021-12-05 Thread Anurag Agarwal
Why are you fucking passing the args
On_delete in manytomany . Class

  promotion = models.ManyToManyField(Promotions, on_delete=models.CASCADE)


On Sun, Dec 5, 2021, 21:09 Samuel Nogueira  wrote:

> Please, can you take some prints of your models?
>
> Em dom., 5 de dez. de 2021 12:34, Khánh Hoàng <
> hoangduckhanh432...@gmail.com> escreveu:
>
>> Hi everyone, I am new to programming, more than 4 months, I had an issue
>> when making  migrations for my apps.
>>
>> I run :" python manage.py makemigrations " and  I got a error.
>>  It said:  TypeError: __init__() got an unexpected keyword argument 'on
>> delete'
>> I'm Using Django 3.2.9
>> Can someone explain it for me? And how to fix it.
>>
>> Thanks and Regards,
>> Khanh Hoang
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b5adebe5-05b0-4c33-b164-85fda53e13cbn%40googlegroups.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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAOJT-cB8%3DxmYBFPykbRxAdagN-PoDQQRne-r8MjHLZk2MX7j9w%40mail.gmail.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOuTKWKubiOk%3D%3DezHsSfP_k%2BamwPma7FUP1Goe%3DKBxcvWu03pQ%40mail.gmail.com.


Re: optimisation django

2021-02-11 Thread Anurag Kumar
use indexes..

On Wednesday, February 10, 2021 at 7:25:45 PM UTC+5:30 en2lin...@gmail.com 
wrote:

>
> I am developing a django application, most of the views are tables, I am 
> facing a problem the loading time of my page is extremely long. how can I 
> do to optimize this, my data set represents more than 100,000 rows. thank 
> you for your help ^^ 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/69e04caf-ba23-4c93-9c51-2c23de79ba37n%40googlegroups.com.


Re: get_absolute_url in djano 2.1.7

2019-03-17 Thread Ankit Anurag
The one major use is that this function helps you avoid situations where 
you have to hardcode a URL in your templates. Instead, you use something 
like {{.get_absolute_url}} and even if you change the path in 
some way at some later point of time, it won't matter. It's basically a 
really good practice to use this function to define your URL.
Check out this link from Stack : 
*https://stackoverflow.com/questions/43179875/when-to-use-django-get-absolute-url-method*

On Sunday, 17 March 2019 20:07:27 UTC+5:30, arpan godiyal wrote:
>
> Can someone help me with how to use get_absolute_url method in django 
> 2.1.7.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7c18e8ad-cb6a-49b6-8ab8-c2a3fcb5184a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django admin css not loading in localhost

2018-02-22 Thread anurag bhadauriya
i am using django-1.11.6. whenever i open my admin panel and login to it then 
it looks like the simple html file.  no any css files are loading .The 
interface i am seeing is totally different than that of the tutorials using 
which i am learning.please give me the stepwise solution

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


'base64' is not a text encoding; use codecs.decode() to handle arbitrary codecs

2018-02-20 Thread anurag kumar


Its showing error LookupError: 'base64' is not a text encoding; use 
codecs.decode() to handle arbitrary codecs.

Last few lines when the execution stops are - thumbnail = 
resize(photo_data, 200, 200) File "/home/anurag/photoshare/app.py", line 
406, in resize image_string = StringIO(img.decode('base64')) LookupError: 
'base64' is not a text encoding; use codecs.decode() to handle arbitrary 
codecs
begin photo uploading codephotos uploaded using base64 encoding so they can 
be directly embeded in HTML

ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])def 
allowed_file(filename):``return '.' in filename and filename.rsplit('.', 1)[1] 
in 
ALLOWED_EXTENSIONS
@app.route('/upload', methods=['GET', 'POST'])@flask_login.login_requireddef 
upload_file():if request.method == 'POST':
uid = getUserIdFromEmail(flask_login.current_user.id)
imgfile = request.files['photo']
caption = request.form.get('caption')
album_id = request.form.get('album')
tags = request.form.get('tags')
photo_data = base64.standard_b64encode(imgfile.read())
thumbnail = resize(photo_data, 200, 200)
cursor = conn.cursor()
cursor.execute("INSERT INTO Photos (imgdata, thumbnail, user_id, 
caption, album_id) VALUES ('{0}', '{1}', '{2}', '{3}', 
'{4}')".format(photo_data, thumbnail, uid, caption, album_id))
conn.commit()
picture_id = cursor.lastrowid
print (picture_id)
print (tags)
insert_tags(picture_id, tags)
return redirect( url_for('get_album', id=album_id))#The method is GET so we 
return a  HTML form to upload the a photo.else:
return render_template('upload.html', loggedin=True, 
albums=get_all_album_data())

end photo uploading coderesizes if greater than (x,y) else returns original

def resize(img, x,y):
image_string = StringIO(img.decode('base64'))with Image.open(image_string) as 
image:
if image.size[0] > 200 and image.size[1] > 200:
cover = resizeimage.resize_cover(image, [x,y])
buffer = StringIO()
cover.save(buffer, format="JPEG")
return base64.b64encode(buffer.getvalue())
else:
return img

Then there is another filefor image. from PIL import Image from io import 
StringIO from resizeimage import resizeimage import os, base64

 def resize(img, x,y):
image_string = StringIO(img.decode('base64'))``with Image.open(image_string) as 
image:
if image.size[0] > 200 and image.size[1] > 200:
cover = resizeimage.resize_cover(image, [x,y])
return base64.standard_b64encode(cover)
else:
return img``

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


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.


how to add additional data to that submitted by the user in a django form

2014-06-23 Thread Anurag Baidyanath
I am trying to create a form in which the user enter details like his email 
id and query. 

After the form is submitted i have to save the data that I get from the 
form along with some additional info such as userid , submitted date and 
time, etc into the database.

What approach should be adopted for solving this problem?

-- 
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/d0f67d83-3e85-4e94-8509-73d69fb6c60d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Setting initial value of a autoincrement field in the database

2014-06-19 Thread Anurag Baidyanath
I have a field in my models.py file as follows

ticket_id = models.AutoField(primary_key=True)

The value for the ticket_id column starts at 1. say i wanted it to start 
from some value (say 989) . how do i accomplish this using django?

-- 
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/5fb06f8d-f8e9-4e16-a4bf-4732487d1119%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: implementing a ticket submission system

2014-06-13 Thread Anurag Baidyanath
Thanks!
it solved the problem

On Wednesday, 11 June 2014 23:40:59 UTC+5:30, Ilya Kazakevich wrote:
>
> Hello, 
>
> Use Primary Key: 
> https://docs.djangoproject.com/en/dev/topics/db/models/#automatic-primary-key-fields
>  
>
>
> 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 Anurag 
> Baidyanath 
> >Sent: Wednesday, June 11, 2014 10:06 PM 
> >To: django...@googlegroups.com  
> >Subject: implementing a ticket submission system 
> > 
> >i am implementing a ticket submission system whose model.py file looks 
> loke 
> >this: 
> >class Ticket(models.Model): 
> >user_id=models.ForeignKey(User) 
> >category_id=models.ForeignKey(Category) 
> >subject=models.CharField(max_length=100) 
> >message=models.TextField(help_text="enter message") 
> >ticket_id=models.IntegerField(help_text="enter tid",unique=True) 
> >created_date_time=models.DateTimeField(auto_now_add=True) 
> >overdue_date_time=models.DateTimeField(auto_now_add=True) 
> >closed_date_time=models.DateTimeField(auto_now_add=True) 
> >status=models.IntegerField(help_text="enter status",default=0) 
> >reopened_date_time=models.DateTimeField(auto_now_add=True) 
> >topic_priority=models.IntegerField(help_text="enter 
> priority",default=1) 
> >duration_for_reply=models.IntegerField(help_text="enter duration for 
> >reply",default=24) 
> > 
> >i need to take the data submitted by the user(message and subject); and 
> >generate the ticket_id dynamically for each ticket. Then the data has to 
> be saved 
> >into the database. please suggest an approach for this. 
> > 
> > 
> > 
> >-- 
> >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/557b5a43-536b-4051-b80c-13f 
> >006a688dd%40googlegroups.com 
> ><https://groups.google.com/d/msgid/django-users/557b5a43-536b-4051-b80c-1 
> >3f006a688dd%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/85fd8849-22a5-41fc-ab14-8f0036793a1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


implementing a ticket submission system

2014-06-11 Thread Anurag Baidyanath
i am implementing a ticket submission system whose model.py file looks loke 
this:
class Ticket(models.Model):
user_id=models.ForeignKey(User)
category_id=models.ForeignKey(Category)
subject=models.CharField(max_length=100)
message=models.TextField(help_text="enter message")
ticket_id=models.IntegerField(help_text="enter tid",unique=True)
created_date_time=models.DateTimeField(auto_now_add=True)
overdue_date_time=models.DateTimeField(auto_now_add=True)
closed_date_time=models.DateTimeField(auto_now_add=True)
status=models.IntegerField(help_text="enter status",default=0)
reopened_date_time=models.DateTimeField(auto_now_add=True)
topic_priority=models.IntegerField(help_text="enter priority",default=1)
duration_for_reply=models.IntegerField(help_text="enter duration for 
reply",default=24)

i need to take the data submitted by the user(message and subject); and 
generate the ticket_id dynamically for each ticket. Then the data has to be 
saved into the database. please suggest an approach for this.

-- 
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/557b5a43-536b-4051-b80c-13f006a688dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Modifying the request.POST data that is received from a form; form is not getting validated then

2014-06-10 Thread Anurag Baidyanath
)
duration_for_reply=models.IntegerField()
def __unicode__(self):
return unicode(self.user_id)

On Tuesday, 10 June 2014 18:23:42 UTC+5:30, Daniel Roseman wrote:
>
> On Tuesday, 10 June 2014 12:25:10 UTC+1, Anurag Baidyanath wrote:
>>
>> i am having difficulty in saving the form data to the database.
>>
>
> And we are having difficulty reading your code. If you can't be bothered 
> to clean it up enough (eg removing all the commented-out lines) to make it 
> easy to read before posting your question, you'll not find many people that 
> can be bothered to answer it.
>
> Also, you should read the very useful documentation on using a form in a 
> view (
> https://docs.djangoproject.com/en/1.6/topics/forms/#using-a-form-in-a-view) 
> and compare it with your view code, which might give you a hint as to where 
> you are going wrong.
> --
> DR.
>

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


Modifying the request.POST data that is received from a form; form is not getting validated then

2014-06-10 Thread Anurag Baidyanath
i am having difficulty in saving the form data to the database.

After the user submits the form; fields such as ticket_id , created_date, 
etc have to be added to the POST request which is generated as a result of 
the form submission. I have copied the POST data to another dictionary and 
appended the other fields. The form isn't getting validated when the 
is_valid() fn is called.

i am attaching the submit function in the views.py file and the forms.py 
file


def submit(request):
context=RequestContext(request)
if(request.method=="POST"):
print request.POST
print "\n"
data = request.POST.copy()
#data=request.POST

print "\n"
print request.user.email
data['created_date_time']=datetime.datetime.now()
data['overdue_date_time']=datetime.datetime.now()
Date=datetime.datetime.now()
Enddate=Date+datetime.timedelta(days=1)
data['overdue_date_time']=Enddate
data['closed_date_time']=Enddate
data['status']=0 # 0 means that the ticket is still 
open and not yet answered
data['reopened_date_time']=Enddate
data['topic_priority']=2 # 2 is the default priority of 
medium
data['duration_for_reply']=24 #in hours
if request.user.is_authenticated():
print request.user
data['user_id']=request.user.email
#returns a user object if the user is logged in. 
@login_required is thus necessary
else:
return HttpResponse("you need to be a valid user to 
submit a ticket. click here to go to the login page")
#let the help topic remain the same
#category_selected=data['help_topic']

#data['help_topic']=Category.objects.get(category="android")#category_selected)#get
 
is used to get a single object
from django.db.models import Max

last_ticket=int(Ticket.objects.all().aggregate(Max('ticket_id'))['ticket_id__max'])
data['ticket_id']=last_ticket+1
#if 'submit' in data: del data['submit']
#if 'csrfmiddlewaretoken' in data: del 
data['csrfmiddlewaretoken']

#user_form=SubmitTicketForm(data)
print data
user_form=SubmitTicketForm(data)
#how to validate the form for yourself
if user_form.is_valid():
 print user_form.cleaned_data
  #   user_form=Ticket.objects.set(topic_id=data['user_id'])
 user_form.save()
 return HttpResponse("Saved successfully")
#else:
 # print data
  # return HttpResponse("Saved unsuccessfully")
   # print "the errors are"
# print user_form.errors
else:
 user_form=SubmitTicketForm()
 return render_to_response(
'submit.html',
{'user_form': user_form},
context)

from user_tickets.models import *
from django import forms
from django.contrib.auth.models import User
import datetime
from datetime import timedelta
from django.db.models import Max
class SubmitTicketForm(forms.ModelForm):
status=forms.IntegerField(widget=forms.HiddenInput(),initial=0)
topic_priority=forms.IntegerField(widget=forms.HiddenInput(),initial=2)

duration_for_reply=forms.IntegerField(widget=forms.HiddenInput(),initial=24)

ticket_id=forms.IntegerField(widget=forms.HiddenInput(),initial=786)#(int(Ticket.objects.all().aggregate(Max('ticket_id'))['ticket_id__max']))+1)

created_date_time=forms.DateTimeField(widget=forms.HiddenInput(),initial=datetime.datetime.now())

overdue_date_time=forms.DateTimeField(widget=forms.HiddenInput(),initial=datetime.datetime.now())

closed_date_time=forms.DateTimeField(widget=forms.HiddenInput(),initial=datetime.datetime.now())

reopened_date_time=forms.DateTimeField(widget=forms.HiddenInput(),initial=datetime.datetime.now())
class Meta:
model=Ticket

fields=('user_id','topic_id','message','ticket_id','status','topic_priority','duration_for_reply','created_date_time','overdue_date_time','closed_date_time','reopened_date_time')

#'created_date_time','overdue_date_time','closed_date_time','reopened_date_time',


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

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 <fjmille...@gmail.com>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" <frank.bien...@produktlaunch.de>
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<django-users%2bunsubscr...@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<http://groups.google.com/group/django-users?hl=en>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<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 <halna...@gardeniatelco.com> 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" <halna...@gardeniatelco.com> 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 <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: 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 <navaneetha...@gmail.com> 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.



Bash autocompletion for django-admin.py/manage.py

2011-02-18 Thread Anurag
I just posted a simple script to autocomplete django-admin.py/manage.py 
commands in bash:

https://github.com/agoel/django-bash-complete

I hope it can save everyone some keystrokes.

Best,
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-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 <itssami.g...@gmail.com> 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/

<http://code.google.com/p/django-mailer/>Regards,
Anurag

On Fri, Jan 21, 2011 at 8:58 PM, hank23 <hversem...@stchas.edu> wrote:

> OK what exactly is django-mailer?
>
> On Jan 19, 4:32 pm, Eduardo Cereto Carvalho <eduardocer...@gmail.com>
> 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 <sh...@milochik.com>
> 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<django-users%2bunsubscr...@googlegroups.com>
> <django-users%2Bunsubscribe@google­groups.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<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-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 <greg0...@yahoo.com> 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<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-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 <d...@bathdesign.co.uk> 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<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
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 <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>
> .
> 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 <armandoper...@hotmail.com>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<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: 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 <list.dja...@calidris.co.uk>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<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 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 <ian.g.ke...@gmail.com> wrote:

> On Thu, Dec 2, 2010 at 3:23 PM, Ian Kelly <ian.g.ke...@gmail.com> 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.



Deleted rows available in a transaction

2010-09-10 Thread Anurag
I am facing a very peculiar problem that even when I delete some rows,
I can just get them back again in same transaction.

Edit:
I have created a sample app to test it out, so that I can be sure that
none of my code is culprit.

I created a testapp with following code

**models.py**

import uuid
from django.db import models

class TestTable(models.Model):
id = models.CharField(max_length=36, primary_key=True)
name = models.CharField(max_length=50)

@classmethod
def get_row(cls, name):
return TestTable(id=str(uuid.uuid4()), name=name)

def __unicode__(self):
return u"%s[%s]"%(self.name, self.id)

**views.py**

import traceback
import time
from django.db import transaction
from django.http import HttpResponse

from testapp.models import TestTable

@transaction.commit_manually
def test_view(request):
time.sleep(1)
out = []
try:
# delete 3 rows
for row in TestTable.objects.all()[:3]:
ID=row.id
out.append("deleting %s"%row)
row.delete()
# check fi really deleted
try:
TestTable.objects.get(id=ID)
out.append("row not deleted?")
except TestTable.DoesNotExist,e:
out.append("row deleted.")

# create 5 rows
for i in range(5):
row = TestTable.get_row("row %s"%i)
row.save()

except Exception,e:
out.append("Error:%s"%traceback.format_exc())
transaction.rollback()
else:
transaction.commit()

return HttpResponse('\n'.join(out), 'text/text'

**urls.py**

from django.conf.urls.defaults import *

urlpatterns = patterns('testapp.views', (r'^test_bug$',
'test_view')

I am running this under apache and mod_wsgi

**TestScript**

import urllib2
from multiprocessing import Process

def get_data():
r = urllib2.urlopen("http://localhost:81/timeapp/test/
test_bug")
print "-"
print r.read()

if __name__ == "__main__":
for i in range(2):
p = Process(target=get_data)
p.start()

**Output:**

$ python test.py
-
deleting row 1[3ad3a82e-830f-4540-8148-88479175ed5e]
row deleted.
deleting row 0[544462d1-8588-4a8c-a809-16a060054479]
row deleted.
deleting row 3[55d422f3-6c39-4c26-943a-1b4db498bf25]
row deleted.
-
deleting row 1[3ad3a82e-830f-4540-8148-88479175ed5e]
row not deleted?
deleting row 0[544462d1-8588-4a8c-a809-16a060054479]
row not deleted?
deleting row 3[55d422f3-6c39-4c26-943a-1b4db498bf25]
row not deleted?

So my question is how come deleted row is again retrievable by
TestTable.objects.get, also even if I sleep more in second call so
that first call can commit code I still get deleted rows in second
call.

-- 
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: Subprocess module in Python CGI

2009-01-08 Thread Anurag


Hello Kenneth,

Thank you for your suggestion. This was helpful to remove a sort of
redundancy in my program but removal of '\' still does not solve my
problem as the Error displayed remains exactly the same.
Any other suggestions?

Once again thank you so much for your valuable time.
Regards.



On Dec 23 2008, 1:59 pm, Kenneth Gonsalves <law...@thenilgiris.com>
wrote:
> On Monday 22 Dec 2008 4:21:31 pm Anurag wrote:
>
> > comd = [\
> >         "tar -xf x.tar.gz", \
>
> nothing to do with python:
> [law...@localhost programs]$ tar -xf x.tar.gz
> tar: x.tar.gz: Cannot open: No such file or directory
> tar: Error is not recoverable: exiting now
>
> btw, there is no need to put '\' when putting a list in more than one line. In
> general, in python, you can put anything within (), [] or {} on more than one
> line without any escaping.
>
> --
> regards
> KGhttp://lawgon.livejournal.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
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Subprocess module in Python CGI

2008-12-23 Thread Anurag

I have also missed out a last line at the end of the Traceback ...
this may be important in fishing out the error. The last line is:

OSError: [Errno 2] No such file or directory

Looking forward to some kind of suggestions.
Thanking you all once again and with Regards.

On Dec 22, 11:51 am, Anurag <anurag.baga...@gmail.com> wrote:
> Hello,
>
> I have started using python recently and would like to call a short
> python script via
> browser using a CGI script, but initially I am trying to call the same
> python script directly through python command line. The script intends
> to
> perform a few command line in a pipe and I have written the script (a
> short
> one) as follows. I would later also like to import this application to
> Django.
>
> #!/usr/bin/python
>
> import cgi, string, os, sys, cgitb, commands, subprocess
> import posixpath, macpath
> #file = "x.tar.gz"
> #comd = "tar -xf %s" % (file)
> #os.system(comd)
> #commands.getoutput('tar -xf x.tar.gz | cd demo; cp README ../')
> comd = [\
>         "tar -xf x.tar.gz", \
>         "cd demo", \
>         "cp README ../", \
>       ]
> outFile = os.path.join(os.curdir, "output.log")
> outptr = file(outFile, "w")
> errFile = os.path.join(os.curdir, "error.log")
> errptr = file(errFile, "w")
> retval = subprocess.call(comd, 0, None, None, outptr, errptr)
> errptr.close()
> outptr.close()
> if not retval == 0:
>         errptr = file(errFile, "r")
>         errData = errptr.read()
>         errptr.close()
>         raise Exception("Error executing command: " + repr(errData))
>
> but after trying to execute this independently, I get the following
> error
> which I am unable to interpret :
>
> Traceback (most recent call last):
>   File "process.py", line 18, in 
>     retval = subprocess.call(comd, 0, None, None, outptr, errptr)
>   File "/usr/lib/python2.5/subprocess.py", line 443, in call
>     return Popen(*popenargs, **kwargs).wait()
>   File "/usr/lib/python2.5/subprocess.py", line 593, in __init__
>     errread, errwrite)
>   File "/usr/lib/python2.5/subprocess.py", line 1135, in
> _execute_child
>     raise child_exception
>
> Could someone suggest where am I going wrong and if corrected, what is
> the
> probability of this script being compatible with being called through
> the
> browser. Thanking you people in advance.
>
> Regards.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Subprocess module in Python CGI

2008-12-22 Thread Anurag

Hello,

I have started using python recently and would like to call a short
python script via
browser using a CGI script, but initially I am trying to call the same
python script directly through python command line. The script intends
to
perform a few command line in a pipe and I have written the script (a
short
one) as follows. I would later also like to import this application to
Django.

#!/usr/bin/python

import cgi, string, os, sys, cgitb, commands, subprocess
import posixpath, macpath
#file = "x.tar.gz"
#comd = "tar -xf %s" % (file)
#os.system(comd)
#commands.getoutput('tar -xf x.tar.gz | cd demo; cp README ../')
comd = [\
"tar -xf x.tar.gz", \
"cd demo", \
"cp README ../", \
  ]
outFile = os.path.join(os.curdir, "output.log")
outptr = file(outFile, "w")
errFile = os.path.join(os.curdir, "error.log")
errptr = file(errFile, "w")
retval = subprocess.call(comd, 0, None, None, outptr, errptr)
errptr.close()
outptr.close()
if not retval == 0:
errptr = file(errFile, "r")
errData = errptr.read()
errptr.close()
raise Exception("Error executing command: " + repr(errData))


but after trying to execute this independently, I get the following
error
which I am unable to interpret :

Traceback (most recent call last):
  File "process.py", line 18, in 
retval = subprocess.call(comd, 0, None, None, outptr, errptr)
  File "/usr/lib/python2.5/subprocess.py", line 443, in call
return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.5/subprocess.py", line 593, in __init__
errread, errwrite)
  File "/usr/lib/python2.5/subprocess.py", line 1135, in
_execute_child
raise child_exception


Could someone suggest where am I going wrong and if corrected, what is
the
probability of this script being compatible with being called through
the
browser. Thanking you people in advance.

Regards.


--~--~-~--~~~---~--~~
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: Query

2008-10-23 Thread Anurag

Hi,
Thanks for these links.

Yes, Googling had certainly given me lot many links and it was taking
me several hours to finally decide which tutorial to continue with.

I had earlier chosen the second link given by you but the second was
not really a FOCUSED one.

I had been continuing with the third link as I had found this one was
better than the others and also FOCUSED with the interactive examples.
If asked, I would recommend the third one to anyone. He/She may
continue referring to more material if they wish.

Thanking you once again.

On Oct 22, 7:51 pm, "jd.strickler" <[EMAIL PROTECTED]> wrote:
> It took about 15 seconds with Google to find these:
>
> http://www.devshed.com/c/a/Python/Writing-CGI-Programs-in-Python/http://www.cs.virginia.edu/~lab2q/lesson_7/http://gnosis.cx/publish/programming/feature_5min_python.html
>
> Anytime you find yourself asking for materials, Google first!  Then,
> if you still have questions, use the mailing lists.  Otherwise it
> looks like you're just too lazy to do your own research.
>
> On Oct 22, 11:16 am, Anurag <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > It is actually that I want to develop a Graphical User Interface for
> > submitting some jobs (presently doing it as command line interface
> > only). I would like to use Python-CGI for it.
> > I would be thankful if someone could suggest me some focused tutorial/
> > book/web-link etc with regard to this.
>
> > Thanking you once again.
> > Regards.
>
> > On Oct 22, 2:41 pm, bruno desthuilliers
>
> > <[EMAIL PROTECTED]> wrote:
> > > On 22 oct, 14:11, Anurag <[EMAIL PROTECTED]> wrote:
>
> > > > Hello Gerard,
>
> > > > Thank you so much for your suggestion. I have tried working in the
> > > > direction suggested by you.
> > > > The next step of difficulty that I find is that there are lot of
> > > > materials available on the internet in this regard but I could not
> > > > find some really good working examples and tutorials with respect to
> > > > developing a Web-server using Python-CGI.
>
> > > Why do you want to develop a web server ? Just use Apache.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Query

2008-10-22 Thread Anurag

Hello,

It is actually that I want to develop a Graphical User Interface for
submitting some jobs (presently doing it as command line interface
only). I would like to use Python-CGI for it.
I would be thankful if someone could suggest me some focused tutorial/
book/web-link etc with regard to this.

Thanking you once again.
Regards.

On Oct 22, 2:41 pm, bruno desthuilliers
<[EMAIL PROTECTED]> wrote:
> On 22 oct, 14:11, Anurag <[EMAIL PROTECTED]> wrote:
>
> > Hello Gerard,
>
> > Thank you so much for your suggestion. I have tried working in the
> > direction suggested by you.
> > The next step of difficulty that I find is that there are lot of
> > materials available on the internet in this regard but I could not
> > find some really good working examples and tutorials with respect to
> > developing a Web-server using Python-CGI.
>
> Why do you want to develop a web server ? Just use Apache.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Query

2008-10-22 Thread Anurag


Hello Gerard,

Thank you so much for your suggestion. I have tried working in the
direction suggested by you.
The next step of difficulty that I find is that there are lot of
materials available on the internet in this regard but I could not
find some really good working examples and tutorials with respect to
developing a Web-server using Python-CGI. Could you suggest some
tutorials or links to them which could be helpful for a newbie to
Python like me.

Thanking you in advance.
Regards.
On Sep 25, 5:58 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote:
> Anurag,
>
> In your case a simple CGI script (in python) might suffice, and will only 
> take you 'days' to build. If you choose to take on Django, it might take you 
> 'weeks'. With Django on the otherhand there are loads of features that will 
> help you easily build complex web applications. But there's more information 
> to digest before you have working functionality.
>
> I'd look at the django 
> tutorial:http://docs.djangoproject.com/en/dev/intro/tutorial01/
>
> And ask yourself if you want to expand your described functionality in the 
> future.
>
> Hope it helps.
>
> Regards,
>
> Gerard.
>
>
>
> ANURAG BAGARIA wrote:
> > Dear Django Users,
>
> > I am totally new to the web technology kind of work. I need to develop a
> > web interface (front end) which could upload certain data files to a
> > server, run some calculations on it and then return the results in a
> > form of an output file. I am told that this kind of work can be done
> > using Django. I would request someone to kindly give me an overview of
> > going about the process or any information regarding the same.
>
> > Looking forward to a positive response from the users and thanking you
> > all in advance.
>
> > Warm regards.
>
> > --
> > The road to success is always under construction ...!!!
>
> > ANURAG KUMAR BAGARIA
> > PhD Student
> > Institute for Biophysical Chemistry
> > J. W. Goethe University, Frankfurt
> > Frankfurt am Main, Germany
>
> --
> urls = { 'fun':  'www.zonderbroodje.nl',  'tech':  'www.gp-net.nl'}
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Query

2008-09-25 Thread ANURAG BAGARIA
Dear Django Users,

I am totally new to the web technology kind of work. I need to develop a web
interface (front end) which could upload certain data files to a server, run
some calculations on it and then return the results in a form of an output
file. I am told that this kind of work can be done using Django. I would
request someone to kindly give me an overview of going about the process or
any information regarding the same.

Looking forward to a positive response from the users and thanking you all
in advance.

Warm regards.

-- 
The road to success is always under construction ...!!!


ANURAG KUMAR BAGARIA
PhD Student
Institute for Biophysical Chemistry
J. W. Goethe University, Frankfurt
Frankfurt am Main, Germany

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with generic views in tutorial example

2008-08-23 Thread Anurag Goel

And in my first reply, I meant 'mysite/polls/urls.py' when I said:

' . I did however, do something that the tutorial did not ask to
do - i.e.
delete all references to the admin in mysite/urls.py, which looks like
this '

On Aug 22, 1:38 am, Rodney Topor <[EMAIL PROTECTED]> wrote:
> On Aug 22, 4:18 pm, Anurag Goel <[EMAIL PROTECTED]> wrote:> I was able to 
> implement the generic views change with yesterday's
> > trunk version successfully. I did not have to do anything special (no
> > separate admin.py, no get_absolute_url())
>
> > I did however, do something that the tutorial did not ask to do - i.e.
> > delete all references to the admin in mysite/urls.py, which looks like
> > this:
>
> Anurag, Thanks.  That worked for me too.  But it's hardly a solution.
> Now I can't use admin.  I want both.  Is that asking too much?  Has
> anyone else any ideas?
>
> > On Aug 21, 10:45 pm, Rodney Topor <[EMAIL PROTECTED]> wrote:
>
> > > I'm having trouble modifying the tutorial example to use generic
> > > views.  (My implementation without generic views works fine.)  I've
> > > registered the class Poll with admin in a separate admin.py module as
> > > described in ticket 8181.  I've provided names for all url patterns in
> > > app polls.  I've defined get_absolute_url() for class Poll using the
> > > name for the poll detail pattern.  I've implemented view vote() as
> > > described in the tutorial,  Yet when I cast a vote in the form with
> > > action = /polls/n/vote/, I get the following error:
>
> > > The model Poll is already registered
>
> > > Any suggestions?
>
> > > (And this is separate from the reverse lookup failures I get with
> > > generic views using named patterns in url template tags...)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with generic views in tutorial example

2008-08-23 Thread Anurag Goel

Apologies - I did not mention that my original urls.py (under mysite/,
at the same level as polls/) still exists (the urls.py has to be
copied over as opposed to moved), and it contains the following code:

--mysite/urls.py begin--
from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('mysite.polls.views',
#enables admin and poll/urls.py
(r'^polls/', include('mysite.polls.urls')),
(r'^admin/(.*)', admin.site.root),
)
--end mysite/urls.py--

Again, no need for any additional changes.

On Aug 22, 1:38 am, Rodney Topor <[EMAIL PROTECTED]> wrote:
> On Aug 22, 4:18 pm, Anurag Goel <[EMAIL PROTECTED]> wrote:> I was able to 
> implement the generic views change with yesterday's
> > trunk version successfully. I did not have to do anything special (no
> > separate admin.py, no get_absolute_url())
>
> > I did however, do something that the tutorial did not ask to do - i.e.
> > delete all references to the admin in mysite/urls.py, which looks like
> > this:
>
> Anurag, Thanks.  That worked for me too.  But it's hardly a solution.
> Now I can't use admin.  I want both.  Is that asking too much?  Has
> anyone else any ideas?
>
> > On Aug 21, 10:45 pm, Rodney Topor <[EMAIL PROTECTED]> wrote:
>
> > > I'm having trouble modifying the tutorial example to use generic
> > > views.  (My implementation without generic views works fine.)  I've
> > > registered the class Poll with admin in a separate admin.py module as
> > > described in ticket 8181.  I've provided names for all url patterns in
> > > app polls.  I've defined get_absolute_url() for class Poll using the
> > > name for the poll detail pattern.  I've implemented view vote() as
> > > described in the tutorial,  Yet when I cast a vote in the form with
> > > action = /polls/n/vote/, I get the following error:
>
> > > The model Poll is already registered
>
> > > Any suggestions?
>
> > > (And this is separate from the reverse lookup failures I get with
> > > generic views using named patterns in url template tags...)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem with generic views in tutorial example

2008-08-22 Thread Anurag Goel

I was able to implement the generic views change with yesterday's
trunk version successfully. I did not have to do anything special (no
separate admin.py, no get_absolute_url())

I did however, do something that the tutorial did not ask to do - i.e.
delete all references to the admin in mysite/urls.py, which looks like
this:

--begin--
from django.conf.urls.defaults import *
from mysite.polls.models import Poll

info_dict = {
'queryset': Poll.objects.all(),
}

urlpatterns = patterns('',
   (r'^$',
'django.views.generic.list_detail.object_list',
info_dict),
   (r'^(?P\d+)/$',
 
'django.views.generic.list_detail.object_detail',
info_dict),
   url(r'^(?P\d+)/results/$',
 
'django.views.generic.list_detail.object_detail',
   dict(info_dict, template_name='polls/
results.html'),
   'poll_results'),
   (r'^(?P\d+)/vote/$',
'mysite.polls.views.vote'),
)
--end--

Hope this helps.

-Anurag
On Aug 21, 10:45 pm, Rodney Topor <[EMAIL PROTECTED]> wrote:
> I'm having trouble modifying the tutorial example to use generic
> views.  (My implementation without generic views works fine.)  I've
> registered the class Poll with admin in a separate admin.py module as
> described in ticket 8181.  I've provided names for all url patterns in
> app polls.  I've defined get_absolute_url() for class Poll using the
> name for the poll detail pattern.  I've implemented view vote() as
> described in the tutorial,  Yet when I cast a vote in the form with
> action = /polls/n/vote/, I get the following error:
>
> The model Poll is already registered
>
> Any suggestions?
>
> (And this is separate from the reverse lookup failures I get with
> generic views using named patterns in url template tags...)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



unable to display images

2007-10-22 Thread Anurag

Sorry for this repeat post - but i am getting quite desperate and be
very thankful for some help...

I am unable to display images directly through Apache - with the
following configuration.Can someone please help. Much thanks!

the line in my base html reads the following
 

my media_url is set to /static/
and the htpd.conf reads the following


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE myapp.settings
PythonDebug On



SetHandler None

Alias /media/  "C:/Python25/Lib/site-packages/django/contrib/admin/
media/"

   Order deny,allow
   Allow from all
 


SetHandler None
 
Alias /static/  "C:/myapp/static/"

   Order deny,allow
   Allow from all



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Apache and images

2007-10-22 Thread Anurag

I am unable to display images directly through Apache - with the
following configuration.Can someone please help. Much thanks!

the line in my base html reads the following
 

my media_url is set to /static/
and the htpd.conf reads the following


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE myapp.settings
PythonDebug On



SetHandler None

Alias /media/  "C:/Python25/Lib/site-packages/django/contrib/admin/
media/"

   Order deny,allow
   Allow from all
 


SetHandler None
 
Alias /static/  "C:/myapp/static/"

   Order deny,allow
   Allow from all



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: admin media

2007-09-24 Thread Anurag

Thanks so much!

Anurag

On Sep 24, 1:39 pm, "Jonathan Buchanan" <[EMAIL PROTECTED]>
wrote:
> On 9/24/07, Anurag <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi,
> > Sorry for this repeat post - but i am getting desperate and
> > seeking some quick kindly help.
>
> > I am unable to get my admin media to be served by Apache. I am runinng
> > on windows.
>
> > Here is my httpd.conf
>
> > 
> > SetHandler python-program
> > PythonHandler django.core.handlers.modpython
> > SetEnv DJANGO_SETTINGS_MODULE newsite.settings
> > PythonDebug On
> > 
>
> > Alias /media/  "C:/Python25/Lib/site-packages/django/contrib/admin/
> > media/"
>
> > 
> >Order deny,allow
> >Allow from all
> >  
>
> > and my settings file has the ADMIN_MEDIA_PREFIX set to /media/
>
> Fromhttp://www.djangoproject.com/documentation/modpython/
>
> 
> SetHandler None
> 
>
> Jonathan.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



admin media

2007-09-24 Thread Anurag

Hi,
Sorry for this repeat post - but i am getting desperate and
seeking some quick kindly help.

I am unable to get my admin media to be served by Apache. I am runinng
on windows.

Here is my httpd.conf


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE newsite.settings
PythonDebug On


Alias /media/  "C:/Python25/Lib/site-packages/django/contrib/admin/
media/"


   Order deny,allow
   Allow from all
 

and my settings file has the ADMIN_MEDIA_PREFIX set to /media/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: serving admin files with Apache/mod_python

2007-09-21 Thread Anurag

Thanks! I added your suggestions in the following way since i am
running on windows

Alias /media/ "C:\Python25\Lib\site-packages\django\contrib\admin\media
\"

 
   Order deny,allow
   Allow from all
 

Am i slashing wrong?


On Sep 21, 4:57 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 21-Sep-07, at 5:13 PM, Anurag wrote:
>
> >   However my admin interface is all garbled up and what i did was i
> > copied the media directory from /admin/media into the htdocs of my
> > Apache setup. But i am still unable to see the admin interface
> > correctly.
>
> coming from php? Never put anything in htdocs. You need an alias like
>
> Alias /media/ "/home/anurag/django_src/django/contrib/admin/media/"
>   
>Order deny,allow
>Allow from all
>  
>
> and in settings.py
> ADMIN_MEDIA_PREFIX = '/media/'
>
> --
>
> regards
> kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: serving admin files with Apache/mod_python

2007-09-21 Thread Anurag

I tried the following in my httpd.conf and it still is not serving any
admin media


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE satchmo.settings
PythonDebug On


Alias /media/ "C:/Python25/Lib/site-packages/django/contrib/admin/
media/"


   Order deny,allow
   Allow from all
 

On Sep 21, 4:57 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 21-Sep-07, at 5:13 PM, Anurag wrote:
>
> >   However my admin interface is all garbled up and what i did was i
> > copied the media directory from /admin/media into the htdocs of my
> > Apache setup. But i am still unable to see the admin interface
> > correctly.
>
> coming from php? Never put anything in htdocs. You need an alias like
>
> Alias /media/ "/home/anurag/django_src/django/contrib/admin/media/"
>   
>Order deny,allow
>Allow from all
>  
>
> and in settings.py
> ADMIN_MEDIA_PREFIX = '/media/'
>
> --
>
> regards
> kghttp://lawgon.livejournal.comhttp://nrcfosshelpline.in/web/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



serving admin files with Apache/mod_python

2007-09-21 Thread Anurag

hello,
 i am a new user of django and would like some simple worded
instructions on how to serve
the admin interface with Apache and mod_python.

With my current set up i have the following in my httpd.conf:


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE myapp.settings
PythonDebug On


  This works well for myapp and i am able to use Apache/mod_python
and things are working fine.

However my admin interface is all garbled up and what i did was i
copied the media directory from /admin/media into the htdocs of my
Apache setup. But i am still unable to see the admin interface
correctly.


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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---