Python-memcached is the official supported memcached driver for Django.
Does it support
Consistent hashing
Binary protocol
If it does, how do I use those features within Django? I couldn't find any documentation.
...
Hello. I'm looking into a possible feature for my little to-do application... I like the idea that I can send an email to a particular email address, containing a to-do task I need to complete, and this will be read by my web application and be put in the database... So, when I come to log into my application, the to-do task I emailed wi...
Hi
i've got MenuItem model :
MenuItem(models.Model)
name=models.CharField(max_length=50)
url = models.URLField()
position = models.IntegerField()
Class Meta:
ordering =['position']
then i'm retriving it by MenuItem.objects.all()
My question is how can i make any user friendly interface in admin panel to allow sorting MenuIte...
I have the following model:
class Service(models.Model):
ratings = models.ManyToManyField(User)
Now if I wanna get all the service with ratings sorted in descending order I did something:
services_list = Service.objects.filter(ratings__gt=0).distinct()
services_list = list(services_list)
services_list.sort(key=lambda service: ser...
I'm trying to setup django on a shared hosting provider. I followed the instructions on http://helpdesk.bluehost.com/index.php/kb/article/000531
and almost have it working.
The problem I'm facing now is that the traffic is properly routed throught the fcgi file, but the file itself shows up as plain text in the browser. If I run ./mysi...
I am developing a Django application, which is a large system that requires multiple sub-applications to keep things neat. Therefore, I have a top level directory that is a Django app (as it has an empty models.py file), and multiple subdirectories, which are also applications in themselves.
The reason I have laid my application out in ...
Straightforward question - apologies if it is a duplicate, but I can't find the answer if so.
I have a User model and a Submission model, like this:
class Submission(models.Model):
uploaded_by = models.ForeignKey('User')
class User(models.Model):
name = models.CharField(max_length=250 )
How can I show the number of Submission...
Hi all,
I want to build an API service using Django. A basic workflow goes like this:
First, an http request goes to http://mycompany.com/create?id=001&callback=http://callback.com. It will create a folder on the server with name 001.
Second, if the folder does not exist, it will be created. You get response immediately in XML for...
My website will use a Neural Network to predict thing based on user data. The user can select the data to be used in training the network and then use their trained network to predict things.
I am using a framework to create, train and query the networks. This uses Java. The framework has persistence for saving a network to an XML file....
Hello,
So i am writing a little app that compares a user's position against a database on web-based server written
using Django and performs some functions with it.
Accessing the browser's geolocation data (in supported browsers ) is fairly trivial using JavaScript. But what is the best way to allow
the Django server to access the lon...
This is just an example, but given the following model:
class Foo(models.model):
bar = models.IntegerField()
def __str__(self):
return str(self.bar)
def __unicode__(self):
return str(self.bar)
And the following QuerySet object:
foobar = Foo.objects.filter(bar__lt=20).distinct()
(meaning, a set of uniq...
Let's say I have a site where Users can add Entries through admin panel. Each User has his own Category he is responsible for (each Category has an Editor assigned through ForeingKey/ManyToManyField).
When User adds Entry, I limit the choices by using EntryAdmin like this:
class EntryAdmin(admin.ModelAdmin):
(...)
def formfiel...
I have created users for my unit tests in two ways:
1) Create a fixture for "auth.user" that looks roughly like this:
{
"pk": 1,
"model": "auth.user",
"fields": {
"username": "homer",
"is_active": 1,
"password":
"sha1$72cd3$4935449e2cd7efb8b3723fb9958fe3bb100a30f2...
Suppose this is my URL route:
(r'^test/?$','hello.life.views.test'),
How do I make it so that people can do .json, .xml, and it would pass a variable to my views.test, so that I know to make json or xml?
...
Hi.
I get a model object, change an attribute, save it and it still has the old attribute:
>>> g = SiteProfile.objects.get(pk=3)
>>> g.renew_date
datetime.date(2010, 4, 11)
>>> g.renew_date = date.today()+timedelta(days=365)
>>> g.renew_date
datetime.date(2011, 4, 11)
>>> g.save()
>>> g.renew_date
datetime.datetime(2010, 4, 11, 16, 57,...
http://docs.djangoproject.com/en/dev/intro/tutorial03/
I was at the step Decoupling the URLconfs where the tutorial illustrates how to decouple urls.py. On doing exactly what it says, i get the following error-
error at /polls/1/
nothing to repeat
Request Method: GET
Request URL: http://localhost:8000/polls/1/
Exception Type: error
...
On my VDS I use nginx, django and tornado. I had just one project, Now i gonna deploy another one project with a different domain name. I want to use different databases and folders.
I know how to configure nginx for serving static resourses , but what about tornado?
Should i run separeted instance of tornado for each project or is there...
This question is connected to my other question but I changed the logic a bit.
I have models like this:
from django.contrib.auth.models import Group
class Category(models.Model):
(...)
editors = ForeignKey(Group)
class Entry(models.Model):
(...)
category = ForeignKey(Category)
Now let's say User logs into admin panel an...
I need to display a piece of HTML only if a variable value appears in a list. I know that Django 1.2 has an 'in' operator. But I am working on a Google App Engine app. Is there a workaround I can use?
...
An odd error here, perhaps someone can help track down source as it's attempting to extend the Django CMS project & attempts to use uses some logic written as part of that project which I'm not fully clear on. In short, using:
urls.py
======================
from django.conf.urls.defaults import *
from cmsplugin_flat_news.models import N...