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
Should one minify server code when it's in production?
6,811,024
6
36
3,747
0
php,python,ruby,perl,node.js
i do not believe this offers any benefit to server side code since the server evaluates the code and doesn't actually send it down. If you are looking to optimize production code you can look into setting up a compiler cache such as APC for PHP
0
0
0
1
2011-07-25T01:24:00.000
4
1
false
6,810,977
0
0
1
3
When it comes to the frontend code you always minify it (remove white spaces, comments etc) in production. Should one do the same with server code? I usually have a lot of comments in my server files. But I have never heard about people doing so. Wouldn't the server run faster if the code was optimized in the same way?
Compare "similar" numbers in Python
6,818,940
2
1
1,316
0
python,math,rounding
You are experiencing Python 2's integer division. When you divide two integers, Python (and many other languages) throw away the remainder. You'll want to divide by a float instead of an integer, as Dogbert indicated.
0
0
0
0
2011-07-25T15:38:00.000
4
0.099668
false
6,818,610
0
0
1
2
In order to sync my iPod and my local music repository, I created a unique key for each track using its metadata. The unique track consists of the track's following metadata fields: artist, album, track number, duration. The iPod saves the track's duration in milliseconds, but my local repository saves it in seconds. For example: 437590 milliseconds on iPod is 438 seconds in my Local repository. When I divide the ipod's track duration by 1000 I get 437. I tried using round(), but round (b.tracklen/1000) prints 437. I can hack this by checking math.ceil(), math.floor() for the iPod duration if there is no match but it's a lousy solution. What is the best approach to this issue?
Compare "similar" numbers in Python
6,818,771
-2
1
1,316
0
python,math,rounding
Honestly, I think you nailed it already with the floor and ceil calls, but for somplicity you might want to do floor((ipodtime/1000)+1) == localrepostime to check equality since the ipod time seems to round down no matter what.
0
0
0
0
2011-07-25T15:38:00.000
4
-0.099668
false
6,818,610
0
0
1
2
In order to sync my iPod and my local music repository, I created a unique key for each track using its metadata. The unique track consists of the track's following metadata fields: artist, album, track number, duration. The iPod saves the track's duration in milliseconds, but my local repository saves it in seconds. For example: 437590 milliseconds on iPod is 438 seconds in my Local repository. When I divide the ipod's track duration by 1000 I get 437. I tried using round(), but round (b.tracklen/1000) prints 437. I can hack this by checking math.ceil(), math.floor() for the iPod duration if there is no match but it's a lousy solution. What is the best approach to this issue?
Python on IIS: how?
25,462,179
3
66
85,151
0
python,iis
just make sure the path to the directory holding the cgi scripts doesn't have spaces or &. i tried lots of things for many days and nothing worked then i changed the path and it worked UPDATE: If it has spaces, put quotes around the path, but not the %s %s like this: "C:\Program Files\Python36\python.exe" %s %s
0
0
0
1
2011-07-25T22:47:00.000
4
0.148885
false
6,823,316
1
0
1
1
I've got a background in PHP, dotNet and am charmed by Python. I want to transpose functionality from PHP to Python step by step, running bits and pieces side-by-side. During this transition, which could take 2 years since the app is enormous, I am bound to IIS. I've got 15 years background of web-programming, including some C work in an ISAPI module on IIS which is the kind of work I don't want to dive into any more. It seems Python just doesn't run well on IIS. I've struggled with FastCGI (not supported, just for PHP) and PyIsapie (badly documented, couldn't get it up and running). In the end I got it up and running with a HeliconZoo dll BUT: My next problem is: how to debug/develop a site? In PHP you install a debugger and whenever you have a problem in your website, you just debug it, set a breakpoint, step through code, inspect watches and such. It seems to me this is the most rudimentary type of work for a developer or troubleshooter. I've bought WingIDE which is an excellent tool and debugger but it can't hook into the Python instance in the IIS process for some reason so no debugging. I noticed Helicon starts Python with -O so I even recompiled Python to ignore this flag altogether but my debugger (WingIDE) just won't come up. I can set up a PHP 'hello world' website on IIS in half an hour including download time. I think I've spent about 120 hours or more getting this to work for Python to no avail. I've bought Programming Python and Learning Python which is about 3000 pages. And I've googled until I dropped. I think Python is a great language but I'm on the verge of aborting my attempts. Is there anyone who can give me a step-by-step instruction on how to set this up on IIS7?
Page scroll bar freezes while div is updated by Ajax responseText
6,824,093
0
0
510
0
javascript,jquery,python,ajax
Try to implement a loader with a freezing background.
0
0
1
0
2011-07-26T00:39:00.000
2
0
false
6,824,062
0
0
1
2
I'm using jQuery's $.ajax() to send Ajax request to server and bring back a large chunk of HTML content to replace the content of a div. Everything works fine except for the problem that while the div is being updated, the page is kind of frozen (even the vertical scroll bar is not draggable). It comes back to normal after the div is updated. Anyone knows if this is desired behavior? (yes, the HTML content is a little big but not super big) Thanks
Page scroll bar freezes while div is updated by Ajax responseText
6,825,203
0
0
510
0
javascript,jquery,python,ajax
Can you link your ajax code? I think you are doing a sync call, try setting async: true. Still without the code thats all I can think about.
0
0
1
0
2011-07-26T00:39:00.000
2
0
false
6,824,062
0
0
1
2
I'm using jQuery's $.ajax() to send Ajax request to server and bring back a large chunk of HTML content to replace the content of a div. Everything works fine except for the problem that while the div is being updated, the page is kind of frozen (even the vertical scroll bar is not draggable). It comes back to normal after the div is updated. Anyone knows if this is desired behavior? (yes, the HTML content is a little big but not super big) Thanks
Smart Automatic Scraping
6,853,367
4
1
1,205
0
python
does this look like a good design ? No. what tools would you choose to do it in if you program in python ? Beautiful Soup find automatically the right table in the HTML page, -- probably by searching the text for some sample data and trying to find the common HTML element which contain both Bad idea. A better idea is to write a short script to find all tables, dump the table and the XPath to the table. A person looks at the table and copies the XPath into a script. extract the rows -- by looking at above two elements and selecting the same patten Bad idea. A better idea is to write a short script to find all tables, dump the table with the headings. A person looks at the table and configures a short block of Python code to map the table columns to data elements in a namedtuple. identify which column contains what -- by using some fuzzy algorithm to best guess which column is what. A person can do this trivially. export it to some python / other list -- cleaning everytihng. Almost a good idea. A person picks the right XPath to the table. A person writes a short snippet of code to map column names to a namedtuple. Given these parameters, then a Python script can get the table, map the data and produce some useful output. Why include a person? Because web pages are filled with notoriously bad errors. After having spent the last three years doing this, I'm pretty sure that fuzzy logic and magical "trying to find" and "selecting the same patten" isn't a good idea and doesn't work. It's easier to write a simple script to create a "data profile" of the page. It's easier to write a simple script reads a configuration file and does the processing.
0
0
1
0
2011-07-27T22:35:00.000
2
0.379949
false
6,852,061
0
0
1
1
I have this problem, I need to scrape lots of different HTML data sources, each data source contains a table with lots of rows, for example country name, phone number, price per minute. I would like to build some semi automatic scraper which will try to .. find automatically the right table in the HTML page, -- probably by searching the text for some sample data and trying to find the common HTML element which contain both extract the rows -- by looking at above two elements and selecting the same patten identify which column contains what -- by using some fuzzy algorithm to best guess which column is what. export it to some python / other list -- cleaning everytihng. does this look like a good design ? what tools would you choose to do it in if you program in python ?
Buildout vs virtualenv + pip for django?
6,870,373
12
12
2,492
0
python,django,virtualenv,pip,buildout
At the core, buildout and pip+virtualenv do the same. They both use python packages, install them, isolate them from the rest of your python environment, handle dependencies (through setup.py) and so on. Buildout does more. Which, naturally, means a bit more configuration than with pip. You'll have to figure out whether the extra configuration is worth the effort for what you get back from it. Some of the extras you can get out of buildout with a couple of add-ons ("recipes"): The 'djangorecipe' addon that sets up django for you. No need for that environment variable that points at your settings.py file, for instance. Handy. Automatically setting up a cronjob. Generating config files (like an apache one for your site) from a template. Uses variables from your buildout config, so this prevents duplication. Basically, you can get some explicit configuration done with buildout. Fewer manual steps. On the other hand, you can use other tools for that extra level of automation that you probably need. So virtualenv+pip+something_else is also a possibility.
0
0
0
0
2011-07-28T21:25:00.000
1
1.2
true
6,865,896
1
0
1
1
Pros and cons? I'm personally using buildout for my django projects but thinking of switching to virtualenv + pip for its simplicity.
Starting game development in javascript. Where to draw the line between JS and Server Language
6,867,016
1
0
1,209
0
javascript,python
to a certain extent, the problem can be considered in terms of economic forces, where you maximize your own utility and minimize costs. In the case of a game with a client/server aspect, The actual forces acting on you are consuming server resources costs you actual money, but consuming client resources doesn't clients could try to cheat, so you have to validate some of the data coming from a client if you consume too much client resources, clients won't want to play, since their utility is outweighed by their costs. Each of these points can be subtle enough to merit some additional discussion. The actual cost of getting your game to clients comes in two parts, the cost of the physical hardware necessary to run the game, and the cost of the network bandwidth to distribute it to clients. Often you might have to trade one for the other; optimizing network usage means you have to be better at anticipating what clients will need or do, increasing processing demands, but offloading more of processing the work to the client means sending more data to the client. There's only so much work the client can do, though. For instance You can't always trust the client to tell you where they aught to be, because that might mean that they are flying around in the air, or teleporting from place to place; You have to actually make sure that clients actually can do the things that they say they're doing. The particular nature of the game can determine how far you have to go, though. In man MMO games, extreme measures are often taken to limit the activity of bot players, but that often has a negative affect on real players. Strictly cooperative games often suffer less even when abusers are at work. Not all potential users of your game have the best available hardware, or are willing to upgrade to the latest, fastest browser, So to make a successful game often means toning down the graphics enough so that a majority of users can play it. Surprisingly, it's often the case that an either client or server approach doesn't actually produce the ideal results. Instead you have to implement key game logic in both places, On the client so that the game feels responsive to the user, but also on the server to mitigate abuse and decide player to player interactions fairly.
0
0
0
0
2011-07-28T23:03:00.000
2
1.2
true
6,866,802
0
0
1
2
Im fairly proficient in php and am also learning python. I have been wanting to create a basic game for some time now and would like to create it in python. But in order to have a fancy smooth interface I need to use javascript (i dont much care for the flash/silverlight route). So I decided to start looking up game development in JavaScript. And in doing so most of the examples I have seen are games nearly completely done in javascript. And many of these games are quite nice. But what im wondering, is if i combine python and javascript together for creating games; should I rely more heavily on javascript and let python do some of the background stuff? Or should I only use javascript for the basic UI elements, animation, flashy stuff and whatnot and keep the core game engine in python. Or some kind of mix between the two. For php/python im mostly used to MVC style frameworks. So if i used JS only for the visuals would I just make heavy use of the in the view files as I would with a normal application? I know I can make a game in either language completely, but to use the best of both worlds im not quite sure where I should draw the line on letting python do work and letting JS do the work. Also as a reference I would like to use some advanced features like canvas/svg and so on. Not really so much WebGL. And the game I have in mind to practice on is an isometric style RTS. The game will mostly be for learning. Im not really planning on releasing it. Any input is appreciated. Clarification: the game will be web based. My web server is nginx. The games i would like to to would be multiplayer games where multiple people are playing online at the same time. Think world of warcraft. each server could hold up to N players that play against eachother. When that one is say 80% full a new one is spun up. Or something along those lines. I would like for the players to actually be able to interact with eachother live. Which is why in same ways i was also kind of looking into node.js but dont know as much about it yet. but seemed like it could fit. -- Update: Im also planning on using mongodb as the database, if that matters to anyones answer.
Starting game development in javascript. Where to draw the line between JS and Server Language
6,866,829
1
0
1,209
0
javascript,python
python would probably run on the server powering your web server. If you want to write multiplayer client-server games then a lot of server code/logic would be in python. If you want to write simpler singleplayer games then all your code is in the client (browser) and would be javascript. Python would just be there for serving your web game. If you want to write desktop games you can do that in python using the pygame library. So depends on what you want. Multiplayer web game : client in JS, server in pythong Singleplayer web game : client in JS, server only for serving web files Desktop game : client in python.
0
0
0
0
2011-07-28T23:03:00.000
2
0.099668
false
6,866,802
0
0
1
2
Im fairly proficient in php and am also learning python. I have been wanting to create a basic game for some time now and would like to create it in python. But in order to have a fancy smooth interface I need to use javascript (i dont much care for the flash/silverlight route). So I decided to start looking up game development in JavaScript. And in doing so most of the examples I have seen are games nearly completely done in javascript. And many of these games are quite nice. But what im wondering, is if i combine python and javascript together for creating games; should I rely more heavily on javascript and let python do some of the background stuff? Or should I only use javascript for the basic UI elements, animation, flashy stuff and whatnot and keep the core game engine in python. Or some kind of mix between the two. For php/python im mostly used to MVC style frameworks. So if i used JS only for the visuals would I just make heavy use of the in the view files as I would with a normal application? I know I can make a game in either language completely, but to use the best of both worlds im not quite sure where I should draw the line on letting python do work and letting JS do the work. Also as a reference I would like to use some advanced features like canvas/svg and so on. Not really so much WebGL. And the game I have in mind to practice on is an isometric style RTS. The game will mostly be for learning. Im not really planning on releasing it. Any input is appreciated. Clarification: the game will be web based. My web server is nginx. The games i would like to to would be multiplayer games where multiple people are playing online at the same time. Think world of warcraft. each server could hold up to N players that play against eachother. When that one is say 80% full a new one is spun up. Or something along those lines. I would like for the players to actually be able to interact with eachother live. Which is why in same ways i was also kind of looking into node.js but dont know as much about it yet. but seemed like it could fit. -- Update: Im also planning on using mongodb as the database, if that matters to anyones answer.
Parsing form data / multi-part requests with Pythons WSGI
6,909,531
1
2
1,493
0
python,wsgi,multipartform-data,form-data
You can use cgi.FieldStorage to parse form posts etc. You may be better off though using Werkzeug/Flask which has its own implementation which works a lot better, plus you get higher level stuff which makes things a lot easier.
0
0
1
0
2011-07-29T05:42:00.000
1
1.2
true
6,869,107
0
0
1
1
Is there a recommendable library to parse form data and/or multi-part requests with Python and WSGI?
What’s the most forgiving HTML parser in Python?
6,870,510
1
4
1,484
0
python,html-parsing,beautifulsoup,lxml,pyquery
If beautifulsoup doesn't fix your html problem, the next best solution would be regular expression. lxml, elementtree, minidom are very strict in parsing and actually they are doing right. Other tips: I feed the html to lynx browser through command prompt, and take out the text version of the page/content and parse using regex. Converting to html to text or html to markdown strips all the html tags and you will remain with text. That is easy to parse.
0
0
1
0
2011-07-29T08:22:00.000
4
0.049958
false
6,870,446
0
0
1
2
I have some random HTML and I used BeautifulSoup to parse it, but in most of the cases (>70%) it chokes. I tried using Beautiful soup 3.0.8 and 3.2.0 (there were some problems with 3.1.0 upwards), but the results are almost same. I can recall several HTML parser options available in Python from the top of my head: BeautifulSoup lxml pyquery I intend to test all of these, but I wanted to know which one in your tests come as most forgiving and can even try to parse bad HTML.
What’s the most forgiving HTML parser in Python?
6,896,409
2
4
1,484
0
python,html-parsing,beautifulsoup,lxml,pyquery
I ended up using BeautifulSoup 4.0 with html5lib for parsing and is much more forgiving, with some modifications to my code it's now working considerabily well, thanks all for suggestions.
0
0
1
0
2011-07-29T08:22:00.000
4
1.2
true
6,870,446
0
0
1
2
I have some random HTML and I used BeautifulSoup to parse it, but in most of the cases (>70%) it chokes. I tried using Beautiful soup 3.0.8 and 3.2.0 (there were some problems with 3.1.0 upwards), but the results are almost same. I can recall several HTML parser options available in Python from the top of my head: BeautifulSoup lxml pyquery I intend to test all of these, but I wanted to know which one in your tests come as most forgiving and can even try to parse bad HTML.
Developing an application server: django vs. zend vs. cakephp vs. codeigniter vs. other
6,876,279
1
0
1,278
0
php,python,django,zend-framework,cakephp
All of the frameworks that you mentioned are capable. Pick one in the language that you know the best and use that.
0
0
0
0
2011-07-29T16:24:00.000
2
1.2
true
6,876,120
0
0
1
1
I'm trying to develop an application server that will deliver content to a core group of websites, as well as provide third party services to other websites that also want to use this content. The app server will be hosting web services for these core + 3rd party websites. Authentication and all that comes into play. The data itself will consist of millions of records. These records will come from a variety of sources: APIs, RSS feeds, REST services, etc. This app server will essentially collect this data on a routine basis, and update the database with this new information. This data will then be shared via some sort of web service (most likely REST) to the core websites and 3rd party websites. FYI, I'm making a distinction between core sites and 3rd party websites because there will be different access levels, i.e. a core website will have more access than a 3rd party website. All that said, I'm trying to make the best decision on which framework to use. At the risk of losing all credibility, I currently have a ton of this code written as a wordpress plugin. What started as a one-time site evolved into several sites, and some homebrew hacking to make my outdated infrastructure work across multiple sites. I'm looking to migrate all of this to a new application server, with a solid framework. Since everything is written in PHP, obviously I'm tempted to do the migration in PHP. However, I'm considering Python because of its powerful ability to manipulate data. I don't know if it's worth the hassle, though, of rewriting a lot of code in Python. Could anyone give me some tips on what I should do? I'm really looking to clean up a big mess more than anything, and would like a framework to encourage some solid programming conventions.
Suggest a standalone python web framework?
6,877,382
0
3
2,446
0
python,frameworks
I don't think that any web framework is specifically oriented for the use case you're talking about; They all assume they are running on a server and there's a browser on a remote machine that is accessing them. A better approach is to think about the HTTP server you'll be using. It's probably preferable to use a server that's as easy to pack and ship as the rest of the python code you'll be using. Now most frameworks provide a 'development' server that's easy to invoke from the command line, but most of them are intended to be "easy for the developer" which often means they are restricted to a single thread. This is bad for deployment because single threaded servers will always feel a bit sluggish. CherryPy stands out in contrast, by providing a full featured, embedded server that's easy to configure for many use cases, and is available by default with the rest of the framework. There are probably others, but I haven't used 'em.
0
0
0
0
2011-07-29T18:16:00.000
6
0
false
6,877,301
0
0
1
1
I have a python program that I would like to present as a simple web application. The program currently uses sqlite for storage. I also need to distribute the whole thing to colleagues so having something standalone and easy to start would be ideal ( no install if possible). This web app is meant to be used locally , not by multiple users over a network. Is there a suitable python framework that might fit my needs? I looked at Django so far but it seems a bit heavy handed for what I need. Thanks for any suggestions.
DNSSEC Sign RRSET using DNSPython
6,890,137
0
3
884
0
python,dns,dnspython
Do you really have to do it with DNSPython? Is this a custom name server? The typical way you normally do it (with bind, for example) is by pre-signing the zone file. The DNSSEC RRSIG does not have any dependency on the connection parameters so we don't really have to do on-the-fly signing. Also, things like NSEC would be easier to handle if you pre-sign.
0
0
0
0
2011-07-29T18:40:00.000
1
0
false
6,877,553
0
0
1
1
I'm trying to DNSSEC Sign a RRSET, however I am not able finding any references to how to do so using DNSPython. Yes it has dns.dnssec.validate_rrsig(), but I want to DNSSEC sign a rrset, how can this be done? I've been pooring over the RFC's however I'm obviously lacking something in order to make it work.
How to serve static files in production for Django 1.3
6,878,503
3
2
940
0
python,django,apache,wsgi
. 4. Point Apache at your static folder.
0
0
0
0
2011-07-29T20:01:00.000
3
1.2
true
6,878,404
0
0
1
1
I'm deploying my app and I wonder what I'm missing. I did the following: Set my STATIC_ROOT to an empty folder in my server. Set the STATIC_URL to '/static/' Added 'django.contrib.staticfiles' to INSTALLED_APPS In development my static files are in the root of my app in a folder named static. So, I ran manage.py collectstatic and all my files were copied to my static_root. However, it doesn't work. I don't know if i'm missing any step. Any help would be great Thanks
PDF Thumbnailing with Google App Engine (Python)
6,893,852
1
4
568
0
python,google-app-engine,pdf
No. This requires a PDF renderer, and to the best of my knowledge no such thing exists in pure-Python. You'll have to use an external service to generate thumbnails.
0
1
0
0
2011-07-29T20:26:00.000
2
1.2
true
6,878,642
0
0
1
1
Is it possible, using the python version of google app engine, to create a thumbnail of a PDF file? The goal is for the user to be able to upload a PDF, and see it represented as a thumbnail on the page.
How is transaction managed in Django's admin commands?
6,880,287
-1
6
1,967
0
python,django,django-admin
I'm not too sure, but admin forms don't reach to the commit point unless they meet clean() requirements. After that I guess everything will be committed. This behavior should be sufficient for the default forms in admin. However, for more complex forms, you can create your custom admin form and I'm pretty sure you can define whether or not you want to commit on success or on save.
0
0
0
0
2011-07-29T22:51:00.000
2
-0.099668
false
6,879,815
0
0
1
1
I just wonder how is transaction managed in django's admin commands. Commit on save? Commit on success? I can't find related info from official documents.
Calling a GWT RPC function from Python-mechanize
6,883,832
0
0
425
0
python,gwt,gwt-rpc
The answer to the question is GWT requires the content-type to be x-gwt-rpc; rather than 'application/x-www-form-urlencoded'; which is hard coded in _http.py in the mechanize library. Quick and dirty hack is to change this to text/x-gwt-rpc; charset=UTF-8 -- I'm sure this could be done better by subclassing AbstractHTTPHandler; maybe someone else could contribute a quick way to do that.
0
0
0
1
2011-07-29T23:59:00.000
2
0
false
6,880,142
0
0
1
2
I am getting a 500 : Internal error, the payload of the POST is definately right, one thing I noticed is the Content-Type is not "sticking" using b.addheaders = [('Content-Type',"text-x-gwt-rpc")] -- and I'm not sure why. Does anyone have quick/dirty code used to access a GWT RPC (i.e. emulate the GWT client) in Python using mechanize. Browser?
Calling a GWT RPC function from Python-mechanize
6,880,354
0
0
425
0
python,gwt,gwt-rpc
Do not use GWT-RPC from non-GWT solutions, the format is internal and subject to change without notice. Consider RESTifying the app (or use SOAP and reuse the existing code of the methods, but care needs to be given to the interface definitions).
0
0
0
1
2011-07-29T23:59:00.000
2
0
false
6,880,142
0
0
1
2
I am getting a 500 : Internal error, the payload of the POST is definately right, one thing I noticed is the Content-Type is not "sticking" using b.addheaders = [('Content-Type',"text-x-gwt-rpc")] -- and I'm not sure why. Does anyone have quick/dirty code used to access a GWT RPC (i.e. emulate the GWT client) in Python using mechanize. Browser?
Passing parameters to a python script using SL4A on Android
10,452,996
1
2
2,086
0
android,python,sl4a
I used a round about method to circumvent the problem. First the python script needs to be modified to look for a text file containing the attributes. Now whenever I need to start the script, i have to push the txt file containing the attributes and then start the script.
1
0
0
1
2011-07-30T09:17:00.000
2
1.2
true
6,882,218
0
0
1
1
I am trying to get a Python script which I normally run on my PC to run on my Android phone (HTC Hero). I have SL4A running on my phone and have made a few tweaks to the Python script so that this does now run. The problem that I am having is how to pass parameters to the script. I have tried creating a sh script in SL4A which called the python file with the parameters, but this didn't work. I have also tried using the app TaskBomb to call through to the python file, but again this doesn't work when parameters are supplied. When no params are supplied the file loads correctly, but when I add -h to the filename it says it can no longer find the python file I am calling. Is anybody able to provide assistance with how to this?
Rewriting A Custom PHP App on a framework. Torn between Python (Django) and PHP (CodeIgniter)
6,886,763
0
0
259
0
php,python,django
Which language do you prefer? That's all that really matters. Both have solid frameworks and similar performance. If you want to increase performance, writing more efficient code is going to make a way bigger difference. Personally, I like python. Django is great, but you might also consider Flask or Pyramid/Pylons. Ajax is just as easy with python as it is with PHP--it's only a request. The server configuration is definitely harder--it doesn't get any easier than PHP--but it's not that hard, and you said you didn't mind it. If you like both languages equally, give python a shot.
0
0
0
1
2011-07-31T00:05:00.000
2
0
false
6,886,699
0
0
1
1
I was thinking of rewriting my custom PHP app on a framework... mainly for the solidity and more ease of growth going forward. Right now its a pseudo MVC setup with lots of hacks in between. I already have the db built out and the app uses a lot of AJAX too. I am not concerned with the amount of work involved as the solidity of the platform I move things to. Server configurations are no worries. I am also looking to increase performance all around. My friend (and Python enthusiast) told me things of python rendering tabular type data at almost 40% increase over PHP and speed is definitely a decision maker in this. Taking out the fact that there would be significantly less work moving to a PHP based framework since the app is PHP already which would be the best fit? I know there are a lot of PHP vs Python stories out there. Python seems to be the clear winner, but how easy is it to use with standard web stuff like AJAX? I just want to know who would use which and why vs the other.
No errors shown rendering an included file in Django/GAE
7,345,375
0
4
81
0
python,google-app-engine,django-templates
Write a unit test in tests.py, where you render the template using django.templates.Template. Check there whether it renders to something else than None or "" or white space. Once that unit test succeeds, you can proceed with the next one: Use self.client to render the template using the full stack. If the problem is here and not in the previous unit test, something is probably wrong with your view function. If you don't enclose your code under test in try-catch, you get the full stack trace when something goes wrong. If there is no stack trace, but your test fails, you know you did something wrong. In my opinion, unit tests in Django are real time-savers.
0
0
0
0
2011-07-31T09:32:00.000
1
0
false
6,888,622
0
0
1
1
Usually an error message is shown in browser if any error occured processing a Django/GAE template. But once such error is contained in an included file, then none message is shown - the "include" tag produces just blank output making development difficult. Is there a way to show all errors?
AJAX web applications with no hand-written JavaScript
6,888,882
2
0
217
0
c#,java,javascript,python
I'd recommend you GWT from Google. It is great, well done framework that allows creating Web 2.0 applications without dealing with HTML/JavaScript at all.
1
0
0
1
2011-07-31T10:20:00.000
4
0.099668
false
6,888,856
0
0
1
1
I'm looking for solutions that make it possible to create AJAX-enabled web applications without need to write JavaScript code manually. The requirements are: Performance doesn't matter. It can be slow, JavaScript may be unoptimized, amount of code it generates may be large. Platform doesn't matter as long as I can work with it on either Linux or Windows. Language doesn't matter as long as it's Python, Java or C#. I want to be able to create composite 'widgets' that can be updated dynamically using AJAX. For instance, I want to be able to load data dynamically and replace existing controls with the other ones when user clicks the button on that page. As long as this solution provides concepts like 'Panel' (composite widget), 'EditBox' and 'Label', I don't care if it's hard to create my own controls. What do you think?
Data Migrations and AppEngine
6,892,479
1
5
608
0
python,ruby-on-rails-3,google-app-engine,data-migration
You can't change the name of an entity. It's not permitted. If you change the name of an attribute in a model (please don't call them columns), AppEngine will ignore the old data in the old field, and return None for the new field.
0
1
0
0
2011-07-31T21:22:00.000
2
0.099668
false
6,892,408
0
0
1
1
I've done a lot of development in rails, and am looking into developing projects using python & app engine. From the demo project and what I've seen so far, I've got a question/concern about app engine projects: How is data migration handled in app-engine? For example, if I change the name of an entity/table (ex: Texts to Documents), or change a column in an existing table (ex: age to dob) - how does it handle old data when this happens? Thanks!
run django from ssh
6,898,424
2
0
342
0
python,django,bash,ssh
The chosen UNIX shell does not matter for the Python development. AFAIK the only shell specific part in Python development, which is currently being widely used, is virtualenv and it should work with sh compatible shells.
0
0
0
1
2011-07-31T22:16:00.000
1
1.2
true
6,892,686
0
0
1
1
i want to create a django project using ssh, my host give me some options when i enable ssh, i'm allowed to use bash, zsh, ksh, csh,fish and tcsh, I'm familiar with bash but not with the rest so which is better for django? which is the closest to python? or are they all the same when it comes to application development?
How to upload a file and display its information
6,895,290
0
0
197
0
php,jquery,python,html,ajax
Yeah, you'll need ajax for that. Create the form as usual, then submit it using Ajax. Form handling can be done as usual. If you google 'file upload Ajax' I'm sure you can find everything you need :)
0
0
0
0
2011-08-01T07:12:00.000
3
0
false
6,895,205
0
0
1
2
I want to build a web service that will process some files. Here is what I want to do: User uploads a file to the server using "upload form", the file is saved as a temporary file on the server-side Server-side python script processes the temporary file and produces some statistics (for example, number of lines and words in the file) The statistics are displayed near the "upload form" The question here is: I would like the file to be processed in the background just after it is uploaded, and after it is done, .append() the produced results to the current view. I do not want to assign a script to <form action="processing_script.php">... because the user will be redirected to the processing_script.php after clicking the Upload button. Any clues? Maybe some neat ajax call?
How to upload a file and display its information
6,895,293
0
0
197
0
php,jquery,python,html,ajax
yeah, i'd made second ajax request and run it with schedule (e.g. every 10 seconds). it will query the server if uploaded file is processed. the server may even do the file processing in external program. the php-script that accepts second ajax request checks some READY status and give client the answer YES/NO/FAILED. when client accepts YES answer it refirects user to the RESULTS PAGE. if it accepts NO, it alerts user the problem.
0
0
0
0
2011-08-01T07:12:00.000
3
0
false
6,895,205
0
0
1
2
I want to build a web service that will process some files. Here is what I want to do: User uploads a file to the server using "upload form", the file is saved as a temporary file on the server-side Server-side python script processes the temporary file and produces some statistics (for example, number of lines and words in the file) The statistics are displayed near the "upload form" The question here is: I would like the file to be processed in the background just after it is uploaded, and after it is done, .append() the produced results to the current view. I do not want to assign a script to <form action="processing_script.php">... because the user will be redirected to the processing_script.php after clicking the Upload button. Any clues? Maybe some neat ajax call?
Python + Django vs. ASP.NET + C#/VB vs PHP?
6,899,782
1
2
3,202
0
php,asp.net,python,django
python has a ui like vb, it's called pygtk (pygtk.org), i suggest you learn python, it's the easiest to learn, and you don't have to write as much as you would in .net php is powerful, and you have to learn it, you just have to, but for big complicated web apps, I rather choose ruby on rails or even better django which is the best? "the best" is just an opinion, asp.net developers think that it's the best and i think that python is the best, it's an argument that will never end
0
0
0
1
2011-08-01T10:10:00.000
3
0.066568
false
6,896,942
1
0
1
3
I know similar questions to this have been asked before, but I'm looking for a more specific answer so here it goes: I'm a student and am looking to develop a web app. I have little experience with all mentioned and like different aspects of each. I like the Visual Web Dev that can be used to create ASP.NET sites, a aspect that isn't there for PHP or Python.. I'm also looking to learn and develop with the language that will be most beneficial for uni, and work in the future - the language that is used and respected most in industry. I've heard mixed views about this. Because I'd want to know the language that is most used, most in demand, and has the longest future. I'd also like the ability to make things fast, they all come with frameworks.. But would it be better me learning things from scratch and understanding how it works that use a framework? Which language has the most frameworks and support? I see that a lot of industries (the ones I've looked at) use ASP.NET. But it seems (remember no real experience) to be easier (especially as a GUI can be used) so does that make it less valuable. Basically - which language do you think would be best for me based on this? WHich would you recommend based on the advantages and disadvantages of each and ease of fast efficient and powerful development? Thanks
Python + Django vs. ASP.NET + C#/VB vs PHP?
6,899,152
1
2
3,202
0
php,asp.net,python,django
This question is really too open ended. there is no one true language, otherwise we'd all be using it. As you've seen they all have merit. You didn't mention Java which still holds a lot of clout in enterprise computing. The only answer is pick one you like and get good at it. You can spends years wishing you'd picked one of the others. Also, if you get good at one & have a firm understanding of the basics, at a later date you'll find it easy (ish) to pick up another one. For what it's worth. my money's on .net. But that's just me. Simon
0
0
0
1
2011-08-01T10:10:00.000
3
1.2
true
6,896,942
1
0
1
3
I know similar questions to this have been asked before, but I'm looking for a more specific answer so here it goes: I'm a student and am looking to develop a web app. I have little experience with all mentioned and like different aspects of each. I like the Visual Web Dev that can be used to create ASP.NET sites, a aspect that isn't there for PHP or Python.. I'm also looking to learn and develop with the language that will be most beneficial for uni, and work in the future - the language that is used and respected most in industry. I've heard mixed views about this. Because I'd want to know the language that is most used, most in demand, and has the longest future. I'd also like the ability to make things fast, they all come with frameworks.. But would it be better me learning things from scratch and understanding how it works that use a framework? Which language has the most frameworks and support? I see that a lot of industries (the ones I've looked at) use ASP.NET. But it seems (remember no real experience) to be easier (especially as a GUI can be used) so does that make it less valuable. Basically - which language do you think would be best for me based on this? WHich would you recommend based on the advantages and disadvantages of each and ease of fast efficient and powerful development? Thanks
Python + Django vs. ASP.NET + C#/VB vs PHP?
6,897,150
0
2
3,202
0
php,asp.net,python,django
I would recomend looking at asp.net mvc and scaffolding. That way you can create good applications quick and effective.
0
0
0
1
2011-08-01T10:10:00.000
3
0
false
6,896,942
1
0
1
3
I know similar questions to this have been asked before, but I'm looking for a more specific answer so here it goes: I'm a student and am looking to develop a web app. I have little experience with all mentioned and like different aspects of each. I like the Visual Web Dev that can be used to create ASP.NET sites, a aspect that isn't there for PHP or Python.. I'm also looking to learn and develop with the language that will be most beneficial for uni, and work in the future - the language that is used and respected most in industry. I've heard mixed views about this. Because I'd want to know the language that is most used, most in demand, and has the longest future. I'd also like the ability to make things fast, they all come with frameworks.. But would it be better me learning things from scratch and understanding how it works that use a framework? Which language has the most frameworks and support? I see that a lot of industries (the ones I've looked at) use ASP.NET. But it seems (remember no real experience) to be easier (especially as a GUI can be used) so does that make it less valuable. Basically - which language do you think would be best for me based on this? WHich would you recommend based on the advantages and disadvantages of each and ease of fast efficient and powerful development? Thanks
App Engine Session Timeout
6,902,956
6
3
824
0
python,google-app-engine
This is configurable in the dashboard, under Administration -> Application Settings. The default is 1 day, but you can set it as high as 2 weeks.
0
1
0
0
2011-08-01T18:26:00.000
1
1.2
true
6,902,663
0
0
1
1
When do user sessions (Users API in Python) timeout when logging in with Google Accounts?
Fun with GAE: using key_name as PK?
6,909,612
1
0
178
0
python,google-app-engine
I don't really understand your question. If you want an automatically-generated key name, just leave out the key when you instantiate the object - one will be automatically assigned when you call put().
0
0
0
0
2011-08-02T07:52:00.000
3
0.066568
false
6,908,827
0
0
1
1
I want to insert new entities programatically as well as manually. For this I was thinking about using key_name to uniquely identify an entity. The problem is that I don't know how to get the model to generate a new unique key name when I create the entity. On the other hand, I cannot create the ID (which is unique across data store) manually. How can I do "create unique key name if provided value is None"? Thanks for your help!
Serve Media Files Via Apache on a Django Development Server?
6,909,236
0
0
859
0
django,apache,media,mod-python
It is surely a pro since the django serves the requests faster without having to deal with the media. A con is that, if and when you edit the media, you need to also restart the apache, for the media to refresh. update based on your comment: You can of-course easily do it. One simple way I practice this is, by using the nginx and symlinking the media folder into nginx sites-enabled and run nginx on port 80 (or any other). You can set the MEDIA_URL in your settings, where you point it to the url with the appropriate port.
0
0
0
0
2011-08-02T08:23:00.000
2
0
false
6,909,143
0
0
1
2
For some reason i can't figure out, other than the 'stupid' errors that keep creeping up when I try to access media files (files uploaded by the user) in my Django app, why I just can't server media files! In this particular case, all I want for example is to be able to serve up images to the front that have been uploaded. My up correctly serves static files via /static/, but when I try to serve my /site_media/ files hell breaks loose! What could I be doing wrong? So, after realizing that Django wasn't essentially crafted to actually handle media files, I decided to resort to using Apache via the recommended mod_python option like it is recommended to do in production. But I've never done this before, and am wondering whether this is worth the trouble on the development server. Well, I know eventually I have to go down this path when I go production, and so will still have to learn how to do this, but what are the pros and cons for this route on the development server?
Serve Media Files Via Apache on a Django Development Server?
6,909,511
0
0
859
0
django,apache,media,mod-python
First, mod_python is not recommended. In fact, it's specifically recommended against. Use mod_wsgi instead. Secondly, we have no possible way of telling what you're doing wrong when serving static media via the dev server, because you have provided no code or details of your setup. Finally, there is no reason why you can't use Apache - or even better, a lightweight server such as nginx - and point it at your static directory only. Then, set STATIC_URL in your settings.py to the address served by that server. It makes no difference what port it is on while you're in development.
0
0
0
0
2011-08-02T08:23:00.000
2
0
false
6,909,143
0
0
1
2
For some reason i can't figure out, other than the 'stupid' errors that keep creeping up when I try to access media files (files uploaded by the user) in my Django app, why I just can't server media files! In this particular case, all I want for example is to be able to serve up images to the front that have been uploaded. My up correctly serves static files via /static/, but when I try to serve my /site_media/ files hell breaks loose! What could I be doing wrong? So, after realizing that Django wasn't essentially crafted to actually handle media files, I decided to resort to using Apache via the recommended mod_python option like it is recommended to do in production. But I've never done this before, and am wondering whether this is worth the trouble on the development server. Well, I know eventually I have to go down this path when I go production, and so will still have to learn how to do this, but what are the pros and cons for this route on the development server?
How to generate checksum from hex byte using python
6,922,436
4
0
7,142
0
python,byte,hex,checksum,crc
Thanks !!! the following two solutions worked; checksum = sum(map(ord, b)) or checksum = sum(bytearray(b)) / J
0
0
0
0
2011-08-02T19:16:00.000
1
0.664037
false
6,917,330
0
0
1
1
I am creating a Hex file using python and at the end I need to add a checksum that consists of sum of all hex values so that checksum = Byte 0x000000 + Byte 0x000001 +…+ Byte 0x27DAFF (not including this 4 bytes). This checksum shall then be written to buffer at position 0x27DB00-0x27DB03 as unsigned long. Any good ideas for how to get this done fast, I am running python2.7. As info of what I am up to I start with creating a buffer using ctypes, then write lots and lots of hex stuff to buffer, then create a cStringIO from buffer and write this string object to a file_obj which happen to be a django http response (i.e. returns the hex file as downloadable file) so any smart things involving the buffer would be appreciated !!! :-) / Jens
Why is there a date class in python
6,920,479
-1
2
307
0
python,datetime,date
datetime is a the same as the types date and time. The only thing better is that it takes less space than date does.
0
0
0
0
2011-08-03T00:34:00.000
3
-0.066568
false
6,920,403
1
0
1
2
Doesn't datetime cover all that date can do? I haven't read all the documentation, but so far I always find myself using datetime. Even in Django - datetime model fields are always more useful (at least for me). You don't have to use the hours if you don't want to, but if you decide that you do, you can. Javascript seems to manage fine with only one date class. Can you give me an example case where date is preferred to datetime?
Why is there a date class in python
6,920,665
4
2
307
0
python,datetime,date
Certain concepts may be easier to understand as dates rather than datetimes. For example, birthdays, paydays, and due dates all could potentially be datetimes, but they may be far better expressed as simple dates. Expressing these as datetimes could lead to confusion/ambiguity down the road. First of all, future maintainers of your code may think that you're already using dates. Then they could be surprised by how the comparison operations behave, as two apparently identical birthdays may not be "equal." Also, even if they know that a birthday is represented as a datetime, it's not immediately obvious what the time will be. It might be reasonable for the time to always be the exact time of birth in UTC. But then there may have to be considerations when the data you get from your users is incomplete, and you default the time to be midnight UTC. And then if you do that, you no longer know if a birthday with a midnight UTC time was auto-filled, or if that was actually user provided data. And otherwise, if you just assign a placeholder midnight UTC time to each datetime, the meaning of the associated time field of every birthday may still not be immediately clear to someone new to the codebase. Someone who isn't aware of this convention could change the time field of one of these datetimes, and that could then lead to functionality breaking very invisibly. If it had just been a date, that problem would have been averted. tl,dr: date exists to make it easier for developers to use the "right tool for the job."
0
0
0
0
2011-08-03T00:34:00.000
3
0.26052
false
6,920,403
1
0
1
2
Doesn't datetime cover all that date can do? I haven't read all the documentation, but so far I always find myself using datetime. Even in Django - datetime model fields are always more useful (at least for me). You don't have to use the hours if you don't want to, but if you decide that you do, you can. Javascript seems to manage fine with only one date class. Can you give me an example case where date is preferred to datetime?
django template boolean variable shows as 0 but is considred True. Why?
6,925,195
6
0
2,159
0
python,django,templates,variables
Because '0' (string) is not 0 (integer). '0' is non-zero-length string, which means it's True in a boolean context. If you store integers, you should be using IntegerField or PositiveIntegerField, not CharField.
0
0
0
0
2011-08-03T10:37:00.000
3
1
false
6,925,150
0
0
1
2
I have template variables that correctly can be displayed with {{ myclass.myvariable }} as either 1 or 0. But when I use them in the if statement {% if myclass.myvariable %} they always are considered to be True, even when the value is 0. The variables are 1-character charfield choices in my model, stored as 0 or 1, and the django template system chapter-4 claims that: 'In Python, the empty list ([]), tuple (()), dictionary ({}), string (''), zero (0), and the special object None are False in a Boolean context. Everything else is True.' I didn't use BooleanField in the model because I also have choice values 2, 3, 4... What could be the issue here?
django template boolean variable shows as 0 but is considred True. Why?
6,925,199
0
0
2,159
0
python,django,templates,variables
They are treated as strings ('0' string and '1' string, not 0 integer and 1 integer). If you go to your command-line Python and call bool(0) or bool(False), you will get False, but if you call bool('0'), you will get True.
0
0
0
0
2011-08-03T10:37:00.000
3
0
false
6,925,150
0
0
1
2
I have template variables that correctly can be displayed with {{ myclass.myvariable }} as either 1 or 0. But when I use them in the if statement {% if myclass.myvariable %} they always are considered to be True, even when the value is 0. The variables are 1-character charfield choices in my model, stored as 0 or 1, and the django template system chapter-4 claims that: 'In Python, the empty list ([]), tuple (()), dictionary ({}), string (''), zero (0), and the special object None are False in a Boolean context. Everything else is True.' I didn't use BooleanField in the model because I also have choice values 2, 3, 4... What could be the issue here?
Can we intergrate an OpenLaszlo front end to a Django back end ?
12,061,571
0
1
259
0
python,django,ria,openlaszlo
The OpenLaszlo platform supports communicating with any server that can receive HTTP POSTS (aka REST) from OpenLaszlo datasets and return an XML response. If your server meets those requirements then yes, you can use OpenLaszlo to create an OpenLaszlo front-end to communicate with your server back-end.
0
0
0
0
2011-08-03T16:03:00.000
2
0
false
6,929,517
0
0
1
1
I am a medical professional not a developer.. so go easy guys.. :) I am trying to build a EMR (Electronic Medical Record) with Django. In fact I am already well into the project. I have done reasonable AJAX and jQuery integration with it. I was trying to improve the front end and came across OpenLaszlo as a Open Source RIA solution. I was wondering if it was possible to integrate it to a Django or Python backend. I could not find any references for this kind of integration on the internet. There are some brief references to such an integration with Flex front end and PyAMF. If yes I would be thankful if you can give some step by step advice. Thanks in advance
How do I tell if the returned cursor is the last cursor in App Engine
6,935,512
5
10
4,861
0
python,google-app-engine,database-cursor
If you mean "has this cursor hit the end of the search results", then no, not without picking the cursor up and trying it again. If more entities are added that match the original search criteria, such that they logically land "after" the cursor (e.g., a query that sorts by an ascending timestamp), then reusing that saved cursor will let you retrieve those new entities.
0
1
0
0
2011-08-03T23:52:00.000
5
1.2
true
6,934,681
0
0
1
1
I apologize if I am missing something really obvious. I'm making successive calls to app engine using cursors. How do I tell if the I'm on the last cursor? The current way I'm doing it now is to save the last cursor and then testing to see if that cursor equals the currently returned cursor. This requires an extra call to the datastore which is probably unnecessary though. Is there a better way to do this? Thanks!
What are the relative advantages of various Python/PHP web frameworks (particularly for my project)?
6,935,676
0
4
1,845
0
php,python,django,web-frameworks,web2py
I've been using Django as part of my work for a couple years now and truly enjoy it when I can make it work. Unfortunately, and maybe it's just me, but I end up spending hours working on configuration every time I start a new server, or try to make it work in a development IDE. It's relatively simple to start a new project and start coding. But there are all sorts of little catches that keep things from working if you deviate from the norm. Things like if you want your django project to serve from a subdirectory like example.com/django. The information is out there to make it work. But it's hard to find. I can't tell you if web2py has those same problems or not. I only just learned about it from your question. It does look slick and simple though. I can tell you that after the hassles of getting the applications to serve properly from whatever server configuration I'm using, django is way more fun to program with than plain php. PHP frameworks may differ.
0
0
0
1
2011-08-04T01:05:00.000
5
0
false
6,935,094
0
0
1
3
I'm deciding on a web framework for an upcoming project, and I'd appreciate any advice. We've decided to use jQuery for the JavaScript, and are heavily leaning toward Python or PHP (more Python) for our server-side logic. I'm especially interested in web2py because of its jQuery integration. About our project Our project is to develop a security console for a complex cybersecurity system operating within an organization's internal network. This console will be largely server-driven, as messages come in from the network and must be pushed by the server to the user. The user will also be able to initiate security actions, the implementation for which will likely be in C++. The interface we've planned will be relatively rich, and I want to leverage jQuery's power as much as possible. We have some control over the browser environment we'll be running in (e.g., we don't have to worry about clients with JavaScript disabled). Our site is likely to have only a few, long-lived client connections. We are looking for software components with permissive licenses, though we're using some copyleft components (I see that web2py is LGPL while Django is BSD, so +1 to Django) We have about a month to create a functional demo of our system, of which this interface is a small (but visible) part. About us We are two developers with about 5 years of programming experience, but little web development experience. I have several years of Python experience and a summers' worth of experience messing around with PHP. My coworker has some Python experience and has never touched PHP. I used Django once back in 2008, and was frustrated by the file and code structure, which I found highly unintuitive. Perhaps this structure is inherent to the MVC model (I've had similar experiences with Django and CakePHP since), and I just need to bite the bullet and memorize it. My Question Given the information above, what are the relative advantages of the various Python/PHP web frameworks for our project? As mentioned above, I'm especially interested in web2py because of its jQuery integration, though Django's dominance is (once again) hard to ignore. Thank you very much for your time!
What are the relative advantages of various Python/PHP web frameworks (particularly for my project)?
6,961,688
1
4
1,845
0
php,python,django,web-frameworks,web2py
Python vs PHP: Python With python, you can always write wrappers for C code so you won't have to mess with starting other processes and passing args to them. That might be useful for your security functions. Web2py will allow you to easily write a webservice for this too, to more easily integrate the C portions with the web-site infrastructure. If you already prefer python, I would go with that. If you need to bring on web-developers later that are trained in PHP, teach them Python. It won't take long, and I'm sure they'll appreciate it in the long run. Plus, moving from a PHP MVC framework to web2py or even django would make things easier. I've used CodeIgniter for PHP and find that web2py was so much simpler and easy to understand. Also as for the directory structure, django is not actually true MVC -- it's MTV (model, template, view). I find web2py's organization a little more straight-forward. But yes, either way it can seem strange at first. I would say YES, you should bite the bullet and use MVC. In web2py, the "view" is html markup with the ability to write raw python code. The controller extracts data from the model (database), attaches any needed files (css/js etc) and the model of course simply defines the structure of the data and allows you to access it in an OO way. Lastly, I wouldn't tip my hat in favor of web2py just because of jQuery integration. It does use it, and a some of the built-in framework stuff (like response.flash/session.flash, the LOAD function that loads a page or data from another controller) rely on jQuery, but using it in another framework only means you have to write an include statement (e.g. ). But, the way it allows/forces you to focus on development is what takes the cake for me.
0
0
0
1
2011-08-04T01:05:00.000
5
0.039979
false
6,935,094
0
0
1
3
I'm deciding on a web framework for an upcoming project, and I'd appreciate any advice. We've decided to use jQuery for the JavaScript, and are heavily leaning toward Python or PHP (more Python) for our server-side logic. I'm especially interested in web2py because of its jQuery integration. About our project Our project is to develop a security console for a complex cybersecurity system operating within an organization's internal network. This console will be largely server-driven, as messages come in from the network and must be pushed by the server to the user. The user will also be able to initiate security actions, the implementation for which will likely be in C++. The interface we've planned will be relatively rich, and I want to leverage jQuery's power as much as possible. We have some control over the browser environment we'll be running in (e.g., we don't have to worry about clients with JavaScript disabled). Our site is likely to have only a few, long-lived client connections. We are looking for software components with permissive licenses, though we're using some copyleft components (I see that web2py is LGPL while Django is BSD, so +1 to Django) We have about a month to create a functional demo of our system, of which this interface is a small (but visible) part. About us We are two developers with about 5 years of programming experience, but little web development experience. I have several years of Python experience and a summers' worth of experience messing around with PHP. My coworker has some Python experience and has never touched PHP. I used Django once back in 2008, and was frustrated by the file and code structure, which I found highly unintuitive. Perhaps this structure is inherent to the MVC model (I've had similar experiences with Django and CakePHP since), and I just need to bite the bullet and memorize it. My Question Given the information above, what are the relative advantages of the various Python/PHP web frameworks for our project? As mentioned above, I'm especially interested in web2py because of its jQuery integration, though Django's dominance is (once again) hard to ignore. Thank you very much for your time!
What are the relative advantages of various Python/PHP web frameworks (particularly for my project)?
6,935,412
2
4
1,845
0
php,python,django,web-frameworks,web2py
Before deciding on a framework, you should first decide if you want to commit to a language you are unfamiliar with. You said you've both got minimal PHP experience, so you have to weigh up the advantages here; Will the pros for going PHP (if any) out weigh the amount of time the developers will need to spend to retrain? (Although depending on your background experience, PHP should be very easy to pick up.) If you frame it like that, PHP would have to have a pretty convincing offering to give you. From what I'm seeing, specifically Django vs web2py, they both seem very close in functionality - which is good, but doesn't provide the "you must use x!" scenario you may be after. However, If you will be bringing more people in later and feel finding people to work with web2py will be difficult, it may tip it to PHP. You said your self, Django's popularity (and BSD license) is hard to ignore, and it should make it easier to find people for later expansion. If it were me, in your shoes, I would go with web2py. Assuming the development team will continue to be Python focused for the foreseeable future.
0
0
0
1
2011-08-04T01:05:00.000
5
1.2
true
6,935,094
0
0
1
3
I'm deciding on a web framework for an upcoming project, and I'd appreciate any advice. We've decided to use jQuery for the JavaScript, and are heavily leaning toward Python or PHP (more Python) for our server-side logic. I'm especially interested in web2py because of its jQuery integration. About our project Our project is to develop a security console for a complex cybersecurity system operating within an organization's internal network. This console will be largely server-driven, as messages come in from the network and must be pushed by the server to the user. The user will also be able to initiate security actions, the implementation for which will likely be in C++. The interface we've planned will be relatively rich, and I want to leverage jQuery's power as much as possible. We have some control over the browser environment we'll be running in (e.g., we don't have to worry about clients with JavaScript disabled). Our site is likely to have only a few, long-lived client connections. We are looking for software components with permissive licenses, though we're using some copyleft components (I see that web2py is LGPL while Django is BSD, so +1 to Django) We have about a month to create a functional demo of our system, of which this interface is a small (but visible) part. About us We are two developers with about 5 years of programming experience, but little web development experience. I have several years of Python experience and a summers' worth of experience messing around with PHP. My coworker has some Python experience and has never touched PHP. I used Django once back in 2008, and was frustrated by the file and code structure, which I found highly unintuitive. Perhaps this structure is inherent to the MVC model (I've had similar experiences with Django and CakePHP since), and I just need to bite the bullet and memorize it. My Question Given the information above, what are the relative advantages of the various Python/PHP web frameworks for our project? As mentioned above, I'm especially interested in web2py because of its jQuery integration, though Django's dominance is (once again) hard to ignore. Thank you very much for your time!
Checking the status of a sent email in django
6,937,662
1
1
2,684
0
python,django,email
You have no other way than generate confirm url in your message like most sites registrations do. If person would be glad to register on your website, he will certainly click confirm at his email client of any sort. Otherwise it's a spam/scam email. There is no way you can do it and know it's a live e-mail for sure... Besides there are 2 other ways mentioned by my colleagues... But they are based on "unsecure" settings in old email clients rather than sure way... IMHO.
0
0
0
1
2011-08-04T04:37:00.000
3
0.066568
false
6,936,252
0
0
1
2
I have a simple mail sending application which runs in python using Django. After sending an email is there a way to see if the recipient has opened it or is it still un-opened? if so how can i do it?
Checking the status of a sent email in django
6,936,289
3
1
2,684
0
python,django,email
You can try setting require return receipt flag on the email you are sending. But, a lot of people (I know I do) ignore that return receipt so you will never find out in those cases. If you are asking for a 100% certain method of finding out if the recipient read his/her email, then the straight answer is: NO, you can't do that.
0
0
0
1
2011-08-04T04:37:00.000
3
0.197375
false
6,936,252
0
0
1
2
I have a simple mail sending application which runs in python using Django. After sending an email is there a way to see if the recipient has opened it or is it still un-opened? if so how can i do it?
Using Django with app engine and eclipse
6,940,884
0
3
1,025
0
python,django,eclipse,google-app-engine,pydev
As @MatToufotu suggested you start with the django integration document in the appengine documentation. I would say you should stick with eclipse and pydev, as django-nonrel project created are nothing but pure django project with support for appengine, pydev can handle both of them with ease........
0
1
0
0
2011-08-04T11:03:00.000
2
0
false
6,940,257
0
0
1
1
We are new to the python world and would like to get started a s soon a possible and develop a little web app for app engine. We are using Eclipse + Google plugin + Pydev. We also would like to start using Django framework and we have two questions: 1. We are looking for a good tutorial which will put us on the right track with Django + app engine? 2. We are looking for a dev tool, apperently Eclipse with Pydev support either Django project or App engine project but not together, is there any other IDE which can solve this problem?
3D Rendering in Google App Engine
6,978,267
3
2
527
0
java,python,google-app-engine,3d
App Engine doesn't currently support C modules on the Python runtime. As a result, any rendering code would have to be written entirely in Python, and would be very, very slow. You couldn't take advantage of a GPU, either, since the runtime doesn't supply one. Your best option, if you care at all about efficiency, is to call out to a server that does the rendering for you.
0
1
0
0
2011-08-04T12:37:00.000
1
1.2
true
6,941,528
0
0
1
1
Is it possible to render any kind of 3D images in Google App Engine (with Backends)? I'm looking for a Python solution, but I will learn Java if needed.
How to explicitly stop a Google App Engine dynamic backend when the start handler finishes?
7,364,170
0
4
1,017
0
python,google-app-engine,backend
If you configure your backend as a Dynamic backend, then the backend will stop automatically 15 minutes after your "trigger" request is processed. If you don't send that "trigger-to-start" request again in the next 15 minutes, the backend will shutdown automatically. Unfortunately, you'll still have to pay for a minimum of 15 minutes of uptime, even though the backend is idle for those 15 minutes. I'm doing exactly what you're doing in my app - the backend starts, starts leasing tasks from a pull queue, and goes idle when the pull queue is empty. I do this once every hour, so I end up paying for 24/3 = 8 hours of backend uptime everyday. Since this is below the 9 hour quota, I'm happy (for now).
0
1
0
0
2011-08-04T17:07:00.000
2
0
false
6,945,595
0
0
1
2
I have a backend that consumes a queue in its start handler. When the queue is exhausted the start handler will stop. I want the backend to stop when the start handler finishes. I have other code that will send a request to the backend if it adds an item to this queue. These requests merely serve to have GAE start the backend so that it can start consuming the queue. I don't want the backend to ever be in a state where the start handler has finished but the backend remains idle. I want it to stop so that the next request to the backend will cause GAE to start the backend again thus invoking the start handler again and start consuming the queue. How do I accomplish this goal?
How to explicitly stop a Google App Engine dynamic backend when the start handler finishes?
6,978,199
1
4
1,017
0
python,google-app-engine,backend
Backends can't (currently) be started and stopped programmatically. It sounds like what you want, though, is a regular task queue task, which behaves exactly as described.
0
1
0
0
2011-08-04T17:07:00.000
2
0.099668
false
6,945,595
0
0
1
2
I have a backend that consumes a queue in its start handler. When the queue is exhausted the start handler will stop. I want the backend to stop when the start handler finishes. I have other code that will send a request to the backend if it adds an item to this queue. These requests merely serve to have GAE start the backend so that it can start consuming the queue. I don't want the backend to ever be in a state where the start handler has finished but the backend remains idle. I want it to stop so that the next request to the backend will cause GAE to start the backend again thus invoking the start handler again and start consuming the queue. How do I accomplish this goal?
Open file from specific disk
6,953,764
0
0
171
0
python,django,filesystems
Use the file:// protocol instead of http:// in your links.
0
0
0
0
2011-08-05T07:53:00.000
1
0
false
6,953,132
0
0
1
1
What I want to achieve is a bit complicated to explain, so I hope I'll be clear enough ! I'm starting to write a Django application for my company. It is installed on a local server which has access to some disks, that the users have access to also. I want to be able to list some files on these disks and when a user clicks on one through the web interface, it opens it on his machine. But I don't want to download it on the user's machine, I want the user machine to open the file at its real location. How can I achieve that ? And please let me know if I'm not being clear enough, it's really important that I can have this functionnality on my application.
Is it better to perform logical conditions in view or template?
6,954,395
2
0
81
0
python,django,model-view-controller
I suggest separating your logic in the following way: Implement the logic belonging to what your application is doing under the hood in your Django handlers. It usually covers most of your logic. Implement only the logic belonging to the actual presentation in your HTML templates. For example you can put you logic selecting different styles for various rows of a table based on a complex condition (not just odd/even) or so. It worked pretty well for me.
0
0
0
0
2011-08-05T09:08:00.000
1
1.2
true
6,953,930
0
0
1
1
I'm starting to learn Django and I'm completely new to the MVC/MTV (whatever you want to call it) playground. In Django templates can perform logical conditions and filters. I want to know from a performance standpoint, is it better to do the conditions in the view or on the template itself. I actually find my self more comfortable with doing everything behind the scenes and if there is no difference in terms of performance, then I'd rather do it from the view.
GAE TaskQueue: Sample code for accessing pull queue from outside App Engine?
8,681,117
1
2
1,520
0
python,google-app-engine,task-queue
These APIS work only for GAE server since the queues can be created only via queue.yaml and infact API does not expose any API for inserting queue and tasks or project.
0
1
0
0
2011-08-06T07:30:00.000
3
0.066568
false
6,965,431
0
0
1
1
I'm attempting to use GAE TaskQueue's REST API to pull tasks from a queue to an external server (a server not on GAE). Is there a library that does this for me? The API is simple enough, so I just need to figure out authentication. I examined the request sent by gtaskqueue_sample from google-api-python-client using --dump_request and found the authorization: OAuth XXX header. Adding that token to my own requested worked, but the token seems to expire periodically (possibly daily), and I can't figure out how to re-generate it. For that matter, gtaskqueue_sample itself no longer works (the call to https://accounts.google.com/o/oauth2/token fails with No JSON object could be decoded). How does one take care of authentication? This is a server app so ideally I could generate a token that I could use from then on.
Installing Django and Python Suds (without admin rights)
6,970,387
2
0
1,250
0
python,django,installation,suds
You can use virtual_env, I have used to play with another (unrelated) python framework buildbot
0
0
0
0
2011-08-07T02:01:00.000
3
1.2
true
6,970,240
1
0
1
1
I am trying to setup my project environment which uses the following: Python 2.5.2 Django 1.3 Python Suds The server I am running it on already has Python (2.5.2) and Django (1.1) installed but I want to use a newer version of Django and dont have administrator rights to upgrade. How do I go about installing this again? Should I have to install Python + Django + Suds in a seperate directory? How would I replace standard python paths to this new one? Thanks!
AppEngine - When to use a parent relationship?
6,976,575
1
5
276
0
python,google-app-engine,google-cloud-datastore
Everything I read is against Parent entities for one reason, and that is when you modify anything in that tree, everything is locked. When I first started working with parent entities, I wanted to treat them like the head of a hive or a database localized around that parent entry but apparently that isn't the way they are done. You probably want to just use ReferenceProperty because that will allow you access to the parent, and won't cause the locking to go on. Of course, if you are wanting that kind of relationship locking, then maybe you do want it, but you weren't specific enough for me to gauge that.
0
1
0
0
2011-08-07T23:14:00.000
2
0.099668
false
6,976,443
0
0
1
1
I'm trying to understand when to use an entity "parent" on GAE. Is this only useful for querying (ie get all the Foo objects where the parent == someObj) or does the child have access to the parent entity much like a ReferenceProperty? When is it better to use the parent vs ReferenceProperty?
PyPy + PHP on a single webserver
8,920,308
-1
5
815
1
php,python,apache,wsgi,pypy
I know that mod_wsgi doesn't work with mod_php I heavily advise you, running PHP and Python applications on CGI level. PHP 5.x runs on CGI, for python there exists flup, that makes it possible to run WSGI Applications on CGI. Tamer
0
0
0
1
2011-08-07T23:41:00.000
2
-0.099668
false
6,976,578
0
0
1
1
I'm in the process of setting up a webserver from scratch, mainly for writing webapps with Python. On looking at alternatives to Apache+mod_wsgi, it appears that pypy plays very nicely indeed with pretty much everything I intend to use for my own apps. Not really having had a chance to play with PyPy properly, I feel this is a great opportunity to get to use it, since I don't need the server to be bulletproof. However, there are some PHP apps that I would like to run on the webserver for administrative purposes (PHPPgAdmin, for example). Is there an elegant solution that allows me to use PyPy within a PHP-compatible webserver like Apache? Or am I going to have to run CherryPy/Paste or one of the other WSGI servers, with Apache and mod_wsgi on a separate port to provide administrative services?
Exclude multiple fields from datadump in django
69,876,980
-1
0
1,667
0
python,django,django-models
You can dump it into a JSON file and then use Notepad++ or equivalent to remove every line that has your field_name. Works for me, and very quick too. Make sure your field name is unique so that it will not remove other rows.
0
0
0
0
2011-08-08T11:41:00.000
3
-0.066568
false
6,981,575
0
0
1
2
Is there a way to exclude fields from different tables while taking DB dump. I could only find to exclude a model completely. (I am using postgresql). any help is appreciated.. Thanks in advance..
Exclude multiple fields from datadump in django
6,982,181
1
0
1,667
0
python,django,django-models
Not easily. I would grab a copy of dumpdata.py from the Django source and put it into your project and customize it. It would not be too hard to extend it to either use a custom manager for dumping or extend the exclude to support app.model.field. That sounds like a generally useful extension.
0
0
0
0
2011-08-08T11:41:00.000
3
1.2
true
6,981,575
0
0
1
2
Is there a way to exclude fields from different tables while taking DB dump. I could only find to exclude a model completely. (I am using postgresql). any help is appreciated.. Thanks in advance..
Python with CGI - handle ajax
6,983,929
1
0
345
0
python,ajax,cgi
You could do this - Use Javascript to check progress every 3 seconds. Your Python script hit at anytime should give the progress at that instance. It should essentially act as state-machine. You need a server here or maybe the progress is stored on some file. But having a server is the way to go... Maybe the long running process stores the progress in a MySQL table. Hope this helps...
0
0
1
1
2011-08-08T14:25:00.000
2
0.099668
false
6,983,622
0
0
1
1
I'd like to: Send request from the browser to a python CGI script This request will start some very long operation The browser should check progress of that operation every 3 seconds How can I do that?
django: admin site not formatted
6,984,814
1
3
2,860
0
python,django,django-admin,gunicorn
If you use contrib.static, you have to execute a collectstatic command to get all the app-specific static files (including admin's own) into the public directory that is served by gunicorn.
0
0
0
0
2011-08-08T15:38:00.000
5
0.039979
false
6,984,672
0
0
1
1
I have a mostly entirely plain django project, with no adding of my own media or customization of the admin interface in any way. Running the server with python manage.py runserver results in a nicely-formatted admin interface. Running the server with gunicorn_django does not. Why is this the case, and how can I fix it? It's definitely an issue of not finding the css files, but where are they stored? I never configured this, and the MEDIA_ROOT setting is ''. EDIT: I just want to know how django-admin serves the non-existent admin files... and how can I get gunicorn_django to do the same?
MySQL-Python Installation Error: Possible Architecture Incompatibility?
6,988,995
0
0
268
0
python,linux,mysql-python
If you can't get the same architecture through pip or your package manager, you will probably need to either recompile Python (which you might consider anyway -- Python 2.4 is old), or MySQLdb. Unfortunately, a lot of Python libraries are not cross-compatible between i386 and x86_64 -- I've actually had exactly the same issue with HGSubversion (the actual issue was with subvertpy, but I needed that for hgsubversion) and cx_Oracle. My solution was to downgrade Python to 2.6 for i386. Stunk.
0
0
0
0
2011-08-08T20:11:00.000
1
1.2
true
6,987,957
1
0
1
1
I am attempting to set up my Django virtualenv production environment on a Linux shared host server. Installing python packages using pip goes fine until I try to install Mysql-Python, which crashes. Does anyone know why this is failing? Looking through the error log, I think it's an architecture incompatibility between the package and my python installation because of these lines: /usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc /usr/bin/ld: warning: i386 architecture of input file build/temp.linux-x86_64-2.4/_mysql.o' is > incompatible with i386:x86-64 output build/temp.linux-x86_64-2.4/_mysql.o: In function _mysql_field_to_python': I was told the server is 64-bit and is running Python 2.4, although I'm not sure how to double-check the former. Ive been googling this issue for several hours but I've only found references to install/import errors on macs. I'm thinking perhaps I need to compile a different version of MySQLdb instead of just doing pip install -E myvirtualenv MySQL-python but I'm unsure. Any help is greatly appreciated.
Help choosing between Django, Zope3 and Web2Py for WebService Server
7,032,112
0
2
1,294
0
python,django,web-services,web2py,zope3
Zope is tremendously powerful, but it definitely has the highest learning curve of the three choices you're discussing.
0
0
0
0
2011-08-09T19:37:00.000
7
0
false
7,001,931
0
0
1
1
I need to build a simple administrative webapp using python that will connect to MySQL. Web Application will need to expose some APIs via Web Services for other Web App and Android/iPhone clients to consume. I need help making technology selections. I would appreciate suggestions and past experience comment comparisons between Django, Zope3 and Web2Py. I am mainly looking at smallest learning curve and out of the box WebService Server support. Suggestions on SOAP versus JSON or REST. What will be most cross platform compatible considering smart phone clients. I do not see SOAP support on Django website.
can I use the django comments framework without an attached parent model?
7,004,917
2
0
186
0
python,django,comments
Why not using the URL as the model? You can even write a middleware that creates an Url instance upon a page request, if it does not exist yet.
0
0
0
0
2011-08-10T01:17:00.000
1
1.2
true
7,004,887
0
0
1
1
I'd like to use the Django comments framework (or something similar) to easily enable comments for my site. According to the Django documentation, a comment thread must be associated with a parent object that is a Django model. (https://docs.djangoproject.com/en/dev/ref/contrib/comments/). However, most of my views are rendered using non-model data. In other words I want to be able to add comments to anything that has a unique URL, and have those comments keyed on the URL rather than on an underlying model object. Is there a way to do this?
Django - redirect to version with www
7,010,297
1
12
8,338
0
python,django,redirect,dns
You can also skip prefix via proper DNS configuration.
0
0
0
0
2011-08-10T11:15:00.000
3
0.066568
false
7,009,884
0
0
1
1
Is in Django a simple way to redirect everything from domain without www to version with it? I mean from http:// example.com to http:// www.example.com.
Which is the easiest Python web application framework to get started with, for general use?
7,016,928
5
5
12,722
0
python,web-frameworks
Django is by far the most popular. Documentation is excellent, which will help you get up and running.
0
0
0
0
2011-08-10T19:52:00.000
5
0.197375
false
7,016,885
0
0
1
2
Which is the easiest Python web application framework to get started with, for general use? Referring to easiest - I mean one which a short learning curve / time, at least in order to be able to use it for fairly simple apps. I have worked on non-trivial Ruby on Rails projects earlier, so it is not that I can't learn a more complex framework, it's just that for this particular app, I do not want to spend a lot of time learning the framework that I use - since this is more of an experimental app to test the idea - see below for more on that. If it turns out that the app idea is useful, I have no problem about later changing to a different framework and rewriting the entire app in that, after learning that framework properly. I want to create a small web app - a personal productivity tool. Initially at least, it will be only for my personal use, though later I may consider opening it up to use by others, under whatever terms. Right now, I just want to prototype the idea and then use it some, myself, on a day-to-day basis, for a while, to get a feel for whether the app is actually useful or not for my productivity. By "general use" (in the title of this question), I mean that the suggested Python web app framework should not be specialized to any particular area, such as, say, Zope may (not sure) be more suited for creating CMS's (Content Management Systems). Also, the framework preferably should not put restrictions on what I can do, except for any restrictions that may be inherent in, or common to, all web app frameworks. (As an example of that last statement, the HTTP request/response cycle is, I guess, common to all, so all web app frameworks, whether in Python or not, put that restriction on the user/developer, that they have to implement their app in that style. Oh yes, and the framework should support creating database-backed web apps (which I guess most do, but mentioning it anyway). I should mention that I have tried out CherryPy (with SQLite) a little - not enough yet to decide whether it is suitable or not, also had some errors which I am working on resolving, but am anyway looking for other suggestions as well. Thanks for any suggestions.
Which is the easiest Python web application framework to get started with, for general use?
7,016,938
0
5
12,722
0
python,web-frameworks
Plone is probably the simplest, but Django is the most popular. It's also extremely well documented.
0
0
0
0
2011-08-10T19:52:00.000
5
0
false
7,016,885
0
0
1
2
Which is the easiest Python web application framework to get started with, for general use? Referring to easiest - I mean one which a short learning curve / time, at least in order to be able to use it for fairly simple apps. I have worked on non-trivial Ruby on Rails projects earlier, so it is not that I can't learn a more complex framework, it's just that for this particular app, I do not want to spend a lot of time learning the framework that I use - since this is more of an experimental app to test the idea - see below for more on that. If it turns out that the app idea is useful, I have no problem about later changing to a different framework and rewriting the entire app in that, after learning that framework properly. I want to create a small web app - a personal productivity tool. Initially at least, it will be only for my personal use, though later I may consider opening it up to use by others, under whatever terms. Right now, I just want to prototype the idea and then use it some, myself, on a day-to-day basis, for a while, to get a feel for whether the app is actually useful or not for my productivity. By "general use" (in the title of this question), I mean that the suggested Python web app framework should not be specialized to any particular area, such as, say, Zope may (not sure) be more suited for creating CMS's (Content Management Systems). Also, the framework preferably should not put restrictions on what I can do, except for any restrictions that may be inherent in, or common to, all web app frameworks. (As an example of that last statement, the HTTP request/response cycle is, I guess, common to all, so all web app frameworks, whether in Python or not, put that restriction on the user/developer, that they have to implement their app in that style. Oh yes, and the framework should support creating database-backed web apps (which I guess most do, but mentioning it anyway). I should mention that I have tried out CherryPy (with SQLite) a little - not enough yet to decide whether it is suitable or not, also had some errors which I am working on resolving, but am anyway looking for other suggestions as well. Thanks for any suggestions.
Django-cms translatable objects
7,448,955
0
1
240
0
python,django,internationalization,django-cms
Found the solution. Django-nani.
0
0
0
0
2011-08-10T20:06:00.000
1
0
false
7,017,059
0
0
1
1
I am implementing payment plans on an multilingual eshop based on django-cms. I need internationalized support for payment plans. User can enter abritrary number of payment plans (implies standard django models) Every payment plan must have a description in every language site supports (3 at the moment). Implies basic django-cms post or plugin. Possible solutions I thought of, but did not fit.. If I go with django models, how do I handle i18n? If I go with cms plugin, how would I link those descriptions to same django models in every language? If I go with cms page, how do I create separate entities? What is the most elegant solution? Thanks.
How should apache/nginx and django play nicely together in respect of 404 errors?
7,305,445
0
1
338
0
python,django,apache,nginx,http-status-code-404
I have worked out what I think is the "correct" way of doing this which is to set: WSGIErrorOverride On In my Apache vhost. This seems to achieve the desired goal of Apache handle the 404 errors.
0
0
0
0
2011-08-10T21:08:00.000
2
0
false
7,017,838
0
0
1
2
Here is a simplified version of our setup: Nginx reverse proxy front end serving static files Apache + mod_wsgi serving a django app in /store and wordpress for all other URLs 404 errors outside /store work fine (via an apache 404 handler). However, 404 errors within /store hit the django 404.html. I'd really like not to repeat myself within that file (DRY!) and so would love to have 404 errors handled by apache (or nginx, I'm not fussy) across the site. I am completely new to nginx, relatively new to django and have a bit of experience hacking wordpress and apache around over the years. Thank you
How should apache/nginx and django play nicely together in respect of 404 errors?
7,045,823
0
1
338
0
python,django,apache,nginx,http-status-code-404
you could always symlink your 404 page as {django}/templates/404.html
0
0
0
0
2011-08-10T21:08:00.000
2
0
false
7,017,838
0
0
1
2
Here is a simplified version of our setup: Nginx reverse proxy front end serving static files Apache + mod_wsgi serving a django app in /store and wordpress for all other URLs 404 errors outside /store work fine (via an apache 404 handler). However, 404 errors within /store hit the django 404.html. I'd really like not to repeat myself within that file (DRY!) and so would love to have 404 errors handled by apache (or nginx, I'm not fussy) across the site. I am completely new to nginx, relatively new to django and have a bit of experience hacking wordpress and apache around over the years. Thank you
Getting contents of title tags with Python script
7,017,930
1
2
179
0
python,mysql,html,sql
use urllib2 to open up the web page. Then parse the returned text with regex to retrieve the title.
0
0
0
0
2011-08-10T21:13:00.000
2
0.099668
false
7,017,890
0
0
1
1
I want to make a really script in Python that gets the contents from the title tags of a specified web page and then puts them into a MySQL database. I have very (and I mean very) little experience with Python but this needs to be done for my project. How can I do this in the simplest way possible? I hope you are able to understand what I'm trying to ask.
Python 3 web scraping options
7,033,832
3
5
1,521
0
python-3.x,web-scraping
lxml.html works on Python 3, and gets you html parsing, at least. BeautifulSoup 4, which is in the works, should support Python 3 (I've done some work on this).
0
0
1
0
2011-08-10T23:54:00.000
2
0.291313
false
7,019,350
0
0
1
1
I'm new to Python so I'm sorry if this is a newbie question. I'm trying to build a program involving webscraping and I've noticed that Python 3 seems to have significantly fewer web-scraping modules than the Python 2.x series. Beautiful Soup, mechanize, and scrapy -- the three modules recommended to me -- all seem to be incompatible. I'm wondering if anyone on this forum has a good option for webscraping using python 3. Any suggestions would be greatly appreciated. Thanks, Will
Django 1.3, how to signal when a post has ended like on ebay?
7,021,874
0
2
204
0
python,sql,django,django-models,django-signals
As other have said, the best solution is django-celery (https://github.com/ask/django-celery) but it's a little heavyweight if you are low on resources. In a similar need, I have a middleware that checks the conditions and executes the needed operations (which, in my case, are just changing a boolean in some records of the database). This works for me because until someone actually access the data there is no need to change it, and because the "task" is just one UPDATE query, so it's not an unbearable load. Otherwise you can set up a cron job every short time (1 minute? 5 minutes?) and check conditions and do consequences.
0
0
0
0
2011-08-11T02:15:00.000
3
0
false
7,020,108
0
0
1
1
I'm totally confused and have no idea how to do this, so please forgive me if my description/information is bad. So I want say to do a notification via django-notification or simply send an e-mail to one of my user when a post of his had ended like on ebay. In my database I have a model which stores the datetime of when the post is going to end, but I'm not sure how to effectively check or store a signal or something which would alert the system to alert the user when the current time is > than the end datetime. thanks! Since I want to send an email/notification the second a post ends, I don't think I can use a scheduler to check if any post had ended, I believe this would be too inefficient, because I would have to check like every second, but like I said above, I'm not sure about anything...
How to get underlined title report by converting sxw to rml format using base_report_designer module?
7,023,526
0
2
838
0
python,reportlab,openerp
For better report customisation, use Aeroo Reports from Alistek. With this module, you can use your odt file without changing anything...
0
0
0
0
2011-08-11T06:24:00.000
1
0
false
7,021,671
0
0
1
1
Problem: I have sxw file and whenever I convert it in rml file using base_report_designer module(OpenERP module), and generate report I do not get underlined fonts in report which are underlined in sxw though but not in rml file.I changed font format & size then after I did not get underlined fonts in report.Currently in sxw font type is "Liberation Serif" and font size is "12". I tried most of font types but did not get undelined fonts in report. Currntly I solve this problem by adding "bold" tag in rml file. And the problem of this solution is, whenever I convert sxw to rml, I've to add "bold" tag everytime. Suggest Solution: Kindly give me another solution of this problem so that whenever I convert sxw to rml, I get underlined fonts in report without explicitly adding "underline" tag in RML.
Configure Flask dev server to be visible across the network
65,440,537
0
605
608,243
0
python,flask,werkzeug
If none of the above solutions are working, try manually adding "http://" to the beginning of the url. Chrome can distinguish "[ip-address]:5000" from a search query. But sometimes that works for a while, and then stops connecting, seemingly without me changing anything. My hypothesis is that the browser might sometimes automatically prepend https:// (which it shouldn't, but this fixed it in my case).
0
0
0
0
2011-08-11T08:40:00.000
15
0
false
7,023,052
0
0
1
1
I'm not sure if this is Flask specific, but when I run an app in dev mode (http://localhost:5000), I cannot access it from other machines on the network (with http://[dev-host-ip]:5000). With Rails in dev mode, for example, it works fine. I couldn't find any docs regarding the Flask dev server configuration. Any idea what should be configured to enable this?
get the modules locally for django project
7,023,397
0
0
334
0
python,django,python-module
Is there a reason you want to import all modules? It's a good practice to import only those modules, classes etc. which are needed...
0
0
0
0
2011-08-11T09:05:00.000
4
0
false
7,023,369
0
0
1
1
Is there a way to import all the modules in the django project itself instead of setting up again and again in all the systems. I would have used gem freeze or something like that in a rails project.
How to ensure there are no pdb calls out of debugging configuration?
7,027,964
1
3
133
0
python,django,git,pdb
The best option would be to have an extensive test suite, and to run the tests before pushing to production. Extraneous pdb breakpoints will prevent the tests from passing. If you can't do that, then option 2 is the best: write a utility to break into the debugger, and make it sensitive to the state of the settings. You still have to solve the problem of how to be sure people use the wrapper rather than a raw pdb call though.
0
0
0
0
2011-08-11T14:37:00.000
3
0.066568
false
7,027,803
0
0
1
2
What do you suggest to get rid of pdb calls on production software? In my case, I'm developing a django website. I don't know if I should: Monkey patch pdb from settings.py (dependding on DEBUG boolean). Make a pdb wrapper for our project which expose set_trace or print basic log if DEBUG = True Dissalow comitting brakpoints on git hooks... (if you think it's the best idea how would you do that?).
How to ensure there are no pdb calls out of debugging configuration?
7,028,046
2
3
133
0
python,django,git,pdb
The third one. You have to enforce some commit rules. For example, run a serie of tests before a commit, etc. This way, developpers have a simple way to check if a pdb break remain. If someone commit a set_trace, he has to bake a cake for the rest of the team. This works fine in my company :-) edit: you may present this method to your boss as CDD (Cake Driven Developpement)
0
0
0
0
2011-08-11T14:37:00.000
3
1.2
true
7,027,803
0
0
1
2
What do you suggest to get rid of pdb calls on production software? In my case, I'm developing a django website. I don't know if I should: Monkey patch pdb from settings.py (dependding on DEBUG boolean). Make a pdb wrapper for our project which expose set_trace or print basic log if DEBUG = True Dissalow comitting brakpoints on git hooks... (if you think it's the best idea how would you do that?).
Nodejs: Where or How to write complicated business logic?
7,034,257
3
41
18,486
0
java,python,node.js
Ryan did not start with JavaScript. A large part of why Node was created in JavaScript is that JavaScript lacked vast oceans of libraries. Those vast oceans of libraries are almost all written in blocking code. To take full advantage of Node.js you need to limit your self to non blocking libraries. Which means that might need to write some libraries to complete your project in Node.js.
0
0
0
0
2011-08-11T22:44:00.000
6
0.099668
false
7,033,844
0
0
1
1
Recently I got introduced to node.js and cool packages like express and jade. I have few questions consistently knocking my door: If I pick node.js to build my next website, I will be using JavaScript to write my server-side complicated logic? but I don't think you can compare JavaScript with Java or Python to write server-side code as they have such a vast ocean of libraries. Is node.js really meant for it? or I have missed something? Can I call Java or Python from node.js?
Check if a field is present in an entity
7,041,161
1
1
487
0
python,google-app-engine,datastore
You cannot filter for property non-existence. Every query must be satisfied by an index, and there's no "negative index" of entities that lack a given property. Generally, you'll need to iterate over all entities, and just ignore the ones that already have the property.
0
0
0
0
2011-08-12T08:10:00.000
2
1.2
true
7,037,269
0
0
1
1
I have updated my model in Datastore so now it has an additional field. Now I have entities with and without that field but I need to add this field to all entities that don't yet have it. Idea is to get entities in a function without that field and add it. So, I wonder how I can filter such entities in Datastore requests?
Where is my Django installation?
7,037,509
4
113
80,172
0
python,django,path,installation
This approach I am describing works across operating systems... You try this on your command line - python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" This gives you the base directory. From there, type /django/ and here you find all the default templates, admin templates, etc. Hope this helps...
0
0
0
0
2011-08-12T08:29:00.000
10
0.07983
false
7,037,468
0
0
1
4
I use Django but I need to find the default templates and applications. I don't know where it's installed. How can I find that?
Where is my Django installation?
27,666,717
1
113
80,172
0
python,django,path,installation
Worth mentioning that if you are using a virtual env all the packages will be in your project's root venv folder under "lib" ...
0
0
0
0
2011-08-12T08:29:00.000
10
0.019997
false
7,037,468
0
0
1
4
I use Django but I need to find the default templates and applications. I don't know where it's installed. How can I find that?
Where is my Django installation?
30,408,755
-1
113
80,172
0
python,django,path,installation
If you are using virtualenv then it will be: /home/user/path where you installed django/django_directory/lib/python2.7/site-packages/Django-1.8.1-py2.7.egg/django/contrib/admin/templates/admin/base_site.html base-site.html is the default template.
0
0
0
0
2011-08-12T08:29:00.000
10
-0.019997
false
7,037,468
0
0
1
4
I use Django but I need to find the default templates and applications. I don't know where it's installed. How can I find that?
Where is my Django installation?
7,037,479
13
113
80,172
0
python,django,path,installation
On Microsft-Windows OS: In the Lib/site-packages folder inside your python installation.
0
0
0
0
2011-08-12T08:29:00.000
10
1
false
7,037,468
0
0
1
4
I use Django but I need to find the default templates and applications. I don't know where it's installed. How can I find that?
This application does not exist (app_id=xxx)
7,063,139
1
24
19,079
0
python,google-app-engine
Tried to upload to the app this morning (first time i've tried since Friday) and it just worked (first time...!) No idea what the issue was as I haven't done any work on this over the weekend so everything should have been the same as it was on Friday.
0
1
0
0
2011-08-12T11:04:00.000
13
0.015383
false
7,039,200
0
0
1
9
I was unable to upload to an AppEngine as appcfg was telling me : This application does not exist (app_id=u'xxx'). I was only a developer on the AppEngine, so as I was just testing I created a new AppEngine where I was the owner but I still get the same message on a newly created AppEngine.
This application does not exist (app_id=xxx)
32,418,665
0
24
19,079
0
python,google-app-engine
Posting Ric Moore's comment in the selected answer because that is a valid answer and it worked in my case (and hopefully it helps someone else having the same issue spot it quickly). I have an alternation solution - in the Google App Engine Launcher select from the menu Control > Clear Deployment Credential. Then when you click Deploy it will take you through the auth flow again and you can select the correct account. - Ric Moore
0
1
0
0
2011-08-12T11:04:00.000
13
0
false
7,039,200
0
0
1
9
I was unable to upload to an AppEngine as appcfg was telling me : This application does not exist (app_id=u'xxx'). I was only a developer on the AppEngine, so as I was just testing I created a new AppEngine where I was the owner but I still get the same message on a newly created AppEngine.
This application does not exist (app_id=xxx)
8,974,660
1
24
19,079
0
python,google-app-engine
I got the same error message trying to make the first deployment of a Python Application using a Google Apps account. In my case the problem was caused by the fact that my 2-way authentication is enabled. With 2-way authentication enabled you need to generate an authentication password in your Google Account Management Application and use it to do the deployments.
0
1
0
0
2011-08-12T11:04:00.000
13
0.015383
false
7,039,200
0
0
1
9
I was unable to upload to an AppEngine as appcfg was telling me : This application does not exist (app_id=u'xxx'). I was only a developer on the AppEngine, so as I was just testing I created a new AppEngine where I was the owner but I still get the same message on a newly created AppEngine.
This application does not exist (app_id=xxx)
26,124,268
1
24
19,079
0
python,google-app-engine
If you are using --oauth2 make sure that you are logged into the correct account when generating the token.
0
1
0
0
2011-08-12T11:04:00.000
13
0.015383
false
7,039,200
0
0
1
9
I was unable to upload to an AppEngine as appcfg was telling me : This application does not exist (app_id=u'xxx'). I was only a developer on the AppEngine, so as I was just testing I created a new AppEngine where I was the owner but I still get the same message on a newly created AppEngine.
This application does not exist (app_id=xxx)
10,004,722
5
24
19,079
0
python,google-app-engine
The same problem occurs with the Java/Eclipse plugin version of App Engine. The 404 happens when you're logged in to the wrong Google account from within the plugin. In that case, look at the bottom-left of Eclipse to see what account you're currently using. Regarding the Python command line updater, if your cookies indicate that you're logged in to a Google account that doesn't have access to the application you're updating, then that would explain why ignoring those cookies by using "appcfg.py update --nocookies" fixes it.
0
1
0
0
2011-08-12T11:04:00.000
13
0.076772
false
7,039,200
0
0
1
9
I was unable to upload to an AppEngine as appcfg was telling me : This application does not exist (app_id=u'xxx'). I was only a developer on the AppEngine, so as I was just testing I created a new AppEngine where I was the owner but I still get the same message on a newly created AppEngine.
This application does not exist (app_id=xxx)
13,440,444
1
24
19,079
0
python,google-app-engine
this way worked: modified the app.yaml to specify the application: some_id python appcfg.py update ../some_application/server/python
0
1
0
0
2011-08-12T11:04:00.000
13
0.015383
false
7,039,200
0
0
1
9
I was unable to upload to an AppEngine as appcfg was telling me : This application does not exist (app_id=u'xxx'). I was only a developer on the AppEngine, so as I was just testing I created a new AppEngine where I was the owner but I still get the same message on a newly created AppEngine.
This application does not exist (app_id=xxx)
13,757,124
4
24
19,079
0
python,google-app-engine
This is really old, so I wouldn't be surprised if this isn't picked up by the poster, but I wanted to ensure that I have a reference for the next time I have the issue. I had this issue. My problem ended up being that I had not invited the user that I was authenticating as to be a developer on the project. In fact I had just created the user and not even logged on yet. I logged on to the google infrastructure as the new user, then added the new user as a developer on the application. I was then able to upload the app.
0
1
0
0
2011-08-12T11:04:00.000
13
0.061461
false
7,039,200
0
0
1
9
I was unable to upload to an AppEngine as appcfg was telling me : This application does not exist (app_id=u'xxx'). I was only a developer on the AppEngine, so as I was just testing I created a new AppEngine where I was the owner but I still get the same message on a newly created AppEngine.
This application does not exist (app_id=xxx)
25,898,433
1
24
19,079
0
python,google-app-engine
I fixed this problem by editing my app.yaml file to have the correct application name. In the app.yaml file where it says 'application:[insert app name here]', I had to change the [insert app name here] part. I'm not sure why the name was wrong, but I do remember toying around with it before while attempting to fix a different bug. The way I figured out the proper name was to go to my applications in my GAE admin console and look to see what the app's name was there. Hope this helps anyone else that runs into this same problem :)
0
1
0
0
2011-08-12T11:04:00.000
13
0.015383
false
7,039,200
0
0
1
9
I was unable to upload to an AppEngine as appcfg was telling me : This application does not exist (app_id=u'xxx'). I was only a developer on the AppEngine, so as I was just testing I created a new AppEngine where I was the owner but I still get the same message on a newly created AppEngine.
This application does not exist (app_id=xxx)
32,109,147
0
24
19,079
0
python,google-app-engine
What worked for me is to use the project id from the google app engine console instead of the project name in app.yaml
0
1
0
0
2011-08-12T11:04:00.000
13
0
false
7,039,200
0
0
1
9
I was unable to upload to an AppEngine as appcfg was telling me : This application does not exist (app_id=u'xxx'). I was only a developer on the AppEngine, so as I was just testing I created a new AppEngine where I was the owner but I still get the same message on a newly created AppEngine.
python logging how to create logfile as html
7,039,432
3
6
7,716
0
python,html,logging,format
I would not recommend storing logs as HTML, having logs easily onward processable is a very important and useful feature, and HTML is hard to parse, and it is also verbose - and logs get large fast :-) However if you really want to you can write your own formatter that will output to HTML - I am not aware of one already in existence - I suspect for the reasons above.
0
0
0
0
2011-08-12T11:20:00.000
2
0.291313
false
7,039,343
0
0
1
1
I read in wikipedia that python logging module was inspired by log4j .In log4j ,there is an HTMLLayout with which one can create the log file as html.Is there any such facility in python logging? Or do anyone know how I can format the log output into an html file ?
How should I handle anonymous user input?
7,050,989
2
1
310
0
python,django,facebook,user-input,anonymous
Don't rely on facebook login, as users without facebook will not be able to vote. As there is no real way to be sure that an unregistered user will not vote twice (he can connect himself from another computer, or whatever), you have to define yourself what is the criteria you want to use to check his identity. You have different ways to solve your problem, all of them rely on storing information about the user that voted. You can rely on ip address, or store information in session or in cookies to know if your users already voted or not.
0
0
0
0
2011-08-13T14:14:00.000
2
1.2
true
7,050,945
0
0
1
1
I'd like the users of my web application to not have to register a user account before they can vote. I've seen websites where I could freely vote up or down on what ever I want without having to register. How is this handled? How can I prevent the same person from voting infinite amounts of times? I'm using Python and Django. I'm thinking of implementing facebook login, but I'd like to hear some of the experts' comments. I'll mark the most helpful answer as correct.
How do I get node-waf to install?
7,057,283
3
4
5,062
0
python,node.js,npm,waf
To solve the path problem, I backed up and re-installed Node. To solve the version problem, at the suggestion of some bright soul on the #nodejs channel, I created a symbolic link at ~/bin/python that pointed to the right version (that solved a lot of my own problems too, starting up the wrong version from the command line...) An obvious hack, but when you're frustrated, you overlook the obvious.
0
1
0
1
2011-08-13T15:12:00.000
1
1.2
true
7,051,276
0
0
1
1
First, props to whoever did node.js. I've been using it for less than a day and I'm already thinking about using it for stuff I use Python for now. In fact, whoever did node.js should think about using it for stuff they use Python for now. There is apparently a tool called node-waf that is in Python and is necessary for npm to work and npm of course is necessary for anything else useful. I think that my original install went bad because node-waf (which is in /mnt/michael/bin/node-waf) couldn't find Scripting.py (which is in /mnt/michael/node/tools/wafadmin/; it was looking in non-existent /mnt/michael/node/tools/../lib/node/wafadmin/). So I hacked node-waf to point to the right director and kept going and found a much more serious problem. Turns out node-waf isn't written in "Python", but in Python2.6, which is a perfectly good language, it's the language I use myself, but it isn't the language that the default on the system I use. The system is CentOS, which requires Python2.4 be the Python that the command "python" invokes. Yes, that's foolish on the part of the CentOS people but less foolish than the same mistake on the part of the node-waf people, since they are necessarily subject to the rules of the OS. So, please tell me there's some switch I haven't found yet that say "Use Python2.6". Also, any hints about a proper install would be appreciated.
IDE for PHP and Python Windows
7,051,285
0
6
3,567
0
php,python,ide
Eclipse and Visual Studio have plugins for just about everything. Eclipse is free, I think for Visual Studio though you'd have to get the professional version to run plugins...
0
0
0
1
2011-08-13T12:46:00.000
5
0
false
7,051,282
0
0
1
2
I used to use netbeans for a while and really liked it. But now, I wan't to expand my toolbox with Python, and Netbeans dropped support for Django, also Python support seems to suck in NB 7.0. So I am looking for recommendations on IDE or Text Editor for Windows with support: Python (possibly with Django) PHP HTML, CSS, JavaScript FTP GIT & SVN I know Aptana 3 can do this, is there anything else? I don't know Vim a lot, but would that be an option?
IDE for PHP and Python Windows
7,051,283
0
6
3,567
0
php,python,ide
Well Aptana is built upon eclipse, so you could just use the basic eclipse with all your necessary add ons. Obviously you'll need Pydev for the python stuff and that has Django integration. For some reason though I actually prefer netbeans for my php ide. Tbh just try out a few and see which one you like best.
0
0
0
1
2011-08-13T12:46:00.000
5
0
false
7,051,282
0
0
1
2
I used to use netbeans for a while and really liked it. But now, I wan't to expand my toolbox with Python, and Netbeans dropped support for Django, also Python support seems to suck in NB 7.0. So I am looking for recommendations on IDE or Text Editor for Windows with support: Python (possibly with Django) PHP HTML, CSS, JavaScript FTP GIT & SVN I know Aptana 3 can do this, is there anything else? I don't know Vim a lot, but would that be an option?
Identify audio sample in a file
7,052,252
2
2
573
0
java,c++,python,audio,signal-processing
I'd start by computing the FFT spectrogram of both the haystack and needle files (so to speak). Then you could try and (fuzzily) match the spectrograms - if you format them as images, you could even use off-the-shelf algorithms for that. Not sure if that's the canonical or optimal way, but I feel like it should work.
0
0
1
1
2011-08-13T17:37:00.000
2
0.197375
false
7,052,169
0
0
1
1
I want to be able to identify an audio sample (that is provided by the user) in a audio file I've got (mp3). The mp3 file is a radio stream that I've kept for testing purposes, and I have the Pre-roll of the show. I want to identify it in the file and get the timestamp where it's playing in the file. Note: The solution can be in any of the following programming languages: Java, Python or C++. I don't know how to analyze the video file and any reference about this subject will help.