"Beginning Geo Django: Rich Gis Web Applications With Python" Where can I get the book?

2014-02-21 Thread Ram Shrestha
Dear All,
I am want to learn GeoDjango in real world application. I believe this book 
"Beginning Geo Django: Rich Gis Web Applications With Python" is the best 
book for me. But I could not download download it. 

If anyone have this book Please share the book with me. Where can I get it 
for free! 

-- 
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/128e65b9-5e30-49e8-b142-f1901f992a96%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: "Beginning Geo Django: Rich Gis Web Applications With Python" Where can I get the book?

2014-02-21 Thread Tom Evans
On Fri, Feb 21, 2014 at 10:15 AM, Ram Shrestha  wrote:
> Dear All,
> I am want to learn GeoDjango in real world application. I believe this book
> "Beginning Geo Django: Rich Gis Web Applications With Python" is the best
> book for me. But I could not download download it.
>
> If anyone have this book Please share the book with me. Where can I get it
> for free!

If the author or publisher does not make this book available as a free
download, it is not appropriate to use this list to try to pirate it.

Doing so discourages future authors and publishers from writing books
about Django.


Cheers

Tom

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


Re: "Beginning Geo Django: Rich Gis Web Applications With Python" Where can I get the book?

2014-02-21 Thread Sandro Dutra
Buy the book and don't be fool!


2014-02-21 10:02 GMT-03:00 Tom Evans :

> On Fri, Feb 21, 2014 at 10:15 AM, Ram Shrestha 
> wrote:
> > Dear All,
> > I am want to learn GeoDjango in real world application. I believe this
> book
> > "Beginning Geo Django: Rich Gis Web Applications With Python" is the best
> > book for me. But I could not download download it.
> >
> > If anyone have this book Please share the book with me. Where can I get
> it
> > for free!
>
> If the author or publisher does not make this book available as a free
> download, it is not appropriate to use this list to try to pirate it.
>
> Doing so discourages future authors and publishers from writing books
> about Django.
>
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFHbX1KcDx05ebasmcJFdEaumVm6Wf4Gxmc23DNobjCnz5ZPBQ%40mail.gmail.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/CAH%2Bpf9%3DNkG9-5Q%3D_MpPB43MXEJ%3Dc_uUzRRQbVWnhiQB78jSzFA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Printing things to the server console in Django?

2014-02-21 Thread wasingej
Hi guys.  I'm pretty new to Django and I'm trying to figure out how I can 
print out information to my console that I started my web application on 
using "python manage.py runserver".

Thanks,
Jared

-- 
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/bb6c3e9d-c0b3-4acc-9481-612c29ae41a1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django Admin - search_fields + related fields

2014-02-21 Thread Camilo Torres
On Thursday, February 20, 2014 4:58:59 PM UTC-4:30, Ivan Goncalves wrote:
>
> I have these two models below: 
>
> class business(models.Model):
> name=models.CharField(max_length=40, blank=True, null=True)
> 
> class phone(models.Model):
> business=models.ForeignKey(business, 
> verbose_name='Business',blank=False)
> phone=models.CharField(max_length=40, blank=True, null=True)
>
> in the admin.py
>
> class businessAdmin(admin.ModelAdmin):
> model=business
> search_fields = phone__phone
>
> How do we make this search work fine ? Ie, bring me all companies that 
> possess the phone number entered by the User in the search of the form 
> (Admin). ?
>

 Hello,

search_fields is a list of names (strings), so you must put:

search_fields = ['phone__phone']

You can also add more field names to this list for the search to include 
those fields. See your same example, working, here:
https://gist.github.com/camilotorresf/9143399

Regards,
Camilo 

-- 
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/acab39de-87b6-460f-868f-ac5269782b49%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Printing things to the server console in Django?

2014-02-21 Thread Brad Pitcher
print("information")

-
Brad Pitcher


On Fri, Feb 21, 2014 at 1:00 PM, wasingej wrote:

> Hi guys.  I'm pretty new to Django and I'm trying to figure out how I can
> print out information to my console that I started my web application on
> using "python manage.py runserver".
>
> Thanks,
> Jared
>
> --
> 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/bb6c3e9d-c0b3-4acc-9481-612c29ae41a1%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/CAMFpZriode-qcfQ0CFso1TVm2x575-Tzp%2BD%3Dwq1cFRFpyhck_A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: API rest for https://docs.djangoproject.com/en/dev/intro/tutorial01/ help

2014-02-21 Thread Camilo Torres
On Thursday, February 20, 2014 6:23:27 PM UTC-4:30, Antonio Villavicencio 
wrote:
>
> I am trying just to do an API REST with the project of:
> https://docs.djangoproject.com/en/dev/intro/tutorial01/
>
> specifically with the model of Question
>
> class Question(models.Model):
> question_text = models.CharField(max_length=200)
> pub_date = models.DateTimeField('date published')
>
> class Choice(models.Model):
> question = models.ForeignKey(Question)
> choice_text = models.CharField(max_length=200)
> votes = models.IntegerField(default=0)
>
>
> I want to apply a serializer with question's choices but I don't know how 
> to do it
>
> class QuestionSerializer(serializers.HyperlinkedModelSerializer):
> class Meta:
> model = Question
> fields = (*'id', 'question_text'*, ? ) 
>
>
> I need some suggestion to solve this problem.
>

