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
X-Sendfile and VERY big files on Apache2
1,693,668
1
3
1,086
0
python,apache2,wsgi,x-sendfile
I have discovered the answer. Use the BETA version provided. It seems to fix this issue.
0
0
0
0
2009-11-07T16:24:00.000
2
0.099668
false
1,693,564
0
0
1
1
Any filesize over about 4GB is not going to work with the mod_xsendfile for Apache2 (as it sets the content length to a long). I am willing to rewrite it to support this; however, I can find no documentation on how to set content length from the apache api to something larger than a long and thus serve large files thro...
Move or copy an entity to another kind
1,693,856
1
0
162
0
python,google-app-engine,indexing,archive,bigtable
Unless someone's written utilities for this kind of thing, the way to go is to read from one and write to the other kind!
0
1
0
0
2009-11-07T17:39:00.000
2
0.099668
false
1,693,815
0
0
1
2
Is there a way to move an entity to another kind in appengine. Say you have a kind defines, and you want to keep a record of deleted entities of that kind. But you want to separate the storage of live object and archived objects. Kinds are basically just serialized dicts in the bigtable anyway. And maybe you don't need...
Move or copy an entity to another kind
1,693,979
1
0
162
0
python,google-app-engine,indexing,archive,bigtable
No - once created, the kind is a part of the entity's immutable key. You need to create a new entity and copy everything across. One way to do this would be to use the low-level google.appengine.api.datastore interface, which treats entities as dicts.
0
1
0
0
2009-11-07T17:39:00.000
2
1.2
true
1,693,815
0
0
1
2
Is there a way to move an entity to another kind in appengine. Say you have a kind defines, and you want to keep a record of deleted entities of that kind. But you want to separate the storage of live object and archived objects. Kinds are basically just serialized dicts in the bigtable anyway. And maybe you don't need...
Django/SQL: keeping track of who who read what in a forum
1,697,224
1
2
354
0
python,sql,django,database-design,database
You might also simply store the last time a user was reading a particular forum. Any posts that have been updated since that date are new. You'll only be storing one additional piece of information per user as opposed to a piece of information per post per user.
0
0
0
0
2009-11-08T16:24:00.000
2
1.2
true
1,697,045
0
0
1
2
I'm working on a not-so-big project in django that will among other things incorporate a forum system. I have most of the system at a more or less functioning state, but I'm still missing a feature to mark unread threads for the users when there are new posts. The thing is I can't really think of a way to properly stor...
Django/SQL: keeping track of who who read what in a forum
1,697,061
2
2
354
0
python,sql,django,database-design,database
You're much better off storing the "read" bit, not the "unread" bit. And you can store them not as relational data, but in a giant bit-blob. Then you don't have to modify the read data at all when new posts are added, only when a user reads posts.
0
0
0
0
2009-11-08T16:24:00.000
2
0.197375
false
1,697,045
0
0
1
2
I'm working on a not-so-big project in django that will among other things incorporate a forum system. I have most of the system at a more or less functioning state, but I'm still missing a feature to mark unread threads for the users when there are new posts. The thing is I can't really think of a way to properly stor...
win32com and PAMIE web page open timeout
1,698,371
0
0
294
0
python,time,multithreading,pamie
I think what you are looking for is somewhere to set the timeout on your request. I would suggest looking into the documentation on PAMIE.
0
0
1
1
2009-11-08T23:40:00.000
2
0
false
1,698,362
0
0
1
2
currently im making some crawler script,one of problem is sometimes if i open webpage with PAMIE,webpage can't open and hang forever. are there any method to close PAMIE's IE or win32com's IE ? such like if webpage didn't response or loading complete less than 10sec or so . thanks in advance
win32com and PAMIE web page open timeout
1,698,422
2
0
294
0
python,time,multithreading,pamie
Just use, to initialize your PAMIE instance, PAMIE(timeOut=100) or whatever. The units of measure for timeOut are "tenths of a second" (!); the default is 3000 (300 seconds, i.e., 5 minutes); with 300 as I suggested, you'd time out after 10 seconds as you request. (You can pass the timeOut= parameter even when you're ...
0
0
1
1
2009-11-08T23:40:00.000
2
1.2
true
1,698,362
0
0
1
2
currently im making some crawler script,one of problem is sometimes if i open webpage with PAMIE,webpage can't open and hang forever. are there any method to close PAMIE's IE or win32com's IE ? such like if webpage didn't response or loading complete less than 10sec or so . thanks in advance
Environment on google Appengine
1,701,239
3
0
461
0
python,google-app-engine
To answer the actual question from the title of your post, assuming you're still wondering: to get environment variables, simple import os and the environment is available in os.environ.
0
1
0
0
2009-11-09T11:24:00.000
3
0.197375
false
1,700,441
0
0
1
1
does someone have an idea how to get the environment variables on Google-AppEngine ? I'm trying to write a simple Script that shall use the Client-IP (for Authentication) and a parameter (geturl or so) from the URL (for e.g. http://thingy.appspot.dom/index?geturl=www.google.at) I red that i should be able to get the C...
Is there an analogue to Java IllegalStateException in Python?
1,701,327
43
67
12,359
0
java,python,exception
In Python, that would be ValueError, or a subclass of it. For example, trying to .read() a closed file raises "ValueError: I/O operation on closed file".
0
0
0
0
2009-11-09T14:12:00.000
3
1.2
true
1,701,199
1
0
1
1
IllegalStateException is often used in Java when a method is invoked on an object in inappropriate state. What would you use instead in Python?
How can I make WSGI(Python) stateful?
1,718,144
2
1
1,364
0
python,wsgi
I prefer working directly on wsgi, along with mako and psycopg. It's good to know about Beaker, though I usually don't hold state in the server because I believe it reduces scalability. I either put it in the user's cookie, in the database tied to a token in the user's cookie, or in a redirect url.
0
0
0
0
2009-11-09T20:11:00.000
3
0.132549
false
1,703,440
0
0
1
3
I'm quite new in Python world. I come from java and ABAP world, where their application server are able to handle stateful request. Is it also possible in python using WSGI? Or stateful and stateless are handled in other layer?
How can I make WSGI(Python) stateful?
1,703,477
1
1
1,364
0
python,wsgi
Your question is a little vague and open-ended. First of all, WSGI itself isn't a framework, it's just the glue to connect a framework to the web server. Secondly, I'm not clear on what you mean when you say "state" -- do you mean storing information about a client on the server? If so, web frameworks (Pylons, Django, ...
0
0
0
0
2009-11-09T20:11:00.000
3
0.066568
false
1,703,440
0
0
1
3
I'm quite new in Python world. I come from java and ABAP world, where their application server are able to handle stateful request. Is it also possible in python using WSGI? Or stateful and stateless are handled in other layer?
How can I make WSGI(Python) stateful?
1,703,470
5
1
1,364
0
python,wsgi
Usually, you don't work with "bare" WSGI. You work with web-frameworks, such as Pylons or TurboGears2. And these contain a session-middleware, based on WSGI - called "Beaker". But if you work with the framework, you don't have to worry about that - you just use it. But if you insist, you can of course use Beaker standa...
0
0
0
0
2009-11-09T20:11:00.000
3
0.321513
false
1,703,440
0
0
1
3
I'm quite new in Python world. I come from java and ABAP world, where their application server are able to handle stateful request. Is it also possible in python using WSGI? Or stateful and stateless are handled in other layer?
Python Form Processing alternatives
1,705,231
1
3
1,382
0
python,google-app-engine,forms
Is there a more specific reason you don't want to use django.forms? I've quite successfully used bits and pieces of django all by themselves without trouble in several projects. As an aside, there are several patches that make django sortof work in app-engine, though I assume you've considered and discarded them.
0
0
0
0
2009-11-10T02:02:00.000
4
0.049958
false
1,705,217
0
0
1
1
django.forms is very nice, and does almost exactly what I want to do on my current project, but unfortunately, Google App Engine makes most of the rest of Django unusable, and so packing it along with the app seems kind of silly. I've also discovered FormAlchemy, which is an SQLAlchemy analog to Django forms, and I i...
Understanding Zope internals, from Django eyes
1,707,165
3
8
3,052
0
python,django,zope,zodb,acquisition
ZODB is a OO-style database that doesn't need a schema definition. You can simply create (nearly) all kinds of objects, and persist them. The TTW is sometimes annoying, but you can mount the ZOPE-object-tree using webdav. Then you can edit the templates and scripts using your favorite editor. ZOPE is especially powerfu...
0
0
0
0
2009-11-10T08:05:00.000
6
0.099668
false
1,706,309
0
0
1
1
I am a newbie to zope and I previously worked on Django for about 2.5 years. So when I first jumped into Zope(v2) (only because my new company is using it since 7 years), I faced these questions. Please help me in understanding them. What is the "real" purpose of zodb as such? I know what it does, but tell me one grea...
IronPython asp.net IntelliSense
1,728,528
0
1
198
0
asp.net,visual-studio,visual-studio-2008,ironpython
I had to uninstall IronPython and install ASP.NET future releases to solve it
0
0
0
0
2009-11-10T11:46:00.000
2
0
false
1,707,390
1
0
1
1
I'm trying IronPython for asp.net, I got a simple CRUD screen to work. I've read IntelliSense doesnt work for IronPython, but is there any way to get rid of Visual Studio underlining all the lines' starting tokens with blue and a message of "expected declaration"?
getting started with django-cms: error on page_submit_row
1,709,285
0
1
462
0
python,django,django-cms
You may need to {% load %} the template tag library at the top of your file.
0
0
0
0
2009-11-10T16:22:00.000
2
0
false
1,709,201
0
0
1
2
I am getting started with django-cms and I am facing an exception when I try to edit a page in the admin inteface. A TemplateSyntaxError exception is raised due to the {% page_submit_row %} templatetag. TemplateSyntaxError at /admin/cms/page/1/ Caught an exception while rendering: admin/page_submit_line.html Reques...
getting started with django-cms: error on page_submit_row
1,709,611
0
1
462
0
python,django,django-cms
It seems that the problem comes from the django-cms installer. It was with RC2 and RC3 is out now. Moreover, It is recommended to use easy_install for the installation easy_instaling RC3 fixed the problem Best
0
0
0
0
2009-11-10T16:22:00.000
2
1.2
true
1,709,201
0
0
1
2
I am getting started with django-cms and I am facing an exception when I try to edit a page in the admin inteface. A TemplateSyntaxError exception is raised due to the {% page_submit_row %} templatetag. TemplateSyntaxError at /admin/cms/page/1/ Caught an exception while rendering: admin/page_submit_line.html Reques...
What Jabber/XMPP libraries are available for PyS60 (Python for Symbian S60) interpreter?
1,716,884
0
2
912
0
python,symbian,xmpp,pys60
It's fairly easy to add native extensions to Python and there are lots of C/C++ libraries for XMPP that would port easily. The previous pyexpat module is just bindings for native expat on Symbian, which is ported to S60 3rd Edition, so you should be able to get pyexpat working too. Of course you need some ability with...
0
0
0
0
2009-11-11T03:11:00.000
1
1.2
true
1,712,768
0
0
1
1
I'm interested in developing a XMPP client on the mobile S60 Symbian platform using the Python interpreter PyS60. I've done a search on Google for possible libraries, but turned up empty. I'm hoping that by asking this on SO, I can get a definite answer on whether there is actually an existing library that I just hadn...
Pylons deployment questions
1,712,913
2
0
450
0
python,apache,deployment,apache2,pylons
mod_wsgi. It's more efficient. FastCGI can be troublesome to setup, whereas I've never known anyone to have a problem using mod_wsgi with a supported version of Python (2.5, 2.6, 3.1 included). WSGI exists for Python (by Python, &c.) and so it makes for a more "Pythonic" experience. Prior to WSGI I used to serve sm...
0
0
0
1
2009-11-11T03:50:00.000
1
1.2
true
1,712,883
0
0
1
1
I'm a beginner with Pylons and I've mostly developed on my localhost using the built-in web server. I think it's time to start deployment for my personal blog, I have a Debian Lenny server with apache2-mpm-prefork module and mod_wsgi - I've never really used mod_wsgi or fastcgi and I hear either of these are the way to...
Is there any library to deserialize with python which is serialized with java
1,714,644
6
13
8,371
0
java,python,serialization
Java binary serialization is really designed to be used with Java. To do it in Python you'd have to have all the relevant Java classes available for inspection, and create Python objects appropriately - it would be pretty hideous and fragile. You're better off using a cross-platform serialization format such as Thrift,...
0
0
1
0
2009-11-11T11:33:00.000
7
1
false
1,714,624
0
0
1
2
Is there any library to deserialize with python which is serialized with java?
Is there any library to deserialize with python which is serialized with java
1,714,862
0
13
8,371
0
java,python,serialization
If you are using Java classes, then I don't even know what it would mean to deserialize a Java class in a Python environment. If you are only using simple primitives (ints, floats, strings), then it probably wouldn't be too hard to build a Python library that could deserialize the Java format. But as others have said,...
0
0
1
0
2009-11-11T11:33:00.000
7
0
false
1,714,624
0
0
1
2
Is there any library to deserialize with python which is serialized with java?
Django Form Wizard and Preview with ModelForm
2,152,059
1
9
2,727
0
python,django,forms,wizard,preview
I do a similar thing at my first Django project. Using session-based FormWizard, I customized it so user can stop subbmiting data at any form. At that point you can use FormPreview probably to show information or just dynamically generate form and show it to user. Data stays in the session.
0
0
0
0
2009-11-11T16:15:00.000
2
0.099668
false
1,716,247
0
0
1
1
I have a large Django model (73 fields) that will will be connected to a ModelForm. I'd like to use a combination of the functionality found the Form Wizard and Form Preview contrib apps. I.e., the form fields would be split over multiple pages, and the user would have a chance to review/preview the data before the mo...
"CSRF verification failed" when attempting to upload a file or create a folder with filebrowser for Django
1,718,362
6
10
16,007
0
python,django,upload,file-upload
You are probably using the development version of Django, which includes quite a lot of extra CRSF security. However it's not released yet so external products probably aren't compatible. You should use the 1.1 version of Django instead.
0
0
0
0
2009-11-11T21:56:00.000
5
1.2
true
1,718,343
0
0
1
2
I have installed filebrowser for Django (not filebrowser3) and when I try to upload a file I recieve the following error: 403 Forbidden CSRF verification failed. Request aborted. More information is available with DEBUG=True. The same error occurs when I try to create a new folder which shows that the problem is ...
"CSRF verification failed" when attempting to upload a file or create a folder with filebrowser for Django
4,137,086
4
10
16,007
0
python,django,upload,file-upload
Add to you settings.py this 2 lines: ‘django.middleware.csrf.CsrfViewMiddleware’, ‘django.middleware.csrf.CsrfResponseMiddleware’,
0
0
0
0
2009-11-11T21:56:00.000
5
0.158649
false
1,718,343
0
0
1
2
I have installed filebrowser for Django (not filebrowser3) and when I try to upload a file I recieve the following error: 403 Forbidden CSRF verification failed. Request aborted. More information is available with DEBUG=True. The same error occurs when I try to create a new folder which shows that the problem is ...
Render page initially and update via AJAX using the same template HTML
1,718,808
3
10
2,693
0
javascript,python,ajax,django
I think option 2 is best. It's incremental (only renders one more comment when a comment is added), and re-uses the rendering. If you don't like returning just HTML from an Ajax request, then have the response be a JSON structure which includes the HTML as just one component. Then you can also carry status (or whate...
0
0
0
0
2009-11-11T23:18:00.000
3
1.2
true
1,718,784
0
0
1
2
Let's say you have a view called "View Story" which is just a web page rendered on the backend via Python/Django. On that page there's a list of comments at the bottom rendered as part of the "View Story" template using Django's templating system (in a loop). This page also allows you to add a comment to the list. T...
Render page initially and update via AJAX using the same template HTML
3,067,371
1
10
2,693
0
javascript,python,ajax,django
There is also option 4: Copy an existing element in the list and change its values. This is of course less flexible than templates. You can copy a hidden element instead to handle the case where the list is empty. You could also try option 2b: Generate the HTML on the server like option 2, but instead of directly acce...
0
0
0
0
2009-11-11T23:18:00.000
3
0.066568
false
1,718,784
0
0
1
2
Let's say you have a view called "View Story" which is just a web page rendered on the backend via Python/Django. On that page there's a list of comments at the bottom rendered as part of the "View Story" template using Django's templating system (in a loop). This page also allows you to add a comment to the list. T...
Python website convert into Adobe Dreamweaver CS3
1,719,141
1
0
458
0
python,dreamweaver
Assuming that any functionality needs to remain intact… no.
0
0
0
0
2009-11-12T00:44:00.000
3
0.066568
false
1,719,127
1
0
1
3
I am comfortable in Adobe Dreamweaver CS3. Is there a way to convert a website written in the Python language into Dreamweaver for those who aren't familiar with writing in code?
Python website convert into Adobe Dreamweaver CS3
1,719,178
0
0
458
0
python,dreamweaver
Well, you can simply copy the HTML that Python generates to make a static copy of the website, but you'll lose any interactivity. In other words, you won't be able to use the website's administrative panel to modify anything. It will let you modify the style of the website, however.
0
0
0
0
2009-11-12T00:44:00.000
3
0
false
1,719,127
1
0
1
3
I am comfortable in Adobe Dreamweaver CS3. Is there a way to convert a website written in the Python language into Dreamweaver for those who aren't familiar with writing in code?
Python website convert into Adobe Dreamweaver CS3
1,719,759
1
0
458
0
python,dreamweaver
If you mean a tool which can convert a python site into dreamweaver, not possible yet, such intelligent machines are not yet invented, but evolution has produced you, so what you can do is see the site page by page, and make it again in dreamweaver. If you have specs and designs of python site handy that would speed up...
0
0
0
0
2009-11-12T00:44:00.000
3
0.066568
false
1,719,127
1
0
1
3
I am comfortable in Adobe Dreamweaver CS3. Is there a way to convert a website written in the Python language into Dreamweaver for those who aren't familiar with writing in code?
Remove "add another" in Django admin screen
51,260,433
1
35
24,607
0
python,django,django-admin
I'm using Django 2.x and I think I found best solution, at least for my case. The HTML file to the "Save and Add Another" button is on your_python_installation\Lib\site-packages\django\contrib\admin\templates\admin\subtmit_line.html. Copy that html file and paste to your project like so your_project\templates\admin\su...
0
0
0
0
2009-11-12T09:35:00.000
12
0.016665
false
1,721,037
0
0
1
1
Whenever I'm editing object A with a foreign key to object B, a plus option "add another" is available next to the choices of object B. How do I remove that option? I configured a user without rights to add object B. The plus sign is still available, but when I click on it, it says "Permission denied". It's ugly. I'm u...
VB webform in IronPython asp.net website
1,747,832
1
0
312
0
asp.net,vb.net,ironpython
The code between <script /> tags is compiled dynamically when the page is first run. This enables you to mix languages. However, the classes in your code-behind files are statically compiled into an assembly by VS.NET ... and a VS.NET project can only support one language at a time. One solution is to put your VB.NET c...
0
0
0
0
2009-11-12T12:09:00.000
2
1.2
true
1,721,761
1
0
1
1
I tried to bring a previously done webform made in vb.net to an IronPython asp.net website with no luck. After seeing it didnt work, I tried to write the simplest codebehind vb.net webform to see if there was a problem with vb.net in an IronPython website and I got the following usual error "be sure that the defined c...
How to create a UserProfile form in Django with first_name, last_name modifications?
1,876,244
0
25
25,783
0
python,django,profile,django-forms
Why not have two model forms on the back-end and just present them as a single form in your template? Drop the name fields from your UserProfileForm and create a second model form for the user object?
0
0
0
0
2009-11-13T06:46:00.000
7
0
false
1,727,564
0
0
1
2
If think my question is pretty obvious and almost every developer working with UserProfile should be able to answer it. However, I could not find any help on the django documentation or in the Django Book. When you want to do a UserProfile form in with Django Forms, you'd like to modify the profile fields as well as so...
How to create a UserProfile form in Django with first_name, last_name modifications?
1,727,895
0
25
25,783
0
python,django,profile,django-forms
I take it normal that you don't find any information in the docs as you merge two models into a single form. Alternatively and maybe very obviously you can: Create two modelforms, one for the user and the other for the userprofile. Set the userprofile modelform to display only firstname and lastname. Put both forms in...
0
0
0
0
2009-11-13T06:46:00.000
7
0
false
1,727,564
0
0
1
2
If think my question is pretty obvious and almost every developer working with UserProfile should be able to answer it. However, I could not find any help on the django documentation or in the Django Book. When you want to do a UserProfile form in with Django Forms, you'd like to modify the profile fields as well as so...
Django ease of building a RESTful interface
1,791,400
2
10
6,277
0
python,django,rest
Regarding your comment about not liking 3rd party code - that's too bad because the pluggable apps are one of django's greatest features. Like others answered, piston will do most of the work for you.
0
0
0
0
2009-11-13T23:03:00.000
6
0.066568
false
1,732,452
0
0
1
2
I'm looking for an excuse to learn Django for a new project that has come up. Typically I like to build RESTful server-side interfaces where a URL maps to resources that spits out data in some platform independent context, such as XML or JSON. This is rather straightforward to do without the use of frameworks, but som...
Django ease of building a RESTful interface
1,732,636
1
10
6,277
0
python,django,rest
A little over a year ago, I wrote a REST web service in Django for a large Seattle company that does streaming media on the Internet. Django was excellent for the purpose. As "a paid nerd" observed, the Django URL config is wonderful: you can set up your URLs just the way you want them, and have it serve up the approp...
0
0
0
0
2009-11-13T23:03:00.000
6
0.033321
false
1,732,452
0
0
1
2
I'm looking for an excuse to learn Django for a new project that has come up. Typically I like to build RESTful server-side interfaces where a URL maps to resources that spits out data in some platform independent context, such as XML or JSON. This is rather straightforward to do without the use of frameworks, but som...
2 mysql instances in MAC
1,734,939
1
0
150
1
python,mysql,django,macos,xampp
You could change the listening port of one of the installations and they shouldn't conflict anymore with each other. Update: You need to find the mysql configuration file my.cnf of the server which should get a new port (the one from xampp should be somewhere in the xampp folder). Find the line port=3306 in the [mysqld...
0
0
0
0
2009-11-14T17:22:00.000
1
1.2
true
1,734,918
0
0
1
1
i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is active all the time and the Xampp one doesnt switch on unless i kill the other one. what i wanted to know is it possible t...
Compress data before storage on Google App Engine
2,125,539
0
1
2,545
0
python,google-app-engine,compression,gzip,zlib
You can store up to 10Mb with a list of Blobs. Search for google file service. It's much more versatile than BlobStore in my opinion, since I just started using BlobStore Api yesterday and I'm still figuring out if it is possible to access the data bytewise.. as in changing doc to pdf, jpeg to gif.. You can storage Bl...
0
1
0
0
2009-11-16T00:55:00.000
5
0
false
1,739,543
0
0
1
2
I im trying to store 30 second user mp3 recordings as Blobs in my app engine data store. However, in order to enable this feature (App Engine has a 1MB limit per upload) and to keep the costs down I would like to compress the file before upload and decompress the file every time it is requested. How would you suggest ...
Compress data before storage on Google App Engine
1,739,598
2
1
2,545
0
python,google-app-engine,compression,gzip,zlib
"Compressing before upload" implies doing it in the user's browser -- but no text in your question addresses that! It seems to be about compression in your GAE app, where of course the data will only be after the upload. You could do it with a Firefox extension (or other browsers' equivalents), if you can develop tho...
0
1
0
0
2009-11-16T00:55:00.000
5
1.2
true
1,739,543
0
0
1
2
I im trying to store 30 second user mp3 recordings as Blobs in my app engine data store. However, in order to enable this feature (App Engine has a 1MB limit per upload) and to keep the costs down I would like to compress the file before upload and decompress the file every time it is requested. How would you suggest ...
Is there a speed difference between WSGI and FCGI?
1,747,336
27
39
25,057
0
python,wsgi,fastcgi
They are two different things. WSGI is a Python specific interface for writing web applications. There are wrappers for about any web server protocol to provide the WSGI interface. FastCGI (FCGI) is one of such web server protocols. So, WSGI is an abstraction layer, while CGI / FastCGI / mod_python are how the actual w...
1
0
0
1
2009-11-17T07:59:00.000
2
1
false
1,747,266
0
0
1
2
From the web I've gleaned that WSGI is a CGI for python web development/frameworks. FCGI seems to be a more generalised gateway for a variety of languages. Don't know the performance difference between the two in reference to the languages python and C/++.
Is there a speed difference between WSGI and FCGI?
1,748,161
80
39
25,057
0
python,wsgi,fastcgi
Correct, WSGI is a Python programmatic API definition and FASTCGI is a language agnostic socket wire protocol definition. Effectively they are at different layers with WSGI being a higher layer. In other words, one can implement WSGI on top of something that so happened to use FASTCGI to communicate with a web server, ...
1
0
0
1
2009-11-17T07:59:00.000
2
1.2
true
1,747,266
0
0
1
2
From the web I've gleaned that WSGI is a CGI for python web development/frameworks. FCGI seems to be a more generalised gateway for a variety of languages. Don't know the performance difference between the two in reference to the languages python and C/++.
Getting data from an Excel sheet
11,293,612
-1
3
7,027
1
python,django,excel,postgresql
Just started using XLRD and it looks very easy and simple to use. Beware that it does not support Excel 2007 yet, so keep in mind to save your excel at 2003 format.
0
0
0
0
2009-11-17T09:07:00.000
9
-0.022219
false
1,747,501
0
0
1
1
How do I load data from an Excel sheet into my Django application? I'm using database PosgreSQL as the database. I want to do this programmatically. A client wants to load two different lists onto the website weekly and they don't want to do it in the admin section, they just want the lists loaded from an Excel sheet. ...
Integration Testing for a Web App
1,747,828
1
10
5,279
0
python,ruby,perl,automated-tests,integration-testing
I would also recommend Selenium. It got a really nice Firefox Plugin, that you can use to create your integration tests.
0
0
0
1
2009-11-17T09:59:00.000
9
0.022219
false
1,747,772
0
0
1
1
I want to do full integration testing for a web application. I want to test many things like AJAX, positioning and presence of certain phrases and HTML elements using several browsers. I'm seeking a tool to do such automated testing. On the other hand; this is my first time using integration testing. Are there any spec...
Django development server CPU intensive - how to analyse?
1,756,874
18
7
3,645
0
python,django,cpu
FWIW, you should do the profiling, but when you do I'll bet you find that the answer is "polling for changes to your files so it can auto-reload." You might do a quick test with "python manage.py runserver --noreload" and see how that affects the CPU usage.
0
0
0
0
2009-11-17T18:01:00.000
4
1.2
true
1,750,676
0
0
1
2
I'm noticing that my django development server (version 1.1.1) on my local windows7 machine is using a lot of CPU (~30%, according to task manager's python.exe entry), even in idle state, i.e. no request coming in/going out. Is there an established way of analysing what might be responsible for this? Thanks! Martin
Django development server CPU intensive - how to analyse?
1,750,793
4
7
3,645
0
python,django,cpu
Hit Control-C and crash the process. It will probably crash somewhere that it's spending a lot of time. Or you could use a profiler.
0
0
0
0
2009-11-17T18:01:00.000
4
0.197375
false
1,750,676
0
0
1
2
I'm noticing that my django development server (version 1.1.1) on my local windows7 machine is using a lot of CPU (~30%, according to task manager's python.exe entry), even in idle state, i.e. no request coming in/going out. Is there an established way of analysing what might be responsible for this? Thanks! Martin
Limit Python VM memory
1,760,046
12
20
13,726
0
python,memory,jvm
On *nix you can play around with the ulimit command, specifically the -m (max memory size) and -v (virtual memory).
0
0
0
0
2009-11-19T00:05:00.000
3
1.2
true
1,760,025
1
0
1
1
I'm trying to find a way to limit the memory available for the Python VM, as the option "-Xmx" in the Java VM does. (The idea is to be able to play with the MemoryError exception) I'm not sure this option exist but there may be a solution using a command of the OS to "isolate" a process and its memory. Thank you.
Shorten Python imports?
1,760,987
5
4
3,580
0
python,django
from myproject.folder import file (horrible name, btw, trampling over the builtin type file, but that's another rant;-), then use file.function -- if file (gotta hate that module name;-) is still too long for you, add e.g. as fi to the from statement, and use fi.function. If you want to rename myproject to myhorror, y...
0
0
0
0
2009-11-19T04:53:00.000
3
1.2
true
1,760,963
1
0
1
1
I'm working on a Django project. Let's call it myproject. Now my code is littered with myproject.folder.file.function. Is there anyway I can remove the need to prefix all my imports and such with myproject.? What if I want to rename my project later? It kind of annoys me that I need to prefix stuff like that when the v...
Different response by screen solutions using Django and jQuery
1,768,324
2
0
2,312
0
jquery,python,django
i think you have few options Just change thumbnail at runtime based on $(window).width(); using jquery Pass on screen resolution to django first time from client side, and later store it in session and render templates accordingly Sometime you may get screen resolution in request headers, i am not sure though Best wou...
0
0
0
0
2009-11-20T03:34:00.000
1
1.2
true
1,768,179
0
0
1
1
In a thumbnail website, if I want to display 100x100 thumbs on screnn resolutions lower than 1280x1024 while display 150x150 thumbs for screens higher than 1280x1024, is the following procedure correct? Render a page frame with no thumbs by view1() On page frame loaded, it detects client's screen resolution and pass i...
how to import contacts from various services like gmail or yahoo using python/django
11,819,696
1
5
2,955
0
python,django
Amir Hussain, Yahoo mail using captcha, so it will not works for any scripts or service unless they have managed service with the help of a third party for captcha decoder. So u have to contact a service provider who provide managed service. As far as I know, Improsys is the first Address Grabber marketer and they hav...
0
0
0
1
2009-11-21T08:12:00.000
3
0.066568
false
1,774,915
0
0
1
1
How can I import contacts of given email id/pwd from gmail yahoo hotmail etc using python/django application. Please suggest?
Python 3: Write newlines to HTML
1,776,100
7
7
25,316
0
python,html,unicode,python-3.x,newline
normally I do like this s=s.replace("\n","<br />\n") because <br /> is needed in web page display and \n is needed in source display. just my 2 cents
0
0
0
0
2009-11-21T17:11:00.000
6
1
false
1,776,066
1
0
1
1
I have upgraded to Python 3 and can't figure out how to convert backslash escaped newlines to HTML. The browser renders the backslashes literally, so "\n" has no effect on the HTML source. As a result, my source page is all in one long line and impossible to diagnose.
Django: request.META['REMOTE_ADDR'] is always '127.0.0.1'
1,779,475
7
2
4,509
0
python,django,http
Do you have any kind of proxy, gateway, or load balancer running on that remote host? That's the sort of thing that would cause connections to appear to be from 127.0.0.1 (because that's where the immediate connection is from, as far as the web server is concerned).
0
0
0
0
2009-11-22T18:10:00.000
2
1.2
true
1,779,464
0
0
1
1
I have an application running with debug=True on a remote host somewhere. Now somehow every time I access REMOTE_ADDR it returns 127.0.0.1 no matter where the request is from. I'm not sure where to start and why this is happening.
How do I save to a field that is specified in a variable?
1,779,579
5
1
161
0
python,django,django-models
You can use: setattr(obj, fieldname, 'new name').
0
0
0
0
2009-11-22T18:45:00.000
1
1.2
true
1,779,567
0
0
1
1
I want to do something like this: # models.py class Model(models.Model): name_in_my_model = models.CharField(max_length=100) # later fieldname = 'name_in_my_model' # this is what I want to do somehow: obj = Model.objects.get(pk=1) obj.fieldname = 'new name' obj.save() Is this possible? I'm making a reusable ...
IronPython and pdb.set_trace()
1,781,255
3
6
1,056
0
ironpython,pdb
Yes, IronPython 2.6 supports this. By default this switches on when sys.settrace is called so frames already on the stack above the caller won't be available. But with the -X:Tracing option it's available all the time.
0
0
0
0
2009-11-22T22:34:00.000
1
0.53705
false
1,780,266
0
0
1
1
Does anyone know if IronPython 2.6 is planned to have support for pdb.set_trace() to enable setting breakpoints in an ironpython module? If not does anyone have a suggestion for accomplishing this without pdb?
Python for web scripting
1,784,843
2
1
756
0
python,html,web-applications,fastcgi,template-engine
You asked whether HTML is allowed within Python, which indicates that you still think too much in PHP terms about it. Contrary to PHP, Python was not designed to create dynamic web-pages. Instead, it was designed as a stand-alone, general-purpose programming language. Therefore you will not be able to put HTML into Pyt...
0
0
0
1
2009-11-23T06:28:00.000
3
0.132549
false
1,781,431
0
0
1
1
I'm just starting out with Python and have practiced so far in the IDLE interface. Now I'd like to configure Python with MAMP so I can start creating really basic webapps — using Python inside HTML, or well, vice-versa. (I'm assuming HTML is allowed in Python, just like PHP? If not, are there any modules/template engin...
Python Vs Ruby On Rails : on Size
1,784,061
0
3
746
0
python,ruby-on-rails,django
With the cheeseshop, any python application can be made installable with a single command. I'm a big fan of Django, but it will require you to hook into an external webserver, as the built in server is for development only. You might look for something that has a more robust builtin web server if you want something y...
0
0
0
0
2009-11-23T14:26:00.000
7
0
false
1,783,431
0
0
1
5
I am planning to do a small web application that will be distributed as a single installable. I have plans to develop this application in either Python/Django or Ruby On Rails. (I am a Java/C++ programmer, hence both these languages are new to me). My main concern is about the size and simplicity of final installable ...
Python Vs Ruby On Rails : on Size
1,783,732
1
3
746
0
python,ruby-on-rails,django
One option with Ruby on Rails is to go with a JRuby deployment which would allow you to pack it all into a single .war file. This would require the person deploying the web application to have a java web application server (Jetty is probably the smallest and easiest to bundle). With Rails, you are generally going to ha...
0
0
0
0
2009-11-23T14:26:00.000
7
0.028564
false
1,783,431
0
0
1
5
I am planning to do a small web application that will be distributed as a single installable. I have plans to develop this application in either Python/Django or Ruby On Rails. (I am a Java/C++ programmer, hence both these languages are new to me). My main concern is about the size and simplicity of final installable ...
Python Vs Ruby On Rails : on Size
1,783,478
4
3
746
0
python,ruby-on-rails,django
I personally prefer Python/django. Size is small given u have necessary things installed.
0
0
0
0
2009-11-23T14:26:00.000
7
0.113791
false
1,783,431
0
0
1
5
I am planning to do a small web application that will be distributed as a single installable. I have plans to develop this application in either Python/Django or Ruby On Rails. (I am a Java/C++ programmer, hence both these languages are new to me). My main concern is about the size and simplicity of final installable ...
Python Vs Ruby On Rails : on Size
1,783,473
3
3
746
0
python,ruby-on-rails,django
With disk space at the current price, size shouldn't matter. Give both a try and figure out which will be easier for you to learn and maintain. Despite the fact that people believe that when you know one language, you know all, that's only true as long as you write code on the "hello world" level.
0
0
0
0
2009-11-23T14:26:00.000
7
0.085505
false
1,783,431
0
0
1
5
I am planning to do a small web application that will be distributed as a single installable. I have plans to develop this application in either Python/Django or Ruby On Rails. (I am a Java/C++ programmer, hence both these languages are new to me). My main concern is about the size and simplicity of final installable ...
Python Vs Ruby On Rails : on Size
1,786,648
1
3
746
0
python,ruby-on-rails,django
I don't think you can get them both. I'm sorry to say this but you have to choose which one is more important to you. Django application is smaller in size because many things is already provided out of the box, but deployment is not as easy. On the other hand, RoR apps deployment is easier (both Ruby MRI or JRuby) b...
0
0
0
0
2009-11-23T14:26:00.000
7
0.028564
false
1,783,431
0
0
1
5
I am planning to do a small web application that will be distributed as a single installable. I have plans to develop this application in either Python/Django or Ruby On Rails. (I am a Java/C++ programmer, hence both these languages are new to me). My main concern is about the size and simplicity of final installable ...
How to have a URL like this in Django?
1,788,452
3
2
712
0
python,django
http://example.com/my%20home/ is a valid URL where space character is escaped and Django will do all escaping/unescaping for you.
0
0
0
0
2009-11-24T07:25:00.000
6
0.099668
false
1,788,432
0
0
1
3
How can I have URLs like example.com/category/catename-operation/ in Django? Also in some cases the user enters a space separated category, how can I handle that? E.g if the user enters the category as "my home", then the URL for this category will become example.com/my home/ which is not a valid URL. How can I handle...
How to have a URL like this in Django?
1,788,715
0
2
712
0
python,django
How can I handle these things? If you want to handle this thing, to obtain my-url, then use the form field clean method to return the valid url. Thats what it is meant for.
0
0
0
0
2009-11-24T07:25:00.000
6
0
false
1,788,432
0
0
1
3
How can I have URLs like example.com/category/catename-operation/ in Django? Also in some cases the user enters a space separated category, how can I handle that? E.g if the user enters the category as "my home", then the URL for this category will become example.com/my home/ which is not a valid URL. How can I handle...
How to have a URL like this in Django?
1,788,459
0
2
712
0
python,django
You could consider adding a URL-friendly name to your category and using that in the URL instead. As another example you could have example.com/tv/ and have the category called "Televisions."
0
0
0
0
2009-11-24T07:25:00.000
6
0
false
1,788,432
0
0
1
3
How can I have URLs like example.com/category/catename-operation/ in Django? Also in some cases the user enters a space separated category, how can I handle that? E.g if the user enters the category as "my home", then the URL for this category will become example.com/my home/ which is not a valid URL. How can I handle...
Python on Rails?
1,794,205
14
23
23,732
0
python,ruby-on-rails,metaprogramming,code-translation
I think one of the things that people like about RoR is the domain-specific language (DSL) style of programming. This is something that Ruby is much better at than Python.
0
0
0
1
2009-11-25T01:56:00.000
4
1
false
1,794,179
0
0
1
1
Would it be possible to translate the Ruby on Rails code base to Python? I think many people like Python more than Ruby, but find Ruby on Rails features better (as a whole) than the ones in Python web frameworks. So that, would it be possible? Or does Ruby on Rails utilize language-specific features that would be diffi...
converting basic HTML to RML (Reportlab Markup Language)
1,842,295
1
2
2,613
0
python,reportlab
You shouldn't have much trouble doing this. Aside from some differences in element names, it's pretty straightforward: just ignore any HTML elements that can't be easily converted/you don't care about converting to RML and do the rest. I'm sure the ReportLab folks would be glad if you contributed even a basic HTML t...
0
0
0
0
2009-11-25T07:59:00.000
2
1.2
true
1,795,349
0
0
1
1
Is there any Python library or some sample code which demonstrates how to convert basic HTML into RML (Reportlab Markup Language www.reportlab.org)? I can think of using a regular HTML parser and adding some home grown code to generate the RML, but I guess there will be a lot of cases to handle in such a conversion.
Point Django at different Python version
1,796,427
6
3
4,848
0
python,django,path
You have it backwards. Django is added to Python's environment. When you install a new Python, you must reinstall everything -- including Django -- for the new Python. Once you have the new Django in the new Python, your PATH settings determine which Python you're using. The version of Python (and the PYTHONPATH) det...
0
0
0
0
2009-11-25T10:46:00.000
3
1.2
true
1,796,105
1
0
1
3
Django application requires a later version of Python. I just installed it to 2.5 (from 2.4) and now when I do a python at the command line, it says 2.5.2. Having said that, Django still says Python Version: 2.4.3. How do I correct this? I've rebooted / restarted / redeployed to no avail.
Point Django at different Python version
1,796,381
4
3
4,848
0
python,django,path
How are you running Django? If it's via the development server, you can explicitly choose the version of Python you're using - python2.5 manage.py runserver. However, if you're using mod_python or mod_wsgi these are fixed to the version of Python that was used when they were compiled. If you need to change this, you'll...
0
0
0
0
2009-11-25T10:46:00.000
3
0.26052
false
1,796,105
1
0
1
3
Django application requires a later version of Python. I just installed it to 2.5 (from 2.4) and now when I do a python at the command line, it says 2.5.2. Having said that, Django still says Python Version: 2.4.3. How do I correct this? I've rebooted / restarted / redeployed to no avail.
Point Django at different Python version
1,796,228
0
3
4,848
0
python,django,path
django uses /usr/bin/env python IIRC. So, wherever your path points (which python) is the python that gets used. dependent upon your system, you can point your path to the python that you want to use. However, on some OS (CentOS for example) this is a bad idea.
0
0
0
0
2009-11-25T10:46:00.000
3
0
false
1,796,105
1
0
1
3
Django application requires a later version of Python. I just installed it to 2.5 (from 2.4) and now when I do a python at the command line, it says 2.5.2. Having said that, Django still says Python Version: 2.4.3. How do I correct this? I've rebooted / restarted / redeployed to no avail.
Correct place to put extra startup code in django?
1,797,198
4
7
5,120
0
python,django
If you don't want to use settings module, then try project's __init__.py.
0
0
0
0
2009-11-25T13:52:00.000
7
0.113791
false
1,797,046
0
0
1
4
I would like to run some environment checks when my django process starts and die noisily in the case of an error. I'm thinking things like the database has an incorrect encoding or the machine has a python version we don't support. I'd rather our team be faced with a fatal error that they have to fix, rather than be a...
Correct place to put extra startup code in django?
1,798,361
4
7
5,120
0
python,django
We use the top-level urls.py for this.
0
0
0
0
2009-11-25T13:52:00.000
7
0.113791
false
1,797,046
0
0
1
4
I would like to run some environment checks when my django process starts and die noisily in the case of an error. I'm thinking things like the database has an incorrect encoding or the machine has a python version we don't support. I'd rather our team be faced with a fatal error that they have to fix, rather than be a...
Correct place to put extra startup code in django?
3,154,109
0
7
5,120
0
python,django
You can put it in settings.py as mentioned by others, but having code in the settings is not ideal. There is also the option of adding a handler for django.db.models.signals.class_prepared that does the desired start up checks after a specific model class is prepared.
0
0
0
0
2009-11-25T13:52:00.000
7
0
false
1,797,046
0
0
1
4
I would like to run some environment checks when my django process starts and die noisily in the case of an error. I'm thinking things like the database has an incorrect encoding or the machine has a python version we don't support. I'd rather our team be faced with a fatal error that they have to fix, rather than be a...
Correct place to put extra startup code in django?
13,517,044
3
7
5,120
0
python,django
I have tested all three __init__.py Settings.py and urls.py methods and this is what I have found. When code is run from either __init__.py or Settings.py, the start up functions are run twice upon web server start up; when the start up functions are run from urls.py the code is run once, however it is run only upon th...
0
0
0
0
2009-11-25T13:52:00.000
7
0.085505
false
1,797,046
0
0
1
4
I would like to run some environment checks when my django process starts and die noisily in the case of an error. I'm thinking things like the database has an incorrect encoding or the machine has a python version we don't support. I'd rather our team be faced with a fatal error that they have to fix, rather than be a...
Launching default application for given type of file, OS X
1,798,364
1
2
576
0
python,subprocess
Do you know about the open command in Mac OS X? I think you can solve your problem by calling it from Python. man open for details: The open command opens a file (or a directory or URL), just as if you had double-clicked the file's icon. If no application name is specified, the default application as determined via Lau...
0
1
0
0
2009-11-25T16:56:00.000
3
0.066568
false
1,798,351
0
0
1
2
I'm writing a python script that generates html file. Every time I run this script I'd like at the end to open default system browser for this file. It's all in OS X environment. What python code can launch Safari/Firefox/whatever is system default html viewer and open given file? subprocess.call doesn't seem to do the...
Launching default application for given type of file, OS X
1,799,054
0
2
576
0
python,subprocess
import ic ic.launchurl('file:///somefile.html')
0
1
0
0
2009-11-25T16:56:00.000
3
0
false
1,798,351
0
0
1
2
I'm writing a python script that generates html file. Every time I run this script I'd like at the end to open default system browser for this file. It's all in OS X environment. What python code can launch Safari/Firefox/whatever is system default html viewer and open given file? subprocess.call doesn't seem to do the...
What is the performance cost of named keys or "pre-generated" keys in Google App Engine?
1,805,774
4
2
198
0
python,google-app-engine
There is no intrinsic penalty to using a key name instead of an auto-generated ID, except the overhead of a (potentially) longer key on the entity and any ReferenceProperties that reference it. In certain cases, in fact, using auto-allocated IDs can have a performance penalty: If you insert new entities at a very high ...
0
1
0
0
2009-11-26T20:38:00.000
1
1.2
true
1,805,555
0
0
1
1
If you used named keys in Google App Engine, does this incur any additional cost? Put another way, is it any more expensive to create a new entity with a named key rather than a randomly generated id? In a similar line of reasoning, I note that you can ask Google App Engine to give you a set of keys that will not be us...
"Permission Denied" in Django template using Djapian
1,806,773
2
0
2,652
0
python,django,search,django-templates,xapian
Please figure out what is the exact file path involved in this error. I guess it involves a write operation to some template cache, but you should make sure. Then you just need to check the UNIX permissions on the file accessed or on the directory for that file in the case of a newly created file. Another possibility i...
0
0
0
0
2009-11-27T01:56:00.000
1
1.2
true
1,806,449
0
0
1
1
I've followed the Djapian tutorial and setup everything "by the book" so that the indexshell commandline supplied by Djapian shows successful queries. However, when integrating the sample search from the Djapian tutorial I get this nonsense error: TemplateSyntaxError at /search/ Caught an exception while rendering: (1...
Why does my python script randomly get killed?
1,811,196
1
17
20,694
0
python,mysql,url
Is it possible that it's hitting an uncaught exception? Are you running this from a shell, or is it being run from cron or in some other automated way? If it's automated, the output may not be displayed anywhere.
0
0
1
0
2009-11-28T00:47:00.000
5
0.039979
false
1,811,173
0
0
1
2
Basically, i have a list of 30,000 URLs. The script goes through the URLs and downloads them (with a 3 second delay in between). And then it stores the HTML in a database. And it loops and loops... Why does it randomly get "Killed."? I didn't touch anything. Edit: this happens on 3 of my linux machines. The machines a...
Why does my python script randomly get killed?
1,811,350
1
17
20,694
0
python,mysql,url
Are you using some sort of queue manager or process manager of some sort ? I got apparently random killed messages when the batch queue manager I was using was sending SIGUSR2 when the time was up. Otherwise I strongly favor the out of memory option.
0
0
1
0
2009-11-28T00:47:00.000
5
0.039979
false
1,811,173
0
0
1
2
Basically, i have a list of 30,000 URLs. The script goes through the URLs and downloads them (with a 3 second delay in between). And then it stores the HTML in a database. And it loops and loops... Why does it randomly get "Killed."? I didn't touch anything. Edit: this happens on 3 of my linux machines. The machines a...
python and securing pyc files on disk
1,814,092
1
1
1,262
0
python,security
To add a little bit to S.Lott's comment: The code portion of your blog should be stored in a location where it can be executed (e.g. via a web request), but not read directly. Any reasonable web server providing CGI support will allow this to be set up.
0
0
0
0
2009-11-28T23:00:00.000
2
0.099668
false
1,814,053
0
0
1
1
I set django's settings.py file to chmod 600 to keep felonious folks from spying my database connection info, but on import python compiles this file and writes out settings.pyc as mode 644. It doesn't take much sleuthing for the bad guys to get the info they need from this compiled version. I fear my blog entries are ...
Allow only one concurrent login per user in django app
1,814,465
0
2
13,565
0
python,django
I'm going to assume that you mean logged in at once, and not one "login" at the same time. I've never written a Django application before. But one method I've used in other languages, is to store the session ID of the logged in user in their user row in the database. For example, if you have a users table in your datab...
0
0
0
0
2009-11-29T02:20:00.000
4
0
false
1,814,437
0
0
1
1
is it possible to allow only one concurrent login per user in django application? if yes, how do you approach?
Javascript communication with Selenium (RC)
1,902,514
1
3
2,109
0
javascript,python,testing,selenium,selenium-rc
If you are purely testing that the JavaScript functions are performing the correct calculations with the given inputs, I would suggest separating your JavaScript from your page and use a JavaScript testing framework to test the functionality. Testing low level code using Selenium is a lot of unnecessary overhead. If ...
0
0
1
0
2009-11-30T13:42:00.000
2
0.099668
false
1,819,903
0
0
1
1
My Application has a lot of calculation being done in JavaScript according to how and when the user acts on the application. The project prints out valuable information (through console calls) as to how this calculation is going on, and so we can easily spot any NaNs creeping in. We are planning to integrate Selenium (...
Set and use flags against a users profile model in Django
1,823,488
0
0
1,168
0
python,django,django-models
There are a variety of ways to do this. I suggest the following: Django has a messaging framework, built by design to show messages to users only once when the software creates them. Whenever X is created/modified/deleted etc, you can add the message to the user via User.message_set.create(message='Whatever you like')....
0
0
0
0
2009-12-01T00:46:00.000
2
0
false
1,823,372
0
0
1
1
I have a simple webapp in Django for an iPhone app. I want to prompt the user to review our product, but just once. I then don't want to show that prompt again. So would the best practise way of implementing this to be to add a new entry to the user profile model with a bolean field: "reviewed" - and then set that flag...
Good way to pass variables for common elements to Mako templates?
1,830,276
0
1
1,022
0
python,mako
You have two OO design choices for your page controllers. Common features can be handled two ways. Inheritance. All page controllers are subclasses of a common class that provides the common attributes. Delegation. All page controllers are part of a pipeline where some common process (either before or after the page...
0
0
0
0
2009-12-02T01:03:00.000
1
1.2
true
1,830,042
0
0
1
1
I'm using Mako's inheritance features to factor out common page elements, like a header and footer, into a "base.mako" template. Page-specific controllers use their own templates, which inherit base.mako. base.mako needs a set of variables -- for example, the name of the logged-on user goes in the header for all page...
Python after Ruby on Rails
1,864,605
1
2
1,541
0
python,ruby-on-rails,pylons
Clarity and ease of use are some of Pythons biggest selling points. In saying that, the different Python web frameworks cover almost the entire spectrum from small and simple all the way up to large and complex with everything in between. You should find that most Python web frameworks have less 'magic' than Rails - ie...
0
0
0
1
2009-12-02T18:22:00.000
5
0.039979
false
1,834,829
0
0
1
1
I have been working with Ruby on Rails for over a year now and have been offered some development work with Python. I would like know if development with Python is as enjoyable as Ruby in terms of the clarity and ease of use. And how well is Python suited for Web development. I've heard of Pylons being a direct port of...
What Python-only HTTP/1.1 web servers are available?
1,837,070
1
2
507
0
python,http
also: web.py (webpy.org) paste (pythonpaste.org)
0
0
1
0
2009-12-02T20:43:00.000
3
0.066568
false
1,835,668
0
0
1
1
There is CherryPy. Are there any others?
Automate interaction with a webpage in python
1,837,397
6
4
9,387
0
python,google-app-engine,pycurl
Twill and mechanize don't do Javascript, and Qt and Selenium can't run on App Engine ((1)), which only supports pure Python code. I do not know of any pure-Python Javascript interpreter, which is what you'd need to deploy a JS-supporting scraper on App Engine:-(. Maybe there's something in Java, which would at least a...
0
0
1
0
2009-12-03T00:59:00.000
5
1
false
1,836,987
0
0
1
1
I want to automate interaction with a webpage. I've been using pycurl up til now but eventually the webpage will use javascript so I'm looking for alternatives . A typical interaction is "open the page, search for some text, click on a link (which opens a form), fill out the form and submit". We're deploying on Google ...
How to get the URL Image which is displyed by script
1,870,291
0
0
163
0
python
if you just want to download the image, theres two strategies you can try: use a something like Firebug or Chrome developer tools. right click the element in question, click "inspect element", and look at the css properties of the element. if you look around, you should find something like background-image style or ...
0
0
1
0
2009-12-03T06:26:00.000
3
0
false
1,838,047
0
0
1
2
When I view the source of page, I do not find the image src. but the image is displayed on the page. This image is generated by some server side code. I am using the selenium for testing. I want to download this image for verification/comparison. How to get that image using python?
How to get the URL Image which is displyed by script
1,838,243
0
0
163
0
python
If you aren't seeing an actual image tag in the HTML, your next step would seem to be figuring out how its being displayed. The first place I'd suggest looking is in the .css files for this page. Images can actually be embedded using CSS, and this seems like the next likely option after being in the HTML code itself. ...
0
0
1
0
2009-12-03T06:26:00.000
3
0
false
1,838,047
0
0
1
2
When I view the source of page, I do not find the image src. but the image is displayed on the page. This image is generated by some server side code. I am using the selenium for testing. I want to download this image for verification/comparison. How to get that image using python?
python web app logging through pipe? (performance concerned)
1,839,366
1
0
514
0
python,logging,pipe
Pipes are one of the fastest I/O mechanisms available. It's just a shared buffer. Nothing more. If the receiving end of your pipe is totally overwhelmed, you may have an issue. But you have no evidence of that right now. If you have 10's of processes started by FastCGI, each can have their own independent log file...
0
1
0
1
2009-12-03T11:28:00.000
1
1.2
true
1,839,348
0
0
1
1
I'm writing a web app using python with web.py, and I want to implement my own logging system. I'd like to log detailed information about each request that come to python (static files are handled by web servers). Currently I'm thinking about writing the logs to a pipe. On the other side, there should be cronolog. My m...
Facebook login without opening another window/popup
1,844,379
0
0
1,221
0
python,facebook
The opening of a window for facebook auth is the way facebook set up their authentication for facebook connect. I don't think they offer another way of authenticating users, and I doubt you'd be able to work-around/circumvent this method without breaking their terms of use Sorry I don't have better news for you :/
0
0
0
0
2009-12-03T19:36:00.000
1
1.2
true
1,842,360
0
0
1
1
Is it possible for web application that is created by the same owner as facebook application to have access to facebook application without going through a explicit session opening exercise? Most of the work is done on server side and I need to access facebook application directly from backend server. Each time the web...
Timer object in Django
1,842,622
1
0
2,462
0
python,django,timer
You should not use some in-process/memory timer objects since your django app can run in multiple processes... I suggest create this "timers" in database (like "expire" datetime field for your product model) and use cron job that will mark expired objects to be available
0
0
0
0
2009-12-03T20:15:00.000
3
0.066568
false
1,842,593
0
0
1
3
I'm using Django to create registration/payment application for a limited number of products. I want to create a timer so that when a user chooses to purchase a product, that product will then displayed as "already taken". But, if the user the user does not go through with the purchase and the timer runs out, the p...
Timer object in Django
1,842,666
-2
0
2,462
0
python,django,timer
Fork it. Have your model use three states for a product: available, taken, and purchased. When a user initiates an action that marks the product as taken, spawn a new process that will mark the product to available in 3 minutes if it is not purchased.
0
0
0
0
2009-12-03T20:15:00.000
3
1.2
true
1,842,593
0
0
1
3
I'm using Django to create registration/payment application for a limited number of products. I want to create a timer so that when a user chooses to purchase a product, that product will then displayed as "already taken". But, if the user the user does not go through with the purchase and the timer runs out, the p...
Timer object in Django
1,842,844
6
0
2,462
0
python,django,timer
I would not use a timer for such situation because it can give some complexity. What will happen to your timers if the process is restarted. That't the case with some internet providers who restart the process on a regular basis. Maybe you are facing a similar situation. I would add a 'taken_time' datetimefield to your...
0
0
0
0
2009-12-03T20:15:00.000
3
1
false
1,842,593
0
0
1
3
I'm using Django to create registration/payment application for a limited number of products. I want to create a timer so that when a user chooses to purchase a product, that product will then displayed as "already taken". But, if the user the user does not go through with the purchase and the timer runs out, the p...
Best XMPP Library for Python Web Application
1,881,020
0
3
1,373
0
javascript,python,xmpp,wsgi
I have found a lot of issues with Openfire and TLS are not with the xmpp lib :( -- SleekXMPP in the trunk has been converted to Python 3.0 and the branch is maintained for Python 2.5 Unlike Julien, I would only go with Twisted Words if you really need the power of Twisted or if you are already using Twisted. IMO Sleek...
0
0
1
0
2009-12-04T14:02:00.000
3
0
false
1,847,120
0
0
1
1
I want to learn how to use XMPP and to create a simple web application with real collaboration features. I am writing the application with Python(WSGI), and the application will require javascript enabled because I am going to use jQuery or Dojo. I have downloaded Openfire for the server and which lib to choose? SleekX...
Objective reasons for using Python or Ruby for a new REST Web API
1,850,652
5
6
3,675
0
python,ruby,web-services,api,rest
I know Ruby, don't know python... you can see which way I'm leaning toward, right?
0
0
0
0
2009-12-05T00:55:00.000
7
1.2
true
1,850,640
0
0
1
5
So this thread is definitely NOT a thread for why Python is better than Ruby or the inverse. Instead, this thread is for objective criticism on why you would pick one over the other to write a RESTful web API that's going to be used by many different clients, (mobile, web browsers, tablets etc). Again, don't compare Ru...
Objective reasons for using Python or Ruby for a new REST Web API
1,850,653
4
6
3,675
0
python,ruby,web-services,api,rest
Choose the one you're most familiar with and most likely to get things done with the fastest.
0
0
0
0
2009-12-05T00:55:00.000
7
0.113791
false
1,850,640
0
0
1
5
So this thread is definitely NOT a thread for why Python is better than Ruby or the inverse. Instead, this thread is for objective criticism on why you would pick one over the other to write a RESTful web API that's going to be used by many different clients, (mobile, web browsers, tablets etc). Again, don't compare Ru...
Objective reasons for using Python or Ruby for a new REST Web API
1,850,743
2
6
3,675
0
python,ruby,web-services,api,rest
I think they are fairly evenly matched in features. I prefer Python, but I have been using it for over a decade so I freely admit that what follows is totally biased. IMHO Python is more mature - there are more libraries for it (although Ruby may be catching up), and the included libraries I think are better designed....
0
0
0
0
2009-12-05T00:55:00.000
7
0.057081
false
1,850,640
0
0
1
5
So this thread is definitely NOT a thread for why Python is better than Ruby or the inverse. Instead, this thread is for objective criticism on why you would pick one over the other to write a RESTful web API that's going to be used by many different clients, (mobile, web browsers, tablets etc). Again, don't compare Ru...
Objective reasons for using Python or Ruby for a new REST Web API
1,852,162
1
6
3,675
0
python,ruby,web-services,api,rest
Either will do a great job and you'll gain in other ways from learning something new. Why not spend as couple of days with each? See how far you can get with a simple subset of the problem, then see how you feel. For bonus points report back here and answer your own question!
0
0
0
0
2009-12-05T00:55:00.000
7
0.028564
false
1,850,640
0
0
1
5
So this thread is definitely NOT a thread for why Python is better than Ruby or the inverse. Instead, this thread is for objective criticism on why you would pick one over the other to write a RESTful web API that's going to be used by many different clients, (mobile, web browsers, tablets etc). Again, don't compare Ru...
Objective reasons for using Python or Ruby for a new REST Web API
1,850,701
6
6
3,675
0
python,ruby,web-services,api,rest
I would say the important thing is that regardless of which you choose, make sure that your choice does not leak through your REST API. It should not matter to the client of your API which you chose.
0
0
0
0
2009-12-05T00:55:00.000
7
1
false
1,850,640
0
0
1
5
So this thread is definitely NOT a thread for why Python is better than Ruby or the inverse. Instead, this thread is for objective criticism on why you would pick one over the other to write a RESTful web API that's going to be used by many different clients, (mobile, web browsers, tablets etc). Again, don't compare Ru...
Ruby Quiz for Python
1,852,706
1
2
463
0
python
At the risk of stating the obvious, why not just do the rubyquiz examples in python. Those exercises as well as others aren't tied to a language - you're just as well off just doing projecteuler problems in python rather than searching for python-specific puzzles. A puzzle is a puzzle a language is just a tool to solve...
0
0
0
1
2009-12-05T06:52:00.000
2
0.099668
false
1,851,396
0
0
1
1
Is there a blog/forum/listserv that is equivalent to RubyQuiz.com for the Python language?
Writing a Faster Python Spider
1,853,865
3
6
7,091
0
python,web-crawler
You waste a lot of time waiting for network requests when spidering, so you'll definitely want to make your requests in parallel. I would probably save the result data to disk and then have a second process looping over the files searching for the term. That phase could easily be distributed across multiple machines ...
0
0
1
0
2009-12-05T22:28:00.000
6
0.099668
false
1,853,673
0
0
1
3
I'm writing a spider in Python to crawl a site. Trouble is, I need to examine about 2.5 million pages, so I could really use some help making it optimized for speed. What I need to do is examine the pages for a certain number, and if it is found to record the link to the page. The spider is very simple, it just needs t...
Writing a Faster Python Spider
1,854,592
0
6
7,091
0
python,web-crawler
What Adam said. I did this once to map out Xanga's network. The way I made it faster is by having a thread-safe set containing all usernames I had to look up. Then I had 5 or so threads making requests at the same time and processing them. You're going to spend way more time waiting for the page to DL than you will pro...
0
0
1
0
2009-12-05T22:28:00.000
6
0
false
1,853,673
0
0
1
3
I'm writing a spider in Python to crawl a site. Trouble is, I need to examine about 2.5 million pages, so I could really use some help making it optimized for speed. What I need to do is examine the pages for a certain number, and if it is found to record the link to the page. The spider is very simple, it just needs t...