Is it worth refactoring a version 2 of django app to use reusable app

2012-03-05 Thread Amit Sethi
Hi all, My question is very simple , Is it worth refactoring an existing and running app for its version 2 , such that it uses reusable apps. Also is there a nice blog post on the benefits of reusable apps -- A-M-I-T S|S -- You received this message because you are subscribed to the Google Gro

How does the multiple database concept work after django 1.2

2012-03-02 Thread Amit Sethi
Hi all , My app has started breaking after moving to django 1.3 . I don't really understand why? I am working using site framework and given model definition through app_label. The only majot change as I can see is that I use UUID Fields rather than AutoField. Now somehow i see that my app is try

Taking a sample mysql dump

2012-01-05 Thread Amit Sethi
Is there a way one could take the dump of just a few sample fields using mysqldump or some other similar tool. ?? Such that you can use it similar to fixture data -- A-M-I-T S|S -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Integrating facebook canvas with django

2011-10-20 Thread Amit Sethi
Hi all , I have to integrate a few django apps with facebook without having to do a major code change on the django apps side. One of the things that I need is to do is to replace django's user backend such that it uses the facebook authentication mechanism .But at same time be able to use other t

Facebook csrf middleware problem

2011-09-28 Thread Amit Sethi
Hi all , I am writing that shall be a facebook canvas app as well as a standard app at the same time. Now for the time being I am just working with removing csrf from my middleware classes but does anyone know about a project that handles this more effectively such that i can use csrf middleware fo

circular dependency in models.py

2011-09-26 Thread Amit Sethi
I think the solution to this might actually be very simple . I have an app stories that looks something like this at the moment . It is in the same file ideally i would like if both of them were related by foreignkey but that is not possible because they are in same file and there are declaration i

Workflow for a django based facebook canvas app

2011-09-23 Thread Amit Sethi
Well a very common workflow for writing views in django is to do something like this if request.method == 'POST': do some form related stuff else : do some other stuff But for a facebook canvas app all requests are POST , how can I change my workflow such that my app works for both facebook

Delegating a async job from a django view

2011-08-25 Thread Amit Sethi
What is the best solution for delegating a long time taking job from a django view. Basically i wish to query a few web api , analyze and then create a report . The report is not to be created in a sync manner and can be sent at a later time . But it will have a web interface to decide a few factor

Handling Efficiency issues

2011-07-13 Thread Amit Sethi
Hi all for some reason i am doing something like this for i in Message.objects.all(): i.read_at = datetime.now() i.save() now the number of Message instances are likely to increase by a lot with time . My question is is it likely that this code piece will become very slow over tim

Efficiently querying db

