Re: Facebook like button in django

2012-10-11 Thread Tomas Neme
You should probably start by reading this:

http://developers.facebook.com/docs/reference/plugins/like/

-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
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: Facebook like button in django

2012-10-11 Thread Matteo Suppo
You want to add a Facebook share button that lets people share things on 
Facebook but also save what they are sharing on your database?

On Thursday, October 11, 2012 9:50:54 PM UTC+2, David Gomez wrote:
>
> How can I create a Facebook Share button in django? I would like something 
> like this:
> button name my_website
> When user click the button it would pop up a window with a form
> When user click the button, it will grab the form information and the 
> information on the blog, and put it on the database like it would do on a 
> regular form. 
> The form will have:
> username = username
> password = password
> note = what ever note the user type
> blog = the blog where the button was in.
>
> Thanks in advance
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Y6vastIH-iEJ.
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: Facebook like button in django

2012-10-11 Thread David Gomez
This is not going to work, because let see if you have a blog and I want 
you to use a button in each entry as a share button, you are going to need 
to intall bootstrap? I want something simple for the blog, website etc... 
Maybe I'm confuse since I'm new in programming. 

On Thursday, October 11, 2012 4:33:59 PM UTC-4, GGC on Django wrote:
>
> You can start here 
>
> http://twitter.github.com/bootstrap/javascript.html#popovers
>
>
> see the examples ...
>
>
>
> On Thu, Oct 11, 2012 at 2:50 PM, David Gomez  > wrote:
>
>> How can I create a Facebook Share button in django? I would like 
>> something like this:
>> button name my_website
>> When user click the button it would pop up a window with a form
>> When user click the button, it will grab the form information and the 
>> information on the blog, and put it on the database like it would do on a 
>> regular form. 
>> The form will have:
>> username = username
>> password = password
>> note = what ever note the user type
>> blog = the blog where the button was in.
>>
>> Thanks in advance
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/jR7qlLE-xkUJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> -- 
>
>
> Best regards / Saludos Cordiales
> Gerardo González Cruz
>
> Blog: http://gerardogc2378.blogspot.com/ http://ggcsblog.blogspot.com/
> Web Page: http://ggcspace.heroku.com/
> Skype: gerardo.enlaceit
> oDesk: gerardogc2378
> gerard...@tropo.im 
> @gerardogc2378
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/lZLKozhDWkoJ.
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: perfectionists... motto doesn't fit

2012-10-11 Thread Russell Keith-Magee
On Fri, Oct 12, 2012 at 9:00 AM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> Lets say you if you were given 1 day to build a shed..
>
> PHP = build your own hammer/screwdriver from scratch, and then use those to
> build your shed - all within the same timeframe
> PHP with Zend Framework = the equivalent of trying to build your shed with
> your childs "early learning toolset", using blu-tac for glue.
> Django = build the shed with the right tools, equipment and materials as
> your disposal.

Ok - lets back away from this thread right now.

There's absolutely no benefit to be gained in continuing a thread
whose sole purpose is to debate the merits of a *tagline*.

There's also absolutely no benefit to be gained by calling other
framework names, no matter how much you may personally dislike them.
Ad hominem attacks and name calling will not be tolerated on Django
mailing lists, and repeat offenders will be banned. You have all been
warned.

Yours,
Russ Magee %-)

-- 
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: perfectionists... motto doesn't fit

2012-10-11 Thread Cal Leeming [Simplicity Media Ltd]
Lets say you if you were given 1 day to build a shed..

PHP = build your own hammer/screwdriver from scratch, and then use those to
build your shed - all within the same timeframe
PHP with Zend Framework = the equivalent of trying to build your shed with
your childs "early learning toolset", using blu-tac for glue.
Django = build the shed with the right tools, equipment and materials as
your disposal.

Some people make the argument of "whatever tool is right for the job"..

Sure - you could make a handsome shed with your first born's plastic tool
set, but for perfectionists it's not just about the end result, it's about
how you got there.

On Thu, Oct 11, 2012 at 1:49 PM, Moonlight wrote:

> What is django definition for perfectionists? Just curious.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-rUl_ZryK44J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Some questions about uploaded file

2012-10-11 Thread Hendrik Speidel
Hi,

