Title
stringlengths
11
150
A_Id
int64
518
72.5M
Users Score
int64
-42
283
Q_Score
int64
0
1.39k
ViewCount
int64
17
1.71M
Database and SQL
int64
0
1
Tags
stringlengths
6
105
Answer
stringlengths
14
4.78k
GUI and Desktop Applications
int64
0
1
System Administration and DevOps
int64
0
1
Networking and APIs
int64
0
1
Other
int64
0
1
CreationDate
stringlengths
23
23
AnswerCount
int64
1
55
Score
float64
-1
1.2
is_accepted
bool
2 classes
Q_Id
int64
469
42.4M
Python Basics and Environment
int64
0
1
Data Science and Machine Learning
int64
0
1
Web Development
int64
1
1
Available Count
int64
1
15
Question
stringlengths
17
21k
Does Django need an IDE?
2,002,644
2
8
3,510
0
python,django
This question comes up a lot in various forms. I suspect it's because there just isn't a Python IDE which is universally accepted to be awesome. If I could have: some of the features of PyDev, like like real code completion, module navigation, live syntax checking and pylint a fantastic (and fast) text editor (like eric4's scintilla-based editor) support for django templates (maybe with gui support for wx or glade or whatever), awesome debugging (like C# on Visual Studio) a reasonable footprint (i.e., not Eclipse/Aptana or NetBeans) cross platform (Mac OS X, Linux, and Windows) sane version control support auto doctests and unit tests Then I'd buy it. All of the python IDEs come close, but all miss the mark by a bit. (Better yet, it would be open source and I'd download it and donate / contribute to it).
0
0
0
0
2010-01-04T16:39:00.000
9
0.044415
false
2,000,631
0
0
1
6
My company is evaluating the possibility of developing a specialized IDE for Django. So we would like to ask Django users: Do you feel the need for a specialized IDE for Django? Would you be willing to pay for it, or would you only consider free a open-source product? What Django-specific features are you missing currently in your development tools?
Does Django need an IDE?
2,000,679
4
8
3,510
0
python,django
I am using Komodo Edit and it's very good. There is a lot of good open-sources product so i don't think that I would buy a commercial product. Maybe a very good and easy-to-use debugger would make me change my mind. I hope it helps.
0
0
0
0
2010-01-04T16:39:00.000
9
0.088656
false
2,000,631
0
0
1
6
My company is evaluating the possibility of developing a specialized IDE for Django. So we would like to ask Django users: Do you feel the need for a specialized IDE for Django? Would you be willing to pay for it, or would you only consider free a open-source product? What Django-specific features are you missing currently in your development tools?
Converting PDF to images automatically
2,002,436
9
34
70,011
0
python,pdf,image
You could call e.g. pdftoppm from the command-line (or using Python's subprocess module) and then convert the resulting PPM files to the desired format using e.g. ImageMagick (again, using subprocess or some bindings if they exist).
0
0
0
1
2010-01-04T20:33:00.000
6
1
false
2,002,055
0
0
1
1
So the state I'm in released a bunch of data in PDF form, but to make matters worse, most (all?) of the PDFs appear to be letters typed in Office, printed/fax, and then scanned (our government at its best eh?). At first I thought I was crazy, but then I started seeing numerous pdfs that are 'tilted', like someone didn't get them on the scanner properly. So, I figured the next best thing to getting the actual text out of them, would be to turn each page into an image. Obviously this needs to be automated, and I'd prefer to stick with Python if possible. If Ruby or Perl have some form of implementation that's just too awesome to pass up, I can go that route. I've tried pyPDF for text extraction, that obviously didn't do me much good. I've tried swftools, but the images I'm getting from that are just shy of completely unusable. It just seems like the fonts get ruined in the conversion. I also don't even really care about the image format on the way out, just as long as they're relatively lightweight, and readable.
Python CGI transaction
2,002,206
3
1
262
0
python,cgi
Same as you should do with every POST: don't send output, but put the output in a session variable and redirect to a pure-GET request. This one looks in the session for messages, and clears+displays those.
0
0
0
1
2010-01-04T20:57:00.000
1
1.2
true
2,002,180
0
0
1
1
I have a Python CGI handling a payment transaction. When the user submits the form, the CGI is called. After submission, the CGI takes a while to perform the credit card transaction. During that time, a user might hit the ESC or refresh button. Doing that will not "kill" the CGI, meaning, the script will keep running completing the transaction but the CGI's HTML output will never reach the client. This means the user will not know the transaction was completed. How can I solve this problem?
Why are django projects python packages?
2,007,779
1
2
306
0
python,django
The core of a project is a settings.py and a root urls.py. Both of those are Python modules, thus they need to be importable somehow. You can put the project directory directly on the Python path and thus make them importable as top-level modules, but that's arguably even worse practice. Better to have the project be a package and the settings and urls be modules within it.
0
0
0
0
2010-01-05T01:17:00.000
4
1.2
true
2,003,527
0
0
1
4
Why aren't they simply directories? Any good advice says to keep as much as possible in the apps and not to couple them to the project. The very ability to import an app as project.application discourages this. Why does django-admin.py create the __init__.py at all? The project is perfectly useful without it. What is the justification?
Why are django projects python packages?
2,003,806
0
2
306
0
python,django
I think the idea is that you can reuse the applications but you don't need to move them from the project where they were initially created. If the project weren't a package you would need to copy/move the application you want to reuse to a python package. Because of that being the project itself a proper python package you can reuse the applications in it without moving the applications to other place.
0
0
0
0
2010-01-05T01:17:00.000
4
0
false
2,003,527
0
0
1
4
Why aren't they simply directories? Any good advice says to keep as much as possible in the apps and not to couple them to the project. The very ability to import an app as project.application discourages this. Why does django-admin.py create the __init__.py at all? The project is perfectly useful without it. What is the justification?
Why are django projects python packages?
2,003,748
1
2
306
0
python,django
There isn't a requirement that apps be inside the project's namespace, to my knowledge. Just that they be on the $PYTHONPATH. As such, they are usable by any other code on the system which shares the same PYTHONPATH.
0
0
0
0
2010-01-05T01:17:00.000
4
0.049958
false
2,003,527
0
0
1
4
Why aren't they simply directories? Any good advice says to keep as much as possible in the apps and not to couple them to the project. The very ability to import an app as project.application discourages this. Why does django-admin.py create the __init__.py at all? The project is perfectly useful without it. What is the justification?
Why are django projects python packages?
2,003,550
2
2
306
0
python,django
We have a single project that we "subclass" of sorts for other projects. So we have other projects that import stuff from the main project. I guess for us it provides the common namespace that contains all the other apps. We could move to a package with all our apps in it separate from the projects i guess. Our system has grown rather than been planned. So I guess my answer is, it provides a good root namespace. (for our needs) :)
0
0
0
0
2010-01-05T01:17:00.000
4
0.099668
false
2,003,527
0
0
1
4
Why aren't they simply directories? Any good advice says to keep as much as possible in the apps and not to couple them to the project. The very ability to import an app as project.application discourages this. Why does django-admin.py create the __init__.py at all? The project is perfectly useful without it. What is the justification?
AppEngine/Python, query database and send multiple images to the client as a response to a single get request
2,041,528
1
0
856
0
python,ajax,image,google-app-engine
As an improvement to Alex's answer, there's no need to use memcache: Simply do a keys-only query to get a list of keys of images you want to send to the client, then use db.get() to fetch the image corresponding to the required key for each image request. This requires roughly the same amount of effort as a single regular query.
0
1
0
0
2010-01-05T01:44:00.000
4
0.049958
false
2,003,630
0
0
1
4
I am working on a social-network type of application on App Engine, and would like to send multiple images to the client based on a single get request. In particular, when a client loads a page, they should see all images that are associated with their account. I am using python on the server side, and would like to use Javascript/JQuery on the client side to decode/display the received images. The difficulty is that I would like to only perform a single query on the server side (ie. query for all images associated with a single user) and send all of the images resulting from the query to the client as a single unit, which will then be broken up into the individual images. Ideally, I would like to use something similar to JSON, but while JSON appears to allow multiple "objects" to be sent as a JSON response, it does not appear to have the ability to allow multiple images (or binary files) to be sent as a JSON response. Is there another way that I should be looking at this problem, or perhaps a different technology that I should be considering that might allow me to send multiple images to the client, in response to a single get request? Thank you and Kind Regards Alexander
AppEngine/Python, query database and send multiple images to the client as a response to a single get request
2,003,692
2
0
856
0
python,ajax,image,google-app-engine
The App Engine part isn't much of a problem (as long as the number of images and total size doesn't exceed GAE's limits), but the user's browser is unlikely to know what to do in order to receive multiple payloads per GET request -- that's just not how the web works. I guess you could concatenate all the blobs/bytestreams (together with metadata needed for the client to reconstruct them) and send that (it will still have to be a separate payload from the HTML / CSS / Javascript that you're also sending), as long as you can cajole Javascript into separating the megablob into the needed images again (but for that part you should open a separate question and tag it Javascript, as Python has little to do with it, and GAE nothing at all). I would instead suggest just accepting the fact that the browser (presumably via ajax, as you mention in tags) will be sending multiple requests, just as it does to every other webpage on the WWW, and focus on optimizing the serving side -- the requests will be very close in time, so you should just use memcache to keep the yet-unsent images to avoid multiple fetch-from-storage requests in your GAE app.
0
1
0
0
2010-01-05T01:44:00.000
4
1.2
true
2,003,630
0
0
1
4
I am working on a social-network type of application on App Engine, and would like to send multiple images to the client based on a single get request. In particular, when a client loads a page, they should see all images that are associated with their account. I am using python on the server side, and would like to use Javascript/JQuery on the client side to decode/display the received images. The difficulty is that I would like to only perform a single query on the server side (ie. query for all images associated with a single user) and send all of the images resulting from the query to the client as a single unit, which will then be broken up into the individual images. Ideally, I would like to use something similar to JSON, but while JSON appears to allow multiple "objects" to be sent as a JSON response, it does not appear to have the ability to allow multiple images (or binary files) to be sent as a JSON response. Is there another way that I should be looking at this problem, or perhaps a different technology that I should be considering that might allow me to send multiple images to the client, in response to a single get request? Thank you and Kind Regards Alexander
AppEngine/Python, query database and send multiple images to the client as a response to a single get request
2,003,690
0
0
856
0
python,ajax,image,google-app-engine
Send the client URLs for all the images in one hit, and deal with it on the client. That fits with the design of the protocol, and still lets you only make one query. The client might, if you're lucky, be able to stream those back in its next request, but the neat thing is that it'll work (eventually) even if it can't reuse the connection for some reason (usually a busted proxy in the way).
0
1
0
0
2010-01-05T01:44:00.000
4
0
false
2,003,630
0
0
1
4
I am working on a social-network type of application on App Engine, and would like to send multiple images to the client based on a single get request. In particular, when a client loads a page, they should see all images that are associated with their account. I am using python on the server side, and would like to use Javascript/JQuery on the client side to decode/display the received images. The difficulty is that I would like to only perform a single query on the server side (ie. query for all images associated with a single user) and send all of the images resulting from the query to the client as a single unit, which will then be broken up into the individual images. Ideally, I would like to use something similar to JSON, but while JSON appears to allow multiple "objects" to be sent as a JSON response, it does not appear to have the ability to allow multiple images (or binary files) to be sent as a JSON response. Is there another way that I should be looking at this problem, or perhaps a different technology that I should be considering that might allow me to send multiple images to the client, in response to a single get request? Thank you and Kind Regards Alexander
AppEngine/Python, query database and send multiple images to the client as a response to a single get request
2,003,652
0
0
856
0
python,ajax,image,google-app-engine
Trying to send all of the images in one request means that you will be fighting very hard against some of the fundamental assumptions of the web and browser technology. If you don't have a really, really compelling reason to do this, you should consider delivering one image per request. That already works now, no sweat, no effort, no wheels reinvented. I can't think of a sensible way to do what you ask, but I can tell you that you are asking for pain in trying to implement the solution that you are describing.
0
1
0
0
2010-01-05T01:44:00.000
4
0
false
2,003,630
0
0
1
4
I am working on a social-network type of application on App Engine, and would like to send multiple images to the client based on a single get request. In particular, when a client loads a page, they should see all images that are associated with their account. I am using python on the server side, and would like to use Javascript/JQuery on the client side to decode/display the received images. The difficulty is that I would like to only perform a single query on the server side (ie. query for all images associated with a single user) and send all of the images resulting from the query to the client as a single unit, which will then be broken up into the individual images. Ideally, I would like to use something similar to JSON, but while JSON appears to allow multiple "objects" to be sent as a JSON response, it does not appear to have the ability to allow multiple images (or binary files) to be sent as a JSON response. Is there another way that I should be looking at this problem, or perhaps a different technology that I should be considering that might allow me to send multiple images to the client, in response to a single get request? Thank you and Kind Regards Alexander
Why is Django's Meta an old-style class?
2,007,514
16
19
1,752
0
python,django,class
I believe that there is no real reason (including history, since new-style classes exist since Python 2.2) and that not only can you choose to use a new-style class instead, but that it would probably be a good idea for you to do so (for all the usual reasons).
0
0
0
0
2010-01-05T09:45:00.000
2
1.2
true
2,005,150
0
0
1
2
I noticed that in Django models, there is a class Meta which makes some additional definitions about the model. My question is, why is this done as an old-style class? (i.e. not subclassing object?) Is there a reason for this or is this just a custom? Could I do it as a new-style class in my projects?
Why is Django's Meta an old-style class?
2,007,686
9
19
1,752
0
python,django,class
Since class Meta is never anything but a simple namespace container, there is zero advantage to subclassing object; just eight extra characters to type. Won't hurt anything to do so if you feel like it, though.
0
0
0
0
2010-01-05T09:45:00.000
2
1
false
2,005,150
0
0
1
2
I noticed that in Django models, there is a class Meta which makes some additional definitions about the model. My question is, why is this done as an old-style class? (i.e. not subclassing object?) Is there a reason for this or is this just a custom? Could I do it as a new-style class in my projects?
How to use C# client to consume Django/Python web service (all methods are returning null)?
2,008,000
0
3
1,555
0
c#,python,django,soap,wsdl
One thing you can do is start by building a manual proxy using WebClient, or WebRequest/WebResponse. Construct your manual proxy to send the desired data to the WS for testing. Couple of things to check on the WSDL implementation: The WSDL definition needs to match exactly, including case, for the C# proxy to recognize the values Namespace definitions need to match exactly, including trailing slashes Check the profile of the generated proxy and make sure it conforms with what your desired profile is (i.e. basic or none if needed) If you post your generated proxy we can look at it and see if there is anything out of the ordinary.
0
0
0
0
2010-01-05T17:36:00.000
2
0
false
2,007,908
0
0
1
2
I have a C# command-line client that I'm testing the consumption of SOAP/WSDL via Django/Python/soaplib created WSDL. I've managed to successfully connect to the web service by adding a service reference. I then call one of service's methods, and the service processes the data I send, but it returns null instead of the integer I'm expecting. Any ideas on how to get back something other than a null response? Thanks for any help or suggestions!
How to use C# client to consume Django/Python web service (all methods are returning null)?
2,008,062
0
3
1,555
0
c#,python,django,soap,wsdl
We faced the similar problem while consuming a web service it was the type of data returned we were getting data in UTF-16 format. Please check if you have proper data type in use.
0
0
0
0
2010-01-05T17:36:00.000
2
0
false
2,007,908
0
0
1
2
I have a C# command-line client that I'm testing the consumption of SOAP/WSDL via Django/Python/soaplib created WSDL. I've managed to successfully connect to the web service by adding a service reference. I then call one of service's methods, and the service processes the data I send, but it returns null instead of the integer I'm expecting. Any ideas on how to get back something other than a null response? Thanks for any help or suggestions!
Is it possible to create an end-user facing site using Django admin alone?
2,013,798
2
3
528
0
python,django,django-admin
Revised. Up until you want per-object permission, the answer is yes. As soon as you want permission on a Blog, where a blog is just a row, you're going to have to do some coding. You can totally reuse the admin interface elements. You have all the source, which you can read. Much of what you want is done with "wrappers" around the admin functions. You write a "wrapper" view function checks object permissions. Your wrapper view function calls the admin view function. After that, you'll want to fix the style sheets in the admin pages to be your preferred look and feel.
0
0
0
0
2010-01-06T14:56:00.000
3
1.2
true
2,013,736
0
0
1
3
I'm very new to Django, having never developed on it. I'm trying to develop a site which has functionality exposed only to authenticated users (typical enterprise thing: for this discussion, let's say it's a private blogging platform). The functionality I'm looking for is: Users can create a new blog. each user can belong to multiple groups: the user can only view/comment on blogposts created by member of groups (s)he belongs to. Each user can modify/delete only the posts (s)he creates. As I see it, this is essentially a CRUD application with access control, and the admin app seems to have a lot of this functionality builtin. Is it feasible to develop this complete application using the admin application alone (not as a prototype, as a release-quality solution), or should I look beyond (Generic views? ModelForms?) I'm trying to estimate how long this will take (learning + implementation), so your feedback could give me a good idea, in addition to teaching me the ways of this new Django-world :) Edit: specifically, one of my worries is per-object/per-row permissions. The django wiki says the Permissions system doesn't support that, so can I still use the admin app?
Is it possible to create an end-user facing site using Django admin alone?
2,014,321
0
3
528
0
python,django,django-admin
As for row-level permissions in the admin, in the SVN version of Django you can override the has_add_permission, has_change_permission, and has_delete_permission methods on the ModelAdmin object to implement the custom permissions logic yourself in a way that will apply across the entire admin. I'm pretty sure this feature is going to be in the 1.2 release this year. It doesn't seem to be in the documentation yet, but if you can find the default methods in the django/contrib/admin/options.py file of the Django source, exact instructions are in the docstrings. I wouldn't recommend doing the entire app in the admin, though. It would work fine for the parts of the app where people are writing their posts and creating their blogs, but the admin wouldn't be suited for just displaying the data, unless you write lots of custom code. Writing views that can display objects and submit comments in Django isn't very hard - most of the work is in the templates.
0
0
0
0
2010-01-06T14:56:00.000
3
0
false
2,013,736
0
0
1
3
I'm very new to Django, having never developed on it. I'm trying to develop a site which has functionality exposed only to authenticated users (typical enterprise thing: for this discussion, let's say it's a private blogging platform). The functionality I'm looking for is: Users can create a new blog. each user can belong to multiple groups: the user can only view/comment on blogposts created by member of groups (s)he belongs to. Each user can modify/delete only the posts (s)he creates. As I see it, this is essentially a CRUD application with access control, and the admin app seems to have a lot of this functionality builtin. Is it feasible to develop this complete application using the admin application alone (not as a prototype, as a release-quality solution), or should I look beyond (Generic views? ModelForms?) I'm trying to estimate how long this will take (learning + implementation), so your feedback could give me a good idea, in addition to teaching me the ways of this new Django-world :) Edit: specifically, one of my worries is per-object/per-row permissions. The django wiki says the Permissions system doesn't support that, so can I still use the admin app?
Is it possible to create an end-user facing site using Django admin alone?
2,014,338
0
3
528
0
python,django,django-admin
As a point of sense you really shouldn't be basing a potentially large scale project on Django-Admin. It's kind of silly, and so many people are fascinated with Django-Admin that they literally have a chapter in their books about when and when not to use it for evil. It seems to me that for all the hacking you will have to do to get the admin to look like a reasonably presentable site in terms of personalization, you might as well take the weekend off, actually LEARN the tools you are trying to bastardize, and make a real site. What you are describing wouldn't be heroic by any means in terms of logic. This scenario reminds me of the old Garfield cartoon where the guy buys the cat an incredibly expensive and awesome looking bed, and the cat chooses to sleep in the box that the bed came in.
0
0
0
0
2010-01-06T14:56:00.000
3
0
false
2,013,736
0
0
1
3
I'm very new to Django, having never developed on it. I'm trying to develop a site which has functionality exposed only to authenticated users (typical enterprise thing: for this discussion, let's say it's a private blogging platform). The functionality I'm looking for is: Users can create a new blog. each user can belong to multiple groups: the user can only view/comment on blogposts created by member of groups (s)he belongs to. Each user can modify/delete only the posts (s)he creates. As I see it, this is essentially a CRUD application with access control, and the admin app seems to have a lot of this functionality builtin. Is it feasible to develop this complete application using the admin application alone (not as a prototype, as a release-quality solution), or should I look beyond (Generic views? ModelForms?) I'm trying to estimate how long this will take (learning + implementation), so your feedback could give me a good idea, in addition to teaching me the ways of this new Django-world :) Edit: specifically, one of my worries is per-object/per-row permissions. The django wiki says the Permissions system doesn't support that, so can I still use the admin app?
Django: How should I store a money value?
2,013,893
1
66
37,694
0
python,django,django-models,decimal,currency
You store it as a DecimalField and manually add the decimals if you need to, as Valya said, using basic formatting techniques. You can even add a Model Method to you product or transaction model that will spit out the DecimalField as an appropriately formatted string.
0
0
0
0
2010-01-06T15:09:00.000
10
0.019997
false
2,013,835
0
0
1
2
I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this: PayPal requires 2 decimal places, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across the wire. Django's DecimalField() doesn't set a decimal amount. It only stores a maximum decimal places amount. So, if you have 49 in there, and you have the field set to 2 decimal places, it'll still store it as 49. I know that Django is basically type casting when it deserializes back from the database into a Decimal (since Databases don't have decimal fields), so I'm not completely concerned with the speed issues as much as I am with the design issues of this problem. I want to do what's best for extensibility. Or, better yet, does anyone know how to configure a django DecimalField() to always format with the TWO_PLACES formatting style.
Django: How should I store a money value?
2,013,866
10
66
37,694
0
python,django,django-models,decimal,currency
I suggest to avoid mixing representation with storage. Store the data as a decimal value with 2 places. In the UI layer, display it in a form which is suitable for the user (so maybe omit the ".00"). When you send the data to PayPal, format it as the interface requires.
0
0
0
0
2010-01-06T15:09:00.000
10
1
false
2,013,835
0
0
1
2
I'm running into a paradigm problem here. I don't know whether I should store money as a Decimal(), or if I should store it as a string and convert it to a decimal myself. My reasoning is this: PayPal requires 2 decimal places, so if I have a product that is 49 dollars even, PayPal wants to see 49.00 come across the wire. Django's DecimalField() doesn't set a decimal amount. It only stores a maximum decimal places amount. So, if you have 49 in there, and you have the field set to 2 decimal places, it'll still store it as 49. I know that Django is basically type casting when it deserializes back from the database into a Decimal (since Databases don't have decimal fields), so I'm not completely concerned with the speed issues as much as I am with the design issues of this problem. I want to do what's best for extensibility. Or, better yet, does anyone know how to configure a django DecimalField() to always format with the TWO_PLACES formatting style.
How does one do async ajax calls using cherrypy?
2,015,344
2
1
3,741
1
jquery,python,ajax,asynchronous,cherrypy
The same way you would do them using any other webserver - by getting your javascript to call a URL which is handled by the server-side application.
0
0
0
0
2010-01-06T17:57:00.000
2
1.2
true
2,015,065
0
0
1
1
I'm using cherrypy's standalone server (cherrypy.quickstart()) and sqlite3 for a database. I was wondering how one would do ajax/jquery asynchronous calls to the database while using cherrypy?
Python/Django: If 5 and 5.00 are different values (when expressed in Decimal), then
2,016,387
3
0
388
0
python,django,decimal
I think it would be more correct to say those are different representations of the same value '5'. Internally, the value saved (unless you're actually storing a string) is 5. When the value is displayed, ie converted to a string representation for the screen, it might be shown as 5, 5.00 or 5.000 but internally, it's still 5 The two decimal places do not appear (if I can put it that way) until the value is output. You can't save a number with 2 decimal places unless you use a string.
0
0
0
0
2010-01-06T21:14:00.000
2
1.2
true
2,016,292
0
0
1
2
If 5 and 5.00 and 5.000 are all different, then why does Django's decimal field save without the .00 even when I have decimal_places=2 ? More importantly, how can I save a value 5.00 as 5.00 in Django without using String.
Python/Django: If 5 and 5.00 are different values (when expressed in Decimal), then
2,016,478
2
0
388
0
python,django,decimal
You have an argument that Django ought to enforce a certain precision on its Python objects, but decimal_places is probably more about maximum precision. I believe precision is not stored in the database, so it will be lost in any case. In any case, if you want to enforce precision, use something like: Decimal(5).quantize(Decimal(10)**-DECIMAL_PLACES) You can overload the to_python method in a custom django.db.models.DecimalField to ensure that a python Decimal object with the correct precision is returned.
0
0
0
0
2010-01-06T21:14:00.000
2
0.197375
false
2,016,292
0
0
1
2
If 5 and 5.00 and 5.000 are all different, then why does Django's decimal field save without the .00 even when I have decimal_places=2 ? More importantly, how can I save a value 5.00 as 5.00 in Django without using String.
Database Design Inquiry
2,017,958
1
1
642
1
python,database-design,google-app-engine,schema
My first cut (I assumed the questions were multiple choice): I'd have a table of Questions, with ID_Question as the PK, the question text, and a category (if you want). I'd have a table of Answers, with ID_Answer as the PK, QuestionID as a FK back to the Questions table, the answer text, and a flag as to whether it's the correct answer or not. I'd have a table of Quizzes, with ID_Quiz as the PK, and a description of the quiz, and a category (if you want). I'd have a table of QuizQuestions, with ID_QuizQuestion as the PK, QuizID as a FK back to the Quizzes table, and QuestionID as a FK back to the Questions table. This model lets you: Use questions standalone or in quizzes Lets you have as many or few questions in a quiz as you want Lets you have as many of few choices for questions as you want (or even multiple correct answers) Use questions in several different quizzes
0
0
0
0
2010-01-07T02:56:00.000
5
0.039979
false
2,017,930
0
0
1
2
I'm making a trivia webapp that will feature both standalone questions, and 5+ question quizzes. I'm looking for suggestions for designing this model. Should a quiz and its questions be stored in separate tables/objects, with a key to tie them together, or am I better off creating the quiz as a standalone entity, with lists stored for each of a question's characteristics? Or perhaps someone has another idea... Thank you in advance. It would probably help to say that I am using Google App Engine, which typically frowns upon relational db models, but I'm willing to go my own route if it makes sense.
Database Design Inquiry
2,017,943
0
1
642
1
python,database-design,google-app-engine,schema
Have a table of questions, a table of quizzes and a mapping table between them. That will give you the most flexibility. This is simple enough that you wouldn't even necessarily need a whole relational database management system. I think people tend to forget that relations are pretty simple mathematical/logical concepts. An RDBMS just handles a lot of the messy book keeping for you.
0
0
0
0
2010-01-07T02:56:00.000
5
0
false
2,017,930
0
0
1
2
I'm making a trivia webapp that will feature both standalone questions, and 5+ question quizzes. I'm looking for suggestions for designing this model. Should a quiz and its questions be stored in separate tables/objects, with a key to tie them together, or am I better off creating the quiz as a standalone entity, with lists stored for each of a question's characteristics? Or perhaps someone has another idea... Thank you in advance. It would probably help to say that I am using Google App Engine, which typically frowns upon relational db models, but I'm willing to go my own route if it makes sense.
How can I configure Apache2/mod_python/Django to abort request processing after N seconds?
2,021,249
0
2
894
0
django,timeout,apache2,mod-python,infinite-loop
Hmmm. I wonder if you can use mod_cgi to run your Python script for development. And then go back to mod_python for deployment. Then you can use the Apache core TimeOut directive to limit how long Apache waits for the mod_cgi response. N.B. Apache 2.2 that is, this extension to the TimeOut directive only came with the 2.2 release. HTH
0
0
0
0
2010-01-07T14:48:00.000
2
0
false
2,021,051
0
0
1
2
I recently spent a long while debugging something that turned out to be an infinite loop bug in my own code. Since I can't guarantee I'll never make that sort of mistake again, how can I configure my web server to terminate any apache2 subprocess that remains waiting for my python app to return a response for over N seconds? In this case, I didn't even notice the bug until the site started feeling slow, at which point one apache2 process had been running inside an infinite loop for hours. If there were a timeout (even a long one, like 10min) that could have caught this and emailed me, I'd have known about the problem sooner, and it wouldn't have impacted site performance for as many users. Googling, I've found some suggestions of similar things in a mod_wsgi configuration, but if there's a way to do this under my current setup I'd prefer that. Thanks!
How can I configure Apache2/mod_python/Django to abort request processing after N seconds?
2,034,804
0
2
894
0
django,timeout,apache2,mod-python,infinite-loop
The short answer is no, there is no builtin ability within mod_python to have timeouts on individual requests.
0
0
0
0
2010-01-07T14:48:00.000
2
1.2
true
2,021,051
0
0
1
2
I recently spent a long while debugging something that turned out to be an infinite loop bug in my own code. Since I can't guarantee I'll never make that sort of mistake again, how can I configure my web server to terminate any apache2 subprocess that remains waiting for my python app to return a response for over N seconds? In this case, I didn't even notice the bug until the site started feeling slow, at which point one apache2 process had been running inside an infinite loop for hours. If there were a timeout (even a long one, like 10min) that could have caught this and emailed me, I'd have known about the problem sooner, and it wouldn't have impacted site performance for as many users. Googling, I've found some suggestions of similar things in a mod_wsgi configuration, but if there's a way to do this under my current setup I'd prefer that. Thanks!
Python based web reporting tool?
2,022,186
2
5
21,339
0
python,reporting
Most reporting tools are stuck in the '80s: a time when you 'painted' a report intended to be printed that completely lacked integration with other reports. Sometimes we still need that. If you need to print an invoice, you're pretty much stuck with that kind of functionality. But in general, most reporting these days consists of multiple queries/charts/graphs/tables per page with drill-down built directly into it. If you've got enough of a need go with an OLAP tool - then you don't even code the reports, your users (theoretically) can. If not, I've seldom seen a scenario in which a "reporting tool" was better than using something like Chart Director with a language like php, perl, python, ruby, etc.
0
0
0
0
2010-01-07T15:15:00.000
6
0.066568
false
2,021,252
0
0
1
1
I have a question for those of you doing web work with python. Is anyone familiar with a python based reporting tool? I am about to start on a pretty big web app and will need the ability to do some end user reporting (invoices, revenue reports, etc). It can be an existing django app or anything python based so I can hook into it. Thanks! Mark
Looking for a payment gateway
2,023,105
2
9
3,656
0
python,payment-gateway,payment
It sounds like you want something like Worldpay or even Google Checkout. But it all depends what your turnover is, because these sorts of providers (who host the payment page themselves), tend to take a percentage of every transaction, rather than a fixed monthly fee that you can get from elsewhere. The other thing to consider is, if you have any way of taking orders over the phone, and the phone operators need to take customers' credit card details, then your whole internal network will need to be PCI compliant, too. If you JUST need it for a website, then that makes it easier. If you have a low turnover, then check out the sites mentioned above. If you have a high turnover, then it may work out more cost effective in the long run to get PCI-DSS certified and still keep control of credit card transactions in-house, giving you more flexibility, and cheaper transaction costs.
0
0
1
0
2010-01-07T17:01:00.000
5
0.07983
false
2,022,067
0
0
1
3
I'm looking for a payment gateway company so we can avoid tiresome PCI-DSS certification and its associated expenses. I'll get this out the way now, I don't want Paypal. It does what I want but it's really not a company I want to trust with any sort of money. It needs to support the following flow: User performs actions on our site, generating an amount that needs to be paid. Our server contacts the gateway asynchronously (no hidden inputs) and tells it about the user, how much they need to pay. The gateway returns a URL and perhaps a tentative transaction ID. Our server stores the transaction ID and redirects the user to the URL provided by the gateway. The user fills out their payment details on the remote server. When they have completed that, the gateway asynchronously contacts our server with the outcome, transaction id, etc and forwards them back to us (at a predestined URL). We can show the user their order is complete/failed/etc. Fin. If at all possible, UK or EU based and developer friendly. We don't need any concept of a shopping basket as we have that all handled in our code already. We have (or at least will have by launch) a proper merchant banking account - so cover services like Paypay aren't needed. If their API covers Python (we're using Django) explicitly, all the better but I think I'm capable enough to decipher any other examples and transcode them into Python myself.
Looking for a payment gateway
2,258,716
4
9
3,656
0
python,payment-gateway,payment
You might want to take a look at Adyen (www.adyen.com). They are European and provide a whole lot of features and a very friendly interface. They don't charge a monthly or set up fee and seem to be reasonably priced per transaction. Their hosted payments page can be completely customised which was an amazing improvement for us.
0
0
1
0
2010-01-07T17:01:00.000
5
1.2
true
2,022,067
0
0
1
3
I'm looking for a payment gateway company so we can avoid tiresome PCI-DSS certification and its associated expenses. I'll get this out the way now, I don't want Paypal. It does what I want but it's really not a company I want to trust with any sort of money. It needs to support the following flow: User performs actions on our site, generating an amount that needs to be paid. Our server contacts the gateway asynchronously (no hidden inputs) and tells it about the user, how much they need to pay. The gateway returns a URL and perhaps a tentative transaction ID. Our server stores the transaction ID and redirects the user to the URL provided by the gateway. The user fills out their payment details on the remote server. When they have completed that, the gateway asynchronously contacts our server with the outcome, transaction id, etc and forwards them back to us (at a predestined URL). We can show the user their order is complete/failed/etc. Fin. If at all possible, UK or EU based and developer friendly. We don't need any concept of a shopping basket as we have that all handled in our code already. We have (or at least will have by launch) a proper merchant banking account - so cover services like Paypay aren't needed. If their API covers Python (we're using Django) explicitly, all the better but I think I'm capable enough to decipher any other examples and transcode them into Python myself.
Looking for a payment gateway
2,023,033
2
9
3,656
0
python,payment-gateway,payment
I just finished something exactly like this using First Data Global Gateway (don't really want to provide a link, can find with Google). There's no Python API because their interface is nothing but http POST. You have the choice of gathering credit card info yourself before posting the form to their server, as long as the connection is SSL and the referring URL is known to them (meaning it's your form but you can't store or process the data first). In the FDGG gateway "terminal interface" you configure your URL endpoints for authorization accepted/failed and it will POST transaction information. I can't say it was fun and their "test" mode was buggy but it works. Sorry, don't know if it's available in UK/EU but it's misnamed if it isn't :)
0
0
1
0
2010-01-07T17:01:00.000
5
0.07983
false
2,022,067
0
0
1
3
I'm looking for a payment gateway company so we can avoid tiresome PCI-DSS certification and its associated expenses. I'll get this out the way now, I don't want Paypal. It does what I want but it's really not a company I want to trust with any sort of money. It needs to support the following flow: User performs actions on our site, generating an amount that needs to be paid. Our server contacts the gateway asynchronously (no hidden inputs) and tells it about the user, how much they need to pay. The gateway returns a URL and perhaps a tentative transaction ID. Our server stores the transaction ID and redirects the user to the URL provided by the gateway. The user fills out their payment details on the remote server. When they have completed that, the gateway asynchronously contacts our server with the outcome, transaction id, etc and forwards them back to us (at a predestined URL). We can show the user their order is complete/failed/etc. Fin. If at all possible, UK or EU based and developer friendly. We don't need any concept of a shopping basket as we have that all handled in our code already. We have (or at least will have by launch) a proper merchant banking account - so cover services like Paypay aren't needed. If their API covers Python (we're using Django) explicitly, all the better but I think I'm capable enough to decipher any other examples and transcode them into Python myself.
Running Different Django Versions But Sharing Authentication
2,022,368
0
0
129
0
python,django,mod-python
A user's login status is stored using sessions. As far as I can tell from comparing trunk to the 0.96 source, the sessions are committed to a cookie the same way, and auth stores the user ID and backend the same way, so as long as the two apps use the same session storage and are on the same domain, it should work. (Just to be safe, I wouldn't use secure cookies in case the backend logic has changed - I didn't check out that part.) However, 0.96 did not feature pluggable session stores like modern Django does. Probably, to get a current version of Django to work with your 0.96 sessions, you would need to write a session backend for the current Django that connects to the 0.96 database and manipulates the sessions there. I'm not sure how well that would work, though.
0
0
0
0
2010-01-07T17:18:00.000
3
0
false
2,022,178
0
0
1
3
Brand new to django. We have a legacy django project using django 0.96x that does authentication, ldap, etc., and it's pretty involved so we don't want to rewrite that code. We want to add a forum solution (off the shelf) but all of the ones I've seen so far require django 1.x I'm trying to figure out how to get this working and I've narrowed it down to the following: Use an old forum solution that works w/django 0.96 (does this exist?) Try to patch a forum solution to make it "backwards compatible" with 0.96 (possible nightmare) Use two different djangos: 0.96 and 1.x and (since we're using Apache w/mod_python) have two different Location directives; adjust PYTHONPATH for each appropriately (or use virtualenv, etc.) But will option #3 even work? I don't know enough about how django.contrib.auth and friends work so if I run two different versions of django will the user stay logged in? I didn't mention trying to patch our 0.96 project to bring it to 1.x but we don't really have the time to do that. Any suggestions?
Running Different Django Versions But Sharing Authentication
2,022,407
1
0
129
0
python,django,mod-python
It's possible, but it may be pretty painful to do option #3. How about Option 4: bite the bullet and upgrade to Django 1.1.1. I did this with a couple of 0.97pre sites and it took less time than I thought it would. The biggest pain was dealing with admin stuff. Instead of going with separate admin.py files, we simply put the Admin classes directly below the Model classes. I use Mercurial for my DVCS and I just cloned, hacked, merged and it worked. It took about 3-5 hours per site and that included some custom template tag munging.
0
0
0
0
2010-01-07T17:18:00.000
3
1.2
true
2,022,178
0
0
1
3
Brand new to django. We have a legacy django project using django 0.96x that does authentication, ldap, etc., and it's pretty involved so we don't want to rewrite that code. We want to add a forum solution (off the shelf) but all of the ones I've seen so far require django 1.x I'm trying to figure out how to get this working and I've narrowed it down to the following: Use an old forum solution that works w/django 0.96 (does this exist?) Try to patch a forum solution to make it "backwards compatible" with 0.96 (possible nightmare) Use two different djangos: 0.96 and 1.x and (since we're using Apache w/mod_python) have two different Location directives; adjust PYTHONPATH for each appropriately (or use virtualenv, etc.) But will option #3 even work? I don't know enough about how django.contrib.auth and friends work so if I run two different versions of django will the user stay logged in? I didn't mention trying to patch our 0.96 project to bring it to 1.x but we don't really have the time to do that. Any suggestions?
Running Different Django Versions But Sharing Authentication
2,029,226
0
0
129
0
python,django,mod-python
It's possible to expose Django 0.96 tables to 1.1 - you can use unmanaged models wrapped around database VIEWs. In other words you issue: CREATE VIEW auth_user AS SELECT * from django096db.auth_user; (and similar cmd for other tables) and then you have Django 1.1 synchronized with 0.96 (assuming 0.96 tables are compatible with 1.1, I haven't checked that).
0
0
0
0
2010-01-07T17:18:00.000
3
0
false
2,022,178
0
0
1
3
Brand new to django. We have a legacy django project using django 0.96x that does authentication, ldap, etc., and it's pretty involved so we don't want to rewrite that code. We want to add a forum solution (off the shelf) but all of the ones I've seen so far require django 1.x I'm trying to figure out how to get this working and I've narrowed it down to the following: Use an old forum solution that works w/django 0.96 (does this exist?) Try to patch a forum solution to make it "backwards compatible" with 0.96 (possible nightmare) Use two different djangos: 0.96 and 1.x and (since we're using Apache w/mod_python) have two different Location directives; adjust PYTHONPATH for each appropriately (or use virtualenv, etc.) But will option #3 even work? I don't know enough about how django.contrib.auth and friends work so if I run two different versions of django will the user stay logged in? I didn't mention trying to patch our 0.96 project to bring it to 1.x but we don't really have the time to do that. Any suggestions?
dumb question alert: use *both* ruby on rails and python possible?
2,023,828
0
0
184
0
python,ruby-on-rails,ruby
If you're parsing data with python, presumably it's going be put into a database. As long as this is the case you can just run two apps standalone. Saying that, using one language and framework is a better solution, especially when you think that you won't be able reuse any code between the two applications if they are written in two different languages. Also I know Ruby has good libraries to do all of what is mentioned in your post, as I'm sure Python also does, so there seems little advantage in using the two together.
0
0
0
0
2010-01-07T20:37:00.000
3
0
false
2,023,458
1
0
1
3
the front end and end-user data-collection we want to build in RoR since it's just some simple forms connected to a database. The integration with other external api's such as twitter and facebook and parsing of the data entered by the users we want to do in python, mostly because the developer for that part knows python. Is that possible?
dumb question alert: use *both* ruby on rails and python possible?
2,023,546
0
0
184
0
python,ruby-on-rails,ruby
Yes, it is possible at some degree using Java. You may use JRuby and Jython in the same app.
0
0
0
0
2010-01-07T20:37:00.000
3
0
false
2,023,458
1
0
1
3
the front end and end-user data-collection we want to build in RoR since it's just some simple forms connected to a database. The integration with other external api's such as twitter and facebook and parsing of the data entered by the users we want to do in python, mostly because the developer for that part knows python. Is that possible?
dumb question alert: use *both* ruby on rails and python possible?
2,023,703
3
0
184
0
python,ruby-on-rails,ruby
It sounds like the only place the two parts will interact is the database: the RoR parts collect data from the user, the python parts collect data from Twitter and elsewhere. As long as your database is supported by both languages, there's no a priori reason why this wouldn't work. Even if you end up needing the two parts to interact more directly, there are plenty of ways of providing an API in one part of the app that the other parts of the app can use regardless of what language they're written in - for instance, it should be easy to have the RoR parts provide a nice RESTful API, and have the python parts interact through that. If you're going to have different parts of the app developed by different teams, they're going to need a strong interface contract in order to make their parts work together anyway; having that contract be in the form of a RESTful API just makes the parts even more modular and gives you more freedom in the future.
0
0
0
0
2010-01-07T20:37:00.000
3
1.2
true
2,023,458
1
0
1
3
the front end and end-user data-collection we want to build in RoR since it's just some simple forms connected to a database. The integration with other external api's such as twitter and facebook and parsing of the data entered by the users we want to do in python, mostly because the developer for that part knows python. Is that possible?
Strategies or support for making parts of a Twisted application reloadable?
2,026,161
1
3
457
0
python,twisted
You could write something similar to paster's reloader, that would work like this: start your main function, and before importing / using any twisted code, fork/spawn a subprocess. In the subprocess, run your twisted application. In the main process, run your code which checks for changed files. If code has changed, reload the subprocess. However, the issue here is that unlike a development webserver, most twisted apps have a lot more state and just flat out killing / restarting the process is a bad idea, you may lose some state. There is a way to do it cleanly: When you spawn the twisted app, use subprocess.Popen() or similar, to get stdin/stdout pipes. Now in your subprocess, use the twisted reactor to listen on stdin (there is code for this in twisted, see twisted.internet.stdio which allows you to have a Protocol which talks to a stdio transport, in the usual twisted non-blocking manner). Finally, when you decide it's time to reload, write something to the stdin of the subprocess telling it to shutdown. Now your twisted code can respond and shut down gracefully. Once it's cleanly quit, your master process can just spawn it again. (Alternately you can use signals to achieve this, but this may not be OS portable)
0
1
0
0
2010-01-08T07:28:00.000
2
0.099668
false
2,026,091
0
0
1
1
I've written a specialized JSON-RPC server and just started working my way up into the application logic and finding it is a tad annoying to constantly having to stop/restart the server to make certain changes. Previously I had a handler that ran in intervals to compare module modified time stamps with the past check then reload the module as needed. Unfortunately I don't trust it to work correctly now. Is there a way for a reactor to stop and restart itself in a manner similar to Paster's Reloadable HTTPServer?
Django - Allow duplicate usernames
17,344,403
0
11
9,747
0
python,django,authentication
I'm facing the exact same problem and I've been reading a lot (about how to solve that problem in 1.5) and I just thought of a much simpler solution. What if you just add a fixed-length prefix with the organization id to store the username? I.e. Organization id = 115, chosen username = "john" and a fixed length of 6. So in the data base you store as username "000115_john". When you do the login you just join the two parameters and try to authenticate with what Django provides. I'm not sure if the fixed length is strictly necessary but could avoid undesirable results if a user chooses a username with only numbers.
0
0
0
0
2010-01-08T15:22:00.000
5
0
false
2,028,515
0
0
1
2
I'm working on a project in django which calls for having separate groups of users in their own username namespace. So for example, I might have multiple "organizations", and username should only have to be unique within that organization. I know I can do this by using another model that contains a username/organization id, but that still leaves this useless (and required) field on the defualt django auth User that I would have to populate with something. I've already written by own auth backend that authenticates a user against LDAP. However, as I mentioned before, I am still stuck with the problem of how to populate / ignore the username field on the default django user. Is there a way to drop the uniqueness constraint for the username for Django auth users?
Django - Allow duplicate usernames
2,029,080
1
11
9,747
0
python,django,authentication
I have not personally been required to find a solution to this, but one way to tackle this (from an SAAS perspective) would be to prefix the username with an organizational identifier (presuming unique organizations). For example: subdomain.yoursite.com would equate to a user with the username: subdomain_username. You would just have to code some business logic on login to a subdomain to tack that onto the username.
0
0
0
0
2010-01-08T15:22:00.000
5
0.039979
false
2,028,515
0
0
1
2
I'm working on a project in django which calls for having separate groups of users in their own username namespace. So for example, I might have multiple "organizations", and username should only have to be unique within that organization. I know I can do this by using another model that contains a username/organization id, but that still leaves this useless (and required) field on the defualt django auth User that I would have to populate with something. I've already written by own auth backend that authenticates a user against LDAP. However, as I mentioned before, I am still stuck with the problem of how to populate / ignore the username field on the default django user. Is there a way to drop the uniqueness constraint for the username for Django auth users?
Datastore Design Inquiry
2,034,622
0
1
151
0
python,database-design,google-app-engine
I'm not that familiar with Google App Engine, but here are some thoughts. First is to consider if "tags" are more appropriate than category & sub categories. Will their be a rigid 2 level category scheme? Will all items have a main and subcategory assignment? Rather than having a class for each category, have you considered a CategoryList class that would have a incrementCategoryByName(str name) method? The class contain a dictionary of classes without having to have the overhead of a class for each category.
0
0
0
0
2010-01-09T19:13:00.000
2
0
false
2,034,584
1
0
1
1
I'm creating a Trivia app, and need some help designing my model relationships. This question may get fairly complicated, but I'll try to be concise. Trivia questions will all be part of a particular category. Categories may be a category within another category. If a trivia question is created/removed, I need to make sure that I also update a counter. In this way, I'll be able to see how many questions are in each category, and display that back to users. If a category has 'child' categories, I will need a way of displaying a cumulative counter of all sub-categories. Accurate tallies are fairly important, but not mission critical. I do not mind using sharded counters. My question is, how should I design this so that it will adopt GAE denormalization, and maintain optimization? I was thinking of having a Category class, with a ListProperty in each, which will represent the ancestor tree. It will contain a key to each parent entity in the tree, in order. But, should I also specify a parent when constructing the entities, or is that not needed in this case? I'm thinking that I may have to run my counter updates in transaction, which is why I am considering a parent-child relationship. Or perhaps there is more optimized way of designing my relationships that will still allow me to keep fairly accurate counters of all questions in each category. Thanks in advance for any help.
GAE and Django: What are the benefits?
2,428,291
1
12
2,741
0
python,django,google-app-engine
I prefer webapp. It scales better according to Google and seems to better integrated with the App Engine infrastructure. Plus it's more lightweight.
0
1
0
0
2010-01-09T19:46:00.000
8
0.024995
false
2,034,684
0
0
1
3
Currently I have a website on the Google App Engine written in Google's webapp framework. What I want to know is what are the benefits of converting my app to run with django? And what are the downsides? Also how did you guys code your GAE apps? Did you use webapp or django? Or did you go an entirely different route and use the Java api? Thanks
GAE and Django: What are the benefits?
2,035,524
2
12
2,741
0
python,django,google-app-engine
GAE is a great tool for new and small projects, that do not require a relational database. I use a range of web hosting solutions. 1) I built www.gaiagps.com on the App Engine, because it was just some brochureware, and a tiny key-value store for the blog part. 2) My colleague also built a web crawler on GAE, because it was just some simple Python scripts that collected web pages. That app actually sends the data over to EC2 though, where more work is done. 3) I host www.trailbehind.com on EC2 because it uses a geo-database (PostGIS) which you would basically have to implement yourself on App Engine. 4) I host TRAC and SVN on WebFaction, because it's off-the-shelf for any slice there. If I need to do a site in a couple of days, I use GAE. If it's a large or existing project, or has a funky database, I use something else.
0
1
0
0
2010-01-09T19:46:00.000
8
0.049958
false
2,034,684
0
0
1
3
Currently I have a website on the Google App Engine written in Google's webapp framework. What I want to know is what are the benefits of converting my app to run with django? And what are the downsides? Also how did you guys code your GAE apps? Did you use webapp or django? Or did you go an entirely different route and use the Java api? Thanks
GAE and Django: What are the benefits?
2,590,020
0
12
2,741
0
python,django,google-app-engine
try kay-framework if you are looking for framework specifically designed for google app engine.
0
1
0
0
2010-01-09T19:46:00.000
8
0
false
2,034,684
0
0
1
3
Currently I have a website on the Google App Engine written in Google's webapp framework. What I want to know is what are the benefits of converting my app to run with django? And what are the downsides? Also how did you guys code your GAE apps? Did you use webapp or django? Or did you go an entirely different route and use the Java api? Thanks
Scripting HTTP more effeciently
2,043,069
0
8
4,483
0
python,ruby,perl,http,scripting
What about using PHP+Curl, or just bash?
0
0
1
1
2010-01-11T16:15:00.000
12
0
false
2,043,058
0
0
1
1
Often times I want to automate http queries. I currently use Java(and commons http client), but would probably prefer a scripting based approach. Something really quick and simple. Where I can set a header, go to a page and not worry about setting up the entire OO lifecycle, setting each header, calling up an html parser... I am looking for a solution in ANY language, preferable scripting
Could not get cookie from another (parent) domain in Django
2,043,172
1
2
2,034
0
javascript,python,django,cookies
The cookie was probably set with 'domain' parameter. Set the cookie to be accessible from all the subdomains of the domain the cookie is being set in. I'm not the python guy, but my knowledge of http protocol shows that this might be the problem.
0
0
0
0
2010-01-11T16:26:00.000
2
0.099668
false
2,043,138
0
0
1
2
I need to remove a cookie that was previously set for parent domain while browsing host at subdomain of the parent. I.e., a cookie "xyz" was set for example.com, and I am trying to remove it on subdomain.example.com, using Django backend. The request.COOKIES given to the view does not contain any cookies except those from subdomain.example.com, so I can't write just response.delete_cookie(...) in order to delete it. It is possible to perform such deletion either in Python or Javascript?
Could not get cookie from another (parent) domain in Django
2,043,336
0
2
2,034
0
javascript,python,django,cookies
You can attempt to call delete_cookie even for a cookie you haven't been able to read. Django will output the relevant Set-Cookie headers to delete the cookie regardless. Naturally the domain and path you pass to delete_cookie must match the cookie you intend to delete. However, if you haven't been able to read the cookie, it is likely there is another problem, which might prevent you deleting it. Are you sure the cookie from the parent domain was set with a domain=parentdomain.tld parameter? If not then it wouldn't be visible or deletable from the subdomain, except in IE due to that browser's bad handling of no-domain-specified cookies.
0
0
0
0
2010-01-11T16:26:00.000
2
0
false
2,043,138
0
0
1
2
I need to remove a cookie that was previously set for parent domain while browsing host at subdomain of the parent. I.e., a cookie "xyz" was set for example.com, and I am trying to remove it on subdomain.example.com, using Django backend. The request.COOKIES given to the view does not contain any cookies except those from subdomain.example.com, so I can't write just response.delete_cookie(...) in order to delete it. It is possible to perform such deletion either in Python or Javascript?
Pass session information from php to python securely? (in agile)
2,045,154
2
2
575
0
php,python,session
In PHP, store the session information in a database, encoded in JSON. In Python, pull the session ID from the cookie and look up the session information in the database.
0
0
0
1
2010-01-11T21:36:00.000
1
1.2
true
2,045,131
0
0
1
1
I have a sign up process that is in a legacy framework and we are trying to switch to a new framework...in fact a different language. So let's say that there are 3 steps in the sign up process and each of those 3 steps has it's own file(step1.php, step2.php, step3.php). Now if I want to change page2.php to a python file I will still need the session information from page1.php. How can I transfer this information between the two pages while maintaining a valid session and obviously security. We want to integrate this language switch in the same repository as the original one and doing releases of the new changes. So that's the agile part. (I'm still not sold that this is the best way to do it but I'm more curious)
geodjango - search by city, state or zip code
7,258,668
0
0
2,044
0
python,django,geodjango
I am going to try something similar soon... I have a small database of about 40 locations, and I want the user to be able to filter these 40 locations by entering any zip code or city name, using a function that will return a list of location that are within a 5, 10, 15, 20, etc radius distance. I am thinking of using geocoding web services to store the lat/lng for each location in the database. Then when the user enters a city name or a zip code, use one web service call to get the latitude/longitude of that, and do a straightforward non-trigonometric distance calculation (driving distance) in a python list comprehension. So in answer to the question, I think that's what it involves but it could explode pretty fast if there is no way to limit the amount of calculations that need to be done.
0
0
0
0
2010-01-12T05:25:00.000
2
0
false
2,046,887
0
0
1
1
How can I use geodjango to search by city and state or zip code in my django application? I am very new to geodjango and just trying to wrap my head around what would be involved in this. Also, does anyone know of an app that already implements this functionality?
AppEngine fetch through a free proxy
2,218,463
0
4
888
0
python,google-app-engine,proxy
I'm currently having the same problem and i was thinking about this solution (not yet tried) : -> develop an app that fetch what you want -> run it locally -> fetch your local server from your initial so the proxy is your computer which you know as not blocked Let me know if it's works !
0
1
0
0
2010-01-12T15:57:00.000
5
0
false
2,050,256
0
0
1
3
My (Python) AppEngine program fetches a web page from another site to scrape data from it -- but it seems like the 3rd party site is blocking requests from Google App Engine! -- I can fetch the page from development mode, but not when deployed. Can I get around this by using a free proxy of some sort? Can I use a free proxy to hide the fact that I am requesting from App Engine? How do I find/choose a proxy? -- what do I need? -- how do I perform the fetch? Is there anything else I need to know or watch out for?
AppEngine fetch through a free proxy
2,050,288
2
4
888
0
python,google-app-engine,proxy
Probably the correct approach is to request permission from the owners of the site you are scraping. Even if you use a proxy, there is still a big chance that requests coming through the proxy will end up blocked as well.
0
1
0
0
2010-01-12T15:57:00.000
5
0.07983
false
2,050,256
0
0
1
3
My (Python) AppEngine program fetches a web page from another site to scrape data from it -- but it seems like the 3rd party site is blocking requests from Google App Engine! -- I can fetch the page from development mode, but not when deployed. Can I get around this by using a free proxy of some sort? Can I use a free proxy to hide the fact that I am requesting from App Engine? How do I find/choose a proxy? -- what do I need? -- how do I perform the fetch? Is there anything else I need to know or watch out for?
AppEngine fetch through a free proxy
3,731,700
0
4
888
0
python,google-app-engine,proxy
Well to be fair, if they don't want you doing that then you probably shouldn't. It's not nice to be mean. But if you really want to do it, the best approach would be creating a simple proxy script and running it on a VPS or some computer with a decent enough connection. Basically you expose a REST API from your server to your GAE, then the server just makes all the same requests it gets to the target site and returns the output.
0
1
0
0
2010-01-12T15:57:00.000
5
0
false
2,050,256
0
0
1
3
My (Python) AppEngine program fetches a web page from another site to scrape data from it -- but it seems like the 3rd party site is blocking requests from Google App Engine! -- I can fetch the page from development mode, but not when deployed. Can I get around this by using a free proxy of some sort? Can I use a free proxy to hide the fact that I am requesting from App Engine? How do I find/choose a proxy? -- what do I need? -- how do I perform the fetch? Is there anything else I need to know or watch out for?
What is the Java Equivalent of Python's property()?
2,056,762
0
10
3,624
0
java,python,properties
Do you want to create new fields/getters/setters in the class? If you want to do this in runtime, you have to create completely new class with your fields and methods, and load it into the JVM. To create new class you can use library like ASM or CGLib, but if you're new to Java, this isn't something you want to start with.
0
0
0
1
2010-01-13T13:03:00.000
6
0
false
2,056,752
1
0
1
2
I'm new to Java, and I'd like to create some class variables that are dynamically calculated when accessed, as you can do in Python by using the property() method. However, I'm not really sure how to describe this, so Googling shows me lots about the Java "Property" class, but this doesn't appear to be the same thing. What is the Java equivalent of Python's property()?
What is the Java Equivalent of Python's property()?
2,056,814
2
10
3,624
0
java,python,properties
They don't really exist. In Java it's common practice to declare members as private or protected and only allow access to them via methods. Often this leads to lots of small getFoo() and setFoo(newFoo) methods. Python doesn't really have private and protected and it's more common to allow direct access to members.
0
0
0
1
2010-01-13T13:03:00.000
6
0.066568
false
2,056,752
1
0
1
2
I'm new to Java, and I'd like to create some class variables that are dynamically calculated when accessed, as you can do in Python by using the property() method. However, I'm not really sure how to describe this, so Googling shows me lots about the Java "Property" class, but this doesn't appear to be the same thing. What is the Java equivalent of Python's property()?
Worst practices in Django you have ever seen
3,299,378
3
23
2,848
0
python,django
My worst mistake was using absolute imports like <project_name>.<app_name>.models rather than <app_name>.models. This way when I made a branch and wanted to check it out in different directory (like having and -stable of my project), it wouldn't run. I managed to revert in one project and use only relative imports in one project, but in another, larger one, we have to stick with it (we have there both absolute and relative). I won't make this mistake again.
0
0
0
0
2010-01-13T16:50:00.000
10
0.059928
false
2,058,532
0
0
1
6
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
2,060,365
5
23
2,848
0
python,django
Monkeying around with pre-save and post-save events. If you can't simply do it in save, you should probably rethink what you're trying to do. After all, it's just a relational database under the hood. If what you're doing gets too complex, you'll have ORM mapping issues. Trying to write uber-generic -- one view does it all -- functionality. View functions are functions for a reason. They can use modules, packages, objects, other functions, etc. They can be short and similar without it being a code smell. If you need to use 10 lines of code to construct the uber-generic-do-it-all object and it would have been a 12-line view function without the uber-generic-do-it-all object, then the uber-object isn't helping. Imposing too much super-sophisticated object class design on the ORM model classes. If it requires abstract base classes or metaclasses, it won't do well in the ORM layer. Failing to make use of tests.py and the test client to create complete unit tests of whatever it's claimed that the application does.
0
0
0
0
2010-01-13T16:50:00.000
10
0.099668
false
2,058,532
0
0
1
6
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
3,496,620
5
23
2,848
0
python,django
Not using raw_id fields for a key to 10000+ objects, then wondering why visiting the Admin brings a server to its knees
0
0
0
0
2010-01-13T16:50:00.000
10
0.099668
false
2,058,532
0
0
1
6
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
2,058,929
9
23
2,848
0
python,django
I think the biggest problem is that people try to code as if this were Java/C: They try to create overly generic applications that need never be changed when future requirements change (which is necessary for Java/C because those apps aren't so easy to change/redesign). What results is a hideously complicated application, which is inflexible and impossible to maintain. It's just not necessary in Django: just write for today's requirements, build reusable apps with defined, specific tasks and make changes when needed. More and more often I find myself trying to write things as simply as possible, avoiding overly complicated designs at all costs.
0
0
0
0
2010-01-13T16:50:00.000
10
1
false
2,058,532
0
0
1
6
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
2,058,590
12
23
2,848
0
python,django
Not splitting stuff up into multiple applications. It's not so much about reusability as it is about having a dozen models, and over 100 views in one app, it's damned unreadable. Plus I like to be able to scan my urls.py file easily to see where a URL points, when I have 100 URLs that gets harder.
0
0
0
0
2010-01-13T16:50:00.000
10
1
false
2,058,532
0
0
1
6
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Worst practices in Django you have ever seen
2,060,303
27
23
2,848
0
python,django
Too much logic in views. I used to write views that would struggle to fit in 40 lines. Now I consider more than 2-3 indentation levels, 10 or so LOC or a handful of inline comments in a view to be code smells. The temptation is to write minimal models, figure out your url routing, then do everything else in the view. In reality, you should be using model methods, managers, template tags, context processors, class-based views with abstract base views... anything to keep the view code simple and readable. Logic around saving forms should go in Form.save(). Logic repeated at the start or end of multiple views should go in decorators. Reused display logic should go in included templates, template tags, and filters. Long views are hard to read, understand, and debug. Learn to use the other tools in you toolkit any you'll save yourself and your team a lot of pain.
0
0
0
0
2010-01-13T16:50:00.000
10
1
false
2,058,532
0
0
1
6
What are the worst mistakes made using Django framework, that you have noticed? Have you seen some real misuses, that maybe should go as warnings to the Django docs?
Practices while releasing the python/ruby/script based web applications on production
2,059,364
3
1
242
0
python,ruby,linux,scripting,release
I would create a branch in SVN for every release of web application and when the release is ready there, I would check it out on the server and set to be run or move it into the place of the old version.
0
1
0
1
2010-01-13T18:52:00.000
4
1.2
true
2,059,337
0
0
1
3
I am purely a windows programmer and spend all my time hacking VC++. Recently I have been heading several web based applications and myself built applications with python (/pylons framework) and doing projects on rails. All the web projects are hosted on ubuntu linux. The RELEASE procedures and check list we followed for building and releasing VC++ windows application are merely no more useful when it comes to script based language. So we don't built any binaries now. I copied asp/php files into IIS folder through ftp server when using open source cms applications. So FTP is the one of the way to host the files to the web server. Now we feel lazy or not so passionate to copy files via ftp instead we use the SVN checkout and we simply do svn update to get the latest copy. Is SVN checkout and svn update are the right methods to update the latest build files into the server? Are there any downside in using svn update? Any better method to release the script/web based scripts into the production server? PS: I have used ssh server at some extension on linux platform.
Practices while releasing the python/ruby/script based web applications on production
4,454,448
0
1
242
0
python,ruby,linux,scripting,release
One downside of doing an svn update: though you can go back in time, to what revision do you go back to? You have to look it up. svn update pseudo-deployments work much cleaner if you use tags - in that case you'd be doing an svn switch to a different tag, not an svn update on the same branch or the trunk. You want to tag your software with the version number something like 1.1.4 , and then have a simple script to zip it up application-1.1.4,zip, and deploy it - then you have automated repeatable releases and rollbacks as well as greater visibility into what is changing between releases.
0
1
0
1
2010-01-13T18:52:00.000
4
0
false
2,059,337
0
0
1
3
I am purely a windows programmer and spend all my time hacking VC++. Recently I have been heading several web based applications and myself built applications with python (/pylons framework) and doing projects on rails. All the web projects are hosted on ubuntu linux. The RELEASE procedures and check list we followed for building and releasing VC++ windows application are merely no more useful when it comes to script based language. So we don't built any binaries now. I copied asp/php files into IIS folder through ftp server when using open source cms applications. So FTP is the one of the way to host the files to the web server. Now we feel lazy or not so passionate to copy files via ftp instead we use the SVN checkout and we simply do svn update to get the latest copy. Is SVN checkout and svn update are the right methods to update the latest build files into the server? Are there any downside in using svn update? Any better method to release the script/web based scripts into the production server? PS: I have used ssh server at some extension on linux platform.
Practices while releasing the python/ruby/script based web applications on production
2,059,406
2
1
242
0
python,ruby,linux,scripting,release
Is SVN checkout and svn update are the right methods to update the latest build files into the server? Very, very good methods. You know what you got. You can go backwards at any time. Are there any downside in using svn update? None. Any better method to release the script/web based scripts into the production server? What we do. We do not run out of the SVN checkout directories. The SVN checkout directory is "raw" source sitting on the server. We use Python's setup.py install to create the application in /opt/app/app-x.y directory tree. Each tagged SVN branch is also a branch in the final installation. Ruby has gems and other installation tools that are probably similar to Python's. Our web site's Apache and mod_wsgi configurations refer to a specific /opt/app/app-x.y version. We can then stage a version, do testing, do things like migrate data from production to the next release, and generally get ready. Then we adjust our Apache and mod_wsgi configuration to use the next version. Previous versions are all in place. And left in place. We'll delete them some day when they confuse us.
0
1
0
1
2010-01-13T18:52:00.000
4
0.099668
false
2,059,337
0
0
1
3
I am purely a windows programmer and spend all my time hacking VC++. Recently I have been heading several web based applications and myself built applications with python (/pylons framework) and doing projects on rails. All the web projects are hosted on ubuntu linux. The RELEASE procedures and check list we followed for building and releasing VC++ windows application are merely no more useful when it comes to script based language. So we don't built any binaries now. I copied asp/php files into IIS folder through ftp server when using open source cms applications. So FTP is the one of the way to host the files to the web server. Now we feel lazy or not so passionate to copy files via ftp instead we use the SVN checkout and we simply do svn update to get the latest copy. Is SVN checkout and svn update are the right methods to update the latest build files into the server? Are there any downside in using svn update? Any better method to release the script/web based scripts into the production server? PS: I have used ssh server at some extension on linux platform.
How important are design patterns in web development?
2,060,509
1
5
1,248
0
python,design-patterns,oop
For web applications, understanding at least at a rudimentary level the patterns described in Patterns of Enterprise Application Architecture has proven valuable to me. Gang of Four patterns are worth knowing, too. But I would argue that you simply don't need encyclopedic knowledge of patterns to get started. A cursory understanding will help you understand where to look when you start to encounter friction between your ideas/business problems and your code. I had a couple of weekend trips that allowed me to plow through these two books in their entirety, but I still find the detailed information in the patterns section more useful as a reference than as background knowledge. Reading just the "Part 1" sections of the GoF or PoEAA will help you far more than learning three or four patterns in depth, because you'll know where to look when you encounter problems they describe. And you can look up the details of most of the patterns they describe online. GoF patterns that I use directly or indirectly, often unconsciously, in web development, include: Observer, Command, Composite, State, Strategy. I usually don't use Singleton except as a client of logging and service locator/dependency injection tools. PoEAA patterns that I use regularly, usually unconsciously, or incidentally as a part of the data access strategy or web framework I'm using, are Active Record, Application Controller, Data Mapper, Domain Model, Gateway, Lazy Load, Layer Supertype, Page Controller, Template View, and Value Object. That's not exhaustive; these are just a few that popped into mind. Most of those are probably more usefully learned by starting with an opinionated web development framework, like Rails, Django, or Castle Monorail, than in the abstract. After all, patterns were identified and extracted from thousands of successful app development experiences, not invented and then glued on because they sounded clever. It's pretty easy to get overly excited by better-than-superficial knowledge gained on one or two patterns and then seeing "only nails" for every problem you see shortly thereafter and trying to hammer an ill-fitting pattern into a solution because you understand how it works. So, learn patterns, yes; get a superficial overview of the motivations of all of the commonly used ones, but don't feel like you have to wait to write serious code until you understand some arbitrary list of them.
0
0
0
0
2010-01-13T21:16:00.000
6
0.033321
false
2,060,341
0
0
1
5
What are the design patterns that I should be completely familiar with? And what is one easy example that each can be used for? I am a web developer (I use Django, and is familiar with separation of logic), but I work at a Desktop-app company. They are always talking about singletons, and I forget...but it leaves me no clue!
How important are design patterns in web development?
2,060,471
1
5
1,248
0
python,design-patterns,oop
Knowing design patterns won't be much use until you know why they are the best strategy for a given problem. Learning design patterns from the very beginning is probably fine, except you've missed all the "wrong" ways to solve that problem, which in turn means you may be missing subtle difference in when to use the given pattern and when to not use it. The only thing worse than people who stick to their old ways and don't bother learning the proper way, is people who learn the proper way and don't bother learning why that way is proper. And they keep applying it to stuff that it shouldn't be applied to, because they just don't know better. So my point is, if you're new at web development, don't be too caught up in the design pattern hype (though it's a good hype). Learn by doing stuff yourself. When you've reached a certain level, read up on design patterns and see where they could have been applied to have made your code better. THAT is how you learn them properly. Not like being forced to run before you can walk.
0
0
0
0
2010-01-13T21:16:00.000
6
0.033321
false
2,060,341
0
0
1
5
What are the design patterns that I should be completely familiar with? And what is one easy example that each can be used for? I am a web developer (I use Django, and is familiar with separation of logic), but I work at a Desktop-app company. They are always talking about singletons, and I forget...but it leaves me no clue!
How important are design patterns in web development?
2,060,411
0
5
1,248
0
python,design-patterns,oop
MVVM is a newer one I have seen used with Silverlight. It's a bit much, but it seems effective.
0
0
0
0
2010-01-13T21:16:00.000
6
0
false
2,060,341
0
0
1
5
What are the design patterns that I should be completely familiar with? And what is one easy example that each can be used for? I am a web developer (I use Django, and is familiar with separation of logic), but I work at a Desktop-app company. They are always talking about singletons, and I forget...but it leaves me no clue!
How important are design patterns in web development?
2,060,409
2
5
1,248
0
python,design-patterns,oop
Honestly, patterns are important but knowing when to use them is just as important. There is never going to be any set answer it is something you need to feel out for yourself. People that fight about it being an absolute where you should always use them or always not use them are incorrect. Design patterns are a tool. I would suggest looking at Amazon.com for a book in whatever language you are writing in that deals specifically with design patterns. I know there is one written for Ruby on Rails that is great though I don't remember the name, there is also one for Java called Head First Design Patterns, and on for C# written by Bob and Micah Martin that is excellent. Read whichever one of those that applies to the language you are most familiar with. Even if you don't use all of the patterns it is good to understand how they work and when they will be useful to use.
0
0
0
0
2010-01-13T21:16:00.000
6
0.066568
false
2,060,341
0
0
1
5
What are the design patterns that I should be completely familiar with? And what is one easy example that each can be used for? I am a web developer (I use Django, and is familiar with separation of logic), but I work at a Desktop-app company. They are always talking about singletons, and I forget...but it leaves me no clue!
How important are design patterns in web development?
2,060,384
10
5
1,248
0
python,design-patterns,oop
Forget Singleton. It's confusing and rarely necessary. Learn State, Strategy and Command. They're used all the time. State is for anything that has logic that depends on the state of the object. In short, every if-statement might possibly be better done via State. Seriously. Too many if-statements are a code smell and indicate that there's stateful processing that's sprawled all over the place. Strategy is for any "plug-in" or "expansion" or "option" processing. Command is for any extensible (and composable) set of actions. Backup, Restore. Table Drop, Create, Index, Populate. Validate, Load, Summarize, Report. Any of those command-like things that can be put together in different ways, different orders, etc., should probably be done with a formal Command design.
0
0
0
0
2010-01-13T21:16:00.000
6
1.2
true
2,060,341
0
0
1
5
What are the design patterns that I should be completely familiar with? And what is one easy example that each can be used for? I am a web developer (I use Django, and is familiar with separation of logic), but I work at a Desktop-app company. They are always talking about singletons, and I forget...but it leaves me no clue!
Facebook connect on Google App Engine with Django Patch
2,681,563
0
0
322
0
python,django,google-app-engine,facebook
Honza: we where looking for something that also does authentication Django style. We ended up doing the login on the client side than sending an AJAX request to Django and wrote our own authenticate/login logic. Once we get the user's credentials, we use PyFacebook for FB connectivity.
0
0
0
0
2010-01-14T14:19:00.000
1
0
false
2,064,673
0
0
1
1
We are building a website on Google App Engine, using django patch. We would like to use Facebook connect for two purposes: Authenticate users. Access user's social data. Searching for a solution in the usual places (google, FB, SO) brigs up a lot of noise, many partial solutions and no clear answer. So the question is this: does anyone has a clear working solution? maybe even a recipe? Thanks.
Does Django logs usernames internally
2,067,231
2
1
66
0
python,django,logging
Yes, the last_login column of the user's record in table auth_user is updated with the date/time of the successful login.
0
0
0
0
2010-01-14T20:00:00.000
1
1.2
true
2,067,185
0
0
1
1
All.. I have a Django site and to access it all the users have to go through the login page. My question is when a user is given a access through the login page to enter the site.Does Django logs the username in any of the Django internal tables.... Thanks.......
Django: Chicken or Egg question
2,078,384
1
3
297
0
python,django,design-patterns,application-design
it is design decision. it depends to your design and programming interests. i used the combination of three methods you said. if i need to some informations that can be build from other fields then i will create an internal function in model class. if i need other records of database to do something i will create an function outside of model class. and other unusual needs will be computed everywhere i need them.
0
0
0
0
2010-01-16T08:19:00.000
1
1.2
true
2,076,678
0
0
1
1
I am building an application that will send an API call and save the resulting information after processing the information in a APIRecord(models.Model) class. 1) Should I build a separate class in such a way that the class does the API call, processes the information (including checking against business rules) and then creates an instance of my APIRecord() class? Or 2) Should I build a separate class with the appropriate methods for processing, and calling the API, and then in my model, override the APIRecord.save() method to call the separate class's API methods and then save the results? Or 3) Should I build my model class with the appropriate methods for calling the API and processing the response (including checking for certain values and other business rules)? I tried # 2 and ran into problems with flexibility (but am still open to suggestion). I'm leaning towards # 1, but I'm not sure of all the negatives yet?
What happen when I add a Django app to INSTALLED_APPS?
2,080,483
4
3
2,706
0
python,django
Nothing particular happens when you add an app to INSTALLED_APPS, but the main thing that affects you is that its views are checked when you call reverse(). The way reverse works is to import all the views in the project, and see which ones match the URL name you have given. However, it is quite fragile, and if any of the views cause an error for some reason, or can't be imported, the reverse call will fail. The fact that it is only failing once you include app2 indicates that there is an issue with the views in app2 somewhere. Try importing them individually from the shell and see what errors you get. Edited after update Thanks for the extra detail. I have seen this before in my own code. It is probably because the admin files are being imported before the urlconf is processed, so this reverse gives an error. Try moving the admin.autodiscover() line down to the very bottom of urls.py, so that it is the last line in that file.
0
0
0
0
2010-01-17T03:56:00.000
2
1.2
true
2,079,898
0
0
1
1
Here is the situation. I have a django project with two installed apps. Both apps appear to function properly if they are installed independently of each other. However if I list both apps in the settings.INSTALLED_APPS the reverse() function seems to break for urls in the first app. So this leads me to believe that a bug in the second app is causing the problem. If I simply remove app_2 from the settings.INSTALLED_APPS, app_1's url reverse() begins working again. So the question becomes what "Magic" is happening when I add app_2 to the settings.INSTALLED_APPS? Where should I be looking in app_2 for code causing this problem? UPDATE: I have narrowed down the problem a little, but it just gets stranger. app_2 has an admin.py file that defines a few custom admin views. In that file is a line that calls reverse: reverse('init_script_view', args=['id_content']) As long as that line is in the admin.py file all calls to reverse() fail with a NoReverseMatch exception. If I remove that line, everything seems to work fine.
Web scraping with Python
8,603,040
63
188
208,635
0
python,web-scraping,screen-scraping
I'd really recommend Scrapy. Quote from a deleted answer: Scrapy crawling is fastest than mechanize because uses asynchronous operations (on top of Twisted). Scrapy has better and fastest support for parsing (x)html on top of libxml2. Scrapy is a mature framework with full unicode, handles redirections, gzipped responses, odd encodings, integrated http cache, etc. Once you are into Scrapy, you can write a spider in less than 5 minutes that download images, creates thumbnails and export the extracted data directly to csv or json.
0
0
1
0
2010-01-17T16:06:00.000
10
1
false
2,081,586
0
0
1
1
I'd like to grab daily sunrise/sunset times from a web site. Is it possible to scrape web content with Python? what are the modules used? Is there any tutorial available?
populating data from xml file to a sqlite database using python
2,085,657
1
7
15,042
1
python,xml,database,sqlite,parsing
If you are accustomed to DOM (tree) access to xml from other language, you may find useful these standard library modules (and their respective docs): xml.dom xml.dom.minidom To save tha data to DB, you can use standard module sqlite3 or look for binding to mysql. Or you may wish to use something more abstract, like SQLAlchemy or Django's ORM.
0
0
0
0
2010-01-18T10:55:00.000
4
0.049958
false
2,085,430
0
0
1
1
I have a question related to some guidances to solve a problem. I have with me an xml file, I have to populate it into a database system (whatever, it might be sqlite, mysql) using scripting language: Python. Does anyone have any idea on how to proceed? Which technologies I need to read further? Which environments I have to install? Any tutorials on the same topic? I already tried to parse xml using both by tree-based and sax method in other language, but to start with Python, I don't know where to start. I already know how to design the database I need. Another question, is Python alone possible of executing database ddl queries?
Django Admin site TemplateSyntaxError at /admin/: name not defined
2,094,101
0
0
4,323
0
python,django,admin
It turns out it was a rather simple thing, I am just not experienced enough with Python and I was calling on my .NET experience. Bad mistake. I called project.settings.SETTING where I should have imported project.settings and then accessed settings.SETTING. In .NET the imports act just shortcuts so you don't have to type the whole 'path' to the function or setting, whereas in Python it seems that you must have the things you are using imported. I don't know if that makes any sense, or if it even correct, but it now works. Thanks for everyone's help, you are always a great help and I wouldn't be able to do this development and advance my knowledge without the resources here.
0
0
0
0
2010-01-18T12:36:00.000
2
1.2
true
2,086,016
0
0
1
2
I have an issue where, when I log in to the Django admin site, I get a template syntax error in /Library/Python/2.6/site-packages/django/template/debug.py in render_node, line 81. I can't find out how to solve this as it is part of Django, I didn't write the code and I have no idea how it works. This did work fine up until a few days ago when I last tried it. The error is: Caught an exception while rendering: name 'pest' is not defined Where pest is the name of my project. As far as I know, I have all the apps in my project installed correctly. Thanks in advance!
Django Admin site TemplateSyntaxError at /admin/: name not defined
2,086,034
1
0
4,323
0
python,django,admin
It seems like an error in the admin.py file for your app. It may be a missing import, or even a typo, but it's hard to tell without any code. It would be great if you could post your admin.py file so we can take a look. TemplateSyntaxErrors in Django are terrible, they almost never tell you what the real problem is. In this case, for example, the template is part of Django, but the error is probably something in your admin file, which Django reads to create the admin interface. The traceback is too deep to find out right away where in your code the problem is.
0
0
0
0
2010-01-18T12:36:00.000
2
0.099668
false
2,086,016
0
0
1
2
I have an issue where, when I log in to the Django admin site, I get a template syntax error in /Library/Python/2.6/site-packages/django/template/debug.py in render_node, line 81. I can't find out how to solve this as it is part of Django, I didn't write the code and I have no idea how it works. This did work fine up until a few days ago when I last tried it. The error is: Caught an exception while rendering: name 'pest' is not defined Where pest is the name of my project. As far as I know, I have all the apps in my project installed correctly. Thanks in advance!
How to send a string from a python script at Google App Engine to the browser client as a file
2,089,653
0
1
180
0
python,html,google-app-engine,mime-types
Setting a content-disposition: attachment header will cause most browsers to download whatever you send them as a file. Safari sometimes ignores it.
0
1
0
0
2010-01-18T22:18:00.000
2
0
false
2,089,635
0
0
1
1
I have a python web-application running inside the Google App Engine. The application creates on user-demand a string and I want the string to be send to the browser client (application/octet-stream?) as a file. How can i realize this?
Streaming Ironpython output to my editor
2,090,745
6
4
4,586
0
ironpython
You can provide a custom Stream or TextWriter which will be used for all output. You can provide those by using one of the ScriptRuntime.IO.SetOutput overloads. Your implementation of Stream or TextWriter should receive the strings and then output them to your editor window (potentially marshalling back onto the UI thread if you're running the script on a 2ndary execution thread).
1
0
0
1
2010-01-18T23:31:00.000
3
1
false
2,089,998
0
0
1
1
We embed ironpython in our app sob that scripts can be executed in the context of our application. I use Python.CreateEngine() and ScriptScope.Execute() to execute python scripts. We have out own editor(written in C#) that can load ironpython scripts and run it. There are 2 problems I need to solve. If I have a print statement in ironpython script, how can i show it my editor(how will I tell python engine to redirect output to some handler in my C# code) I plan to use unittest.py for running unittest. When I run the following runner = unittest.TextTestRunner() runner.run(testsuite) the output is redirected to standard output but need a way for it to be redirected to my C# editor output window so that user can see the results. This question might be related to 1 Any help is appreciated G
Run a C++ Program from Django Framework
2,091,309
1
4
4,911
0
c++,python,django
You can use swig to create a C++ module that can be imported in python. An alternative is boost::python (but personnaly, I prefer swig).
0
0
0
0
2010-01-19T05:27:00.000
4
0.049958
false
2,091,294
0
0
1
1
I need to run a C++ Program from Django Framework. In a sense, I get inputs from UI in views.py . Once I have these inputs, I need to process the input using my C++ program and use those results. Is it possible ?
Chat application using django
2,094,368
1
10
12,068
0
python,django,performance,chat,private-messaging
I think for a chat application you can use other technologies, such as AMQP(RabbitMQ, etc), Comet, etc. But, for develop user profile, PMs, and other you can use Django. Do not forget that performance still depends on server configuration (web server software, cache, db)
0
0
0
0
2010-01-19T13:37:00.000
6
0.033321
false
2,093,822
0
0
1
1
If i devlop a chat application using django will it have some performance problem? Can i do server push in django? I want to have PM and room discussions as well.
A few questions regarding Pythons 'import' feature
2,097,024
-1
2
217
0
python,import
Might not be relevant, but have you considered using imdbpy? Last time I used it it worked pretty well...
0
0
1
0
2010-01-19T17:28:00.000
6
-0.033321
false
2,095,505
1
0
1
1
I just downloaded Beautiful Soup and I've decided I'll make a small library (is that what they call them in Python?) that will return results of a movie given and IMDB movie search. My question is, how exactly does this import thing work? For example, I downloaded BeautifulSoup and all it is, is a .py file. Does that file have to be in the same folder as the my python application (my project that will use the library)?
Pylons and multiple forms per page
2,500,262
0
1
255
0
python,html,forms,pylons
Yes (to iterate Tom's answer), HTML is designed to explicitly only allow a single form to be submitted at a time. Plus, forms may not be nested, so no confusion possible there. However, a single form may contain multiple submit buttons. So, you may if you really want to organize your page as one big single form, and so submitting will submit all the values each time. You will need to take care then that there are all field names are distinct -- so, not convenient if you have a repetition of "item" forms, in which case it should be a lot cleaner to have a form per item...
0
0
0
0
2010-01-19T22:12:00.000
2
0
false
2,097,556
0
0
1
2
I've got a web page I'm generating with Pylons and the evoque templating tool. I'm trying to generate a page with multiple forms per page (one form is part of a base template that becomes part of every page). I'm having a problem as I seemingly can only get the form element values for one form; whenever I try to get the value from the base template, I get nothing back. Is there a way in Pylons to get a form element from a form by name? I'm using the request.params("variable_name") style that is standard in Pylons. Thanks in advance for your help! Doug
Pylons and multiple forms per page
2,104,760
1
1
255
0
python,html,forms,pylons
You will only get the form values for the form that was posted in the request(ie: whichever submit button the user clicked), that's how html works.
0
0
0
0
2010-01-19T22:12:00.000
2
0.099668
false
2,097,556
0
0
1
2
I've got a web page I'm generating with Pylons and the evoque templating tool. I'm trying to generate a page with multiple forms per page (one form is part of a base template that becomes part of every page). I'm having a problem as I seemingly can only get the form element values for one form; whenever I try to get the value from the base template, I get nothing back. Is there a way in Pylons to get a form element from a form by name? I'm using the request.params("variable_name") style that is standard in Pylons. Thanks in advance for your help! Doug
using django and twisted together
2,101,355
0
5
15,742
0
python,django,chat,twisted,forums
If forum application needs to get something from chat application, it's simplier to make forum application communicate with chat application with plain HTTP requests and to make them run separately.
0
0
0
0
2010-01-20T05:12:00.000
3
0
false
2,099,189
0
0
1
1
1)I want to devlop a website that has forums and chat.The chat and forums are linked in some way.Meaning for each thread the users can chat in the chat room for that thread or can post a reply to the forum. I was thinking of using django for forums and twisted for chat thing.Can i combine the two? The chat application devloped using twisted is linked to the forum. 2)If i use twisted and django what kind of web host shold i use while putting by website on web ?Shold i use a VPS? Or can i get a host that supports both?
Django primary key
2,102,333
7
1
9,900
0
python,django
Calling People.objects.all(pk=code) (calling all) will result in the pk=code being ignored and a QuerySet for all People returned. Calling People.objects.get(pk=code) (calling get) will result in the People object with pk=code returned, or an error if not found.
0
0
0
0
2010-01-20T14:06:00.000
2
1
false
2,101,838
0
0
1
1
When querying in django say People.objects.all(pk=code), what does pk=code mean?
Load and Reuse Django Template Filters
2,104,791
3
0
250
0
python,django,templatetags
Template tags are just Python functions; you can import their module and call them with impunity, the only requirement being that you pass them appropriate arguments. The django.contrib.humanize.templatetags.humanize module has separate functions to do the work, so it's even easier in that specific case.
0
0
0
0
2010-01-20T20:38:00.000
1
1.2
true
2,104,767
0
0
1
1
Is it possible to load a django template tag/filter to use as a function in one of my template tags? I'm trying to load up some of the django.contrib.humanize filters so I can apply them to the results of some of my custom template tags. I can't seem to import them at all, and I don't want to have to rewrite any of that code.
CherryPy changes my response code
2,106,456
1
3
1,737
0
python,apache,mod-wsgi,cherrypy
The HTTP 500 error is used for internal server errors. Something in the server or your application is likely throwing an exception, so no matter what you set the response code to be before this, CherryPy will send a 500 back. You can look into whatever tools CherryPy includes for debugging or logging (I'm not familiar with them). You can also set breakpoints into your code and continue stepping into the CherryPy internals until it hits the error case.
0
0
1
0
2010-01-21T01:46:00.000
1
0.197375
false
2,106,377
0
0
1
1
In my python application using mod_wsgi and cherrypy ontop of Apache my response code get changed to a 500 from a 403. I am explicitly setting this to 403. i.e. cherrypy.response.status = 403 I do not understand where and why the response code that the client receives is 500. Does anyone have any experience with this problem>
Limit a single record in model for django app?
2,106,836
11
7
9,457
0
python,python-3.x,django,django-models,django-admin
An easy way is to use the setting's name as the primary key in the settings table. There can't be more than one record with the same primary key, so that will allow both Django and the database to guarantee integrity.
0
0
0
0
2010-01-21T03:58:00.000
7
1.2
true
2,106,823
0
0
1
1
I want use a model to save the system setting for a django app, So I want to limit the model can only have one record, how to do the limit?
python virtual environment on source control
2,108,129
0
1
789
0
python,linux,installation,virtualenv
You can but you don't really need 'version' control for that. You need to setup your environment. It's a one time job to setup your environment. After that you'll just use it. Why version control it?
0
0
0
0
2010-01-21T09:30:00.000
3
0
false
2,108,105
1
0
1
2
I have created a python web virtual environment contains all django, pylons related packages. I use the host ubuntu desktop PC at home and I have ubuntu virtual machine running on windows PC laptop. Both the operating systems are linux only. I will be using the same environment for production that will be ubuntu server. Is it possible to store the my python virtual environment to the version control and use the same files for ubuntu desktop, laptop ubuntu desktop VM and ubuntu server in production?
python virtual environment on source control
2,108,226
2
1
789
0
python,linux,installation,virtualenv
You might want to look into virtualenv. This will allow you to set up your working environment, 'freeze' the list of packages that are needed to replicate it, and store that list of requirements in version control so that others can check it out and rebuild the environment with a single step.
0
0
0
0
2010-01-21T09:30:00.000
3
1.2
true
2,108,105
1
0
1
2
I have created a python web virtual environment contains all django, pylons related packages. I use the host ubuntu desktop PC at home and I have ubuntu virtual machine running on windows PC laptop. Both the operating systems are linux only. I will be using the same environment for production that will be ubuntu server. Is it possible to store the my python virtual environment to the version control and use the same files for ubuntu desktop, laptop ubuntu desktop VM and ubuntu server in production?
Running Python & Django on IIS
3,100,230
5
6
5,212
0
asp.net,python,asp.net-mvc,apache,iis
We've been running django on IIS for a couple of years using PyISAPIe. It's a fairly big site, about 150,000 users. We're moving to linux/apache though, partly cos PyISAPIe isn't great. Case in point - WebKit browsers don't work well with it, it seems to mess up the chunking. That's tolerable for us as we are allowed to limit our users to FF/IE7+, but annoys me on a mac as I much prefer Safari to FF.
0
0
0
0
2010-01-21T20:15:00.000
2
0.462117
false
2,112,525
1
0
1
1
Is it possible to run Python & Django on IIS? I am going to be a Lead Developer in some web design company and right now they are using classic ASP and ASP.NET. As far as I can see ASP.NET MVC is not mature. Should I recommend Python & Django stack? If it's not possible to run Python on IIS what do you think I should do? Stick with ASP.NET which I don't know? I don't know python well as well but I'm more comfortable with it. Can I run IIS and Apache in parallel?
How can I keep on-the-fly application-level statistics in an application running under Apache?
2,113,376
1
3
333
0
python,multithreading,apache,pylons,fork
Perhaps you could keep the relevant counters and other statistics in a memcached, that is accessed by all apache processes?
0
1
0
0
2010-01-21T22:11:00.000
3
1.2
true
2,113,352
0
0
1
1
I have an application running under apache that I want to keep "in the moment" statistics on. I want to have the application tell me things like: requests per second, broken down by types of request latency to make requests to various backend services via thrift (broken down by service and server) number of errors being served per second etc. I want to do this without any external dependencies. However, I'm running into issues sharing statistics between apache processes. Obviously, I can't just use global memory. What is a good pattern for this sort of issue? The application is written in python using pylons, though I suspect this is more of a "communication across processes" design question than something that's python specific.
iPhone app with Google App Engine
2,124,718
2
2
1,021
1
iphone,python,google-app-engine,gql
True, Google App Engine is a very cool product, but the datastore is a different beast than a regular mySQL database. That's not to say that what you need can't be done with the GAE datastore; however it may take some reworking on your end. The most prominent different that you notice right off the start is that GAE uses an object-relational mapping for its data storage scheme. Essentially object graphs are persisted in the database, maintaining there attributes and relationships to other objects. In many cases ORM (object relational mappings) map fairly well on top of a relational database (this is how Hibernate works). The mapping is not perfect though and you will find that you need to make alterations to persist your data. Also, GAE has some unique contraints that complicate things a bit. One contraint that bothers me a lot is not being able to query for attribute paths: e.g. "select ... where dog.owner.name = 'bob' ". It is these rules that force you to read and understand how GAE data store works before you jump in. I think GAE could work well in your situation. It just may take some time to understand ORM persistence in general, and GAE datastore in specifics.
0
1
0
0
2010-01-23T20:55:00.000
4
1.2
true
2,124,688
0
0
1
3
I've prototyped an iPhone app that uses (internally) SQLite as its data base. The intent was to ultimately have it communicate with a server via PHP, which would use MySQL as the back-end database. I just discovered Google App Engine, however, but know very little about it. I think it'd be nice to use the Python interface to write to the data store - but I know very little about GQL's capability. I've basically written all the working database code using MySQL, testing internally on the iPhone with SQLite. Will GQL offer the same functionality that SQL can? I read on the site that it doesn't support join queries. Also is it truly relational? Basically I guess my question is can an app that typically uses SQL backend work just as well with Google's App Engine, with GQL? I hope that's clear... any guidance is great.
iPhone app with Google App Engine
2,124,705
1
2
1,021
1
iphone,python,google-app-engine,gql
That's a pretty generic question :) Short answer: yes. It's going to involve some rethinking of your data model, but yes, changes are you can support it with the GAE Datastore API. When you create your Python models (think of these as tables), you can certainly define references to other models (so now we have a foreign key). When you select this model, you'll get back the referencing models (pretty much like a join). It'll most likely work, but it's not a drop in replacement for a mySQL server.
0
1
0
0
2010-01-23T20:55:00.000
4
0.049958
false
2,124,688
0
0
1
3
I've prototyped an iPhone app that uses (internally) SQLite as its data base. The intent was to ultimately have it communicate with a server via PHP, which would use MySQL as the back-end database. I just discovered Google App Engine, however, but know very little about it. I think it'd be nice to use the Python interface to write to the data store - but I know very little about GQL's capability. I've basically written all the working database code using MySQL, testing internally on the iPhone with SQLite. Will GQL offer the same functionality that SQL can? I read on the site that it doesn't support join queries. Also is it truly relational? Basically I guess my question is can an app that typically uses SQL backend work just as well with Google's App Engine, with GQL? I hope that's clear... any guidance is great.
iPhone app with Google App Engine
2,125,297
2
2
1,021
1
iphone,python,google-app-engine,gql
GQL offers almost no functionality at all; it's only used for SELECT queries, and it only exists to make writing SELECT queries easier for SQL programmers. Behind the scenes, it converts your queries to db.Query objects. The App Engine datastore isn't a relational database at all. You can do some stuff that looks relational, but my advice for anyone coming from an SQL background is to avoid GQL at all costs to avoid the trap of thinking the datastore is anything at all like an RDBMS, and to forget everything you know about database design. Specifically, if you're normalizing anything, you'll soon wish you hadn't.
0
1
0
0
2010-01-23T20:55:00.000
4
0.099668
false
2,124,688
0
0
1
3
I've prototyped an iPhone app that uses (internally) SQLite as its data base. The intent was to ultimately have it communicate with a server via PHP, which would use MySQL as the back-end database. I just discovered Google App Engine, however, but know very little about it. I think it'd be nice to use the Python interface to write to the data store - but I know very little about GQL's capability. I've basically written all the working database code using MySQL, testing internally on the iPhone with SQLite. Will GQL offer the same functionality that SQL can? I read on the site that it doesn't support join queries. Also is it truly relational? Basically I guess my question is can an app that typically uses SQL backend work just as well with Google's App Engine, with GQL? I hope that's clear... any guidance is great.
Network IPC With Authentication (in Python)
2,125,162
1
1
324
0
python,json,networking,ipc
Use a client side certificate for the connection. This is a good monetization technique to get more income for your client side app.
0
0
1
0
2010-01-23T23:18:00.000
1
0.197375
false
2,125,149
0
0
1
1
I am looking for a way to connect a frontend server (running Django) with a backend server. I want to avoid inventing my own protocol on top of a socket, so my plan was to use SimpleHTTPServer + JSON or XML. However, we also require some security (authentication + encryption) for the connection, which isn't quite as simple to implement. Any ideas for alternatives? What mechanisms would you use? I definitely want to avoid CORBA (we have used it before, and it's way too complex for what we need).
How limiting are web frameworks
2,126,329
1
7
653
0
python,ruby-on-rails,django,rest
You have written down no requirements, you have written down technology decisions. That's something totally different. What do you want to achieve? Then we might be able to help you with how to achieve them.
0
0
0
0
2010-01-24T03:53:00.000
11
0.01818
false
2,125,865
0
0
1
7
This is a general question about how limiting are web development frameworks such as Django and ruby-on-rails. I am planning on building a RESTful web service which will have a purely JSON/XML interface, no GUI. The service will rely on a database however for a few of the more important operations there is no clear way of persisting a "model" object directly into a database table. In addition I require full control over when and how the data is being written to the database. I will need to maintain multiple database connections in order to use some connections only for reads and others only for writes. I've looked at the "full" MVC frameworks such as Django and more basic ones such web.py and pylons. The impression I currently have is that if I go with the full framework initially things will go faster but eventually I will get stuck because I will be limited by the framework in what I can do. If I go with a more basic framework it will take much longer to get everything running but I will be free to do what I need. This is what it seems like but I suspect that it might be an incorrect impression given how many sites are written in Django and Rails. Could you please provide your opinion. Am I totally wrong and there is a way to easily do anything with a framework like Django or Rails or given my requirements I should go with something like web.py? Thank you!
How limiting are web frameworks
2,125,958
0
7
653
0
python,ruby-on-rails,django,rest
You'll be much more limited by the abilities of yourself versus a diverse community of developers working on a large project to share all those common parts.
0
0
0
0
2010-01-24T03:53:00.000
11
0
false
2,125,865
0
0
1
7
This is a general question about how limiting are web development frameworks such as Django and ruby-on-rails. I am planning on building a RESTful web service which will have a purely JSON/XML interface, no GUI. The service will rely on a database however for a few of the more important operations there is no clear way of persisting a "model" object directly into a database table. In addition I require full control over when and how the data is being written to the database. I will need to maintain multiple database connections in order to use some connections only for reads and others only for writes. I've looked at the "full" MVC frameworks such as Django and more basic ones such web.py and pylons. The impression I currently have is that if I go with the full framework initially things will go faster but eventually I will get stuck because I will be limited by the framework in what I can do. If I go with a more basic framework it will take much longer to get everything running but I will be free to do what I need. This is what it seems like but I suspect that it might be an incorrect impression given how many sites are written in Django and Rails. Could you please provide your opinion. Am I totally wrong and there is a way to easily do anything with a framework like Django or Rails or given my requirements I should go with something like web.py? Thank you!
How limiting are web frameworks
2,125,973
1
7
653
0
python,ruby-on-rails,django,rest
Rails is as helpful or not as you need it to be, overall. If you need to load a collection with straight SQL, it's straightforward. If in the same line you want to use all the built-in ActiveRecord Fu, you can. RESTful routing is extremely simple, but again if the particular Rails flavor of REST doesn't meet your needs, the routing is completely configurable. In a Rails app you can use as much or as little of the defaults as you need to, and reconfiguration is available at all levels.
0
0
0
0
2010-01-24T03:53:00.000
11
0.01818
false
2,125,865
0
0
1
7
This is a general question about how limiting are web development frameworks such as Django and ruby-on-rails. I am planning on building a RESTful web service which will have a purely JSON/XML interface, no GUI. The service will rely on a database however for a few of the more important operations there is no clear way of persisting a "model" object directly into a database table. In addition I require full control over when and how the data is being written to the database. I will need to maintain multiple database connections in order to use some connections only for reads and others only for writes. I've looked at the "full" MVC frameworks such as Django and more basic ones such web.py and pylons. The impression I currently have is that if I go with the full framework initially things will go faster but eventually I will get stuck because I will be limited by the framework in what I can do. If I go with a more basic framework it will take much longer to get everything running but I will be free to do what I need. This is what it seems like but I suspect that it might be an incorrect impression given how many sites are written in Django and Rails. Could you please provide your opinion. Am I totally wrong and there is a way to easily do anything with a framework like Django or Rails or given my requirements I should go with something like web.py? Thank you!