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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Using IronPython to learn the .NET framework, is this bad? | 1,504,904 | 5 | 4 | 477 | 0 | c#,.net,ironpython | You can definitely do that to learn the class library, but I'm not sure if it's such a good idea when it comes to fundamental CLR concepts (e.g. delegates and events). You'll need to pay attention and distinguish what is strictly an IronPython feature, and what is CLR feature exposed in IronPython in a way that matches... | 0 | 0 | 0 | 1 | 2009-10-01T15:55:00.000 | 4 | 0.244919 | false | 1,504,804 | 1 | 0 | 1 | 3 | Because I'm a Python fan, I'd like to learn the .NET framework using IronPython. Would I be missing out on something? Is this in some way not recommended?
EDIT:
I'm pretty knowledgeable of Java ( so learning/using a new language is not a problem for me ). If needed, will I be able to use everything I learned in IronPyt... |
Network programming abstraction, decomposition | 1,506,213 | 0 | 0 | 290 | 0 | python,networking,network-programming,twisted | Why not use a database instead of "just a structure"? Both relational and non-relational DBs offer many practical advantages (separate processes using them, take care of replication [[and/or snapshots, backups, ...]], rich functionality if you need it for the "queries", and so on, and so forth).
Worst case, the "just ... | 0 | 1 | 0 | 0 | 2009-10-01T18:45:00.000 | 3 | 0 | false | 1,505,744 | 0 | 0 | 1 | 1 | I have a problem as follows:
Server process 1
Constantly sends updates that occur to a datastore
Server process 2
Clients contact the server, which queries the datastore, and returns a result
The thing is, the results that process 1 and process 2 are sending back the client are totally different and unrelated.
How ... |
Converting urls into lowercase? | 1,512,414 | 3 | 0 | 344 | 0 | python,google-app-engine,web-applications | You'd have to wrap the instance of WSGIApplication with your own WSGI app that lowercases the URL in the WSGI environment -- but then the environment would just stay modified, which may have other unpleasant effects. Why not just add (?i) to the regex patterns you use in urlpatterns instead? | 0 | 0 | 0 | 0 | 2009-10-03T00:21:00.000 | 2 | 1.2 | true | 1,512,389 | 0 | 0 | 1 | 1 | Is there any straightforward to convert all incoming urls to lowercase before they get matched against urlpatterns in run_wsgi_app(webapp.WSGIApplication(urlpatterns))? |
Deploying a web service to my Google App Engine application | 1,514,062 | 1 | 0 | 369 | 0 | iphone,python,web-services,google-app-engine | Looks like you're not setting the Content-Type header correctly in your service (assuming you ARE actually trying to send XML -- e.g. SOAP, XML-RPC, &c). What code are you using to set that header? Without some indication about what protocol you're implementing and via what framework, it's impossible to help in detail... | 0 | 1 | 0 | 0 | 2009-10-03T07:04:00.000 | 2 | 0.099668 | false | 1,513,038 | 0 | 0 | 1 | 2 | We made a simple application and using GoogleAppEngineLauncher (GAEL) ran that locally. Then we deployed, using GAEL again, to our appid. It works fine.
Now, we made a web service. We ran that locally using GAEL and a very thin local python client. It works fine.
We deployed that, and we get this message when we try t... |
Deploying a web service to my Google App Engine application | 1,604,138 | 0 | 0 | 369 | 0 | iphone,python,web-services,google-app-engine | Looks like we aren't going to get to the bottom of this one. Just not enough information available at debug time. We've managed to affect a fix on the service, although I hate ot admit it we never found out what was causing this bug. | 0 | 1 | 0 | 0 | 2009-10-03T07:04:00.000 | 2 | 1.2 | true | 1,513,038 | 0 | 0 | 1 | 2 | We made a simple application and using GoogleAppEngineLauncher (GAEL) ran that locally. Then we deployed, using GAEL again, to our appid. It works fine.
Now, we made a web service. We ran that locally using GAEL and a very thin local python client. It works fine.
We deployed that, and we get this message when we try t... |
How to get a http page using mechanize cookies? | 1,513,899 | 2 | 3 | 1,699 | 0 | python,mechanize | Some wild ideas:
Fetch the second page before filling in the form?
Or fetch the new page and then goBack()? Although maybe that will reset the values. | 0 | 0 | 1 | 0 | 2009-10-03T14:08:00.000 | 3 | 0.132549 | false | 1,513,823 | 0 | 0 | 1 | 1 | There is a Python mechanize object with a form with almost all values set, but not yet submitted. Now I want to fetch another page using cookies from mechanize instance, but without resetting the page, forms and so on, e.g. so that the values remain set (I just need to get body string of another page, nothing else). So... |
CherryPy vs Django | 1,514,830 | 5 | 35 | 26,287 | 0 | python,django,cherrypy | CherryPy is web server "http framework", while Django supports web application front-to-end: it provides object-relational mapper, template, session management, automagically generates DB schema and all CRUD screens, and more. | 0 | 0 | 0 | 0 | 2009-10-03T20:26:00.000 | 7 | 0.141893 | false | 1,514,755 | 0 | 0 | 1 | 7 | CherryPy vs Django, which would you use and why? |
CherryPy vs Django | 13,001,017 | 4 | 35 | 26,287 | 0 | python,django,cherrypy | I think they're both great, but I'm not a fan of full stack frameworks. CherryPy is a lot easier to use and much more flexible. | 0 | 0 | 0 | 0 | 2009-10-03T20:26:00.000 | 7 | 0.113791 | false | 1,514,755 | 0 | 0 | 1 | 7 | CherryPy vs Django, which would you use and why? |
CherryPy vs Django | 1,514,816 | 45 | 35 | 26,287 | 0 | python,django,cherrypy | They're not exactly comparable. CherryPy provides url routing and a request/response abstraction, which makes prototyping very easy (although I find vanilla mod_python just as convenient). Django is a complete web application "stack", including a templating system and an object-relational mapper. | 0 | 0 | 0 | 0 | 2009-10-03T20:26:00.000 | 7 | 1.2 | true | 1,514,755 | 0 | 0 | 1 | 7 | CherryPy vs Django, which would you use and why? |
CherryPy vs Django | 1,514,785 | 6 | 35 | 26,287 | 0 | python,django,cherrypy | I would use Django because of its large user base and existing modules (including the built-in admin interface) but I would imaging that CherryPy is more flexible than Django. You just have to look at the available options, figure out what you want to do and choose the platform that supports that the best. | 0 | 0 | 0 | 0 | 2009-10-03T20:26:00.000 | 7 | 1 | false | 1,514,755 | 0 | 0 | 1 | 7 | CherryPy vs Django, which would you use and why? |
CherryPy vs Django | 1,514,768 | 6 | 35 | 26,287 | 0 | python,django,cherrypy | Django, because the community is so much larger. You'll find more 3rd-party modules you can use and you'll find much more support. | 0 | 0 | 0 | 0 | 2009-10-03T20:26:00.000 | 7 | 1 | false | 1,514,755 | 0 | 0 | 1 | 7 | CherryPy vs Django, which would you use and why? |
CherryPy vs Django | 1,520,944 | 11 | 35 | 26,287 | 0 | python,django,cherrypy | Though e.e. coli has already provided the accepted answer (and a good one at that), one thing I'll say in favor of CherryPy is that it is also implements WSGI out of the box. What this means is that, unlike the mod_python approach mentioned (which I believe is still an Apache-only solution)*, it provides abstraction f... | 0 | 0 | 0 | 0 | 2009-10-03T20:26:00.000 | 7 | 1 | false | 1,514,755 | 0 | 0 | 1 | 7 | CherryPy vs Django, which would you use and why? |
CherryPy vs Django | 7,599,911 | 13 | 35 | 26,287 | 0 | python,django,cherrypy | Django is vast, and difficult to learn, functions, tags and what not, you will absolutely are a computational genius if you have figured Django out completely. "full-stack" means every thing is available, you just have to spend the time looking for it :(
CherryPy is light and clean and far less complex. Compare the sta... | 0 | 0 | 0 | 0 | 2009-10-03T20:26:00.000 | 7 | 1 | false | 1,514,755 | 0 | 0 | 1 | 7 | CherryPy vs Django, which would you use and why? |
Need help in designing a phone book application on python running on google app engine | 1,519,020 | 0 | 0 | 420 | 1 | python,google-app-engine,bulk-load | I think you're going to need to be more specific as to what problem you're having. As far as bulk loading goes, there's lots of bulkloader documentation around; or are you asking about model design? If so, we need to know more about how you plan to search for users. Do you need partial string matches? Sorting? Fuzzy ma... | 0 | 0 | 0 | 0 | 2009-10-05T07:50:00.000 | 2 | 0 | false | 1,518,725 | 0 | 0 | 1 | 1 | Hi I want some help in building a Phone book application on python and put it on google app engine. I am running a huge db of 2 million user lists and their contacts in phonebook. I want to upload all that data from my servers directly onto the google servers and then use a UI to retrieve the phone book contacts of eac... |
Basic Comet in Python using just std lib | 1,751,708 | 0 | 1 | 719 | 0 | python,comet | Extending what lost-theory has said, if you want to use comet for a passing messages between clients then you need to implement something like pubsub.
Using something like tornado for the pubsub is much simpler than with the single threaded wsgiref servers. | 0 | 1 | 0 | 0 | 2009-10-05T16:04:00.000 | 3 | 0 | false | 1,520,953 | 0 | 0 | 1 | 2 | I'm developing a web interface for an already existing desktop application. I've been looking for a way to allow the server to push content to the browser and ended up reaching Comet.
Navigating through the internet, and most of the questions here, I got answers like twisted, orbited, tornado and most of them even poin... |
Basic Comet in Python using just std lib | 1,520,980 | 0 | 1 | 719 | 0 | python,comet | This is possible. Just don't close the connection to the client. | 0 | 1 | 0 | 0 | 2009-10-05T16:04:00.000 | 3 | 0 | false | 1,520,953 | 0 | 0 | 1 | 2 | I'm developing a web interface for an already existing desktop application. I've been looking for a way to allow the server to push content to the browser and ended up reaching Comet.
Navigating through the internet, and most of the questions here, I got answers like twisted, orbited, tornado and most of them even poin... |
flup/fastcgi cpu usage under no-load conditions | 1,531,138 | 2 | 1 | 792 | 0 | python,django,fastcgi,lighttpd,flup | I've looked at this on django running as fastcgi on both Slicehost (django 1.1, python 2.6) and Dreamhost (django 1.0, python 2.5), and I can say this:
Running the top command shows the processes use a large amount of CPU to start up for ~2-3 seconds, then drop down to 0 almost immediately.
Running the ps aux command a... | 0 | 0 | 0 | 0 | 2009-10-05T23:02:00.000 | 2 | 1.2 | true | 1,522,844 | 0 | 0 | 1 | 2 | I'm running Django as threaded fastcgi via flup, served by lighttpd, communicating via sockets.
What is the expected CPU usage for each fastcgi thread under no load? On startup, each thread runs at 3-4% cpu usage for a while, and then backs off to around .5% over the course of a couple of hours. It doesn't sink below t... |
flup/fastcgi cpu usage under no-load conditions | 1,526,653 | 0 | 1 | 792 | 0 | python,django,fastcgi,lighttpd,flup | Your fast-cgi threads must not consume any (noticeable) CPU if there are no requests to process.
You should investigate the load you are describing. I use the same architecture and my threads are completely idle. | 0 | 0 | 0 | 0 | 2009-10-05T23:02:00.000 | 2 | 0 | false | 1,522,844 | 0 | 0 | 1 | 2 | I'm running Django as threaded fastcgi via flup, served by lighttpd, communicating via sockets.
What is the expected CPU usage for each fastcgi thread under no load? On startup, each thread runs at 3-4% cpu usage for a while, and then backs off to around .5% over the course of a couple of hours. It doesn't sink below t... |
Update a gallery webpage via Dropbox? | 2,074,899 | 2 | 2 | 4,092 | 0 | php,python,html,dropbox | If you can install the DropBox client on the webserver then it would be simple to let it sync your folder and then iterate over the contents of the folder with a programming language (PHP, Python, .NET etc) and produce the gallery page. This could be done every time the page is requested or as a scheduled job which re... | 0 | 0 | 1 | 0 | 2009-10-05T23:43:00.000 | 3 | 0.132549 | false | 1,522,951 | 0 | 0 | 1 | 1 | I'd like to know if the following situation and scripts are at all possible:
I'm looking to have a photo-gallery (Javascript) webpage that will display in order of the latest added to the Dropbox folder (PHP or Python?).
That is, when someone adds a picture to the Dropbox folder, there is a script on the webpage that... |
Werkzeug in General, and in Python 3.1 | 1,622,505 | 1 | 2 | 2,259 | 1 | python,python-3.x,werkzeug | I can only answer question one:
I started using it for some small webstuff but now moved on to rework larger apps with it. Why Werkzeug? The modular concept is really helpful. You can hook in modules as you like, make stuff easily context aware and you get good request file handling for free which is able to cope with ... | 0 | 1 | 0 | 0 | 2009-10-06T05:13:00.000 | 3 | 0.066568 | false | 1,523,706 | 0 | 0 | 1 | 3 | I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi.
History:
PHP + MySQL years ago
PHP + Python 2.x + MySQL recently and current
Python + PostgreSQL working on it
We use a great library for communicating betwe... |
Werkzeug in General, and in Python 3.1 | 1,523,934 | 1 | 2 | 2,259 | 1 | python,python-3.x,werkzeug | I haven't used Werkzeug, so I can only answer question 2:
No, Werkzeug does not work on Python 3. In fact, very little works on Python 3 as of today. Porting is not difficult, but you can't port until all your third-party libraries have been ported, so progress is slow.
One big stopper has been setuptools, which is a v... | 0 | 1 | 0 | 0 | 2009-10-06T05:13:00.000 | 3 | 0.066568 | false | 1,523,706 | 0 | 0 | 1 | 3 | I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi.
History:
PHP + MySQL years ago
PHP + Python 2.x + MySQL recently and current
Python + PostgreSQL working on it
We use a great library for communicating betwe... |
Werkzeug in General, and in Python 3.1 | 1,525,943 | 3 | 2 | 2,259 | 1 | python,python-3.x,werkzeug | mod_wsgi for Python 3.x is also not ready. There is no satisfactory definition of WSGI for Python 3.x yet; the WEB-SIG are still bashing out the issues. mod_wsgi targets a guess at what might be in it, but there are very likely to be changes to both the spec and to standard libraries. Any web application you write toda... | 0 | 1 | 0 | 0 | 2009-10-06T05:13:00.000 | 3 | 0.197375 | false | 1,523,706 | 0 | 0 | 1 | 3 | I've been looking really hard at all of the way**(s)** one can develop web applications using Python. For reference, we are using RHEL 64bit, apache, mod_wsgi.
History:
PHP + MySQL years ago
PHP + Python 2.x + MySQL recently and current
Python + PostgreSQL working on it
We use a great library for communicating betwe... |
Is an applet a proper solution for hardware detection and driver install? | 1,524,622 | 0 | 0 | 101 | 0 | c#,python,ruby | Applet should be better if your application is not depended on IE.
If for IE only then use COM/ActiveX | 0 | 0 | 0 | 0 | 2009-10-06T09:45:00.000 | 1 | 0 | false | 1,524,606 | 0 | 0 | 1 | 1 | Can I use applets to inform me which hardware is installed on client system (fingerprint reader)? And if it is installed, can it tell me its version, so that it can download the proper plugin from a site? So that after everything is OK, the user can use his fingerprint reader to authenticate himself? |
How do I display images at different times on webpage | 1,524,724 | 0 | 1 | 328 | 0 | python,django | You could make a Date object in javascript. Check the current time and depending on the time, you set the img src to whatever image you want for that time of day :) or hide the image through myimg.style.visibility = "hidden" if you dont want to display an image at that moment. | 0 | 0 | 1 | 0 | 2009-10-06T10:15:00.000 | 4 | 0 | false | 1,524,713 | 0 | 0 | 1 | 2 | I'm supposed to display images at certain times of the day on the webpage, Please can anyone tell me how to go about it |
How do I display images at different times on webpage | 1,524,812 | 0 | 1 | 328 | 0 | python,django | If you need to change the image before a page refresh, you could use jquery ajax call to get the correct image. jquery has some interval functionality which would allow this. | 0 | 0 | 1 | 0 | 2009-10-06T10:15:00.000 | 4 | 0 | false | 1,524,713 | 0 | 0 | 1 | 2 | I'm supposed to display images at certain times of the day on the webpage, Please can anyone tell me how to go about it |
Django Vote Up/Down method | 1,528,617 | 11 | 29 | 12,621 | 0 | python,django,voting | Whatever you do, make sure that it's submitted by POST and not GET; GET requests should never alter database information. | 0 | 0 | 0 | 0 | 2009-10-06T23:10:00.000 | 4 | 1 | false | 1,528,583 | 0 | 0 | 1 | 1 | I am making a small app that lets users vote items either up or down. I'm using Django (and new to it!).
I am just wondering, what is the best way to present the upvote link to the user. As a link, button or something else?
I have already done something like this in php with a different framework but I'm not sure if I ... |
Can a WIN32 program authenticate into Django authentication system, using MYSQL? | 1,529,146 | 0 | 1 | 203 | 1 | python,windows,django,authentication,frameworks | If the only thing the WIN32 app uses the MS-SQL Server for is Authentication/Authorization then you could write a new Authentication/Authorization provider that uses a set of Web Services (that you would have to create) that expose the Django provider. | 0 | 0 | 0 | 0 | 2009-10-07T01:59:00.000 | 2 | 0 | false | 1,529,128 | 0 | 0 | 1 | 1 | I have a web service with Django Framework.
My friend's project is a WIN32 program and also a MS-sql server.
The Win32 program currently has a login system that talks to a MS-sql for authentication.
However, we would like to INTEGRATE this login system as one.
Please answer the 2 things:
I want scrap the MS-SQL to use... |
Can a WIN32 program authenticate into Django authentication system, using MYSQL? | 1,581,622 | 1 | 0 | 103 | 1 | python,mysql,windows,django | The Win32 client can act like a web client to pass the user's credentials to the server. You will want to store the session cookie you get once you are authenticated and use that cookie in all following requests | 0 | 0 | 0 | 0 | 2009-10-07T02:00:00.000 | 1 | 1.2 | true | 1,533,259 | 0 | 0 | 1 | 1 | I have a web service with Django Framework.
My friend's project is a WIN32 program and also a MS-sql server.
The Win32 program currently has a login system that talks to a MS-sql for authentication.
However, we would like to INTEGRATE this login system as one.
Please answer the 2 things:
I want scrap the MS-SQL to use... |
Python: how to show results on a web page? | 1,537,103 | 2 | 11 | 29,818 | 0 | python | Whose web server? If it is a web server provided by a web hosting company or someone else and you don't have control over it, you need to ascertain in what way they support the use of Python for writing web applications. It isn't enough to know just that they have Python available.
As pointed out by others, is likely t... | 0 | 0 | 0 | 0 | 2009-10-07T20:40:00.000 | 8 | 0.049958 | false | 1,534,070 | 0 | 0 | 1 | 1 | Most likely it's a dumb question for those who knows the answer, but I'm a beginner, and here it goes:
I have a Python script which I run in a command-line with some parameter, and it prints me some results. Let's say results are some HTML code.
I never done any Python programming for web, and couldn't figure it out...... |
What do I need to know/learn for automated python deployment? | 1,537,585 | 2 | 2 | 1,087 | 0 | python,deployment,virtualenv | You already mentioned buildout, and it's all you need. Google for example buildouts for the different parts. Takes a while to set it up the first time, but then you can reuse the setup between different projects too.
Let supervisord start everything, not just the python server. Then start supervisord at reboot either f... | 0 | 0 | 0 | 1 | 2009-10-08T11:40:00.000 | 3 | 1.2 | true | 1,537,298 | 0 | 0 | 1 | 1 | I'm starting a new webapp project in Python to get into the Agile mind-set and I'd like to do things "properly" with regards to deployment. However, I'm finding the whole virtualenv/fabric/zc.buildout/etc stuff a little confusing - I'm used to just FTP'ing PHP files to a server and pointing a webserver at it.
After dep... |
Difference between GET and FILTER in Django model layer | 1,541,322 | 48 | 20 | 9,344 | 0 | python,django | I don't know if you really need an example, it's quite easy:
if you know it's one object that matches your query, use get. It will fail if it's more than one.
otherwise use filter, which gives you a list of objects.
To be more precise:
MyTable.objects.get(id=x).whatever gives you the whatever property of your object... | 0 | 0 | 0 | 0 | 2009-10-09T00:21:00.000 | 1 | 1.2 | true | 1,541,249 | 0 | 0 | 1 | 1 | What is the difference, please explain them in laymen's terms with examples. Thanks! |
A .net wrapper for Google App Engine? | 17,356,271 | 0 | 3 | 3,521 | 0 | java,.net,python,web-services,google-app-engine | Python has a .NET alternative called IronPython. But I don't think it will work in GAE as it supports only pure python. I am also facing a similar problem trying to port a source written in C#.net into GAE compatible code. I'm going to work around it by re-inventing the spokes of the wheel (not the wheel itself) by re-... | 0 | 1 | 0 | 0 | 2009-10-09T03:59:00.000 | 3 | 0 | false | 1,541,722 | 0 | 0 | 1 | 1 | Does anyone know of a .net wrapper around either python or java Google App Engine services?
Any help appreciated // :) |
Why does this happen in my template for Django? | 1,549,656 | 1 | 0 | 180 | 0 | python,django | Try removing the space between the rec.artist_name and the |. So you should have this:
{{ rec.artist_name|safe }}
That'll fix the autoescaping, but I think the other commentors are correct in saying that you're storing the %20 into the db. So you'll probably have to fix it on that end of things. | 0 | 0 | 0 | 0 | 2009-10-11T01:42:00.000 | 2 | 0.099668 | false | 1,549,606 | 0 | 0 | 1 | 1 | simple%20minds is displayed when do this:
{{ rec.artist_name }}
How do I remove the %20...and make it spaces?
When I put | safe as a fitler, the error is:
Could not parse the remainder: ' | safe' from 'active.artist_name | safe'
Thanks. |
URLs stored in database for Django site | 1,563,359 | 1 | 1 | 3,215 | 1 | python,database,django,url,content-management-system | Your question is a little bit twisted, but I think what you're asking for is something similar to how django.contrib.flatpages handles this. Basically it uses middleware to catch the 404 error and then looks to see if any of the flatpages have a URL field that matches.
We did this on one site where all of the URLs were... | 0 | 0 | 0 | 0 | 2009-10-13T21:43:00.000 | 2 | 0.099668 | false | 1,563,088 | 0 | 0 | 1 | 1 | I've produced a few Django sites but up until now I have been mapping individual views and URLs in urls.py.
Now I've tried to create a small custom CMS but I'm having trouble with the URLs. I have a database table (SQLite3) which contains code for the pages like a column for header, one for right menu, one for content.... |
What pure Python library should I use to scrape a website? | 1,563,177 | 11 | 2 | 1,959 | 0 | python,google-app-engine,xpath,beautifulsoup,mechanize | Beautiful Soup. | 0 | 0 | 1 | 0 | 2009-10-13T21:58:00.000 | 5 | 1 | false | 1,563,165 | 0 | 0 | 1 | 2 | I currently have some Ruby code used to scrape some websites. I was using Ruby because at the time I was using Ruby on Rails for a site, and it just made sense.
Now I'm trying to port this over to Google App Engine, and keep getting stuck.
I've ported Python Mechanize to work with Google App Engine, but it doesn't sup... |
What pure Python library should I use to scrape a website? | 1,563,301 | 6 | 2 | 1,959 | 0 | python,google-app-engine,xpath,beautifulsoup,mechanize | lxml -- 100x better than elementtree | 0 | 0 | 1 | 0 | 2009-10-13T21:58:00.000 | 5 | 1 | false | 1,563,165 | 0 | 0 | 1 | 2 | I currently have some Ruby code used to scrape some websites. I was using Ruby because at the time I was using Ruby on Rails for a site, and it just made sense.
Now I'm trying to port this over to Google App Engine, and keep getting stuck.
I've ported Python Mechanize to work with Google App Engine, but it doesn't sup... |
How can I make Zenoss recognize skin changes? | 1,578,608 | 1 | 0 | 433 | 0 | python,zope,zenoss | The problem turned out to be that none of the template changes I made actually had any impact on the final page output. The changes were picked up, they just didn't matter. | 0 | 0 | 0 | 0 | 2009-10-15T14:16:00.000 | 1 | 1.2 | true | 1,572,661 | 0 | 0 | 1 | 1 | I'm writing a ZenPack for Zenoss which includes a new DataSource. The DataSource has a ToOne relationship with another persistent object and I'm trying to construct the user interface to allow a user to specify the value of this relationship. I've given the DataSource a factory_type_information attribute with an "imm... |
What is the typical workflow for development of a Zenoss ZenPack? | 7,033,005 | 2 | 2 | 1,306 | 0 | python,database,zenoss | I am working on this very problem this week with Zenoss 3.1.
Caveat-
If you make a bad zenpack - no wait - when you make a bad one, it can get stuck in Zope's db, and there is no way to get it out AFAIK. So-
First use the GUI to make a complete backup of a clean Zenoss site.
Later you will need to restore using zenrest... | 0 | 0 | 0 | 0 | 2009-10-15T15:35:00.000 | 2 | 0.197375 | false | 1,573,166 | 0 | 0 | 1 | 1 | ZenPack development seems to involve the creation of a variety of persistent state. There are model classes which represent explicitly persistent state. There are skins which are associated with model objects. There are organizers and instances of persistent classes (data sources, graphs, etc).
Considering that duri... |
Long, slow operation in Django view causes timeout. Any way for Python to speak AJAX instead? | 1,582,971 | 7 | 5 | 3,585 | 0 | python,ajax,django,timeout | Ajax doesn't require any particular technology on the server side. All you need is to return a response in some form that some Javascript on the client side can understand. JSON is an excellent choice here, as it's easy to create in Python (there's a json library in 2.6, and Django has django.utils.simplejson for other... | 0 | 0 | 0 | 0 | 2009-10-17T17:19:00.000 | 3 | 1.2 | true | 1,582,708 | 0 | 0 | 1 | 1 | I've been programming Python a while, but DJango and web programming in general is new to me.
I have a very long operation performed in a Python view. Since the local() function in my view takes so long to return, there's an HTTP timeout. Fair enough, I understand that part.
What's the best way to give an HTTPresponse ... |
positioning sound with pygame? | 1,583,298 | 0 | 2 | 2,176 | 0 | python,audio,pygame | I think setting the separate channel volume is the only way. Pygame doesn't seem to have any notion of world space or positioning for sounds. | 1 | 0 | 0 | 0 | 2009-10-17T21:32:00.000 | 3 | 0 | false | 1,583,284 | 0 | 0 | 1 | 1 | Is there a way to do panning or 3d sound in Pygame? The only way I've found to control sound playback is to set the volume for both the left and right channels. |
PHP, Python, Ruby application with multiple RDBMS | 1,586,035 | 0 | 2 | 369 | 1 | php,python,ruby-on-rails,database | It would be great if code written for one platform would work on every other without any modification whatsoever, but this is usually not the case and probably never will be. What the current frameworks do is about all anyone can. | 0 | 0 | 0 | 0 | 2009-10-18T20:56:00.000 | 4 | 0 | false | 1,586,008 | 0 | 0 | 1 | 3 | I start feeling old fashioned when I see all these SQL generating database abstraction layers and all those ORMs out there, although I am far from being old. I understand the need for them, but their use spreads to places they normally don't belong to.
I firmly believe that using database abstraction layers for SQL gen... |
PHP, Python, Ruby application with multiple RDBMS | 1,586,105 | 2 | 2 | 369 | 1 | php,python,ruby-on-rails,database | If you want to leverage the bells and whistles of various RDBMSes, you can certainly do it. Just apply standard OO Principles. Figure out what kind of API your persistence layer will need to provide.
You'll end up writing a set of isomorphic persistence adapter classes. From the perspective of your model code (whi... | 0 | 0 | 0 | 0 | 2009-10-18T20:56:00.000 | 4 | 0.099668 | false | 1,586,008 | 0 | 0 | 1 | 3 | I start feeling old fashioned when I see all these SQL generating database abstraction layers and all those ORMs out there, although I am far from being old. I understand the need for them, but their use spreads to places they normally don't belong to.
I firmly believe that using database abstraction layers for SQL gen... |
PHP, Python, Ruby application with multiple RDBMS | 1,587,887 | 2 | 2 | 369 | 1 | php,python,ruby-on-rails,database | You cannot eat a cake and have it, choose on of the following options.
Use your database abstraction layer whenever you can and in the rare cases when you have a need for a hand-made query (eg. performance reasons) stick to the lowest common denominator and don't use stored procedures or any proprietary extensions tha... | 0 | 0 | 0 | 0 | 2009-10-18T20:56:00.000 | 4 | 1.2 | true | 1,586,008 | 0 | 0 | 1 | 3 | I start feeling old fashioned when I see all these SQL generating database abstraction layers and all those ORMs out there, although I am far from being old. I understand the need for them, but their use spreads to places they normally don't belong to.
I firmly believe that using database abstraction layers for SQL gen... |
how to determine if webpage has been modified | 1,588,461 | -1 | 6 | 2,946 | 0 | python,diff,webpage,snapshot | just take snapshots of the files with MD5 or SHA1...if the values differ the next time you check, then they are modified. | 0 | 0 | 1 | 0 | 2009-10-19T10:13:00.000 | 4 | -0.049958 | false | 1,587,902 | 0 | 0 | 1 | 1 | I have snapshots of multiple webpages taken at 2 times. What is a reliable method to determine which webpages have been modified?
I can't rely on something like an RSS feed, and I need to ignore minor noise like date text.
Ideally I am looking for a Python solution, but an intuitive algorithm would also be great.
Than... |
What are the use cases for non relational datastores? | 1,588,748 | 2 | 3 | 587 | 1 | python,google-app-engine,couchdb | Consider the situation where you have many entity types but few instances of each entity. In this case you will have many tables each with a few records so a relational approach is not suitable. | 0 | 1 | 0 | 0 | 2009-10-19T13:36:00.000 | 3 | 0.132549 | false | 1,588,708 | 0 | 0 | 1 | 2 | I'm looking at using CouchDB for one project and the GAE app engine datastore in the other. For relational stuff I tend to use postgres, although I much prefer an ORM.
Anyway, what use cases suit non relational datastores best? |
What are the use cases for non relational datastores? | 1,589,186 | 0 | 3 | 587 | 1 | python,google-app-engine,couchdb | In some cases that are simply nice. ZODB is a Python-only object database, that is so well-integrated with Python that you can simply forget that it's there. You don't have to bother about it, most of the time. | 0 | 1 | 0 | 0 | 2009-10-19T13:36:00.000 | 3 | 0 | false | 1,588,708 | 0 | 0 | 1 | 2 | I'm looking at using CouchDB for one project and the GAE app engine datastore in the other. For relational stuff I tend to use postgres, although I much prefer an ORM.
Anyway, what use cases suit non relational datastores best? |
Google App Engine compatibility layer | 4,219,064 | 0 | 6 | 702 | 0 | python,google-app-engine | If you develop with web2py your code will run GAE other architectures wihtout changes using any of the 10 supported relational databases. The compatibility layer covers database api (including blobs and listproperty), email, and fetching). | 0 | 1 | 0 | 0 | 2009-10-19T16:33:00.000 | 5 | 0 | false | 1,589,743 | 0 | 0 | 1 | 1 | I'm planning an application running on Google App Engine. The only worry I would have is portability. Or just the option to have the app run on a local, private cluster.
I expected an option for Google App Engine applications to run on other systems, a compatibility layer, to spring up. I could imagine a GAE compatibl... |
Get the request uri outside of a RequestHandler in Google App Engine (Python) | 1,593,985 | 2 | 1 | 786 | 0 | python,google-app-engine | You should generally be doing everything within some sort of RequestHandler or the equivalent in your non-WebApp framework. However, if you really insist on being stuck in the early 1990s and writing plain CGI scripts, the environment variables SERVER_NAME and PATH_INFO may be what you want; see a CGI reference for mo... | 0 | 1 | 1 | 0 | 2009-10-20T09:33:00.000 | 2 | 1.2 | true | 1,593,483 | 0 | 0 | 1 | 1 | So, within a webapp.RequestHandler subclass I would use self.request.uri to get the request URI. But, I can't access this outside of a RequestHandler and so no go. Any ideas?
I'm running Python and I'm new at it as well as GAE. |
How do you convert a Word Document into very simple html in Python? | 1,597,120 | 2 | 13 | 26,350 | 0 | python,html,django,ms-word | It depends how much formatting and images you're dealing with. I do one of a couple things:
Google Docs: Probably the closest you'll get to the original formatting and usable HTML.
Markdown: Abandon formatting. Paste it into a plain text editor, run it through Markdown and fix the rest by hand. | 0 | 0 | 0 | 0 | 2009-10-20T19:52:00.000 | 6 | 0.066568 | false | 1,596,911 | 0 | 0 | 1 | 2 | Every now and then I receive a Word Document that I have to display as a web page. I'm currently using Django's flatpages to achieve this by grabbing the html content generated by MS Word. The generated html is quite messy. Is there a better way that can generate very simple html to solve this issue using Python? |
How do you convert a Word Document into very simple html in Python? | 8,174,432 | 2 | 13 | 26,350 | 0 | python,html,django,ms-word | Word 2010 has the ability to "save as filtered web page". This will eliminate the overwhelming majority of the HTML that Word inserts. | 0 | 0 | 0 | 0 | 2009-10-20T19:52:00.000 | 6 | 0.066568 | false | 1,596,911 | 0 | 0 | 1 | 2 | Every now and then I receive a Word Document that I have to display as a web page. I'm currently using Django's flatpages to achieve this by grabbing the html content generated by MS Word. The generated html is quite messy. Is there a better way that can generate very simple html to solve this issue using Python? |
starting my own threads within python paste | 1,843,498 | 0 | 1 | 862 | 0 | python,pylons,paste | To answer your basic question directly, you should be able to use threads just as you'd like. The "killing hung threads" part is paste cleaning up its own threads, not yours.
There are other packages that might help, etc, but I'd suggest you start with simple threads and see how far you get. Only then will you know w... | 0 | 0 | 0 | 0 | 2009-10-21T22:43:00.000 | 4 | 0 | false | 1,604,079 | 1 | 0 | 1 | 2 | I'm writing a web application using pylons and paste. I have some work I want to do after an HTTP request is finished (send some emails, write some stuff to the db, etc) that I don't want to block the HTTP request on.
If I start a thread to do this work, is that OK? I always see this stuff about paste killing off hung ... |
starting my own threads within python paste | 1,768,292 | 0 | 1 | 862 | 0 | python,pylons,paste | Take a look at gearman, it was specifically made for farming out tasks to 'workers' to handle. They can even handle it in a different language entirely. You can come back and ask if the task was completed, or just let it complete. That should work well for many tasks.
If you absolutely need to ensure it was completed, ... | 0 | 0 | 0 | 0 | 2009-10-21T22:43:00.000 | 4 | 0 | false | 1,604,079 | 1 | 0 | 1 | 2 | I'm writing a web application using pylons and paste. I have some work I want to do after an HTTP request is finished (send some emails, write some stuff to the db, etc) that I don't want to block the HTTP request on.
If I start a thread to do this work, is that OK? I always see this stuff about paste killing off hung ... |
django syncdb and an updated model | 37,202,110 | 1 | 86 | 51,126 | 0 | python,django,django-models | In django 1.6
At first we have run - python manage.py sql <app name>
Then we have to run - python manage.py syncdb | 0 | 0 | 0 | 0 | 2009-10-22T08:04:00.000 | 7 | 0.028564 | false | 1,605,662 | 0 | 0 | 1 | 3 | I have recently updated my model, added a BooleanField to it however when I do python manage.py syncdb, it doesn't add the new field to the database for the model. How can I fix this ? |
django syncdb and an updated model | 27,652,020 | 0 | 86 | 51,126 | 0 | python,django,django-models | If you run Django with Apache and MySQL, restart apache after making migration with makemigrations. | 0 | 0 | 0 | 0 | 2009-10-22T08:04:00.000 | 7 | 0 | false | 1,605,662 | 0 | 0 | 1 | 3 | I have recently updated my model, added a BooleanField to it however when I do python manage.py syncdb, it doesn't add the new field to the database for the model. How can I fix this ? |
django syncdb and an updated model | 1,605,670 | 2 | 86 | 51,126 | 0 | python,django,django-models | Havent used django in a while, but i seem to remember that syncdb does perform alter commands on db tables. you have to drop the table then run again and it will create again.
edit: sorry does NOT perform alter. | 0 | 0 | 0 | 0 | 2009-10-22T08:04:00.000 | 7 | 0.057081 | false | 1,605,662 | 0 | 0 | 1 | 3 | I have recently updated my model, added a BooleanField to it however when I do python manage.py syncdb, it doesn't add the new field to the database for the model. How can I fix this ? |
Django: How to detect if translation is activated? | 2,450,262 | 0 | 2 | 735 | 0 | python,django,internationalization | Depends on application and architecture...
Hack provided by Ignacio should works, but what is you will run in non activated yet thread?
I would use Ignacio solution + add Queue visible by all threads, monkeypatch trans_real.activate function and set attribute in queue. | 0 | 0 | 0 | 0 | 2009-10-22T08:18:00.000 | 3 | 0 | false | 1,605,706 | 0 | 0 | 1 | 1 | django.utils.translation.get_language() returns default locale if translation is not activated. Is there a way to find out whether the translation is activated (via translation.activate()) or not? |
Python debugging in Netbeans | 1,606,803 | 1 | 4 | 2,156 | 0 | python,netbeans | I just installed Python for NetBeans yesterday and hadn't tried the debugger, so just tried it, and I got the same error. So I thought maybe it's a Firewall issue, disabled my Firewall and retried it, and then it worked.
However I restarted the Firewall and now it's still working, so I don't know. I saw the Netbeans op... | 0 | 1 | 0 | 0 | 2009-10-22T12:02:00.000 | 2 | 0.099668 | false | 1,606,746 | 0 | 0 | 1 | 2 | I have a problem with debugging Python programs under the Netbeans IDE. When I start debugging, the debugger writes the following log and error. Thank you for help.
[LOG]PythonDebugger : overall Starting
>>>[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive d... |
Python debugging in Netbeans | 1,636,617 | 1 | 4 | 2,156 | 0 | python,netbeans | For Python I like WingIDE from Wingware. | 0 | 1 | 0 | 0 | 2009-10-22T12:02:00.000 | 2 | 0.099668 | false | 1,606,746 | 0 | 0 | 1 | 2 | I have a problem with debugging Python programs under the Netbeans IDE. When I start debugging, the debugger writes the following log and error. Thank you for help.
[LOG]PythonDebugger : overall Starting
>>>[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive d... |
What is a light python library that can eliminate HTML tags? (and only text) | 1,620,413 | 4 | 0 | 746 | 0 | python | python standard module html.parser should allow you to parse simple html content and eliminate tags. you only have to derive HTMLParser, then overload all handle_*() methods so that they output or discard content, depending on the surrounding element tags. | 0 | 0 | 0 | 0 | 2009-10-25T08:31:00.000 | 4 | 1.2 | true | 1,620,363 | 0 | 0 | 1 | 1 | I know that NLTK has it. But any else? |
How do I display real-time python script output on a website? | 11,067,328 | 0 | 3 | 5,553 | 0 | python,ajax,cgi,web-applications,fastcgi | As suggested by a few of the others you can use a keep alive connection and instead of "return" statements use yield statements and instead of "print" statements also use yield statements. This will basically show everything that happens in the python script onto the website page.
After extensive searching and testing ... | 0 | 0 | 0 | 1 | 2009-10-25T17:10:00.000 | 5 | 0 | false | 1,621,430 | 0 | 0 | 1 | 1 | I have a Python script that outputs something every second or two, but takes a long while to finish completely. I want to set up a website such that someone can directly invoke the script, and the output is sent to the screen while the script is running.
I don't want the user to wait until the script finishes complete... |
Find Monday's date with Python | 1,622,263 | 54 | 87 | 60,733 | 0 | python,django | ChristopheD's post is close to what you want. I don't have enough rep to make a comment :(
Instead of (which actually gives you the next upcoming monday):
>>> today + datetime.timedelta(days=-today.weekday(), weeks=1)
datetime.date(2009, 10, 26)
I would say:
>>> last_monday = today - datetime.timedelta(days=today.we... | 0 | 0 | 0 | 0 | 2009-10-25T20:53:00.000 | 8 | 1 | false | 1,622,038 | 1 | 0 | 1 | 1 | How do I find the previous Monday's date, based off of the current date using Python? I thought maybe I could use: datetime.weekday() to do it, but I am getting stuck.
I basically want to find today's date and Mondays date to construct a date range query in django using: created__range=(start_date, end_date). |
Restrict access to images on my website except through my own htmls | 1,623,338 | 6 | 2 | 4,621 | 1 | php,python,linux,perl | Any method you choose to determine the source of a request is only as reliable as the HTTP_REFERER information that is sent by the user's browser, which is not very. Requiring authentication is the only good way to protect content. | 0 | 0 | 0 | 0 | 2009-10-26T06:06:00.000 | 5 | 1 | false | 1,623,311 | 0 | 0 | 1 | 2 | On my website I store user pictures in a simple manner such as:
"image/user_1.jpg".
I don't want visitors to be able to view images on my server just by trying user_ids. (Ex: www.mydomain.com/images/user_2.jpg, www.mydomain.com/images/user_3.jpg, so on...)
So far I have three solutions in mind:
I tried using .htaccess... |
Restrict access to images on my website except through my own htmls | 1,623,325 | 2 | 2 | 4,621 | 1 | php,python,linux,perl | You are right considering option #3. Use service script that would validate user and readfile() an image. Be sure to set correct Content-Type HTTP header via header() function prior to serving an image. For better isolation images should be put above web root directory, or protected by well written .htaccess rules - th... | 0 | 0 | 0 | 0 | 2009-10-26T06:06:00.000 | 5 | 0.07983 | false | 1,623,311 | 0 | 0 | 1 | 2 | On my website I store user pictures in a simple manner such as:
"image/user_1.jpg".
I don't want visitors to be able to view images on my server just by trying user_ids. (Ex: www.mydomain.com/images/user_2.jpg, www.mydomain.com/images/user_3.jpg, so on...)
So far I have three solutions in mind:
I tried using .htaccess... |
Does using Psyco with django make any sense? | 1,623,547 | 4 | 4 | 1,160 | 0 | python,django,psyco | You should be using fastcgi or wsgi with django, so the process won't be starting up for each request.
You really need to write your code to be psyco friendly if you want decent gains, and you will not benefit if your bottleneck is the database. | 0 | 0 | 0 | 0 | 2009-10-26T07:50:00.000 | 3 | 0.26052 | false | 1,623,538 | 0 | 0 | 1 | 2 | I know the benefits of Psyco for a Desktop app, but in a Web app where a process ( = a web page or an AJAX call) dies immediately after been fired, isn't it pointless ? |
Does using Psyco with django make any sense? | 1,623,581 | 4 | 4 | 1,160 | 0 | python,django,psyco | First, as gribbler and Ibrahim mentioned, your process won't die unless you are using pure CGI... which you shouldn't be using.
Secondly, the bottleneck in most web apps are database queries, for which Psyco won't help.
If you happen to have a some logic that is computationally intensive it can certainly make sense to ... | 0 | 0 | 0 | 0 | 2009-10-26T07:50:00.000 | 3 | 1.2 | true | 1,623,538 | 0 | 0 | 1 | 2 | I know the benefits of Psyco for a Desktop app, but in a Web app where a process ( = a web page or an AJAX call) dies immediately after been fired, isn't it pointless ? |
Is there an easy way to create derived attributes in Django Model/Python classes? | 1,626,233 | 0 | 4 | 1,644 | 0 | python,django,django-models,oop | You've got two options I can think of right now:
Since you don't want the field in the database your best bet is to define a method on the model that returns self.id * SOME_CONSTANT, say you call it big_id(). You can access this method anytime as yourObj.big_id(), and it will be available in templates as yourObj.big_i... | 0 | 0 | 0 | 0 | 2009-10-26T17:30:00.000 | 3 | 0 | false | 1,626,155 | 0 | 0 | 1 | 1 | Every Django model has a default primary-key id created automatically. I want the model objects to have another attribute big_id which is calculated as:
big_id = id * SOME_CONSTANT
I want to access big_id as model_obj.big_id without the corresponding database table having a column called big_id.
Is this possible? |
How to manage local vs production settings in Django? | 5,528,824 | 4 | 339 | 119,151 | 0 | python,django,deployment | For most of my projects I use following pattern:
Create settings_base.py where I store settings that are common for all environments
Whenever I need to use new environment with specific requirements I create new settings file (eg. settings_local.py) which inherits contents of settings_base.py and overrides/adds prope... | 0 | 0 | 0 | 0 | 2009-10-26T18:00:00.000 | 22 | 0.036348 | false | 1,626,326 | 0 | 0 | 1 | 4 | What is the recommended way of handling settings for local development and the production server? Some of them (like constants, etc) can be changed/accessed in both, but some of them (like paths to static files) need to remain different, and hence should not be overwritten every time the new code is deployed.
Currently... |
How to manage local vs production settings in Django? | 1,626,371 | 14 | 339 | 119,151 | 0 | python,django,deployment | I use a settings_local.py and a settings_production.py. After trying several options I've found that it's easy to waste time with complex solutions when simply having two settings files feels easy and fast.
When you use mod_python/mod_wsgi for your Django project you need to point it to your settings file. If you point... | 0 | 0 | 0 | 0 | 2009-10-26T18:00:00.000 | 22 | 1 | false | 1,626,326 | 0 | 0 | 1 | 4 | What is the recommended way of handling settings for local development and the production server? Some of them (like constants, etc) can be changed/accessed in both, but some of them (like paths to static files) need to remain different, and hence should not be overwritten every time the new code is deployed.
Currently... |
How to manage local vs production settings in Django? | 36,996,922 | 1 | 339 | 119,151 | 0 | python,django,deployment | As an alternative to maintain different file if you wiil:
If you are using git or any other VCS to push codes from local to server, what you can do is add the settings file to .gitignore.
This will allow you to have different content in both places without any problem. SO on server you can configure an independent vers... | 0 | 0 | 0 | 0 | 2009-10-26T18:00:00.000 | 22 | 0.009091 | false | 1,626,326 | 0 | 0 | 1 | 4 | What is the recommended way of handling settings for local development and the production server? Some of them (like constants, etc) can be changed/accessed in both, but some of them (like paths to static files) need to remain different, and hence should not be overwritten every time the new code is deployed.
Currently... |
How to manage local vs production settings in Django? | 9,517,763 | 6 | 339 | 119,151 | 0 | python,django,deployment | The problem with most of these solutions is that you either have your local settings applied before the common ones, or after them.
So it's impossible to override things like
the env-specific settings define the addresses for the memcached pool, and in the main settings file this value is used to configure the cache b... | 0 | 0 | 0 | 0 | 2009-10-26T18:00:00.000 | 22 | 1 | false | 1,626,326 | 0 | 0 | 1 | 4 | What is the recommended way of handling settings for local development and the production server? Some of them (like constants, etc) can be changed/accessed in both, but some of them (like paths to static files) need to remain different, and hence should not be overwritten every time the new code is deployed.
Currently... |
Is it possible access other webpages from within another page | 1,628,598 | 1 | 1 | 213 | 0 | javascript,jquery,python | There are two general approaches:
Modify your Python code so that it runs as a CGI (or WSGI or whatever) module and generate the page of interest by running some server side code.
Use Javascript with jQuery to load the content of interest by running some client side code.
The difference between these two approaches i... | 0 | 0 | 1 | 0 | 2009-10-27T03:07:00.000 | 3 | 0.066568 | false | 1,628,564 | 0 | 0 | 1 | 1 | Basically, what I'm trying to do is simply make a small script that accesses finds the most recent post in a forum and pulls some text or an image out of it. I have this working in python, using the htmllib module and some regex. But, the script still isn't very convenient as is, it would be much nicer if I could som... |
Python Package For Multi-Threaded Spider w/ Proxy Support? | 5,803,567 | 1 | 1 | 9,003 | 0 | python,proxy,multithreading,web-crawler,pool | usually proxies filter websites categorically based on how the website was created. It is difficult to transmit data through proxies based on categories. Eg youtube is classified as audio/video streams therefore youtube is blocked in some places espically schools.
If you want to bypass proxies and get the data off a we... | 0 | 0 | 1 | 0 | 2009-10-27T04:23:00.000 | 2 | 0.099668 | false | 1,628,766 | 0 | 0 | 1 | 1 | Instead of just using urllib does anyone know of the most efficient package for fast, multithreaded downloading of URLs that can operate through http proxies? I know of a few such as Twisted, Scrapy, libcurl etc. but I don't know enough about them to make a decision or even if they can use proxies.. Anyone know of the ... |
Are there any known issues with django and multithreading? | 1,629,913 | 2 | 1 | 1,383 | 0 | python,django,multithreading | Generally, your Django app already is multi-threaded. That's the way most of the standard Django servers operate -- they can tolerate multiple WSGI threads sending requests to them.
Further, you'll almost always have Django running under Apache, which is also multi-threaded.
If you use mod_wsgi, then Django may be par... | 0 | 0 | 0 | 0 | 2009-10-27T10:08:00.000 | 3 | 0.132549 | false | 1,629,800 | 0 | 0 | 1 | 1 | I need to develop an app that runs side by side with a django-app.
This will be the first time i develop a multithreaded app that runs next to a django-app so are there any 'gotchas' and 'traps' i should be aware of? |
Django Zip upload permission problem | 1,631,366 | 0 | 0 | 677 | 0 | python,django,zip | it works with ZipFile.extractall | 0 | 0 | 0 | 0 | 2009-10-27T12:19:00.000 | 2 | 1.2 | true | 1,630,427 | 0 | 0 | 1 | 1 | I have few uploads in this app, uploading csv files is working fine.
I have a model that has zip upload in it. Zip file is uploaded, can be viewed, but having issues extracting it.
class Message(models.Model):
uploadFile = models.FileField(_('images file (.zip)'),
upload_to='mes... |
How do we override the choice field display of a reference property in appengine using Django? | 1,636,697 | 1 | 1 | 289 | 0 | python,django,google-app-engine,referenceproperty | I got it to work by overriding the init method of the modelform to pick up the correct fields as I had to do filtering of the choices as well. | 0 | 0 | 0 | 0 | 2009-10-28T07:25:00.000 | 2 | 0.099668 | false | 1,635,638 | 0 | 0 | 1 | 1 | The default choice field display of a reference property in appengine returns the choices
as the string representation of the entire object. What is the best method to override this behaviour? I tried to override str() in the referenced class. But it does not work. |
django generic templates | 1,639,340 | 1 | 3 | 1,334 | 0 | python,django,frameworks,templating | I don't see you getting away from writing templates, especially if you would want to format it, even slightly.
However you can re-use basic templates, for e.g, create a generic object_list.html and object_detail.html
that will basically contain the information to loop over the object list and present it, and show the o... | 0 | 0 | 0 | 0 | 2009-10-28T17:40:00.000 | 2 | 0.099668 | false | 1,638,870 | 0 | 0 | 1 | 1 | So, Generic views are pretty cool, but what I'm interested in is something that's a generic template.
so for example, I can give it an object and it'll just tostring it for me.
or if I give it a list, it'll just iterate over the objects and tostring them as a ul (or tr, or whatever else it deems necessary).
for most us... |
Android: Java v. Python | 1,641,125 | 11 | 10 | 4,643 | 0 | java,python,android | Java is "more native" on the Android platform; Python is coming after and striving to get parity but not quite there yet AFAIK. Roughly the reverse situation wrt App Engine, where Python's been around for a year longer than Java and so is still more mature and complete (even though Java's catching up).
So, in any situ... | 0 | 0 | 0 | 1 | 2009-10-28T23:30:00.000 | 3 | 1.2 | true | 1,640,806 | 0 | 0 | 1 | 2 | Is there any reason to favor Python or Java over the other for developing on Android phones, other than the usual Python v. Java issues? |
Android: Java v. Python | 1,641,263 | 2 | 10 | 4,643 | 0 | java,python,android | On the mobile platform performance and memory usage are much more critical than desktop or server. The JVM that runs on Android is highly optimized for the mobile platform. Based on the links I have seen about Python on Android none of them seem to have an optimized VM for mobile platform. | 0 | 0 | 0 | 1 | 2009-10-28T23:30:00.000 | 3 | 0.132549 | false | 1,640,806 | 0 | 0 | 1 | 2 | Is there any reason to favor Python or Java over the other for developing on Android phones, other than the usual Python v. Java issues? |
Close all opened xml tags | 1,652,871 | 0 | 5 | 1,809 | 0 | python,xml | You could use BeautifulStoneSoup (XML part of BeautifulSoup).
www.crummy.com/software/BeautifulSoup
It's not ideal, but it would circumvent the problem if you cannot fix the file's output...
It's basically a previously implemented version of what Denis said.
You can just join whatever you need into the soup and it will... | 0 | 0 | 1 | 0 | 2009-10-29T16:36:00.000 | 4 | 0 | false | 1,644,994 | 0 | 0 | 1 | 2 | I have a file, which change it content in a short time. But I'd like to read it before it is ready. The problem is, that it is an xml-file (log). So when you read it, it could be, that not all tags are closed.
I would like to know if there is a possibility to close all opened tags correctly, that there are no problems ... |
Close all opened xml tags | 1,645,047 | 0 | 5 | 1,809 | 0 | python,xml | You can use any SAX parser by feeding data available so far to it. Use SAX handler that just reconstructs source XML, keep the stack of tags opened and close them in reverse order at the end. | 0 | 0 | 1 | 0 | 2009-10-29T16:36:00.000 | 4 | 0 | false | 1,644,994 | 0 | 0 | 1 | 2 | I have a file, which change it content in a short time. But I'd like to read it before it is ready. The problem is, that it is an xml-file (log). So when you read it, it could be, that not all tags are closed.
I would like to know if there is a possibility to close all opened tags correctly, that there are no problems ... |
Concurrency control in Django model | 4,679,345 | 13 | 23 | 16,575 | 0 | python,django,django-models,concurrency | I don't think that 'keeping a version number or timestamp' works.
When self.version == self.read_current_version() is True, there is still a chance that the version number got modified by other sessions just before you call super().save(). | 0 | 0 | 0 | 0 | 2009-10-29T17:19:00.000 | 3 | 1 | false | 1,645,269 | 0 | 0 | 1 | 1 | How do I handle concurrency in a Django model? I don't want the changes to the record being overwritten by another user who reads the same record. |
Django db reset without loading fixtures | 1,645,519 | 2 | 1 | 1,667 | 1 | python,database,django,fixtures | As far as I know, the fixtures (in initial_data file) are automatically loaded after manage.py syndcb and not after reset. So, if you do a manage.py reset yourapp it should not load the fixtures. Hmm? | 0 | 0 | 0 | 0 | 2009-10-29T17:26:00.000 | 2 | 1.2 | true | 1,645,310 | 0 | 0 | 1 | 1 | Is there an easy way to reset a django database (i.e. drop all data/tables, create new tables and create indexes) without loading fixture data afterwords? What I want to have is just an empty database because all data is loaded from another source (a kind of a post-processed backup).
I know that this could be achieved... |
mod_python django logging problem | 1,648,183 | 2 | 1 | 556 | 0 | python,django,logging | RotatingFileHandler is not designed to work in multiprocess system. Each process you have notice that file is too large and starts new log, so you get up to 5 new logs. It's not as easy to implement it properly: you have to obtain interprocess lock before creating new file and inform each process to reopen it. You'd be... | 0 | 1 | 0 | 0 | 2009-10-30T04:10:00.000 | 1 | 1.2 | true | 1,647,974 | 0 | 0 | 1 | 1 | I use logging settings as below in the settings.py file:
logging.basicConfig(level=LOG_LEVEL, format=LOG_FORMAT);
handler = logging.handlers.RotatingFileHandler( LOG_FILE_PATH, 'a', LOG_FILE_SIZE,LOG_FILE_NUM );
formatter = logging.Formatter ( LOG_FORMAT );
handler.setFormatter(formatter);
logging.getLogger().addHandl... |
How do I automatically rebuild the Sphinx index under django-sphinx? | 2,657,021 | 0 | 2 | 2,816 | 0 | python,django,search,sphinx,django-sphinx | The above sounds right to me, though I'll mention that you could call the indexer from your save function for the object.
It'd probably get called a LOT, but it could work. Just call it as you would any external command. | 0 | 0 | 0 | 0 | 2009-10-31T01:18:00.000 | 2 | 0 | false | 1,653,071 | 0 | 0 | 1 | 1 | I just setup django-sphinx, and it is working beautifully. I am now able to search my model and get amazing results. The one problem is that I have to build the index by hand using the indexer command. That means every time I add new content, I have to manually hit the command line to rebuild the search index. That is ... |
Python deprecated functions | 1,653,756 | 0 | 3 | 4,339 | 0 | python,python-2.6 | I think Python 2.5 apps should work fine in 2.6 without updates. 2.6 might complain about some deprecated functionality but those are only removed in 3.0 and still work in 2.6. | 0 | 0 | 0 | 0 | 2009-10-31T07:55:00.000 | 5 | 0 | false | 1,653,734 | 1 | 0 | 1 | 3 | I have a Django app written in Python 2.5 and I plan to upgrade it to be compatible with Python 2.6. It contains hundreds of .py files. Is there a simple way to find all deprecated functions in those files? |
Python deprecated functions | 1,653,810 | 5 | 3 | 4,339 | 0 | python,python-2.6 | Between point releases of Python (like between 2.5 and 2.6) anything that might break is a warning for at least one release. Most deprecation warnings are emitted by default but you have fine-grained control over the emitted warnings with the -W interpreter invocation option.
This is a relatively small issue between po... | 0 | 0 | 0 | 0 | 2009-10-31T07:55:00.000 | 5 | 0.197375 | false | 1,653,734 | 1 | 0 | 1 | 3 | I have a Django app written in Python 2.5 and I plan to upgrade it to be compatible with Python 2.6. It contains hundreds of .py files. Is there a simple way to find all deprecated functions in those files? |
Python deprecated functions | 8,189,947 | 0 | 3 | 4,339 | 0 | python,python-2.6 | More and more I am persuaded that the right answer is "Just run your testsuite to find out." You have your testsuite covering your program reasonably, right? If not, this is a great opportunity to create one (you can persuade your point-headed boss that it is "migration" ;)). | 0 | 0 | 0 | 0 | 2009-10-31T07:55:00.000 | 5 | 0 | false | 1,653,734 | 1 | 0 | 1 | 3 | I have a Django app written in Python 2.5 and I plan to upgrade it to be compatible with Python 2.6. It contains hundreds of .py files. Is there a simple way to find all deprecated functions in those files? |
erlang on google app engine? | 1,654,786 | 11 | 2 | 1,713 | 0 | python,google-app-engine,erlang | Erlang and Python are programming languages, and each language has one or more "runtimes" that allow you to run programs written in those languages. GAE supplies a Python runtime.
GAE has no support for Erlang programs. | 0 | 1 | 0 | 0 | 2009-10-31T15:48:00.000 | 1 | 1.2 | true | 1,654,759 | 0 | 0 | 1 | 1 | I know python can be run on GAE
what is different erlang and python in lay man term?
can erlang run on google app engine ? |
PyQt and MVC-pattern | 1,692,893 | 9 | 35 | 29,014 | 0 | python,qt,pyqt | Yes, PyQt uses Model/View concept (officially without the "Controller" part), but may be you have a somewhat distorted picture what does it mean in PyQt.
There are two parts:
Models, subclassed from appropriate PyQt base abstract model classes (QAbstractItemModel, QAbstractTableModel, QAbstractListModel, etc.). These ... | 1 | 0 | 0 | 0 | 2009-11-02T10:27:00.000 | 3 | 1 | false | 1,660,474 | 0 | 0 | 1 | 1 | I am trying to design an MVC-pattern with PyQt.
I want to split all programs into 3 parts:
classes abstracted from all Qt classes (model)
classes providing data from the model to a Qt app (controller)
the Qt app itself with defined method SignalsToSlots that connects signals with controller.
Is this optimally? What s... |
Can I add Runtime Properties to a Python App Engine App? | 1,674,790 | 1 | 0 | 158 | 0 | python,google-app-engine,properties,runtime | You can:
edit records in the datastore through the dashboard ( if you really have to )
upload new scripts / files ( you can access files in READ-ONLY )
export a WEB Service API to configuration records in the datastore ( probably not what you had in mind )
access a page somewhere through an HTTP end-point | 0 | 1 | 0 | 0 | 2009-11-04T15:58:00.000 | 2 | 1.2 | true | 1,674,764 | 0 | 0 | 1 | 1 | Coming from a java background I'm used to having a bunch of properties files I can swap round at runtime dependent on what server I'm running on e.g. dev/production.
Is there a method in python to do similar, specifically on Google's App Engine framework?
At the minute I have them defined in .py files, obviously I'd li... |
wxPython: How should I organize per-widget data in the controller? | 1,738,316 | 2 | 4 | 519 | 0 | python,model-view-controller,user-interface | The anomaly (from the MVC viewpoint) that makes this design difficult to make MVC-conformant is that you want to display information that, by your conceptualization, "does not live in a model". There is no such thing as "information that does not live in a model" in MVC: its conceptual root is "the models hold all the... | 1 | 0 | 0 | 0 | 2009-11-06T08:37:00.000 | 3 | 1.2 | true | 1,686,235 | 0 | 0 | 1 | 1 | I have a widget that displays a filesystem hierarchy for convenient browsing (basically a tree control and some associated toolbar buttons, such as "refresh"). Each of these widgets has a set of base directories for it to display (recursively). Assume that the user may instantiate as many of these widgets as they find ... |
Overhead of a Round-trip to MySql? | 1,689,143 | 1 | 3 | 1,620 | 1 | python,mysql,django,overhead | There is always overhead in database calls, in your case the overhead is not that bad because the application and database are on the same machine so there is no network latency but there is still a significant cost.
When you make a request to the database it has to prepare to service that request by doing a number of ... | 0 | 0 | 0 | 0 | 2009-11-06T17:18:00.000 | 4 | 0.049958 | false | 1,689,031 | 0 | 0 | 1 | 4 | So I've been building django applications for a while now, and drinking the cool-aid and all: only using the ORM and never writing custom SQL.
The main page of the site (the primary interface where users will spend 80% - 90% of their time) was getting slow once you have a large amount of user specific content (ie photo... |
Overhead of a Round-trip to MySql? | 1,689,146 | 3 | 3 | 1,620 | 1 | python,mysql,django,overhead | The overhead of each queries is only part of the picture. The actual round trip time between your Django and Mysql servers is probably very small since most of your queries are coming back in less than a one millisecond. The bigger problem is that the number of queries issued to your database can quickly overwhelm it.... | 0 | 0 | 0 | 0 | 2009-11-06T17:18:00.000 | 4 | 0.148885 | false | 1,689,031 | 0 | 0 | 1 | 4 | So I've been building django applications for a while now, and drinking the cool-aid and all: only using the ORM and never writing custom SQL.
The main page of the site (the primary interface where users will spend 80% - 90% of their time) was getting slow once you have a large amount of user specific content (ie photo... |
Overhead of a Round-trip to MySql? | 1,689,452 | 4 | 3 | 1,620 | 1 | python,mysql,django,overhead | Just because you are using an ORM doesn't mean that you shouldn't do performance tuning.
I had - like you - a home page of one of my applications that had low performance. I saw that I was doing hundreds of queries to display that page. I went looking at my code and realized that with some careful use of select_relate... | 0 | 0 | 0 | 0 | 2009-11-06T17:18:00.000 | 4 | 0.197375 | false | 1,689,031 | 0 | 0 | 1 | 4 | So I've been building django applications for a while now, and drinking the cool-aid and all: only using the ORM and never writing custom SQL.
The main page of the site (the primary interface where users will spend 80% - 90% of their time) was getting slow once you have a large amount of user specific content (ie photo... |
Overhead of a Round-trip to MySql? | 1,689,330 | 2 | 3 | 1,620 | 1 | python,mysql,django,overhead | There are some ways to reduce the query volume.
Use .filter() and .all() to get a bunch of things; pick and choose in the view function (or template via {%if%}). Python can process a batch of rows faster than MySQL.
"But I could send too much to the template". True, but you'll execute fewer SQL requests. Measure... | 0 | 0 | 0 | 0 | 2009-11-06T17:18:00.000 | 4 | 1.2 | true | 1,689,031 | 0 | 0 | 1 | 4 | So I've been building django applications for a while now, and drinking the cool-aid and all: only using the ORM and never writing custom SQL.
The main page of the site (the primary interface where users will spend 80% - 90% of their time) was getting slow once you have a large amount of user specific content (ie photo... |
How do I upload data to Google App Engine periodically? | 1,690,155 | 0 | 0 | 400 | 0 | python,security,google-app-engine,automation | Can you break up the scraping process into independent chunks that can each finish in the timeframe of an appengine request? (which can run longer than one second btw). Then you can just spawn a bunch of tasks using the task API that when combined, accomplish the full scrape. Then use the cron API to spawn off those ... | 0 | 1 | 0 | 0 | 2009-11-06T18:56:00.000 | 5 | 0 | false | 1,689,570 | 0 | 0 | 1 | 4 | I'm writing an aggregation application which scrapes data from a couple of web sources and displays that data with a novel interface. The sites from which I'm scraping update every couple of minutes, and I want to make sure the data on my aggregator is up-to-date.
What's the best way to periodically submit fresh data t... |
How do I upload data to Google App Engine periodically? | 1,690,150 | 3 | 0 | 400 | 0 | python,security,google-app-engine,automation | Write a Task Queue task or an App Engine cron job to handle this. I'm not sure where you heard that there's a limit of 1 second on any sort of App Engine operations - requests are limited to 30 seconds, and URL fetches have a maximum deadline of 10 seconds. | 0 | 1 | 0 | 0 | 2009-11-06T18:56:00.000 | 5 | 1.2 | true | 1,689,570 | 0 | 0 | 1 | 4 | I'm writing an aggregation application which scrapes data from a couple of web sources and displays that data with a novel interface. The sites from which I'm scraping update every couple of minutes, and I want to make sure the data on my aggregator is up-to-date.
What's the best way to periodically submit fresh data t... |
How do I upload data to Google App Engine periodically? | 1,689,805 | 0 | 0 | 400 | 0 | python,security,google-app-engine,automation | The only way to get data into AppEngine is to call up a Web app of yours (as a Web app) and feed it data through the usual HTTP-ish means, i.e. as parameters to a GET request (for short data) or to a POST (if long or binary).
In other words, you'll have to craft your own little dataloader, which you will access as a We... | 0 | 1 | 0 | 0 | 2009-11-06T18:56:00.000 | 5 | 0 | false | 1,689,570 | 0 | 0 | 1 | 4 | I'm writing an aggregation application which scrapes data from a couple of web sources and displays that data with a novel interface. The sites from which I'm scraping update every couple of minutes, and I want to make sure the data on my aggregator is up-to-date.
What's the best way to periodically submit fresh data t... |
How do I upload data to Google App Engine periodically? | 1,693,701 | 0 | 0 | 400 | 0 | python,security,google-app-engine,automation | I asked around and some friends came up with two solutions:
Upload a file with a shared secret token along with the application, but when committing to the codebase, change the token.
Create a small datastore model with one row, a secret token.
In both cases the token can be used to authenticate POST requests used to... | 0 | 1 | 0 | 0 | 2009-11-06T18:56:00.000 | 5 | 0 | false | 1,689,570 | 0 | 0 | 1 | 4 | I'm writing an aggregation application which scrapes data from a couple of web sources and displays that data with a novel interface. The sites from which I'm scraping update every couple of minutes, and I want to make sure the data on my aggregator is up-to-date.
What's the best way to periodically submit fresh data t... |
How to implement Symfony Partials or Components in Django? | 1,691,549 | 1 | 1 | 715 | 0 | python,django,symfony1 | Assuming you are going to be using the components in different places on different pages I would suggest trying {% include "foo.html" %}. One of the (several) downsides of the Django templating language is that there is no concept of macros, so you need to be very consistent in the names of values in the context you pa... | 0 | 0 | 0 | 0 | 2009-11-07T00:21:00.000 | 2 | 0.099668 | false | 1,691,400 | 0 | 0 | 1 | 1 | I've been developing in the Symfony framework for quite a time, but now I have to work with Django and I'm having problems with doing something like a "component" or "partial" in Symfony.
That said, here is my goal:
I have a webpage with lots of small widgets, all these need their logic - located in a "views.py" I gue... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.