django uses upload handlers to manage uploaded files.
In the default configuration, if the uploaded file is small, it is only
stored in memory at that point. Therefore, the uploaded file object does
not expose a temporary path as part of its public api.
When using a FileField/ImageField as part of a model, the file is
automatically written to a configurable location.
If you don't need a model for your use case, you can simply save the
file to a location you choose.
Have a look at the handle_uploaded_file function at
https://docs.djangoproject.com/en/dev/topics/http/file-uploads/

Cheers,

Hendrik


On 10/11/2012 11:57 PM, Jiao Li wrote:
> Hi, I uploaded a file to the server. I want to extract the location of
> the file at the server side. I use request.FILES['location'] to get my
> file. When I print the request.FILE['location'], it just shows the file
> name, not the path name. So how can I get the path of the file uploaded?
> Thank you~~
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/FXwctBpp1kgJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

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



Some questions about uploaded file

2012-10-11 Thread Jiao Li
Hi, I uploaded a file to the server. I want to extract the location of the 
file at the server side. I use request.FILES['location'] to get my file. 
When I print the request.FILE['location'], it just shows the file name, not 
the path name. So how can I get the path of the file uploaded? Thank you~~

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FXwctBpp1kgJ.
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.



Facebook like button in django

2012-10-11 Thread David Gomez
How can I create a Facebook Share button in django? I would like something 
like this:
button name my_website
When user click the button it would pop up a window with a form
When user click the button, it will grab the form information and the 
information on the blog, and put it on the database like it would do on a 
regular form. 
The form will have:
username = username
password = password
note = what ever note the user type
blog = the blog where the button was in.

Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jR7qlLE-xkUJ.
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: Display only model fields that are non-empty

2012-10-11 Thread Jonathan Baker
I just used the following code on a project to solve the problem you're
describing:

models.py
class SomeModel(models.Model):
...
def get_fields(self):
return [(field.name, field.value_to_string(self)) for field in
SomeModel._meta.fields if field.value_to_string(self) is not None]

It's a basic extension to the link that Kurtis just provided.

HTH.

On Thu, Oct 11, 2012 at 1:33 PM, Kurtis Mullins wrote:

> There's a couple of ways, assuming you're talking about in the template.
>
> One example would simply be:
>
> {% if object.fieldname %}
> {{ object.fieldname }}
> {% endif %}
>
> Another example might be:
>
> {{ object.fieldname|default:"" }}
>
> But it doesn't allow for much formatting of an empty field.
>
> If you want to do this generically, you could take an approach of looping
> through all fields of a model and checking if each has a value before
> printing. Something along the lines of this might work for you:
>
>
> http://stackoverflow.com/questions/2217478/django-templates-loop-through-and-print-all-available-properties-of-an-object
>
> Good luck!
>
> On Thu, Oct 11, 2012 at 1:47 PM, Keir Lawson  wrote:
>
>> Hello,
>>
>> I was wondering what the most elegant way (using a DetailView or similar)
>> to display the fields of a model, excluding those that are empty?
>>
>> Thanks
>>
>> Keir
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/uYV-psryrHcJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.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: Display only model fields that are non-empty

2012-10-11 Thread Kurtis Mullins
There's a couple of ways, assuming you're talking about in the template.

One example would simply be:

{% if object.fieldname %}
{{ object.fieldname }}
{% endif %}

Another example might be:

{{ object.fieldname|default:"" }}

But it doesn't allow for much formatting of an empty field.

If you want to do this generically, you could take an approach of looping
through all fields of a model and checking if each has a value before
printing. Something along the lines of this might work for you:

http://stackoverflow.com/questions/2217478/django-templates-loop-through-and-print-all-available-properties-of-an-object

Good luck!

On Thu, Oct 11, 2012 at 1:47 PM, Keir Lawson  wrote:

> Hello,
>
> I was wondering what the most elegant way (using a DetailView or similar)
> to display the fields of a model, excluding those that are empty?
>
> Thanks
>
> Keir
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/uYV-psryrHcJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Django-cms + Wymeditor + Heroku + AWS s3 + Cors

2012-10-11 Thread Matteo Suppo
I found this: 
http://comments.gmane.org/gmane.comp.python.django.django-cms/1202

and I decided to use tinymce for now. It's not solved though. I will do 
something, maybe.

