Re: building multiple dynamic websites on the fly

2014-01-08 Thread Erik Cederstrand
Den 07/01/2014 kl. 14.40 skrev Mrinmoy Das : > Is there a pure django solution towards this problem? There is the Django sites framework to help you decide what to do depending on the domain name you are receiving. See https://docs.djangoproject.com/en/dev/ref/contrib/sites/. Or just look at H

Re: new to Django and Python

2014-01-08 Thread 向量
oh, my god. your db have problem, what db you use, mysql or sqlite? 在 2013年12月27日星期五UTC+8上午4时44分24秒,Brent Register写道: > > I get an error message when I run the > "$ python manage.py syncdb" > Command. > > > 70 > SyntaxError: Non-ASCII character '\xe2' in file > /Users/bmregister/djangoL

Django and Bind jQuery Grid to MySql Database using PHP

2014-01-08 Thread David Nides
Greetings, I am noob to django and web dev. I followed the directions on the JQuery websiteto Bind jQuery Grid to a MySql Database using PHP. By means of getting

Django and Bind jQuery Grid to MySql Database using PHP

2014-01-08 Thread David Nides
Greeting, I am trying to bind a jQuery grid to MySql database using PHP and serve up using Django. I am a complete noob to web dev and Django. I followed the directions on JQuery's website

Re: Which Real Time Communications Protocol

