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 e... | 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 c... |
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 c... |
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'... |
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 c... |
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... | 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 t... |
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... | 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 t... |
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 t... |
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 ... | 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 t... |
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 regu... | 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 u... |
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/bytestr... | 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 u... |
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'... | 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 u... |
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... | 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 u... |
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 recogniz... | 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... |
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... |
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 "wrap... | 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 ... |
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 fea... | 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 ... |
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 hav... | 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 ... |
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 wi... |
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 wi... |
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 ... | 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).quant... | 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 ... | 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... |
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 concep... | 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... |
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... | 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 se... |
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 se... |
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 day... | 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 ... |
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 ... | 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 actio... |
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 improvemen... | 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 actio... |
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... | 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 actio... |
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. (Ju... | 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 ... |
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 p... | 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 ... |
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 compati... | 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 ... |
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... | 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 pyth... |
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 pyth... |
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 pa... | 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 pyth... |
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, r... | 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 t... |
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. ... | 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/organizat... |
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... | 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/organizat... |
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 c... | 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 ma... |
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 an... |
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 ... | 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 an... |
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 an... |
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 pars... |
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 f... |
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 coo... | 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 f... |
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 fil... |
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 ... | 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 ... |
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 ... |
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 ... | 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 ... |
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 w... | 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()? | 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. ... |
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 ... | 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 ... | 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 applicati... | 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. ... | 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... |
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 ... | 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... |
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 ser... | 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... |
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... | 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 n... |
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 giv... | 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 n... |
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 n... |
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 t... | 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 n... |
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... | 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 n... |
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... |
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 fu... | 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 the... |
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... | 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... |
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 respo... | 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... | 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 h... |
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 ... | 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 u... |
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... | 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 u... |
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 t... | 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 ... |
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 f... |
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 s... | 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 th... |
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 th... |
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... |
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 th... |
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... | 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 th... |
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... |
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... |
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 ... | 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 d... |
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 be... |
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 ... | 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 in... |
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 forei... | 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 in... |
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 rel... | 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 in... |
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 si... |
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... |
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... |
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... | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.