On Thursday, October 11, 2012 7:25:19 PM UTC+2, Matteo Suppo wrote:
>
> Ok, here's a fun one.
>
> I set up a django installation on Heroku, added the django-cms app, 
> deployed on heroku, and collected the static files on AWS.
>
> The problem is Django-CMS tries to load the js file for the wymeditor but 
> AWS says:
>
> MLHttpRequest cannot load 
> https://s3.amazonaws.com/[...]/cms/js/wymeditor/skins/django/skin.js. 
> Origin [...] is not allowed by Access-Control-Allow-Origin.
>
> I actually searched a lot, and discovered this: 
> http://docs.amazonwebservices.com/AmazonS3/latest/dev/cors.html
>
> Seems like a solution, but even if I activated it, nothing works.
>
> I'm at loss. It should work but it doesn't. Am I missing something here? 
> Maybe it doesn't work the way I thought? Should I ask AWS directly?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/4YPceJ2PwyoJ.
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.



Display only model fields that are non-empty

2012-10-11 Thread Keir Lawson
Hello,

I was wondering what the most elegant way (using a DetailView or similar) 
to display the fields of a model, excluding those that are empty?

Thanks

Keir

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/uYV-psryrHcJ.
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-cms + Wymeditor + Heroku + AWS s3 + Cors

2012-10-11 Thread Matteo Suppo
Apparently with Firefox I don't have the CORS problem. It doesn't work 
either but at least it's a different error message:

Error: Permission denied to access property 'styleSheets'

styles = this._doc.styleSheets[0];

that brought me to this: 
http://stackoverflow.com/questions/2206586/wymeditor-across-subdomains-cross-site-permission-issue

Hmm I'll try it


On Thursday, October 11, 2012 7:25:19 PM UTC+2, Matteo Suppo wrote:
>
> Ok, here's a fun one.
>
> I set up a django installation on Heroku, added the django-cms app, 
> deployed on heroku, and collected the static files on AWS.
>
> The problem is Django-CMS tries to load the js file for the wymeditor but 
> AWS says:
>
> MLHttpRequest cannot load 
> https://s3.amazonaws.com/[...]/cms/js/wymeditor/skins/django/skin.js. 
> Origin [...] is not allowed by Access-Control-Allow-Origin.
>
> I actually searched a lot, and discovered this: 
> http://docs.amazonwebservices.com/AmazonS3/latest/dev/cors.html
>
> Seems like a solution, but even if I activated it, nothing works.
>
> I'm at loss. It should work but it doesn't. Am I missing something here? 
> Maybe it doesn't work the way I thought? Should I ask AWS directly?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ejalT2r8CbUJ.
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 - store small pieces of data

2012-10-11 Thread Matteo Suppo

>
> I would like to add to panel admin new position only with edit view where 
> user can fill couple of text fields


I don't understand what you're saying here, but for the rest it appears to 
me that maybe this could help you:

http://www.djangopackages.com/packages/p/django-flatblocks/


On Thursday, October 11, 2012 7:02:29 PM UTC+2, Wojtek Rymaszewski wrote:
>
> Hi,
>
> It's my first post so at the beginning i would like to say Hello.
>
> I am quite new to django.
>
> I have one problem to solve.
>
> My website has couple of places where i would like to put some content 
> (static text) managed by admin panel.
> I know that there is django flatpage or some project like django-chunk. 
> Flatpage has only couple of fields and django-chunk has all in one place 
> (key-value).
>
> I would like to add to panel admin new position only with edit view where 
> user can fill couple of text fields. After save data is storied in file (or 
> in database).
>
> Generally i would like to store small pieces of text like phone number, 
> address, some tagline which are on several pages. And creating model with 
> full CRUD is unnecessary.
>
> How can i do this? Is it possible?
>
> Thanks in advance.
>
> Best regards,
> Wojtek
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ImsMwIb5K_YJ.
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-cms + Wymeditor + Heroku + AWS s3 + Cors

2012-10-11 Thread Matteo Suppo
Ok, here's a fun one.

I set up a django installation on Heroku, added the django-cms app, 
deployed on heroku, and collected the static files on AWS.

The problem is Django-CMS tries to load the js file for the wymeditor but 
AWS says:

MLHttpRequest cannot load 
https://s3.amazonaws.com/[...]/cms/js/wymeditor/skins/django/skin.js. 
Origin[...] is not allowed by Access-Control-Allow-Origin.

