django

What do I need to import to gain access to my models?

I'd like to run a script to populate my database. I'd like to access it through the Django database API. The only problem is that I don't know what I would need to import to gain access to this. How can this be achieved? ...

Framework/Language for new web 2.0 sites (2008 and 2009)

I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willing to use beta...

Regular expression that uses an "OR" conditional

I could use some help writing a regular expression. In my Django application, users can hit the following URL: http://www.example.com/A1/B2/C3 I'd like to create a regular expression that allows accepts any of the following as a valid URL: http://www.example.com/A1 http://www.example.com/A1/B2 http://www.example.com/A1/B2/C3 I...

Django admin interface inlines placement

I want to be able to place an inline inbetween two different fields in a fieldset. You can already do this with foreignkeys, I figured that inlining the class I wanted and defining it to get extra forms would do the trick, but apparently I get a: "class x" has no ForeignKey to "class y" error. Is this not something that is supported ...

Django: Inject errors into already validated form?

After my form.Form validates the user input values I pass them to a separate (external) process for further processing. This external process can potentially find further errors in the values. Is there a way to inject these errors into the already validated form so they can be displayed via the usual form error display methods? Or, are ...

In Django how do I notify a parent when a child is saved in a foreign key relationship?

I have the following two models: class Activity(models.Model): name = models.CharField(max_length=50, help_text='Some help.') entity = models.ForeignKey(CancellationEntity) ... class Cancellation(models.Model): activity = models.ForeignKey(Activity) date = models.DateField(default=datetime.now().date()) descrip...

Running a web app in Grails vs Django

I'm currently in the planning stage for a web application and I find myself trying to decide on using Grails or Django. From an operation perspective: Which ecosystem is easier to maintain (migrations, backup, disaster recovery etc.)? If using grails it'll probably be a typical tomcat + mysql on linux. If django it'll be apache + my...

Django with custom, non-SQL service to store models?

Can I have a custom service providing the storage of the models I use in Django? That service would not be speaking SQL. I would like to build a web frontend to a system that consists of multiple services linked with a network based IPC, one of which provides an interface to commonly used, persistent objects (stored in a database). The...

How can I port a legacy Java/J2EE website to a modern scripting language (PHP,Python/Django, etc)?

I want to move a legacy java web application (J2EE) to a scripting language -- any scripting language -- in order to improve programming efficiency. What is the easiest way to do this? Are there any automated tools that can convert the bulk of the business logic? ...

How to configure server for small hosting company for django-powered flash sites?

I'm looking at setting up a small company that hosts flash-based websites for artist portfolios. The customer control panel would be django-powered, and would provide the interface for uploading their images, managing galleries, selling prints, etc. Seeing as the majority of traffic to the hosted sites would end up at their top level d...

Generate JavaScript objects out of Django Models

I am performing a lot of JavaScript work in the browser and would like to have some of that backend functionality in the front-end. Specifically, it would be nice to have the functions get(), save(), all() and count() available to the client. Additionally, it would be great to have the field list of the model already available in the gen...

How do I get python-markdown to additionally "urlify" links when formatting plain text?

Markdown is a great tool for formatting plain text into pretty html, but it doesn't turn plain-text links into URLs automatically. Like this one: http://www.google.com/ How do I get markdown to add tags to URLs when I format a block of text? ...

Sometimes can't delete an Oracle database row using Django

I have a unit test which contains the following line of code Site.objects.get(name="UnitTest").delete() and this has worked just fine until now. However, that statement is currently hanging. It'll sit there forever trying to execute the delete. If I just say print Site.objects.get(name="UnitTest") then it works, so I know that i...

variables as parameters in field options

I want to create a model, that will set editable=False on creation, and editable=True on editing item. I thought it should be something like this: home = models.ForeignKey(Team, editable=lambda self: True if self.id else False) But it doesn't work. Maybe something with overriding the init can help me, but i don't sure what can do th...

Django @ Google App Engine - Site Map Framework

Hi Folks, has anybody managed to get Djangos site map framework to run on Google App Engine? I receive the following exception: ImproperlyConfigured at /sitemap.xml You haven't set the DATABASE_ENGINE setting yet. Request Method: GET Request URL: http://127.0.0.1:8080/sitemap.xml Exception Type: ImproperlyConfigured Exception Valu...

Django template with jquery: Ajax update on existing page

I have a Google App Engine that has a form. When the user clicks on the submit button, AJAX operation will be called, and the server will output something to append to the end of the very page where it comes from. How, I have a Django template, and I intend to use jquery. I have the following view: <html> <head> <title></title> <script...

How to port from Drupal to Django?

What would be the best way to port an existing Drupal site to a Django application? I have around 500 pages (mostly books module) and around 50 blog posts. I'm not using any 3rd party modules. I would like to keep the current URLS (for SEO purposes) and migrate database to Django. I will create a simple blog application, so migrating blo...

Using django-rest-interface

I have a django application that I'd like to add some rest interfaces to. I've seen http://code.google.com/p/django-rest-interface/ but it seems to be pretty simplistic. For instance it doesn't seem to have a way of enforcing security. How would I go about limiting what people can view and manipulate through the rest interface? Norma...

In Django, how could one use Django's update_object generic view to edit forms of inherited models?

In Django, given excerpts from an application animals likeso: A animals/models.py with: from django.db import models from django.contrib.contenttypes.models import ContentType class Animal(models.Model): content_type = models.ForeignKey(ContentType,editable=False,null=True) name = models.CharField() class Dog(Animal): is_lucky...

django,fastcgi: how to manage a long running process?

I have inherited a django+fastcgi application which needs to be modified to perform a lengthy computation (up to half an hour or more). What I want to do is run the computation in the background and return a "your job has been started" -type response. While the process is running, further hits to the url should return "your job is still ...