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
Call program from within a browser without using a webserver
1,025,901
0
2
2,904
0
python,html,browser
Try also XML-RPC it gives you a simple way to pass remote procedure calls from YUI towards a simple XMLRPC server and from that towards your rs232 device
0
0
0
0
2009-06-22T07:03:00.000
7
0
false
1,025,817
0
0
1
3
Is there a way to call a program (Python script) from a local HTML page? I have a YUI-colorpicker on that page and need to send its value to a microcontroller via rs232. (There is other stuff than the picker, so I can't code an application instead of an HTML page.) Later, this will migrate to a server, but I need a fas...
Call program from within a browser without using a webserver
1,026,086
0
2
2,904
0
python,html,browser
I see no reason why you can't setup a handler for .py/.bat/.vbs files in your browser. This should result in your chosen application running a script when you link to it. This won't work when you migrate to the server but as a testing platform it would work. Just remember to turn it off when you're done or you expose y...
0
0
0
0
2009-06-22T07:03:00.000
7
0
false
1,025,817
0
0
1
3
Is there a way to call a program (Python script) from a local HTML page? I have a YUI-colorpicker on that page and need to send its value to a microcontroller via rs232. (There is other stuff than the picker, so I can't code an application instead of an HTML page.) Later, this will migrate to a server, but I need a fas...
Simple User management example for Google App Engine?
1,030,362
1
17
7,295
1
php,python,google-app-engine
You don't write user management and registration and all that, because you use Google's own authentication services. This is all included in the App Engine documentation.
0
1
0
0
2009-06-23T01:58:00.000
3
0.066568
false
1,030,293
0
0
1
1
I am newbie in Google App Engine. While I was going through the tutorial, I found several things that we do in php-mysql is not available in GAE. For example in dataStore auto increment feature is not available. Also I am confused about session management in GAE. Over all I am confused and can not visualize the whole t...
Python/Django or C#/ASP.NET for web development?
1,031,492
14
7
7,667
0
asp.net,python,django,scalability
Almost all the well known frameworks and languages can scale. It doesn't really matter which one you use. Its about how well you structure the code that matters most. On a personal level it is always good to know more than one language. But, you can create perfectly scalable Python, PHP, .NET applications. The qua...
0
0
0
0
2009-06-23T09:01:00.000
4
1
false
1,031,438
1
0
1
4
I am a .NET developer. I have no experience on Python. Which platform is more scalable? Which platform is more suitable for large-size high-traffic web sites? If you have any experience about scalability on these platforms, please inform us. Thank you.
Python/Django or C#/ASP.NET for web development?
1,036,254
3
7
7,667
0
asp.net,python,django,scalability
Derek had a great answer, so I won't repeat it. I would like to make one observation, however. While for the most part, the language choice isn't really a big deal these days, if you really need high performance and scalability, the dynamic nature of python might come back to haunt you. For all the benefits that a dyn...
0
0
0
0
2009-06-23T09:01:00.000
4
0.148885
false
1,031,438
1
0
1
4
I am a .NET developer. I have no experience on Python. Which platform is more scalable? Which platform is more suitable for large-size high-traffic web sites? If you have any experience about scalability on these platforms, please inform us. Thank you.
Python/Django or C#/ASP.NET for web development?
3,224,766
1
7
7,667
0
asp.net,python,django,scalability
There is a added scalability cost with going with .NET over Python, the cost of Windows Server licenses (at the minimum, you usually add SQL Server to that as well).
0
0
0
0
2009-06-23T09:01:00.000
4
0.049958
false
1,031,438
1
0
1
4
I am a .NET developer. I have no experience on Python. Which platform is more scalable? Which platform is more suitable for large-size high-traffic web sites? If you have any experience about scalability on these platforms, please inform us. Thank you.
Python/Django or C#/ASP.NET for web development?
1,036,216
16
7
7,667
0
asp.net,python,django,scalability
Much as I love Python (and, that's a LOT!-), if you're highly skilled at C# and, as you say, "have no experience on Python", your code will be more scalable and suitable (for the next several months, at least) if you stick with what you know best. For a hypothetical developer extremely skilled at both platforms, scalab...
0
0
0
0
2009-06-23T09:01:00.000
4
1.2
true
1,031,438
1
0
1
4
I am a .NET developer. I have no experience on Python. Which platform is more scalable? Which platform is more suitable for large-size high-traffic web sites? If you have any experience about scalability on these platforms, please inform us. Thank you.
how to addreference to Ritmo for iSeries in ironpython
1,034,326
0
0
438
0
c#,ironpython
Jonathan helped me to figure out that I had not copied the dll file to the location where IronPython can find it. After copying the dll file to the location, usually it s "c:\Program Files\IronPython 2.0\" unless stated otherwise, I did: import clr clr.AddReference('System.Data') clr.AddReferenceToFile('Sql400.dll') ...
0
0
0
0
2009-06-23T14:24:00.000
2
0
false
1,032,888
0
0
1
2
I was just wondering if anybody knows how to add reference to "Ritmo for iSeries" in IronPython. I did it successfully in C# and get it to work (since it is just click click click) And I was trying to do the same in IronPython but it says, "could not add reference to assembly Ritmo for iSeries". I was doing import clr ...
how to addreference to Ritmo for iSeries in ironpython
1,032,962
0
0
438
0
c#,ironpython
You need to use the actual name of the assembly (it won't have spaces). In your C# project, what does it list under the 'references' folder once you've added it as a reference? Try putting that. Also, make sure you've copied the dll for the library to where your IronPython script can find it (if it's not in the GAC).
0
0
0
0
2009-06-23T14:24:00.000
2
0
false
1,032,888
0
0
1
2
I was just wondering if anybody knows how to add reference to "Ritmo for iSeries" in IronPython. I did it successfully in C# and get it to work (since it is just click click click) And I was trying to do the same in IronPython but it says, "could not add reference to assembly Ritmo for iSeries". I was doing import clr ...
Per-session transactions in Django
1,121,915
2
8
2,065
1
python,django,transactions
I came up with something similar to the Memento pattern, but different enough that I think it bears posting. When a user starts an editing session, I duplicate the target object to a temporary object in the database. All subsequent editing operations affect the duplicate. Instead of saving the object state in a meme...
0
0
0
0
2009-06-23T17:16:00.000
3
0.132549
false
1,033,934
0
0
1
1
I'm making a Django web-app which allows a user to build up a set of changes over a series of GETs/POSTs before committing them to the database (or reverting) with a final POST. I have to keep the updates isolated from any concurrent database users until they are confirmed (this is a configuration front-end), ruling ou...
Any Python Script to Save Websites Like Firefox?
1,035,855
1
3
2,633
0
python
Like Cobbal stated, this is largely what wget is designed to do. I believe there's some flags/arguments that you can set to make it download the entire page, CSS + all. I suggest just alias-ing into something more convenient to type, or tossing it into a quick script.
0
0
1
0
2009-06-23T23:40:00.000
5
0.039979
false
1,035,825
0
0
1
1
I am tired of clicking "File" and then "Save Page As" in Firefox when I want to save some websites. Is there any script to do this in Python? I would like to save the pictures and css files so that when I read it offline, it looks normal.
Python Web-based Bot
1,036,758
0
3
6,042
0
python,html,bots
Well obviously python won't interpret the JS for you (though there may be modules out there that can). I suppose you need to convert the JS instructions to equivalent transformations in Python. I suppose ElementTree or BeautifulSoup would be good starting points to interpret the HTML structure.
0
0
1
0
2009-06-24T06:15:00.000
7
0
false
1,036,660
0
0
1
2
I am trying to write a Python-based Web Bot that can read and interpret an HTML page, then execute an onClick function and receive the resulting new HTML page. I can already read the HTML page and I can determine the functions to be called by the onClick command, but I have no idea how to execute those functions or how...
Python Web-based Bot
5,873,989
0
3
6,042
0
python,html,bots
Why don't you just sniff what gets sent after the onclick event and replicate that with your bot?
0
0
1
0
2009-06-24T06:15:00.000
7
0
false
1,036,660
0
0
1
2
I am trying to write a Python-based Web Bot that can read and interpret an HTML page, then execute an onClick function and receive the resulting new HTML page. I can already read the HTML page and I can determine the functions to be called by the onClick command, but I have no idea how to execute those functions or how...
HTML conversion
14,180,592
0
0
677
0
wxpython
stylesheet, not slidesheet. f = open('NAMEOFSTYLESHEET.css','w') f.write('#ID{}\n.class{}')
1
0
0
0
2009-06-24T12:54:00.000
3
0
false
1,038,182
0
0
1
1
How to convert HTML CSS file to wxPython files? That is, how to create slidsheet in wxPython like HTML CSS files?
how to use french letters in a django template?
1,063,665
7
5
4,002
0
python,django,unicode
You are probably storing the template in a non-unicode encoding, such as latin-1. I believe Django assumes that templates are in UTF-8 by default (though there is a setting to override this). Your editor should be capable of saving the template file in the UTF-8 encoding (probably via a dropdown on the save as page, t...
0
0
0
0
2009-06-30T13:14:00.000
2
1.2
true
1,063,626
0
0
1
1
I have some french letters (é, è, à...) in a django template but when it is loaded by django, an UnicodeDecodeError exception is raised. If I don't load the template but directly use a python string. It works ok. Is there something to do to use unicode with django template?
What is the best way to add an API to a Django application?
1,064,563
2
2
299
0
python,django,api,django-models,django-admin
Web services API's are just more URL's. These WS API URL's map to view functions. The WS view functions handle GET and POST (and possibly PUT and DELETE). The WS view functions use Forms as well as the Models to make things happen. It is, in a way, like an admin interface. Except, there's no HTML. The WS view function...
0
0
0
0
2009-06-30T15:56:00.000
2
0.197375
false
1,064,520
0
0
1
1
I am adding MetaWeblog API support to a Django CMS, and am not quite sure how to layer the application. I am using django_xmlrpc, which allows me to map to parameterised functions for each request. It is just a case of what level do I hook in calls to the django application from the service functions (AddPage, EditPage...
Django way to do conditional formatting
1,068,601
2
8
6,131
0
python,django,formatting,django-templates
Since you are doing static comparison (no queries needed), you should go for the most DRY and easy to implement option. In this case, I would go for option 4, make a template filter. Then you could do value|filter to get the class you would need to set the background colour. Template filters are actually a bit simpler ...
0
0
0
0
2009-07-01T11:21:00.000
4
0.099668
false
1,068,573
0
0
1
1
What is the correct way to do conditional formatting in Django? I have a model that contains a date field, and I would like to display a list of records, but colour the rows depending on the value of that date field. For example, records that match today's date I want to be yellow, records that is before today I want g...
user friendly framework for personal website?
1,073,087
-1
7
6,057
0
php,python,frameworks
Kentico,Umbraco and Sitefinity,DotNetNuke are meant for developers/designers/integrators. Use Wordpress or if you are looking for .NET version use Community server.
0
0
0
0
2009-07-02T07:02:00.000
8
-0.024995
false
1,072,920
0
0
1
2
Hi, Which are the user friendly frameworks for building personal sites? Specially if that comes with little programming knowledge. And integrated jquery will be great. python or php based framework will do better. I tried wordpress and joomla! But those are far more complex for a simple personal site with personal blog...
user friendly framework for personal website?
22,913,432
0
7
6,057
0
php,python,frameworks
AnchorCMS gets a lot of good feedback, give it a try.
0
0
0
0
2009-07-02T07:02:00.000
8
0
false
1,072,920
0
0
1
2
Hi, Which are the user friendly frameworks for building personal sites? Specially if that comes with little programming knowledge. And integrated jquery will be great. python or php based framework will do better. I tried wordpress and joomla! But those are far more complex for a simple personal site with personal blog...
How to debug SCons scripts using eclipse and pydev?
1,075,694
3
4
2,414
0
python,eclipse,pydev,scons
I'm not an Eclipse expert, but since you didn't get any other answer... If you make the SCons source a part of the Eclipse project, and run the whole command from within Eclipse it should work like any Eclipse debugging. SCons is written in Python, there is no reason it shouldn't be debuggable in Eclipse just like anyt...
0
1
0
1
2009-07-02T16:16:00.000
6
1.2
true
1,075,304
0
0
1
5
I'm a newbie to SCons and also using pydev. Can someone help me with instructions on how to debug scons scripts using Eclipse and pydev? Is it even possible considering the fact that SCons is a seperate app and not an extension to python?
How to debug SCons scripts using eclipse and pydev?
45,216,082
0
4
2,414
0
python,eclipse,pydev,scons
As an addendum: on Windows, I had to copy the scons-installed files to reside under C:\Python27\Lib\site-packages\scons in order for this to work. Adding the original installed location, qualified with the version number, to the PYTHONPATH, did not work.
0
1
0
1
2009-07-02T16:16:00.000
6
0
false
1,075,304
0
0
1
5
I'm a newbie to SCons and also using pydev. Can someone help me with instructions on how to debug scons scripts using Eclipse and pydev? Is it even possible considering the fact that SCons is a seperate app and not an extension to python?
How to debug SCons scripts using eclipse and pydev?
15,386,322
1
4
2,414
0
python,eclipse,pydev,scons
On MAC to debug scons through pydev follow Lennart's answer but with one simply addition. Using Finder (or terminal) browse to where scons is installed. You can find this with the "which" command. e.g. which scons -> /usr/local/bin/scons Make a copy of the scons file and call it scons.py. Now when you create the Debug ...
0
1
0
1
2009-07-02T16:16:00.000
6
0.033321
false
1,075,304
0
0
1
5
I'm a newbie to SCons and also using pydev. Can someone help me with instructions on how to debug scons scripts using Eclipse and pydev? Is it even possible considering the fact that SCons is a seperate app and not an extension to python?
How to debug SCons scripts using eclipse and pydev?
1,077,102
6
4
2,414
0
python,eclipse,pydev,scons
You are right. Since the SCons is python based, the SCons scripts are debuggable via EClipse PyDev. For this, you need to do the following in the debug configuration... 1. Under the main tab, set the main module to the SCons file which will be available under the python/scripts directory if you have installed SCons. ...
0
1
0
1
2009-07-02T16:16:00.000
6
1
false
1,075,304
0
0
1
5
I'm a newbie to SCons and also using pydev. Can someone help me with instructions on how to debug scons scripts using Eclipse and pydev? Is it even possible considering the fact that SCons is a seperate app and not an extension to python?
How to debug SCons scripts using eclipse and pydev?
32,887,089
0
4
2,414
0
python,eclipse,pydev,scons
I've since gain more experience with SCons / Python and I'd recommend using python's pdb module. To use it simply add the following code to your SCons/Python files. import pdb; pdb.set_trace() When the file is run from the command line a breakpoint will be hit at this line. I also moved away from Eclipse. A lightweight...
0
1
0
1
2009-07-02T16:16:00.000
6
0
false
1,075,304
0
0
1
5
I'm a newbie to SCons and also using pydev. Can someone help me with instructions on how to debug scons scripts using Eclipse and pydev? Is it even possible considering the fact that SCons is a seperate app and not an extension to python?
Restarting a Django application running on Apache + mod_python
1,078,235
-1
8
7,641
0
python,django,mod-python
Use a test server included in Django. (like ./manage.py runserver 0.0.0.0:8080) It will do most things you would need during development. The only drawback is that it cannot handle simultaneous requests with multi-threading. I've heard that there is a trick that setting Apache's max instances to 1 so that every code ch...
0
0
0
0
2009-07-03T07:23:00.000
4
-0.049958
false
1,078,166
0
0
1
2
I'm running a Django app on Apache + mod_python. When I make some changes to the code, sometimes they have effect immediately, other times they don't, until I restart Apache. However I don't really want to do that since it's a production server running other stuff too. Is there some other way to force that? Just to mak...
Restarting a Django application running on Apache + mod_python
1,078,289
1
8
7,641
0
python,django,mod-python
You can reduce number of connections to 1 by setting "MaxRequestsPerChild 1" in your httpd.conf file. But do it only on test server, not production. or If you don't want to kill existing connections and still restart apache you can restart it "gracefully" by performing "apache2ctl gracefully" - all existing connection...
0
0
0
0
2009-07-03T07:23:00.000
4
0.049958
false
1,078,166
0
0
1
2
I'm running a Django app on Apache + mod_python. When I make some changes to the code, sometimes they have effect immediately, other times they don't, until I restart Apache. However I don't really want to do that since it's a production server running other stuff too. Is there some other way to force that? Just to mak...
Deploying a Web.py application with WSGI, several servers
1,406,572
0
7
6,152
0
python,wsgi,web.py
Here is an example of two hosted apps using cherrypy wsgi server: #!/usr/bin/python from web import wsgiserver import web # webpy wsgi app urls = ( '/test.*', 'index' ) class index: def GET(self): web.header("content-type", "text/html") return "Hello, world1!" application = web.application(ur...
0
0
0
0
2009-07-03T09:35:00.000
3
0
false
1,078,599
0
0
1
1
I've created a web.py application, and now that it is ready to be deployed, I want to run in not on web.py's built-in webserver. I want to be able to run it on different webservers, Apache or IIS, without having to change my application code. This is where WSGI is supposed to come in, if I understand it correctly. Howe...
How to put Google login box inside flash in GAE?
1,353,761
1
0
237
0
python,flash,google-app-engine,authentication
Of course this is possible you just need to use flash to post http request to your server and your server could communicate to flash through several ways like: xml , html, and AMF or even johnson( I am not sure). I recommend you use pyamf at server side to build a native support for flash at server side
0
0
0
0
2009-07-03T11:50:00.000
1
0.197375
false
1,079,022
0
0
1
1
I am putting my old flash site into GAE. I want to use Google's user authentication too. Now, I want to put Googles login box inside the flash instead of redirecting to Google's login page. Same thing I want for forgot password. Is it possible to do this? How to do this?
How to check available Python libraries on Google App Engine & add more
1,085,550
1
1
1,050
0
python,google-app-engine,sqlite
Afaik, you can only use the GAE specific database.
0
1
0
0
2009-07-06T05:23:00.000
2
0.099668
false
1,085,538
0
0
1
1
How to check available Python libraries on Google App Engine & add more? Is SQLite available or we must use GQL with their database system only? Thank you in advance.
Django file upload input validation and security
5,921,094
2
4
4,001
0
python,django,security,file-upload
Also, you might want to put the target files outside Apache's DocumentRoot directory, so that they are not reachable by any URL. Rules in .htaccess offer a certain amount of protection if they're written well, but if you're seeking for maximum security, just put the files away from web-reachable directory.
0
0
0
0
2009-07-07T22:50:00.000
2
0.197375
false
1,095,250
0
0
1
2
I'm creating a very simple django upload application but I want to make it as secure as possible. This is app is going to be completely one way, IE. anybody who uploads a file will never have to retrieve it. So far I've done the following: Disallow certain file extensions (.php, .html, .py, .rb, .pl, .cgi, .htaccess...
Django file upload input validation and security
1,095,662
7
4
4,001
0
python,django,security,file-upload
Disallowing a file extension is -- potentially -- a waste of time. A unix server doesn't use the extension -- it uses ownership and permissions. When accepting an upload, you will often rename the file to prevent it being misused. Uploaded files should be simply named "upload_xxx" with the "xxx" being a key to some...
0
0
0
0
2009-07-07T22:50:00.000
2
1.2
true
1,095,250
0
0
1
2
I'm creating a very simple django upload application but I want to make it as secure as possible. This is app is going to be completely one way, IE. anybody who uploads a file will never have to retrieve it. So far I've done the following: Disallow certain file extensions (.php, .html, .py, .rb, .pl, .cgi, .htaccess...
Pylons/Routes rewrite POST or GET to fancy URL
1,096,315
2
2
1,116
0
python,routes,pylons
HTML forms are designed to go to a specific URL with a query string (?q=) or an equivalent body in a POST -- either you write clever and subtle Javascript to intercept the form submission and rewrite it in your preferred weird way, or use redirect_to (and the latter will take some doing). But why do you need such weird...
0
0
0
0
2009-07-08T05:49:00.000
2
0.197375
false
1,096,300
0
0
1
2
The behavior I propose: A user loads up my "search" page, www.site.com/search, types their query into a form, clicks submit, and then ends up at www.site.com/search/the+query instead of www.site.com/search?q=the+query. I've gone through a lot of the Pylons documentation already and just finished reading the Routes docu...
Pylons/Routes rewrite POST or GET to fancy URL
1,097,943
2
2
1,116
0
python,routes,pylons
You can send whatever content you want for any URL, but if you want a particular URL to appear in the browser's address bar, you have to use a redirect. This is independent of whether you use Pylons, Django or Rails on the server side. In the handling for /search (whether POST or GET), one would normally run the query ...
0
0
0
0
2009-07-08T05:49:00.000
2
1.2
true
1,096,300
0
0
1
2
The behavior I propose: A user loads up my "search" page, www.site.com/search, types their query into a form, clicks submit, and then ends up at www.site.com/search/the+query instead of www.site.com/search?q=the+query. I've gone through a lot of the Pylons documentation already and just finished reading the Routes docu...
Why is Ruby more suitable for Rails than Python?
1,100,263
-6
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
All of this is TOTALLY "IMHO" In Ruby there is ONE web-application framework, so it is the only framework that is advertised for that language. Python has had several since inception, just to name a few: Zope, Twisted, Django, TurboGears (it itself a mix of other framework components), Pylons (a kinda-clone of the Rail...
0
0
0
0
2009-07-08T16:55:00.000
13
-1
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Why is Ruby more suitable for Rails than Python?
1,099,320
1
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
Some have said that the type of metaprogramming required to make ActiveRecord (a key component of rails) possible is easier and more natural to do in ruby than in python - I do not know python yet;), so i cannot personally confirm this statement. I have used rails briefly, and its use of catchalls/interceptors and dyna...
0
0
0
0
2009-07-08T16:55:00.000
13
0.015383
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Why is Ruby more suitable for Rails than Python?
1,123,890
4
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
I suppose we should not discuss the language features per se but rather the accents the respective communities make on the language features. For example, in Python, re-opening a class is perfectly possible but it is not common; in Ruby, however, re-opening a class is something of the daily practice. this allows for a ...
0
0
0
0
2009-07-08T16:55:00.000
13
0.061461
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Why is Ruby more suitable for Rails than Python?
2,040,561
-1
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
Two answers : a. Because rails was written for ruby. b. For the same reason C more suitable for Linux than Ruby
0
0
0
0
2009-07-08T16:55:00.000
13
-0.015383
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Why is Ruby more suitable for Rails than Python?
1,204,243
1
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
I think that the syntax is cleaner and Ruby, for me at least, is just a lot more "enjoyable"- as subjective as that is!
0
0
0
0
2009-07-08T16:55:00.000
13
0.015383
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Why is Ruby more suitable for Rails than Python?
1,104,198
15
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
The real answer is neither Python or Ruby are better/worse candidates for a web framework. If you want objectivity you need to write some code in both and see which fits your personal preference best, including community. Most people who argue for one or other have either never used the other language seriously or are...
0
0
0
0
2009-07-08T16:55:00.000
13
1
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Why is Ruby more suitable for Rails than Python?
1,100,340
53
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
The python community believes that doing things the most simple and straight forward way possible is the highest form of elegance. The ruby community believes doing things in clever ways that allow for cool code is the highest form of elegance. Rails is all about if you follow certain conventions, loads of other thing...
0
0
0
0
2009-07-08T16:55:00.000
13
1
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Why is Ruby more suitable for Rails than Python?
1,127,435
8
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
Because Rails is developed to take advantage of Rubys feature set. A similarly gormless question would be "Why is Python more suitable for Django than Ruby is?".
0
0
0
0
2009-07-08T16:55:00.000
13
1
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Why is Ruby more suitable for Rails than Python?
1,099,454
11
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
Python has a whole host of Rails-like frameworks. There are so many that a joke goes that during the typical talk at PyCon at least one web framework will see the light. The argument that Rubys meta programming would make it better suited is IMO incorrect. You don't need metaprogramming for frameworks like this. So I t...
0
0
0
0
2009-07-08T16:55:00.000
13
1
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Why is Ruby more suitable for Rails than Python?
1,141,854
26
91
14,973
0
python,ruby-on-rails,ruby,web-frameworks
Is this debate a new "vim versus emacs" debate? I am a Python/Django programmer and thus far I've never found a problem in that language/framework that would lead me to switch to Ruby/Rails. I can imagine that it would be the same if I were experienced with Ruby/Rails. Both have similar philosophy and do the job in a f...
0
0
0
0
2009-07-08T16:55:00.000
13
1
false
1,099,305
1
0
1
10
Python and Ruby are usually considered to be close cousins (though with quite different historical baggage) with similar expressiveness and power. But some have argued that the immense success of the Rails framework really has a great deal to do with the language it is built on: Ruby itself. So why would Ruby be more s...
Best way to denormalize data in Django?
1,101,410
17
16
5,270
0
python,mysql,django
You have managers in Django. Use a customized manager to do creates and maintain the FK relationships. The manager can update the counts as the sets of children are updated. If you don't want to make customized managers, just extend the save method. Everything you want to do for denormalizing counts and sums can be do...
0
0
0
0
2009-07-08T22:41:00.000
5
1.2
true
1,100,924
0
0
1
2
I'm developing a simple web app, and it makes a lot of sense to store some denormalized data. Imagine a blogging platform that keeps track of Comments, and the BlogEntry model has a "CommentCount" field that I'd like to keep up to date. One way of doing this would be to use Django signals. Another way of doing this w...
Best way to denormalize data in Django?
1,101,004
5
16
5,270
0
python,mysql,django
The first approach (signals) has the advantage to loose the coupling between models. However, signals are somehow more difficult to maintain, because dependencies are less explicit (at least, in my opinion). If the correctness of the comment count is not so important, you could also think of a cron job that will update...
0
0
0
0
2009-07-08T22:41:00.000
5
0.197375
false
1,100,924
0
0
1
2
I'm developing a simple web app, and it makes a lot of sense to store some denormalized data. Imagine a blogging platform that keeps track of Comments, and the BlogEntry model has a "CommentCount" field that I'd like to keep up to date. One way of doing this would be to use Django signals. Another way of doing this w...
Is there a way to plan and diagram an architecture for dynamic scripting languages like groovy or python?
1,102,219
3
1
359
0
python,architecture,groovy,uml,dynamic-languages
UML isn't too well equipped to handle such things, but you can still use it to communicate your design if you are willing to do some mental mapping. You can find an isomorphism between most dynamic concepts and UMLs static object-model. For example you can think of a closure as an object implementing a one method inter...
0
1
0
0
2009-07-09T06:23:00.000
2
0.291313
false
1,102,134
0
0
1
1
Say I want to write a large application in groovy, and take advantage of closures, categories and other concepts (that I regularly use to separate concerns). Is there a way to diagram or otherwise communicate in a simple way the architecture of some of this stuff? How do you detail (without verbose documentation) the...
Can I detect if my code is running on cPython or Jython?
13,682,964
37
14
6,376
0
python,django,jython
The most clear-cut way is: import platform platform.python_implementation() 'CPython' By default, most of the time the underlying interpreter is CPython only which is also arguably the most efficient one :)
0
0
0
0
2009-07-09T12:19:00.000
5
1
false
1,103,487
0
0
1
2
I'm working on a small django project that will be deployed in a servlet container later. But development is much faster if I work with cPython instead of Jython. So what I want to do is test if my code is running on cPython or Jython in my settiings.py so I can tell it to use the appropriate db driver (postgresql_psyc...
Can I detect if my code is running on cPython or Jython?
1,103,680
3
14
6,376
0
python,django,jython
You'll have unique settings.py for every different environment. Your development settings.py should not be your QA/Test or production settings.py. What we do is this. We have a "master" settings.py that contains the installed apps and other items which don't change much. We have environment-specific files with names li...
0
0
0
0
2009-07-09T12:19:00.000
5
0.119427
false
1,103,487
0
0
1
2
I'm working on a small django project that will be deployed in a servlet container later. But development is much faster if I work with cPython instead of Jython. So what I want to do is test if my code is running on cPython or Jython in my settiings.py so I can tell it to use the appropriate db driver (postgresql_psyc...
storing uploaded photos and documents - filesystem vs database blob
1,105,534
1
11
7,730
1
python,postgresql,storage,photos,photo-management
a DB might be faster than a filesystem on some operations, but loading a well-identified chunk of data 100s of KB is not one of them. also, a good frontend webserver (like nginx) is way faster than any webapp layer you'd have to write to read the blob from the DB. in some tests nginx is roughly on par with memcached f...
0
0
0
0
2009-07-09T17:39:00.000
6
0.033321
false
1,105,429
0
0
1
4
My specific situation Property management web site where users can upload photos and lease documents. For every apartment unit, there might be 4 photos, so there won't be an overwhelming number of photo in the system. For photos, there will be thumbnails of each. My question My #1 priority is performance. For the e...
storing uploaded photos and documents - filesystem vs database blob
1,105,444
9
11
7,730
1
python,postgresql,storage,photos,photo-management
File system. No contest. The data has to go through a lot more layers when you store it in the db. Edit on caching: If you want to cache the file while the user uploads it to ensure the operation finishes as soon as possible, dumping it straight to disk (i.e. file system) is about as quick as it gets. As long as the fi...
0
0
0
0
2009-07-09T17:39:00.000
6
1
false
1,105,429
0
0
1
4
My specific situation Property management web site where users can upload photos and lease documents. For every apartment unit, there might be 4 photos, so there won't be an overwhelming number of photo in the system. For photos, there will be thumbnails of each. My question My #1 priority is performance. For the e...
storing uploaded photos and documents - filesystem vs database blob
1,105,479
3
11
7,730
1
python,postgresql,storage,photos,photo-management
Definitely store your images on the filesystem. One concern that folks don't consider enough when considering these types of things is bloat; cramming images as binary blobs into your database is a really quick way to bloat your DB way up. With a large database comes higher hardware requirements, more difficult repli...
0
0
0
0
2009-07-09T17:39:00.000
6
0.099668
false
1,105,429
0
0
1
4
My specific situation Property management web site where users can upload photos and lease documents. For every apartment unit, there might be 4 photos, so there won't be an overwhelming number of photo in the system. For photos, there will be thumbnails of each. My question My #1 priority is performance. For the e...
storing uploaded photos and documents - filesystem vs database blob
1,105,453
10
11
7,730
1
python,postgresql,storage,photos,photo-management
While there are exceptions to everything, the general case is that storing images in the file system is your best bet. You can easily provide caching services to the images, you don't need to worry about additional code to handle image processing, and you can easily do maintenance on the images if needed through standa...
0
0
0
0
2009-07-09T17:39:00.000
6
1
false
1,105,429
0
0
1
4
My specific situation Property management web site where users can upload photos and lease documents. For every apartment unit, there might be 4 photos, so there won't be an overwhelming number of photo in the system. For photos, there will be thumbnails of each. My question My #1 priority is performance. For the e...
Looking for testing/QA idea for Python Web Application Project
1,108,750
0
1
664
0
python,testing,integration-testing
Few things help as much as testing. These two quotes are really important. "how many unit tests you can afford to write." "From time to time embarrassing mistakes still occur," If mistakes occur, you haven't written enough tests. If you're still having mistakes, then you can afford to write more unit tests. It's th...
0
0
0
1
2009-07-10T05:29:00.000
5
0
false
1,107,858
0
0
1
1
I have the 'luck' of develop and enhance a legacy python web application for almost 2 years. The major contribution I consider I made is the introduction of the use of unit test, nosestest, pychecker and CI server. Yes, that's right, there are still project out there that has no single unit test (To be fair, it has a f...
Separation of ORM and validation
1,108,987
0
0
585
0
python,django,validation,architecture,django-models
I am not sure if this is best practise but what I do is that I tend to validate both client side and server side before pushing the data to the database. I know it requires a lot more effort but this can be done by setting some values before use and then maintaining them. You could also try push in size contraints with...
0
0
0
0
2009-07-10T11:09:00.000
5
0
false
1,108,967
0
0
1
4
I use django and I wonder in what cases where model validation should go. There are at least two variants: Validate in the model's save method and to raise IntegrityError or another exception if business rules were violated Validate data using forms and built-in clean_* facilities From one point of view, answer is ob...
Separation of ORM and validation
1,109,190
0
0
585
0
python,django,validation,architecture,django-models
Your two options are two different things. Form-based validation can be regarded as syntactic validation + convert HTTP request parameters from text to Python types. Model-based validation can be regarded as semantic validation, sometimes using context not available at the HTTP/form layer. And of course there is a th...
0
0
0
0
2009-07-10T11:09:00.000
5
0
false
1,108,967
0
0
1
4
I use django and I wonder in what cases where model validation should go. There are at least two variants: Validate in the model's save method and to raise IntegrityError or another exception if business rules were violated Validate data using forms and built-in clean_* facilities From one point of view, answer is ob...
Separation of ORM and validation
1,109,327
0
0
585
0
python,django,validation,architecture,django-models
"but what the hell all that validation features are doing in django.db.models? " One word: Legacy. Early versions of Django had less robust forms and the validation was scattered. "So should I check such conditions in save method?" No, you should use a form for all validation. "What are the best practices of model val...
0
0
0
0
2009-07-10T11:09:00.000
5
0
false
1,108,967
0
0
1
4
I use django and I wonder in what cases where model validation should go. There are at least two variants: Validate in the model's save method and to raise IntegrityError or another exception if business rules were violated Validate data using forms and built-in clean_* facilities From one point of view, answer is ob...
Separation of ORM and validation
1,111,592
0
0
585
0
python,django,validation,architecture,django-models
DB/Model validation The data store in database must always be in a certain form/state. For example: required first name, last name, foreign key, unique constraint. This is where the logic of you app resides. No matter where you think the data comes from - it should be "validated" here and an exception raised if the re...
0
0
0
0
2009-07-10T11:09:00.000
5
0
false
1,108,967
0
0
1
4
I use django and I wonder in what cases where model validation should go. There are at least two variants: Validate in the model's save method and to raise IntegrityError or another exception if business rules were violated Validate data using forms and built-in clean_* facilities From one point of view, answer is ob...
switch versions of python
1,109,305
1
16
26,273
0
python,development-environment,ubuntu-9.04
"Question1: How will i tell any framework that go and use version so and so pf python like day django to use 2.6 and say mjango to use 2.4?" You simply run them with the specific python version they need. Run mjango with /usr/bin/python2.4 and django with /usr/bin/python2.6. As easy as that. "Question2: Is there more e...
0
0
0
0
2009-07-10T11:12:00.000
7
0.028564
false
1,108,974
1
0
1
2
Story: One of the app that i have works on python 2.4 and other on 2.6. I tried to do a sym link of python2.4 to python and things started to break loose on ubuntu jaunty. Now i am downloading every dependency of 2.4 and installing it using python2.4 setup.py install. The dependencies seem to be endless. Question1: Ho...
switch versions of python
35,381,570
0
16
26,273
0
python,development-environment,ubuntu-9.04
Move to the project directory : Create an environment : virtualenv -p python2.7 --no-site-packages ~/env/twoseven Then activate your source : source ~/env/twoseven/bin/activate
0
0
0
0
2009-07-10T11:12:00.000
7
0
false
1,108,974
1
0
1
2
Story: One of the app that i have works on python 2.4 and other on 2.6. I tried to do a sym link of python2.4 to python and things started to break loose on ubuntu jaunty. Now i am downloading every dependency of 2.4 and installing it using python2.4 setup.py install. The dependencies seem to be endless. Question1: Ho...
How to build an Ecommerce Shopping Cart in Django?
1,111,510
3
1
10,724
0
python,django,shopping-cart
Ingredients: one cup PayPal (or subsitute with other equivalent payment system) few cups html add css to taste add django if desired Cooking: Mix well. Bake for 1-2 month. Release as open source :-)
0
0
0
0
2009-07-10T18:22:00.000
3
0.197375
false
1,111,173
0
0
1
1
Is there a book or a tutorial which teaches how to build a shopping cart with django or any other python framework ?
What are the different possible values for __name__ in a Python script, and what do they mean?
1,112,223
6
9
1,833
0
python
__name__ is usually the module name, but it's changed to '__main__' when the module in question is executed directly instead of being imported by another one. I understand that other values can only be set directly by the code you're running.
0
0
0
0
2009-07-10T21:59:00.000
2
1
false
1,112,198
1
0
1
1
Checking to see if __name__ == '__main__' is a common idiom to run some code when the file is being called directly, rather than through a module. In the process of writing a custom command for Django's manage.py, I found myself needing to use code.InteractiveConsole, which gives the effect to the user of a standard py...
How to keep an App Engine/Java app running with deaf requests from a Java/Python web cron?
4,707,002
1
3
1,731
0
java,python,google-app-engine,httpwebrequest,keep-alive
App engine also has a new PAY feature where you can have it "always-on". Costs about $0.30 USD cents a day. Just go into your billing settings and enable it if you don't mind paying for the feature. I believe it guarantees you at least 3 instances always running. (I didn't realize hitting a /ping url which caused an...
0
1
0
0
2009-07-11T06:02:00.000
4
0.049958
false
1,113,066
0
0
1
1
App Engine allows you 30 seconds to load your application My application takes around 30 seconds - sometimes more, sometimes less. I don't know how to fix this. If the app is idle (does not receive a request for a while), it needs to be re-loaded. So, to avoid the app needing to be reloaded, I want to simulate user a...
Django Model Sync Table
1,117,089
0
4
6,973
0
python,database,django,django-models,synchronization
Just to throw in an extra opinion - dmigrations is pretty nice and clear to use, but I'd say South is your best bet. Again, it's easy to get into, but it's more powerful and also has support for more database backends than just MySQL. It even handles MSSQL, if that's your thing
0
0
0
0
2009-07-12T03:21:00.000
5
0
false
1,115,238
0
0
1
2
If I change a field in a Django model, how can I synchronize it with the database tables? Do I need to do it manually on the database or is there a tool that does helps with the process?
Django Model Sync Table
1,232,838
4
4
6,973
0
python,database,django,django-models,synchronization
Can't seem to be able to add a comment to the marked answer, probably because I haven't got enough rep (be nice if SO told me so though). Anyway, just wanted to add that in the answered post, I believe it is wrong about syncdb - syncdb does not touch tables once they have been created and have data in them. You should ...
0
0
0
0
2009-07-12T03:21:00.000
5
0.158649
false
1,115,238
0
0
1
2
If I change a field in a Django model, how can I synchronize it with the database tables? Do I need to do it manually on the database or is there a tool that does helps with the process?
Static methods and thread safety
1,115,427
8
3
3,314
0
python,django,thread-safety
Functions in a module are equivalent to static methods in a class. The issue of thread safety arises when multiple threads may be modifying shared data, or even one thread may be modifying such data while others are reading it; it's best avoided by making data be owned by ONE module (accessed via Queue.Queue from other...
0
0
0
0
2009-07-12T06:32:00.000
2
1
false
1,115,420
1
0
1
1
In python with all this idea of "Everything is an object" where is thread-safety? I am developing django website with wsgi. Also it would work in linux, and as I know they use effective process management, so we could not think about thread-safety alot. I am not doubt in how module loads, and there functions are static...
Retrieve cookie created using javascript in python
1,116,535
3
2
2,627
0
python,cookies,urllib2,cookiejar
If all pages have the same JavaScript then maybe you could parse the HTML to find that piece of code, and from that get the value the cookie would be set to? That would make your scraping quite vulnerable to changes in the third party website, but that's most often the case while scraping. (Please bear in mind that th...
0
0
0
0
2009-07-12T16:25:00.000
4
1.2
true
1,116,362
0
0
1
1
I've had a look at many tutorials regarding cookiejar, but my problem is that the webpage that i want to scape creates the cookie using javascript and I can't seem to retrieve the cookie. Does anybody have a solution to this problem?
Django Initialization
1,117,692
19
10
6,064
0
python,django
settings.py is for Django settings; it's fine to put your own settings in there, but using it for arbitrary non-configuration data structures isn't good practice. Just put it in the module it logically belongs to, and it'll be run just once per instance. If you want to guarantee that the module is loaded on startup an...
0
0
0
0
2009-07-12T21:19:00.000
2
1
false
1,116,948
1
0
1
2
I have a big array, that I would like to load into memory only once when django starts up and then treat it as a read only global variable. What is the best place to put the code for the initialization of that array? If I put it in settings.py it will be reinitialized every time the settings module is imported, correct...
Django Initialization
1,117,100
9
10
6,064
0
python,django
settings.py is the right place for that. Settings.py is, like any other module, loaded once. There is still the problem of the fact that a module must be imported once for each process, so a respawning style of web server (like apache) will reload it once for each instance in question. For mod_python this will be on...
0
0
0
0
2009-07-12T21:19:00.000
2
1.2
true
1,116,948
1
0
1
2
I have a big array, that I would like to load into memory only once when django starts up and then treat it as a read only global variable. What is the best place to put the code for the initialization of that array? If I put it in settings.py it will be reinitialized every time the settings module is imported, correct...
Turbogears 2 vs Django - any advice on choosing replacement for Turbogears 1?
51,161,118
-1
12
20,511
0
python,django,google-app-engine,turbogears,turbogears2
Django ORM uses the active record implementation – you’ll see this implementation in most ORMs. Basically what it means is that each row in the database is directly mapped to an object in the code and vice versa. ORM frameworks such as Django won’t require predefining the schema to use the properties in the code. You j...
0
0
0
0
2009-07-13T07:49:00.000
7
-0.028564
false
1,118,163
0
0
1
4
I have been using Turbogears 1 for prototyping small sites for the last couple of years and it is getting a little long in the tooth. Any suggestions on making the call between upgrading to Turbogears 2 or switching to something like Django? I'm torn between the familiarity of the TG community who are pretty responsive...
Turbogears 2 vs Django - any advice on choosing replacement for Turbogears 1?
1,584,576
-1
12
20,511
0
python,django,google-app-engine,turbogears,turbogears2
Ive only got one question...is the app you are developing directed towards social networking or customized business logic? I personally find Django is good for social networking and pylons/turbogears if you really want the flexibility and no boundaries... just my 2c
0
0
0
0
2009-07-13T07:49:00.000
7
-0.028564
false
1,118,163
0
0
1
4
I have been using Turbogears 1 for prototyping small sites for the last couple of years and it is getting a little long in the tooth. Any suggestions on making the call between upgrading to Turbogears 2 or switching to something like Django? I'm torn between the familiarity of the TG community who are pretty responsive...
Turbogears 2 vs Django - any advice on choosing replacement for Turbogears 1?
1,118,237
4
12
20,511
0
python,django,google-app-engine,turbogears,turbogears2
I have been using Django for a year now and when I started I had no experience of Python or Django and found it very intuitive to use. I have created a number of hobbyist Google App Engine apps using Django with the latest one being a CMS for my site. Using Django has meant that I have been able to code a lot quicker a...
0
0
0
0
2009-07-13T07:49:00.000
7
0.113791
false
1,118,163
0
0
1
4
I have been using Turbogears 1 for prototyping small sites for the last couple of years and it is getting a little long in the tooth. Any suggestions on making the call between upgrading to Turbogears 2 or switching to something like Django? I'm torn between the familiarity of the TG community who are pretty responsive...
Turbogears 2 vs Django - any advice on choosing replacement for Turbogears 1?
1,118,670
11
12
20,511
0
python,django,google-app-engine,turbogears,turbogears2
I have experience with both Django and TG1.1. IMO, TurboGears strong point is it's ORM: SQLAlchemy. I prefer TurboGears when the database side of things is non-trivial. Django's ORM is just not that flexible and powerful. That being said, I prefer Django. If the database schema is a good fit with Django's ORM I would g...
0
0
0
0
2009-07-13T07:49:00.000
7
1.2
true
1,118,163
0
0
1
4
I have been using Turbogears 1 for prototyping small sites for the last couple of years and it is getting a little long in the tooth. Any suggestions on making the call between upgrading to Turbogears 2 or switching to something like Django? I'm torn between the familiarity of the TG community who are pretty responsive...
Migrating Django Application to Google App Engine?
1,118,790
1
9
1,845
1
python,django,google-app-engine
There are a few things that you can't do on the App Engine that you can do on your own server like uploading of files. On the App Engine you kinda have to upload it and store the datastore which can cause a few problems. Other than that it should be fine from the Presentation part. There are a number of other little th...
0
1
0
0
2009-07-13T10:40:00.000
4
0.049958
false
1,118,761
0
0
1
2
I'm developing a web application and considering Django, Google App Engine, and several other options. I wondered what kind of "penalty" I will incur if I develop a complete Django application assuming it runs on a dedicated server, and then later want to migrate it to Google App Engine. I have a basic understanding of...
Migrating Django Application to Google App Engine?
1,119,377
8
9
1,845
1
python,django,google-app-engine
Most (all?) of Django is available in GAE, so your main task is to avoid basing your designs around a reliance on anything from Django or the Python standard libraries which is not available on GAE. You've identified the glaring difference, which is the database, so I'll assume you're on top of that. Another difference...
0
1
0
0
2009-07-13T10:40:00.000
4
1.2
true
1,118,761
0
0
1
2
I'm developing a web application and considering Django, Google App Engine, and several other options. I wondered what kind of "penalty" I will incur if I develop a complete Django application assuming it runs on a dedicated server, and then later want to migrate it to Google App Engine. I have a basic understanding of...
Java Python Integration
58,624,426
7
57
81,995
0
java,python,integration
The best solutions, is to use Python programs throw REST API. You define your services and call them. You perhaps need to learn some new modules. But you will be more flexible for futures changes. Here a small list of use full modules for this purpose: Python modules Flask Flask-SQLAlchemy Flask-Restful SQlite3 Jsonif...
0
0
0
0
2009-07-13T14:15:00.000
12
1
false
1,119,696
1
0
1
1
I have a Java app that needs to integrate with a 3rd party library. The library is written in Python, and I don't have any say over that. I'm trying to figure out the best way to integrate with it. I'm trying out JEPP (Java Embedded Python) - has anyone used that before? My other thought is to use JNI to communicate wi...
Platform for developing all things google?
1,121,377
0
4
263
0
java,python,android,platform
I'd throw down another vote for Eclipse. I've been using it on the mac and I find it to be very buggy. Not sure if that's just the nature of the beast... My experiences with it on XP have been more stable. Haven't had time to check it out on Ubuntu.
0
1
0
0
2009-07-13T15:48:00.000
3
0
false
1,120,297
0
0
1
2
I am interested in developing things for google apps and android using python and java. I am new to both and was wondering if a environment set in windows or linux would be more productive for these tasks?
Platform for developing all things google?
1,122,211
0
4
263
0
java,python,android,platform
Internally, I believe Google uses Eclipse running on Ubuntu for Android development, so that'd be your best bet if you're completely paranoid about avoiding all potential issues. Of course, this is impossible, and really you should just use whatever you're comfortable in.
0
1
0
0
2009-07-13T15:48:00.000
3
0
false
1,120,297
0
0
1
2
I am interested in developing things for google apps and android using python and java. I am new to both and was wondering if a environment set in windows or linux would be more productive for these tasks?
Django templates: adding sections conditionally
1,120,987
1
0
235
0
python,django,django-templates
The answer to this depends a lot on how you've structured your data, which you don't say - are the extra bits of information in separate related tables, subclassed models, individual fields on the same model...? In general, this sounds like a job for a template tag. I would probably write a custom tag that took your pa...
0
0
0
0
2009-07-13T17:31:00.000
2
0.099668
false
1,120,914
0
0
1
1
I just started using django for development. At the moment, I have the following issue: I have to write a page template able to represent different categories of data. For example, suppose I have a medical record of a patient. The represented information about this patient are, for example: name, surname and similar d...
Eliminating certain Django Session Calls
1,121,363
1
0
208
0
python,django,session
Sessions are lazily loaded: if you don't use the session during a request, Django won't load it. This includes request.user: if you access it, it accesses the session to find the user. (It loads lazily, too--if you don't access request.user, it won't access the session, either.) So, figure out what's accessing the ses...
0
0
0
0
2009-07-13T18:40:00.000
1
1.2
true
1,121,299
0
0
1
1
I was wondering if I could eliminate django session calls for specific views. For example, if I have a password reset form I don't want a call to the DB to check for a session or not. Thanks!
creating non-reloading dynamic webapps using Django
1,129,395
1
0
823
0
python,ajax,django
Maybe a few iFrames and some Comet/long-polling? Have the comment submission in an iFrame (so the whole page doesn't reload), and then show the result in the long-polled iFrame... Having said that, it's a pretty bad design idea, and you probably don't want to be doing this. AJAX/JavaScript is pretty much the way to go ...
0
0
0
0
2009-07-15T03:15:00.000
4
0.049958
false
1,129,210
0
0
1
2
As far as I know, for a new request coming from a webapp, you need to reload the page to process and respond to that request. For example, if you want to show a comment on a post, you need to reload the page, process the comment, and then show it. What I want, however, is I want to be able to add comments (something...
creating non-reloading dynamic webapps using Django
1,129,222
8
0
823
0
python,ajax,django
You want to do that with out any client side code (javascript and ajax are just examples) and with out reloading your page (or at least part of it)? If that is your question, then the answer unfortunately is you can't. You need to either have client side code or reload your page. Think about it, once the client get's t...
0
0
0
0
2009-07-15T03:15:00.000
4
1.2
true
1,129,210
0
0
1
2
As far as I know, for a new request coming from a webapp, you need to reload the page to process and respond to that request. For example, if you want to show a comment on a post, you need to reload the page, process the comment, and then show it. What I want, however, is I want to be able to add comments (something...
Jython or JRuby?
1,130,727
1
4
5,421
0
python,ruby,jruby,jython
The compatibility in either case is at the source-code level; with necessary changes where the Python or Ruby code invokes packages that involve native code (especially, standard Python packages like ctypes are not present in Jython).
0
0
0
1
2009-07-15T10:50:00.000
5
0.039979
false
1,130,697
0
0
1
3
It's a high level conceptual question. I have two separate code bases that serve the same purpose, one built in Python and the other in Ruby. I need to develop something that will run on JVM. So I have two choices: convert the Python code to Jython or convert the Ruby to JRuby. Since I don't know any of them, I was won...
Jython or JRuby?
1,140,847
1
4
5,421
0
python,ruby,jruby,jython
Anything you can do in one, you can do in the other. Learn enough of both to realise which one appeals to your coding sensibilities. There is no right or wrong answer here.
0
0
0
1
2009-07-15T10:50:00.000
5
0.039979
false
1,130,697
0
0
1
3
It's a high level conceptual question. I have two separate code bases that serve the same purpose, one built in Python and the other in Ruby. I need to develop something that will run on JVM. So I have two choices: convert the Python code to Jython or convert the Ruby to JRuby. Since I don't know any of them, I was won...
Jython or JRuby?
1,130,722
5
4
5,421
0
python,ruby,jruby,jython
In both cases, most of the code should Just Work™. I don't know of a really compelling reason to choose Jython over JRuby or vice versa if you'll be learning either from scratch. Python places a heavy emphasis on readability and not using "magic", but Ruby tends to give you a little more rope to do fancy things, e.g., ...
0
0
0
1
2009-07-15T10:50:00.000
5
0.197375
false
1,130,697
0
0
1
3
It's a high level conceptual question. I have two separate code bases that serve the same purpose, one built in Python and the other in Ruby. I need to develop something that will run on JVM. So I have two choices: convert the Python code to Jython or convert the Ruby to JRuby. Since I don't know any of them, I was won...
Count lines of code in a Django Project
1,133,417
1
11
6,904
0
python,django
Check out the wc command on unix.
0
0
0
0
2009-07-15T19:17:00.000
5
0.039979
false
1,133,391
0
0
1
1
Is there an easy way to count the lines of code you have written for your django project? Edit: The shell stuff is cool, but how about on Windows?
Keep ConfigParser output files sorted
1,134,323
-1
7
6,931
0
python,configuration,configparser
ConfigParser is based on the ini file format, who in it's design is supposed to NOT be sensitive to order. If your config file format is sensitive to order, you can't use ConfigParser. It may also confuse people if you have an ini-type format that is sensitive to the order of the statements...
0
0
0
0
2009-07-15T21:03:00.000
4
-0.049958
false
1,134,071
1
0
1
1
I've noticed with my source control that the content of the output files generated with ConfigParser is never in the same order. Sometimes sections will change place or options inside sections even without any modifications to the values. Is there a way to keep things sorted in the configuration file so that I don't ha...
Google App engine template unicode decoding problem
1,140,751
2
2
2,383
0
python,django,google-app-engine,unicode
Are you using Django 0.96 or Django 1.0? You can check by looking at your main.py and seeing if it contains the following: from google.appengine.dist import use_library use_library('django', '1.0') If you're using Django 1.0, both FILE_CHARSET and DEFAULT_CHARSET should default to 'utf-8'. If your template is saved u...
0
1
0
0
2009-07-16T17:40:00.000
3
0.132549
false
1,139,151
0
0
1
3
When trying to render a Django template file in Google App Engine from google.appengine.ext.webapp import template templatepath = os.path.join(os.path.dirname(file), 'template.html') self.response.out.write (template.render( templatepath , template_values)) I come across the following error: <type 'exceptions.Unico...
Google App engine template unicode decoding problem
1,139,534
1
2
2,383
0
python,django,google-app-engine,unicode
Did you check in your text editor that the template is encoded in utf-8?
0
1
0
0
2009-07-16T17:40:00.000
3
0.066568
false
1,139,151
0
0
1
3
When trying to render a Django template file in Google App Engine from google.appengine.ext.webapp import template templatepath = os.path.join(os.path.dirname(file), 'template.html') self.response.out.write (template.render( templatepath , template_values)) I come across the following error: <type 'exceptions.Unico...
Google App engine template unicode decoding problem
1,141,420
6
2
2,383
0
python,django,google-app-engine,unicode
Well, turns out the rendered results returned by the template needs to be decoded first: self.response.out.write (template.render( templatepath , template_values).decode('utf-8') ) A silly mistake, but thanks for everyone's answers anyway. :)
0
1
0
0
2009-07-16T17:40:00.000
3
1.2
true
1,139,151
0
0
1
3
When trying to render a Django template file in Google App Engine from google.appengine.ext.webapp import template templatepath = os.path.join(os.path.dirname(file), 'template.html') self.response.out.write (template.render( templatepath , template_values)) I come across the following error: <type 'exceptions.Unico...
What are the best books and resources for learning to develop, deploy and/or host Django?
1,152,601
2
15
2,869
0
python,django,apache
Found Python Web Development with Django by Forcier, Bissex and Chun a great start. 50 pages on python to get you going and all the basics of Django.
0
0
0
0
2009-07-17T20:06:00.000
8
0.049958
false
1,145,414
0
0
1
1
I'm a newbie on the Django scene coming from an ASP.NET C# background. I'm looking for some good resources to help me learn the ins and outs of Django/Python. Any recommendations?
How to make easy_install expand a package into directories rather than a single egg file?
1,145,611
5
3
1,188
0
python,django,setuptools,easy-install,egg
You add zip_safe = False as an option to setup(). I don't think it has to do with directories. Setuptools will happily eggify packages with loads of directories in it. Then of course it's another problem that this part of Django doesn't find the package even though it's zipped. It should.
0
0
0
0
2009-07-17T20:29:00.000
1
1.2
true
1,145,524
1
0
1
1
How exactly do I configure my setup.py file so that when someone runs easy_install the package gets expanded into \site-packages\ as a directory, rather than remaining inside an egg. The issue I'm encountering is that one of the django apps I've created won't auto-detect if it resides inside an egg. EDIT: For example, ...
Possible to access gdata api when using Java App Engine?
1,149,886
0
0
802
0
java,python,google-app-engine,gdata-api
I'm having a look into the google data api protocol which seems to solve the problem.
0
0
1
0
2009-07-18T18:08:00.000
3
1.2
true
1,148,165
0
0
1
1
I have a dilemma where I want to create an application that manipulates google contacts information. The problem comes down to the fact that Python only supports version 1.0 of the api whilst Java supports 3.0. I also want it to be web-based so I'm having a look at google app engine, but it seems that only the python v...
Using Task Queues to schedule the fetching/parsing of a number of feeds in App Engine (Python)
1,148,720
2
0
365
0
python,google-app-engine,feed
2 fetches per task? 3?
0
1
0
0
2009-07-18T22:04:00.000
3
0.132549
false
1,148,709
0
0
1
2
Say I had over 10,000 feeds that I wanted to periodically fetch/parse. If the period were say 1h that would be 24x10000 = 240,000 fetches. The current 10k limit of the labs Task Queue API would preclude one from setting up one task per fetch. How then would one do this? Update: RE: Fetching nurls per task - Given the 3...
Using Task Queues to schedule the fetching/parsing of a number of feeds in App Engine (Python)
1,148,729
0
0
365
0
python,google-app-engine,feed
Group up the fetches, so instead of queuing 1 fetch you queue up, say, a work unit that does 10 fetches.
0
1
0
0
2009-07-18T22:04:00.000
3
0
false
1,148,709
0
0
1
2
Say I had over 10,000 feeds that I wanted to periodically fetch/parse. If the period were say 1h that would be 24x10000 = 240,000 fetches. The current 10k limit of the labs Task Queue API would preclude one from setting up one task per fetch. How then would one do this? Update: RE: Fetching nurls per task - Given the 3...
Rendering common session information in every view
1,148,886
0
0
157
0
python,django,session,templates
Are you trying to make certain areas of your site only accessible when logged on? Or certain areas of a particular page? If you want to block off access to a whole URL you can use the @login_required decorator in your functions in your view to block certain access. Also, you can use includes to keep the common parts of...
0
0
0
0
2009-07-18T23:18:00.000
3
0
false
1,148,854
0
0
1
1
I'd like to output some information that depends on session data in Django. Let's take a "Login" / "Logged in as | Logout" fragment for example. It depends on my request.session['user']. Of course I can put a user object in the context every time I render a page and then switch on {% if user %}, but that seems to brea...
SQLAlchemy and django, is it production ready?
1,308,718
4
23
12,511
1
python,database,django,sqlalchemy
Jacob Kaplan-Moss admitted to typing "import sqlalchemy" from time to time. I may write a queryset adapter for sqlalchemy results in the not too distant future.
0
0
0
0
2009-07-20T15:44:00.000
5
0.158649
false
1,154,331
0
0
1
3
Has anyone used SQLAlchemy in addition to Django's ORM? I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins). Is it possible? Note: I'm aware about django-sqlalchemy but the project doesn't seem to be production ready.
SQLAlchemy and django, is it production ready?
1,155,407
19
23
12,511
1
python,database,django,sqlalchemy
What I would do, Define the schema in Django orm, let it write the db via syncdb. You get the admin interface. In view1 you need a complex join def view1(request): import sqlalchemy data = sqlalchemy.complex_join_magic(...) ... payload = {'data': data, ...} return render_to_re...
0
0
0
0
2009-07-20T15:44:00.000
5
1.2
true
1,154,331
0
0
1
3
Has anyone used SQLAlchemy in addition to Django's ORM? I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins). Is it possible? Note: I'm aware about django-sqlalchemy but the project doesn't seem to be production ready.
SQLAlchemy and django, is it production ready?
3,555,602
7
23
12,511
1
python,database,django,sqlalchemy
I've done it before and it's fine. Use the SQLAlchemy feature where it can read in the schema so you don't need to declare your fields twice. You can grab the connection settings from the settings, the only problem is stuff like the different flavours of postgres driver (e.g. with psyco and without). It's worth it as ...
0
0
0
0
2009-07-20T15:44:00.000
5
1
false
1,154,331
0
0
1
3
Has anyone used SQLAlchemy in addition to Django's ORM? I'd like to use Django's ORM for object manipulation and SQLalchemy for complex queries (like those that require left outer joins). Is it possible? Note: I'm aware about django-sqlalchemy but the project doesn't seem to be production ready.
Django, how to make a view atomic?
1,155,531
-1
1
2,233
0
python,database,django,locking,atomic
Wrap the DB queries that read and the ones that update in a transaction. The syntax depends on what ORM you are using.
0
0
0
0
2009-07-20T19:38:00.000
3
-0.066568
false
1,155,513
0
0
1
1
I have a simple django app to simulate a stock market, users come in and buy/sell. When they choose to trade, the market price is read, and based on the buy/sell order the market price is increased/decreased. I'm not sure how this works in django, but is there a way to make the view atomic? i.e. I'm concerned that u...
Seeding random in django
1,156,541
3
4
2,315
0
python,django,random,django-views
Call random.seed() rarely if at all. To be random, you must allow the random number generator to run without touching the seed. The sequence of numbers is what's random. If you change the seed, you start a new sequence. The seed values may not be very random, leading to problems. Depending on how many numbers you ...
0
0
0
0
2009-07-20T23:26:00.000
3
1.2
true
1,156,511
0
0
1
3
In a view in django I use random.random(). How often do I have to call random.seed()? One time for every request? One time for every season? One time while the webserver is running?