I actually searched a lot, and discovered this: 
http://docs.amazonwebservices.com/AmazonS3/latest/dev/cors.html

Seems like a solution, but even if I activated it, nothing works.

I'm at loss. It should work but it doesn't. Am I missing something here? 
Maybe it doesn't work the way I thought? Should I ask AWS directly?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/X4aoCq5rnGEJ.
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 admin - store small pieces of data

2012-10-11 Thread Wojtek Rymaszewski
Hi,

It's my first post so at the beginning i would like to say Hello.

I am quite new to django.

I have one problem to solve.

My website has couple of places where i would like to put some content 
(static text) managed by admin panel.
I know that there is django flatpage or some project like django-chunk. 
Flatpage has only couple of fields and django-chunk has all in one place 
(key-value).

I would like to add to panel admin new position only with edit view where 
user can fill couple of text fields. After save data is storied in file (or 
in database).

Generally i would like to store small pieces of text like phone number, 
address, some tagline which are on several pages. And creating model with 
full CRUD is unnecessary.

How can i do this? Is it possible?

Thanks in advance.

Best regards,
Wojtek

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/otPXKDKh9uAJ.
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 setup with elsatic beanstalk

2012-10-11 Thread Stefano Tranquillini
same problem, did you solve it?

On Monday, October 8, 2012 7:22:51 PM UTC+2, shlomi oberman wrote:
>
> I'm trying without succes to setup a simple application using django with 
> elastic beanstalk from my windows machine.
> Does anyone have any expreience with this? I am currently getting the 
> following error from the EB console: 
> "Your WSGIPath refers to a file that does not exist."
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WiWZ2EApeWUJ.
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: Javascript encoding and python decoding and vice versa

2012-10-11 Thread Javier Guerra Giraldez
On Thu, Oct 11, 2012 at 11:09 AM, Kurtis Mullins
 wrote:
> On the other hand, some valid points raised against storing sensitive data
> in a Query String:
> http://stackoverflow.com/questions/323200/is-a-https-query-string-secure

oh, yes; the browser URL cache.   effectively, that's part of the 'off
hands' that lie beyond the SSL endpoint.  although i don't think URLs
used only for AJAX queries would be cached as 'visibly' as address-bar
ones...


-- 
Javier

-- 
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: Javascript encoding and python decoding and vice versa

2012-10-11 Thread Javier Guerra Giraldez
On Thu, Oct 11, 2012 at 10:25 AM, Kurtis Mullins
 wrote:
> Sorry, you're probably right. I imagine there are no security risks related
> to pulling a host-name from a DNS server. However, I do not know if the case
> is the same for an HTTP Proxy when the query is included in the URL.

a malicious DNS would lead the client to a rogue server, but if the
client checks the server certificate, it wouldn't fly (that's what i
meant by "sever identity verification")

a malicious HTTP proxy rarely would be transparent.  Even in that
case, it would only see who is communicating with who.  The whole
stream (including the HTTP verbs, URL, parameters, bodies, etc) is
opaque if encrypted with SSL.  That's why you should always use https.

-- 
Javier

-- 
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: Javascript encoding and python decoding and vice versa

2012-10-11 Thread Kurtis Mullins
Sorry, you're probably right. I imagine there are no security risks related
to pulling a host-name from a DNS server. However, I do not know if the
case is the same for an HTTP Proxy when the query is included in the URL.

On Thu, Oct 11, 2012 at 11:14 AM, Javier Guerra Giraldez  wrote:

> On Thu, Oct 11, 2012 at 10:04 AM, Kurtis Mullins
>  wrote:
> > If you use GET requests to transmit data, there is still a chance that
> the
> > data might be intercepted by a DNS server or Proxy Server regardless of
> SSL.
> > I'd keep everything contained in POST and just like the others have
> > mentioned, simply go with SSL and Signed Certificates.
>
> ??
>
> AFAICT, GET and POST are exactly the same from both DNS, SSL and
> information theory points of view
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Django with Jquery

2012-10-11 Thread Adrián Espinosa
I will try to use Google jQuery link. It's quite fast too.

If you want to use your local files, you may try to use {{ STATIC_URL }} or 
{{ MEDIA_URL }} (although media is for uploaded files).

Check your settings.py and urls.py

