The documentation says:
http://docs.djangoproject.com/en/dev/ref/settings/#time-zone
Note that this is the time zone to
which Django will convert all
dates/times -- not necessarily the
timezone of the server. For example,
one server may serve multiple
Django-powered sites, each with a
separate time-zone setting.
Normal...
I am working on power monitoring and want to send live power data to authorised users only. Some users have opted to install power sensors in their houses, others are viewing those sensors. Each sensor sends samples to a Twisted backend - the goal is to have this backend forward the data to Javascript running in the browser.
My current ...
Is is possible to do something similar to this with a list, dictionary or something else even?
data_dict = {
'title' : 'awesome title',
'body' : 'great body of text',
}
Model.objects.create(data_dict)
Even better if I can extend it
Model.objects.create(data_dict, extra='hello', extra2='world)
...
Put simply, is there a way to get generic views to work?
If I try the following in urls.py:
publisher_info = {
'queryset': Publisher.objects.all(),
}
urlpatterns = patterns('',
(r'^publishers/$', list_detail.object_list, publisher_info)
)
I get the following error:
AttributeError at /publishers 'Query'
object has no a...
Hi All
I'm using the GenerickStackedInline which is a subclass of InlineModelAdmin which goes to ModelAdmin. When I override save_model method... it's not being called.
class LocatedItemStackedInline(generic.GenericStackedInline):
template = "admin/location_app/located_items/stacked.html"
model = LocatedItem
extra = 1
f...
in my .po file i have
msgid "This string will have %s inside."
How can i translate this in template?
I've tried:
{% blocktrans %}This string will have {{ value }} inside.{% endblocktrans %}
and
{% blocktrans with value as value%}This string will have {{ value }} inside.{% endblocktrans %}
Neither works for me
...
What are some options to avoid the latency of pointing local django development servers to a remote MySQL database?
If developers use local MySQL databases to avoid the latency, what are some useful tools to sync schema updates of the remote db with the local db and avoid manually creating, downloading, and loading dumps?
Thanks!
...
I'm trying to develop a site that will allow users to pay for services with eChecks that other users are offering.
The purchaser would pay money that would go into my account via direct deposit. The service provider could later withdraw money up to the amount they accumulated to their bank account.
Every time I ask payment gateway prov...
I've been tackling this for a while. I setup a completely new machine. I've installed a fresh copy of postgresql and all my other dependencies. Basically, I get these database disconnections at random times. I can perform identical requests and either it works or it doesn't. Very nondeterministic in outward appearance. Watching logs at P...
I have a model and form like so:
class Image(BaseModel):
original = db.BlobProperty()
class ImageForm(ModelForm):
class Meta:
model = Image
I do the following in my view:
form = ImageForm(request.POST, request.FILES, instance=image)
if form.is_valid():
And I get:
AttributeError at /image/add/
'NoneType' object has...
Suppose I am in the usual situation where there're extra fields in the many2many relationship:
class Person(models.Model):
name = models.CharField(max_length=128)
class Group(models.Model):
name = models.CharField(max_length=128)
members = models.ManyToManyField(Person, through='Membership')
class Membership(models.Model):...
Building a Django app on a VPS. I am not very experienced with setting up my own server, but I decided to try a VPS this time around.
I have been doing a bunch of research to learn how to "properly" setup a LAMPython server using the Apache worker MPM. Naturally, the mod_python vs mod_wsgi debate came up.
Reading Graham Dumpleton's ...
I'm getting an AttributeError using rcrowley's django-twitterauth: http://github.com/rcrowley/django-twitterauth
Looks like it occurs when the validate() method is called on the user object, which the user object does not have. I don't know why the author did this. I'm really new to Django, wondering if anyone else knows. I know you can...
This is a best-practices question.
When writing tests in Django, is it better to hard code urls in your tests.py, or to use the dispatch's reverse() function to retrieve the correct url?
Using hard-coded urls for testing only feels like the right way, but at the same time I can't think of a good enough argument for not using reverse()....
I'm reading the Django EmailMessage doc and it doesn't mention the CC field. What changes should I make so that I can put recipients in the CC field?
...
I want to learn a framework that promotes good programming practices and is respected by the programming community.
However, I also want a framework that I can use for a day job.
Which one would you recommend?
This question comes from my experience of learning the basics of Django because it was highly acclaimed by developers on Stack...
The below code removes certain values from a drop down menu.
It works fine but I want to remove the value if the user lacks certain permissions.
How can I access request.user in the ModelForm's constructor? Or is there a better way to accomplish what I am trying to do?
class AnnouncementModelForm(forms.ModelForm):
def __init__(sel...
Hi Djangonauts,
I am almost done developing a Django project (with a few pluggable apps).
I want to offer this project as a SaaS (something like 37signals.com).
i.e: customer1.product1.com , customer2.product2.com etc
product1 could be the basecamp
product2 could be highrise
and so on.
I want to know how the project should be struc...
I'm wondering, what is a standard way of updating multiple fields of an instance of a model in django? ... If I have a model with some fields,
Class foomodel(models.Model):
field1 = models.CharField(max_length=10)
field2 = models.CharField(max_length=10)
field3 = models.CharField(max_length=10)
...
... and I instantiat...
I've got a few small web projects where I'd like to get some user feedback however the services I've found are not cheap. To get to a useful level of features on UserVoice or Get Satisfaction I'd be needing to be on at least the $90/month plan on either service, multipled by a few sites is far more than I can justify spending for a few s...