Thanks RequestFactory does exactly what I needed it is a pity that I
had ignored it while going through the docs.
There is however one question I have is it possible to check what
template was used to render the content. The assertTemplateUsed()
method looks for a response.templates attribute that
heya,
Also, I noticed that there's no models.py file in the first app that
startproject
creates - I assume this is by design, right?
Hmm, what's the rationale behind it?
Cheers,
Victor
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view
heya,
*NB: Not sure if this belongs in dev or general, but I'm assuming here -
please let me know if I'm wrong.*
I just noticed there was a change made to startproject/startapp, and the
default Django layout in trunk (yes, I'm a bit behind the curve...haha).
https://code.djangoproject.com/chan
Thank you, that is a very helpful suggestion.
However, I have a followup question. What are my options if:
1. It is okay to be slow (low performance), and
2. The method must work on any webserver, not necessarily or
specifically Apache or Nginx.
In pure Python/Django, how do I open a file on the
On Tuesday, 8 November 2011 18:39:12 UTC, jay K. wrote:
>
>
> Hello,
>
> Is there any way I could retrieve information about a template,
> such as template name, url, etc inside a view? is there built-in
> object that represents the template object?
>
> thanks
>
> regards
>
>
You seem confuse
On Tue, Nov 8, 2011 at 2:11 PM, zak2011 wrote:
> Dear Django Users,
>
> tl;dr: Please tell me what strategies I might use to serve a large
> static file from within Django, from views.py.
>
> If I want to limit access to a particular page in a Django app, I can
> do something like this in views.p
Dear Django Users,
tl;dr: Please tell me what strategies I might use to serve a large
static file from within Django, from views.py.
If I want to limit access to a particular page in a Django app, I can
do something like this in views.py:
(Note: I will use four periods to indent, because spaces
I'm investigating this as well. I just read that using the natural
keys dumpdata option might help.
https://docs.djangoproject.com/en/dev/topics/serialization/#topics-serialization-natural-keys
On Oct 28, 9:48 am, ycseattle wrote:
> Hi,
>
> In my application, I have fixed groups (like admin, sta
I have the following models
class Group(models.Model):
name = models.CharField(max_length=32, unique=True)
class Subgroup(models.Model):
name = models.CharField(max_length=32, unique=True)
group = models.ForeignKey(Group)
class KeywordsList(models.Model):
name = models.CharField(
Hello, Tom
thanks for your answer
I believe it can be done like the way you suggested
I should clarify that I am new to django and have no web developing
background, so
my questions may sound a bit silly sometimes
I got another one, if you dont mind
how can I retrieve information on a template
Hello,
Is there any way I could retrieve information about a template,
such as template name, url, etc inside a view? is there built-in
object that represents the template object?
thanks
regards
--
You received this message because you are subscribed to the Google Groups
"Django users" group
2011/11/8 Andres Reyes
> I've been using django-compressor and totally recommend it
>
>
> https://github.com/mintchaos/django_compressor
>
>
>
I second that, works like charm and I really like the way it solved the
thing with a templatetag instead of having to define file groups on
settings.
Re
Found the answer while reading the piston documentation:
curl -H "Accept: application/json" http://127.0.0.1:8000/api/";
The -H option allows to pass a custom header to the server.
Best,
Benjamin
--
You received this message because you are subscribed to the Google Groups
"Django users" group
I've been using django-compressor and totally recommend it
https://github.com/mintchaos/django_compressor
2011/11/8 Gelonida N
> Hi,
>
>
> I'm having an rather weak (CPU) server accesible over a rather slow
> network.
>
> Therfore my plan is to use
> multiple readable debuggable css files for
I'm new to APIs and played around with
https://github.com/funkbit/django-dynamicresponse
today.
I get no errors, but it seems that I'm not able to call the API
correctly.
I configured the URLs so that the view available under
http://127.0.0.1:8000/api/
returns SerializeOrRender.
But when I call
The validation error happens when the formset is passed an empty
dictionary. The docs (release notes for 1.3) suggest passing None instead.
So doing this should fix the problem:
>
> TenantFormset(data=self.data or None, instance=instance,
prefix='TENANTS_%s' % pk_value)
In my case, which is sim
I'm using the development version of django-formwizard
(https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/),
how could I send parameters through a url to a wizardview ?
this is mi url: r'^buscar/control/(?P\d+)',
form_control_nino.as_view([ ControlForm,], )
thanks
--
On Tue, Nov 8, 2011 at 5:02 PM, Chase wrote:
> I agree that the kind of queries that are repeated tend to be light
> weight ones. The only reason I started looking at this was due to some
> higher than average latency between servers in our hosting
> environment.
>
> When you're spending an extra
I agree that the kind of queries that are repeated tend to be light
weight ones. The only reason I started looking at this was due to some
higher than average latency between servers in our hosting
environment.
When you're spending an extra 10m per query, even the light ones
count.
http://bitkick
Hi
Is there a recommended way to set default doctest options?
(per doctest, per app, or even per project would be ok)
I'm thinking of REPORT_NDIFF in particular, which is essential when
testing large xml serializations and such.
Tobia
--
You received this message because you are subscribed to
On Tue, Nov 8, 2011 at 4:46 PM, Nicolas wrote:
> Dear all,
> I'm almost at the end of the tutorial part 2 but I can't manage to
> change "Django administration" to something different. What I did:
> - create a template/admin subdirectory into the folder containing all
> the files related to mysite
Dear all,
I'm almost at the end of the tutorial part 2 but I can't manage to
change "Django administration" to something different. What I did:
- create a template/admin subdirectory into the folder containing all
the files related to mysite (it looks like this; C:/Users/songbird/
Documents/mysite/
On 11/08/11 01:13, Kevin wrote:
These ~5% of your userbase is most likely like myself, where I
block all cookies and add specific sites to an exception
list.
...
Another idea is to fetch the form via AJAX and render it
using Javascript onto the page.
Just a note: if these ~5% are taking the p
On Tue, Nov 8, 2011 at 4:07 PM, Chase wrote:
> Has anyone else ever been surprised by the number of duplicate
> database queries when looking at the Django debug toolbar output?
>
> In my application, we have models for Users, Profiles and Companies.
> Many of our methods take a user as a paramete
2011/11/8 Andre Terra :
> I stand corrected. I must have read the OP too fast. Well, I believe it's
> been answered then! :)
If it was a typo, having 'bar' in context whoulnt have sense.
Thanks for your time, I will go Tom Evans way with dict_get tag, as I
dont see how to prepare my context bette
Has anyone else ever been surprised by the number of duplicate
database queries when looking at the Django debug toolbar output?
In my application, we have models for Users, Profiles and Companies.
Many of our methods take a user as a parameter, and then look up the
related profile and/or company.
I stand corrected. I must have read the OP too fast. Well, I believe it's
been answered then! :)
Cheers,
AT
On Tue, Nov 8, 2011 at 12:51 PM, Tom Evans wrote:
> On Tue, Nov 8, 2011 at 2:31 PM, Andre Terra wrote:
> > Actually, judging by his 'context' variable, he is not. I'm attributing
> > th
2011/11/8 Andre Terra :
> I think you have a typo! Try {{ foo.baz }} instead ;-)
No, no typos here. I dont want to do foo["baz"], but foo[bar] (in my
case, i want to iterate over an ordered list and work with values from
dictionary which has keys equal to list items)
Ax
--
Hůla Václav
Přírodověd
When I need something like you want, I usually use RequestFactory to create
the request and call the view directly.
You can see an example here https://gist.github.com/1348085
Hope that helps ;)
[]'s
On Tue, Nov 8, 2011 at 12:21 PM, nav wrote:
> Dear Folks,
>
> While testing my application I
On Tue, Nov 8, 2011 at 2:31 PM, Andre Terra wrote:
> Actually, judging by his 'context' variable, he is not. I'm attributing
> the"foo[bar]" (sic) in his question to a newbie typo, rather.
>
>
I don't particularly want to argue this point, but:
A dictionary in the context named "foo" , with a ke
Actually, judging by his 'context' variable, he is not. I'm attributing
the"foo[bar]" (sic) in his question to a newbie typo, rather.
Cheers,
AT
On Tue, Nov 8, 2011 at 12:28 PM, Tom Evans wrote:
> 2011/11/8 Andre Terra :
> > I think you have a typo! Try {{ foo.baz }} instead ;-)
> >
> >
>
> No
2011/11/8 Andre Terra :
> I think you have a typo! Try {{ foo.baz }} instead ;-)
>
>
No, look closer, he's trying to do variable interpolation.
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 dj
On Tuesday 08 November 2011,
"Hůla, Václav" wrote:
> Hello.
> How I do equivalent of foo[bar] in template? From documentation it
> looks like it should be done automatically - see
> https://docs.djangoproject.com/en/1.3/ref/templates/api/#render
>
> But:
> >>> from django.template import Context
I think you have a typo! Try {{ foo.baz }} instead ;-)
Cheers,
AT
2011/11/8 Hůla, Václav
> Hello.
> How I do equivalent of foo[bar] in template? From documentation it
> looks like it should be done automatically - see
> https://docs.djangoproject.com/en/1.3/ref/templates/api/#render
>
> But:
>
Dear Folks,
While testing my application I found out that the middleware that
implements process_request is not run. This is fine as long as I can
add the required field to the request object before passing the
required URL to self.client.get().
what I want to do is something like this
request.f
2011/11/8 Hůla, Václav :
> Hello.
> How I do equivalent of foo[bar] in template? From documentation it
> looks like it should be done automatically - see
> https://docs.djangoproject.com/en/1.3/ref/templates/api/#render
>
> But:
>
from django.template import Context, Template
t = Template
Hello.
How I do equivalent of foo[bar] in template? From documentation it
looks like it should be done automatically - see
https://docs.djangoproject.com/en/1.3/ref/templates/api/#render
But:
>>> from django.template import Context, Template
>>> t = Template("Will ot work? {{ foo.bar }}")
>>> con
On Tue, Nov 8, 2011 at 12:25 PM, Andre Terra wrote:
> On Tue, Nov 8, 2011 at 12:40 AM, Russell Keith-Magee
> wrote:
>>
>> If you ask a query to output its SQL, what is displayed is not exactly
>> equivalent to what is passed to the underlying query engine. Django
>> uses a standard Python databas
On Tue, Nov 8, 2011 at 12:40 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:
> If you ask a query to output its SQL, what is displayed is not exactly
> equivalent to what is passed to the underlying query engine. Django
> uses a standard Python database API to access the database. That
>
You are passing one positional argument to your view with the value of 1L
(the L is for long integers), and an empty dict for the keyword arguments.
Check your mysite.polls.views.results URL mapping in urls.py and see what
it's expecting. My bet is that your missing a \d wildcard in your regex.
I
I just run into the tutorial part 4,and at the last of the psot. I got a
error message:
*Reverse for 'mysite.polls.views.results' with arguments '(1L,)' and
keyword arguments '{}' not found*
*
*
*who can tell me what's up?*
*thanks!*
--
You received this message because you are subscribed to t
I have documented a set of viz libraries:
http://blizzardzblogs.blogspot.com/2010/12/data-visualization-charts-and.html
-V-
--
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 u
On Tue, 2011-11-08 at 21:16 +1100, Mario Gudelj wrote:
> I'm a Django/Python beginner, but the above works for me and it plots
> the number of items per month, where the Y-axis is the number of items
> and X-axis is the month names.
I found it faster and more efficient to generate the DataTable us
On Mon, Nov 7, 2011 at 10:51 PM, M. Herold wrote:
> With that, I'm trying to link a static style.css file for development,
> but it's not working worth a damn:
>
> if settings.DEBUG:
> urlpatterns += patterns('',
> (r'^static/(?P.*)$', 'django.views.static.serve',
> {'document_root': 'st
Disclaimer: I am not a security expert
On Tue, Nov 8, 2011 at 7:13 AM, Kevin wrote:
> Yes, this will open your site up to attack, as most bots never send
> cookies. Take a look at how the shell programs curl and wget
> function, both of them never send a cookie, unless the user
> specifically ad
Hey, I implemented a line chart and this is my code:
View:
def render_chart(request):
months =
['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
month_values = [0,0,0,0,0,0,0,0,0,0,0,0]
list_of_items = MyModel.objects.all()
for item in list_of_items:
On Mon, Nov 7, 2011 at 11:58 PM, Markus Gattol wrote:
>
> Maybe sombody has given http://code.google.com/p/django-dmq and Mongrel2 a
> spin already and can report how it went? The reason I am interested is
> because it would allow me to get rid of WSGI altogether and have this stack
> (ZeroMQ b
Hi,
I'm having an rather weak (CPU) server accesible over a rather slow network.
Therfore my plan is to use
multiple readable debuggable css files for debugging and
a single, minizmized .js for for production.
This will affect some of my templates.
How do you handle this setup in your projec
48 matches
Mail list logo