2014-01-08 Thread Tom Evans
On Mon, Dec 30, 2013 at 7:14 PM, Nikolas Stevenson-Molnar wrote: > The reason for this (someone please correct me if I'm wrong on this) is that > Django isn't meant to hold connections indefinitely. Ideally you want to get > a request and turn around a response as quick as possible. Using the > ng

Re: new to Django and Python

2014-01-08 Thread Hans S . Tømmerholt
在 2013年12月27日星期五UTC+8上午4时44分24秒,Brent Register写道: I get an error message when I run the"$ python manage.py syncdb" Command. 70 SyntaxError: Non-ASCII character '\xe2' in file /Users/bmregister/djangoLocal/myFirstSite/myFirstSite/settings.py on line 70, but >no encoding declared; see http:

Re: Django and Bind jQuery Grid to MySql Database using PHP

2014-01-08 Thread Daniel Roseman
On Wednesday, 8 January 2014 05:16:32 UTC, David Nides wrote: > > Greeting, > > I am trying to bind a jQuery grid to MySql database using PHP and serve up > using Django. I am a complete noob to web dev and Django. I followed the > directions > on JQuery's > website

Re: Django and Bind jQuery Grid to MySql Database using PHP

2014-01-08 Thread carlos
Hi you not need the 3 flies you only need create the proyect and them 1 app this app is the data you need create the views inside one function similar data.php but in python use impor json and them create de index.html similar de index.php so you replace this connect.php == settings.py data.php ==

DecimalField Problem

2014-01-08 Thread Timothy W. Cook
I have several decimal fields defined in the model like this: min_inclusive = models.DecimalField(_('minimum inclusive'), max_digits=19, decimal_places=10, help_text=_("Enter the minimum (inclusive) value for this concept."), null=True, blank=True) Via the admin interface when I enter a 0 (zero)

Re: Django and Bind jQuery Grid to MySql Database using PHP

2014-01-08 Thread David Nides
Daniel, I was just looking at the JQuery demo. I guess I assumed it was needed but now understand this can all be done using Django. I just don't understand how

Re: DecimalField Problem

2014-01-08 Thread Erik Cederstrand
Den 08/01/2014 kl. 16.18 skrev Timothy W. Cook : > I have several decimal fields defined in the model like this: > > min_inclusive = models.DecimalField(_('minimum inclusive'), max_digits=19, > decimal_places=10, help_text=_("Enter the minimum (inclusive) value for this > concept."), null=True,

Re: Which Real Time Communications Protocol

2014-01-08 Thread Nikolas Stevenson-Molnar
Thank you, that's a very good point! I'm so used to thinking about Django in the context of the request/response cycle that I didn't think about pairing it with a websocket framework to take on that task. _Nik On 1/8/2014 3:56 AM, Tom Evans wrote: > On Mon, Dec 30, 2013 at 7:14 PM, Nikolas Steven

Re: DecimalField Problem

2014-01-08 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 1:44 PM, Erik Cederstrand wrote: > Den 08/01/2014 kl. 16.18 skrev Timothy W. Cook : > > > > So, why doesn't it just store a zero? > > Underneath a DecimalField there is a Python float type, and some > equivalent float type in your database. Float values are an approximation

Could not parse the remainder: '{{variabile}}' from '{{variabile}}'

2014-01-08 Thread luca72
hello the views file is like: def test(request): testo = ["a","b"] titolo = 'test' variabile = 'one' return render_to_response('vini.html',{'testo':testo,'titolo':titolo, 'testo':testo,'variabile':variabile,}) the template is: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

Re: Could not parse the remainder: '{{variabile}}' from '{{variabile}}'

2014-01-08 Thread Jonathan Baker
When referencing a context variable within an if statement in a template, you don't need to use {{ var }}. Simply use: {% if variabile == "one" %}...{% elif variable == "two" %}...{% else %}...{% endif %}. JDB On Wed, Jan 8, 2014 at 9:33 AM, luca72 wrote: > hello the views file is like: > > de

Re: Could not parse the remainder: '{{variabile}}' from '{{variabile}}'

2014-01-08 Thread Larry Martell
On Wed, Jan 8, 2014 at 9:33 AM, luca72 wrote: > hello the views file is like: > > def test(request): >testo = ["a","b"] >titolo = 'test' >variabile = 'one' >return render_to_response('vini.html',{'testo':testo,'titolo':titolo, > 'testo':testo,'variabile':variabile,}) > > the templa

Re: DecimalField Problem

2014-01-08 Thread Erik Cederstrand
Den 08/01/2014 kl. 17.11 skrev Timothy W. Cook : > But one would think that if Django calls it a decimal field, it would convert > the float to decimal. > I suppose I'll do that before writing it out to the file (an XML schema) so > it really isn't a big deal, just surprising. Ah, the “decimal

Re: DecimalField Problem

2014-01-08 Thread Daniel Roseman
On Wednesday, 8 January 2014 16:47:52 UTC, Erik Cederstrand wrote: > > Den 08/01/2014 kl. 17.11 skrev Timothy W. Cook >: > > > > But one would think that if Django calls it a decimal field, it would > convert the float to decimal. > > I suppose I'll do that before writing it out to the file (a

Re: DecimalField Problem

2014-01-08 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 2:56 PM, Daniel Roseman wrote: > > No, no, no. None of this is true. > > Decimals are not a differently-formatted version of floats. Decimals are > not a built-in datatype in Python, it's true, but they are provided in the > standard library in (not surprisingly) the `decima

Re: DecimalField Problem

2014-01-08 Thread Erik Cederstrand
Den 08/01/2014 kl. 17.56 skrev Daniel Roseman : > > No, no, no. None of this is true. > > Decimals are not a differently-formatted version of floats. Decimals are not > a built-in datatype in Python, it's true, but they are provided in the > standard library in (not surprisingly) the `decimal`

Re: Which Real Time Communications Protocol

2014-01-08 Thread Mario R. Osorio
Thanks to both of you On Jan 8, 2014 11:08 AM, "Nikolas Stevenson-Molnar" wrote: > Thank you, that's a very good point! I'm so used to thinking about > Django in the context of the request/response cycle that I didn't think > about pairing it with a websocket framework to take on that task. > > _

Re: DecimalField Problem

2014-01-08 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 6:07 PM, Erik Cederstrand wrote: > Den 08/01/2014 kl. 17.56 skrev Daniel Roseman : > > > > Greatly embarrassed, and thanks for clarifying. Will be more careful when > answering next time :-) > > Erik > > Well, Erik. I appreciate you answering even if it wasn't 100% accurate

Re: Question about Django X_FRAME_OPTIONS setting

2014-01-08 Thread ernando
Hi Chen, Do you really need to set it via Django? Usually it's done via web-server (nginx/apache/etc) What about Django - I think you can use HttpResponse object and update header in default way: response['X_FRAME_OPTIONS'] = "value" See additional examples here: https://docs.djangoproject.co

referencing choices tuples

2014-01-08 Thread Phil Hughes
I have a typical set of choices tuples that are then referenced in a choices=... reference in a field definition. It does, well, what it is supposed to do. But, I have a situation where I need to change the value of the field to "a different choice" in code in the view (rather than as a from ch

Re: referencing choices tuples

2014-01-08 Thread Timothy W. Cook
I am not exactly sure what you are asking. However, I believe you want to make this change in the form. hth, Tim On Wed, Jan 8, 2014 at 7:51 PM, Phil Hughes wrote: > I have a typical set of choices tuples that are then referenced in a > choices=... reference in a field definition. It does, w

Question about the __unicode__()

2014-01-08 Thread Igor Korot
Hi, ALL, In the tutorial it is said that I need to create __unicode__() function to properly display the results of my model. Unfortunately the tutorial is using only one text field and everywhere I looked people are using something related, i.e. first_name+last_name and so they can create a tup

Re: Question about the __unicode__()

2014-01-08 Thread Avraham Serour
it will be whatever you want, you don't actually need to define it but the default implementation is not very useful, but you can override so it behaves like you need it can show manufacturer+' '+serial, or only one or the other, or even a constant unrelated string like 'Hello mom!' good luck On

Re: Question about the __unicode__()

2014-01-08 Thread Igor Korot
Hi, Avraham, Well, I'm looking for a way to "properly" override this function. The problem is that I have a lot more text fields in a table/model than just 2, but they are not related as in my example first and last name. So what would be the proper implementation? Because right now following tu

Re: How to approach this problem?

2014-01-08 Thread César García Tapia
django-nested-inlines doesn't seem to work with Django 1.6 In case anyone is interested, I solved it with the info in this very valuable post: http://yergler.net/blog/2013/09/03/nested-formsets-redux/ Hooray for Nathan Yergler :-) El domingo, 5 de enero de 2014 19:58:22 UTC+1, Avraham Serour

Re: Question about the __unicode__()

2014-01-08 Thread Avraham Serour
Hi, What do you mean they are not related? like in relational database related? In any case it doesn't matter how many fields or even if the data comes from a field, this is just a python function that should return a string, just fetch/calculate whatever data you need and make sure to return a s

Re: Question about the __unicode__()

2014-01-08 Thread Igor Korot
Hi, Avraham, So, lets say I write something like this: [code] def __unicode__(self): return (%s %s) manufacturer, serial_number [/code] and in tutorial part 1 I will go to the section "Play with API" I will still see 2 different fields when I issue: "Stuff.objects.all()"? Because as far as

Re: Deploying to Heroku for first time, Dynos is blank, not recognizing Procfile

2014-01-08 Thread Scott Meyers
Thanks for the effort. Yes I do have a requirements.txt file, and yes, my Procfile has no extensions. Heroku just isn't picking it up. If I delete my procfile and build another one, how do I re-send it to Heroku? Do I do another commit, or push master? On Tuesday, January 7, 2014 2:40:07 AM

Django Install Error: " SyntaxError: future feature unicode_literals is not defined "

2014-01-08 Thread Byron Price
I am new to programming in general and I am struggling to install Django. I downloaded the gar file, unzipped it and then attempted to do the " sudo python setup.py install " command in the terminal (I'm working on a Mac OS X 10.5.8) but was given the following message : Traceback (most recen

Django Sprint in Kraków, PL: 15-16 Feb 2014

2014-01-08 Thread Tomek Paczkowski
[Cross posting with django-developers] Hello, Pykonik, Kraków Python User Group, would like to invite you to 3rd Django Sprint in Kraków. We would like this event to become a winter tradition, so come and join us! This year we meet on weekend of 15th and 16th February in brand new offices of B

Re: DecimalField Problem

2014-01-08 Thread Mike Dewhirst
On Thursday, January 9, 2014 7:37:43 AM UTC+11, Timothy W. Cook wrote: > > > On Wed, Jan 8, 2014 at 6:07 PM, Erik Cederstrand > > > wrote: > >> Den 08/01/2014 kl. 17.56 skrev Daniel Roseman >> >> >: >> > > > >> But to post the solution to the issue, just for completeness. >> > > Yes, Djan

Accessing database table

2014-01-08 Thread Don Fox
In my manage.py shell I can load the following module: *from userprofile.models import NPIdata* However inside a file of utility functions located in the userprofile app the same import statement yields *ImportError:* 'No module named userprofile.models' I'm mystified! Any hints or help welc

Re: Accessing database table

2014-01-08 Thread Lachlan Musicman
If it's in the app itself, try import .models? On 9 January 2014 15:27, Don Fox wrote: > In my manage.py shell I can load the following module: > from userprofile.models import NPIdata > > However inside a file of utility functions located in the userprofile app > the same import statement yiel

Re: Django Install Error: " SyntaxError: future feature unicode_literals is not defined "

2014-01-08 Thread Mark Moss
What's the version of python you are using? Django 1.5 has dropped support for Python 2.5 (*see here * and *here

Re: Question about the __unicode__()

2014-01-08 Thread Babatunde Akinyanmi
Think about it like this. A class is a box with something inside. The __unicode__ method is putting a label on the box to describe what is inside the box. The label doesn't have to be there and if its there, it can have anything written on it (which should make sense to the person writing it). The

Re: Question about the __unicode__()

2014-01-08 Thread Igor Korot
Tundebabzy, I understand that. But at the same time it should make some sense, otherwise what is the point of having this label (__unicode__() function), right? Thank you. On Wednesday, January 8, 2014 3:03:58 PM UTC-8, Igor Korot wrote: > > Hi, ALL, > In the tutorial it is said that I need to

Re: Question about Django X_FRAME_OPTIONS setting

2014-01-08 Thread Chen Xu
Ah thanks, good point. There are different ways of doing it, I am just wondering if Django itself have ALLOW_FROM as a valid value since it has deny and sameorigin. On Wed, Jan 8, 2014 at 3:41 PM, ernando wrote: > Hi Chen, > > Do you really need to set it via Django? Usually it's done via we