Should you append 'choices' to the list?

Regards,

Camilo.

-- 
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/9009490e-04c7-4031-908f-b3be4296fbde%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Printing things to the server console in Django?

2014-02-21 Thread Camilo Torres
On Friday, February 21, 2014 4:30:11 PM UTC-4:30, wasingej wrote:
>
> how I can print out information to my console that I started my web 
> application on using "python manage.py runserver".
>

Hello

With runserver you can use print() function calls, like:

print("Some output")

Regard 

-- 
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/2a7d6273-87e7-4f23-bc35-cfeece4eed3f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django test client encoding of JSON Booleans

2014-02-21 Thread Daniel Smith
I'm using Django version 1.5.5. Here is a short snippet of the test I'm 
writing:

from django.test import TestCase

class MyTest(TestCase):

  def my_test(self):
url = ... location of my view ...
self.client.post(url, data={'active': False}, format='json')


The problem I'm running into is that when I inspect request.POST inside my 
view, I get: {'active': [u'False']}. The workaround I have right now is to 
use json.loads(request.raw_post_data), but I'm wondering if this is a bug 
or if I am just missing something. Any help would be greatly appreciated.

-- 
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/3d786ca3-a9b6-4a44-8ba3-aead63a135e1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Apache with mod_wsgi not serving static files

2014-02-21 Thread Bryan P
Hello all,

My Django application is not serving my static files (CSS, JS) and keeps 
returning a 404 error. I have set the STATIC_ROOT to the location where I 
collected all my static files with manage.py and set an alias in my 
VirtualHost. 


Here is my Settings.py

Here is my VirtualHost file

Here is the 404 file




and the url it's trying to retrieve them from i

fixtracker.com/static/BugFixTracker/main.css


This is running in production with debug set to False, so it shouldn't be 
relying on Django to distribute the files. Any help is much appreciated. 

-- 
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/d1a06619-f388-4b7f-a687-36e4d2fcbd6f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Can't figure out how to attach file to email using EmailMessage

2014-02-21 Thread Patrick Beeson
Good morning y'all!

I'm having a heck of a time figuring out what I'm doing wrong in attaching 
a file uploaded via a ModelForm to an email that's sent if the form is 
valid. Here's a link to my code on Stackoverflow: 
http://stackoverflow.com/questions/21938849/inmemoryuploadedfile-object-has-no-attribute-rfind-when-sending-email-with-a

Thanks 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 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/e9973fcb-099f-40ce-9ee7-820eda3d664f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Can't figure out how to attach file to email using EmailMessage

2014-02-21 Thread Tom Evans
On Fri, Feb 21, 2014 at 4:28 PM, Patrick Beeson  wrote:
> Good morning y'all!
>
> I'm having a heck of a time figuring out what I'm doing wrong in attaching a
> file uploaded via a ModelForm to an email that's sent if the form is valid.
> Here's a link to my code on Stackoverflow:
> http://stackoverflow.com/questions/21938849/inmemoryuploadedfile-object-has-no-attribute-rfind-when-sending-email-with-a
>
> Thanks for your help!
>   resume = form.cleaned_data.get('resume')
>
>   #Compose message
>   email = EmailMessage()
>   email.body = '...'
>   email.subject = 'A new application has been submitted'
>   email.from_email = 'Job application '
>   email.to = ['em...@email.com',]
>   email.attach_file(resume)

EmailMessage.attach_file() takes the path to a file on disk, not a
django.core.files.File subclass.

You may want to use EmailMessage.attach(), which takes a filename (as
listed in the email, not used for anything else), the contents of the
file as a string, and the content type of the file.

Both are documented here:

https://docs.djangoproject.com/en/1.6/topics/email/#the-emailmessage-class

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1JywdF-tyyF4jzqCKvs3D9ekx8-fVxKaWo4PH1i2D%3Dp-g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Apache with mod_wsgi not serving static files

2014-02-21 Thread Alex Mandel
On 02/21/2014 04:00 PM, Bryan P wrote:
> Hello all,
> 
> My Django application is not serving my static files (CSS, JS) and keeps 
> returning a 404 error. I have set the STATIC_ROOT to the location where I 
> collected all my static files with manage.py and set an alias in my 
> VirtualHost. 
> 
> 
> Here is my Settings.py
> 
> Here is my VirtualHost file
> 
> Here is the 404 file
> 
> 
> 
> 
> and the url it's trying to retrieve them from i
> 
> fixtracker.com/static/BugFixTracker/main.css
> 
> 
> This is running in production with debug set to False, so it shouldn't be 
> relying on Django to distribute the files. Any help is much appreciated. 
> 

How are you referencing the static in your template? Looks like a
mismatch in path. BugFixTracker isn't in /static according to your vhost
file. So shouldn't the url be:

fixtracker.com/static/main.css

Thanks,
Alex

-- 
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/530801F1.5090300%40wildintellect.com.
For more options, visit https://groups.google.com/groups/opt_out.