2011-07-13 Thread Amit Sethi
I have a db that looks something like this . { message : xyz parent : 23 id : 25 } or { message : abc parent : None id : 25 } { message : cde parent : 28 id : 32 } { message : lbq parent : 23 id : 35 } I want to make seperate the lists such that messages in same thread( The parent message a

Re: Integrity Error with generic relation using ContentType

2011-06-14 Thread Amit Sethi
On Tue, Jun 14, 2011 at 8:00 PM, christian.posta wrote: > Yes, it is. Any reason why you want the content-types to be part of > your fixtures? Why not let django build that up by itself? > Well essentially it was just a dumpdata from earlier that is being used. But why should I not have it as part

Re: Integrity Error with generic relation using ContentType

2011-06-14 Thread Amit Sethi
On Tue, Jun 14, 2011 at 1:41 AM, christian.posta wrote: > Are you using your own fixtures (like initial_data.json)? > Is it possible that in your initial_data.json ( or whatever fixture > you're using) that you're including entries into the content_types [..] Well i do have entries of the kind th

Integrity Error with generic relation using ContentType

2011-06-13 Thread Amit Sethi
Hi all , I am trying to introduce some messaging capability in my app. I tried to create a generic relation between some part of my messaging app and a model in one of my previous apps. However when fixtures load I get this error. I am not able to make head and tail of this . What is happening can

Re: Reasons to use managers

2011-06-02 Thread Amit Sethi
> functionality to your models. (For "row-level" functionality -- i.e., > functions that act on a single instance of a model object -- use Model > methods, not custom Manager methods.) > But what is the benefit of model methods compared to adding an extra field and getting almost the same thing do

Reasons to use managers

2011-06-02 Thread Amit Sethi
Hi all , I have a situation in which i am contemplating using an extra field although the same thing can be done using a manager(although the function may take some time). In this situation normalization isn't actually a priority. Are there some other reasons to use a manager. Also what would be th

Re: Slightly cryptic debug message

2011-05-26 Thread Amit Sethi
Well for example : """ Exception Type: TemplateSyntaxError Exception Value: Caught NameError while rendering: global name 'approved' is not defined """ I don't understand if it is a NameError why should django say TemplateSyntax error when exception value it says it got caught a NameErro

Slightly cryptic debug message

2011-05-26 Thread Amit Sethi
Hi all , I have a question , On the the new versions of django (after 1.2) a lot of syntax errors and other errors come as Templatesyntax errors instead .. . Shouldn't django try to give more compatible debug message. -- A-M-I-T S|S -- You received this message because you are subscribed to the

Re: South migration for fixtures

2011-05-26 Thread Amit Sethi
And what process should be followed in production and for other collaborators. -- A-M-I-T S|S -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group,

South migration for fixtures

2011-05-25 Thread Amit Sethi
Hi all , I might be wrong with some of the concepts as I am new to south. I am using south to migrate some fixture data for a django app. Also something worth noting is I am bringing south new into the django app it was not part of installed apps till now . So the workflow I have followed till now

Re: form being deleted from base.html

2011-05-24 Thread Amit Sethi
Hi all sorry it was an issue with my html. -- A-M-I-T S|S -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr.

Re: GET/POST

2011-05-24 Thread Amit Sethi
I think this is csrfmiddleware issue . Just add {% csrf_token %} like this {% csrf_token %} -- A-M-I-T S|S -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe fro

form being deleted from base.html

2011-05-24 Thread Amit Sethi
Hi all , I am not able to understand this but it seems while extending the base template removes form tag. Is this possible in some scenario. This is the only explanation I am able to come up with for the behavior I am seeing in my app. -- A-M-I-T S|S -- You received this message because you ar

sqlite3 and south data migration

2011-04-27 Thread Amit Sethi
Hi all does sqlite3 not support data migration. I am trying to implement migration on my test fixtures using south however i get this particular error : AttributeError: 'DatabaseFeatures' object has no attribute 'supports_tablespaces' -- A-M-I-T S|S -- You received this message because you ar

field specific error message

2010-03-12 Thread Amit Sethi
How do you do field specific messages ... like for a Telephone Number , if all characters are not digit send message (no invalid ) . I have tried raising forms.ValidationError like specified here (http://www.djangosnippets.org/snippets/337/) I have also tried changing forms.Form._errors ... it i

Text Search using Python

2010-01-14 Thread Amit Sethi
Hi , I have a project with a few static html pages , I wish to search these static html using a django search app . Most of the tutorials I saw are focused on searching django models but none I could see concentrates on indexing static html pages . Can some one guide be to a library /tutorial etc

Possibility of recursive rendering

2010-01-10 Thread Amit Sethi
Hi I wish to know if it is possible to use recursive rendering ? . What I mean by that is that their is a template which renders no of comments on a paragraph . SInce their are many paragraphs what i wish to send is a list of render_to_response calls for each paragraph. i.e send response messages

Using django only for request handling work

2009-12-27 Thread Amit Sethi
Hi ,I have a project that is in general written to work with wsgi server except i wish to alter some of the environ variables provided to the app. So I have a function: def __call__(self, environ, start_response): In this I want to change some part of environ So my application looks someth

Help with apache mod rewrite engine

2009-12-08 Thread Amit Sethi
Hi all , I need some help understanding the mod rewrite module of apache . What I wished to do want that i had a comments folder by the name of /comments/ . Now i run a django project on /sees and i want all the call to /comments/ be redirected to /sees/comments and than be handled by the wsgi file

modwsgi on suburl

2009-11-25 Thread Amit Sethi
Hi , can somebody tell me how i should configure mod_wsgi on a suburl I want to set a django project on domain.com/test/ so my urls.py at present looks like : urlpatterns = patterns('', (r'^(.*)', 'sttp.views.serve'),) and the wgi scrip alias is WSGIScriptAlias /test /home/amit/sttp-projec

how to import a library in only in django project

2009-11-25 Thread Amit Sethi
Hi , I want to use a library in a django project but I don't want to put it in python path. Where am I supposed to put the sys.append so that it will available to the whole django project. -- A-M-I-T S|S -- You received this message because you are subscribed to the Google Groups "Django users"

how to serve multiple files using mod_wsgi

2009-11-19 Thread Amit Sethi
Hi , I have been trying to make a project work with mod_wsgi under apache . The project is not exactly in django . It has a development server of its own for adapting I was using this as a reference .The mod_wsgi manual says that you have to send the response in following manner def application(en

Re: first project taking it too production server

2009-11-17 Thread Amit Sethi
Hi , I was able to run it for the time being using mod_proxy but is this is good way . What are the possible problems because of it. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.c

Re: first project taking it too production server

2009-11-16 Thread Amit Sethi
yes I do have ssh access and the server does have python on it. On Tue, Nov 17, 2009 at 7:02 AM, Kenneth Gonsalves wrote: > On Monday 16 Nov 2009 7:41:47 pm Amit Sethi wrote: >> Hi , I just developed my first small app using django , I wish to >> deploy it . I have a apache ser

first project taking it too production server

2009-11-16 Thread Amit Sethi
Hi , I just developed my first small app using django , I wish to deploy it . I have a apache server with drupal running on it . Can anybody guide me about the procedure i should use to deploy the project without disturbing the drupal installation in any way... -- A-M-I-T S|S -- You received th

Re: Following part 2 of the tutorial, I get the following error when trying to view /admin/:

2009-07-24 Thread Amit Sethi
On Fri, Jul 24, 2009 at 6:04 PM, ashish wrote: Well as your error message says , Template does not exist my first guess would be that you did not Activate the admin site .. if that is not so , you should have a look at the section , Customize the look and feel of admin ... it is talking about the

Re: Hi people

2009-07-22 Thread Amit Sethi
Take up a small project like the tutorial... On Wed, Jul 22, 2009 at 1:00 PM, Vasil Vangelovski wrote: > > A good place to start is the tutorial: > > http://docs.djangoproject.com/en/dev/intro/tutorial01/ > > If you are new to python you can also check dive into python: > > http://diveintopython.

Re: How to get this value

2009-07-13 Thread Amit Sethi
I am not sure what you are trying to do. And the code seems almost unreadable . You could try posting the code to : http://pastebin.com/ Also what might be helpful: What is the problem statement what is this code trying to solve ? What value you want and where ? And what error does django giv

Help regarding how to deliver a particular project

2009-06-26 Thread Amit Sethi
I hope i am not breaking any code here and i don't get mails saying its not the place to discuss this . I am trying to create a small xml-rpc like service which uses some other multiple REST/JSON based web services . I am using django because I like simple organized architecture it gives for deve

Searching disparate databases

2009-06-08 Thread Amit Sethi
Hi all , I am trying to develop a web app that searches products on some local stores and give the price.Now I can obviously have a format for stores to feed my database but rather than that .What I want is that the local stores be able to dump their database/feeds on my Server . It woul

Re: serving static files

2009-04-13 Thread amit sethi
hi thanks , well got the point about url-conf the url pattern you have given does not raise the error but i have still not been able to get my css working my urls.py has an entry (r'^sitemedia/?P.*$', 'django.views.static.serve', {'document_root': '/home/amit/analytics/sitemedia', 'show_ind

serving static files

2009-04-13 Thread amit sethi
Hi , i am new to django and i am trying to serve my css file . I followed the instruction to serve static files in development server and made a seperate /media directory I copied my css file into it and changed the url pattern to include: (r'^site_media/default.css$', 'django.views.static.serve'