Re: ANN: Django 1.2.1 released

2010-05-24 Thread Dhruv Adhia
Awesome! Congrats guys!

Dhruv Vinodrai Adhia
http://www.thirdimension.com



On Mon, May 24, 2010 at 12:33 PM, James Bennett wrote:

> Following up on last week's Django 1.2 release, today we'd like to
> announce Django 1.2.1, the first bugfix release in the 1.2 series:
>
> * Announcement blog post:
> http://www.djangoproject.com/weblog/2010/may/24/121/
> * Download: http://www.djangoproject.com/download/
> * Checksums: http://media.djangoproject.com/pgp/Django-1.2.1.checksum.txt
>
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of
> correct."
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-develop...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-developers?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: My project is not detecting the geodjango application

2009-10-25 Thread Dhruv Adhia
The error means that are you sure you have added "world" in INSTALLED_APPS
which is in settings.py?

Dhruv Adhia
http://www.thirdimension.com



On Sun, Oct 25, 2009 at 10:35 AM, Sahiti Polishetty
wrote:

>  Hello .. I want to have google maps in my application, so i created a
> project and in that made an application to handle the maps and made the
> required changes in the settings.py for the above. But i am getting the
> following error when i am trying to issue the command "python manage.py
> sqlall world" Error: App with label world could not be found. Are you sure
> your INSTALLED_APPS setting is correct? Can some one please help in this
> issue . And my models file is as follows: from django.contrib.gis.db import
> models class WorldBorders(models.Model): # Regular Django fields
> corresponding to the attributes in the # world borders shapefile. name =
> models.CharField(max_length=50) area = models.IntegerField() pop2005 =
> models.IntegerField('Population 2005') fips = models.CharField('FIPS Code',
> max_length=2) iso2 = models.CharField('2 Digit ISO', max_length=2) iso3 =
> models.CharField('3 Digit ISO', max_length=3) un =
> models.IntegerField('United Nations Code') region =
> models.IntegerField('Region Code') subregion =
> models.IntegerField('Sub-Region Code') lon = models.FloatField() lat =
> models.FloatField() # GeoDjango-specific: a geometry field
> (MultiPolygonField), and # overriding the default manager with a GeoManager
> instance. mpoly = models.MultiPolygonField() objects = models.GeoManager() #
> So the model is pluralized correctly in the admin. class Meta:
> verbose_name_plural = "World Borders" # Returns the string representation of
> the model. def __unicode__(self): return self.name
>
>
> >
>

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



django deployment using apache and mod_wsgi

2009-10-23 Thread Dhruv Adhia

I have complete application working on localhost and now I want to
deploy that so other of my teammates can use it.

I have centos,
apache,
python 2.5
django 1.1.1


I have my django project at /var/www/html/ipwn/carbon_chaos
inside carbon_chaos folder I created apache folder and inside apache
folder I created file called django.wsgi
Inside django.wsgi I have


import os
import sys
sys.path.append('/var/www/html/ipwn/carbon_chaos')
sys.path.append('/usr/lib/python2.5/site-packages/django')
os.environ['DJANGO_SETTINGS_MODULE'] = 'carbon_chaos.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


I have little idea what to do next as I have done deployment once
before

I remember using this code and creating some sort of file out of it
and enabling it

WSGIRestrictStdout Off

LimitInternalRecursion 1000
ServerAdmin webmas...@localhost
ServerName localhost
DocumentRoot /home/user/django/
ErrorLog /home/user/django/apache.log
LogLevel warn
AddHandler wsgi-script .wsgi

AllowOverride FileInfo
Options ExecCGI MultiViews FollowSymLinks
MultiviewsMatch Handlers
Order deny,allow
Allow from all

Alias /media/ "/home/user/django/myproject/media/"

Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
allow from all



I had made appropriate changes and did some enabling stuff and running
apachectl start command and it showed up.
I read the following doc
http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

But it didnt say what name should I be saving that file with and where
should be saving it. Also enabling part is something I am looking for.

Can somebody just briefly walk me through the steps?

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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
Allright, working :)

Thank you all!
Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 4:09 PM, Dhruv Adhia  wrote:

> Just ignore past messages. I got successful posting of data from unity to
> django localhost server. Now I am creating POST request from unity thats why
> I am doing request.POST if condition.
>
> I could see that through print statements inside this code
>
>  if request.POST:
>name = request.POST['name']
>print name
>score = request.POST['score']
>print score
>hash = request.POST['hash']
>print hash
>
> before there was no output. So now I am sure that I am getting values.
>
> Can anybody help in storing name and score into database?
>
> i have models setup as follows.
>
> from django.db import models
> # Create your models here.
>
> class Scores(models.Model):
> name = models.CharField(max_length=100)
> score = models.IntegerField()
>
> class Meta:
> verbose_name_plural ="Scores"
>
> Thanks a ton!
>
> Dhruv Adhia
> http://thirdimension.com
>
>
>
> On Thu, Oct 22, 2009 at 2:54 PM, Dhruv Adhia  wrote:
>
>> here is the version I thought should have worked, but its not quite there
>>
>> def add_score(request):
>>#response_dict ={}
>>secret_key = "asdf789as7df89asdf87ds89a8f7sfd8"
>> name =""
>> score=0
>> hash=""
>>
>> # getting the posted data
>>if request.GET:
>>name = request.POST['name']
>>print name
>>score = request.POST['score']
>>print score
>>hash = request.POST['hash']
>>print hash
>>#leaderboard = {'name': name, 'score': score, 'hash': hash}
>>
>>  #hashlib stuff for encryption
>>m = hashlib.md5()
>>m.update(name+str(score)+secret_key)
>>real_hash = m.hexdigest()
>>
>>   #storing it into database
>>if real_hash == hash:
>># store the name and score into the database
>>leaderboard = Scores(name = request.POST['name'] ,score =
>> request.POST['score'])
>>leaderboard.save
>>
>>leaderboard = Scores.objects.all()
>>return render_to_response('add_score.html', {'leaderboard':
>> leaderboard})
>>
>>
>> This version does not do what i wanted it do. which is 1) Read the posted
>> data 2) Store it into database
>>
>> Any help would be appreciated.
>>
>> Thanks
>>
>> Dhruv Adhia
>> http://thirdimension.com
>>
>>
>>
>> On Thu, Oct 22, 2009 at 1:05 PM, Dhruv Adhia  wrote:
>>
>>> Allright, I get that part.
>>>
>>> the url is coming from unity
>>>
>>> javascript part inside unity
>>>
>>> the part in bold is doing the post data.
>>>
>>> private var secretKey="mySecretKey";
>>> function postScore(name, score) {
>>> //This connects to a server side php script that will add the name
>>> and score to a MySQL DB.
>>> // Supply it with a string representing the players name and the
>>> players score.
>>> var hash=Md5.Md5Sum(name +""+ score + ""+ secretKey);
>>>
>>> *var highscore_url = addScoreUrl + "name=" + WWW.EscapeURL(name) +
>>> "&score=" + score + "&hash=" + hash;
>>>
>>> // Post the URL to the site and create a download object to get the
>>> result.
>>> hs_post = WWW(highscore_url);*
>>> yield hs_post; // Wait until the download is done
>>> if(hs_post.error) {
>>> print("There was an error posting the high score: " +
>>> hs_post.error);
>>> }
>>> }
>>>
>>>
>>> >>
>>> $db = mysql_connect('mysql_host', 'mysql_user', 'mysql_password'
>>> ) or die <http://www.perldoc.com/perl5.6/pod/func/die.html>('Could not
>>> connect: ' . mysql_error());
>>> mysql_select_db('my_database') or 
>>> die<http://www.perldoc.com/perl5.6/pod/func/die.html>
>>> ('Could not select database');
>>>
>>> // Strings must be escaped to prevent SQL injection attack.
>>> $name = mysql_real_escape_string($_GET['name'], $db);
>>> $score = 

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
Just ignore past messages. I got successful posting of data from unity to
django localhost server. Now I am creating POST request from unity thats why
I am doing request.POST if condition.

I could see that through print statements inside this code

 if request.POST:
   name = request.POST['name']
   print name
   score = request.POST['score']
   print score
   hash = request.POST['hash']
   print hash

before there was no output. So now I am sure that I am getting values.

Can anybody help in storing name and score into database?

i have models setup as follows.

from django.db import models
# Create your models here.

class Scores(models.Model):
name = models.CharField(max_length=100)
score = models.IntegerField()

class Meta:
verbose_name_plural ="Scores"

Thanks a ton!

Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 2:54 PM, Dhruv Adhia  wrote:

