I have a simple django page that has a counter on it.
I use Apache2 with mod_wsgi to serve it.
First, when I enter this page, the counter shows 0, as it should.
The second time when I enter the page the counter shows 1 - again, it is the right behavior.
The problem begins now, cause when I enter this page the third time, I get 0 again.
...
In many django projects, in the docs directory I can see *.rst files :
What is the best way to browse them (without using a text editor of course) ?
Is that possible to generate HTML ?
...
I am trying to set up multiple virtual hosts on the same server with Nginx and Apache and have run into a curious configuration issue.
I have nginx is configured with a generic upstream to apache.
upstream backend {
server 1.1.1.1:8080;
}
I'm trying to set up multiple subdomains in nginx that hit different mountpoints in apache. E...
I have a model name called StoreEntry. Django admin changes it to look like 'Store Entrys'. This is weird. If anything it should be Store entries. Any idea what's going on here and how to change it?
...
I have a MySQL gone away with Django under WSGI. I found entries for this problem on stackoverflow, but nothing with Django specifically. Google does not help, except for workarounds (like polling the website every once in a while, or increasing the database timeout). Nothing definitive. Technically, Django and/or MySQLdb (I'm using the ...
I'm getting the following error when attempting to upload a file to S3:
S3StorageError: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>AWS authentication requires a valid Date or x-amz-date header</Message><RequestId>7910FF83F3FE17E2</RequestId><HostId>EjycXTgSwUkx19YNkpAoY2UDDur/0d5SMvGJUicpN6qCZFa2Ouqc...
I just want to import my facebook status and photos to my personal django website but all the examples and documentation i can find are for developing facebook applications.
A simple rss feed would be enough but it doesnt seem to exist in facebook.
Do i really have to create a full facebook app to do this?
...
this is the code:
def create(request, form_class=MapForm, template_name="maps/create.html"):
map_form = form_class(request.POST or None)
if map_form.is_valid():
map = map_form.save(commit=False)
and the map_form is :
class MapForm(forms.ModelForm):
slug = forms.SlugField(max_length=20,
help_text = _("a s...
I want to check users' subscribed dates for certain period. And send mail to users whose subscription is finishing (ex. reminds two days).
I think the best way is using thread and timer to check dates. But I have no idea how to call this function. I don't want to make a separate program or shell. I want to combine this procedure to my dj...
Hi,
I am in the process of making a webapp, and this webapp needs to have a form wizard. The wizard consists of 3 ModelForms, and it works flawlessly. But I need the second form to be a "edit form". That is, i need it to be a form that is passed an instance.
How can you do this with a form wizard? How do you pass in an instance of a mo...
Hello,
I want to modify / change the way the floatformat works.
By default it changes the input decimal as such:
{{ 1.00|floatformat }} -> 1
{{ 1.50|floatformat }} -> 1.5
{{ 1.53|floatformat }} -> 1.53
I want to change this abit as such: If there is a floating part, it should keep the first 2 floating digits. If no floating (which me...
I'd like to create a form that includes fields from two separate models, along with some other regular (non-model) fields. The form will create an instance of each model. I don't think I can use inline formsets for this, since I don't want to include all the fields from both models.
I'd like to create the form field without hard-coding ...
The title may be a little confusing, but I don't know how else to call it.
I would like to create a Django project with a large set of applications you could arbitrary turn on or off using INSTALLED_APPS option in settings.py (you would obviously also need to edit urls.py and run syncdb). After being turned on an app should be able to a...
I've got a really simple blog application and I want to add a really simple search feature to it.
There are 3 key fields to my model.
class BlogPost(models.Model):
title = models.CharField(max_length=100) # the title
intro = models.TextField(blank=True, null=True) # an extract
content = models.TextField(blank=True, null=Tru...
I want to add a 404 page on my Django site.
I've created a template, 404.html, and saved it in the root of my /templates directory. I've also made sure that the
from django.conf.urls.defaults import *
line is included at the top of urls.py. I've set DEBUG to False. (I've been following these instructions.)
However, if I try to go ...
content_type = ContentType.objects.get_for_model(Map)
maps = maps.extra(select=SortedDict([
('member_count', MEMBER_COUNT_SQL),
('topic_count', TOPIC_COUNT_SQL),
]), select_params=(content_type.id,))
and the ContentType is:
class ContentType(models.Model):
name = models.CharField(max_length=100)
app_la...
I have a similar question than django cross-site reverse. But i think I can't apply the same solution.
I'm creating an app that lets the users create their own site. After completing the signup form the user should be redirected to his site's new post form. Something along this lines:
new_post_url = 'http://%s.domain:9292/mana...
Is there a way to have any @property definitions passed through to a json serializer when serializing a Django model class?
example:
class FooBar(object.Model)
name = models.CharField(...)
@property
def foo(self):
return "My name is %s" %self.name
Want to serialize to:
[{
'name' : 'Test User',
'foo' : 'My name is Test User',...
Hi, I've got problems on getting django to work on apache 2.2 with mod_wsgi.
Django is installed and mod_wsgi too.
I can even see a 404 page when accessing the path and I can login to django admin.
But if I want to install the tagging module I get the following error:
Traceback (most recent call last):
File "setup.py", line 49, in <...
How do I change some models name from "Categorys" to "Categories" on admin site in the new dev django version?
In the old version (whithout admin sites and admin models) you could just do this;
http://www.the-dig.com/blog/post/customize-plural-name-django-admin/
However - now setting verbose_name_plural inside my modeladmin based class ...