Re: Newbie question: How should I structure my very simple project / app?
Just a quick response to thank everyone for the suggestions. I'll let you all know how I get on. ;-) (Actually, you'll probably guess from the quality or absurdity of my questions that may come up over the coming days / weeks) WZ On 20 October 2010 00:01, timc3wrote: > Take a look at: > > http://lincolnloop.com/django-best-practices/projects/layout.html > > After you have done the tutorials and stuff. > > Tim. -- 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.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Newbie question: How should I structure my very simple project / app?
Take a look at: http://lincolnloop.com/django-best-practices/projects/layout.html After you have done the tutorials and stuff. Tim. -- 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.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Newbie question: How should I structure my very simple project / app?
Waza - Django should be ideal for your project. It should be a snap once you figure out how Django's put together. *Skip Do as others have suggested and do the tutorial. It will help you better understand MVC. * Skip the AJAX stuff unitl you have the above figured out. The magic ponies sometimes get in the way of more important details while you are learning. On Tuesday, October 19, 2010 07:52:34 am wawa wawawa wrote: > Hi All, > > I'm new to Django (and to be honest, a little bit hazy on the subtleties of > MVC, but if you don't try, you don't learn). > > I want to create a simple web frontend for a Python program I have already > (mostly) written and I'd like to use Django (which may be overkill... not > sure). > > - Users have a bunch of externally generated XML files. (Could be one, > could be many (max of 20?). Possibly in an zip or tar.gz archive). > - Users access the Django app and can upload via a simple form (with funky > Ajax uploadiness - including as many ponies and rainbows as might be > necessary) > - A backend script will process this XML, performing all manner of > fantastical space/time-bending magic (which will not take longer than 5 to > 10 secs... Max tested with many, many input files is about 40seconds). > - The output will be produced and the user will have the option to download > as CSV or possibly PDF. Possibly with functionality to allow the report to > be mailed to them when complete (so user identity needs to be built in). > > Very vague I know. But a very simple web app I think. Essentially, the > backend script summarizes the input files into a summary per file and a > total summary of the presence and count of certain keys / values or > combinations of data. There's a set of logical rules that I have yet to > invent which will be used when parsing the input XML (for example: if value > "B" exists in "A" with attribute "Z" but not attribute "X" then count, > otherwise do not). > > The reason I want to use Django is: > - I know I will be asked to add all sorts of functionality to this. Django > is extensible, powerful. > - I don't want to be responsible for maintaing the "rules" and would love > to be able to expose this via an admin interface so anyone (with > authorization) can add or edit rules logic. > - I've already got the bulk of the parsing script written in Python. > > I guess I need: > - a handler for the input files. > - a way to pass these file serially to my backend script (I presume I would > use the filesystem for this? The input files can be anywhere from 2K to 1MB > in very extreme cases.) > - a mechanism to separate different user sessions. > - a way to accumulate the results of each file parse and then report on the > total (store the results in the DB?) > - a mechanism to present and archive the reports (and then this leads to a > way to look up old reports). > > So, given this paucity of requirements and the horrendously unclear > explanation above, what suggestions might you lot have? (Apart from "RTFM", > of course!) > > - Do / Don't use Django? > - Structure of projects / Apps? > - Any key external apps / modules that might be useful (e.g. for handling > for uploads) > - Any gotchas when invoking backend scripts? > ... > > I'm really just looking for a nudge in the right direction. > > Thanks in advance for any tips, pointers or help you can give. > > Thanks > > Waza -- -- 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.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Newbie question: How should I structure my very simple project / app?
Hi Javier, Many thanks for your comments. On 19 October 2010 15:57, Javier Guerra Giraldezwrote: > first and foremost, yes, you have to read the manual, and do the > tutorial. ideally, you should forget about your specific project > while doing it. it's not too long, should take a few hours to do > completely. the fact is, if you skip this step, you won't get useful > answers here. > Understood. I'm working my way through them now. [...comment ref: message queueing...] I appreciate your insight into the queuing side. The one thing that I cannot seem to parse is how to structure the App so it fits with the Django approach. Is this one project and one app or is it an app per functional element of the system? Essentially this is a glorified form 'that does stuff in the backend'. I'm struggling with how to structure it... good luck, and welcome > Appreciated! Regards W -- 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.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Newbie question: How should I structure my very simple project / app?
On Tue, Oct 19, 2010 at 6:52 AM, wawa wawawawrote: > So, given this paucity of requirements and the horrendously unclear > explanation above, what suggestions might you lot have? (Apart from "RTFM", > of course!) first and foremost, yes, you have to read the manual, and do the tutorial. ideally, you should forget about your specific project while doing it. it's not too long, should take a few hours to do completely. the fact is, if you skip this step, you won't get useful answers here. then, you'll see that it's easy to read the rest of the documentation to find anything you need for your project. if at any point you need some pointers, just ask here, in most cases you'll get a quick answer about where to find the relevant docs, together with some extra tips. and lastly, you'll find that your Django code shouldn't wait until your backend process finishes, so you'll have to spin the task out of the request/response cycle. the ideal answer is a queue manager, like RabbitMQ + celery. but if you don't foresee hundreds of files processed daily, a ghetto queue should be enough. for that, simply save the uploaded file somewhere, and note in the database any other parameters, meanwhile your background process checks the DB for tasks ready to be processed, takes them, and updates the status in the DB record. the user would check his task in some status page, and when it reaches the 'done' state, presents the result. good luck, and welcome -- Javier -- 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.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Newbie question: How should I structure my very simple project / app?
Hi All, I'm new to Django (and to be honest, a little bit hazy on the subtleties of MVC, but if you don't try, you don't learn). I want to create a simple web frontend for a Python program I have already (mostly) written and I'd like to use Django (which may be overkill... not sure). - Users have a bunch of externally generated XML files. (Could be one, could be many (max of 20?). Possibly in an zip or tar.gz archive). - Users access the Django app and can upload via a simple form (with funky Ajax uploadiness - including as many ponies and rainbows as might be necessary) - A backend script will process this XML, performing all manner of fantastical space/time-bending magic (which will not take longer than 5 to 10 secs... Max tested with many, many input files is about 40seconds). - The output will be produced and the user will have the option to download as CSV or possibly PDF. Possibly with functionality to allow the report to be mailed to them when complete (so user identity needs to be built in). Very vague I know. But a very simple web app I think. Essentially, the backend script summarizes the input files into a summary per file and a total summary of the presence and count of certain keys / values or combinations of data. There's a set of logical rules that I have yet to invent which will be used when parsing the input XML (for example: if value "B" exists in "A" with attribute "Z" but not attribute "X" then count, otherwise do not). The reason I want to use Django is: - I know I will be asked to add all sorts of functionality to this. Django is extensible, powerful. - I don't want to be responsible for maintaing the "rules" and would love to be able to expose this via an admin interface so anyone (with authorization) can add or edit rules logic. - I've already got the bulk of the parsing script written in Python. I guess I need: - a handler for the input files. - a way to pass these file serially to my backend script (I presume I would use the filesystem for this? The input files can be anywhere from 2K to 1MB in very extreme cases.) - a mechanism to separate different user sessions. - a way to accumulate the results of each file parse and then report on the total (store the results in the DB?) - a mechanism to present and archive the reports (and then this leads to a way to look up old reports). So, given this paucity of requirements and the horrendously unclear explanation above, what suggestions might you lot have? (Apart from "RTFM", of course!) - Do / Don't use Django? - Structure of projects / Apps? - Any key external apps / modules that might be useful (e.g. for handling for uploads) - Any gotchas when invoking backend scripts? ... I'm really just looking for a nudge in the right direction. Thanks in advance for any tips, pointers or help you can give. Thanks Waza -- 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.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.