> here is the version I thought should have worked, but its not quite there
>
> def add_score(request):
>#response_dict ={}
>secret_key = "asdf789as7df89asdf87ds89a8f7sfd8"
> name =""
> score=0
> hash=""
>
> # getting the posted data
>if request.GET:
>name = request.POST['name']
>print name
>score = request.POST['score']
>print score
>hash = request.POST['hash']
>print hash
>#leaderboard = {'name': name, 'score': score, 'hash': hash}
>
>  #hashlib stuff for encryption
>m = hashlib.md5()
>m.update(name+str(score)+secret_key)
>real_hash = m.hexdigest()
>
>   #storing it into database
>if real_hash == hash:
># store the name and score into the database
>leaderboard = Scores(name = request.POST['name'] ,score =
> request.POST['score'])
>leaderboard.save
>
>leaderboard = Scores.objects.all()
>return render_to_response('add_score.html', {'leaderboard':
> leaderboard})
>
>
> This version does not do what i wanted it do. which is 1) Read the posted
> data 2) Store it into database
>
> Any help would be appreciated.
>
> Thanks
>
> Dhruv Adhia
> http://thirdimension.com
>
>
>
> On Thu, Oct 22, 2009 at 1:05 PM, Dhruv Adhia  wrote:
>
>> Allright, I get that part.
>>
>> the url is coming from unity
>>
>> javascript part inside unity
>>
>> the part in bold is doing the post data.
>>
>> private var secretKey="mySecretKey";
>> function postScore(name, score) {
>> //This connects to a server side php script that will add the name and
>> score to a MySQL DB.
>> // Supply it with a string representing the players name and the
>> players score.
>> var hash=Md5.Md5Sum(name +""+ score + ""+ secretKey);
>>
>> *var highscore_url = addScoreUrl + "name=" + WWW.EscapeURL(name) +
>> "&score=" + score + "&hash=" + hash;
>>
>> // Post the URL to the site and create a download object to get the
>> result.
>> hs_post = WWW(highscore_url);*
>> yield hs_post; // Wait until the download is done
>> if(hs_post.error) {
>> print("There was an error posting the high score: " +
>> hs_post.error);
>> }
>> }
>>
>>
>> >
>> $db = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
>> or die <http://www.perldoc.com/perl5.6/pod/func/die.html>('Could not
>> connect: ' . mysql_error());
>> mysql_select_db('my_database') or 
>> die<http://www.perldoc.com/perl5.6/pod/func/die.html>
>> ('Could not select database');
>>
>> // Strings must be escaped to prevent SQL injection attack.
>> $name = mysql_real_escape_string($_GET['name'], $db);
>> $score = mysql_real_escape_string($_GET['score'], $db);
>> $hash = $_GET['hash'];
>>
>> $secretKey="mySecretKey"; # Change this value to match the value
>> stored in the client javascript below
>>
>>     $real_hash = md5($name . $score . $secretKey);
>> if($real_hash == $hash) {
>> // Send variables for the MySQL database class.
>> $query = "insert into scores values (NULL, '$name',
>> '$score');";
>> $result = mysql_query($query) or 
>> die<http://www.perldoc.com/perl5.6/pod/func/die.htm

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
here is the version I thought should have worked, but its not quite there

def add_score(request):
   #response_dict ={}
   secret_key = "asdf789as7df89asdf87ds89a8f7sfd8"
name =""
score=0
hash=""

# getting the posted data
   if request.GET:
   name = request.POST['name']
   print name
   score = request.POST['score']
   print score
   hash = request.POST['hash']
   print hash
   #leaderboard = {'name': name, 'score': score, 'hash': hash}

 #hashlib stuff for encryption
   m = hashlib.md5()
   m.update(name+str(score)+secret_key)
   real_hash = m.hexdigest()

  #storing it into database
   if real_hash == hash:
   # store the name and score into the database
   leaderboard = Scores(name = request.POST['name'] ,score =
request.POST['score'])
   leaderboard.save

   leaderboard = Scores.objects.all()
   return render_to_response('add_score.html', {'leaderboard': leaderboard})


This version does not do what i wanted it do. which is 1) Read the posted
data 2) Store it into database

Any help would be appreciated.

Thanks

Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 1:05 PM, Dhruv Adhia  wrote:

> Allright, I get that part.
>
> the url is coming from unity
>
> javascript part inside unity
>
> the part in bold is doing the post data.
>
> private var secretKey="mySecretKey";
> function postScore(name, score) {
> //This connects to a server side php script that will add the name and
> score to a MySQL DB.
> // Supply it with a string representing the players name and the
> players score.
> var hash=Md5.Md5Sum(name +""+ score + ""+ secretKey);
>
> *var highscore_url = addScoreUrl + "name=" + WWW.EscapeURL(name) +
> "&score=" + score + "&hash=" + hash;
>
> // Post the URL to the site and create a download object to get the
> result.
> hs_post = WWW(highscore_url);*
> yield hs_post; // Wait until the download is done
> if(hs_post.error) {
> print("There was an error posting the high score: " +
> hs_post.error);
> }
> }
>
>
> 
> $db = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
> or die <http://www.perldoc.com/perl5.6/pod/func/die.html>('Could not
> connect: ' . mysql_error());
> mysql_select_db('my_database') or 
> die<http://www.perldoc.com/perl5.6/pod/func/die.html>
> ('Could not select database');
>
> // Strings must be escaped to prevent SQL injection attack.
> $name = mysql_real_escape_string($_GET['name'], $db);
> $score = mysql_real_escape_string($_GET['score'], $db);
> $hash = $_GET['hash'];
>
> $secretKey="mySecretKey"; # Change this value to match the value
> stored in the client javascript below
>
> $real_hash = md5($name . $score . $secretKey);
> if($real_hash == $hash) {
> // Send variables for the MySQL database class.
> $query = "insert into scores values (NULL, '$name',
> '$score');";
> $result = mysql_query($query) or 
> die<http://www.perldoc.com/perl5.6/pod/func/die.html>
> ('Query failed: ' . mysql_error());
> }
>  ?>
>
> This is the php side of things that I found online. Basically I am trying
> to convert that to python code as you can see.
>
> I wrote the getting part of the data and the rest is what I am working on
> right now.
>
> It would be nice,
>
> if I could read values sent by unity(which is fine) and store them into
> database rather than just displaying.
>
> Thanks Karen.
>
> Dhruv Adhia
> http://thirdimension.com
>
>
>
> On Thu, Oct 22, 2009 at 12:46 PM, Karen Tracey  wrote:
>
>> On Thu, Oct 22, 2009 at 3:25 PM, Dhruv Adhia  wrote:
>>
>>> Yep and sorry I am bit new to this stuff, I mistook 69 for 200. This
>>> explained it
>>> http://cwiki.apache.org/GMOxSAMPLES/using-asynchronous-http-client.data/s200.log
>>>
>>> so for '?' then should my url pattern for add_Score look like this
>>>   (r'^add_score/?', 'carbon_chaos.highscore.views.add_score'),
>>>
>>>
>>>
>> No, query strings don't play any part in the url matching.  You might want
>> to add a $ to the end of your existing pattern, to indicate that the inbound
>> URL path must end after the slash after add_score...as it is your r

Re: displaying posted data

2009-10-22 Thread Dhruv Adhia
Allright, I get that part.

the url is coming from unity

javascript part inside unity

the part in bold is doing the post data.

private var secretKey="mySecretKey";
function postScore(name, score) {
//This connects to a server side php script that will add the name and
score to a MySQL DB.
// Supply it with a string representing the players name and the players
score.
var hash=Md5.Md5Sum(name +""+ score + ""+ secretKey);

*var highscore_url = addScoreUrl + "name=" + WWW.EscapeURL(name) +
"&score=" + score + "&hash=" + hash;

// Post the URL to the site and create a download object to get the
result.
hs_post = WWW(highscore_url);*
yield hs_post; // Wait until the download is done
if(hs_post.error) {
print("There was an error posting the high score: " +
hs_post.error);
}
}


http://www.perldoc.com/perl5.6/pod/func/die.html>('Could not
connect: '. mysql_error
());
mysql_select_db('my_database') or
die<http://www.perldoc.com/perl5.6/pod/func/die.html>
('Could not select database');

// Strings must be escaped to prevent SQL injection attack.
$name = mysql_real_escape_string($_GET['name'], $db);
$score = mysql_real_escape_string($_GET['score'], $db);
$hash = $_GET['hash'];

$secretKey="mySecretKey"; # Change this value to match the value
stored in the client javascript below

$real_hash = md5($name . $score . $secretKey);
if($real_hash == $hash) {
// Send variables for the MySQL database class.
$query = "insert into scores values (NULL, '$name', '$score');";

$result = mysql_query($query) or
die<http://www.perldoc.com/perl5.6/pod/func/die.html>
('Query failed: ' . mysql_error());
}
 ?>

This is the php side of things that I found online. Basically I am trying to
convert that to python code as you can see.

I wrote the getting part of the data and the rest is what I am working on
right now.

It would be nice,

if I could read values sent by unity(which is fine) and store them into
database rather than just displaying.

Thanks Karen.

Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 12:46 PM, Karen Tracey  wrote:

> On Thu, Oct 22, 2009 at 3:25 PM, Dhruv Adhia  wrote:
>
>> Yep and sorry I am bit new to this stuff, I mistook 69 for 200. This
>> explained it
>> http://cwiki.apache.org/GMOxSAMPLES/using-asynchronous-http-client.data/s200.log
>>
>> so for '?' then should my url pattern for add_Score look like this
>>   (r'^add_score/?', 'carbon_chaos.highscore.views.add_score'),
>>
>>
>>
> No, query strings don't play any part in the url matching.  You might want
> to add a $ to the end of your existing pattern, to indicate that the inbound
> URL path must end after the slash after add_score...as it is your requested
> URL is only matching because that $ is missing from your pattern, allowing
> any URL path that starts with add_score/ to get routed to your add_score
> view, even if there is more after the add_score/ element of the URL path.
>
> What you need to do to be able to access the query string values from the
> request.GET dictionary is change whatever is generating that URL to generate
> it properly, with the ? separating the URL path from the query string.  But
> near as I can tell you have not said anything about where that URL is coming
> from, so I don't know what to tell you tot fix.  You need the request coming
> in to the server to have the ? in its proper place, you do not need the ? in
> the pattern.
>
> Karen
>
> >
>

--~--~-~--~~~---~--~~
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: displaying posted data

2009-10-22 Thread Dhruv Adhia
Yep and sorry I am bit new to this stuff, I mistook 69 for 200. This
explained it
http://cwiki.apache.org/GMOxSAMPLES/using-asynchronous-http-client.data/s200.log

so for '?' then should my url pattern for add_Score look like this
  (r'^add_score/?', 'carbon_chaos.highscore.views.add_score'),


Thanks Karen.
Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 12:17 PM, Karen Tracey  wrote:

> On Thu, Oct 22, 2009 at 2:35 PM, Dhruv Adhia  wrote:
>
>> Allright, I see some progress, so now my views looks like this with that
>> little modification
>>
>> def add_score(request):
>>response_dict ={}
>>if request.POST:
>>name = request.POST['name']
>>score = request.POST['score']
>>hash = request.POST['hash']
>>response_dict = {'name': name, 'score': score, 'hash': hash}
>>return render_to_response('add_score.html', response_dict)
>>
>>
>> From unity I am getting scores and names and I am also posting it onto the
>> webserver. The getting part is fine as I could read it from the database.
>> But when I post , the server is getting the posted values but it also gives
>> 200 69 which is internal server error
>>
>>
> 200 is not internal server error, it is HTTP OK.  (500 is internal server
> error.) 69 is the number of bytes returned in the response.
>
>
>> here is what I see in terminal
>>
>> [22/Oct/2009 13:30:36] "GET
>> /add_score/name=carbon_chaos&score=100&hash=56ee224509ffd27920e64189cab9a06f
>> HTTP/1.1" 200 69
>> [22/Oct/2009 13:30:36] "GET /display_score/ HTTP/1.1" 200 187
>>
>
> This shows you are not posting the data, rather you are getting it.  The
> request says GET and the parameters you are looking for are almost encoded
> into a query string, except it's missing the leading ? which signals the end
> of the url path and the beginning of the query string.  How is that request
> being generated?  It should be:
>
> /add_score/?name=carbon_chaos&score=100&hash=56ee224509ffd27920e64189cab9a06f
>
>
> Without the ? the values will not be available in the request.GET
> dictionary, as they appear to be part of the URL path.
>
> Karen
>
> >
>

--~--~-~--~~~---~--~~
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: displaying posted data

2009-10-22 Thread Dhruv Adhia
ohk , corrected. But then why am I not getting to see the values on browser?
is it because the url pattern is not matching?

Thanks Daniel.
Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 12:05 PM, Daniel Roseman wrote:

>
> On Oct 22, 7:35 pm, Dhruv Adhia  wrote:
> > Allright, I see some progress, so now my views looks like this with that
> > little modification
> >
> > def add_score(request):
> >response_dict ={}
> >if request.POST:
> >name = request.POST['name']
> >score = request.POST['score']
> >hash = request.POST['hash']
> >response_dict = {'name': name, 'score': score, 'hash': hash}
> >return render_to_response('add_score.html', response_dict)
> >
> > From unity I am getting scores and names and I am also posting it onto
> the
> > webserver. The getting part is fine as I could read it from the database.
> > But when I post , the server is getting the posted values but it also
> gives
> > 200 69 which is internal server error
> >
> > here is what I see in terminal
> >
> > [22/Oct/2009 13:30:36] "GET
> >
> /add_score/name=carbon_chaos&score=100&hash=56ee224509ffd27920e64189cab9a06
> f
> > HTTP/1.1" 200 69
> > [22/Oct/2009 13:30:36] "GET /display_score/ HTTP/1.1" 200 187
> >
> > as you will see name = carbon_chaos and score=100 and some hash value...
> I
> > am posting those data from unity and when I load the scene I see that
> > activity happening inside the terminal. But it does not display the
> values
> > inside in the browser.
> >
> > What is the mistake?
> >
> > Thanks
> > Dhruv Adhiahttp://thirdimension.com
>
> You are using GET after all! As you can see from the console, it is a
> GET request, not a POST. So you should have been using request.GET
> ['whatever'] all along.
>
> I've no idea why you think '200 69' is an internal server error. On
> the contrary. The 200 part of that is the code for 'OK'. The 69 is
> just the length of the content that was returned.
> --
> DR.
> >
>

--~--~-~--~~~---~--~~
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: displaying posted data

2009-10-22 Thread Dhruv Adhia
Inside my urls,

I have the url pattern as

(r'^add_score/', 'carbon_chaos.highscore.views.add_score'), # for displaying
posted data from unity..

is the url pattern wrong?
Thanks
Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 11:35 AM, Dhruv Adhia  wrote:

> Allright, I see some progress, so now my views looks like this with that
> little modification
>
> def add_score(request):
>response_dict ={}
>if request.POST:
>name = request.POST['name']
>score = request.POST['score']
>hash = request.POST['hash']
>response_dict = {'name': name, 'score': score, 'hash': hash}
>return render_to_response('add_score.html', response_dict)
>
>
> From unity I am getting scores and names and I am also posting it onto the
> webserver. The getting part is fine as I could read it from the database.
> But when I post , the server is getting the posted values but it also gives
> 200 69 which is internal server error
>
> here is what I see in terminal
>
> [22/Oct/2009 13:30:36] "GET
> /add_score/name=carbon_chaos&score=100&hash=56ee224509ffd27920e64189cab9a06f
> HTTP/1.1" 200 69
> [22/Oct/2009 13:30:36] "GET /display_score/ HTTP/1.1" 200 187
>
> as you will see name = carbon_chaos and score=100 and some hash value... I
> am posting those data from unity and when I load the scene I see that
> activity happening inside the terminal. But it does not display the values
> inside in the browser.
>
> What is the mistake?
>
> Thanks
> Dhruv Adhia
> http://thirdimension.com
>
>
>
> On Thu, Oct 22, 2009 at 11:30 AM, Daniel Roseman wrote:
>
>>
>> On Oct 22, 7:19 pm, Dhruv Adhia  wrote:
>> > oops that was a typo.. thanks for pointing that out... Yep I see atleast
>> the
>> > html elements getting displayed like those arrows...
>> >
>> > on the views side I didnt get what f4nt meant.. can you show me an
>> example?
>> >
>>
>> You had it right in your reply to him: request.POST['name']
>>
>> request.GET['whatever'] is for elements that are passed in as GET
>> parameters, eg /myurl/?param1=value1
>> --
>> DR.
>> >>
>>
>

--~--~-~--~~~---~--~~
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: displaying posted data

2009-10-22 Thread Dhruv Adhia
Allright, I see some progress, so now my views looks like this with that
little modification

def add_score(request):
   response_dict ={}
   if request.POST:
   name = request.POST['name']
   score = request.POST['score']
   hash = request.POST['hash']
   response_dict = {'name': name, 'score': score, 'hash': hash}
   return render_to_response('add_score.html', response_dict)


>From unity I am getting scores and names and I am also posting it onto the
webserver. The getting part is fine as I could read it from the database.
But when I post , the server is getting the posted values but it also gives
200 69 which is internal server error

here is what I see in terminal

[22/Oct/2009 13:30:36] "GET
/add_score/name=carbon_chaos&score=100&hash=56ee224509ffd27920e64189cab9a06f
HTTP/1.1" 200 69
[22/Oct/2009 13:30:36] "GET /display_score/ HTTP/1.1" 200 187

as you will see name = carbon_chaos and score=100 and some hash value... I
am posting those data from unity and when I load the scene I see that
activity happening inside the terminal. But it does not display the values
inside in the browser.

What is the mistake?

Thanks
Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 11:30 AM, Daniel Roseman wrote:

>
> On Oct 22, 7:19 pm, Dhruv Adhia  wrote:
> > oops that was a typo.. thanks for pointing that out... Yep I see atleast
> the
> > html elements getting displayed like those arrows...
> >
> > on the views side I didnt get what f4nt meant.. can you show me an
> example?
> >
>
> You had it right in your reply to him: request.POST['name']
>
> request.GET['whatever'] is for elements that are passed in as GET
> parameters, eg /myurl/?param1=value1
> --
> DR.
> >
>

