Hi
I am writting a custom widget which I want to return a list as the value. From what I can find to set the value that is returned you create a custom value_from_datadict function. I have done this
def value_from_datadict(self, data, files, name):
value = data.get(name, None)
if value:
# split the sting up so that we...
My Web pages causes following error on the browser's Back Button,
It works fine for firefox but not on IE,
IE Says,
Most likely cause:
•The local copy of this webpage is out of date, and the website requires that you download it again.
What you can try:
Click on the Refresh button on the toolbar to reload the page. After refres...
I am making a multilingual Django website. I want the site to check from which country the user is accessing the website, and according to that decide which language to use.
What would be a good tool to use for that?
...
How can I break into a running test with the pdb interactive debugger?
This is the test:
class UserTestCase(TestCase):
def test_register_should_create_UserProfile(self):
c = Client()
response = c.post('/account/register/', {u'username': [u'john'], u'email': [u'[email protected]'], u'bnewaccount': [u'Signup']})
self.assert...
I know that the word “enterprise” gives some people the creeps, but I am curious to know if anyone has experience creating enterprise applications, similar to something like say… Java EE applications, which are highly concurrent, distributed applications with Django? I know Java has its own issues but its kind of viewed as THE enterprise...
What are common ways of implementing web API request throttling? Are there any libraries for common web frameworks (Rails, Django, Java, etc.) that give you this along with temporary banning?
A related question suggests that the rate limiting is done at the web server by limiting requests by IP, but that would mean that all requests are...
We are deploying django application, I found in the documentation that it is recommended to use WSGI appoach for doing that.
Before deploying I wanted to know, why it is recommended over other two approaches i.e. using mod_python and fastcgi...
Thanks a lot.
...
I have a simple Django app that has a variety of views of various different asset types. I have various jQuery functions that key off the asset type name and so when I generate the page using the django template I use a template variable to fill in the asset type parameter in the javascript code...
$(document).ready(function()
{
$...
I'm trying to test that a UserProfile model is created as a new User is registered in django_authopenid.
I don't understand how to add the Openid session data to the POST.
class UserTestCAse(TestCase):
def test_register_should_create_UserProfile(self):
from django.test.client import Client
c = Client()
response = c.p...
I am making a multilingual Django website. I created a messages file, populated and compiled it. I checked the site (the admin in this case,) in my wanted language (Hebrew) and most phrases appear in Hebrew like they should, but some don't. I checked the source and these still appear as _('Whatever') like they should, also they are trans...
I have 2 Models, User (django.contrib.auth.models.User) and a model named Log. Both contain an "email" field. Log does not have a ForeignKey pointing to the User model. I'm trying to figure out how I can perform a JOIN on these two tables using the email field as the commonality.
There are basically 2 queries I want to be able to per...
Hello,
Less or more I am building my site heavly on sessions(especially for redirecting users etc), I am curious if this a dangerous practice. What would be the rough percentage of users who have disabled their cookie saving with their browsers ? I am open to any suggestions :)
Thanks
...
I'm trying to make a generic table for listing django_tables objects. I've got everything working, except that the get_absolute_urls() on my User objects returns:
/users/<username>/
While I could create this URL, it doesn't match with the rest of the site layout, so I'm looking for another way to do this. Is there a way to override ...
In other words, what did you not know when you started with Django that you wish someone had told you?
I've dabbled some in Django but nothing really serious. However, I'm hoping to change that, and I'm wondering if there's any gotchas/shortcomings/whatever that I need to be aware of as I go.
...
Right now, if I want to run tests from all my apps, I go:
python manage.py test app1 app2 app3
If I run:
python manage.py test
The test of all apps in INSTALLED_APPS are run, including the django ones. Is there a simple command to run the tests of all the apps that I have created?
...
I have a RH system running RHEL 5.3, which comes with python2.4 that can't be removed for numerous reasons.
I have been able to build 64-bit RPMS for python 2.6 as an altinstall. It's called with "python26".
How can I tell Django to use this command to get to the proper python version, instead of the default "python".
I can, of cou...
I want to make it that one user on the site can chat request another user on my Django site. I want the requestee to get a realtime box that say: "Do you want to chat?"
How does the following client polling approach sound:
user1 clicks on users2 nickname, generating a POST request to some /message/requests, which creates a Message of t...
I'm attempting to execute my Django 1.1 app, which accesses a SQL Server 2005 database, inside a Tomcat servlet container. I'm using Django-Jython 1.1.1 and Jython 2.5.1 to do this.
In settings.py, I set
DATABASE_ENGINE='doj.backends.zxjdbc.mssql2k'
When I try to get the war file to deploy to Tomcat with:
jython manage.py war
I...
def list_ajax(reqest):
#q = request.GET.get('q',None)
#get all where var = q.
return ...
list_ajax = condition(etag_func=list_ajax)(list_ajax)
As you can see, I'm trying to return a 304 to the client if the result is the same. But, I am getting this Django error, why?:
Traceback:
File "/usr/local/lib/python2.6/dist-package...
What is the best practice when designing a mission critical signup form when it comes to using django-powered sessions?
Is it generally considered ok to require the user to accept the session cookie?
Are there any tips to maximize the percent of users who can accept the session cookie?
...