On Sunday, February 28, 2010 6:39:04 PM UTC+1, Alexis Selves wrote:
>
> Hello,
> I am totally helpless. I am trying to use JQuery in my django
> templates, but I always get in firebug this: $ not defined.
>
> In my template I am linking jquery :
> 
>
> And then
> 
> $(document).ready(function() {
> alert("Hello from jQuery");
> });
> 
>
> But  I always get nothing..
> using ubuntu 9.10. Thanks for your help in advance.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/DSyIaYzCzhgJ.
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: Javascript encoding and python decoding and vice versa

2012-10-11 Thread Javier Guerra Giraldez
On Thu, Oct 11, 2012 at 10:04 AM, Kurtis Mullins
 wrote:
> If you use GET requests to transmit data, there is still a chance that the
> data might be intercepted by a DNS server or Proxy Server regardless of SSL.
> I'd keep everything contained in POST and just like the others have
> mentioned, simply go with SSL and Signed Certificates.

??

AFAICT, GET and POST are exactly the same from both DNS, SSL and
information theory points of view

-- 
Javier

-- 
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: static files

2012-10-11 Thread Brad Pitcher
I believe the best way of doing this is to have your image(s) in
static/images and your css in static/css.  Then you can use a relative URL
to set the background image like so:

background-image : url("../images/PAE.jpg")

It's better not to have any CSS mixed in with your HTML anyway.
On Oct 11, 2012 7:49 AM, "luca72"  wrote:

> hello my project is lacated here:
>
> /home/
>   /luca72
> /Scrivania
>   /Quintas_Disegno_definitivo
> /quintas/ here i have the file manage.py ,
>
> than i have the file settings,py here:
> /home
>/luca72
>   /Scrivania
>  /Quintas_Disegno_definitivo
> /quintas
>/quintas, here i have add a folder "static" with and image
> called PAE.jpg.
>
> How i have to configure the file setting.py in a way that in my template
> when i write via CSS background-image : url("PAE.jpg") the image is load
>
> I have try a lot of thing but i get that the image is not found.
>
> I use apache in localhost.
>
> Thaks
>
> Luca
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/VXS19g9Ie7MJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Javascript encoding and python decoding and vice versa

2012-10-11 Thread Kurtis Mullins
If you use GET requests to transmit data, there is still a chance that the
data might be intercepted by a DNS server or Proxy Server regardless of
SSL. I'd keep everything contained in POST and just like the others have
mentioned, simply go with SSL and Signed Certificates.

On Thu, Oct 11, 2012 at 10:37 AM, Javier Guerra Giraldez  wrote:

> On Thu, Oct 11, 2012 at 3:39 AM, Laxmikant Gurnalkar
>  wrote:
> >  I'm using ssl at all. Still I need some data which is going through
> Ajax.
>
> i'm not sure i understand correctly.  do you mean "i'm _not_ using ssl
> at all", or "i'm using ssl for everything" ??
>
> if the former, then stop reading and turn everything to https (that's
> http in ssl).
> if the latter, then you're more than halfway through.
>
> with https and the correct certificates in your server, you get:
>
> - a secure channel
> - server identity verification
> - non-forgeable IP number of client
>
> what you don't get:
>
> A: client identity verification
> B: obscured data (aka. DRM)
> C: client code certification
>
> for A, just making sure that the user/password travel via SSL is
> usually enough.  but if you store that password somewhere, then it
> might be used by malicious code.  a crypto library can help (typically
> by a challenge-response protocol and HMACs), but since the client code
> (JS) is on the clear and on a user-controlled repository (the
> browser), then that part is somewhat lost cause.
>
> by B, I mean that any data you send and is decoded by JS client code
> is user-available and you can't control it anymore.  there are DRM
> schemes that allow client code to do some verifications before
> decrypting, but as repeatedly shown by DRM exploits, the simple fact
> that the client needs the decrypting keys means that somebody else
> would get them
>
> finally, C is what makes most of these issues next to impossible:
> there's no way that you can verify that the JS client code you're
> communicating with is what you want to be.  that's the main point of
> the last link i sent originally.
>
> from a security design point of view, you can carefully protect the
> data deep within your server; but at the far end (the user's eyes)
> it's no longer private.  that's common to all systems.  what you must
> do is determine which is the boundary between what's controllable and
> what not.
>
> in traditional client-server systems, you can (mostly) control client
> code, so the boundary might be the user's screen.
>
> but in web applications, by using SSL in the best possible way, the
> last place where you have privacy is the client's network port.
> everything beyond that (OS, browser, even your JavaScript code) is off
> your hands and must be treated as potentially hostile.
>
>
> > So, I suppose  that I can encrypt using crypto.js but how can I decrypt
> my
> > code in my python code.
>
> if using SSL, you don't have to.  the http sever (typically
> Apache/Nginx) handles the decoding.
>
> if using crypto.js (on top of SSL, never in place of), then just stay
> within well known crypto protocols and find the equivalent python
> library.  since there's no advantage in doubly-encrypting, i'd say
> don't bother with encryption.  where crypto.js (and others) can help
> you is with mutual verification, mostly using HMACs, Diffie-Hellman
> and other hash applications.
>
> note that SSL already does D-H to get mutual verification on the
> connection.
>
>
> > Just Wanted to let you know, I'm doing such stuff for first time. and i
> dont
> > want to take any risk over my data transer  while user is purchasing
> > something or etc.
>
>
>
> --
> Javier
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



