django

Is it better to dive into Rails or Django going into the future?

I've been a dev using rails since it's initial release and have recently lost touch with it because I've done a lot of work with Django due to my recent fondness of python. I do like Ruby as well and was asked by a friend recently if he should approach Rails or Django. Given that Rails is merging with merb and has a huge user-base versus...

what is the difference between Django and Joomla?

What is the difference between Django and Joomla? Or better still what is the difference between Content Managers (Joomla, Drupal etc) and Web Framworks (Django, Symphony, Zend etc) ...

How do I add multiple arguments to my custom template filter in a django template?

Here's my custom filter: from django import template register = template.Library() @register.filter def replace(value, cherche, remplacement): return value.replace(cherche, remplacement) and here are the ways I tried using it in my template file that resulted in an error: {{ attr.name|replace:"_"," " }} {{ attr.name|replace:"_"...

How to do text full history in Django?

I'd like to have the full history of a large text field edited by users, stored using Django. I've seen the projects: Django Full History (Google Code) Django ModelHistory, and Django FullHistory I've a special use-case that probably falls outside the scope of what these projects provide. Further, I'm wary of how well documented, te...

How to access the user profile in a Django template?

I'm storing some additional per-user information using the AUTH_PROFILE_MODULE. We can access the user in a Django template using {{ request.user }} but how do we access fields in the profile since the profile is only accessible via a function user.get_profile() ? Is it really required to explicitly pass the profile into the template e...

Django form - in-place edit of data from reverse foreign key join

I have a Person table and Phone table. The Phone table has a foreign key into the Person table, which is an auto-increment ID. Each person can have an arbitrary number of phone numbers. Is there a way for me to create a Django form to enter phone numbers while creating a new Person entry and edit them along with an existing Person ent...

How to save inline formset models in Django?

Formsets have a .save() method, and the documentation says to save in views like this: if request.method == "POST": formset = BookInlineFormSet(request.POST, request.FILES, instance=author) if formset.is_valid(): formset.save() # Do something. else: formset = BookInlineFormSet(instance=author) I am followin...

Which software for intranet CMS - Django or Joomla?

In my company we are thinking of moving from wiki style intranet to a more bespoke CMS solution. Natural choice would be Joomla, but we have a specific architecture. There is a few hundred people who will use the system. System should be self explainable (easier than wiki). We use a lot of tools web, applications and integrated within 3...

Django on IronPython

I am interested in getting an install of Django running on IronPython, has anyone had any success getting this running with some level of success? If so can you please tell of your experiences, performance, suggest some tips, resources and gotchas? ...

What is your favorite solution for managing database migrations in django?

I quite like Rails' database migration management system. It is not 100% perfect, but it does the trick. Django does not ship with such a database migration system (yet?) but there are a number of open source projects to do just that, such as django-evolution and south for example. So I am wondering, what database migration management...

How to hide a primary key field in a Django form

I'd prefer my primary key field weren't visible in my edit page. If I make it an AutoField, it isn't rendered in the HTML form. But then the primary key value isn't in my POST data either. Is there a simple way to render the AutoField as a hidden field? ...

In django, what is a "slug"?

When I read django code I often see in models what is called a "slug". I am not quite sure what this is but I do know it has something to do with URL:s. How and when is this slug-thing supposed to be used? (I have read it's definition in this glossary) ...

Deploying Django at Dreamhost

I'm trying to get the Poll tutorial working at my Dreamhost account (I don't have any prior experience of deploying Django). I downloaded the script I found here (http://gabrielfalcao.com/2008/12/02/hosting-and-deploying-django-apps-on-dreamhost/) at my home directory and executed it. Now I have Python 2.5 and Django in ~/.myroot/ and my...

What's the best way to map the main urls in a django project?

I've got a django project that contain some apps. The main urls.py includes the urls.py from the apps I've enabled, and all is good. Now I want to configure the project so that when you go to http://testsite/, you'll get the same page that you get when you go to http://testsite/app/. I can do this by duplicating the corresponding line...

Saving object with ManyToMany relation

I have models (simplified example): class Group(models.Model): name = models.CharField(max_length = 32) class Person(models.Model): group = models.ForeignKey(Group) class Task(models.Model): group = models.ForeignKey(Group) people = models.ManyToManyField(Person) def save(self, **kwargs): ppl = Person.objects.all().filt...

Ordered lists in django

Hi, i have very simple problem. I need to create model, that represent element of ordered list. This model can be implemented like this: class Item(models.Model): data = models.TextField() order = models.IntegerField() or like this: class Item(models.Model): data = models.TextField() next = models.ForeignKey('self') ...

Syncing Django users with Google Apps without monkeypatching

I am writing a Django app, and I would like an account to be created on our Google Apps hosted email using the Provisioning API whenever an account is created locally. I would solely use signals, but since I would like the passwords to be synchronized across sites, I have monkeypatched User.objects.create_user and User.set_password usin...

Apostrophes replacing quotation marks in script tag in input field.

I have this input in a form: <input type="text" value="<script src='/js/script.js' type='text/javascript'></script>" name="embed"/> The quotations in general have to be double, so I put single-quotes within the value property. However, when I do that, the result is: <script src=’/js/script.js’ type=’text/javascript’></script> Not...

Sending an SMS to a Cellphone using Django

I am building an application, where I have this little survey module, which sends out a simple sms to the phone number I give and has to collect the response(if the user fires it) and show it to me. I am using to django build my project. I have tried django-sms google code project, but I couldn't post messages back from my mobile to my s...

Djang-Admin: CharField as TextArea

I have class Cab(models.Model): name = models.CharField( max_length=20 ) descr = models.CharField( max_length=2000 ) class Cab_Admin(admin.ModelAdmin): ordering = ('name',) list_display = ('name','descr', ) # what to write here to make descr using TextArea? admin.site.register( Cab, Cab_Admin ) how to assig...