django

Web based large files upload with resume facility in django or asp.net

Hi We are looking for an approach for developing a web based application which should have facility to upload large files (size upto 10 GB) with resume facility. We want to develop this application using python/django or C#/asp.net. Any suggestion would be appreciated. ...

Django ModelForm and datetimefield : no widget

I try to display a modelform containing a datetime field But when I try to display this field, anything wants to appear. In the model form, when I print self.fields : {'status': <django.forms.fields.TypedChoiceField object at 0x1340e10>, 'reserved': <django.forms.fields.BooleanField object at 0x1340cd0>, 'date_publication': None, 'dat...

Is python good enough for big applications

From the moment I faced python the only thing I can say for it is "It is awesome". I am using Django framework for it and I am amazed how quick the things happen and how developer friendly this language is. But from many sides I hear that Python is scripting language, and very useful for small things, experiments etc. So the question is...

Add additional options to Django form select widget

I have a form which I use to construct a queryeset filter. The form pulls in the project status options from the database. However, I wanted to add additional options, for example "All live promotions" ... so the select box would then look something like: All Promotions * All Live Promotions * Draft Submitted Accepted Reported Checke...

In Django, how do I mimic the two-step method of adding users through the admin for my own models?

I have a model where I would like to make a custom admin change_form mimicking the behavior of the Add User functionality of the stock Django Admin Interface. That is, I want a two-step action where the user will first input only a device-id and then be taken to a page where he can enter information on the device. Similar to how you firs...

django orm versus sqlachemy, are they basically the same thing?

When using django, I believe you can swap out the built-in orm for sqlalchemy (not sure how though?). Are they both basically the same thing or there is a clear winner between the 2? ...

learning pylons now, in django, how easy is it to use sqlalchemy and a different view engine?

learning pylons now, in django, how easy is it to use sqlalchemy and a different view engine? Is it hackery or its really easy? That's pretty much the only reason I am using pylons over django. But I like that fact that django has a bigger community and easier to get answers to issues. ...

error in configure mod_wsgi with Apache2.2

I am follow this http://pradyumnajoshi.wordpress.com/2009/06/09/setting-up-mod_wsgi-for-apache-and-django-on-windows/ I am using python2.6, Apache2.2, Django1.3 and mod_wsgi>3 on windows xp. now I have installed Apache correctly it is running well. and I have add the following line in httpd.conf file:- LoadModule wsgi_module modules/mod...

QuerySelectField works on one server, breaks on another with same code.

I'm in the process of setting up a test installation of my current Python/Django project. Everything works great on my dev server, but we recently set up a new VM for the test and eventual production copies of the project. I'm using Python, Django, SqlAlchemy (with a MSSQL backend), and WTForms as my main packages. I'm having a proble...

How to add to the pythonpath in windows 7?

Hi There, I have a directory which hosts all my django app. *"C:\My_Projects".* I want to add this directory to my pythonpath so I can call the apps directly. I have *right clicked My Computer > Properties > Advanced System Settings > Environmental Variables. Then I added C:\My_Projects\; to my Path variable* but it still doesn't read ...

help using django's ORM for UNION query

Hi people, i am making a history page for a website. The structure of my classes is something like this: class Person(models.Model): name = models.CharField(max_length=100) type = models.CharField(max_length=30) class History(models.Model): date = models.DateField(max_length=100) action = models.CharField(max_length=...

How to copy InMemoryUploadedFile object to disk

I am trying to catch a file sent with form and perform some operations on it before it will be saved. So I need to create a copy of this file in temp directory, but I don't know how to reach it. Shutil's functions fail to copy this file, since there is no path to it. So is there a way to do this operation in some other way ? My code : ...

django tiny mce is normal text field instead of rich text formatting? a fix please. Settings included.

I installed Django tiny mce however i am getting a normal text area in my admin. Can anyone help me to correct this to a rich text area where i can acces text formating? here are my settings.py import os PROJECT_DIR = os.path.dirname(__file__) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '[email protected]...

How to store the result of a delay-call using celery in a django view?

I`ve followed the guidelines in http://celeryq.org/docs/django-celery/getting-started/first-steps-with-django.html and created a view that calls my test method in tasks.py: import time from celery.decorators import task @task() def add(x, y): time.sleep(10) return x + y But if my add-method takes a long time to respond, how c...

Django app stops working when deployed on Apache ( subprocess runs, but fails )

My Django app stops working when deployed on Apache ( with mod_wsgi ). It runs on a Windows server. The app calls on a windows executable called "rex" ( Alchemy Remote Executor ) which executes a command on another remote windows box. process = subprocess.Popen( ['rex',ip,usr,pwd,command], stdout=subprocess.PIPE, universal_newlines=...

Denormalising field in django

I'm finding it difficult to denormalise a field in a django model. I have: class AnswerSet(models.Model): title = models.CharField(max_length=255) num_answers = models.PositiveIntegerField(editable=False, default=0) answers = models.ManyToManyField(Answer, through='AnswerSetAnswer') ... class AnswerSetAnswer(models.Mode...

Django get_FIELD_display

Hi Guys, I am trying to access data.get_age_display in my email template. I can't seem to get the display of this. I am not sure what I am doing wrong, I've using get_FIELD_display numerous times before but passed as context to a normal template. Is there something different with forms? class RequestForm(forms.Form): ADULT = 1 ...

Using sessions in Django

I'm using sessions in Django to store login user information as well as some other information. I've been reading through the Django session website and still have a few questions. From the Django website: By default, Django stores sessions in your database (using the model django.contrib.sessions.models.Session). Though this ...

Django sessions is not working

Hi, i'm trying to find bug for few hours now but nothing comes out. Django gives me this error message when i'm trying to access request.SESSION from view. No other errors. 'WSGIRequest' object has no attribute 'SESSION' Here is my Django settings what points to sessions and authentication. Most of them are set to their defaults. ...

Django, Python, trying to change field values / attributes in object retrieved from DB objects.all call, not working, advice appreciated

I'm trying to change a specific field from a field in an object that I retrieved from a django db call. class Dbobject () def __init__(self): dbobject = Modelname.objects.all() def test (self): self.dbobject[0].fieldname = 'some new value' then I am able to access a specific attribute like so: objclass = Dbobject(...