Re: static files

2012-10-11 Thread luca72
Thanks i have try but with no result, i have set as follow: MEDIA_ROOT = '/home/luca72/Scrivania/Quintas_Disegno_definitivo/quintas/quintas/static/' MEDIA_URL = '/static/' STATIC_URL = '' STATIC_ROOT = '' STATICFILES_DIRS = ('/home/luca72/Scrivania/Quintas_Disegno_definitivo/quintas/quintas/sta

Cleaning up redis connection after client disconnects from streaming response

2012-10-11 Thread Brent Tubbs
I've implemented a Server Sent Event API in my Django app to stream realtime updates from my backend to the browser. The backend is a Redis pubsub. My Django view looks like this: def event_stream(request): """ Stream worker ev

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 (")_(") t

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

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,

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 equi

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

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 par

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

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 li

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]

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 wan

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 installa

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

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-

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 Th

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

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 dj

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 >

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

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 D

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,

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

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

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

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

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

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

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 m

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

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

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

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

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

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

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 djangop

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