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. F... |
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. F... |
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, includin... |
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 a... |
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 a... |
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 id... | 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,
-- probab... |
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 whethe... | 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
clien... | 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 de... |
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... | 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 de... |
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 us... | 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:
Bea... |
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:
Bea... |
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.... |
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 ser... | 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 ... |
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... | 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 coll... |
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 ... | 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 subcl... | 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... |
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... |
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 SL... |
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.... | 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 s... |
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 h... | 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 wor... |
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... |
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 w... |
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. ... | 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 w... |
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... | 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 a... |
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 ... | 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 a... |
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 a... |
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 acr... |
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 th... | 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 uploa... |
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 c... | 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 uploa... |
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 ide... |
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 s... |
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 mainta... | 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 s... |
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, ... |
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, ... |
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 Sour... |
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 sa... | 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 c... |
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 pr... | 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 proj... |
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 t... | 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 proj... |
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 retrai... | 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 proj... |
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...
... | 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'... | 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 t... |
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 t... | 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 mini... | 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 ... |
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 ... |
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 cl... |
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 sel... | 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 mo... |
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 --... |
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 aga... |
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 ... | 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 t... |
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 r... | 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... |
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 sa... | 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 betwee... |
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... |
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... |
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... |
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... |
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... |
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 no... |
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 no... |
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 ... |
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... |
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... | 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 wh... |
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 ... |
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 someti... | 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 w... |
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. ... | 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 b... |
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 thi... | 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 b... |
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 m... | 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 se... |
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 reque... |
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... | 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 ... | 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... | 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 in... | 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 ha... | 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 d... | 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 alread... | 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... | 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... |
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... | 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 necessar... |
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, ... |
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, ... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.