--~--~-~--~~~---~--~~
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: displaying posted data

2009-10-22 Thread Dhruv Adhia
oops that was a typo.. thanks for pointing that out... Yep I see atleast the
html elements getting displayed like those arrows...

on the views side I didnt get what f4nt meant.. can you show me an example?

Thanks
Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 11:05 AM, Daniel Roseman wrote:

>
> On Oct 22, 6:20 pm, Dhruv Adhia  wrote:
> > Hello,
> >
> > Quite a basic question.. I am posting data from Unity, its like name
> > and score. I want to read the posted data and display it.
> >
> > Here is the code that I currently have inside views.py
> >
> > def add_score(request):
> >response_dict ={}
> >if request.POST:
> >name = request.GET['name']
> >score = request.GET['score']
> >hash = request.GET['hash']
> >response_dict = {'name': name, 'score': score, 'hash': hash}
> >return render_to_response('add_score.html', response_dict)
> >
> > and template part
> >
> > Carbon Chaos leader board
> >
> > 
> > {% for carbon_chaos in response_dict %}
> > {{carbon_chaos.name}} >>> {{carbon_chaos.score}} >>>
> > {{carbon_chaos.hash}}
> > {% endfor %}
> >
> > Can somebody point out what is the mistake?
> >
> > Thanks,
> > Dhruv
>
> As well as the view issue noted by f4nt, there are two further
> mistakes in the template:
> * response_dict is not an element in the context, it's what you have
> called the context within your view. In the template itself, the
> context elements are the keys/values in that dictionary.
> * There is no 'carbon_chaos' item in your context, so it doesn't make
> sense to iterate through it.
>
> So the template should look like this:
> 
> {{name}} >>> {{score}} >>> {{hash}}
> 
> --
> DR.
> >
>

--~--~-~--~~~---~--~~
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: displaying posted data

2009-10-22 Thread Dhruv Adhia
do you mean name = request.POST['name'] ?

Thanks
Dhruv Adhia
http://thirdimension.com



On Thu, Oct 22, 2009 at 10:48 AM, f4nt  wrote:

>
> You're initting your variables from request.GET instead of
> request.POST.
>
> On Oct 22, 12:20 pm, Dhruv Adhia  wrote:
> > Hello,
> >
> > Quite a basic question.. I am posting data from Unity, its like name
> > and score. I want to read the posted data and display it.
> >
> > Here is the code that I currently have inside views.py
> >
> > def add_score(request):
> >response_dict ={}
> >if request.POST:
> >name = request.GET['name']
> >score = request.GET['score']
> >hash = request.GET['hash']
> >response_dict = {'name': name, 'score': score, 'hash': hash}
> >return render_to_response('add_score.html', response_dict)
> >
> > and template part
> >
> > Carbon Chaos leader board
> >
> > 
> > {% for carbon_chaos in response_dict %}
> > {{carbon_chaos.name}} >>> {{carbon_chaos.score}} >>>
> > {{carbon_chaos.hash}}
> > {% endfor %}
> >
> > Can somebody point out what is the mistake?
> >
> > Thanks,
> > Dhruv
>
> >
>

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



displaying posted data

2009-10-22 Thread Dhruv Adhia

Hello,

Quite a basic question.. I am posting data from Unity, its like name
and score. I want to read the posted data and display it.

Here is the code that I currently have inside views.py


def add_score(request):
   response_dict ={}
   if request.POST:
   name = request.GET['name']
   score = request.GET['score']
   hash = request.GET['hash']
   response_dict = {'name': name, 'score': score, 'hash': hash}
   return render_to_response('add_score.html', response_dict)


and template part

Carbon Chaos leader board


{% for carbon_chaos in response_dict %}
{{carbon_chaos.name}} >>> {{carbon_chaos.score}} >>>
{{carbon_chaos.hash}}
{% endfor %}


Can somebody point out what is the mistake?

Thanks,
Dhruv
--~--~-~--~~~---~--~~
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: optional username registration

2009-08-15 Thread Dhruv Adhia
yes I got it working. I override the User fields inside contrib.auth.models
and also override UserManager in which I removed username as one of the
necessary argument while calling 'create_user' method. Now I have call like
this

CustomUser.objects.create_user(# check for cleaned email,
 # check for cleaned
pasword)

This only logs in with email and password. I had ovveride certain other tags
in templates too.
Thanks for the reply.

Dhruv Adhia
http://thirdimension.com



On Sat, Aug 15, 2009 at 6:12 AM, Léon Dignòn  wrote:

>
> Sorry, I assumed you used django-registration. But the idea is the
> same until you did not set up an own user model. :)
>
> On Aug 15, 3:11 pm, Léon Dignòn  wrote:
> > django-registration uses the django.contrib.auth module which includes
> > the models.User model. in this model it is necessary to supply a
> > username, but not an e-mail address.
> >
> > I assume you want to authenticate users via the e-mail address, then
> > you'd simply copy the e-mail address into the username field until a
> > user decides to use another username.
> >
> > Léon
> >
> > On Aug 12, 11:59 pm, Dhruv Adhia  wrote:
> >
> >
> >
> > > Hello,
> >
> > > I have a registration system working and most of the code is pulled
> > > out from django code base. I would like to make username optional. Is
> > > there any shorter way?
> >
> > > Thanks
> > > Dhruv- Hide quoted text -
> >
> > - Show quoted text -
> >
>

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



optional username registration

2009-08-12 Thread Dhruv Adhia

Hello,

I have a registration system working and most of the code is pulled
out from django code base. I would like to make username optional. Is
there any shorter way?

Thanks
Dhruv
--~--~-~--~~~---~--~~
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: WAR creation problem

2009-08-03 Thread Dhruv Adhia
This means you dont have django. Go to shell and check if you have django by
importing the module and then checking its version.
Dhruv Adhia
http://thirdimension.com



On Mon, Aug 3, 2009 at 2:52 AM, Sumeet  wrote:

>
> Hi
>
> Can anyone help me creating WAR file of a Django project. Somewhere I
> realized we need Jython to do this. So I installed Jython on my
> machine and then tried to create WAR file using the following command
> from my project directory.
>
> jython manage.py war
>
>
> But its repeatedly showing me an error which looks like this :
>
>
> The system cannot find the file ☻
> .
> Traceback (most recent call last):
>  File "manage.py", line 2, in 
>from django.core.management import execute_manager
> ImportError: No module named django
>
> Kindly help.
>
> Thanks in advance :)
>
> >
>

--~--~-~--~~~---~--~~
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 1.1 release candidate now available

2009-07-21 Thread Dhruv Adhia
Go Django! Thanks to everybody and specially developers!
Dhruv Adhia
http://thirdimension.com



On Tue, Jul 21, 2009 at 7:35 PM, James Bennett wrote:

>
> Hi folks! Tonight we've pushed out the Django 1.1 release candidate,
> which is hopefully the last stepping-stone to the final 1.1 release.
> If you'd like to try it out, here's where you'll want to look:
>
> * Download instructions: http://www.djangoproject.com/download/
> * Release notes: http://docs.djangoproject.com/en/dev/releases/1.1-rc-1/
> * Blog post announcing the release:
> http://www.djangoproject.com/weblog/2009/jul/21/rc/
>
> If all goes well, we'll see you back here in one week's time for the
> final 1.1 release.
>
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of
> correct."
>
> >
>

--~--~-~--~~~---~--~~
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: I need to get psycopg2 installed on Mac OS X 10.5

2009-07-16 Thread Dhruv Adhia
Yep :)

also check
>>> psycopg2.__version__
'2.0.8 (dec mx dt ext pq3)'
(This is on ubuntu, but you should see version if its installed correctly)

Dhruv Adhia
http://thirdimension.com



On Thu, Jul 16, 2009 at 9:46 AM, Dave Everitt wrote:

>
> I've just done this after installing Postgresql (BTW and letting it
> mess with my OS X memory settings):
>
> Added path to .bash_login (or .bash_profile)
> export PATH="/Library/PostgreSQL/8.4/bin:$PATH"
>
> sudo easy_install psycopg2
> Password:
> Searching for psycopg2
> Reading http://pypi.python.org/simple/psycopg2/
> Reading http://initd.org/projects/psycopg2
> Reading http://initd.org/pub/software/psycopg/
> Best match: psycopg2 2.0.11
> Downloading http://initd.org/pub/software/psycopg/psycopg2-2.0.11.tar.gz
> Processing psycopg2-2.0.11.tar.gz
> Running psycopg2-2.0.11/setup.py -q bdist_egg --dist-dir /tmp/
> easy_install-jTbWWk/psycopg2-2.0.11/egg-dist-tmp-9HFHuM
> warning: no files found matching '*.html' under directory 'doc'
> warning: no files found matching 'MANIFEST'
> zip_safe flag not set; analyzing archive contents...
> Adding psycopg2 2.0.11 to easy-install.pth file
>
> Installed /Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/psycopg2-2.0.11-py2.6-macosx-10.3-i386.egg
> Processing dependencies for psycopg2
> Finished processing dependencies for psycopg2
>
> python
> >>>import psycopg2
> >>>
>
> Success?
>
> >
>