static files

2012-10-11 Thread luca72
hello my project is lacated here:

/home/
  /luca72
/Scrivania
  /Quintas_Disegno_definitivo
/quintas/ here i have the file manage.py , 

than i have the file settings,py here: 
/home
   /luca72
  /Scrivania
 /Quintas_Disegno_definitivo
/quintas
   /quintas, here i have add a folder "static" with and image 
called PAE.jpg.

How i have to configure the file setting.py in a way that in my template 
when i write via CSS background-image : url("PAE.jpg") the image is load

I have try a lot of thing but i get that the image is not found.

I use apache in localhost.

Thaks

Luca

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/VXS19g9Ie7MJ.
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: Javascript encoding and python decoding and vice versa

2012-10-11 Thread Javier Guerra Giraldez
On Thu, Oct 11, 2012 at 3:39 AM, Laxmikant Gurnalkar
 wrote:
>  I'm using ssl at all. Still I need some data which is going through Ajax.

i'm not sure i understand correctly.  do you mean "i'm _not_ using ssl
at all", or "i'm using ssl for everything" ??

if the former, then stop reading and turn everything to https (that's
http in ssl).
if the latter, then you're more than halfway through.

with https and the correct certificates in your server, you get:

- a secure channel
- server identity verification
- non-forgeable IP number of client

what you don't get:

A: client identity verification
B: obscured data (aka. DRM)
C: client code certification

for A, just making sure that the user/password travel via SSL is
usually enough.  but if you store that password somewhere, then it
might be used by malicious code.  a crypto library can help (typically
by a challenge-response protocol and HMACs), but since the client code
(JS) is on the clear and on a user-controlled repository (the
browser), then that part is somewhat lost cause.

by B, I mean that any data you send and is decoded by JS client code
is user-available and you can't control it anymore.  there are DRM
schemes that allow client code to do some verifications before
decrypting, but as repeatedly shown by DRM exploits, the simple fact
that the client needs the decrypting keys means that somebody else
would get them

finally, C is what makes most of these issues next to impossible:
there's no way that you can verify that the JS client code you're
communicating with is what you want to be.  that's the main point of
the last link i sent originally.

from a security design point of view, you can carefully protect the
data deep within your server; but at the far end (the user's eyes)
it's no longer private.  that's common to all systems.  what you must
do is determine which is the boundary between what's controllable and
what not.

in traditional client-server systems, you can (mostly) control client
code, so the boundary might be the user's screen.

but in web applications, by using SSL in the best possible way, the
last place where you have privacy is the client's network port.
everything beyond that (OS, browser, even your JavaScript code) is off
your hands and must be treated as potentially hostile.


> So, I suppose  that I can encrypt using crypto.js but how can I decrypt my
> code in my python code.

if using SSL, you don't have to.  the http sever (typically
Apache/Nginx) handles the decoding.

if using crypto.js (on top of SSL, never in place of), then just stay
within well known crypto protocols and find the equivalent python
library.  since there's no advantage in doubly-encrypting, i'd say
don't bother with encryption.  where crypto.js (and others) can help
you is with mutual verification, mostly using HMACs, Diffie-Hellman
and other hash applications.

