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
Eclipse error: "javaw.exe not found"
12,868,194
0
0
556
0
eclipse,python-2.7
Have you installed java runtime? If not, you need to install it first. If you have it already, you might need to adjust your path.
0
0
0
0
2012-10-12T22:48:00.000
2
1.2
true
12,868,135
0
0
1
1
I installed Python 2.7 recently and with it Django--as part of the installation I had to add a PATH environment variable with the path to my Python installation. After I did that, when I launch Eclipse, I get an error saying "javaw.exe" was not found. I need both Python and Eclipse on my machine, is there something I ...
Place Python Output in HTML Widget
12,869,309
1
0
221
0
python,html,rss,widget,feedparser
One of several options: i'm thinking this might be quickest/easiest... Upload the python script to the server. Have it create/update a publicly readable file under the webroot. Write some javascript to load that page into your html page. If you want to get fancy schedule the script to run periodically via cron.
0
0
0
0
2012-10-13T01:10:00.000
2
1.2
true
12,869,051
0
0
1
2
This seems like a very simple question, so I will remove if it's a repeat. I just can't seem to find the answer. I'm using the feedparser module to parse an RSS feed. I want to post the output to a widget on a site. I don't want the python script to write the whole page. I just want to be able to get the output to the ...
Place Python Output in HTML Widget
12,869,418
1
0
221
0
python,html,rss,widget,feedparser
I'll paste my comment into the answer here as well. There are a lot of ways to go about it, but I'll focus on the design decision question first. To make things simple, create two pages. First page for displaying the generated info without the generated info, just the styling and all other icing on the cake. Include a...
0
0
0
0
2012-10-13T01:10:00.000
2
0.099668
false
12,869,051
0
0
1
2
This seems like a very simple question, so I will remove if it's a repeat. I just can't seem to find the answer. I'm using the feedparser module to parse an RSS feed. I want to post the output to a widget on a site. I don't want the python script to write the whole page. I just want to be able to get the output to the ...
Mod_Python: Publisher Handler vs PSP Handler
12,876,548
3
0
274
0
python,mod-python
I am not familiar with the mod_python (project was abandoned long ago) but nowadays Python applications are using wsgi (mod_wsgi or uwsgi). If you are using apache, mod_wsgi is easy to configure, for nginx use the uwsgi.
0
0
0
1
2012-10-13T19:19:00.000
1
1.2
true
12,876,159
0
0
1
1
I've been testing out Mod_python and it seems that there are two ways of producing python code using:- Publisher Handler PSP Handler I've gotten both to work at the same time however, should I use one over the other? PSP resembles PHP a lot but Publisher seems to resemble python more. Is there an advantage over using...
How can a python web app open a program on the client machine?
12,877,893
1
1
351
0
python,linux,web
Note this is not a standard way. Imagine the websites out there had the ability to open Notepad or Minesweeper at their will when you visit or click something. The way it is done is, you need to have a service which is running on the client machine which can expose certain apis and trust the request from the web apps c...
0
1
0
0
2012-10-13T23:18:00.000
3
0.066568
false
12,877,870
0
0
1
1
I'm going to be using python to build a web-based asset management system to manage the production of short cg film. The app will be intranet-based running on a centos machine on the local network. I'm hoping you'll be able to browse through all the assets and shots and then open any of them in the appropriate program ...
Check size of HTTP POST without saving to disk
12,879,591
2
1
134
0
python,pyramid
You should be able to check the request.content_length. WSGI does not support streaming the request body so content length must be specified. If you ever access request.body, request.params or request.POST it will read the content and save it to disk. The best way to handle this, however, is as close to the client as p...
0
0
0
1
2012-10-14T02:30:00.000
1
1.2
true
12,878,819
0
0
1
1
Is there a way to check the size of the incoming POST in Pyramid, without saving the file to disk and using the os module?
Youtube GData 2 thousand most viewed
12,892,498
1
0
164
0
python,youtube,gdata
YouTube will not provide this to you. They intentionally rate limit their feeds to prevent abuse.
0
0
1
0
2012-10-14T06:11:00.000
1
0.197375
false
12,879,754
0
0
1
1
I want to catch the 1 thousand most viewed youtube videos through gdata youtube api. However, only the first 84 are being returned. If I use the following query, only 34 records are returned (plus the first 50). Anyone knows what is wrong? "http://gdata.youtube.com/feeds/api/standardfeeds/most_popular?start-index=1" re...
Accessing Google Groups Services on Google Apps Script in Google App Engine?
12,881,937
2
1
221
0
python,google-app-engine,google-apps-script
No you can't. AS and GAE are totally different things and won't work together. What you can really do is (abstract): write an AS that does what you need redirect from GAE to the AS url to make sure that the user logs-in/grants permissions. perform what you needed to do with AS send back the user to GAE with a bunch of...
0
1
0
0
2012-10-14T11:35:00.000
2
1.2
true
12,881,834
0
0
1
1
I'm trying to work out if it is possible to use Google Apps Scripts inside Google App Engine? And if there is a tutorial in doing this out there ? Through reading Google's App Script site I get the feeling that you can only use app scripts inside Google Apps like Drive, Docs etc? What I would like to do is to be able...
More Efficient Way to Prevent Duplicate Voting
12,889,623
0
0
193
0
python,google-app-engine,google-cloud-datastore,security,voting
Have you tried set() variable type which avoid duplicate?
0
0
0
0
2012-10-15T04:53:00.000
3
0
false
12,889,477
0
0
1
2
There are a few questions similar to this already but I am hoping for a somewhat different answer. I have a website on Google App Engine in Python and I let registered users vote on posts, either up or down, and I only want each user to be able to vote once. The primary method that I have thought of and read about is t...
More Efficient Way to Prevent Duplicate Voting
12,895,187
0
0
193
0
python,google-app-engine,google-cloud-datastore,security,voting
If you only have hundreds of votes for hundreds of posts this is not a big data hog or read/write hog. I am assuming you are storing the list of users as a list in the post enity on the data store. Depending on if you are storing a long that points to the user or a string for their email you are probably at most usin...
0
0
0
0
2012-10-15T04:53:00.000
3
0
false
12,889,477
0
0
1
2
There are a few questions similar to this already but I am hoping for a somewhat different answer. I have a website on Google App Engine in Python and I let registered users vote on posts, either up or down, and I only want each user to be able to vote once. The primary method that I have thought of and read about is t...
Using Java RMI to invoke Python method
12,890,526
1
0
2,053
0
java,python,rmi,rpc,web2py
I'd be astonished if you could do it at all. Java RMI requires Java peers.
0
0
1
1
2012-10-15T06:06:00.000
4
0.049958
false
12,890,137
0
0
1
1
I have a remote method created via Python web2py. How do I test and invoke the method from Java? I was able to test if the method implements @service.xmlrpc but how do i test if the method implements @service.run?
Going from Ruby to Python : Crawlers
12,891,191
3
2
5,706
0
python,ruby,web-crawler
Between lxml and beautiful soup, lxml is more equivalent to nokogiri because it is based on libxml2 and it has xpath/css support. The equivalent of net/http is urllib2
0
0
1
0
2012-10-15T07:18:00.000
4
0.148885
false
12,890,897
0
0
1
1
I've started to learn python the past couple of days. I want to know the equivalent way of writing crawlers in python. so In ruby I use: nokogiri for crawling html and getting content through css tags Net::HTTP and Net::HTTP::Get.new(uri.request_uri).body for getting JSON data from a url what are equivalents of these...
Redirecting PyUnit output to file in Eclipse
12,945,643
2
2
823
0
eclipse,pydev,python-unittest
Output can be easily redirected to a file in Run Configurations > Common tab > Standard Input and Output section. Hiding just in plain sight...
0
0
0
1
2012-10-15T14:35:00.000
1
1.2
true
12,897,908
0
0
1
1
Is there a built-in way in Eclipse to redirect PyUnit's output to a file (~ save the report)?
How can I run a celery periodic task from the shell manually?
12,900,160
8
89
60,194
0
python,django,celery,django-celery,celery-task
I think you'll need to open two shells: one for executing tasks from the Python/Django shell, and one for running celery worker (python manage.py celery worker). And as the previous answer said, you can run tasks using apply() or apply_async() I've edited the answer so you're not using a deprecated command.
0
1
0
1
2012-10-15T16:34:00.000
3
1
false
12,900,023
0
0
1
1
I'm using celery and django-celery. I have defined a periodic task that I'd like to test. Is it possible to run the periodic task from the shell manually so that I view the console output?
Search files(key) in s3 bucket takes longer time
12,907,767
3
2
5,534
1
python,amazon-s3,boto
There are two ways to implement the search... Case 1. As suggested by john - you can specify the prefix of the s3 key file in your list method. that will return you result of S3 key files which starts with the given prefix. Case 2. If you want to search the S3 key which are end with specific suffix or we can say extens...
0
0
1
0
2012-10-15T21:29:00.000
2
0.291313
false
12,904,326
0
0
1
1
I have 10000 files in a s3 bucket.When I list all the files it takes 10 minutes. I want to implement a search module using BOTO (Python interface to AWS) which searches files based on user input. Is there a way I can search specific files with less time?
Google App Engine Search API Performing Location Based Searches
13,315,721
1
2
498
0
python,google-app-engine,geolocation,geocoding,gae-search
I don't know of any examples that show geo specifically, but the process is very much the same. You can index documents containing GeoFields, each of which has a latitude and a longitude. Then, when you construct your query, you can: limit the results by distance from a fixed point by using a query like distance(my_ge...
0
0
0
0
2012-10-15T21:36:00.000
1
0.197375
false
12,904,413
0
0
1
1
I have been going through trying to find the best option on Google App Engine to search a Model by GPS coordinates. There seem to be a few decent options out there such as GeoModel (which is out of date) but the new Search API seems to be the most current and gives a good bit of functionality. This of course comes at...
Safely storing encrypted credentials in django
12,904,783
-2
12
6,457
0
python,django,security,encryption,credentials
Maybe you can rely on a multi-user scheme, by creating : A user running Django (e.g. django) who does not have the permission to access the credentials A user having those permissions (e.g. sync). Both of them can be in the django group, to allow them to access the app. After that, make a script (a Django command, su...
0
0
0
0
2012-10-15T21:49:00.000
3
-0.132549
false
12,904,560
0
0
1
1
I'm working on a python/django app which, among other things, syncs data to a variety of other services, including samba shares, ssh(scp) servers, Google apps, and others. As such, it needs to store the credentials to access these services. Storing them as unencrypted fields would be, I presume, a Bad Idea, as an SQL i...
GAE: Instance shutdown from source code
12,921,291
1
0
144
0
python,google-app-engine
If can disable an entire application (from Application Settings page) for sometime and then reenable it (or you can delete it from that point onwards). There is no way you can "shutdown" a particular instance. You can have different version of your application, but at any moment in time, you can only have only one inst...
0
1
0
0
2012-10-16T18:28:00.000
2
1.2
true
12,921,120
0
0
1
2
In user interface of Google App Engine, in "Instances" I can shutdown selected instances by press button "Shutdown". Can I do shutdown by program from source code?
GAE: Instance shutdown from source code
12,944,920
0
0
144
0
python,google-app-engine
Actually you can force an instance to shutdown within your code, but it's not pretty. Just allocate more memory than you instance has, it will be then shutdown for you. I have used this technique in some python2.5 M/S apps where a DeadlineExceeded during startup could cause problems with incomplete imports. If the nex...
0
1
0
0
2012-10-16T18:28:00.000
2
0
false
12,921,120
0
0
1
2
In user interface of Google App Engine, in "Instances" I can shutdown selected instances by press button "Shutdown". Can I do shutdown by program from source code?
Timezone for server
12,923,424
1
0
115
0
python,django,timezone
generally, the server is setup to run as UTC, which has no daylight saving time, etc, and each user's settings contains their preferred timezone. Then you do the time difference calculation. You DB might have that feature.
0
0
0
0
2012-10-16T21:04:00.000
2
1.2
true
12,923,402
0
0
1
1
I am building a application where the clients are supposed to pass a datetime field to query the database. But the client will be in different timezones, so how to solve that problem. Should I make it a point that the client's timezone is used as deafult for each user or the server for every user. And if so than how c...
Sphinx code validation for Django projects
14,034,222
1
1
148
0
django,testing,python-sphinx
Turned out that I had some python paths wrong. Everything works as expected - as noted by bmu in his comment. (I'm writing this answer so I can close the question in a normal way)
0
0
0
0
2012-10-17T09:35:00.000
1
1.2
true
12,931,338
0
0
1
1
I have a Django project with a couple of apps - all of them with 100% coverage unit tests. And now I started documenting the whole thing in a new directory using ReST and Sphinx. I create the html files using the normal approach: make html. Since there are a couple of code snippets in these ReST files, I want to make s...
Git, Django and pluggable applications
12,944,156
4
0
154
0
python,django,git
The way I work: Each website has it's own git repo and each app has it's own repo. Each website also has it's own virtualenv and requirements.txt. Even though 2 websites may share the most recent version of MyApp right now, they may not in the future (maybe you haven't gotten one of the websites up to date on some API ...
0
0
0
0
2012-10-17T21:40:00.000
1
1.2
true
12,943,846
0
0
1
1
I'm currently developing several websites on Django, which requiere several Django Apps. Lets say I have two Django projects: web1 and web2 (the websites, each has a git repo). Both web1 and web2 have a different list of installed apps, but happen to both use one (or more) application(s) developed by me, say "MyApp" (a...
Close TCP port 80 and 443 after forking in Django
12,947,246
2
5
256
0
python,django,linux,apache2
If you use the subprocess module to execute the script, the close_fds argument to the Popen constructor will probably do what you want: If close_fds is true, all file descriptors except 0, 1 and 2 will be closed before the child process is executed. Assuming they weren't simply closed, the first three file descriptor...
0
1
0
0
2012-10-18T03:38:00.000
1
1.2
true
12,946,708
0
0
1
1
I am trying to fork() and exec() a new python script process from within a Django app that is running in apache2/WSGI Python. The new python process is daemonized so that it doesn't hold any association to apache2, but I know the HTTP ports are still open. The new process kills apache2, but as a result the new python...
Regex routing in Python using Tornado framework
12,950,281
0
1
1,761
0
python,regex,routing,tornado
What about this: r'/admin/?' or r'/admin/{0,1}? Pay attention that I'm only talking about regex, don't know if this would work in Django.
0
0
0
0
2012-10-18T07:48:00.000
2
1.2
true
12,949,634
1
0
1
1
i currently have this in my routing: (r"/admin", AdminController.Index ), (r"/admin/", AdminController.Index ), how do i merge them with just one line and have admin and admin/ go to AdminController.Index? i know this could be achieved via regex, but it doesnt seem to work
Why does SimpleHTTPServer redirect to ?querystring/ when I request ?querystring?
25,786,569
5
13
6,427
0
python,simplehttpserver,webdev.webserver
The right way to do this, to ensure that the query parameters remain as they should, is to make sure you do a request to the filename directly instead of letting SimpleHTTPServer redirect to your index.html For example http://localhost:8000/?param1=1 does a redirect (301) and changes the url to http://localhost:8000/?p...
0
0
1
0
2012-10-18T11:26:00.000
3
0.321513
false
12,953,542
0
0
1
1
I like to use Python's SimpleHTTPServer for local development of all kinds of web applications which require loading resources via Ajax calls etc. When I use query strings in my URLs, the server always redirects to the same URL with a slash appended. For example /folder/?id=1 redirects to /folder/?id=1/ using a HTTP 30...
Merge (append) GAE datastores from different apps
12,958,199
0
1
52
0
python,google-app-engine,google-cloud-datastore
You can use UrlFetch in App2 to request all the data you need from App1 and proces it to create your merged result. It is quite easy to serve and serialize the entities (with a cursor) using JSON for the data exchange in App1.
0
1
0
0
2012-10-18T14:06:00.000
2
0
false
12,956,582
0
0
1
1
I have 2 different apps that are basically identical but I had to setup a 2nd app because of GAE billing issues. I want to merge the datastore data from the 1st app with the 2nd apps data store. By merge, I simply want to append the 2 data stores. To help w/visualise App1: SomeModel AnotherModel App2: SomeModel Ano...
How do I make Django admin URLs accessible to localhost only?
12,960,567
2
3
2,696
0
python,django,apache,wsgi,django-wsgi
I'd go for the Apache configuration + run a proxy in front + restrict in WSGI : I dislike Apache for communicating with web clients when dynamic content generation is involved. Because of it's execution model, a slow or disconnected client can tie up the Apache process. If you have a proxy in front ( i prefer nginx,...
0
0
0
0
2012-10-18T17:19:00.000
2
0.197375
false
12,960,212
0
0
1
1
What is the simplest way to make Django /admin/ urls accessible to localhost only? Options I have thought of: Seperate the admin site out of the project (somehow) and run as a different virtual host (in Apache2) Use a proxy in front of the hosting (Apache2) web server Restrict the URL in Apache within WSGI somehow. I...
Session variables on Ruby when called through a Python web service
12,966,697
2
1
95
0
python,ruby,session-state,web.py
Usually a session cookie is used to keep track of the session between client (in your case your Python web.py part) and server (in this case the Ruby server). Make sure you save the the session cookie when in your Python part when making the first request to the Ruby service. When making a second request simple send th...
0
0
0
0
2012-10-19T02:34:00.000
1
0.379949
false
12,966,573
0
0
1
1
I have an app running on python web.py. For a couple of data items, I contact a ruby service. I was wondering if I could, in some way, keep track of the session in ruby as well. Every time the python calls the ruby service, it treats it as a different session. Any help? Thanks! PS - This might not be trivial and I migh...
Efficient way to do large IN query in Google App Engine?
12,980,347
0
3
176
1
python,google-app-engine
I misunderstood part of your problem, I thought you were issuing a query that was giving you 250 entities. I see what the problem is now, you're issuing an IN query with a list of 250 phone numbers, behind the scenes, the datastore is actually doing 250 individual queries, which is why you're getting 250 read ops. I ca...
0
1
0
0
2012-10-19T14:43:00.000
3
0
false
12,976,652
0
0
1
1
A user accesses his contacts on his mobile device. I want to send back to the server all the phone numbers (say 250), and then query for any User entities that have matching phone numbers. A user has a phone field which is indexed. So I do User.query(User.phone.IN(phone_list)), but I just looked at AppStats, and is th...
Modify a Google App Engine entity id?
13,069,255
3
2
1,404
0
python,google-app-engine
The entity ID forms part of the primary key for the entity, so there's no way to change it. Changing it is identical to creating a new entity with the new key and deleting the old one - which is one thing you can do, if you want. A better solution would be to create a PhoneNumber kind that provides a reference to the a...
0
1
0
0
2012-10-19T15:05:00.000
1
1.2
true
12,977,110
0
0
1
1
I'm using Google App Engine NDB. Sometimes I will want to get all users with a phone number in a specified list. Using queries is extremely expensive for this, so I thought I'll just make the id value of the User entity the phone number of the user so I can fetch directly by ids. The problem is that the phone number fi...
Extending ArcGIS
32,124,775
0
0
727
0
java,python,visual-studio-2010,arcgis,arcobjects
Creating a Python AddIn is probably the quickest and easiest approach if you just want to do some geoprocessing and deploy the tool to lots of users. But as soon as you need a user interface (that does more than simply select GIS data sources) you should create a .Net AddIn (using either C# or VB.net). I've created man...
0
0
0
1
2012-10-20T17:52:00.000
3
0
false
12,991,111
0
0
1
1
I've been tasked with a thesis project where i have to extend the features of ArcGis. I've been asked to create a model written in Python that can run out of ArcGIS 10. This model will have a simple user interface where the user can drag/drop a variety of shapefiles and enter the values for particular variables in orde...
Boto's DynamoDB API returns wrong value when using item_count
13,003,481
5
3
592
0
python,amazon-web-services,boto,amazon-dynamodb
The item_count value is only updated every six hours or so. So, I think boto is returning you the value as it is returned by the service but that value is probably not up to date.
0
0
1
0
2012-10-21T15:33:00.000
1
1.2
true
12,999,262
0
0
1
1
I'm using the python framework Boto to interact with AWS DynamoDB. But when I use "item_count" it returns the wrong value. What's the best way to retrieve the number of items in a table? I know it would be possible using the Scan operation, but this is very expensive on resources and can take a long time if the table i...
What is a good cms that is postgres compatible, open source and either php or python based?
13,003,890
1
5
5,703
1
postgresql,content-management-system,python-2.7
Have you tried Drupal. Drupal supports PostgreSQL and is written in PHP and is open source.
0
0
0
0
2012-10-21T16:56:00.000
2
0.099668
false
13,000,007
0
0
1
1
Php or python Use and connect to our existing postgres databases open source / or very low license fees Common features of cms, with admin tools to help manage / moderate community have a large member base on very basic site where members provide us contact info and info about their professional characteristics. About...
Python: sending and receiving large files over POST using cherrypy
26,299,500
0
3
4,776
0
python,http,post,upload,cherrypy
Huge file uploads always problematic. What would you do when connection closes in the middle of uploading? Use chunked file upload method instead.
0
0
1
0
2012-10-21T22:07:00.000
2
0
false
13,002,676
0
0
1
1
I have a cherrypy web server that needs to be able to receive large files over http post. I have something working at the moment, but it fails once the files being sent gets too big (around 200mb). I'm using curl to send test post requests, and when I try to send a file that's too big, curl spits out "The entity sent w...
How can I defer the execution of Celery tasks?
36,787,909
2
18
25,567
0
python,django,celery,django-celery
I think you are trying to avoid race condition of your own scripts, not asking for a method to delay a task run. Then you can create a task, and in that task, call each of your task with .apply(), not .apply_async() or .delay(). So that these tasks run sequentially
0
1
0
0
2012-10-22T06:42:00.000
3
0.132549
false
13,006,151
0
0
1
1
I have a small script that enqueues tasks for processing. This script makes a whole lot of database queries to get the items that should be enqueued. The issue I'm facing is that the celery workers begin picking up the tasks as soon as it is enqueued by the script. This is correct and it is the way celery is supposed t...
Is sleep() blocking the handling of requests in Django?
13,017,620
2
5
1,668
0
python,django
I would image that calling sleep() should block the execution of all Django code in most cases. However it might depend on the deployment architecture (e.g. gevent, gunicorn, etc). For instance if you are using a server which fires Django threads for each request, then no it will not block all the code. In most cases h...
0
0
0
0
2012-10-22T18:24:00.000
1
0.379949
false
13,017,421
0
0
1
1
In Django, if the view uses a sleep() function while answering a request, does this block the handling of the whole queue of requests? If so, how to delay an http answer without this blocking behavior? Can we do that out-of-the-box and avoid using a job queue like Celeri?
AuthAlreadyAssociated Exception in Django Social Auth
13,032,929
16
18
9,224
0
python,django,django-socialauth
DSA doesn't logout accounts (or flush sessions) at the moment. AuthAlreadyAssociated highlights the scenario where the current user is not associated to the current social account trying to be used. There are a couple solutions that might suite your project: Define a sub-class of social_auth.middleware.SocialAuthExcep...
0
0
0
0
2012-10-22T19:12:00.000
5
1.2
true
13,018,147
0
0
1
1
After I create a user using say Facebook(let's say fbuser) or Google(googleuser). If I create another user through the normal django admin(normaluser), and try logging again using Facebook or Google while third user(normaluser) is logged in, it throws an error exception AuthAlreadyAssociated. Ideally it should throw ...
Using IronPython at a hosting company
13,024,373
0
0
136
0
ironpython,web-hosting,shared-hosting
IronPython should work in shared hosting environments. I'm assuming they have some sort of partial-trust setup and not a full-trust environment; if it's full-trust, there's no issues. If not, it should still work, but it hasn't been as heavily tested. You have to deploy it with your project (in the bin directory), but ...
0
0
0
0
2012-10-22T23:20:00.000
1
0
false
13,021,375
0
0
1
1
Does anyone have experience running IronPython in a shared hosting environment? Am using one hosting company but they don't support it. It's a project mixing ASP.NET MVC 4 with IronPython. I would do a VM somewhere if all else fails, but figured I give this a shot to save a few bucks. #lazystackoverflow Thanks, -rob
Can i use apache mahout with django application
13,696,473
1
1
326
0
python,django,apache,mahout
I think you could build an independent application with mahout, and you python application is just a client.
0
0
0
0
2012-10-23T03:21:00.000
1
0.197375
false
13,023,103
0
0
1
1
I am building the web application in python/django. I need to apply some machine learning algorithms on some data. I know there are libraries available for python. But someone in my company was saying that Mahout is very good toll for that. i want to know that can i use it with python/django. or i should do that with p...
Django-Nonrel(mongo-backend):Model instance modification tracking
13,031,452
0
0
132
1
python,django,mongodb,django-models,django-nonrel
After some deep digging into the Django Models i was able to solve the problem. The save() method inturn call the save_base() method. This method saves the returned results, ids in case of mongo, into self.id. This _id field can then be picked by by over riding the save() method for the model
0
0
0
0
2012-10-23T06:01:00.000
1
1.2
true
13,024,361
0
0
1
1
I am using Django non-rel version with mongodb backends. I am interested in tracking the changes that occur on model instances e.g if someone creates/edits or deletes a model instance. Backend db is mongo hence models have an associated "_id" fields with them in the respective collections/dbs. Now i want to extract thi...
Overriding a Java class from Python using JCC. Is that possible?
13,026,184
0
0
148
0
java,python,pylucene,jcc
you could create a proxy class in Python that calls the Java class. Then on the proxy class you can override whatever you need.
0
0
0
0
2012-10-23T07:56:00.000
1
0
false
13,025,856
1
0
1
1
I'm using JCC to create a Python wrapper for a Java library and I need to override a method from a Java class inside the Python script. Is it possible? How can you do that if it is possible?
Django running under python 2.7 on AWS Elastic Beanstalk
14,729,865
1
6
1,731
0
django,python-2.7,mod-wsgi,amazon-elastic-beanstalk
To get around mod_wsgi limitation, you can deploy your application under your own wsgi container like uWSGI and add configuration to apache to serve as a reverse proxy for your WSGI container. You can use container_commands to place your apache configuration files under /etc/httpd/...
0
0
0
0
2012-10-23T09:53:00.000
4
0.049958
false
13,027,848
0
0
1
1
According to the docs, AWS Elastic Beanstalk supports Python 2.6. I wonder if anyone has set up a custom AMI using the EBS backed 64 bit Linux AMI to run django under Python 2.7 on the beanstalk? While most aspects of a set up under 2.7 will probably be straightforward using virtualenv or changing the symlinks, I'm wor...
django add relationships to user model
13,034,305
0
3
7,527
0
python,django,django-models
Add a ManytoMany relationship in your article to the User model. Everytime a user likes one article add him into it. Length of that field will be the number of like in that article.
0
0
0
0
2012-10-23T15:28:00.000
4
0
false
13,033,979
0
0
1
1
I have a django project using the built in user model. I need to add relationships to the user. For now a "like" relationship for articles the user likes and a "following" relationship for other users followed. What's the best way to define these relationships? The django doc recommends creating a Profile model with a ...
Scraping news sites with Python
13,040,391
2
2
570
0
python,json,reddit
Would it make sense to keep the Python scraper application running on it's own server, which then writes the scraped URL's to the database? Yes, that is a good idea. I would set up a cron job to run the program every so often. Depending on the load you're expecting, it doesn't necessarily need to be on its own serve...
0
0
1
0
2012-10-23T22:04:00.000
1
1.2
true
13,040,048
0
0
1
1
I'm extremely new to Python, read about half a beginner book for Python3. I figure doing this will get me going and learning with something I actually want to do instead of going through some "boring" exercises. I'm wanting to build an application that will scrape Reddit for the top URL's and then post these onto my ow...
Webapp2 + WTForms issue: How to pass values and errors back to user?
13,051,668
1
1
348
0
python,google-app-engine,webapp2,wtforms
I think this will work if the routes are part of the same app. But why not using a single handler with get and put and a method _create, which can be called (self._create instead of a redirect) by get and put to render the template with the form. It is faster than a browser redirect and you can pass arguments in an eas...
0
0
0
0
2012-10-24T12:45:00.000
1
1.2
true
13,049,515
0
0
1
1
I am having a problem with webapp2 and wtforms. More specifically I have defined two methods in two different handlers, called: create, which is a GET method listening to a specific route save, which is a POST method listening to another route In the save method I validate my form and if fails, I want to redirect to ...
script to open web browser and enter data
13,073,177
1
1
1,062
0
python
There are a number of tools out there for this purpose. For example, Selenium, which even has a package on PyPI with Python bindings for it, will do the job.
0
0
1
0
2012-10-25T16:31:00.000
2
1.2
true
13,073,147
0
0
1
1
I am not sure if this is possible, but I was wondering if it would be possible to write a script or program that would automatically open up my web browser, go to a certain site, fill out information, and click "send"? And if so, where would I even begin? Here's a more detailed overview of what I need: Open browser Go...
South initial migrations are not forced to have a default value?
13,085,822
1
0
107
1
python,django,postgresql,django-south
If you add a column to a table, which already has some rows populated, then either: the column is nullable, and the existing rows simply get a null value for the column the column is not nullable but has a default value, and the existing rows are updated to have that default value for the column To produce a non-null...
0
0
0
0
2012-10-26T11:00:00.000
2
1.2
true
13,085,658
0
0
1
2
I see that when you add a column and want to create a schemamigration, the field has to have either null=True or default=something. What I don't get is that many of the fields that I've written in my models initially (say, before initial schemamigration --init or from a converted_to_south app, I did both) were not run ...
South initial migrations are not forced to have a default value?
13,085,826
0
0
107
1
python,django,postgresql,django-south
When you have existing records in your database and you add a column to one of your tables, you will have to tell the database what to put in there, south can't read your mind :-) So unless you mark the new field null=True or opt in a default value it will raise an error. If you had an empty database, there are no valu...
0
0
0
0
2012-10-26T11:00:00.000
2
0
false
13,085,658
0
0
1
2
I see that when you add a column and want to create a schemamigration, the field has to have either null=True or default=something. What I don't get is that many of the fields that I've written in my models initially (say, before initial schemamigration --init or from a converted_to_south app, I did both) were not run ...
A Django library for Gmail
13,087,381
0
3
1,086
0
python,django,gmail,gmail-imap
I would suggest you to look at context.io, I've used it before and it works great.
0
0
0
1
2012-10-26T11:18:00.000
2
0
false
13,085,946
0
0
1
1
I'm looking for an API or library that gives me access to all features of Gmail from a Django web application. I know I can receive and send email using IMAP or POP3. However, what I'm looking for are all the GMail features such as marking emails with star or important marker, adding or removing tags, etc. I know there...
zipped packages and in memory storage strategies
13,126,025
1
1
57
0
google-app-engine,memory-management,python-2.7,multi-tenant
i agree with nick. there should be no python code in the tenant specific zip. to solve the memory issue i would cache most of the pages in the datastore. to serve them you don't need to have all tenants loaded in your instances. you might also wanna look in pre generating html views on save rather then on request.
0
0
0
0
2012-10-26T16:06:00.000
1
0.197375
false
13,090,476
1
0
1
1
i have a multitenant app with a zipped package for each tenant/client which contains the templates and handlers for the public site for each of them. right now i have under 50 tenants and its fine to keep the imported apps in memory after the first request to that specific clients domain. this approach works well but i...
ManyToMany in Django admin: select none
13,090,557
11
3
2,338
0
python,django,django-admin
This sounds like a browser issue rather than a Django issue. To unselect an element in a multiple select, press the Ctrl key (linux / windows) or the Command key (mac) when you click on it.
0
0
0
0
2012-10-26T16:06:00.000
1
1.2
true
13,090,479
0
0
1
1
Having A = ManyToManyField(B, null=True, blank=True), when I go in A's admin page, it seems I can't unselect every entries in the ManyToMany box after having clicked on a B element. And even if I don't click on any entry, there is a related B element selected after saving (the first B element I guess). But I want to ad...
Django get client's domain name/host name
38,819,664
2
2
10,741
0
python,django,gethostbyaddr
You can just print HttpRequest.META and find what you want and I think req.META['HTTP_ORIGIN'] is the thing you need, It's the same as the browser address bar value.
0
0
0
0
2012-10-26T20:25:00.000
3
0.132549
false
13,093,951
0
0
1
1
What is the easiest way to obtain the user's host/domain name, if available? Or is there a function to lookup the IP address of the user to see if it is bound to a named address? (i.e. gethostbyaddr() in PHP) HttpRequest.get_host() only returns the IP address of the user.
Do as many copies as the number of revisions exist for a file in plone?
13,676,795
0
4
122
0
python,plone,zope
If you change the content in any way (or just re-save it) a duplicate of the object is created (which allows you to undo later). If you change only the metadata (like the title) the object is usually not duplicated. These duplicated "backup" copies are removed (and the undo option for them) whenever the database is pa...
0
0
0
0
2012-10-27T06:25:00.000
2
0
false
13,097,843
1
0
1
1
In plone, how many physical copies of a file (or any content) exist if it is revised say 4 times? I am using plone 4.1 wherein the files and images are stored on the file system.
Can I deploy (update) Single Python file to existing Google App Engine application?
13,102,795
5
4
1,137
0
python,google-app-engine,deployment
No, there isn't. If you change one file, you need to package and upload the whole application.
0
1
0
0
2012-10-27T06:52:00.000
1
1.2
true
13,097,975
0
0
1
1
Is it possible to update single py file in existing GAE app.something like we update cron.yaml using, appcfg.py update_cron Is there any way to update .py file? Regrads.
Installing Django with pip, django-admin not found
13,098,637
3
4
7,509
0
python,django,macos,pip
django-admin is not on path, you could search for it find / -name django-admin.py and add it to your .profile/.bashrc/.whatever. Let me recommend using virtualenv for everything python related you do though. Installing it in a local environment prevents this kind of problem. Each environment comes with its own Python d...
0
0
0
0
2012-10-27T08:19:00.000
4
0.148885
false
13,098,457
0
0
1
1
I installed python using: brew install python and then eventually pip install Django. However when I try to run django-admin.py startproject test I just get a file not found. What did I forget?
Fastest way to write to a log in python
13,099,158
2
1
2,514
0
python,logging,uwsgi,gevent
If latency is a crucial factor for your app, undefinitely writing to disk could make things really bad. If you want to survive a reboot of your server while redis is still down i see no other solutions than writing to disk, otherwise you may want to try with a ramdisk. Are you sure having a second server with a second ...
0
1
0
0
2012-10-27T09:50:00.000
2
1.2
true
13,099,032
0
0
1
1
I am using the gevent loop in uWSGI and I write to a redis queue. I get about 3.5 qps. On occasion, there will be an issue with the redis connection so....if fail, then write to a file where I will have a separate process do cleanup later. Because my app very latency aware, what is the fastest way to dump to disk in...
How can one test appengine/drive/google api based applications?
13,125,588
1
2
259
0
python,google-app-engine,google-drive-api,google-api-python-client
There are the mock http and request classes that the apiclient package uses for its own testing. They are in apiclient/http.py and you can see how to use them throughout the test suite.
0
0
1
1
2012-10-29T03:42:00.000
1
1.2
true
13,115,599
0
0
1
1
There are several components involved in auth and the discovery based service api. How can one test request handlers wrapped with decorators used from oauth2client (eg oauth_required, etc), httplib2, services and uploads? Are there any commonly available mocks or stubs?
Django Queryset for no-operation
13,116,348
4
0
126
0
python,django
Model.objects.none() always gives you an empty queryset
0
0
0
0
2012-10-29T05:27:00.000
2
1.2
true
13,116,301
0
0
1
1
Is there any way to specify a Django Queryset, which will do nothing but still be valid Queryset? Empty queryset should ideally not call DB and results would be empty.
UWSGI adding double slash to admin login form in Django
14,267,828
1
2
768
0
python,django,uwsgi,mezzanine
After a long time I've figured out what the problem is! I had followed some directions on how to set up uwsgi with nginx that said to include a line saying uwsgi_param SCRIPT_NAME /;. The purpose of SCRIPT_NAME is to provide the base path for the UWSGI application, so in this case it serves to double the slashes. I fo...
0
0
0
0
2012-10-29T15:43:00.000
1
1.2
true
13,124,913
0
0
1
1
Running Django behind UWSGI, I have set up an instance of Mezzanine that is almost working perfectly. The only problem is the admin login page does not work properly. If you just try to log in normally than the browser is redirected to http://admin/. The html form action attribute is set to //admin/ instead of /admi...
How to remove .upload file
13,127,985
0
0
594
0
python,django,ubuntu
If the file size is greater than 2.5MB Django will write the uploaded file to your /tmp directory (on Linux) before saving it. After the upload is complete you can remove the file manually or you can have a cron job (or something similar) to remove the temp files automatically.
0
0
0
0
2012-10-29T18:40:00.000
1
1.2
true
13,127,708
0
0
1
1
When I use a form to upload a large video to the server, there is a temp.upload created in the /tmp directory. Where does this .upload created? Can I remove it after the uploading is complete? I use Django and python on ubuntun. I check Django documentation for file upload. It says that: "If an uploaded file is too l...
Setting default encoding Openerp/Python
13,135,341
4
0
803
0
python,encoding,openerp
The comment # -*- coding: utf-8 -*- tells the python parser the encoding of the source file. It affects how the bytecode compiler converts unicode literals in the source code. It has no effect on the runtime environment. You should explicitly define the encoding when converting strings to unicode. If you are getting U...
0
0
0
0
2012-10-30T07:19:00.000
1
0.664037
false
13,134,353
0
0
1
1
Do you guys know how to change the default encoding of an openerp file? I've tried adding # -*- coding: utf-8 -*- but it doesn't work (is there a setup that ignore this command? just a wild guess). When I try to execute sys.getdefaultencoding() still its in ASCII. Regards
How to run a command on an app and get the exit code on cloudfoundry
13,139,010
1
2
127
0
python,ssh,cloud-foundry
I assume you mean get the result from outside of CloudFoundry (i.e. not one app launching another app and getting result, stdout and stderr). You can only access CloudFoundry apps over http(s), so you would have to find a way to wrap your invocation into something that exposes everything you need as http.
0
1
0
0
2012-10-30T10:18:00.000
1
0.197375
false
13,136,885
0
0
1
1
We need to run arbitrary commands on cloudfoundry. (The deployed apps are Python/Django, but the language for this solution does not matter). Ideally over ssh, but the protocol does not matter. We need a reliable way to get the exit code of the command that was run, as well as its stderr and stdout. If possible, the co...
Call Django view from a template
13,139,288
0
1
1,663
0
python,django,templates,view
Map an url to that view. Redirect to that url from template.
0
0
0
0
2012-10-30T12:40:00.000
2
0
false
13,139,192
0
0
1
1
I want to call a Django view from a Django template. Is there a tag to do that ? For example, I want to create a view which manage my login form. So basically, this view will be used just to send the Django form to the html template. Thank you for your help.
Django app life cycle: standart hooks to handle start and reload?
13,145,394
2
0
925
0
python,django
Short answer: no. The longer version is that it really depends on how your application is deployed. In Java for example, it's not Spring (the equivalent of Django in this analogy) that gives you an onStart hook, it's Tomcat or Jetty. The usual interface for deploying Django, WSGI, doesn't define such hooks. A WSGI proc...
0
0
0
0
2012-10-30T18:18:00.000
1
1.2
true
13,145,282
0
0
1
1
I am trying to understand if there are standard means to handle the specific django application start (and reload). Currenly I would like to use it to start a parallel thread, but the question for me is more general: is this allowed or not allowed for some reason. For example, such handlers are a part of the applicatio...
Appengine SDK 1.7.3 not detecting updated files
13,638,216
3
3
294
0
python,google-app-engine
A similiar issue happens with appcfg.py in SDK 1.73, where it skips uploading some files sometimes. It looks like this only happens if appcfg.py is run under python 2.7. The workaround is to simply run appcfg.py under python 2.5. Then the upload works reliably. The code uploaded can still be 2.7 specific - it is only ...
0
1
0
0
2012-10-30T22:29:00.000
2
0.291313
false
13,148,512
0
0
1
1
I just updated to SDK 1.7.3 running on Linux. At the same time I switched to the SQLite datastore stub, suggested by the depreciation message. After this, edits to source files are not always detected, and I have to stop and restart the SDK after updating, probably one time in ten. Is anyone else seeing this? Any ideas...
Efficient way to store comments in Google App Engine?
13,151,123
2
2
171
0
python,google-app-engine
If comments are threaded, storing them as separate entities might make sense. If comments can be the target of voting, storing them as separate entities makes sense. If comments can be edited, storing them as separate entities reduces contention, and avoids having to either do pessimistic locking on all comments, or ri...
0
1
0
0
2012-10-31T00:41:00.000
2
0.197375
false
13,149,663
0
0
1
1
With Google App Engine, an entity is limited to 1 MB in size. Say I have a blog system, and expect thousands of comments on each article, some paragraphs in lengths. Typically, without a limit, you'd just store all the comments in the same entity as the blog post. But here, there would be concerns about reaching the 1 ...
async db access between requests on GAE/Python
13,181,950
0
0
82
0
python,google-app-engine,asynchronous,google-cloud-datastore
You cannot start an async API call in one request and get its result in another. The HTTP serving infrastructure will wait for all API calls started in a request to complete before the HTTP response is sent back; the data structure representing the async API call will be useless in the second request (even if it hits ...
0
1
0
0
2012-10-31T13:25:00.000
1
0
false
13,159,051
0
0
1
1
I'm trying to optimize my GAE webapp for latency. The app has two requests which usually come one after another. Is it safe to start an async db/memcache request during the first request and then use its results inside the following request? (I'm aware that the second request might hit another instance. It would be han...
Link to python modules in emacs
13,160,450
2
5
314
0
python,django,emacs,ide
I also switched from Eclipse to Emacs and I must say that after adjusting to more text-focused ways of exploring code, I don't miss this feature at all. In Emacs, you can just open a shell prompt (M-x shell). Then run IPython from within the Emacs shell and you're all set. I typically split my screen in half horizontal...
0
0
0
1
2012-10-31T14:28:00.000
3
0.132549
false
13,160,217
0
0
1
1
I'm looking into emacs as an alternative to Eclipse. One of my favorite features in Eclipse is being able to mouse over almost any python object and get a listing of its source, then clicking on it to go directly to its code in another file. I know this must be possible in emacs, I'm just wondering if it's already impl...
Why use Tornado and Flask together?
13,219,183
2
43
46,076
0
python,web,webserver,flask,tornado
instead of using Apache as your server, you'll use Tornado (of course as blocking server due to the synchronous nature of WSGI).
0
1
0
0
2012-10-31T17:59:00.000
4
0.099668
false
13,163,990
0
0
1
1
As far as I can tell Tornado is a server and a framework in one. It seems to me that using Flask and Tornado together is like adding another abstraction layer (more overhead). Why do people use Flask and Tornado together, what are the advantages?
Can Django admin handle millions of records?
13,168,612
6
1
943
0
python,django,scalability
count is fast and admin pagination for objects is limited to 100 records per page. Sorting on 2 million records could take some time though, but with 2 million users you can afford some ram to put some indexes on these fields ;) to be serious: this is no problem at all as long as your database can handle it.
0
0
0
0
2012-10-31T22:45:00.000
1
1.2
true
13,168,523
0
0
1
1
I am wondering if Django admin can handle a huge amount of records. Say I have a 2 million users, how the pagination will be handled for example? Will it be dead slow because every time all the records will be counted to be provided to the offset? Note: I plan to use PostgreSQL. Thanks.
How django handles simultaneous requests with concurrency over global variables?
13,172,015
2
7
4,217
0
python,django,apache,concurrency,mod-wsgi
This partly depends on your mod_wsgi configuration. If you configure it to use only one thread per process, then global variables are safe--although I wouldn't recommend using them, for a variety of reasons. In a multi-thread configuration, there is nothing guaranteeing that requests won't get mixed up if you use globa...
0
0
0
0
2012-11-01T06:11:00.000
1
1.2
true
13,171,860
0
0
1
1
I have a django instance hosted via apache/mod_wsgi. I use pre_save and post_save signals to store the values before and after save for later comparisons. For that I use global variables to store the pre_save values which can be accessed in the post_save signal handler. My question is, if two requests A and B come toge...
Using raw sql in django python
13,172,382
3
0
408
1
python,django
You need to use the database's table and field names in the raw query--the string you provide will be passed to the database, not interpreted by the Django ORM.
0
0
0
0
2012-11-01T06:54:00.000
1
0.53705
false
13,172,331
0
0
1
1
I have few things to ask for custom queries in Django DO i need to use the DB table name in the query or just the Model name if i need to join the various tables in raw sql. do i need to use db field name or model field name like Person.objects.raw('SELECT id, first_name, last_name, birth_date FROM Person A inner joi...
Python- How to flush the log? (django)
37,881,645
19
41
53,163
0
python,django,google-app-engine,logging,django-nonrel
If the use case is that you have a python program that should flush its logs when exiting, use logging.shutdown(). From the python documentation: logging.shutdown() Informs the logging system to perform an orderly shutdown by flushing and closing all handlers. This should be called at application exit and no further u...
0
0
0
0
2012-11-01T11:34:00.000
5
1
false
13,176,173
0
0
1
1
I'm working with Django-nonrel on Google App Engine, which forces me to use logging.debug() instead of print(). The "logging" module is provided by Django, but I'm having a rough time using it instead of print(). For example, if I need to verify the content held in the variable x, I will put logging.debug('x is: %s' % ...
Getting Responsive Django View
13,177,553
0
1
457
0
python,django,django-views,subprocess
Easiest I think will be use ajax to start he simulator. Response for start request can be updated on the same page. However, you will still have to think about how to pause,resume and stop the simulator started by earlier requests. i.e how to manage and manipulate state of the simulator. May be you want to update that ...
0
0
0
0
2012-11-01T12:28:00.000
2
0
false
13,177,087
0
0
1
1
I have a HTML page which has four buttons Start, Stop, Pause and Resume in it. The functionality of the buttons are: Start Button: Starts the backend Simulator. (The Simulator takes around 3 minutes for execution.) Stop Button: Stops the Simulator. Pause Button: Pauses the Simulator. Resume Button: Resumes the Simulat...
Deleting Blobstore orphans
13,187,373
1
2
1,014
1
google-app-engine,python-2.7,google-cloud-datastore,blobstore
You can create an entity that links blobs to users. When a user uploads a blob, you immediately create a new record with the blob id, user id (or post id), and time created. When a user submits a post, you add a flag to this entity, indicating that a blob is used. Now your cron job needs to fetch all entities of this ...
0
0
0
0
2012-11-01T22:29:00.000
4
0.049958
false
13,186,494
0
0
1
3
What is the most efficient way to delete orphan blobs from a Blobstore? App functionality & scope: A (logged-in) user wants to create a post containing some normal datastore fields (e.g. name, surname, comments) and blobs (images). In addition, the blobs are uploaded asynchronously before the resto of the data is sent...
Deleting Blobstore orphans
13,247,039
3
2
1,014
1
google-app-engine,python-2.7,google-cloud-datastore,blobstore
Thank for the comments. However, I understood those solutions well, I find them too inefficient. Querying thousands of entries for those that are flagged as "unused" is not ideal. I believe I have come up with a better way and would like to hear your thoughts on it: When a blob is saved, immediately a deferred task is ...
0
0
0
0
2012-11-01T22:29:00.000
4
1.2
true
13,186,494
0
0
1
3
What is the most efficient way to delete orphan blobs from a Blobstore? App functionality & scope: A (logged-in) user wants to create a post containing some normal datastore fields (e.g. name, surname, comments) and blobs (images). In addition, the blobs are uploaded asynchronously before the resto of the data is sent...
Deleting Blobstore orphans
16,378,785
0
2
1,014
1
google-app-engine,python-2.7,google-cloud-datastore,blobstore
Use Drafts! Save as draft after each upload. Then dont do the cleaning! Let the user for himself chose to wipe out. If you're planning on posts in a Facebook style use drafts either or make it private. Why bother deleting users' data?
0
0
0
0
2012-11-01T22:29:00.000
4
0
false
13,186,494
0
0
1
3
What is the most efficient way to delete orphan blobs from a Blobstore? App functionality & scope: A (logged-in) user wants to create a post containing some normal datastore fields (e.g. name, surname, comments) and blobs (images). In addition, the blobs are uploaded asynchronously before the resto of the data is sent...
Search Between Two Models in Django
13,198,418
1
0
88
0
python,django,templates,gis
Perhaps you could put it in the view which renders the search page. asuuming you have a view function like search you could: get users radius request.user.get_radius search for places based on that radius relevant_places = Places.get_all_places_in_radius Render those places to a user
0
0
0
0
2012-11-02T15:22:00.000
3
0.066568
false
13,198,198
0
0
1
2
I apologize in advance is this question is too broad, but I need some help conceptualizing. The end result is that I want to enable radius-based searching. I am using Django. To do this, I have two classes: Users and Places. Inside the Users class is a function that defines the radius in which people want to search. In...
Search Between Two Models in Django
13,202,154
0
0
88
0
python,django,templates,gis
I just decided to add the function to the view so that the information can be input directly into the model after a user enters it. Thanks for the help. I'll probably wind up looking into geodjango.
0
0
0
0
2012-11-02T15:22:00.000
3
0
false
13,198,198
0
0
1
2
I apologize in advance is this question is too broad, but I need some help conceptualizing. The end result is that I want to enable radius-based searching. I am using Django. To do this, I have two classes: Users and Places. Inside the Users class is a function that defines the radius in which people want to search. In...
Silent failure of s3multiput (boto) upload to s3 from EC2 instance
13,203,938
1
3
515
0
python,crontab,boto
First, I would try updating boto; a commit to the development branch mentions logging when a multipart upload fails. Note that doing so will require using s3put instead, as s3multiput is being folded into s3put.
0
0
1
1
2012-11-02T22:13:00.000
1
0.197375
false
13,203,745
0
0
1
1
I'm trying to automate a process that collects data on one (or more) AWS instance(s), uploads the data to S3 hourly, to be retrieved by a decoupled process for parsing and further action. As a first step, I whipped up some crontab-initiated shell script (running in Ubuntu 12.04 LTS) that calls the boto utility s3multip...
Can you serve static HTML pages from Pyramid?
13,205,833
1
1
1,016
0
python,html,pyramid
You can serve static html from Pyramid by using views that return pre-fabricated responses. You'll have a more fun time doing it though by just having your web server serve static html if it finds it, otherwise proxying the request to your Pyramid app.
0
0
0
0
2012-11-03T00:42:00.000
1
1.2
true
13,204,907
0
0
1
1
I have a Pyramid app using Mako templates and am wondering if it is possible to serve static HTML pages within the app? For the project I'm working on, we want to have relatively static pages for the public "front-facing" bits, and then the application will dynamically serve the meat of the site. We would like one of o...
python in azure website using webapp2
13,206,994
-1
2
231
0
python,azure,webapp2
To my knowledge, Windows Azure Web Sites don't support Python.
0
0
0
0
2012-11-03T01:54:00.000
1
-0.197375
false
13,205,245
0
0
1
1
I would like to try to develop website using python, upload to azure website. I saw there is a tutorial using django. Is there a tutorial using webapp2?
Google App Engine Update Issue
13,236,236
1
0
937
0
python,google-app-engine
After 3 days of endless searching, I have figured out the problem, if you are facing this issue, first thing you have to check is your system time, mine was incorrect due to daylight saving changes. Thanks
0
1
0
0
2012-11-03T05:53:00.000
2
1.2
true
13,206,438
0
0
1
1
I am working on an application (python based), which is deployed on GAE, it was working fine till last day, but I can't seem to update any code on app engine since this morning, it is complaining about some sort of issue with password, I have double checked and email id and password are correct. here is the stack trace...
How can I "ignore" NoReverseMatch in Django template?
13,207,944
0
4
1,152
0
python,django,django-templates
Easiest/quickest would be update django's url tag to fail silently. You can update function definition on def url(parser, token): in <your_django_path>/templatetags/future.py to have all code in try ... except and do not raise exception when there is any. However, this is quickest hack that I could think of, I'm not s...
0
0
0
0
2012-11-03T09:11:00.000
2
1.2
true
13,207,710
0
0
1
1
Is there any way to disable throwing NoReverseMatch exceptions from url tags in Django templates (just make it silently fail, return an empty string or smth... temporarily, for development, of course)? (I'm working on a Django project that is kind of a mess as far as things are organized (bunch of remote-workers, contr...
What are the best reusable django apps for form processing?
13,221,181
2
0
154
0
python,django,windows,pinax
Django allows you to do this super easily without any apps. I'd highly recommend you read up on its basic form processing features.
0
0
0
0
2012-11-04T16:47:00.000
3
0.132549
false
13,220,619
0
0
1
1
In my application I want to process some form data and show it later on a different page. My question is: Can you recommend any django apps to quickly set up such a system? I appreciate your answer!!!
Remove all user's cookies/sessions when password is reset
13,551,567
1
0
282
0
python,turbogears,repoze.who
Storing a timestamp of the last time password got changed inside request.identity['userdata'] should make possible to check it whenever the user gets back and log him out if it's different from the last time the password got changed for real.
0
0
0
0
2012-11-04T22:57:00.000
1
1.2
true
13,223,839
0
0
1
1
I'm interested in improving security of my TurboGears 2.2 application so that when user changes his password, it logs him out from all sessions and he must login again. The goal is when user changes password on browser 1, he must relogin on browser 2, too. Experiments show that this is not the case, especially if brows...
Is there a way to atomically run a function as a transaction within google app engine when the function modifies more than five entity groups?
13,228,117
0
1
66
0
python,google-app-engine
XG transactions are limited to a few entity groups for performance reasons. Running an XG transaction across hundreds of entity groups would be incredibly slow. Can you break your function up into many sub-functions, one for each entity group? If so, you should have no trouble running them individually, or on the task ...
0
1
0
0
2012-11-05T03:25:00.000
2
0
false
13,225,540
0
0
1
1
I'm developing on google app engine. The focus of this question is a python function that modifies hundreds of entity groups. The function takes one string argument. I want to execute this function as a transaction because there are instances right now when the same function with the same string argument are simulta...
Django default=timezone.now() saves records using "old" time
13,226,368
66
28
23,029
1
python,django,django-timezone
Just ran into this last week for a field that had default=date.today(). If you remove the parentheses (in this case, try default=timezone.now) then you're passing a callable to the model and it will be called each time a new instance is saved. With the parentheses, it's only being called once when models.py loads.
0
0
0
0
2012-11-05T04:23:00.000
2
1.2
true
13,225,890
0
0
1
1
This issue has been occurring on and off for a few weeks now, and it's unlike any that has come up with my project. Two of the models that are used have a timestamp field, which is by default set to timezone.now(). This is the sequence that raises error flags: Model one is created at time 7:30 PM Model two is creat...
Resolve FB GraphAPI picture call to the final URL
13,228,977
1
0
872
0
python,django,facebook-graph-api
Make a Graph API call like this and you get the real URL: https://graph.facebook.com/[fbid]?fields=picture Btw, you don´t need an access token for this.
0
0
1
0
2012-11-05T09:02:00.000
3
0.066568
false
13,228,847
0
0
1
1
I'm developing an application that displays a users/friends photos. For the most part I can pull photos from the album, however for user/album cover photos, all that is given is the object ID for which the following URL provides the image: https://graph.facebook.com/1015146931380136/picture?access_token=ABCDEFG&type=pi...
How to convert in OpenERP from one chart of account to another?
13,824,676
0
8
963
0
python,python-2.7,openerp,accounting
IMO its very difficult we are currently migrating some data and its proving to be difficult. I would advice you to pick a date in the future and tell everyone to just use another db with the correct chart of accounts. Your finance dept will be the one to suggest what date is perfect. How about when a period starts.
0
0
0
0
2012-11-05T10:29:00.000
4
0
false
13,230,195
0
0
1
4
I have installed chart of accounts A for company1. This chart was used couple months for accounting. How can I convert into chart of accounts B and keep old data for accounts (debit, credit, etc.)? In other words, is possible migrate data from one chart of accounts to another? Solution could be programmatically or trou...
How to convert in OpenERP from one chart of account to another?
13,369,353
0
8
963
0
python,python-2.7,openerp,accounting
I don't know of any way to install another chart of accounts after you've run the initial configuration wizard on a new database. However, if all you want to do is change the account numbers, names, and parents to match a different chart of accounts, then you should be able to do that with a bunch of database updates. ...
0
0
0
0
2012-11-05T10:29:00.000
4
0
false
13,230,195
0
0
1
4
I have installed chart of accounts A for company1. This chart was used couple months for accounting. How can I convert into chart of accounts B and keep old data for accounts (debit, credit, etc.)? In other words, is possible migrate data from one chart of accounts to another? Solution could be programmatically or trou...
How to convert in OpenERP from one chart of account to another?
15,182,814
0
8
963
0
python,python-2.7,openerp,accounting
I needed to do similar. It is possible to massage the chart from one form to another but I found in the end that creating a New Database, bringing in modules, assigning the new Chart and then importing all critical elements was the best and safest path. If you have a lot of transactions that will be more difficult to ...
0
0
0
0
2012-11-05T10:29:00.000
4
0
false
13,230,195
0
0
1
4
I have installed chart of accounts A for company1. This chart was used couple months for accounting. How can I convert into chart of accounts B and keep old data for accounts (debit, credit, etc.)? In other words, is possible migrate data from one chart of accounts to another? Solution could be programmatically or trou...
How to convert in OpenERP from one chart of account to another?
41,658,981
0
8
963
0
python,python-2.7,openerp,accounting
The fastest way to do so is using a ETL like Talend or Pentaho (provided there is a logic as to which account will map to which other during the process). If not you will have to do so by hand. In case there is a logic, you would export it to a format you can transform and re import. Uninstall your account chart and in...
0
0
0
0
2012-11-05T10:29:00.000
4
0
false
13,230,195
0
0
1
4
I have installed chart of accounts A for company1. This chart was used couple months for accounting. How can I convert into chart of accounts B and keep old data for accounts (debit, credit, etc.)? In other words, is possible migrate data from one chart of accounts to another? Solution could be programmatically or trou...
using neo4J (server) from python with transaction
13,234,558
5
2
1,075
1
python,flask,neo4j,py2neo
None of the REST API clients will be able to explicitly support (proper) transactions since that functionality is not available through the Neo4j REST API interface. There are a few alternatives such as Cypher queries and batched execution which all operate within a single atomic transaction on the server side; however...
0
0
0
0
2012-11-05T13:27:00.000
2
1.2
true
13,233,107
0
0
1
1
I'm currently building a web service using python / flask and would like to build my data layer on top of neo4j, since my core data structure is inherently a graph. I'm a bit confused by the different technologies offered by neo4j for that case. Especially : i originally planned on using the REST Api through py2neo ,...
Why does calling get() on memcache increase item count in Google App Engine?
13,389,191
1
4
195
0
python,google-app-engine,memcached
memcache.get should not increase the item count in memcache statistic, and I'm not able to reproduce that behavior in production. The memcache statistic page is global, so if you happen to have other requests (live, or through task queue) going to your application at the same time you're using the remote api, that coul...
0
1
0
0
2012-11-05T14:26:00.000
1
0.197375
false
13,234,094
0
0
1
1
I'm looking at the Memcache Viewer in my admin console on my deployed Google App Engine NDB app. For testing, I'm using the remote api. I'm doing something very simple: memcache.get('somekey'). For some reason, everytime I call this line and hit refresh on my statistics, the item count goes up by 2. This happens whethe...
Which GAE Database Property Fits a Tag Property?
13,250,634
1
0
72
0
python,google-app-engine,google-cloud-datastore
A repeated string property is your best option.
0
1
0
0
2012-11-05T22:34:00.000
2
0.099668
false
13,241,503
0
0
1
1
I want to have a property on a database model of mine in Google App Engine and I am not sure which category works the best. I need it to be a tag cloud similar to the Tags on SO. Would a text property be best or should I use a string property and make it repeated=True. The second seems best to me and then I can just ...
what does the cursor() method of GAE Query class return if the last result was already retrieved?
13,252,901
3
2
119
0
python,google-app-engine
There's still a cursor, even if the last result is retrieved. The query class doesn't know that, in any case: it knows what you've had already, but it doesn't know what else is still to come. The cursor doesn't represent any actual result, it's simply a way of resuming the query later. In fact, it's possible to use a c...
0
1
0
0
2012-11-06T14:03:00.000
2
0.291313
false
13,252,683
0
0
1
1
From the Google App Engine documentation: "cursor() returns a base64-encoded cursor string denoting the position in the query's result set following the last result retrieved." What does it return if the the last result retrieved IS the last result in the query set? Wouldn't this mean that there is no position that can...
AES Encryption (Python and Java)
13,262,092
3
1
631
0
java,python,security,encryption,aes
Typically, you'd generate the IV randomly, and send it along with the encrypted message. The IV doesn't need to be secret--it just needs to be different for every message you send. There are a wide variety of concerns to worry about when implementing crypto. Your block cipher mode matters, for instance--if you're using...
0
0
0
0
2012-11-07T01:34:00.000
1
1.2
true
13,262,047
1
0
1
1
I'm making a project in Java and Python that includes sending an encrypted string from one to the other. I can get the languages to understand each other and fully de-crypt / encrypt strings. However I was talking to somebody and was told that I am not being totally secure. I am using AES encryption for the project. Pa...
AWS glacier delete job
13,275,014
9
7
1,164
1
python,amazon-web-services,boto,amazon-glacier
The AWS Glacier service does not provide a way to delete a job. You can: Initiate a job Describe a job Get the output of a job List all of your jobs The Glacier service manages the jobs associated with an vault.
0
0
0
0
2012-11-07T16:42:00.000
1
1.2
true
13,274,197
0
0
1
1
I have started a retrival job for an archive stored in one of my vaults on Glacier AWS. It turns out that I do not need to resurrect and download that archive any more. Is there a way to stop and/or delete my Glacier job? I am using boto and I cannot seem to find a suitable function. Thanks
Get page (nested) level scrapy on each page(url, request) in spider
13,641,429
1
0
294
0
python,scrapy,web-crawler
After some time we found the solution - response.meta['depth']
0
0
1
0
2012-11-08T09:22:00.000
2
1.2
true
13,286,049
0
0
1
1
Subj.I want to get page (nested) level in scrapy on each page(url, request) in spider, is there any way to do that?