django

how do i login facebook via facevook connect and django.

my request.__dict__ is : ['session', 'openid', '_post_parse_error', 'openids', '_cached_user', '_files', 'facebook', '_post', '_get', 'META', 'environ', 'path_info', 'LANGUAGE_CODE', 'path', '_cookies', 'method'] my request.facebook is : ['feed', 'status', 'marketplace', 'uid', 'stream', 'locale', 'auth_token', 'is_session_from...

django fabric syncdb

How would you run this django command to syncdb with fabric automatically. python manage.py syncdb --settings="app.settings.test" if tried to do run, it gets stuck at the "Do you want to create superuser account", can it passed as yes and login information with it. run('python manage.py syncdb --settings="app.settings.%s"' % name...

Switching from MySQL to Cassandra - Pros/Cons?

Hello all, For a bit of background - this question deals with a project running on a single small EC2 instance, and is about to migrate to a medium one. The main components are Django, MySQL and a large number of custom analysis tools written in python and java, which do the heavy lifting. The same machine is running Apache as well. Th...

Better way to represent Many to many relationship in django admin

I have a unique problem the way it should be handled in django admin. I have following models structure... class Product(models.Model): name = models.CharField(max_length = 100) base_price = models.DecimalField(max_digits = 5, decimal_places = 2) def __unicode__(self): return self.name class Country(models.Mo...

Migrate a SQLite3 database table to MySQL with Python without dump files

I need to migrate information that I created in SQLite3 to a MySQL database on my website. The website is on a hosted server. I have remote access to the MySQL database. I initially thought it would be easy, but I am not finding any good info on it, and everything I read seems to imply that you need to dump the SQLite3 file, convert i...

drupal ubercart order update djano

How would you update a django app when there was an order in drupal ubercart. The order details and user information gets carried to django app. ...

Django-cms example. How to run it?

I'm trying to run django-cms example. But I think I'm doing something wrong. Can anybody describe by steps, how to run django-cms example? ...

customize the django admin panel ?

I want to change the django bydefault admin panel title bar where wirte the django administration. Actually I want to replace the django administration with the my site name. ...

Django not displaying image in css

I have a django application.I have added image (url) in css,it isn't displaying the image. But when I used it as a html file,it is displaying the image.Should I set any url in settings.py for this? Source [shown here][1]. [1]: http://dpaste.com/164620/ ...

Django admin App

Hi I am building a app. The app will build a Poll OR a Quiz. So my models will have a type field(Poll, Quiz) Now i would like to display the 2 "Types" in the admin App list. But i dont what to create two apps Poll and Quiz. Is there a way, to display the 2 options in the list and then when you click on lets say Poll, the type field is...

Adaptive optimization of django transaction size

I'm bulk loading data into a django model, and have noticed that the number of objects loaded into memory before doing a commit affects the average time to save each object. I realise this can be due to many different factors, so would rather focus on optimizing this STEPSIZE variable. What would be a simple algorithm for optimizing th...

Customizing the language-guessing algorithm in Django

I'm developing a multilingual Django website. It has two languages, English and Hebrew. I want the default language for every first-time visitor to be Hebrew, regardless of what his browser's Accept-Language is. Of course, if he changes language to English (and thus gets the language cookie or the key in the session), it should remain a...

Insert arbitrary content into textfield

I'm building a CMS and I want to be able to insert "stuff" in arbitrary locations in a document (CMS page). The "stuff" objects will have generic foreign keys and can be a table generated from a db entry, or it can be an uploaded image or something else. I've seen that Nathan Borror's django-basic-apps contains a basic-inlines app whi...

Tracking changes to Django Model instances

When you create or modify an object instance in Django's admin, a changelog entry is created. This is really nice for fairly obvious reasons. However my model's instances created by a normal user outside of the admin interface. No changelog is recorded to note its creation (not a huge issue) but I would like to track edits the user make...

django override User model

I'm trying to override the default User model in Django to add some logic into the save() method. I'm having a hard time trying to figure out out to go about this. I'm using Django 1.1 if that helps. I used post_save since i need to add the user into ldap.. I just added this into a models.py from django.db import models from django....

How to extend request.user with own functions in django?

I've seen some nifty code on django-ratings documentation and like to create something similar. After googling around for now 2 weeks I got no idea on how to do this. Maybe you could help me what to search for or where to get some docs? Code from django-ratings docs: ... response = AddRatingView()(request, **params) if response.st...

Django queries: how to make contains OR not_contains queries

Hello. I have to make a query that will get records containing "wd2" substring or not containing "wd" string at all. Is there any way to do it nicely? Seems something like: Record.objects.filter( Q(parameter__icontains="wd2") | Q( ## what should be here? ## ) ) ...

model.__unicode__() returning russian string cause TemplateSyntaxError

code: class Gallery(models.Model): title = models.CharField(max_length=100) description = models.TextField(blank=True) created = models.DateField(auto_now_add=True) class Meta: verbose_name = 'галерея' verbose_name_plural = 'галереи' def __unicode__(self): return 'Галерея %s' % self.title ...

Post processing attendance data with Django

I have a web app which tries to determine when people are attending events. class Attendee(models.Model): location = models.ForeignKey(Location) user = models.ForeignKey(User) checked_in = models.DateTimeField() checked_out = models.DateTimeField() last_active = models.DateTimeField() An Attendee is checked in when...

Send Email in Django without SMTP server. Like php mail() function does

Hello! As far as I read, Django only supports sending mails using SMTP. I would like to send Emails from my script in Django, but do not want to setup SMTP server (it's too complex for me, I'm a linux newbie). Is it possible, to send mails in Django in the same way like I do it in PHP, without providing SMTP login, password and etc? ...