note that SSL already does D-H to get mutual verification on the connection.


> Just Wanted to let you know, I'm doing such stuff for first time. and i dont
> want to take any risk over my data transer  while user is purchasing
> something or etc.



-- 
Javier

-- 
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: perfectionists... motto doesn't fit

2012-10-11 Thread sbrandt
Those people who are able to analyse a motto with the sufficient sense of 
humour and subtleness and do not break it down to single incoherent parts. 
Sorry to be rude, but what's the point of this question other than trolling?

In my case, I _am_ a perfectionist with deadlines and it fits pretty much.

On Thursday, October 11, 2012 2:49:19 PM UTC+2, Moonlight wrote:
>
> What is django definition for perfectionists? Just curious.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/0ZgUvplZ954J.
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 dispatcher slow?

2012-10-11 Thread Kkk Kkk
>This is why I disagree with your conjecture that because Django is
>slower than another framework, therefore Django is slow. That is not
>what is shown, only that the other frameworks do certain things
> faster.

I think we have the same standpoint of view here. May be it is faster somewhere 
else... but where? If it is slower here and there... it is probaly just slow, 
isn't it? May be the word 'slow' is not correct... if the framework does more 
for me in URL dispatch I want to know what that more means... I know it can do 
reverse url but that feature is not used in url dispatch.

>Open source is wonderful, because you are allowed the choice of
>framework. You can choose full featured, and accept that those
>features will cost time, or you can choose lightweight, and not use
>those features. There is no magical mid-way point where you get all
>the features and all the speed.

Agreed. We are free to talk about this and that is good. It would be better if 
someone also listen. If the difference between lightweight and full featured 
impacts performance that much I want to see which features cause that. Let 
itemize the list. Honesty I tried... but just can not related them to the facts 
faced.




 From: Tom Evans 
To: Moonlight  
Sent: Thursday, October 11, 2012 3:46 PM
Subject: Re: URL dispatcher slow?
 
On Thu, Oct 11, 2012 at 1:07 PM, Moonlight  wrote:
>> So, the benchmarks are interesting. They tell us which stacks are
>> fully featured, and which stacks are very lightweight. Apart from
>> that, they don't tell us much at all - is Django's template engine
>> slow, or is it about right for the work it does? This benchmark
>> doesn't tell us that, it only says it is slower than a bare bones
>> template engine, which is unsurprising, and shouldn't be a cause for
>> concern.
>
>
> It is sort of no sense. Django is fully featured and we do not care... some
> other are fast because they are lightweight... tell me which 'full featured'
> feature prevents it from become better. I guess for the #1 framework it is
> important to be leader... hmm... not sure what you mean by 'right for the
> work it does'... who needs a template that doesn't do what you need?

You are absolutely right - personally, I do not care one iota how fast
Django routes requests. I know that it does it fast enough, and that
improving the speed of that tiny subsection of code is not going to
improve the performance of my web application. This part of code makes
up a disproportionally small part of the request cycle, even if it was
twice as fast, the overall improvement would be negligible.

This is why I disagree with your conjecture that because Django is
slower than another framework, therefore Django is slow. That is not
what is shown, only that the other frameworks do certain things
faster.

>From your previous post, talking about urlresolver:

> I definitely would appreciate if someone from core team I guess or in the 
> community finally have a look there

Django's url resolver _is_ fast. It does a lot more work than the
other frameworks under test, which is why it is subjectively slower
than them in that test, but that is not relevant. It could be made
faster, if it stopped doing the useful features that we rely on to
build our projects.

Open source is wonderful, because you are allowed the choice of
framework. You can choose full featured, and accept that those
features will cost time, or you can choose lightweight, and not use
those features. There is no magical mid-way point where you get all
the features and all the speed.

Cheers

Tom

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



perfectionists... motto doesn't fit

2012-10-11 Thread Moonlight
What is django definition for perfectionists? Just curious.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-rUl_ZryK44J.
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 performance vs others

2012-10-11 Thread Moonlight
I think the URL dispatch cases are valid (dynamic urls and some that never 
changes)... so legit at least for django (I looked at code)... I have no 
idea if the code is valid for other frameworks. I have run that benchmark 
as it explained in that post and got almost the same results... hmmm, why 
'missing' test case is so slow... even in bottle? Can someone tell me?

