Cant we send a dictionary variable when using HttpResponseRedirect
render_to_response('edited/display.html',context_instance=RequestContext(request,{'newlist': newlist}))
//How can the dictionary and the request sent back again
//sumthing like this
return HttpResponseRedirect('edited/display.html',context_instance...
I have two sites with different SITE_IDs, but I want to have only one admin interface for both sites.
I have a model, which is just an extended FlatPage:
# models.py
class SFlatPage(FlatPage):
currobjects = CurrentSiteManager('sites')
galleries = models.ManyToManyField(Gallery)
# etc
# admin.py
class SFlatPageAdmin(FlatPa...
Hi,
I'm surprised this question hasn't come up. Couldn't find much on the web.
Using Entry.objects.latest('created_at') I can recover the latest entry for all Entry objects, but say if I want the latest entry for each user? This is something similar to an SQL latest record query. But how do I achieve this using the ORM? Here is my appr...
Map.objects.filter(name__iexact=self.cleaned_data["name"]).count()
thanks
...
i want to get the user who login now ..
how to do this ..
thanks
this is my code :
ps=Position.objects.filter(name=User.username)
updated:
ps=Position.objects.filter(name=request.user.username)
and
return render_to_response(template_name, {
"map_form": map_form,
"map": map,
"group": map, # @@@ this shou...
Hello
Under my debian copy, I run a django site runs via apache2 and mod_wsgi. Now I want to include a wordpress to it, for that I need to install php - apache bindings. I am curious what library is recommended for this, aswell as how shall I be doing the apache2 config file ?
Here is my current apache 2 000-default file:
<VirtualHost ...
Hi
I am trying to integrate Django-Paypal onto a site, where once the customer makes a payment I need to send a dynamic URL from which the user can download some specific information.
I am registering all users to a URL which allows them to buy the document. The URL which can only be accessed by a registered user with a verified email...
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although I have pretty good ...
I'm creating a JSON POST request from Objective C using the JSON library like so:
NSMutableURLRequest *request;
request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@/", host, action]]];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/json-rpc" forHTTPHeaderField:@"Content...
Hi,
I'm using a 500.html template for my app, which is an identical copy of the 404.html with some minor text changes.
Interestingly the {{ media_url }} context variable will not be resolved by the server if the 500.html is presented (e.g. when I force an internal server error), resulting in a page without any css loaded.
An easy way ...
Need to integrate Django with an existing authentication system. That system has it's own database, API, login/logout,edit profile web pages and cookie.
(I may have to add a few additional profile fields stored/updated locally)
What's the proper approach to substitute the out-of-the-box authentication in Django?
...
I am trying to test IPN. Working with django-paypal. What could be wrong.
The URL is working. No errors otherwise...
But when I test this, it says IPN delivery failed and error code is 403,
...
Hi guys, I'm building an app for a small business so I've to work with currencies, decimal numbers, etc... My goal is to create something like pulseapp.com.
I've searched for opensource projects to look and the only thing I had found was django-cashflow. This app uses python-money.
I've read some of the code and the ways it's coded see...
Hi:
I am doing some unit testing stuff in Django. What is the relationship between TestCase class and the actual method in this class? What is the best practice for organizing these stuff?
For example, I have
class Test(TestCase):
def __init__(self):
...
def testTestA(self):
#test code
def testTestB(self)...
I want to generate some dynamic data and feed these data in to test cases. But I found that Django will initial the test class every time to do the test. So the data will get generated every time django test framework calls the function.
Is there anyway to use something like the singleton or static variable to solve the problem? What s...
I have an application with an interstitial page to hold the user while an intensive operation runs in the background (takes anywhere from 30 secs to 1 minute). Once the operation is done, the user is redirected to the results page.
Once on the result page, typical user behavior is to hit the 'back' button to perform the operation on a d...
Does anyone know how you can turn off autocompletion on a textfield in Django?
For example, a form that I generate from my model has an input field for a credit card number. It is bad practice to leave autocompletion on. When making the form by hand, I'd add a autocomplete="off" statement, but how do you do it in Django and still retai...
If there are several methods in the test class, I found that the order to execute is alphabetical. But I want to customize the order of execution. How to define the execution order?
For example: testTestA will be loaded first than testTestB.
class Test(TestCase):
def setUp(self):
...
def testTestB(self):
#test ...
I am trying to use inlineformset_factory to generate a formset. My models are defined as:
class Measurement(models.Model):
subject = models.ForeignKey(Subject)
experiment = models.ForeignKey(Experiment)
assay = models.ForeignKey(Assay)
values = models.CommaSeparatedIntegerField(blank=True, null=True)
class Experiment(m...
Hello
what am i doing wrong?
class MyModel(models.Model):
name = models.CharField(max_length=100, verbose_name=_("Name"), blank=False, null=False)
rating = models.DecimalField(max_digits=2, decimal_places=2, default=0)
id i do something like that:
average = count/len(votes)
mymodel.rating = average
mymodel.save()
count is the...