Hi Alex, here is a small example of a JSON response. I don't mix HTML
and JSON personally (I use HTML pages and then fetch JSON via AJAX
calls so).
Here is a fragment of code from one of my views:
t = loader.get_template('members/member_info.json')
c = Context({'member_set':member_set})
On Jun 16, 8:20 am, MH wrote:
> Hi,
> I'm making a model, that has a bit complex dependencies between the fields,
> such as date progression (start_date must not be later than finish_date).
> I'm looking for a way to validate these dependencies while creating (or
> saving) the model, but I am not
Hi!
finn wrote:
> Now to the problem: a lot of people who needs websites have heard of
> Drupal or Joomla! or WordPress or PHP. But NOBODY has EVER heard about
> Django.
That's because Django is not a CMS. You cannot take it, install onto web
site and start adding content. With CMS you do exactl
Django has an escapejs filter so if you're using a template to
generate json you'd be safer doing, e.g.:
"first_name":"{{ one_member.first_name|escapejs }}"
That way if someone sticks something untoward (like a double quote) in
your first_name or last_name fields it won't break things :).
For th
On Jun 17, 6:40 am, Sheena wrote:
> Thanks
>
> The question is how do I populate a field with some other date, for
> example, there's a date of birth field that the auto stuff wont be
> ideal for...
> In the populate method i mentioned before, i passed the dob(date of
> birth) field a Date object
Hi!
Matt Hoskins wrote:
> return HttpResponse(simplejson.dumps(data),mimetype='text/plain)
Small correction: mime type should be application/json.
--
Dmitry Dulepov
Twitter: http://twitter.com/dmitryd/
Web: http://dmitry-dulepov.com/
--
You received this message because you are subscribed to
On Thu, Jun 17, 2010 at 12:26 AM, finn wrote:
> Hi,
>
> I have with interest followed the thread "Seeking Django vs. Joomla
> comparison", and it has inspired me to start this new thread.
>
> I consider myself a Python/Django programmer, and I do so because my
> experiences with a number of progra
Any py gurus?
On Wed, Jun 16, 2010 at 8:42 PM, Radhakrishna wrote:
> This may be very silly, but I cant figure out the problem. Everything
> seems to be in place.
> I have deployed my django project to Apache using mod_wsgi. In urls.py
> I am mapping "gateway/" to gateway.py which imports 'pyamf'
Hi!
Radhakrishna wrote:
> I have deployed my django project to Apache using mod_wsgi. In urls.py
> I am mapping "gateway/" to gateway.py which imports 'pyamf' module.
> The problem is, even though pyamf module is in python path, its not
> able to find it. I can import it from command line and when
I was just copying Ian's choice of mimetype - see Ian's comment above
"I choose text/plain deliberately but you might choose text/json (or
something else)."... Although it's worth pointing out that "text/json"
shouldn't be used, since "application/json" is, as you rightly point,
the mimetype for js
That's how I solved it, but I was wondering if there were something
more official :)
On Wed, Jun 16, 2010 at 20:27, patrickk wrote:
> I don´t think there is (although this issue has already been discussed
> years ago) - no ability to change apps-name and/or app-translations.
>
> you could use a
On Jun 17, 6:28 pm, Dmitry Dulepov wrote:
> Hi!
>
> Radhakrishna wrote:
> > I have deployed my django project to Apache using mod_wsgi. In urls.py
> > I am mapping "gateway/" to gateway.py which imports 'pyamf' module.
> > The problem is, even though pyamf module is in python path, its not
> > a
if i have a project with domain example.com and it's deployed as 3
wsgi apps:
- www.example.com
- admin.example.com
- api.example.com
is there something in settings.py that should be shared across wsgi
apps except SESSION_COOKIE_DOMAIN?
i can't figure out if i should use the same SECRET_KEY in all
Sorry, other posters have picked up two of my errors.
It is a while since I used application/json and I was running on
(incorrect) memory. My reasoning for using plain text is as follows.
I regard parsing JSON using eval() as a security risk on the client
side. If you have complete control of th
On Jun 17, 10:31 am, Ian McDowall wrote:
>
> In some cases, I don't use templates to build a JSON response. It can
> be straightforward to write it as a string inline. I don't personally
> yet use the built in Python JSON module as I don't want to limit the
> Python versions that I can deploy
Thanks all!
I will try a combination of these pointers. server/client
communication patterns seems to be a recurring theme (or nightmare!)
of mine.
This conversation has been very helpful and reassuring - I can see
that the hard and fast rule is 'when in doubt, json it'
i am using this link
http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-deployment-modwsgi
In this link i am unable to under stand topic SERVING MEDIA FILES
the lines(given below) which is used in this tutorial , i am able
understand where we edit this line , if its edit in ap
On Jun 17, 9:17 pm, Jagdeep Singh Malhi
wrote:
> i am using this
> linkhttp://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-...
>
> In this link i am unable to under stand topic SERVING MEDIA FILES
> the lines(given below) which is used in this tutorial , i am able
> understan
I have been thinking about this for a while and am writing this
because everything said so far interests me greatly...
I am not a qualified django developer (yet), but have been
successfully building commercial sites for over ten years with the
last five in python/zope/plone. I love the pluggabil
The automatic documentation generated, via docutils, in the admin
interface for a django app does not pull in documentation for methods
defined for classes, only attributes. Is this a "feature" of the
django implementation or docutils?
Thanks,
P.K.
--
You received this message because you are su
On Thu, Jun 17, 2010 at 1:14 AM, Russell Keith-Magee
wrote:
> On Thu, Jun 17, 2010 at 5:40 AM, Peter Bengtsson wrote:
>> This is a new feature of Django 1.2. I'm curious, why does it want to
>> do this? I want to control this for my settings so that I can things
>> like disabled verify_exists on
> plug and play. A manager/developer making the decisions on a platform
> for their next project should be able to download django and just plug
> in the functionality he/she needs. Dependencies will exist but that's
> normal.
> If all that would happen django would be an easy choice for anyone
Without any filtering, I can execute the following SQL query to get my
ordered data:
SELECT * from EXECUTION_JOB ORDER BY GREATEST(startTime, queueTime)
DESC;
But in Django, it seems like the order_by only likes passing of field
names, not a function call.
Is there a way to have it bass a raw O
@Matt
You are correct. The "drupal/joomla/plone/wordpress space" does exist
and it is where most people (non-developers) look first. These are
the people who need to perceive django in a more positive light if the
goal is to increase django market share. They are the people who hire
you and I.
Hi all
i have an application in django that is used by our academics to apply
for approval for projects
So it will be used by many different people many of whom will be cut
and pasting scientific information from MS Word into text fields in
django forms
Underneath it all is an oracle database (t
Running Django 1.2.1 with Python 2.6
I am trying to create a simple test tag (the more complex ones are not
working either...).
In the templatetags directory, I have this code in the my_tags.py file:
from django import template
register = template.Library()
@register.tag
def foo(eggs=None, spam
On Jun 17, 5:44 am, rahul jain wrote:
> Hi there,
>
> I have some filters set-up on admin page. As soon as I perform admin
> action. All filters are getting reset.
>
> Is this is a bug from framework ?
No. There are work-arounds to get back to these; Google this group
for suggestions.
--
You r
On Thu, Jun 17, 2010 at 10:06 PM, Richard Shebora wrote:
> @Matt
>
> You are correct. The "drupal/joomla/plone/wordpress space" does exist
> and it is where most people (non-developers) look first. These are
> the people who need to perceive django in a more positive light if the
> goal is to in
On Jun 17, 4:11 pm, Derek wrote:
> Running Django 1.2.1 with Python 2.6
>
> I am trying to create a simple test tag (the more complex ones are not
> working either...).
>
> In the templatetags directory, I have this code in the my_tags.py file:
>
> from django import template
> register = template
Richard,
That is where most people who are looking for something *in that
space* look first - i.e. they have a set of requirements where those
platforms are a good fit for what they're trying to do, but it isn't
the only space. Those people aren't the people who pay my wages at
present because, as
If you want to get a response. Why don't you make a minimal example?
>From your email I do not understand what your problem is. I thought
you want to generate a file like the one you posted but what about all
that Django stuff?
What do you want to do? Is it correct, that you want a file with (x,y)
In this case you want to use extra(). Assuming jobs is a QuerySet or
Manager instance:
jobs = jobs.extra(select={greatest_time': 'GREATEST(startTime, queueTime)'})
jobs = jobs.extra(order_by=['-greatest_time'])
On Thursday, June 17, 2010, Kyle wrote:
> Without any filtering, I can execute the fo
This is also one of the things I like most about Django. It's helpful, but
not so much that it gets in the way or makes doing anything "outside the
box" difficult.
But, I'm just a newbie who's learning and doing lots of stuff wrong. But, I
continue work in Django because it seems like a sound in
On Wed, Jun 16, 2010 at 5:14 PM, aurel...@gmail.com wrote:
> Thanks Karen!
>
> Django 1.0 Web Site Development book (code example is from that book)
> has following paragraph:
> "By specifying correct field types in our form, we don't have to
> implement any
> additional input validation. For exam
Sir Graham
my actual problem is this :-
Myhttp://localhost/admin/ is display in pattern without grapic or
image not like that which is shown in Tutorial
http://docs.djangoproject.com/en/1.2/intro/tutorial02/#intro-tutorial02
MY admin page (http://localhost/admin/)
Django administration
Wel
Russ,
Yes, I did at first see this as one issue. I see that your
"Enterprise" site should not define best practices but at most refer
to them as further reading. My email addresses the same issues as Tom
and Venkatraman above. Thanks for explaining.
Thanks,
Richard Shebora
On Thu, Jun 17, 201
Matt,
Between you and Russ I see what you mean. I will contact Tom and
Venkatraman regarding their concept to see how I can help. I am not
proficient with django's paradigm yet, but I can get better in the
process.
Thanks,
Richard Shebora
On Thu, Jun 17, 2010 at 11:36 AM, Matt Hoskins wrote:
Not really. Giving them a different secret key won't make much
difference. Just make sure your site id is the same.
On Thu, Jun 17, 2010 at 11:22 AM, Aljosa Mohorovic
wrote:
> if i have a project with domain example.com and it's deployed as 3
> wsgi apps:
> - www.example.com
> - admin.example.com
On Jun 18, 3:53 am, Jagdeep Singh Malhi
wrote:
> Sir Graham
> my actual problem is this :-
>
> Myhttp://localhost/admin/is display in pattern without grapic or
> image not like that which is shown in
> Tutorialhttp://docs.djangoproject.com/en/1.2/intro/tutorial02/#intro-tutorial02
>
> MY ad
On Thursday 17 June 2010 19:36:18 Richard Shebora wrote:
> You are correct. The "drupal/joomla/plone/wordpress space" does exist
> and it is where most people (non-developers) look first. These are
> the people who need to perceive django in a more positive light if the
> goal is to increase djan
This thread shows a very prevalent side of most developers that makes
me ashamed to tell people that I'm a developer.
The OP is not saying that we should go out and advertise that Django
is a great CMS. In fact he spends half of his post making trying to
preemptively shut all the know-it-all folks
You're getting a recursion error because you're trying to extend admin/
change_form.html with itself. In other words your copy of admin/
change_form.html in the directory location you have is the default
admin/change_form.html template now...
You can either:
1. Copy the entire admin/change_form.ht
Kenneth,
You are right... of course.
However, I am not trying to disguise django as a cms, just trying to
say it would be great to have a best practices declaration for a cms
within django. And for all the other great modules that don't yet
play well together out of the box.
Thanks,
Richard She
hi
I have a problem - there is a model called Player with first_name and
last_name. There is a unique_together constraint on first_name and last_name.
However I find that the people doing data entry have been entering things like
Ram Sharan and RAM SHARAN which are two different names. Of cours
Use South data migrations.
Sent from my iPad, in accordance with the prophesy.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
On Jun 17, 8:50 am, "c.poll...@bangor.ac.uk"
wrote:
> Hi all
>
> i have an application in django that is used by our academics to apply
> for approval for projects
>
> So it will be used by many different people many of whom will be cut
> and pasting scientific information from MS Word into text f
46 matches
Mail list logo