--~--~-~--~~~---~--~~
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-admin.py complains about missing DJANGO_SETTINGS_MODULE

2009-07-14 Thread Dhruv Adhia
Copy your app to site-packages folder and see if that works. If you dont
know where site-packages folder is , do 'which python' from command line and
you will get an idea.

Dhruv Adhia
http://thirdimension.com



On Tue, Jul 14, 2009 at 8:22 AM, Nate Reed  wrote:

> The admin tool is complaining about this environment variable, but I've
> never had this problem before on this box.  I'm not sure what's changed
> since the last time I used it.
>
> I tried specifying the path:
>
> $ django-admin.py syncdb --settings=mysite.settings
> Error: Could not import settings 'mysite.settings' (Is it on sys.path? Does
> it have syntax errors?): No module named mysite.settings
>
> What's the fix for this (short of modifying django-admin.py to add my
> project to the python import path)?
>
> I'm using django 1.0 (from SVN).
>
> Nate
>
>
> >
>

--~--~-~--~~~---~--~~
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: Receiving information

2009-07-04 Thread Dhruv Adhia
Nope I have not used it, Can you give me an example of it?

Thanks,

On Sat, Jul 4, 2009 at 9:01 AM, chefsmart  wrote:

>
> Did you try HttpRequest.raw_post_data
>
> Regards,
> CM.
>
> On Jul 3, 9:44 pm, Dhruv Adhia  wrote:
> > Hello All,
> >
> > I am trying to send information from iPhone to django app through
> > json.
> >
> > I got "Message" json block spitting in the form as below:
> >
> >  message json format
> >
> >  {
> > "Messages":  [
> > {
> > "id":1.2.3.n,
> > "Message": "some message"
> > }
> > 
> > 
> > ]
> > }
> >
> > Now on the django side on apache server all I see is this,
> >
> > {
> >  "Messages":   [  ]
> >
> > }
> >
> > In short I am not receiving the message, Here is the function that I
> > wrote in views.py
> > # I only want to receive the message therefore I am ignoring id
> > information
> > def message_json(request):
> > message_list=[]
> > try:
> > message_list = request.POST['Message']
> >     except:
> > pass
> > data_out = simplejson.dumps({"Messages":
> > message_list},sort_keys=False, indent=4)
> > return HttpResponse('\n'.join([l.rstrip() for l in
> > data_out.splitlines()]),mimetype ="text/javascript")
> >
> > Any thoughts?
> >
> > Thank you,
> > Dhruv
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: Best distro for django

2009-07-03 Thread Dhruv Adhia
I ve been PC user for almost a decade, getting enough frustration , I
shifted to mac osx and I am happy with it. Much less configuration required.
I ve just installed Linux Ubuntu yesterday. Lets see how it goes with Linux.


Cheers,

On Fri, Jul 3, 2009 at 2:41 PM, Evandro Viana  wrote:

> Debian or Slackware
> more
>
> the best for developer is OSX
>
>
>
> On Fri, Jul 3, 2009 at 6:28 PM, Tim Chase 
> wrote:
>
>>
>> > Looking for opinion of the best distro for a developer machine for
>> > django.
>> >
>> > I'm on ubuntu now, its going ok. I'm having keyboard issues, and
>> > wondering if I should put the time in on fixing it, or just ditch it
>> > for say, pc-bsd, if thats what the cool django kids are using.
>>
>> I've done Django development on multiple OSes and found 3 tiers
>> of experience:
>>
>> Top Tier: any Linux or BSD I've played with (Debian, Ubuntu,
>> OpenBSD).  I expect other variants will be equally facile (Red
>> Hat, Suse, Slack, Gentoo, PC BSD, FreeBSD, etc)
>>
>> Mid Tier:  Mac OS X -- Doable, but a few more hoops to jump
>> through.  Easiest since Python2.5's added built-in sqlite3 which
>> previously you had to build yourself
>>
>> Bottom Tier:  Win32.  It's feasible (especially once Python2.5
>> added sqlite3), but I've found this a notably more painful
>> experience than on the other two tiers of platforms.
>>
>>
>> I haven't tinkered with Solaris in *years* so I don't know
>> whether that would be top- or middle-tier.
>>
>>
>> However, once you've got the base configuration done, development
>> is pretty easy no matter where you do it.
>>
>> My $0.02
>>
>> -tim
>>
>>
>>
>>
>>
>> >>
>>


-- 
Dhruv Adhia
http://thirdimension.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
-~--~~~~--~~--~--~---



Receiving information

2009-07-03 Thread Dhruv Adhia

Hello All,

I am trying to send information from iPhone to django app through
json.

I got "Message" json block spitting in the form as below:

 message json format

 {
"Messages":  [
{
"id":1.2.3.n,
"Message": "some message"
}


]
}

Now on the django side on apache server all I see is this,

{
 "Messages":   [  ]
}

In short I am not receiving the message, Here is the function that I
wrote in views.py
# I only want to receive the message therefore I am ignoring id
information
def message_json(request):
message_list=[]
try:
message_list = request.POST['Message']
except:
pass
data_out = simplejson.dumps({"Messages":
message_list},sort_keys=False, indent=4)
return HttpResponse('\n'.join([l.rstrip() for l in
data_out.splitlines()]),mimetype ="text/javascript")

Any thoughts?

Thank you,
Dhruv


--~--~-~--~~~---~--~~
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: Tutorial 2 - Template Dirs

2009-06-30 Thread Dhruv Adhia
Look for .html files, they are your templates and find out where they are
then enter the whole path in template_dirs tuple.

On Tue, Jun 30, 2009 at 9:36 AM, Divesh Gidwani  wrote:

>
> So I have had a pretty smooth transition so far, but am now stuck when
> at the end of tutorial 2, it asks to specify my directory of tempaltes
> in the settings.py file under the template_dirs tuple.
>
> Where are the templates i created stored?
>
> Sorry, Newbie at Django, but looking to help out in the near future!
>
> Thanks,
> Divesh
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: TinyMCE django admin

2009-06-25 Thread Dhruv Adhia
Yep you got me :)
I am quite familier with django now, but haven't tried forms till now!!

Thanks!

On Thu, Jun 25, 2009 at 4:59 PM, Joost Cassee  wrote:

>
> On Jun 25, 7:08 pm, Dhruv Adhia  wrote:
>
> > I was just googling and came across all those old hacky ways to integrate
> > tinymce which I finally did yesterday. Its working. But yes if its
> something
> > builtin now I should go for that. However I dont know If I can easily
> change
> > the properties that way for the editor. Right now in the Hacky way I
> change
> > plugins,themes,skins stuff and it shows up the changes. Can we do this
> with
> > widgets?
>
> Yes, you can. Just slow down a little ;-) and read the django-tinymce
> documentation. You may also want to look at the Django forms
> documentation if you're new to Django. It is possible to set project-
> wide TinyMCE configuration options in settings.py and override them in
> the widget initializer.
>
> Regards,
>
> Joost
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: TinyMCE django admin

2009-06-25 Thread Dhruv Adhia
Hey Joost,

I was just googling and came across all those old hacky ways to integrate
tinymce which I finally did yesterday. Its working. But yes if its something
builtin now I should go for that. However I dont know If I can easily change
the properties that way for the editor. Right now in the Hacky way I change
plugins,themes,skins stuff and it shows up the changes. Can we do this with
widgets?

Thanks,

On Thu, Jun 25, 2009 at 12:38 AM, Joost Cassee  wrote:

>
> On Jun 24, 6:51 pm, Dhruv Adhia  wrote:
>
> > Second part is working.
>
> Great!
>
> > I am new to those firebug stuff. Can you guide me to docs?
>
> Firebug can be found at [1]. The docs are there as well. Basically you
> enable Javascript debugging for your site and watch for errors in the
> Firebug console.
>
> [1] http://getfirebug.com/
>
> Is there a reason why you are not using the django-tinymce widget to
> render the BlogPost.body field?
>
> Regards,
>
> Joost
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: Entering large chunk of data

2009-06-24 Thread Dhruv Adhia
Thanks guys,

I think Ill go with .import filename tablename
I have the table
sqlite> .schema promo_new
CREATE TABLE "promo_new" (
"id" integer NOT NULL PRIMARY KEY,
"title" varchar(200) NOT NULL,
"news_content" varchar(200) NOT NULL,
"pub_date" datetime NOT NULL
);
for news model suppose I want title = 'Some title' , content = 'some
content' and pub_date= '2009-06-22 12:33:30' till id 2000 (2000 rows)

How would I do that with import statement?

On Wed, Jun 24, 2009 at 11:45 AM, Carl Zmola  wrote:

>
> in sqlite3 (the sqlite3 shell), you can use .import to import data from
> a text file.  It works great.  You may need to change the separator.
> For a one time load, this is probably the easiest method.
>
> Dhruv Adhia wrote:
> > Hey,
> >
> > I would prefer second method as I am using sqlite3.
> >
> > Is this what you mean?
> > django-admin.py loaddata mydata.json , If so I how do I populate json
> file
> > such large amounts of data?
> >
> > Thanks,
> >
> > On Wed, Jun 24, 2009 at 10:48 AM, creecode  wrote:
> >
> >> Hello Dhruv,
> >>
> >> Two ways you can do this, that I know.  Use your databases' built in
> >> data import technique.  For example with MySql you can use LOAD DATA.
> >> Alternately you could use manage.py shell to run python code to load
> >> your data.
> >>
> >> Read about manage.py shell and dbshell here <
> >> http://docs.djangoproject.com/en/dev/ref/django-admin/ >.
> >>
> >> Toodle-looo...
> >> creecode
> >>
> >> On Jun 24, 10:23 am, Dhruv Adhia  wrote:
> >>
> >>> I have news field in django admin and I would like to enter 2000 news
> >>> items at once. May I know how to do it in shorter way?
> >>>
> >
> >
>
> --
> Carl Zmola
> czm...@woti.com
>
>
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: Entering large chunk of data

2009-06-24 Thread Dhruv Adhia
Hey,

I would prefer second method as I am using sqlite3.

Is this what you mean?
django-admin.py loaddata mydata.json , If so I how do I populate json file
such large amounts of data?

Thanks,

On Wed, Jun 24, 2009 at 10:48 AM, creecode  wrote:

>
> Hello Dhruv,
>
> Two ways you can do this, that I know.  Use your databases' built in
> data import technique.  For example with MySql you can use LOAD DATA.
> Alternately you could use manage.py shell to run python code to load
> your data.
>
> Read about manage.py shell and dbshell here <
> http://docs.djangoproject.com/en/dev/ref/django-admin/ >.
>
> Toodle-looo...
> creecode
>
> On Jun 24, 10:23 am, Dhruv Adhia  wrote:
>
> > I have news field in django admin and I would like to enter 2000 news
> > items at once. May I know how to do it in shorter way?
> >
>


-- 
Dhruv Adhia
http://thirdimension.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
-~--~~~~--~~--~--~---



Entering large chunk of data

2009-06-24 Thread Dhruv Adhia

Hello All,

I have news field in django admin and I would like to enter 2000 news
items at once. May I know how to do it in shorter way?

Thanks,
Dhruv
--~--~-~--~~~---~--~~
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: TinyMCE django admin

2009-06-24 Thread Dhruv Adhia
Allright Joost,

Second part is working. I am new to those firebug stuff. Can you guide me to
docs?

Thanks,

On Wed, Jun 24, 2009 at 6:34 AM, Joost Cassee  wrote:

>
> On Jun 24, 6:10 am, Dhruv Adhia  wrote:
> > Hello All,
> >
> > I have following under models.py
> >
> > from django.db import models
> > from django.contrib import admin
> > from tinymce import models as tinymce_models
> >
> > class BlogPost(models.Model):
> >
> > title = models.CharField(max_length=150)
> > body = models.TextField() #observe, thats how you get big
> > character field
> > timestamp = models.DateTimeField()
> >
> > class Meta:
> > ordering = ('-timestamp',)
> > class Admin:
> > list_display = ('title', 'timestamp')
> > js = ['tiny_mce/tiny_mce.js', 'js/textareas.js']
> >
> > class BlogPostAdmin(admin.ModelAdmin):
> > pass
> >
> > class MyModel(models.Model):
> > my_field = tinymce_models.HTMLField()
> >
> > admin.site.register(MyModel)
> > admin.site.register(BlogPost, BlogPostAdmin)
> >
> > As you can see I have followed all the settings. But I dont get the
> > editor for the textfield and also I HTMLfield does not work. Though I
> > am able to edit content inside HTML field and then in the front end
> > side I am not able to view it. It shows me all the tags.
>
> I cannot comment about your problem with the BlogPost model, as you
> are apparently setting up TinyMCE yourself. You may have to use
> Firebug to debug Javascript.
>
> As far as I can see, the MyModel HTMLField does exactly what it is
> supposed to. You write that the admin site works, and stores HTML in
> the field. You are seeing tags in your frontend (the raw HTML) because
> the field content is not marked safe. You may want to use the 'safe'
> filter. [1]
>
> [1] http://docs.djangoproject.com/en/dev/ref/templates/builtins/#safe
>
> Regards,
>
> Joost
> >
>


-- 
Dhruv Adhia
http://thirdimension.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
-~--~~~~--~~--~--~---



TinyMCE django admin

2009-06-23 Thread Dhruv Adhia

Hello All,

I have following under models.py

from django.db import models
from django.contrib import admin
from tinymce import models as tinymce_models


class BlogPost(models.Model):

title = models.CharField(max_length=150)
body = models.TextField() #observe, thats how you get big
character field
timestamp = models.DateTimeField()

class Meta:
ordering = ('-timestamp',)
class Admin:
list_display = ('title', 'timestamp')
js = ['tiny_mce/tiny_mce.js', 'js/textareas.js']

class BlogPostAdmin(admin.ModelAdmin):
pass

class MyModel(models.Model):
my_field = tinymce_models.HTMLField()

admin.site.register(MyModel)
admin.site.register(BlogPost, BlogPostAdmin)

As you can see I have followed all the settings. But I dont get the
editor for the textfield and also I HTMLfield does not work. Though I
am able to edit content inside HTML field and then in the front end
side I am not able to view it. It shows me all the tags.

Thanks,
Dhruv
--~--~-~--~~~---~--~~
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: psycopg2.OperationalError: fe_sendauth: no password supplied

2009-06-23 Thread Dhruv Adhia
I think combo of these links should help you,

http://hocuspokus.net/2008/05/install-postgresql-on-ubuntu-804
find out where pg_hba.conf

should be under your 8.3/main/ , I am not sure just find it out. This file
has all the permission stuff.

Also otherwise look at docs
http://www.postgresql.org/docs/current/static/libpq-pgpass.html

Happy debugging :)


On Tue, Jun 23, 2009 at 7:09 PM, Chris Haynes  wrote:

>
> I've just installed postgresql and psycopg2. I supplied a password in
> the postgres install, but don't know how to supply it to psycopg2:
>
>  ~/s/sd$ manage.py syncdb
> Traceback (most recent call last):
>  File "./manage.py", line 11, in 
>execute_manager(settings)
>  File "/users/home/system/lib/djangotrunk/django/core/management/
> __init__.py", line 347, in execute_manager
>utility.execute()
>  File "/users/home/system/lib/djangotrunk/django/core/management/
> __init__.py", line 295, in execute
>self.fetch_command(subcommand).run_from_argv(self.argv)
>  File "/users/home/system/lib/djangotrunk/django/core/management/
> base.py", line 195, in run_from_argv
>self.execute(*args, **options.__dict__)
>  File "/users/home/system/lib/djangotrunk/django/core/management/
> base.py", line 222, in execute
>output = self.handle(*args, **options)
>  File "/users/home/system/lib/djangotrunk/django/core/management/
> base.py", line 351, in handle
>return self.handle_noargs(**options)
>  File "/users/home/system/lib/djangotrunk/django/core/management/
> commands/syncdb.py", line 48, in handle_noargs
>cursor = connection.cursor()
>  File "/users/home/system/lib/djangotrunk/django/db/backends/
> __init__.py", line 62, in cursor
>cursor = self._cursor(settings)
>  File "/users/home/system/lib/djangotrunk/django/db/backends/
> postgresql_psycopg2/base.py", line 84, in _cursor
>self.connection = Database.connect(conn_string, **self.options)
> psycopg2.OperationalError: fe_sendauth: no password supplied
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: psycopyg setup error: no build_ext

2009-06-23 Thread Dhruv Adhia
I got my copy from the following site

http://www.initd.org/pub/software/psycopg/
and got it working smoothly for the purpose of geodjango app
the version I installed was
psycopg2-2.0.11.tar.gz<http://www.initd.org/pub/software/psycopg/psycopg2-2.0.11.tar.gz>

Cheers,

On Tue, Jun 23, 2009 at 6:47 PM, Chris Haynes  wrote:

>
> /opt/local/bin$ sudo port install py26-psycopg2
>
> worked, after an incredible number of (presumably dependent) installs.
>
> Now I'm getting a password error, but I'll post that separately as it
> deserves a different title.
>
> thanks
> Chris
>
>
> On Jun 23, 8:33 pm, James Martin  wrote:
> > I was never able to get psycopg2 to compile on osx I recommend
> > using sqlite for development or another database.  If you must use
> > psycopg2, you may want to try to get it through something like
> > darwinports.
> >
> > On Tue, Jun 23, 2009 at 1:19 PM, Chris Haynes
> wrote:
> >
> > > Using what I believe is the latest version of psycopyg, I get:
> >
> > > 509 ~/Desktop/psycopg2-2.0.9$ python setup.py build
> > > running build
> > > running build_py
> > > creating build
> > > creating build/lib.macosx-10.3-fat-2.6
> > > creating build/lib.macosx-10.3-fat-2.6/psycopg2
> > > copying lib/__init__.py -> build/lib.macosx-10.3-fat-2.6/psycopg2
> > > copying lib/errorcodes.py -> build/lib.macosx-10.3-fat-2.6/psycopg2
> > > copying lib/extensions.py -> build/lib.macosx-10.3-fat-2.6/psycopg2
> > > copying lib/extras.py -> build/lib.macosx-10.3-fat-2.6/psycopg2
> > > copying lib/pool.py -> build/lib.macosx-10.3-fat-2.6/psycopg2
> > > copying lib/psycopg1.py -> build/lib.macosx-10.3-fat-2.6/psycopg2
> > > copying lib/tz.py -> build/lib.macosx-10.3-fat-2.6/psycopg2
> > > running build_ext
> > > error: No such file or directory
> >
> > > and easy_install doesn't work either (seems like the same problem):
> >
> > > 510 ~/Desktop/psycopg2-2.0.9$ easy_install .
> > > Processing .
> > > Running setup.py -q bdist_egg --dist-dir /Users/home/Desktop/
> > > psycopg2-2.0.9/egg-dist-tmp-mYsMSq
> > > error: Setup script exited with error: No such file or directory
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: running into problems with polls tutorial

2009-06-21 Thread Dhruv Adhia
Did you import the module in urls.py?

On Sun, Jun 21, 2009 at 5:38 AM, tekion  wrote:

>
> Hi,
> I am getting the below error:
> ViewDoesNotExist at /polls/
>
> Could not import play_django.polls.views. Error was: No module named
> unresolvers
>
> Request Method: GET
> Request URL:http://127.0.0.1:8000/polls/
> Exception Type: ViewDoesNotExist
> Exception Value:
>
> Could not import play_django.polls.views. Error was: No module named
> unresolvers
>
> I am stump becuase the views.py does exist under polls and index
> function does exist in views.py.  Why is it having problem importing
> it?
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: Installation error

2009-06-20 Thread Dhruv Adhia

Does not matter where you install them
Did you run python setup.py install from inside django dir?

Sent from my iPhone

On 19-Jun-09, at 5:18 PM, 78fxs  wrote:

>
> All righty...not only am i new to django and python, i am new to using
> the terminal on my mac. so this is going to be mickey mouse stuff.
>
> i have a few things going on:
>
> 1. i think some of my confusion is knowing where these django and
> python folders should be. after i install python and django, should i
> move the "djanjo-1.0.2-final" and "python 2.6.2" folders to my
> applications folder?
>
> 2. when i installed django i was told that permission was denied to
> create /usr/local/bin. i think that is creating a problem for me now.
> at one point as i tried to troubleshoot the problem below, i manually
> created the directories: ~user/usr/local/bin . Now, that's not where
> my Python or django folders are - they're in the applications folder.
> i don't know if that helped or just screwed it up. is usr/local/bin
> supposed to be in my root user directory?
>
> 3. when i type the command "django-admin.py startproject mysite" i get
> command not found. i believe that is due to django-admin.py not being
> on my system path (page 14 of the django book). so, i need to use this
> "sudo ln ... " command, right? i found out out where my python site
> directory is, using this command from Webmonkey:
> python -c "from distutils.sysconfig import get_python_lib; print
> get_python_lib()"
>
> I get this result: /Library/Python/2.5/site-packages
>
> I've tried a bunch of ways to do the sudo ln command but i can't get
> it to work. sometimes it says "file already exists" and other times
> "no such user or directory" or an "illegal option." what is the
> correct way to enter that command? And do i need to enter my password
> for that command, as the Webmonkey tutorial says?
>
> By the way,
> when i type echo $PATH i get:
> /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
>
> No idea what that means.
>
> I realize this is a bit of a mess. But this is what it's like to start
> out I guess.
>
> Thanks for your assistance.
>
> Steve
>
> >

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



configuring postgresql_psycopg2 with geodjango

2009-06-18 Thread Dhruv Adhia

Hello,

I tried installing and running geodjango and went into some troubles.
I am fairly new to django.

I tried following the docs out here
http://geodjango.org/docs/install.html and got stuck on postgis part
and was not able to proceed further
 ./configure --datadir=`pg_config --sharedir` (dont know how to
configure postgis with postgres with this info)
However I have postgres installed at Library/PostgreSQL/8.3/share/ and
replaced sharedir with this part
./configure --datadir=`pg_config --Library/PostgreSQL/8.3/share/`

Apart from that createdb command does not work which means Postgres
itself is not installed properly.

Finally I knew running python manage.py sqlall db will give me this
error
Error loading psycopg2 module: No module named psycopg2
It's the same world geodjango tutorial that I am trying to run.

Thank you,
Dhruv
--~--~-~--~~~---~--~~
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 nginx fastcgi and flup

2009-06-12 Thread Dhruv Adhia
Hello Matt,

Couple of days back I tried firing django app on fcgi server through runfcgi
command. As indicated I installed flup packages and did python path settings
as usual and when I run it I dont get any message that its running on so and
so server and neither does it runs the server. Is it something similar?



On Fri, Jun 12, 2009 at 10:30 AM, Matt Davies  wrote:

> Hello everyone
> I'm going to write down a quite complex problem I'm having that I'm having
> trouble debugging, but before I start has anyone noticed any strange
> behaviour using django nginx fastcgi and flup recently?
>
> If there is an obvious problem that I haven't heard about then any links
> I"d be grateful
>
> I'll post the problem back to this forum as I work though it, it might help
> someone out.
>
> Hopefully me :-)
>
>
>
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: Running django app on apache server

2009-06-10 Thread Dhruv Adhia
So I finished editing httpd.conf file as mentioned here
http://docs.djangoproject.com/en/dev/howto/deployment/modpython/
I also have web sharing turned on from system preferences. I have django
project called myPollsApp and I would like to now see it on apache server.
How do I proceed further?

On Wed, Jun 10, 2009 at 2:51 PM, Dhruv Adhia  wrote:

> ok found it!
>
> On Wed, Jun 10, 2009 at 2:35 PM, Dhruv Adhia  wrote:
>
>> I have installed mod_python and I on my way to edit httpd.conf but could
>> not find the file. May I know where can I find it?
>>
>> Thanks,
>>
>>
>> On Wed, Jun 10, 2009 at 1:20 PM, Dhruv Adhia  wrote:
>>
>>> Thanks Alex.
>>>
>>>
>>> On Wed, Jun 10, 2009 at 1:15 PM, Alex Gaynor wrote:
>>>
>>>>
>>>>
>>>> On Wed, Jun 10, 2009 at 3:13 PM, Dhruv Adhia  wrote:
>>>>
>>>>>
>>>>> Hello,
>>>>>
>>>>> Can anybody explain me how would I run django app on apache server
>>>>> other than development server?
>>>>>
>>>>> Thank you,
>>>>> Dhruv
>>>>>
>>>>>
>>>> I suggest you read the documentation on how to deploy django:
>>>> http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index
>>>>
>>>> Alex
>>>>
>>>> --
>>>> "I disapprove of what you say, but I will defend to the death your right
>>>> to say it." --Voltaire
>>>> "The people's good is the highest law."--Cicero
>>>>
>>>>
>>>> >>>>
>>>>
>>>
>>>
>>> --
>>> Dhruv Adhia
>>> http://thirdimension.com
>>>
>>>
>>
>>
>> --
>> Dhruv Adhia
>> http://thirdimension.com
>>
>>
>
>
> --
> Dhruv Adhia
> http://thirdimension.com
>
>


-- 
Dhruv Adhia
http://thirdimension.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: Running django app on apache server

2009-06-10 Thread Dhruv Adhia
ok found it!

On Wed, Jun 10, 2009 at 2:35 PM, Dhruv Adhia  wrote:

> I have installed mod_python and I on my way to edit httpd.conf but could
> not find the file. May I know where can I find it?
>
> Thanks,
>
>
> On Wed, Jun 10, 2009 at 1:20 PM, Dhruv Adhia  wrote:
>
>> Thanks Alex.
>>
>>
>> On Wed, Jun 10, 2009 at 1:15 PM, Alex Gaynor wrote:
>>
>>>
>>>
>>> On Wed, Jun 10, 2009 at 3:13 PM, Dhruv Adhia  wrote:
>>>
>>>>
>>>> Hello,
>>>>
>>>> Can anybody explain me how would I run django app on apache server
>>>> other than development server?
>>>>
>>>> Thank you,
>>>> Dhruv
>>>>
>>>>
>>> I suggest you read the documentation on how to deploy django:
>>> http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index
>>>
>>> Alex
>>>
>>> --
>>> "I disapprove of what you say, but I will defend to the death your right
>>> to say it." --Voltaire
>>> "The people's good is the highest law."--Cicero
>>>
>>>
>>> >>>
>>>
>>
>>
>> --
>> Dhruv Adhia
>> http://thirdimension.com
>>
>>
>
>
> --
> Dhruv Adhia
> http://thirdimension.com
>
>