2012/10/10 Moonlight 
>
>> I think this  one 
>> explains how it works.
>
>
> A quick read make me think it's a bit complex.
>
> Check out the routing benchmark too 
> http://mindref.blogspot.fr/2012/10/python-web-routing-benchmark.html
>
> If this is legit tests, they are impressive. 
>
> Would you mind at least using the django...@googlegroups.com 
> ML...
>
> Thanks,
>
> Amirouche
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/JTLzNwshW8IJ.
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 with Jquery

2012-10-11 Thread Marc Kirkwood
I'm having this problem at the moment too. In our case, it's because we 
have a base template that inserts the jQuery library via a script tag 
towards the end of the document, just before the close of the body element. 
Since anything following a $ character in JS depends on jQuery, including 
the $(document).ready function call itself, we can't do anything with 
jQuery in a child template because the browser only includes the jQuery 
library when it receives it from the server. A possible solution is simply 
to move the 

Django 1.4 reusable app template repo

2012-10-11 Thread Dries Desmet
I would appreciate any feedback on my django 1.4 reuasable app template. 
You can find the code here: https://github.com/TrioTorus/django-app-skel

I love the new --template option that comes with django 1.4 now and this is 
my first attempt at a simple skeleton. Would you use such a thing? Are you 
missing something I haven't included? Are the docs clear enough? I'm a bit 
on my island here (django-wise) so any feedback is appreciated.

Regards,

Dries Desmet.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/vKMVHUJax_gJ.
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: Create table and load data

2012-10-11 Thread Larry Martell
On Thu, Oct 11, 2012 at 1:37 AM, Joseph Wayodi  wrote:
> On Thu, Oct 11, 2012 at 2:23 AM, Larry Martell  
> wrote:
>> I'm having trouble getting django to read my fixture file. I created it in 
>> yaml:
>>
>> - model: cdsem.fields
>>pk: 1
>>fields:
>>  name: data_file_id
>>  description: data_file_id
>> - model: cdsem.fields
>>pk: 2
>>fields:
>>  name: tool_id
>>  description: tool_id
>>
>> and so on.
>>
>> I put it in a file called initial_data.yaml in the fixtures dir of my
>> app. When I run syncdb it does not pick it up. FIXTURE_DIRS was not
>> set. I should not have to set it, but I did anyway, but it still did
>> not pick up the file. If I run loaddata and give it the path to the
>> file I get:
>>
>> Problem installing fixture './fixtures/initial_data': yaml is not a
>> known serialization format.
>>
>> The docs say yaml is supported. What am I doing wrong?
>>
>
> According to the docs [1], you may need to install PyYAML:
> .
>
> [1] 
> 

Thanks! Didn't see that.

-- 
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: Djangoproject and Djangobook websites

2012-10-11 Thread Russell Keith-Magee
On Thu, Oct 11, 2012 at 10:53 AM, Csaba Kiss  wrote:
> I am wondering if the above mentioned sites are created by Django. If yes,
> why don't they have a Django badge?
> If they don't use Django, then hmm, that would make you think...

Yes, they both use Django. In fact, the source code for
djangoproject.com is available as part of our Github repository. We
just don't go out of our way to advertise it. The content of the site
is a lot more important than whatever geek points we might gain by
putting a couple of badges on the site.

Yours,
Russ Magee %-)

-- 
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: Create table and load data

2012-10-11 Thread Joseph Wayodi
On Thu, Oct 11, 2012 at 2:23 AM, Larry Martell  wrote:
> I'm having trouble getting django to read my fixture file. I created it in 
> yaml:
>
> - model: cdsem.fields
>pk: 1
>fields:
>  name: data_file_id
>  description: data_file_id
> - model: cdsem.fields
>pk: 2
>fields:
>  name: tool_id
>  description: tool_id
>
> and so on.
>
> I put it in a file called initial_data.yaml in the fixtures dir of my
> app. When I run syncdb it does not pick it up. FIXTURE_DIRS was not
> set. I should not have to set it, but I did anyway, but it still did
> not pick up the file. If I run loaddata and give it the path to the
> file I get:
>
> Problem installing fixture './fixtures/initial_data': yaml is not a
> known serialization format.
>
> The docs say yaml is supported. What am I doing wrong?
>

According to the docs [1], you may need to install PyYAML:
.

[1] 


Joseph.

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