django

Django - no module named app

Hi, I have been trying to get an application written in django working - but it is not working at all. I have been working on for some time too - and it is working on dev-server perfectly. But I am unable to put in the production env (apahce). My project name is apstat and the app name is basic. I try to access it as following B...

Django: Paginator + raw SQL query

Hello! I'm using Django Paginator everywhere on my website and even wrote a special template tag, to make it more convenient. But now I got to a state, where I need to make a complex custom raw SQL query, that without a LIMIT will return about 100K records. How can I use Django Pagintor with custom query? Simplified example of my prob...

Django: getting the list of related records for a list of objects

Hello! I have two models related one-to many: class Person(models.Model): name = models.CharField(max_length=255); surname = models.CharField(max_length=255); age = models.IntegerField(); class Dog(models.Model): name = models.CharField(max_length=255); owner = models.ForeignKey('Person...

Using Django CMS

Hi, I know python and have just read a basic intro of django. I have to built something like a travel website with real time updates. Will django be sufficent for this? Somebody advised me to look at django-CMS, I couldn't find a very beginner's tutorial there. Should I opt for django-CMS? Also how much of django should i know before i ...

How to setup and teardown temporary django db for unit testing?

I would like to have a python module containing some unit tests that I can pass to hg bisect --command. The unit tests are testing some functionality of a django app, but I don't think I can use hg bisect --command manage.py test mytestapp because mytestapp would have to be enabled in settings.py, and the edits to settings.py would be ...

How to convert this query to a "django model query" ?

Hello ! What i want is simple : models : class userLastTrophy(models.Model): user = models.ForeignKey(userInfo) platinum = models.IntegerField() gold = models.IntegerField() silver = models.IntegerField() bronze = models.IntegerField() level = models.IntegerField() rank = models.IntegerField() pe...

Counts of events grouped by date in python?

This is no doubt another noobish question, but I'll ask it anyways: I have a data set of events with exact datetime in UTC. I'd like to create a line chart showing total number of events by day (date) in the specified date range. Right now I can retrieve the total data set for the needed date range, but then I need to go through it and ...

Python: UTF-8 problems (again...)

I have a database which is synchronized against an external web source twice a day. This web source contains a bunch of entries, which have names and some extra information about these names. Some of these names are silly and I want to rename them when inserting them into my own database. To rename these silly names, I have a standard d...

How use Django with Tornado web server ?

How do I use Django with the Tornado web server? ...

Django Sum all values with a distinct ForeignKey ID & zip them with fields from related table

I would like to perform something similar to this (ie get the sum of distinct event amounts in a payment table then group the payments by event details and total money paid for them. Also getting users and what they have paid for an event will be done) in Django using PostgreSQL. My models are as below: class UserProfile(User): on...

Social Game Mechanics in Django

I want users to receive 'points' for completing various tasks in my application - ranging from tasks such as tagging objects to making friends. I havn't yet found a Django application that simplifies this. At the moment I'm thinking that the best way to accumulate points is that each user action creates the equivalent of a "stream item"...

Thread Synchronization in Django

Is there any way to block a critical area like with Java synchronized in Django? ...

Authentication and Login on 2 website

Hi at all, I have 2 site: example.com and exampletwo.com I want that when a user login on example.com then he is automatically authenticated also on exampletwo.com How can I do that ? I use Django + Nginx on first website and Tornado framework + Tornado server on second website. Thanks ;) . P.S. If you don't know this platforms ( Dj...

Django Import Error: No module named http

I installed django on windows. When I am trying to run my first project I am getting Import Error: No module named htpp ...

how to load google map geo-location not using kml..

like this site : http://www.housingmaps.com/ thanks ...

passing an argument to a custom save() method

How do I pass an argument to my custom save method, preserving proper *args, **kwargs for passing to te super method? I was trying something like: form.save(my_value) and def save(self, my_value=None, *args, **kwargs): super(MyModel, self).save(*args, **kwargs) print my_value But this doesn't seem to work. What am I doing w...

Error in django url.py??

I am new in django. I try to practice and run the wiki application (i found tutorial at Learn django), In url.py file i write the following urls... urlpatterns = patterns('', (r'^wikicamp/(?p<page_name>[^/]+)/edit/$','wikiapp.wiki.views.edit_page'), (r'^wikicamp/(?p<page_name>[^/]+)/save/$','wikiapp.wiki.views.save_page'), ...

how to save and load (many)users's kml data on google-maps

i want a way to do this. thanks ...

Django Formset management-form validation error

I have a form and a formset on my template. The problem is that the formset is throwing validation error claiming that the management form is "missing or has been tampered with". Here is my view @login_required def home(request): user = UserProfile.objects.get(pk=request.session['_auth_user_id']) blogz = list(blog.objects.filt...

django handling file uploads - target different than media folder

Hi, I want to enable the user to upload media which will not be saved in the media folder. When I use the following line of code data will be uploaded to media/upload/logo . logo_img = models.FileField(upload_to='upload/logo', blank=True) I'm wondering how I can change this behaviour. I would try to write a custom FileField and a v...