-- 
Dhruv Adhia
http://thirdimension.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: Running django app on apache server

2009-06-10 Thread Dhruv Adhia
I have installed mod_python and I on my way to edit httpd.conf but could not
find the file. May I know where can I find it?

Thanks,

On Wed, Jun 10, 2009 at 1:20 PM, Dhruv Adhia  wrote:

> Thanks Alex.
>
>
> On Wed, Jun 10, 2009 at 1:15 PM, Alex Gaynor wrote:
>
>>
>>
>> On Wed, Jun 10, 2009 at 3:13 PM, Dhruv Adhia  wrote:
>>
>>>
>>> Hello,
>>>
>>> Can anybody explain me how would I run django app on apache server
>>> other than development server?
>>>
>>> Thank you,
>>> Dhruv
>>>
>>>
>> I suggest you read the documentation on how to deploy django:
>> http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index
>>
>> Alex
>>
>> --
>> "I disapprove of what you say, but I will defend to the death your right
>> to say it." --Voltaire
>> "The people's good is the highest law."--Cicero
>>
>>
>> >>
>>
>
>
> --
> Dhruv Adhia
> http://thirdimension.com
>
>


-- 
Dhruv Adhia
http://thirdimension.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: Running django app on apache server

2009-06-10 Thread Dhruv Adhia
Thanks Alex.

On Wed, Jun 10, 2009 at 1:15 PM, Alex Gaynor  wrote:

>
>
> On Wed, Jun 10, 2009 at 3:13 PM, Dhruv Adhia  wrote:
>
>>
>> Hello,
>>
>> Can anybody explain me how would I run django app on apache server
>> other than development server?
>>
>> Thank you,
>> Dhruv
>>
>>
> I suggest you read the documentation on how to deploy django:
> http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
>
>
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: {% url %} in conjunction with context variable

2009-06-10 Thread Dhruv Adhia
url

Returns an absolute URL matching given view with its parameters.

Documentation for using url tag

This is a way to define links that aren't tied to a particular URL
configuration:

{% url path.to.some_view arg1,arg2,name1=value1 %}

The first argument is a path to a view. It can be an absolute python path or
just app_name.view_name without the project name if the view is located
inside the project. Other arguments are comma-separated values that will be
filled in place of positional and keyword arguments in the URL. All
arguments for the URL should be present.

For example if you have a view app_name.client taking client's id and the
corresponding line in a URLconf looks like this:

('^client/(\d+)/$', 'app_name.client')

and this app's URLconf is included into the project's URLconf under some
path:

('^clients/', include('project_name.app_name.urls'))

then in a template you can create a link for a certain client like this:

{% url app_name.client client.id %}

The URL will look like /clients/client/123/.
Note: you can uncomment admin/doc part from urls.view to see the docs.

On Wed, Jun 10, 2009 at 12:02 PM, Margie  wrote:

>
> I'm trying to figure out how to use the {% url %} tag in conjunction
> with a context variable.  For example, I have the context variable
> 'app_name' available in my template, and I'd like to do something like
> this:
>
> List {{app_name}}
>
> Anyone know how to do this?
>
> Margie
> >
>


-- 
Dhruv Adhia
http://thirdimension.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
-~--~~~~--~~--~--~---



Running django app on apache server

2009-06-10 Thread Dhruv Adhia

Hello,

Can anybody explain me how would I run django app on apache server
other than development server?

Thank you,
Dhruv
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



image upload

2009-06-09 Thread Dhruv Adhia

Hello,

I am new to django, any help would be appreciated.
I got admin backend part working
class Thing(models.Model):
poll = models.ForeignKey(Poll) # assigning specific image for each
question
name = models.CharField(blank=False, null=False, max_length=30)
photo = models.ImageField(upload_to='media/photos', blank=True,
null=True)

so where does it upload the photo to(where do i see it on frontend
side?)? localhost:8000/media/photos/ ? i tried that and it says page
does not exist saying "Page not found: /Library/Frameworks/
Python.framework/Versions/2.5/lib/python2.5/site-packages/django/
contrib/admin/media/photos"

Thank you,
Dhruv
--~--~-~--~~~---~--~~
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 Tutorial 3 for beginners: What's wrong with the detail.html?

2009-06-09 Thread Dhruv Adhia
I would suggest you create template directory inside your project. Otherwise
Daniel's point is correct.

On Tue, Jun 9, 2009 at 4:44 AM, Daniel Roseman <
roseman.dan...@googlemail.com> wrote:

>
> On Jun 9, 11:21 am, Jipe  wrote:
> > Hi all,
> > I 'm trying to use the Django Tutorial 3 for beginners.
> > I've met some problems.
> > Until you have to work with the template and index.html, it's ok
> > But when i try to make appear detail.html who is in the same template
> > directory as index.html, no way...
> > It tolds me page not found...
> > I really don't understand.
> > If someone have a answer, i 'll appreciate.
> > I m' working on windows xp...i know...:p
> > Thanks
> >
> > Here is my view.py
> >
> > from django.shortcuts import render_to_response
> > from mysite.polls.models import Poll
> > from django.http import Http404
> > # ...
> > def detail(request, poll_id):
> > try:
> > p = Poll.objects.get(pk=poll_id)
> > except Poll.DoesNotExist:
> > raise Http404
> > return render_to_response('polls/detail.html', {'poll': p})
> >
> > def index(request):
> > latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5]
> > return render_to_response('polls/index.html', {'latest_poll_list':
> > latest_poll_list})
> >
> > *
> > Url.py from django.conf.urls.defaults import *
> >
> > # Uncomment the next two lines to enable the admin:
> > from django.contrib import admin
> > admin.autodiscover()
> >
> > urlpatterns = patterns('',
> >
> > (r'^polls/(?P\d+)/$', 'mysite.polls.views.detail'),
> > (r'^polls/$', 'mysite.polls.views.index'),
> > (r'^polls/(?P\d+)/results/$',
> > 'mysite.polls.views.results'),
> > (r'^polls/(?P\d+)/vote/$', 'mysite.polls.views.vote'),
> >
> > (r'^admin/', include(admin.site.urls)),
> > )
> >
>
> Assuming you're going to the 'detail' view via  a URL like /polls/2/,
> I'd guess that the poll with the ID you're entering does not exist, so
> you're hitting the 'raise Http404' line.
> --
> DR.
> >
>


-- 
Dhruv Adhia
http://thirdimension.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: image upload

2009-06-07 Thread Dhruv Adhia
It seems bit confusing for me.

When I create image field for example

question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')

#an image to displayed here
   logo = models.ImageField(upload_to="images/logos/", blank=True,
help_text="Should be 50px wide")
   It gives me error and asks me to install PIL library which I did install
using python setup.py install command from directory

Can somebody provide simple solution for this?
Ill repeat my question my again, I want to have a field in backend for
image. So I will upload image from backend and it will show up in frontend.

Thank you,


On Fri, Jun 5, 2009 at 4:33 PM, Dhruv Adhia  wrote:

> Yep Ill try and see if it works.
>
> Thank you!
>
>
> On Fri, Jun 5, 2009 at 3:32 PM, Antoni Aloy  wrote:
>
>>
>> 2009/6/5 Dhruv Adhia :
>> >
>> > I am new to django and was searching for thorough tutorial for image
>> > upload.
>> >
>> > What I want to do is add image upload field in backend and after
>> > uploading image from admin section it shows in frontend
>> >
>> like this
>> http://code.google.com/p/appfusedjango/source/browse/#svn/trunk/thumbs_prj
>> ?
>>
>>
>> --
>> Antoni Aloy López
>> Blog: http://trespams.com
>> Site: http://apsl.net
>>
>> >>
>>
>
>
> --
> Dhruv Adhia
> http://thirdimension.com
>
>


-- 
Dhruv Adhia
http://thirdimension.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: image upload

2009-06-05 Thread Dhruv Adhia
Yep Ill try and see if it works.

Thank you!

On Fri, Jun 5, 2009 at 3:32 PM, Antoni Aloy  wrote:

>
> 2009/6/5 Dhruv Adhia :
> >
> > I am new to django and was searching for thorough tutorial for image
> > upload.
> >
> > What I want to do is add image upload field in backend and after
> > uploading image from admin section it shows in frontend
> >
> like this
> http://code.google.com/p/appfusedjango/source/browse/#svn/trunk/thumbs_prj
> ?
>
>
> --
> Antoni Aloy López
> Blog: http://trespams.com
> Site: http://apsl.net
>
> >
>


-- 
Dhruv Adhia
http://thirdimension.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
-~--~~~~--~~--~--~---



image upload

2009-06-05 Thread Dhruv Adhia

I am new to django and was searching for thorough tutorial for image
upload.

What I want to do is add image upload field in backend and after
uploading image from admin section it shows in frontend

Thank you,
Dhruv Adhia



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