>
> def login(request):
> html = "HI"
> get_template('prova.html')
> return HttpResponse(html)
--
Andy McKay
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django us
On Mon, Feb 6, 2012 at 9:04 AM, xina towner wrote:
> How can I check the template of a view??
..
> self.assertTemplateUsed(resp, 'name_of_the_template', 'Bad
> Template')
Yes, the docs on assertTemplateUsed are at:
https://docs.djangoproject.com/en/dev/topics/testing/#django.test.TestCa
> The Django crowd seems to prefer PostgreSQL collectively, but I know
> there are a million sites out there using MySQL, so that would
> probably resonate with people. Sort of the "frank Wiles of the mySQL
> world"?
+1 on good MySQL speakers, whilst its not preferred by many, its very
under repre
You can define multiple caches:
https://docs.djangoproject.com/en/1.3/topics/cache/#django-s-cache-framework
You could then use a file system cache or your own local memcache.
https://docs.djangoproject.com/en/1.3/topics/cache/#filesystem-caching
You can then get that cache and access it in you
You can define a custom test runner to do this. For example:
https://docs.djangoproject.com/en/dev/topics/testing/#django.test.simple.DjangoTestSuiteRunner.setup_databases
On Wed, Feb 8, 2012 at 7:42 AM, xina towner wrote:
> Yes, but django makes a new testDatabase and that's my problem, I want
On Fri, Feb 10, 2012 at 4:01 PM, dslowik wrote:
u.get_all_permissions()
> set([u'wb.delete_libraryitem', u'wb.change_libraryitem'])
u.has_perm("wb.change_libraryitem")
> True
>
> ...Shouldn't that be False?
Why would it be False? get_all_permissions: Returns a set of
permission strings
Please give us the full traceback and exact line of code it occurred
on. There isn't enough information right now.
On Sun, Feb 26, 2012 at 1:38 PM, Mario Gudelj wrote:
> In print 'time' what's time? Should you not have print exp_datetime?
>
>
> On 27 February 2012 01:27, Stanwin Siow wrote:
>>
>
You can return whatever you want. All depends how you are using the result.
On Sun, Feb 26, 2012 at 5:48 PM, Stanwin Siow wrote:
> It's ok guys!
>
>
> I figured out the error.
>
> At the end of the method we were returning 0 and 1 that will throw the
> error.
>
> Is there some rule in django that
> Any idea what is the best way to accomplish this?
Sort the list in Python in your view. Its easier to do, easier to test
and easier to maintain.
--
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
On Wed, Apr 4, 2012 at 12:50 PM, Homer wrote:
> Should I add something else so that it would work? Thanks for your help!
There's nothing I've seen yet that's a Django problem. Does the
outputted HTML look right? Does that work? If not tell us and we'll
see if we can help you figure out how your
That's not something I'd ever recommend an untrusted user do. There
are still many ways that could go wrong. The safest execution
environment I've seen for Python is App Engine, send a callback to
that instead :)
--
You received this message because you are subscribed to the Google Groups
"Djang
own servers and
excuting them there.
On Apr 14, 2012 11:43 AM, "Arruda" wrote:
> Is this what you're talking about?
> https://developers.google.com/appengine/docs/python/overview
> Still don't understand how this would be used.
>
> Em sábado, 14 de abril de
> @patch('apps.market.models.House')
Is create house in apps.market.models, or is it somewhere else? If
it's somewhere else, mock it relative to that file eg:
@patch('apps.some_file.House')
> I'm also wondering if it's possible to inspect MockedHouse to see if it has
> for example some tags adde
What does your form code look like?
--
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
Run django debug toolbar, see what queries you are running and how
long they take and that you've got database indexes set up.
Failing that, run a middleware or other logging tool to tell you slow
pages. Then test with django debug toolbar. Rinse and repeat.
--
You received this message because
Change your code so you don't have to. Relying on a restart for that
is the wrong approach.
--
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
> A plumber is mostly manual labor which will take a toll on the body over the
> years.
Programming too takes its toll on the body over time (make sure you
have a nice ergonomic setup). The relentless march of technology means
that the length of a programmers career is shorter than many jobs,
incl
You can hook into the model signal so that when the model changes, you
do you calculation and change your models.
https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save
--
You received this message because you are subscribed to the Google Groups
"Django users" gro
Use include to pull in values from other apps inside your urls.py
https://docs.djangoproject.com/en/dev/topics/http/urls/#including-other-urlconfs
On Tue, May 22, 2012 at 11:49 AM, siddharth56660
wrote:
> Hi,
> I am developing an ERP system which is vast and covers many modules.
> After developi
> Somehow create a standalone django app that is the same as the online one
> and then have it synchronize when it goes back online. Something ala Google
> Gears / HTML5. But not done anything like this and I'm not sure how
> complicated the synchronizing would be and I'm reluctant to roll out djan
> Now they want me to add to that how long
> the browser takes to render the page after it gets the data.
You can use the navigation timing API:
https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
We use this in conjuction with graphite and django-statsd to produce
g
> I'm trying to use the Navigation Timing package to measure how long a
> page takes to be rendered.
So you don't want to include all the lookups? Just the "rendering" part?
> So that would be loadEventEnd-responseEnd,
> however I am finding that loadEventEnd is always 0 for me, even though
> I a
> Thanks Andy. Super cool, and pretty much just what I was looking for.
> Seems to work fine in FF and Chrome, but in Safari I don't seem to
> have access to the performance.timing data. Should that be there or do
> I have do something to load or enable it?
Sadly, Safari does not support this :( Y
> cursor.execute("SELECT
> GetDirectionDescr("+str(nod_id1)+","+str(nod_id2)+") from sys.dual")
Please note that code means that you might be open to SQL injection.
You should be using the parameters for SQL, see:
https://docs.djangoproject.com/en/dev/topics/db/sql/#passing-parameters-i
es it. Then
when read it does the reverse turning it back into a string.
You'll have either to alter that behaviour or find another way around.
[1]
https://code.djangoproject.com/browser/django/trunk/django/utils/safestring.py#L89
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
ors or simply timing out on HEAD requests"
Sounds like similar is happening here.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dja
7;:'hello', 'safe':True} and then cope with it when you deserialize.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djan
On 2011-08-23, at 4:17 AM, smith jack wrote:
> i mean not use django for web site development, but for desktop application,
> it seems its orm can be used in destop application, isn't it?
Yes.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message
don't involve parsing the entire tree, as far as I
remember: http://docs.python.org/library/markup.html
But I would take the XML and store the bits you need in a more efficient format.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are
On 2011-09-02, at 4:58 AM, Yaşar Arabacı wrote:
>
> Is there a way to test whether or not a 3rd party url shortener works. What I
> have in mind is this:
Sure, python has libraries like urllib for dong that sort of thing.
http://docs.python.org/library/urllib.html
--
Andy
You could write a Python process that starts up a Socket Server and imports
all the Django stuff, just like the current server does for HTTP. Then
there's no need to "send the data to django". Might help:
http://docs.python.org/library/socketserver.html
On Mon, Sep 19, 2011 at 2:00 PM, Micke wro
with Django. Our codebase is rather big so might be hard to
follow, but the key PayPal stuff is here:
https://github.com/jbalogh/zamboni/blob/master/apps/paypal/__init__.py
It doesn't answer your question, but gives you something to look at ;)
Cheers.
--
Andy McKay
a...@clearwind.ca
ort order. So relax, don't worry about
it. Instead give each signal a unique dispatch_uid:
https://docs.djangoproject.com/en/dev/topics/signals/#preventing-duplicate-signals
This makes disconnecting signals easier as well.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You rec
n't being imported. Stick a print
statement in the module to confirm this is the case. If so, import them.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this gro
Is this using the Django built in runserver or some other way of serving
pages? If not try using runserver.
--
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 t
Inspecting your stack to find the user seems a pretty convoluted way to do
it.
You could either a) not access users in your models b) explicitly pass the
user around or c) just place your user into a local threading and retrieve
it anywhere else for example:
https://github.com/andymckay/arecibo/bl
On Mon, Jan 2, 2012 at 12:25 PM, Waldek Herka
wrote:
> c) local threading way posted by you is not as straight
> forward as it looks - I'd say it's very similar in complexity to
> mine.. you still need to explicitly call 'activate' somewhere(view
> method)
Middleware can do that just fine.
--
On Thu, Jan 12, 2012 at 9:50 AM, John DeRosa wrote:
> url(r'^results/text/(?P)/$', 'textresults',
> name='exporttextresults')
One guess, you haven't specified what the (?P in your regex accepts.
For example:
(?P\w+)
--
You received this message because you are subscribed to the Google Gr
On Feb 22, 2013, at 3:18 AM, R R wrote:
> I was wondering if there are any tools to benchmark DB transactions using the
> Django ORM. I'm using PostGreSQL with Django 1.4. I'm required to compare and
> come up with the best possible database design for a project which will have
> millions of r
On Tue, Mar 12, 2013 at 5:42 PM, frocco wrote:
> I want to run the code below in a file called migration.py
django-extensions will do this for you, if you create a run method.
http://blog.brendel.com/2012/01/how-to-use-djangextensions-runscript.html
--
You received this message because you are
On Thu, Aug 8, 2013 at 12:41 PM, Robin Lery wrote:
> How do i create a Friendship model? Please guide me.
>
You would need to provide more detail to get much help. The tutorial covers
how to make models:
https://docs.djangoproject.com/en/dev/intro/tutorial01/
--
You received this message beca
Any string can be rendered as a template. This is covered pretty well in
the docs:
https://docs.djangoproject.com/en/dev/ref/templates/api/
For example:
>>> from django.template import Context, Template
>>> t = Template("body { background-color: {{ bgcolor }} }")
>>> c = Context({'bgcolor': '#99
The Vancouver Python User Group and the Vancouver Django Meetup Group are
pleased to announce:
Vancouver Python Day
Saturday, November 16, 2013
SFU Harbour Centre
Part of Vancouver Developer Week 2013, Vancouver Python Day is a one-day
mini conference celebrating the Python Developer Community in
Hi Djangonauts!
We've just set the deadline for Vancouver Python Day talk proposal
submissions. All talk proposals must be submitted by *Thursday, October 17,
2013 at 23:59 Pacific Time*. See
https://github.com/andymckay/vancouver-python-day for instructions on
submitting a talk proposal. All Pyth
Just wanted to make people aware that each month the board of the Django
Software Foundation meets. The minutes of each meeting are published here:
https://www.djangoproject.com/foundation/records/
If there's anything you'd like discussed at the next board meeting, please
contact us at:
https://
We're pleased to announce that tickets for Vancouver Python Day will be
released on Friday, October 25 at 10AM. You can purchase tickets at
http://vanpyday.eventbrite.com/
Space is extremely limited, so we advise buying your tickets as early as
possible if you plan to attend. Thanks to our generou
have another user database where you can store data
particular to you application such as session and profiles since your other
databases sound immutable?
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Groups
&q
delChoiceField. Since one
is a form and one is a field. You can create a ModelForm given a Model and its
instance or primary key as outlined here:
http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#modelform
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You receive
oiceField back into the object ids.
new_dict = form.cleaned_data.copy()
new_dict['option'] = new_dict['option'].pk
Might work. You should then be able to cleanly store that in a session and
repopulate forms with it again later.
--
Andy McKay
a...@clearwind.ca
twitt
On 2011-05-03, at 2:05 PM, Seth Gordon wrote:
> I get an exception, complaining that Target.source does not allow
> null values.
You'll probably want to allow null values on your OneToOne field then:
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.nul
On 2011-05-03, at 2:05 PM, Seth Gordon wrote:
> I get an exception, complaining that Target.source does not allow
> null values.
You'll probably want to allow null values on your OneToOne field then:
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.nul
e unlikely to be able to help.
But here's a bet:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
The example for DecadeBornListFilter shows how you can define a custom queryset
and perhaps this will allow you to filter out disabled rows
tial
model.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
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
On 2011-05-06, at 7:01 PM, Robert Ray wrote:
> I''im using Django 1.3 with Djcelery and Djkombu on Windows7. When I'm
> Can anyone give me any help? Thanks in advance!
You are using sqlite? Don't use that, use postgresql instead.
--
Andy McKay
a...@clearwin
/ref/contrib/sites/?from=olddocs
The tutorial is a good place to start:
http://docs.djangoproject.com/en/dev/intro/tutorial01/
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
internet about this. Here's a couple:
http://blog.moertel.com/articles/2006/12/15/never-store-passwords-in-a-database
http://www.codinghorror.com/blog/2007/09/youre-probably-storing-passwords-incorrectly.html
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received thi
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
> 41: ordinal not in range(128)
There's some helpful information on this error from Google, here's one of them:
http://wiki.python.org/moin/UnicodeDecodeError
--
Andy McKay
a...@clearwind.ca
> Exception Type: TypeError at /admin/main/learndjango/add/
> Exception Value: 'float' object is not callable
Please paste your model that is having the problem.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscrib
els/fields/#floatfield
Not sure off the top of my head why you get that error though.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
):
def __init__(self, *args, **kw):
kw['instance'].click_through = True
super(MyForm, self).__init__()
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Groups
"Django users" g
while rendering: Reverse for 'profile_detail'
> with arguments '('',)' and keyword arguments '{}' not found.
Hence it can't find the matching url.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are
http://ask.github.com/celery/getting-started/introduction.html
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
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@googlegro
p.
> 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.
>
--
Andy McKay
r mock and check that under different
conditions it is called correctly.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-
hey are longer around - IRC will still be there :)
The #django IRC channel and all the other channels for all the other projects
(celery, gevent, postgres, mysql etc) can be great. I'd recommend them as a
great help channel to everyone.
--
Andy McKay
a...@clearwind.ca
twitter: @a
On 2011-07-07, at 2:22 PM, John Fabiani wrote:
> I'm wondering if anyone has had any success with PhoneGap and Django?
Yes.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Groups
"Django users"
com/en/dev/ref/contrib/csrf/#exceptions
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
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 t
eField.
http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
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@goog
cs.djangoproject.com/en/dev/ref/request-response/#httpresponse-objects
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
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@google
t equal to
'cbSMWord'
> return render_to_response('c:/Python27/Scripts/Spokas/web.html',
> {'cbSMWord':cbSMWord}, context_instance = RequestContext(request) )
Also, you should not be specifying the full path to templates, let the template
loader do that
You've got a syntax error in your code, likely wherever you have
"return Poll.objects.filter(" in your code.
"Outside a function" likely means that you have not correctly indented
your code, for example if your return has no indentation. Whitespace
in Python is significant and is part of the synta
On Sat, Mar 1, 2014 at 12:39 PM, Andreas Kuhne
wrote:
> The main difference is that you can use redis as a session cache for
> django (save the session objects to memory instead of the database), which
> I haven't found a solution for memcache yet.
>
Memcache works just fine as a session backend:
101 - 172 of 172 matches
Mail list logo