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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Ancestors in App Engine data store | 6,243,119 | 5 | 0 | 300 | 0 | python,google-app-engine,datastore,ancestor | When you create an entity with a parent, the entities are placed in the same Entity Group. Transactions in App Engine can only work within a single entity group, so if you need transactions, you need entity groups. If you don't need transaction, you don't need entity groups (in particular, to build relationships betwee... | 0 | 1 | 0 | 0 | 2011-06-04T22:19:00.000 | 1 | 1.2 | true | 6,239,737 | 0 | 0 | 1 | 1 | I've been developing for Google App Engine for a while. One of the features I've noticed but haven't had an opportunity to use yet is "ancestors" in the data store.
What would be an example of a situation where this is useful? |
Working with django and mod_wsgi in Windows | 6,243,058 | 1 | 0 | 543 | 0 | python,windows,django,apache,mod-wsgi | The answer is: don't use Apache in development. Use the built-in development server, or perhaps gunicorn. | 0 | 0 | 0 | 0 | 2011-06-05T12:55:00.000 | 2 | 1.2 | true | 6,243,015 | 0 | 0 | 1 | 1 | I finished installing django on my Windows machine using Apache 2.2/Python 2.6/Django 1.3/mod_wsgi. It seems like everytime I change my Python code (such as settings.py), I need to restart Apache in order for changes to take effect.
I understood that using WSGIRestrictEmbedded should solve this issue but the docs for w... |
CMS or web framework a simple project | 6,245,184 | 0 | 3 | 1,735 | 0 | python,django,wordpress,content-management-system | Drupal or Joomla are your best bet. Firstly, Joomla allows you to basically drop in these features you're asking for in an install an go manner. This is the easiest way to go.
Now if you want a LOTS and LOTS customization and don't mind getting into a little code then drupal will be perfect.The great thing is that the ... | 0 | 0 | 0 | 1 | 2011-06-05T18:25:00.000 | 6 | 0 | false | 6,244,906 | 0 | 0 | 1 | 2 | There's not really anything on my planned site that would require a whole lot of customization but I'm looking for something that has built in functionality for forums, comments, reviews, a blog, a database that can queried by users, and some social networking features.
I have a decent amount of experience using python... |
CMS or web framework a simple project | 6,244,936 | 1 | 3 | 1,735 | 0 | python,django,wordpress,content-management-system | Use a CMS, Drupal is very flexible and you can install another cms like vanilla for the forums options with a plugin.
It's al you need. But if you want a full control of your site, use a framwork like Django and you get all.
Remenber, the CMS is the fastest way to build a site.
Sorry for my english mistakes. | 0 | 0 | 0 | 1 | 2011-06-05T18:25:00.000 | 6 | 0.033321 | false | 6,244,906 | 0 | 0 | 1 | 2 | There's not really anything on my planned site that would require a whole lot of customization but I'm looking for something that has built in functionality for forums, comments, reviews, a blog, a database that can queried by users, and some social networking features.
I have a decent amount of experience using python... |
If i have to choose only one html scraping library for python, which should i choose | 6,248,603 | 1 | 1 | 162 | 0 | python,parsing,search,web-crawler | I'm using Beautiful Soup and am very happy with it. So far it answered all my scraping needs. Two main benefits:
It's pretty good at handling non-perfect HTML. Since browsers are quite lax, many HTML documents aren't 100% well-formed
In addition to high-level access APIs, it has low-level APIs which make it extendible... | 0 | 0 | 1 | 0 | 2011-06-06T06:21:00.000 | 2 | 1.2 | true | 6,248,424 | 0 | 0 | 1 | 2 | I need to do lot html parsing / scraping /search engine /crawling.
There are many libraries currently like Scrapy, Beautiful Soup, lxml , lxml2 requests, pyquery.
Now i don't want to try each of these and then decide. basically i want to follow on one and then study in detail and then use that most often.
So which libr... |
If i have to choose only one html scraping library for python, which should i choose | 6,248,605 | 1 | 1 | 162 | 0 | python,parsing,search,web-crawler | Since lots of HTML documents are not well-formed but rather a bunch of tags (sometimes not even properly nested) you probably want to go with BeautifulSoup instead of one of the xml-based parsers. | 0 | 0 | 1 | 0 | 2011-06-06T06:21:00.000 | 2 | 0.099668 | false | 6,248,424 | 0 | 0 | 1 | 2 | I need to do lot html parsing / scraping /search engine /crawling.
There are many libraries currently like Scrapy, Beautiful Soup, lxml , lxml2 requests, pyquery.
Now i don't want to try each of these and then decide. basically i want to follow on one and then study in detail and then use that most often.
So which libr... |
Should Django Python apps be stored in the web server document root? | 6,248,788 | 4 | 2 | 561 | 0 | python,django | No. WSGI containers don't require the scripts to be in the document root, and so to increase security in case of a transient server error they shouldn't be placed in the document root. | 0 | 0 | 0 | 0 | 2011-06-06T07:06:00.000 | 4 | 1.2 | true | 6,248,772 | 0 | 0 | 1 | 2 | As the title states, I'm trying to figure out the best practice for where to store application files for a Python website on the server. Document root, or no?
I come from a land of PHP. :)
EDIT - To that end, links to any material describing the best practice differences between Python and PHP are hugely appreciated. |
Should Django Python apps be stored in the web server document root? | 6,248,805 | 0 | 2 | 561 | 0 | python,django | There's no reason to store it in the document root.
While storing the app in the doc root isn't nessescarily a security problem - if configured correctly and handled carefully - storing it outside will remove a lot of headache and configuration work.
That's the main reason not to do it. | 0 | 0 | 0 | 0 | 2011-06-06T07:06:00.000 | 4 | 0 | false | 6,248,772 | 0 | 0 | 1 | 2 | As the title states, I'm trying to figure out the best practice for where to store application files for a Python website on the server. Document root, or no?
I come from a land of PHP. :)
EDIT - To that end, links to any material describing the best practice differences between Python and PHP are hugely appreciated. |
Pass arguments to Zope browser page | 6,253,856 | 3 | 1 | 337 | 0 | python,parameter-passing,zope | You're missing rather a lot of detail on your method. Is it a method of a class? Or standalone? Normally, self would refer to an instance of the class PyTest - which would be a subclass of BrowserView.
Then, the data you pass to the view (@@test) is retrieved from the Request object, which is available in self.reques... | 0 | 0 | 0 | 0 | 2011-06-06T14:29:00.000 | 1 | 1.2 | true | 6,253,541 | 0 | 0 | 1 | 1 | In my Zope instance, I have a Python script registered as a browser page. I have the following code as its registry:
<browser:page name="test" for="*" permission="zope2.Public" class="browser.test.PyTest" attribute="CallPy" />
This function, "PyTest.CallPy" is defined as:
def CallPy(self, data): ...
I then use JavaScr... |
How to display the current year in a Django template? | 6,602,387 | 50 | 182 | 64,035 | 0 | python,django | {% now 'Y' %} is the correct syntax | 0 | 0 | 0 | 0 | 2011-06-07T01:23:00.000 | 5 | 1 | false | 6,259,775 | 0 | 0 | 1 | 1 | What is the inbuilt template tag to display the present year dynamically. Like "2011" what would be the template tag to display that? |
Is it possible to code search engine in beautiful Soup | 6,260,471 | 1 | 0 | 262 | 0 | python,linux,search,beautifulsoup | No, BeautifulSoup is not a search engine. It is also not a Swiss Army knife, nor can it make you a sandwich. You will need a database (preferably one that's optimized for search, like Sphinx or Lucene) to do that. | 0 | 0 | 1 | 0 | 2011-06-07T03:17:00.000 | 1 | 1.2 | true | 6,260,277 | 0 | 0 | 1 | 1 | I am using Beautiful Soup for parsing web pages.
Are there any functions in BS which i can use i making search engine or crawling the website to index it in database. |
How to detect online users in a web application in Google App Engine | 6,264,539 | 2 | 2 | 548 | 0 | python,google-app-engine,session | HTTP is stateless, so there's no inherent definition of "online user". You could count the number of non-destroyed sessions you've created, but unless you've got a cron job that destroys old sessions, this won't give an accurate picture.
You basically need to decide how much time without a new page request counts as "o... | 0 | 1 | 0 | 0 | 2011-06-07T08:35:00.000 | 2 | 0.197375 | false | 6,262,601 | 0 | 0 | 1 | 1 | I am currently working on an application for Google App Engine, and I need some advice to detect the number of online users in the application. How can I do this?
I am using a session library. Do I need to overwrite the session methods (create_session, destroy_session increment/and decrement a value in datastore) or i... |
Could not scrape data in English, help! | 6,268,759 | 2 | 0 | 98 | 0 | python,beautifulsoup | You haven't said what the site is so impossible to answer for sure. But a couple of suggestions. If the url does not change when you click the flag, then either:
a) The english is already in the html document, and the relevant content is being switched with javascript
b) The english content is being fetched via an ajax... | 0 | 0 | 0 | 0 | 2011-06-07T16:36:00.000 | 2 | 0.197375 | false | 6,268,580 | 0 | 0 | 1 | 1 | I have a website that I'm trying to scrape using Python & BeautifulSoup. The site itself can be viewed in 2 languages(Thai or English); all you have to do is to click on either the Thai or UK flag on the upper right corner of the screen and the data is displayed in the selected language. When in comes to the script tho... |
Can I use MonkeyRunner tool to work in mobile as application | 6,278,753 | 1 | 0 | 1,492 | 0 | android,python,monkeyrunner | I want to simulate touch event, keyboard event on mobile device. Can I do it with MonkeyRunner?
From your development machine, yes. Per your question title, you cannot use MonkeyRunner on a device.
Also, I have the impression that it only works with SDK?
Yes.
I want the application to be installed on mobile, which... | 1 | 0 | 0 | 0 | 2011-06-08T07:02:00.000 | 3 | 0.066568 | false | 6,275,277 | 0 | 0 | 1 | 1 | I want to simulate touch event, keyboard event on mobile device. Can I do it with MonkeyRunner? Also, I have the impression that it only works with SDK?
I want the application to be installed on mobile, which will perform some random touch, keyboard events. Is it possible with MonkeyRunner?
If yes, please provide me he... |
Are there any techniques to separate code and markup in WordPress? | 6,283,414 | 0 | 3 | 770 | 0 | php,python,model-view-controller,wordpress | I find putting all reusable template items as separate php, and including presentation logic as a theme function/object and business logic in a plugin in an okay way to separate concerns as such objects/functions are always available if loaded correctly. The template parts do save significant time if you use particular... | 0 | 0 | 0 | 0 | 2011-06-08T14:10:00.000 | 4 | 0 | false | 6,280,067 | 0 | 0 | 1 | 2 | I generally work with Python to create web apps and love how I can work separately with the code and presentation layers. I really like working with Jinja2. But, I sometimes have to work with WordPress for my clients. So, I wonder, if there are any ways to make developing for WordPress a less headache with all its head... |
Are there any techniques to separate code and markup in WordPress? | 6,280,300 | 3 | 3 | 770 | 0 | php,python,model-view-controller,wordpress | Agreed with Denis, Wordpress simply is spaghetti, and there's nothing you can do about that. Nonetheless, if you're writing your own code for Wordpress (we make themes and plugins for our customers), there's nothing stopping you from splitting the concerns out into different files, and we found that it's much easier to... | 0 | 0 | 0 | 0 | 2011-06-08T14:10:00.000 | 4 | 1.2 | true | 6,280,067 | 0 | 0 | 1 | 2 | I generally work with Python to create web apps and love how I can work separately with the code and presentation layers. I really like working with Jinja2. But, I sometimes have to work with WordPress for my clients. So, I wonder, if there are any ways to make developing for WordPress a less headache with all its head... |
Controlling size of swf file posted to wall using graph api | 6,337,169 | 0 | 2 | 570 | 0 | php,python,facebook,facebook-graph-api | The answer was to use the still not completely deprecated REST api, which has that functionality. | 0 | 0 | 1 | 0 | 2011-06-08T23:23:00.000 | 2 | 1.2 | true | 6,286,449 | 0 | 0 | 1 | 2 | I am trying to use the Facebook graph api to publish a swf file on my wall, and was wondering if there is anyway I can control the height of the swf file. It looks like facebook sets the height to 259px automatically. Any help would be really appreciated!
Thanks. |
Controlling size of swf file posted to wall using graph api | 6,292,361 | 1 | 2 | 570 | 0 | php,python,facebook,facebook-graph-api | Facebook will automatically set the size to width:398px;height:259px.
The movie will be stretched to accomodate this.
If your movie is a different size, the best thing to do is to make sure it is at least the same aspect ratio. | 0 | 0 | 1 | 0 | 2011-06-08T23:23:00.000 | 2 | 0.099668 | false | 6,286,449 | 0 | 0 | 1 | 2 | I am trying to use the Facebook graph api to publish a swf file on my wall, and was wondering if there is anyway I can control the height of the swf file. It looks like facebook sets the height to 259px automatically. Any help would be really appreciated!
Thanks. |
Django: class views, generic views, etc | 6,286,985 | 4 | 5 | 743 | 0 | python,django | There are in my opinion two cases for necessity of class-based(-generic)-views:
You really need generic functionality in your views and a little bit extra.
You write a resusable Django app and want to make it possible that others can extend your views.
For anything else use what you feel most comfortable with. As you... | 0 | 0 | 0 | 0 | 2011-06-09T00:30:00.000 | 2 | 1.2 | true | 6,286,826 | 0 | 0 | 1 | 1 | I'm coming back to Django after a brief encounter with version 1.2, and now in version 1.3 the favored approach to views seems to be using classes.
Keeping in mind code style, maintainability and modularity: when should I use classes, and when functions? Should I always extend from generic class views (there seems to b... |
Implement time-based quotas in python | 6,286,944 | 1 | 2 | 232 | 0 | python,quota | I'm not aware of any ready-made component, but it should be fairly simple to do this.
I would probably use a database table, containing two columns: user ID and timestamp. Each time a user (IP address?) wants a connection, you find all the entries with that user ID with a timestamp between now and 60 seconds ago. If it... | 0 | 1 | 0 | 0 | 2011-06-09T00:31:00.000 | 1 | 1.2 | true | 6,286,838 | 0 | 0 | 1 | 1 | I need to implement a time-based quota in my python (twisted) application.
Is there an existing module, or other implementation that I should use as a reference?
Specifically, my application needs to ratelimit connections from clients, using rules like '10 connections per minute'.
There is a Google App Engine module na... |
HTML Table -- Putting a Link in the Header for Sorting? (No JavaScript) | 6,297,204 | 0 | 2 | 5,055 | 0 | python,html,django,hyperlink | You would have to grab the 'sort' variable in your server-side code and resend the query to the data source so your table would be populated in the desired manner.
In order to add the link, you would want to dynamically generate the href so it would append the sort=columnnamehere to the query string.
If you need help c... | 0 | 0 | 0 | 0 | 2011-06-09T17:56:00.000 | 2 | 0 | false | 6,297,149 | 0 | 0 | 1 | 1 | I'm dynamically generating a table, as well as the column headers.
How do I make the columns clickable (NO JavaScript!), so that when they're clicked, they add a sort=columnNameHere entry to the query, and reload the current page with that query? |
html post form different destinations | 6,298,838 | 0 | 2 | 2,961 | 0 | javascript,python,html,django,http-post | You can't. There is no way to send a form to two ressources.
What you CAN do is send a HTTP request in your register script to the newsletter script, e.g. using urllib2. | 0 | 0 | 0 | 0 | 2011-06-09T20:25:00.000 | 5 | 0 | false | 6,298,813 | 0 | 0 | 1 | 1 | I am developing a django web app in which I would like to have a registration process. In this registration process I have of course a form asking for name, email and password. What I would like to do is, send the form via post to 2 different places. One of which is of course the registration database which saves the ... |
"Best" way to integrate Django with an Ajax library | 6,309,310 | 1 | 8 | 4,724 | 0 | jquery,python,ajax,django,json | Dajax is quite straight forward. You'd better tell us more about what puzzles you in Dajax. | 0 | 0 | 0 | 0 | 2011-06-10T14:45:00.000 | 5 | 0.039979 | false | 6,307,992 | 0 | 0 | 1 | 2 | Obviously, horses for courses, but what are some good ways to integrate javascript libraries with one's Django application?
I'm planning on using jQuery, mostly because it seems popular and looks powerful (but I'm open to other suggestions).
Are there python-side libraries that are very helpful or essential? Or is it b... |
"Best" way to integrate Django with an Ajax library | 6,308,115 | 5 | 8 | 4,724 | 0 | jquery,python,ajax,django,json | I would suggest that you simply create your own javascript and AJAX views. Ruby on Rails long had the opposite problem: forcing people to do AJAX in a certain way, and it was always a point of conflict for people. Recently, they finally realized their folly and decoupled AJAX from the framework so you can easily use wh... | 0 | 0 | 0 | 0 | 2011-06-10T14:45:00.000 | 5 | 0.197375 | false | 6,307,992 | 0 | 0 | 1 | 2 | Obviously, horses for courses, but what are some good ways to integrate javascript libraries with one's Django application?
I'm planning on using jQuery, mostly because it seems popular and looks powerful (but I'm open to other suggestions).
Are there python-side libraries that are very helpful or essential? Or is it b... |
Installing a my Django app on ec2 | 6,311,394 | 0 | 1 | 618 | 0 | python,django,amazon-ec2,amazon-web-services,cloud-hosting | I usually simply scp -R my whole site directory into /home/bitnami of my AMI. I'm using Apache/NGINX/Django with mod_wsgi. So the directory (for example /home/bitnami/djangosites/) gets referred to based on my mod_wsgi path in my apache cfg file.
In other words, why not just move the whole directory recursively (scp -R... | 0 | 0 | 0 | 1 | 2011-06-10T18:34:00.000 | 3 | 0 | false | 6,310,624 | 0 | 0 | 1 | 1 | Im in the process of launching a Django app on ec2, but have hit a wall trying to install my code on my AMI instance. This is my situation: I have a bitnami AMI up and running that has Django, apache, Postgresql, and nearly all my dependancies pre installed, and I have my fully functional Django app running on my local... |
What are my options for MVC, GUI + Interactive Visualization in App Engine (python)? | 6,314,144 | 1 | 2 | 658 | 0 | python,django,google-app-engine,user-interface,visualization | Does it have to be in python? The GAE has wonderful support for GWT. The GWT eclipse plugin can compile and deploy directly to the GAE with no further modification. The best solution that meets all three of your requirements will be to use GWT + GAE/J.
If you're mainly looking for a charting/graphing solution, there ar... | 0 | 0 | 0 | 0 | 2011-06-11T04:06:00.000 | 3 | 0.066568 | false | 6,313,982 | 0 | 0 | 1 | 2 | I'm creating an app that allows users to query, manipulate, and explore a very large graph.
What's the 'best' way to create a gui + visualization for my project?
By best I mean the following:
1. conforms to web standards, no flavor of the month solution
2. allows creative flexibility
3. intuitive, won't require weeks t... |
What are my options for MVC, GUI + Interactive Visualization in App Engine (python)? | 6,314,329 | 4 | 2 | 658 | 0 | python,django,google-app-engine,user-interface,visualization | App Engine is flexible on the UI side. The Python supports Django templates (0.96 out of the box, and 1.2 with a one-line config change). Django templates are easy to use, and are JavaScript toolkit neutral. I use jQuery, but that's a personal choice that App Engine doesn't impose. On the UI side, it's a safe choice, a... | 0 | 0 | 0 | 0 | 2011-06-11T04:06:00.000 | 3 | 1.2 | true | 6,313,982 | 0 | 0 | 1 | 2 | I'm creating an app that allows users to query, manipulate, and explore a very large graph.
What's the 'best' way to create a gui + visualization for my project?
By best I mean the following:
1. conforms to web standards, no flavor of the month solution
2. allows creative flexibility
3. intuitive, won't require weeks t... |
Django + js Framework | 6,321,230 | 3 | 2 | 2,131 | 0 | javascript,python,django,frameworks | If you already have experience with jQuery, then go on with jQuery!
I use Django + jQuery + Postgresql for all my projects and couldn't be any happier with this powerful combination. | 0 | 0 | 0 | 0 | 2011-06-11T07:37:00.000 | 3 | 0.197375 | false | 6,314,746 | 0 | 0 | 1 | 2 | I want to develop a web application using Django, but I can't decide which javascript framework to use. May be some of you guys has developed Django + JS Framework application? I personally prefer JQuery because it is easy and fast, but other libraries like Dojo has so cool features and widgets. That I want to switch t... |
Django + js Framework | 6,314,809 | 2 | 2 | 2,131 | 0 | javascript,python,django,frameworks | jQuery and Scriptaculous are good choices,
But if you want to develop desktop like functionality over the web Qooxdoo helps alot :-) | 0 | 0 | 0 | 0 | 2011-06-11T07:37:00.000 | 3 | 0.132549 | false | 6,314,746 | 0 | 0 | 1 | 2 | I want to develop a web application using Django, but I can't decide which javascript framework to use. May be some of you guys has developed Django + JS Framework application? I personally prefer JQuery because it is easy and fast, but other libraries like Dojo has so cool features and widgets. That I want to switch t... |
Deploying Django project on EC2 with BitNami image | 6,315,809 | 3 | 2 | 488 | 0 | python,django,deployment,amazon-ec2,amazon-web-services | The answer is pretty obvious. If you start with the Bitnami stack you'll save yourself the hassle of installing and configuring the various components (web server, gateway, python and the required libs, DB, etc.).
So if you app is pretty straight forward (typical web app) then sure, start with the bitnami stack. At mos... | 0 | 1 | 0 | 0 | 2011-06-11T11:35:00.000 | 1 | 0.53705 | false | 6,315,654 | 0 | 0 | 1 | 1 | I have a complex university project that requires building some specific libraries and the use of threads (AppEngine out of the question), and I want to deploy in on EC2 (Free tier deal).
I was wondering what would be best, to start with a bare linux distribution or the BitNami Django stack ?
I've seen similar question... |
Apache + mod_wsgi / Lighttpd + wsgi - am I going to see differences in performance? | 6,319,726 | 1 | 3 | 2,472 | 0 | python,apache,lighttpd | That you have mentioned gevent is important. Does that mean you are specifically trying to implement a long polling application? If you are and that functionality is the bulk of the application, then you will need to put your gevent server behind a front end web server that is implemented using async techniques rather ... | 0 | 0 | 0 | 1 | 2011-06-12T01:31:00.000 | 2 | 0.099668 | false | 6,319,575 | 0 | 0 | 1 | 2 | I'm a newbie to developing with Python and I'm piecing together the information I need to make intelligent choices in two other open questions. (This isn't a duplicate.)
I'm not developing using a framework but building a web app from scratch using the gevent library. As far as front-end web servers go, it seems I have... |
Apache + mod_wsgi / Lighttpd + wsgi - am I going to see differences in performance? | 6,319,667 | 5 | 3 | 2,472 | 0 | python,apache,lighttpd | Apache...
Apache is by far the most widely used web server out there. Which is a good thing. There is so much more information on how to do stuff with it, and when something goes wrong there are a lot of people who know how to fix it. But, it is also the slowest out of the box; requring a lot of tweaking and a beefier ... | 0 | 0 | 0 | 1 | 2011-06-12T01:31:00.000 | 2 | 1.2 | true | 6,319,575 | 0 | 0 | 1 | 2 | I'm a newbie to developing with Python and I'm piecing together the information I need to make intelligent choices in two other open questions. (This isn't a duplicate.)
I'm not developing using a framework but building a web app from scratch using the gevent library. As far as front-end web servers go, it seems I have... |
Choosing a Python webscraping framework for handling pure Javascript based sites | 6,322,502 | 0 | 2 | 1,041 | 0 | python,selenium,web-scraping,selenium-webdriver,windmill | Before using tools like Selenium that are designed for front end testing and not for scraping, you should have a look at where the data on the site comes from. Find out what XHR requests are made, what parameters they take and what the result is.
For example the site you mentioned in your comment does a POST request wi... | 0 | 0 | 1 | 0 | 2011-06-12T11:32:00.000 | 1 | 0 | false | 6,321,696 | 0 | 0 | 1 | 1 | I'm a Python programmer specializing in web-scraping, I had to ask this question as I found nothing relevant.
I want to know what are the popular, well documented frameworks that are available for Python for scraping pure Javascript based sites? Currently I know Mechanize and Beautiful Soup but they do not interact wi... |
E-commerce from scratch or not | 6,325,410 | 3 | 10 | 12,769 | 0 | php,python,django,magento,e-commerce | I've no experience with Django. I develop websites using Wordpress and a year ago I tested Magento (not tested it since).
I was surprised of how user friendly Magento was. Both front end and backend. It was really easy to set up. You can easily customize the layout as well using Magento template API.
Here are some pros... | 0 | 0 | 0 | 0 | 2011-06-12T22:22:00.000 | 8 | 1.2 | true | 6,325,094 | 0 | 0 | 1 | 2 | I need to develop a new site with the e-commerce part. I'm here to get some hints from you on which road I should go on.
The site will have a static part which include some static pages and the e-commerce part for sell the products. I'm a Django and PHP developer but this is the first time I need to develop an e-commer... |
E-commerce from scratch or not | 6,325,503 | 0 | 10 | 12,769 | 0 | php,python,django,magento,e-commerce | Many of us have been in the same situation before - code-from-scratch (CFS) or use a framework.
My experience - I started scripting with Perl. And one of the most used module (for web programming) of PERL is CGI. Some considered it a 'heavy' module and thus a few had developed a 'lighter' version of it. For a newbie, ... | 0 | 0 | 0 | 0 | 2011-06-12T22:22:00.000 | 8 | 0 | false | 6,325,094 | 0 | 0 | 1 | 2 | I need to develop a new site with the e-commerce part. I'm here to get some hints from you on which road I should go on.
The site will have a static part which include some static pages and the e-commerce part for sell the products. I'm a Django and PHP developer but this is the first time I need to develop an e-commer... |
GSUtil vs PHP RESTful class | 9,041,894 | 2 | 0 | 766 | 0 | php,python,rest,google-cloud-storage | Fundamentally, your PHP code and gsutil are both using the RESTful interface (gsutil is actually layered atop an open source Python library called boto which implements the bulk of the REST interface), however, there are several reasons to consider using gsutil:
Gsutil takes care of OAuth 2.0 authentication/authorizat... | 0 | 0 | 0 | 1 | 2011-06-13T07:18:00.000 | 1 | 1.2 | true | 6,327,592 | 0 | 0 | 1 | 1 | We all know that working with S3 is a pain: deleting virtual directories requires to delete all the objects from within the path, etc. At least with RESTful API this is the case.
I was wondering whether there would be any performance improvement if I would use PHP to call GSUtil rather than using my own PHP class. Is t... |
Can I generate html templates from models | 6,328,303 | 1 | 2 | 131 | 0 | python,django | For a list page, you could just generate a table.
For an add/edit page, use Django Forms. | 0 | 0 | 0 | 0 | 2011-06-13T08:43:00.000 | 2 | 0.099668 | false | 6,328,289 | 0 | 0 | 1 | 1 | I know we can generate Database Tables from models, which enables a fast development.
Can we also generate HTML templates from models, such as list/add/edit?
You know we can do this in Grails. Hopefully we can also do that in Django. |
limits of bulk email in GAE | 6,337,957 | 2 | 1 | 196 | 0 | python,google-app-engine,email,backend,task-queue | Enqueue a single task which sends emails sequentially, checking the wallclock time after each email. When the time approaches 10 minutes, chain another task to continue where the current task left off. If you want to send emails faster, parallelize this, and enqueue several tasks that each send emails to a subset of us... | 0 | 1 | 0 | 0 | 2011-06-13T15:30:00.000 | 1 | 1.2 | true | 6,332,562 | 0 | 0 | 1 | 1 | I'm working on a voting app where I need to send an email to each voter to inform him or her about the election. I see three methods for doing this and I'm curious what the approximate limits on the number of emails I could send with each method:
In a user request, add a task to a task queue where each task sends one... |
GAE expanded log view | 6,337,910 | 1 | 0 | 96 | 0 | python,google-app-engine,logging | App Engine stores logging information in a set of circular buffers. When it runs out of space, it overwrites older log entries with the new data. What you're seeing is requests for which the detailed logs have been overwritten by newer requests. | 0 | 1 | 0 | 0 | 2011-06-13T19:24:00.000 | 1 | 1.2 | true | 6,335,248 | 0 | 0 | 1 | 1 | This might not be bug, but feature. I'm having problem views expanded logs when searching logs in dashboard on app engine.
Search results show first couple of logs in full detail, but rest of log entries are obscured. Every new entry in log is shown in full details, but older ones get obscured over the time.
Same beh... |
Django-Haystack with Solr contains search | 16,082,986 | 2 | 7 | 2,893 | 0 | python,django,solr,django-haystack | You can achieve the same behavior without having to touch the solr schema. In your index, make your text field an EdgeNgramField instead of a CharField. Under the hood this will generate a similar schema to what lindstromhenrik suggested. | 0 | 0 | 0 | 0 | 2011-06-14T00:14:00.000 | 4 | 0.099668 | false | 6,337,811 | 0 | 0 | 1 | 2 | I am using haystack within a project using solr as the backend. I want to be able to perform a contains search, similar to the Django .filter(something__contains="...")
The __startswith option does not suit our needs as it, as the name suggests, looks for words that start with the string.
I tried to use something like... |
Django-Haystack with Solr contains search | 14,520,797 | 0 | 7 | 2,893 | 0 | python,django,solr,django-haystack | I am using an expression like:
.filter(something__startswith='...')
.filter_or(name=''+s'...')
as is seems solr does not like expression like '...*', but combined with or will do | 0 | 0 | 0 | 0 | 2011-06-14T00:14:00.000 | 4 | 0 | false | 6,337,811 | 0 | 0 | 1 | 2 | I am using haystack within a project using solr as the backend. I want to be able to perform a contains search, similar to the Django .filter(something__contains="...")
The __startswith option does not suit our needs as it, as the name suggests, looks for words that start with the string.
I tried to use something like... |
Link within flash file posted on facebook wall possible? | 6,349,413 | 0 | 1 | 262 | 0 | python,flash,facebook,facebook-graph-api | I suppose so... just set a click event handler inside the Flash movie to redirect the user to wherever you want. | 0 | 0 | 1 | 0 | 2011-06-14T05:42:00.000 | 2 | 1.2 | true | 6,339,541 | 0 | 0 | 1 | 2 | Is there anyway I can add a link to a flash file I post on my wall using the rest/graph api, such that when a user clicks on the flash file playing, it takes them to my app?
Thanks. |
Link within flash file posted on facebook wall possible? | 15,536,720 | 1 | 1 | 262 | 0 | python,flash,facebook,facebook-graph-api | I don't know if you still require this , But here is the solution to what you are seeking:
Use the Feed dialog , and specify in the link parameter the URL of your APP , and in the source parameter , the URL of the flash file you want to post. | 0 | 0 | 1 | 0 | 2011-06-14T05:42:00.000 | 2 | 0.099668 | false | 6,339,541 | 0 | 0 | 1 | 2 | Is there anyway I can add a link to a flash file I post on my wall using the rest/graph api, such that when a user clicks on the flash file playing, it takes them to my app?
Thanks. |
Connecting C# Back-end with PHP frontend | 6,341,033 | 1 | 4 | 3,827 | 0 | c#,php,asp.net,python,web-services | You can do whatever you like. Personally i wouldnt use php because i dont know very much php.
But you can do it, you could expose a soap web service and there are libraries that will let php talk to it.
No one here will be able to tell you what you haven't already told us. Asp.Net will probably be easier because of how... | 0 | 0 | 0 | 1 | 2011-06-14T08:28:00.000 | 4 | 0.049958 | false | 6,340,972 | 1 | 0 | 1 | 3 | I have a code written in C# I would like to use as the back-end of a site I'm building.
I would prefer not to build the site front-end in ASP.NET (which integrates nicely with C#), and to use PHP or Python instead.
Is that reasonable? Should I re-consider using ASP.NET?
How can I achieve that? |
Connecting C# Back-end with PHP frontend | 43,901,958 | 0 | 4 | 3,827 | 0 | c#,php,asp.net,python,web-services | Ugh, in normal instances, reading data with C# writing it to files and loading up with PHP sound slow, inefficient and down wright crazy. I believe these terms are being used wrongly.
Client Server - user machine - database great for private networks where you connect to the DB without going over the internet
vs n-Tier... | 0 | 0 | 0 | 1 | 2011-06-14T08:28:00.000 | 4 | 0 | false | 6,340,972 | 1 | 0 | 1 | 3 | I have a code written in C# I would like to use as the back-end of a site I'm building.
I would prefer not to build the site front-end in ASP.NET (which integrates nicely with C#), and to use PHP or Python instead.
Is that reasonable? Should I re-consider using ASP.NET?
How can I achieve that? |
Connecting C# Back-end with PHP frontend | 6,341,059 | 3 | 4 | 3,827 | 0 | c#,php,asp.net,python,web-services | Just use asp.net mvc framework for the frontend instead of plain asp.net. It's easy to learn. And if you know php it will be easy to you undestand asp.net mvc.
I don't see the reasons if you are using c# backend use php frontend. For sure you can create service layer on c# and communicate with php through it, but it d... | 0 | 0 | 0 | 1 | 2011-06-14T08:28:00.000 | 4 | 0.148885 | false | 6,340,972 | 1 | 0 | 1 | 3 | I have a code written in C# I would like to use as the back-end of a site I'm building.
I would prefer not to build the site front-end in ASP.NET (which integrates nicely with C#), and to use PHP or Python instead.
Is that reasonable? Should I re-consider using ASP.NET?
How can I achieve that? |
Adding custom button or a tag to django admin | 7,200,879 | 0 | 0 | 1,283 | 0 | python,django-admin | I used Omokoli's solution from above but to make the field use my custom widget I did:
class MyModelAdminForm(forms.ModelForm):
class Meta:
model = get_model('myapp', 'mymodel')
widgets = {
'original_link': OutputWidget,
} | 0 | 0 | 0 | 0 | 2011-06-14T10:27:00.000 | 4 | 0 | false | 6,342,183 | 0 | 0 | 1 | 1 | I want to add some html element (button, "a" tag, etc ) to a django admin page. How can i do it? Please help. |
Is there a standard DSL for data integrity validation? | 6,509,510 | 1 | 3 | 976 | 0 | java,python,validation,import-from-csv | Can you imagine a DSL that would do it? How will the rules look like?
Several months ago I worked on such problem - in the end it turned out to be harder than it seemed first.
The first step was obvious - all
rows were parsed and placed to the
special data stuctures so I could
work with them; the ones with
missing f... | 0 | 0 | 0 | 0 | 2011-06-14T17:12:00.000 | 1 | 0.197375 | false | 6,347,374 | 0 | 0 | 1 | 1 | I am faced with CSV files which come from clients and which can contain hundreds of thousands of rows. Is there a DSL (or wildly popular library in Java or Python) which can efficiently run calculations on this information, applying various rules to issue warnings and errors (user-configurable, of course)? |
pyramid: get application absolute url | 6,360,651 | 4 | 5 | 2,905 | 0 | python,pylons,pyramid | Pyramid (like most WSGI applications) can be mounted on any domain and url prefix. Thus the application itself doesn't actually know what urls it is responsible for unless you code that into your application specifically (an INI setting, for example).
This is why request.application_url exists... because the applicatio... | 0 | 0 | 0 | 0 | 2011-06-14T18:15:00.000 | 2 | 1.2 | true | 6,348,094 | 0 | 0 | 1 | 1 | Is there any way to get pyramid absolute application url in main() function?
I want to add it into global settings, so it could be called every where(in templates and js files).
In pyramid documents there is some functions would help, but all of them need a request object and must call in a view.
Thanks. |
Turing complete template engines | 6,351,798 | 0 | 5 | 630 | 0 | python,ruby,perl,templates,programming-languages | Virtually anything that allows procedural code to compute the template result. | 0 | 0 | 0 | 1 | 2011-06-15T00:38:00.000 | 4 | 0 | false | 6,351,765 | 0 | 0 | 1 | 1 | What template engines / template languages are turing complete? I heard about these so far:
FreeMarker (implemented in java)
MovableTypes template language (in perl)
xslt :-(
Cheetah (in Python)
Smarty (in PHP)
Any others (especially implemented with perl)?
Ps: Don't waste time with clarifying me MVC, and why turing ... |
Formatting strings with python in django | 6,355,486 | 1 | 1 | 170 | 0 | python,django,string | The most flexible way - is to create custom template filter. If string needs formatting, it will do that, if it doesn't - just output it. | 0 | 0 | 0 | 0 | 2011-06-15T09:09:00.000 | 1 | 1.2 | true | 6,355,449 | 0 | 0 | 1 | 1 | I have a question list for a questionnaire which are stored in database but some questions has to be modified by certain parameters.
For example, if someone selects an employer name from previous page, some questions should have employer's name "Do you like to work for ........ company ?".
One solution might be savinf ... |
Python Plone views call others | 6,360,580 | 1 | 0 | 327 | 0 | python,views,plone | Just import it and call it as any other function. You don't want to make it a view - that requires you to do a MultiAdapter lookup which is a real pain, and completely unnecessary.
[Edit - strictly using a view is a MultiAdapter lookup, but you can shortcut it via traversal, but that still isn't worth the effort] | 0 | 0 | 0 | 1 | 2011-06-15T14:44:00.000 | 1 | 1.2 | true | 6,359,581 | 0 | 0 | 1 | 1 | I have a Python function registered as a View in Plone. I need to be able to call another function from within this registered function. I'm not sure if it would be best to register this other function as a view as well and try to call that (don't know how to call other views), or if there is a better way to handle t... |
How do I write the Multiplication Sign in reStructuredText (reST)? | 14,228,087 | 3 | 3 | 6,465 | 0 | utf-8,special-characters,python-sphinx,restructuredtext | I would use MathML within rst :math:`m \times p` | 0 | 0 | 0 | 0 | 2011-06-16T08:26:00.000 | 4 | 0.148885 | false | 6,369,049 | 1 | 0 | 1 | 1 | I'm writing reST documents that will be rendered to HTML and PDF using Sphinx. My source files are UTF-8, and expect my HTML to be displayed as UTF-8.
What's the best practice for writing the multiplication sign?
That is: ×, not x.
I know I can insert it as a Unicode character. If I were writing LaTeX, I'd use \times.... |
App Engine TimeOut Error: Serving a third-party API with an image stored on App Engine | 6,373,752 | 1 | 1 | 494 | 0 | python,image,api,google-app-engine,timeout | If you directly use the App Engine URLfetch API, you can adjust the timeout for your request. The default is 5 seconds, and it can be increased to 10 seconds for normal handlers, or to 10 minutes for fetches within task queue tasks or cron jobs.
If the external API is going to take more than 10 seconds to respond, prob... | 0 | 1 | 0 | 0 | 2011-06-16T10:21:00.000 | 1 | 1.2 | true | 6,370,335 | 0 | 0 | 1 | 1 | I'm building an application in Python on App Engine. My application receives images as email attachments. When an email comes in, I grab the image and need to send it to a third party API.
The first thing I did was:
1) make a POST request to the third party API with the image data
I stopped this method because I had so... |
Django create groups on init, extending superuser profile | 6,374,988 | 6 | 4 | 2,720 | 0 | python,django,django-syncdb | 2 steps:
Take a dump from an existing database containing all the required data using the command dumpdata
After syncdb, load the fixture using the command loaddata | 0 | 0 | 0 | 0 | 2011-06-16T16:00:00.000 | 3 | 1 | false | 6,374,899 | 0 | 0 | 1 | 1 | I create a site in Django and here is my Question
How to make something like this:
On init (for example, when someone run "syncdb"?)
I need to create a group with permissions
and extend superuser profile from User to UserProfile(when user register it's not a problem but first admin/superuser is autocreated when app is ... |
django: why does accessing a page from web browser freeze the server? | 6,391,503 | 2 | 2 | 256 | 0 | python,django,browser | The Django development server only does 1 request at a time. I believe that's why you have the issue. | 0 | 0 | 0 | 0 | 2011-06-17T20:23:00.000 | 2 | 0.197375 | false | 6,391,388 | 0 | 0 | 1 | 1 | I've made a django app, running it w/ the built-in server for now (just for testing). I have programs which access urls multiple times per second on the app without any issues. However, when I view an admin page, or one of those URLs that the program visits, in a web browser, the server freezes for many seconds. Why mi... |
Installing Mechanize using easy_install | 6,395,374 | 0 | 0 | 248 | 0 | python,mechanize,easy-install | What's your Python installation location?
How did you run easy_install?
easy_install probably uses the default user account permissions and you need to manually change file permissions / ownership so that non-admins can see the files.
Generally, easy_install is designed for single user installations (development use) ... | 0 | 1 | 0 | 0 | 2011-06-18T06:26:00.000 | 1 | 1.2 | true | 6,394,305 | 0 | 0 | 1 | 1 | I've installed mechanize using easy_install on Windows 7 Admin account. However, when I try to setup/run another program that needs mechanize on a different account, it doesn't find it.
Any solutions? |
Fastest way to handle a submit button with a variable in it? | 6,400,025 | 1 | 0 | 75 | 0 | python,html,forms | If the POST values are stored in a dict you could turn this around and instead of looking for something that looks like a remove-# you generate all remove-# and try to use them to index the dict. That would limit the search to O(m) where m is the number of elements that can be removed. | 0 | 0 | 0 | 0 | 2011-06-19T01:22:00.000 | 3 | 0.066568 | false | 6,399,975 | 0 | 0 | 1 | 2 | I've got a form with a bunch of items. Beside each item is a "Remove" button. When one of buttons is pressed, I need to know which one so that I know which item to remove.
The way I have it now, each button is named remove-# where # is the index of the item. In order to grab the # though I have to loop over every POST ... |
Fastest way to handle a submit button with a variable in it? | 6,399,995 | 1 | 0 | 75 | 0 | python,html,forms | An option would be to put each remove button in a separate form, with a hidden value with a constant name and the value indicating which item to remove. | 0 | 0 | 0 | 0 | 2011-06-19T01:22:00.000 | 3 | 0.066568 | false | 6,399,975 | 0 | 0 | 1 | 2 | I've got a form with a bunch of items. Beside each item is a "Remove" button. When one of buttons is pressed, I need to know which one so that I know which item to remove.
The way I have it now, each button is named remove-# where # is the index of the item. In order to grab the # though I have to loop over every POST ... |
Java applet or a custom browser plugin? | 6,401,478 | 1 | 0 | 550 | 0 | java,python,applet | The universal API for browser addons is javascript. It is well supported in Firefox, Chromium/Chrome, and Opera at least; it is the only extension API available on the last two. Intersting API subsets are firefox's Fuel, Chromium's trimmed down extension api, and the very portable GreaseMonkey functions.
A second runti... | 0 | 0 | 0 | 0 | 2011-06-19T08:44:00.000 | 1 | 0.197375 | false | 6,401,415 | 0 | 0 | 1 | 1 | We're writing a platform for building apps that are able to run on any browser and we were thinking, is there a way to do this with Python? Or should we better go with Java and Java Applets?
I was also wondering, how hard is it to write a custom browser plugin? How long would it take e.g. in man-hours?
Thank you! |
`Node.js` and/or other Javascript offshoots' performance, stability and speed relative to non-JS frameworks (Rails, Django...) | 6,409,663 | 7 | 20 | 6,136 | 0 | javascript,python,ruby-on-rails,node.js,model-view-controller | Node.js is beating other platforms, sure. But it's not it's raw speed (V8), it's the sophisticated event-driven model which powers the node.js platform ;) | 0 | 0 | 0 | 0 | 2011-06-20T09:35:00.000 | 3 | 1 | false | 6,409,306 | 0 | 0 | 1 | 1 | I find myself often needing performance & speed references for friends who still don't believe a Node.js or other Javascript-derived implementation or application can compete with those powered by Rails, Pure Ruby, .NET, Python and similar setups.
I have seen very impressive reports on this, with graphs and eyecandy, b... |
Google App Engine __main__ module | 6,418,275 | 2 | 1 | 332 | 0 | python,google-app-engine | each script entry in your app.yaml will be executed as a __main__ module. If you only want a single __main__ then you need to run everything through a single entry-point and map everything via a single WSGIApplication instance. | 0 | 1 | 0 | 0 | 2011-06-20T17:53:00.000 | 1 | 1.2 | true | 6,415,316 | 0 | 0 | 1 | 1 | I'm building a data seeder module that looks for all models using introspection and the inspect module. I index the models I found by a string looking like module.model_name because there might be more modules with the same name in different modules.
The problem is that module sometimes is indeed the right module name,... |
Passing session info from python to flex | 6,418,097 | 2 | 0 | 213 | 0 | python,django,apache-flex,pyamf | If your Python/DJango app uses cookies for tracking sessions; then you just have to make sure that your SWF is served off the same domain that the Python app is served from.
The Flash Player will pass the appropriate cookies to the remote server whenever it makes a call to that server. As long as your "Flash Call" e... | 0 | 0 | 0 | 0 | 2011-06-20T21:49:00.000 | 1 | 0.379949 | false | 6,417,986 | 0 | 0 | 1 | 1 | I have a simple site made with python (django). User registers, inputs some basic info and it stores it to mysql. User then is able to log in with his username/password which he created...
Now i want to add a flex application which will run once the user is logged in, but i dont want the user to have to log in twice ... |
Python replacements for RVM/Bundler/Capistrano | 6,422,391 | 3 | 10 | 1,832 | 0 | python,ruby,development-environment,env | pip is 'the' tool for Python packages, replacing easy_install. Most people are using virtualenv for multiple python environments. | 0 | 0 | 0 | 0 | 2011-06-21T08:09:00.000 | 2 | 0.291313 | false | 6,422,189 | 1 | 0 | 1 | 2 | I'm just moving over from Ruby/Rails development to Python/Django and i'm trying to find the best replacements for RVM/Bundler/Capistrano but it seems to be a total mess?
I've found these so far:
pythonbrew
virtualenv
envwrapper
pip
easyinstall
setuptools
For capistrano I've found Fabric which seems to fit fairly we... |
Python replacements for RVM/Bundler/Capistrano | 6,422,481 | 3 | 10 | 1,832 | 0 | python,ruby,development-environment,env | I have used pip/virtualenv/fabric extensively and am happy with it. You can't go wrong with this choice.
I haven't used pythonbrew however, so I can't do any relative comparison. | 0 | 0 | 0 | 0 | 2011-06-21T08:09:00.000 | 2 | 1.2 | true | 6,422,189 | 1 | 0 | 1 | 2 | I'm just moving over from Ruby/Rails development to Python/Django and i'm trying to find the best replacements for RVM/Bundler/Capistrano but it seems to be a total mess?
I've found these so far:
pythonbrew
virtualenv
envwrapper
pip
easyinstall
setuptools
For capistrano I've found Fabric which seems to fit fairly we... |
Decoupling Domain classes from Django Model Classes | 6,426,206 | 4 | 15 | 2,441 | 0 | python,django,model | Can you seriously envisage a possibility that you're going to just ditch the Django ORM, but keep everything else? Or that if you ditched Django totally, any of your code is still going to be applicable?
You don't complain that if you ditched Django, you'll have to rewrite all your templates. Of course you will, that's... | 0 | 0 | 0 | 0 | 2011-06-21T12:54:00.000 | 4 | 0.197375 | false | 6,425,535 | 0 | 0 | 1 | 4 | So I have completed my OO analysis and design of a web application that I am building and am now getting into implementation. Design decisions have been made to implement the system using Python and the web development framework Django.
I want to start implementing some of my domain entity classes which need persistenc... |
Decoupling Domain classes from Django Model Classes | 6,426,280 | 0 | 15 | 2,441 | 0 | python,django,model | You would not have to "rewrite your models from scratch" if you wanted a different persistence mechanism. The whole point of an activerecord-style persistence system is that it imposes minimal constraints on the model classes, and acts largely transparently.
If you're really worried, abstract out any code that relies o... | 0 | 0 | 0 | 0 | 2011-06-21T12:54:00.000 | 4 | 0 | false | 6,425,535 | 0 | 0 | 1 | 4 | So I have completed my OO analysis and design of a web application that I am building and am now getting into implementation. Design decisions have been made to implement the system using Python and the web development framework Django.
I want to start implementing some of my domain entity classes which need persistenc... |
Decoupling Domain classes from Django Model Classes | 20,776,976 | 0 | 15 | 2,441 | 0 | python,django,model | I think that there's no implemented solution for decoupling Django models and the domain classes, at least I haven't found any. In fact, the only ORM with such decoupling that I know exists only in Smalltalk world and it's called GLORP. It allows you to persist your domain model in a relational DB without having to mod... | 0 | 0 | 0 | 0 | 2011-06-21T12:54:00.000 | 4 | 0 | false | 6,425,535 | 0 | 0 | 1 | 4 | So I have completed my OO analysis and design of a web application that I am building and am now getting into implementation. Design decisions have been made to implement the system using Python and the web development framework Django.
I want to start implementing some of my domain entity classes which need persistenc... |
Decoupling Domain classes from Django Model Classes | 6,426,080 | 3 | 15 | 2,441 | 0 | python,django,model | Well, the way to go with Django is to inherit from Django's base model classes. This is the 'active record' pattern. Your django models will have all CRUD and query methods along with you business logic (if you decide to add it of course). This is seen as an anti-pattern in the java world, but the cool thing about it i... | 0 | 0 | 0 | 0 | 2011-06-21T12:54:00.000 | 4 | 0.148885 | false | 6,425,535 | 0 | 0 | 1 | 4 | So I have completed my OO analysis and design of a web application that I am building and am now getting into implementation. Design decisions have been made to implement the system using Python and the web development framework Django.
I want to start implementing some of my domain entity classes which need persistenc... |
Sever Side convert SVG to PNG or JPG image with Python on Google Application Engine | 6,434,768 | -1 | 3 | 2,517 | 0 | python,google-app-engine,svg | If you manage to find (or write) a pure Python library to do this, it is likely to be prohibitive to run it on GAE due to the amount of computation required and the request time restrictions.
I would consider hosting the image conversion service elsewhere and have the GAE fetch the PNGs from there | 0 | 0 | 0 | 0 | 2011-06-22T03:17:00.000 | 2 | 1.2 | true | 6,434,530 | 0 | 0 | 1 | 1 | How to convert SVG to PNG or JPG image with Python on Google Application Engine?
Any idea?
Google Application Engine has PIL support. However, PIL doesn't support SVG. |
Python and Django IDE with remote editing? | 6,714,141 | 6 | 8 | 5,204 | 0 | python,django,ide | I have Pycharm setup on a Ubuntu 10.10. The key is to use "sshfs" - it maps to my web-host - via ssh. Those are the pre-reqs : ssh access, sshfs. (unless you can figure out a way to map ssh to a windows shared drive).
So once ssh, sshfs are setup, I create a linux mount locally - so my webhost's directory appears loca... | 0 | 0 | 0 | 1 | 2011-06-22T04:45:00.000 | 3 | 1.2 | true | 6,435,000 | 0 | 0 | 1 | 1 | I'm looking for an IDE that will allow me to edit remote Python projects and also has decent Django support, remote command execution, and maybe remote debugging. I've tried PyCharm and Aptana with PyDev but I'm not having much luck configuring them for remote editing. Thanks for your help! |
Why python module not found on apache | 6,436,999 | 2 | 1 | 581 | 0 | python,django,apache | HTTPd using a different version/install of Python than your REPL. | 0 | 0 | 0 | 0 | 2011-06-22T08:26:00.000 | 1 | 1.2 | true | 6,436,979 | 0 | 0 | 1 | 1 | I have a problem with python and Django.
I have the error "Error was: No module named httplib2", so i installed httplib2. When i go on my console and type "import httplib2" it works!
But when i try to do that on my web page, it fails.
Any idea?
Thank you! |
Python - How to import functions? | 6,443,008 | 0 | 2 | 1,269 | 0 | python,syntax,import | You would have to import the class to get access to the instance method you've defined on the class. | 0 | 0 | 0 | 0 | 2011-06-22T16:01:00.000 | 2 | 0 | false | 6,442,959 | 1 | 0 | 1 | 1 | models.py
def operation(argument):
#Operation
return variable
class X(models.Model)
a = models ...
b = models ...
I am trying to import operation in my views.py .. When I try using
from project.models import operation
But then I get the following error
ImportError: cannot im... |
Python function return to jQuery var | 6,444,570 | -2 | 1 | 1,309 | 0 | jquery,python | Why would you say "without using JSON"? That's exactly what JSON is for. | 0 | 0 | 0 | 0 | 2011-06-22T18:08:00.000 | 4 | -0.099668 | false | 6,444,458 | 1 | 0 | 1 | 1 | I've a python script that returns something. In a html page, I use jQuery to send a GET request to this script (with $.get()). I want the "return" of python script in a jQuery/javascript var. Is it possible with jQuery function? Without use JSON or other. |
What is the significance of the 'P' in LAMP? Why is it PHP, Perl, or Python? | 6,446,503 | 2 | 3 | 6,337 | 0 | java,python,ruby,lamp | I think you're trying to read too much into what it means. The acronym became popular because they were often used together and it was easy to pronounce. It doesn't have any meaning or implication beyond the literal one. There's also WAMP (Windows), LAPP (PostgreSql) and whatever else you want to make up. | 0 | 0 | 0 | 1 | 2011-06-22T20:50:00.000 | 4 | 0.099668 | false | 6,446,385 | 0 | 0 | 1 | 4 | I'm a Java web developer that knows a bit of Python (but haven't done any Python web development), and I am curious what exactly is meant by a LAMP stack.
I understand this to be Linux-Apache-MySQL-(PHP, Perl, or Python), but I don't understand what unites these three languages other than the letter P.
Is a LAMP stack ... |
What is the significance of the 'P' in LAMP? Why is it PHP, Perl, or Python? | 6,447,007 | 1 | 3 | 6,337 | 0 | java,python,ruby,lamp | Besides being popular Web development languages, Perl, PHP, and Python share something else: They are all dynamically typed languages, and notoriously fast to develop in. I believe this is part of the "spirit" of LAMP.
So, while it's true you could substitute any other language in for the 'P', some languages fit the ... | 0 | 0 | 0 | 1 | 2011-06-22T20:50:00.000 | 4 | 0.049958 | false | 6,446,385 | 0 | 0 | 1 | 4 | I'm a Java web developer that knows a bit of Python (but haven't done any Python web development), and I am curious what exactly is meant by a LAMP stack.
I understand this to be Linux-Apache-MySQL-(PHP, Perl, or Python), but I don't understand what unites these three languages other than the letter P.
Is a LAMP stack ... |
What is the significance of the 'P' in LAMP? Why is it PHP, Perl, or Python? | 6,446,413 | 8 | 3 | 6,337 | 0 | java,python,ruby,lamp | It's just so happens that the most commonly used components in that part of the stack all happened to begin with a P. It's nothing more than a coincidence. The LAMP acronym was coined before Ruby gained its current popularity levels and there's no reason why you couldn't stick Ruby in the P slot. | 0 | 0 | 0 | 1 | 2011-06-22T20:50:00.000 | 4 | 1.2 | true | 6,446,385 | 0 | 0 | 1 | 4 | I'm a Java web developer that knows a bit of Python (but haven't done any Python web development), and I am curious what exactly is meant by a LAMP stack.
I understand this to be Linux-Apache-MySQL-(PHP, Perl, or Python), but I don't understand what unites these three languages other than the letter P.
Is a LAMP stack ... |
What is the significance of the 'P' in LAMP? Why is it PHP, Perl, or Python? | 6,446,566 | 7 | 3 | 6,337 | 0 | java,python,ruby,lamp | I believe the P originally stood mainly for PHP, as that particular combination was extremely widely used. It got expanded to include Python and Perl as non-PHP languages became more popular for web development, and never expanded further because it would have broken the acronym.
LAMP is a de facto standard way of doin... | 0 | 0 | 0 | 1 | 2011-06-22T20:50:00.000 | 4 | 1 | false | 6,446,385 | 0 | 0 | 1 | 4 | I'm a Java web developer that knows a bit of Python (but haven't done any Python web development), and I am curious what exactly is meant by a LAMP stack.
I understand this to be Linux-Apache-MySQL-(PHP, Perl, or Python), but I don't understand what unites these three languages other than the letter P.
Is a LAMP stack ... |
Python - from Script to Web App? | 6,448,835 | 3 | 2 | 947 | 0 | python,web-services,web-applications | Go check out Google App Engine. There's a Python API. It works well with other Google services, like Calendar. Probably the fastest way to get where you want to go. | 0 | 0 | 1 | 0 | 2011-06-23T02:48:00.000 | 3 | 1.2 | true | 6,448,814 | 0 | 0 | 1 | 1 | I have a Python script that can run in command line/console which works with the Google Calendar Data API to do some tasks like retrieve calendars and modify or update events. I want to turn it into a web application/interface, but was not sure what would be the optimal or simplest way going about it.
Some precursor in... |
idle state detection silverlight 4 application | 9,692,923 | 2 | 6 | 1,573 | 0 | silverlight,python-idle,dispatchertimer | Handled events will not bubble up to root control. Instead you should use the AddHandler method with handledEventsToo = true. | 1 | 0 | 0 | 0 | 2011-06-23T09:25:00.000 | 2 | 0.197375 | false | 6,451,919 | 0 | 0 | 1 | 1 | What's the best way to detect idle state for a silverlight application? I have read quite a few articles on the net by now and usually they are either for wpf/mobile apps etc.
I have created a DispatcherTimer which locks the screen after 5 minutes and it seems that I will have to go to every widget in every screen(my ... |
Making only one task run at a time in celerybeat | 6,455,760 | 0 | 4 | 3,061 | 0 | python,celery,celerybeat | You can try adding a classfield to the object that holds the function that youre making run and use that field as a "some other guy is working or not" control | 0 | 1 | 0 | 0 | 2011-06-23T13:45:00.000 | 4 | 0 | false | 6,455,046 | 0 | 0 | 1 | 1 | I have a task which I execute once a minute using celerybeat. It works fine. Sometimes though, the task takes a few seconds more than a minute to run because of which two instances of the task run. This leads to some race conditions that mess things up.
I can (and probably should) fix my task to work properly but I wan... |
django templates performance | 6,457,582 | 3 | 4 | 673 | 0 | python,django,performance,django-templates | This is like the argument about the most efficient way to append strings (virtually every programming language has that argument). This is 2011, not 1970. Even consumer level computers have processing power and memory reserves to match the supercomputers of the last decade. Network server-class machines have much more.... | 0 | 0 | 0 | 0 | 2011-06-23T15:28:00.000 | 3 | 0.197375 | false | 6,456,627 | 0 | 0 | 1 | 3 | Which is more efficient in Django: to render an object using the template language? or to push the code to render the object via a templatetag function using the python language? |
django templates performance | 6,456,742 | 3 | 4 | 673 | 0 | python,django,performance,django-templates | The question is sort-of nonsensical. Templates are always going to be slower than a hand-tuned rendering solution, but template tags still need to run through the Template machinery, so you lose out any advantage there. If you want ultra-high efficiency, consider writing all of the HTML as an array of Python strings,... | 0 | 0 | 0 | 0 | 2011-06-23T15:28:00.000 | 3 | 0.197375 | false | 6,456,627 | 0 | 0 | 1 | 3 | Which is more efficient in Django: to render an object using the template language? or to push the code to render the object via a templatetag function using the python language? |
django templates performance | 6,456,673 | 1 | 4 | 673 | 0 | python,django,performance,django-templates | I'd say it's about the same; take the most clean way, and if you need speed, cache it. | 0 | 0 | 0 | 0 | 2011-06-23T15:28:00.000 | 3 | 0.066568 | false | 6,456,627 | 0 | 0 | 1 | 3 | Which is more efficient in Django: to render an object using the template language? or to push the code to render the object via a templatetag function using the python language? |
MVC Game Design with objects | 6,463,049 | 4 | 2 | 1,166 | 0 | python,model-view-controller,oop | MVC can be counter-intuitive sometimes, especially when you're first learning OO and discover that having a "draw" method makes things so organized!
Here's an overview of one of many ways you might implement MVC for your game:
Model:
"Box": box_type, pos_x, pos_y
"BoxManager": list(Box)
"GameState": box_manager, playe... | 1 | 0 | 0 | 0 | 2011-06-24T03:20:00.000 | 3 | 1.2 | true | 6,462,967 | 1 | 0 | 1 | 3 | I wrote a simple sokoban like 2D game in python that I want to clean up. It's done in a sort-of OO way where each object in the game has a Draw function I can call to redraw the screen. It works out nicely since I can loop through each position on the screen and call the object's draw function.
I am learning about de... |
MVC Game Design with objects | 11,327,596 | 0 | 2 | 1,166 | 0 | python,model-view-controller,oop | One aspect that I'll just quickly make explicit is that when your model changes, it can't call the view to say "render this change" - because the model shouldn't know about the view(s).
Instead the model raises an event to say it has changed, and the view re-renders as necessary on receiving these. The view(s) know abo... | 1 | 0 | 0 | 0 | 2011-06-24T03:20:00.000 | 3 | 0 | false | 6,462,967 | 1 | 0 | 1 | 3 | I wrote a simple sokoban like 2D game in python that I want to clean up. It's done in a sort-of OO way where each object in the game has a Draw function I can call to redraw the screen. It works out nicely since I can loop through each position on the screen and call the object's draw function.
I am learning about de... |
MVC Game Design with objects | 6,463,038 | 0 | 2 | 1,166 | 0 | python,model-view-controller,oop | Refactoring your code to conform to MVC would mean creating a "view" (like that represented your screen, and that view would have (for example) a draw method that took the "model" (a python object that contained all of the block states) and rendered that model to the screen.
Now perhaps all that draw method would do t... | 1 | 0 | 0 | 0 | 2011-06-24T03:20:00.000 | 3 | 0 | false | 6,462,967 | 1 | 0 | 1 | 3 | I wrote a simple sokoban like 2D game in python that I want to clean up. It's done in a sort-of OO way where each object in the game has a Draw function I can call to redraw the screen. It works out nicely since I can loop through each position on the screen and call the object's draw function.
I am learning about de... |
Handle server error python | 6,467,479 | 1 | 0 | 207 | 0 | python,api,error-handling | The easiest solution will be probably to try to validate the user input before you use it. A simple regular expression which checks the last parts of the domain the user has entered might be enough.
If you want to support arbitrary domains without a google\.[a-z]+ or appspot.com suffix you will need another way to figu... | 0 | 1 | 0 | 0 | 2011-06-24T10:54:00.000 | 2 | 0.099668 | false | 6,466,790 | 0 | 0 | 1 | 1 | I m workin on an api where the user enters a domain and i need to redirect to the login page of that domain.
So this works for only google domains and i need to handle the error created when user enters non google domain . I m workin on google app engine.
I m new to dis error handling.So kindly explain how it works alo... |
Application access its own version in mercurial repository | 6,471,560 | 5 | 3 | 91 | 0 | python,mercurial | The best approach is probably to use precommit hook to replace a designated file with the output of hg log -r tip, possibly with a --template arg to format it in a particular way.
Unfortunately, there's a bit of a chicken and egg problem. The revision is a checksum of the commited data, but the checksum is not availab... | 0 | 0 | 0 | 0 | 2011-06-24T17:20:00.000 | 3 | 0.321513 | false | 6,471,412 | 0 | 0 | 1 | 1 | I have application I want to print out (in "about" box) its revision/version from mercurial. Suppose it is revision deadbeef so it will know that. In old times in CVS could use something like $Revision$ to substitute automatically.
What is best practice with Mercurial for this? |
Avoiding "MySQL server has gone away" on infrequently used Python / Flask server with SQLAlchemy | 58,821,330 | 6 | 64 | 33,654 | 1 | python,mysql,sqlalchemy,flask,database-connection | The pessimistic approach as described by @wim
pool_pre_ping=True
can now be done for Flask-SQLAlchemy using a config var -->
SQLALCHEMY_POOL_PRE_PING = True | 0 | 0 | 0 | 0 | 2011-06-24T17:34:00.000 | 7 | 1 | false | 6,471,549 | 0 | 0 | 1 | 2 | How can Flask / SQLAlchemy be configured to create a new database connection if one is not present?
I have an infrequently visited Python / Flask server which uses SQLAlchemy. It gets visited every couple of days, and on the first visit it often throws a "MySQL server has gone away" error. Subsequent page views are fin... |
Avoiding "MySQL server has gone away" on infrequently used Python / Flask server with SQLAlchemy | 51,015,137 | 2 | 64 | 33,654 | 1 | python,mysql,sqlalchemy,flask,database-connection | When I encountered this error I was storing a LONGBLOB / LargeBinary image ~1MB in size. I had to adjust the max_allowed_packet config setting in MySQL.
I used mysqld --max-allowed-packet=16M | 0 | 0 | 0 | 0 | 2011-06-24T17:34:00.000 | 7 | 0.057081 | false | 6,471,549 | 0 | 0 | 1 | 2 | How can Flask / SQLAlchemy be configured to create a new database connection if one is not present?
I have an infrequently visited Python / Flask server which uses SQLAlchemy. It gets visited every couple of days, and on the first visit it often throws a "MySQL server has gone away" error. Subsequent page views are fin... |
Do Django-nonrel and Django-SocialAuth play together nicely? | 6,902,951 | 1 | 1 | 223 | 0 | python,django-nonrel,django-socialauth | They do, the only issue you'll run into if you are using a non-rel database is that the admin modules for Social_Auth will not work. They use joins. I was considering forking the project to see if I could make them work with non-rel, but I ran out of time.
What I've done is setup two separate databases. I'm storing my ... | 0 | 0 | 0 | 0 | 2011-06-24T21:19:00.000 | 1 | 1.2 | true | 6,473,879 | 0 | 0 | 1 | 1 | Anybody got Django-SocialAuth working with Django-nonrel?
Do they work together?
Please let me know if you have done it. Any gotchas to watch for? |
Django - use generic views or not? | 6,485,173 | 3 | 7 | 3,542 | 0 | python,django,django-generic-views | Whether to use generic views or not is your prerogative. It won't cause you any trouble, although you might find yourself coding repetitious view logic. You might consider using wrapped/subclassed generic views in your views.py (frequently you'll want to customize them anyways), which would keep the boilerplate out of ... | 0 | 0 | 0 | 0 | 2011-06-26T15:55:00.000 | 3 | 0.197375 | false | 6,485,005 | 0 | 0 | 1 | 2 | I was going through quick poll tutorial on the Django site, and the last topic is introduction of generic views. A convenient way to bypass the need of creation of custom views for every URL pattern.
This is the main idea as far as I understand:
1) Request -> URL patterns -> View -> Template
or
2) Request -> URL patter... |
Django - use generic views or not? | 6,485,415 | 10 | 7 | 3,542 | 0 | python,django,django-generic-views | The intention of Generic Views is to reduce boilerplate code when you repeatedly use similar code in several views. You should really use it just for that. Basically, just because django allows something you are doing generically you shouldn't do it, particularly not when your code becomes not to your like.
If you are ... | 0 | 0 | 0 | 0 | 2011-06-26T15:55:00.000 | 3 | 1.2 | true | 6,485,005 | 0 | 0 | 1 | 2 | I was going through quick poll tutorial on the Django site, and the last topic is introduction of generic views. A convenient way to bypass the need of creation of custom views for every URL pattern.
This is the main idea as far as I understand:
1) Request -> URL patterns -> View -> Template
or
2) Request -> URL patter... |
python reverse proxy spawning via cgi | 6,531,642 | 2 | 1 | 488 | 0 | python | You don't need to spawn another process, that would complicate things a lot. Here's how I would do it based on something similar in my current project :
Create a WSGI application, which can live behind a web server.
Create a request handler (or "view") that is accessible from any URL mapping as long as the user doesn... | 0 | 1 | 0 | 1 | 2011-06-27T05:10:00.000 | 1 | 0.379949 | false | 6,488,806 | 0 | 0 | 1 | 1 | I need to write a cgi page which will act like a reverse proxy between the user and another page (mbean). The issue is that each mbean uses different port and I do not know ahead of time which port user will want to hit.
Therefore want I need to do is following:
A) Give user a page which will allow him to choose which... |
What python based ajax push servers are good to work with | 6,529,595 | 0 | 3 | 1,481 | 0 | python,real-time,comet,ajax-push | I think the most popular is tornado open-sourced by facebook. It also has pretty decent documentation. | 0 | 0 | 0 | 0 | 2011-06-27T13:17:00.000 | 3 | 0 | false | 6,493,444 | 0 | 0 | 1 | 2 | I have a web application im currently working on in python. I'm using Django as my web framework currently. I intend to integrate real-time web features into the application using ajax push. However, I'm a bit confused as to what python based push server i should adopt. I've heard of a few of them, Orbited, Gevent, Tor... |
What python based ajax push servers are good to work with | 6,494,673 | 0 | 3 | 1,481 | 0 | python,real-time,comet,ajax-push | APE seems a cool thing.
I think it's not a problem to make it work with PDjango as a backend. | 0 | 0 | 0 | 0 | 2011-06-27T13:17:00.000 | 3 | 0 | false | 6,493,444 | 0 | 0 | 1 | 2 | I have a web application im currently working on in python. I'm using Django as my web framework currently. I intend to integrate real-time web features into the application using ajax push. However, I'm a bit confused as to what python based push server i should adopt. I've heard of a few of them, Orbited, Gevent, Tor... |
Parsing HTML with Python 2.7 - HTMLParser, SGMLParser, or Beautiful Soup? | 6,494,288 | -4 | 16 | 6,435 | 0 | python,html,parsing,beautifulsoup,html-parsing | Well, software is like cars....different flavors about all do drive!
Go with BeautifulSoup (4). | 0 | 0 | 1 | 0 | 2011-06-27T14:11:00.000 | 4 | -1 | false | 6,494,199 | 0 | 0 | 1 | 2 | I want to do some screen-scraping with Python 2.7, and I have no context for the differences between HTMLParser, SGMLParser, or Beautiful Soup.
Are these all trying to solve the same problem, or do they exist for different reasons? Which is simplest, which is most robust, and which (if any) is the default choice?
Als... |
Parsing HTML with Python 2.7 - HTMLParser, SGMLParser, or Beautiful Soup? | 6,494,502 | 6 | 16 | 6,435 | 0 | python,html,parsing,beautifulsoup,html-parsing | BeautifulSoup in particular is for dirty HTML as found in the wild. It will parse any old thing, but is slow.
A very popular choice these days is lxml.html, which is fast, and can use BeautifulSoup if needed. | 0 | 0 | 1 | 0 | 2011-06-27T14:11:00.000 | 4 | 1 | false | 6,494,199 | 0 | 0 | 1 | 2 | I want to do some screen-scraping with Python 2.7, and I have no context for the differences between HTMLParser, SGMLParser, or Beautiful Soup.
Are these all trying to solve the same problem, or do they exist for different reasons? Which is simplest, which is most robust, and which (if any) is the default choice?
Als... |
Python: PyCurl set URL exception | 6,495,548 | 9 | 1 | 5,514 | 0 | python,curl,pycurl | The problem is that it accepts strings, not unicode objects. Remove the u and unicode(). | 0 | 0 | 0 | 0 | 2011-06-27T15:16:00.000 | 2 | 1.2 | true | 6,495,077 | 0 | 0 | 1 | 1 | I try to set the url using this code c.setopt(pycurl.URL, link), but I get the following exception
File "/home/sultan/Repository/Django/monitor/app/thread/utils.py", line 164, in perform
self.proxy_request.setopt(pycurl.URL, u'%s' % unicode(link))
TypeError: invalid arguments to setopt
What is wrong with my cod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.