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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
accessing a MBean which is boolean in wlst | 37,591,919 | 1 | 1 | 938 | 0 | python,weblogic,mbeans,wlst | Try cmo.isPausedForForwarding().That works for me. | 0 | 0 | 0 | 0 | 2013-07-13T23:57:00.000 | 3 | 0.066568 | false | 17,635,271 | 0 | 0 | 1 | 2 | Need to access a boolean value under Store and Forward Agent ...
already inside the SAF_Agent and once i do a ls(), i see a list of operations and attributes. I can perform the operations, but i am unable to get one of the attributes
the attribute is PausedForForwarding which is a boolean true or false which currently ... |
Browser Simulation and Scraping with windmill or selenium, how many http requests? | 17,642,669 | 0 | 0 | 728 | 0 | python,selenium,selenium-webdriver,httprequest,windmill | Selenium uses the browser but number of HTTP request is not one. There will be multiple HTTP request to the server for JS, CSS and Images (if any) mentioned in the HTML document.
If you want to scrape the page with single HTTP request, you need to use scrapers which only gets what is present in the HTML source. If you... | 0 | 0 | 1 | 0 | 2013-07-14T12:16:00.000 | 1 | 0 | false | 17,639,299 | 0 | 0 | 1 | 1 | I want to use windmill or selenium to simulate a browser that visits a website, scrapes the content and after analyzing the content goes on with some action depending of the analysis.
As an example. The browser visits a website, where we can find, say 50 links. While the browser is still running, a python script for ex... |
Flask - How do I read the raw body in a POST request when the content type is "application/x-www-form-urlencoded" | 46,003,806 | 11 | 17 | 23,453 | 0 | python,ajax,post,flask | Use request.get_data() to get the POST data. This works independent of whether the data has content type application/x-www-form-urlencoded or application/octet-stream. | 0 | 0 | 1 | 0 | 2013-07-14T15:15:00.000 | 4 | 1 | false | 17,640,687 | 0 | 0 | 1 | 1 | Turns out that Flask sets request.data to an empty string if the content type of the request is application/x-www-form-urlencoded. Since I'm using a JSON body request, I just want to parse the json or force Flask to parse it and return request.json.
This is needed because changing the AJAX content type forces an HTTP O... |
get image frames webcam from server with selenium python script | 17,718,816 | 0 | 0 | 439 | 0 | python-2.7,selenium,selenium-webdriver | First, what you'll need to do is navigate to the webpage with Selenium.
Then, analyse the web page source HTML which the Javascript will have rendered by you navigating to the page, to get the image URL. You can do this with Selenium or with an HTML parser.
Then you can easily download the image using wget or some othe... | 0 | 0 | 1 | 0 | 2013-07-14T16:47:00.000 | 1 | 1.2 | true | 17,641,441 | 0 | 0 | 1 | 1 | I need to take image frames from a webcam server using selenium python module.
The frames webcam is show on the selenium browser ( using http:// .....html webpage) .
The source code of the page show me it's done using some java script.
I try to use:
capture_network_traffic() and captureNetworkTraffic
Not working , also... |
Where should I keep the authentication settings when using Scrapy? | 17,644,278 | 1 | 1 | 96 | 0 | python,scrapy | The "standard" is to use the environment. Depending on what environment you're running in you may not always be guaranteed a filesystem, however env vars are usually present in most application environments. | 0 | 0 | 1 | 0 | 2013-07-14T21:35:00.000 | 1 | 0.197375 | false | 17,644,019 | 0 | 0 | 1 | 1 | I have a working Scrapy scraper that does a login before proceeding to parse and retrieve data but I want to open source it with exposing my username/password. Where should I factor these out to?
I was thinking of either storing them in ENV and then accessing them via os.environ, putting them in a settings.local.py fil... |
when to use pre_save, save, post_save in django? | 39,893,085 | 5 | 33 | 24,676 | 0 | python,django,django-models,django-signals | Don't forget about recursions risk.
If you use post_save method with instance.save() calling, instead of .update method, you should disconnect your post_save signal:
Signal.disconnect(receiver=None, sender=None,
dispatch_uid=None)[source] To disconnect a receiver from a signal,
call Signal.disconnect(). The argum... | 0 | 0 | 0 | 0 | 2013-07-15T02:09:00.000 | 3 | 0.321513 | false | 17,645,801 | 0 | 0 | 1 | 1 | I see I can override or define pre_save, save, post_save to do what I want when a model instance gets saved.
Which one is preferred in which situation and why? |
cant download files uploaded tree.io | 17,730,860 | 1 | 2 | 109 | 0 | python,django,apache,treeio-django | after sometime found a solution for this.
i had to define the MEDIA_ROOT as an absolute URL in the settings.py
when i went to static/media there was no folder called attachments, i had to make one and give it the correct permissions for python can write to that folder.
this worked for me. | 0 | 0 | 1 | 0 | 2013-07-15T11:47:00.000 | 1 | 1.2 | true | 17,653,546 | 0 | 0 | 1 | 1 | All the files I upload to the tree.io tickets, projects, etc cannot be downloaded,
I am getting a 404 error.
I am running tree.io in a cantos 6 box.
any ideas to get this working please ? |
Logging User Login in App Engine | 17,655,687 | 0 | 0 | 35 | 0 | google-app-engine,python-2.7 | Log only if its been some time since they entered the app.
if you really want to do it at the login level hou can but you will need to setup SSO on the domain. | 0 | 1 | 0 | 0 | 2013-07-15T11:54:00.000 | 1 | 0 | false | 17,653,659 | 0 | 0 | 1 | 1 | I have a Python application on AppEngine that requires users to log in.
Is there any way to write a log entry on logging in?
Users could hit the log in screen from any URL and will reload pages throughout their session so adding it to code would add numerous entries when all I want is one at the point of authentication... |
Heroku - Flask - Bcrypt error | 32,994,904 | 0 | 2 | 773 | 0 | python,flask | Add cffi or cryptography in requirements.txt .That solved the problem in my case. | 0 | 0 | 0 | 1 | 2013-07-15T16:32:00.000 | 3 | 0 | false | 17,659,176 | 0 | 0 | 1 | 2 | I am attempting to deploy a flask app on Heroku and it always errors at the same place. GCC fails to install and compile the Bcrypt module so I removed it from my requirements.txt (it is not used in the app). When I view the requrements.txt file, there is no mention of Bcrypt but when I push to heroku, it still tries t... |
Heroku - Flask - Bcrypt error | 20,009,155 | 0 | 2 | 773 | 0 | python,flask | I was able to get around it kind of, by successfully installing the following: "Successfully installed z3c.bcrypt python-bcrypt py-bcrypt-w32". Installing one of these (likely the second one) is what probably included the main bcrypt library that I guess needed to be compiled? I not 100% sure... I noticed this post i... | 0 | 0 | 0 | 1 | 2013-07-15T16:32:00.000 | 3 | 0 | false | 17,659,176 | 0 | 0 | 1 | 2 | I am attempting to deploy a flask app on Heroku and it always errors at the same place. GCC fails to install and compile the Bcrypt module so I removed it from my requirements.txt (it is not used in the app). When I view the requrements.txt file, there is no mention of Bcrypt but when I push to heroku, it still tries t... |
Delete entities from a datastore table without knowing ancestor | 17,659,738 | 2 | 1 | 80 | 0 | python,google-app-engine,app-engine-ndb | Provided you have indexed them to be queried by date, you can query the entities by date.
The query will return the entities of interest. You can find out the ancestor of a given entity from its key - the ancestor's key is part of the entity's key. | 0 | 1 | 0 | 0 | 2013-07-15T16:49:00.000 | 1 | 1.2 | true | 17,659,500 | 0 | 0 | 1 | 1 | Is it possible to delete entities from a datastore table without knowing their ancestor? I wish to delete all entities older than a specific date, but there are many different ancestors. |
Gathering information from few forms in django | 17,663,244 | 0 | 3 | 79 | 0 | python,django,django-forms,formset | I just come up with an idea, that I can create in first form additional hidden fields, which can be synchronized with fields from second form by JavaScript. This will create small redundancy, however seems to be very easy to implement.
Is it a good idea? | 0 | 0 | 0 | 0 | 2013-07-15T19:54:00.000 | 2 | 0 | false | 17,662,714 | 0 | 0 | 1 | 1 | I am creating simple search engine, so I have one input text field on the top of the page and buttom "search" next to it. That is all in one form, and "produce" for instance/q=search%20query.
In sidebar I have panel with another form with filters, lets say from, to. I want to have a possibility of creating link like /q... |
Python webdriver to handle pop up browser windows which is not an alert | 17,676,233 | 8 | 31 | 84,462 | 0 | python,selenium,webdriver | If its a new window or an iframe you should use the driver.switch_to_frame(webelement) or driver.switch_to_window(window_name). This should then allow you to interact with the elements within the popup.
After you've finished, you should then driver.switch_to_default_content() to return to the main webpage. | 0 | 0 | 1 | 0 | 2013-07-16T12:02:00.000 | 2 | 1 | false | 17,676,036 | 0 | 0 | 1 | 1 | I am working on a web application, in which clicking on some link another popup windows appears. The pop windows is not an alert but its a form with various fields to be entered by user and click "Next".
How can I handle/automate this popup windows using selenium.
Summary :-
Click on the hyperlink (url) - "CLICK HER... |
How can I manage separate app.yaml / cron.yaml for my app engine source code? | 17,686,245 | 0 | 1 | 169 | 0 | google-app-engine,python-2.7,google-analytics | I've been using two branches where the app.yaml files are different. But it requires that I have to be careful when merging and explicitly NOT merge the app.yaml file. It's still a pain. | 0 | 1 | 0 | 0 | 2013-07-16T15:49:00.000 | 1 | 0 | false | 17,681,217 | 0 | 0 | 1 | 1 | I have two versions of my app, prod and dev that I manage from one git repo. The way I've been managing them is to constantly switch and uncomment lines in both my app.yaml and my cron.yaml depending upon which version I want to upload.
I was wondering if anyone had better experience managing two different versions ... |
PyCharm - some breakpoints not working in a Django project | 67,087,404 | 2 | 9 | 6,842 | 0 | python,django,breakpoints,pycharm | In my case, setting the "No reload" option in the run/debug configuration solved the problem. I'm using python 3.8. | 0 | 0 | 0 | 0 | 2013-07-16T16:12:00.000 | 5 | 0.07983 | false | 17,681,731 | 0 | 0 | 1 | 4 | I'm seeing some bizarre behaviour in PyCharm. I have a Django project where breakpoints stopped working in some files but not others. For example, all the breakpoints in my app's views.py work fine, but all the breakpoints in that same app's models.py are just ignored.
I've tried the following but no joy:
double-chec... |
PyCharm - some breakpoints not working in a Django project | 23,372,427 | 13 | 9 | 6,842 | 0 | python,django,breakpoints,pycharm | If you have the setting "Gevent compatible debugging" enabled it does not seem to hit breakpoints in a non-Gevent django application.
Find it under Preferences -> Python Debugger -> Gevent compatible debugging | 0 | 0 | 0 | 0 | 2013-07-16T16:12:00.000 | 5 | 1 | false | 17,681,731 | 0 | 0 | 1 | 4 | I'm seeing some bizarre behaviour in PyCharm. I have a Django project where breakpoints stopped working in some files but not others. For example, all the breakpoints in my app's views.py work fine, but all the breakpoints in that same app's models.py are just ignored.
I've tried the following but no joy:
double-chec... |
PyCharm - some breakpoints not working in a Django project | 17,688,764 | 6 | 9 | 6,842 | 0 | python,django,breakpoints,pycharm | While I don't know why or how, the problem was resolved by deleting the ".idea" directory within the Django project directory. This is where the PyCharm project data lives, so by removing this directory you will lose your project specific settings, so just be aware. Hope this helps someone else. | 0 | 0 | 0 | 0 | 2013-07-16T16:12:00.000 | 5 | 1.2 | true | 17,681,731 | 0 | 0 | 1 | 4 | I'm seeing some bizarre behaviour in PyCharm. I have a Django project where breakpoints stopped working in some files but not others. For example, all the breakpoints in my app's views.py work fine, but all the breakpoints in that same app's models.py are just ignored.
I've tried the following but no joy:
double-chec... |
PyCharm - some breakpoints not working in a Django project | 65,536,326 | -1 | 9 | 6,842 | 0 | python,django,breakpoints,pycharm | Just like other folders on the left side of your project, there will be a '.idea' folder on the top must be there. Delete that '.idea folder'. Close the project. Open it again. It solved my issues. | 0 | 0 | 0 | 0 | 2013-07-16T16:12:00.000 | 5 | -0.039979 | false | 17,681,731 | 0 | 0 | 1 | 4 | I'm seeing some bizarre behaviour in PyCharm. I have a Django project where breakpoints stopped working in some files but not others. For example, all the breakpoints in my app's views.py work fine, but all the breakpoints in that same app's models.py are just ignored.
I've tried the following but no joy:
double-chec... |
Do I need to SSH into EC2 instance in order to start custom script with arguments, or there are some service that I don't know | 17,691,484 | 1 | 0 | 218 | 0 | python,amazon,chef-infra,boto,aws-opsworks | You can use knife-bootstrap. This can be one way to do it. You can use AWS SDK to do most of it
Launch an instance
Add a public IP (if its not in VPC)
Wait for instance to come back online
use knife bootstrap to supply script, setup chef-client, update system
Then use chef cookbook to setup your machine | 0 | 0 | 1 | 1 | 2013-07-16T21:04:00.000 | 2 | 0.099668 | false | 17,686,939 | 0 | 0 | 1 | 1 | I need to create an application that will do the following:
Accept request via messaging system ( Done )
Process request and determine what script and what type of instance is required for the job ( Done )
Launch an EC2 instance
Upload custom script's (probably from github or may be S3 bucket)
Launch a script with a ... |
Datastore vs Memcache for high request rate game | 17,816,617 | 1 | 3 | 341 | 1 | python,google-app-engine,memcached,google-cloud-datastore,app-engine-ndb | As a commenter on another answer noted, there are now two memcache offerings: shared and dedicated. Shared is the original service, and is still free. Dedicated is in preview, and presently costs $.12/GB hour.
Dedicated memcache allows you to have a certain amount of space set aside. However, it's important to under... | 0 | 1 | 0 | 0 | 2013-07-17T14:13:00.000 | 2 | 0.099668 | false | 17,702,165 | 0 | 0 | 1 | 1 | I have been using the datastore with ndb for a multiplayer app. This appears to be using a lot of reads/writes and will undoubtedly go over quota and cost a substantial amount.
I was thinking of changing all the game data to be stored only in memcache. I understand that data stored here can be lost at any time, but as ... |
Push Notifications server to selected clients | 17,719,764 | 1 | 1 | 1,317 | 0 | php,python,rest | So basically you can query your server from client in some interval (interval ~ 0 == realtime) and ask, if it has some news.
Normally apache can't deal with long waiting connection, because of its thread/fork request processing model.
You can try switch to nginx, because it is using socket multiplexing (select/epoll/kq... | 0 | 0 | 1 | 1 | 2013-07-18T09:16:00.000 | 2 | 0.099668 | false | 17,719,300 | 0 | 0 | 1 | 1 | Currently I am using Web Application(LAMP stack) with REST API to communicate with clients(Python Desktop Application).
Clients can register with server and send states to server through REST API.
Now I need to push notifications to selected clients from web application(server).
My question is how can I send push notif... |
Is it possible to generate reports with dynamic columns in OpenERP? | 17,739,668 | 0 | 1 | 582 | 0 | python,report,openerp | I hope you can use webkit reporting. Any other openerp reporting tools have its limitations for creating dynamic columns. | 0 | 0 | 0 | 0 | 2013-07-18T17:38:00.000 | 2 | 0 | false | 17,730,406 | 0 | 0 | 1 | 1 | I need to understand if it is possible to create reports with X number of columns. X will come from the amenities a hotel have for example. So it will change depending on the hotel selected from a wizard before generating the report.
Lets say Hotel XYZ has 5 amenities I need a report with 5 columns where I will show th... |
how to deploy apps developed in virtual env | 17,758,271 | 0 | 0 | 83 | 0 | python,module,virtualenv | Uploading your virtualenv probably won't work. There is a good chance that something in the virtualenv is dependent on the exact file paths and versions that won't match from your machine to the virtual host.
You can upload the virtualenv tool, make a new virtualenv, and then install the version of flask you want insi... | 0 | 0 | 0 | 0 | 2013-07-20T02:21:00.000 | 1 | 0 | false | 17,758,039 | 0 | 0 | 1 | 1 | I have a flask based app, and it's now running with virtualenv on my dev machine. Now I want to deploy it to my virtual host. Sadly, this virtual host is running flask 0.6, and I want flask 0.10. I don't have enough privilege to upgrade it.
Can I just upload my whole virtual environment, and to use my own version of f... |
Implementing Universal Search in a Django Application | 17,762,184 | 0 | 0 | 624 | 0 | python,django,search,inheritance,django-forms | It seems like you just need to create another SearchView which takes the query and displays the results. I am not sure if the results have to be displayed differently depending on which page the search has been performed from but it does not seem like.
The form would not have anything to do with the other views. Yo... | 0 | 0 | 0 | 0 | 2013-07-20T11:51:00.000 | 3 | 0 | false | 17,761,974 | 0 | 0 | 1 | 1 | We have a large Django application made up of a large number of different views (some of which contain forms). As with most large applications, we use a base layout template that contains the common layout elements across the applications (mainly a header and a footer), which the templates for all of our views extend.... |
JavaScript is enabled in client browser in django or in python? | 17,778,994 | 0 | 0 | 319 | 0 | javascript,django,browser,python-2.7,client | Unfortunately, you can't do this unless trying a second request. There's no way to know this before actually interacting with the browser itself.
The closest I can think of is trying to set a cookie and store this information for future visits.
Hope it helps. | 0 | 0 | 0 | 0 | 2013-07-22T02:12:00.000 | 2 | 0 | false | 17,778,972 | 0 | 0 | 1 | 2 | I am trying to find a solution to detect if clients brower has javascript enabled or not.
Is there a way to check whether JavaScript is enabled in the client browser, in django if possible or in python? |
JavaScript is enabled in client browser in django or in python? | 32,660,783 | 0 | 0 | 319 | 0 | javascript,django,browser,python-2.7,client | The right approach is to degrade gracefully, but that is not always possible especially with web app. Use a <noscript> tag to tell the user to re-enable javascript.
If you need a solution through django, set a cookie using JS and try to read it in the second request. If you dont see the cookie then JS is not enabled. ... | 0 | 0 | 0 | 0 | 2013-07-22T02:12:00.000 | 2 | 0 | false | 17,778,972 | 0 | 0 | 1 | 2 | I am trying to find a solution to detect if clients brower has javascript enabled or not.
Is there a way to check whether JavaScript is enabled in the client browser, in django if possible or in python? |
how to make dynamic field creation capability in openerp module? | 17,897,177 | 0 | 0 | 228 | 0 | python,eclipse,openerp | I can't think of any easy way of doing this. When OpenERP connects to a database it sets up a registry containing all models and all the fields and as part of this, loads the fields into the database, performs database refactoring etc. The idea is that it is simple to inherit existing models and add your fields that ... | 0 | 0 | 1 | 0 | 2013-07-22T05:02:00.000 | 1 | 0 | false | 17,780,235 | 0 | 0 | 1 | 1 | Hi I have created an openerp module using Python (eclipse) . I want to add a feature in my form so that admin will be able to create his own fields whenever and whatever he wants . I needed some guidance of how this will be done . As I am new to openerp , any help will be good to me . Thanks
Hopes for advice |
Git check-out from ant target or python | 17,787,947 | 1 | 0 | 106 | 0 | python,git,ant,build | I would make with ant - it standard tool for Java-platform. May be generate ant from python or other one. Lack of this manner is not flexible of ant by comparison with Python.
Lack of Python-based solution is greater complexity of deployment in future: for linux good practice make packet, for Windows you have install p... | 0 | 0 | 0 | 1 | 2013-07-22T10:16:00.000 | 2 | 0.099668 | false | 17,785,000 | 0 | 0 | 1 | 1 | During our build , we call ANT from our Python .For code checkout,We have two options to checkout code from Git.
Pull code directly from Python script
Make an ANT target to pull code , Call that target from Python.
Can anyone please brief about pros and cons of both approach. I am new to all three tech.
Thanks |
How to create a function for a pop up in OpenERP | 18,320,029 | 0 | 0 | 604 | 0 | python,openerp | You can write a small wizard to do so.refer to openerp documentation for how to. | 0 | 0 | 0 | 0 | 2013-07-22T13:38:00.000 | 1 | 0 | false | 17,789,071 | 0 | 0 | 1 | 1 | I have created a button in debugging mode of OpenERP and want to display a message on click of that button.
This is the button Ex. then How to write an action on click of this button mainly the popup and message is required |
Free PaaS without / with less port forwarding to bind to custom ports? | 21,300,896 | 0 | 0 | 362 | 0 | python-2.7,httprequest,openshift,paas | You can also bind to arbitrary ports as long as you either want to talk out on that port or want to only consume it internally. For example some people write IRC bots using OpenShift, which goes out on port 6666 or 6667. If you want to have something listening to requests that come from outside openshift then you can o... | 0 | 1 | 0 | 0 | 2013-07-23T03:00:00.000 | 2 | 0 | false | 17,800,796 | 0 | 0 | 1 | 2 | I am currently engaged in a project which has the following requirements.
The application is written in Python,
The Application has two threads running at any instance, one is the 'server' and the other is the 'app-logic'.
The server listens on port 6000 (or any such custom port) and reads the incoming message (whi... |
Free PaaS without / with less port forwarding to bind to custom ports? | 18,064,738 | 0 | 0 | 362 | 0 | python-2.7,httprequest,openshift,paas | I have found one way! That is to use the DIY cartridge (Do it yourself) in Openshift, install Python and run "Websockets". Of course this still means that the transmissions should be of HTTP.
The other option is to move to IaaS (infrastructure as a service) rather than PaaS. | 0 | 1 | 0 | 0 | 2013-07-23T03:00:00.000 | 2 | 0 | false | 17,800,796 | 0 | 0 | 1 | 2 | I am currently engaged in a project which has the following requirements.
The application is written in Python,
The Application has two threads running at any instance, one is the 'server' and the other is the 'app-logic'.
The server listens on port 6000 (or any such custom port) and reads the incoming message (whi... |
Best practices for management of a developer system on Mac OS X for non-developers | 17,810,311 | 0 | 2 | 673 | 0 | python,ruby,macos | If all that you are worried about is quickly setting up a new machine, use a backup software to setup the new machine. You can also try to use a custom time machine setup with just the folders that you are interested it. | 0 | 0 | 0 | 1 | 2013-07-23T09:09:00.000 | 3 | 0 | false | 17,805,952 | 0 | 0 | 1 | 2 | I'm a designer who writes mostly Sass, Less (CSS pre-processors), HTML, Javascript and usually starts off with static site generators such as Jekyll, Yeoman, etc. While working with developers who code in Python, Ruby, Clojure, I help with the templates. In my free time, I design wordpress themes and write plugins in P... |
Best practices for management of a developer system on Mac OS X for non-developers | 17,808,568 | 0 | 2 | 673 | 0 | python,ruby,macos | I am not sure what you meant by "How can you help me setup my Mac?". It seems that you are very much comfortable installing all the dependencies(gems and all) for your projects. If you want to automate all these environment installation setup then you may go ahead and write a generic shell script to install ruby, pytho... | 0 | 0 | 0 | 1 | 2013-07-23T09:09:00.000 | 3 | 0 | false | 17,805,952 | 0 | 0 | 1 | 2 | I'm a designer who writes mostly Sass, Less (CSS pre-processors), HTML, Javascript and usually starts off with static site generators such as Jekyll, Yeoman, etc. While working with developers who code in Python, Ruby, Clojure, I help with the templates. In my free time, I design wordpress themes and write plugins in P... |
How to use a recaptcha custom theme with Flask-WTF | 17,856,425 | 0 | 1 | 1,772 | 0 | python,flask,recaptcha,flask-wtforms | After a couple hours trying to get a custom design working I couldn't make it work. Flask-WTF outputs all the html and javascript code for the recaptcha to work. You can't change its behavior without editing the extension code itself. | 0 | 0 | 0 | 0 | 2013-07-23T10:52:00.000 | 3 | 0 | false | 17,808,137 | 0 | 0 | 1 | 1 | I'm trying to customize the recaptcha inside my form, but I only get a javascript error. Can it be made, or do I have to modify the Flask-WTF code myself? |
Switch Django's version | 17,820,118 | 1 | 0 | 1,815 | 0 | python,django,virtualenv | Yes. Use virtualenv to install each project in its own isolated environment, with its own installation of libraries. | 0 | 0 | 0 | 0 | 2013-07-23T20:06:00.000 | 3 | 0.066568 | false | 17,820,037 | 0 | 0 | 1 | 1 | I'm using different Django framework version(1.3, 1.4, 1.5) for different projects.
On my laptop, I have to reinstall Django with pip, every time I want to switch to another project.
Is there an easier(less stupid! :D) way, that i can automatically switch to the version I need? Something like NVM for node? |
Websocket connection between two servers | 17,835,810 | 0 | 0 | 1,390 | 0 | python-2.7,websocket,tornado | WebSocket was designed for low-latency bidirectional browser<->service communication. It's placed on top of TCP/IP and brings along some overhead. It was designed to solve all the problems that you simply do not have when it's about front-end<->back-end communication, because there we're talking about a defined environ... | 0 | 1 | 1 | 0 | 2013-07-24T03:07:00.000 | 2 | 0 | false | 17,824,526 | 0 | 0 | 1 | 1 | Im using python tornado as web server and I have a backend server and a frontend server. I want to create browser-frontend-backend connection. Can anyone help me how to do this? I know how to create websocket connection between frontend and browser but I have no idea how to connect my frontend server to backend server... |
python bottle deciding on return mimetype | 17,832,612 | 0 | 0 | 377 | 0 | python,format,return,bottle | The Request Mime-type(or content-type) is the type of the content being sent to the server - it does not mean this is the same type that should be returned by the server.
The client should know what the server Response type is going to be, and not otherwise - the server should not "guess" what response the client wants... | 0 | 0 | 1 | 0 | 2013-07-24T10:02:00.000 | 2 | 0 | false | 17,830,806 | 0 | 0 | 1 | 1 | I am using bottle for a POC restful service project. would someone kindly let me know what is the best way to decide if the caller wants me to send the response in JSON, XML, or HTML? I have seen some examples of this using request.mimetypes.best_match, but that needs me to import flask. is there a way to do this in bo... |
Do debug messages being displayed on production server? | 17,834,315 | 0 | 0 | 124 | 0 | python,django | When DEBUG=False Error messages wont appear on site.You will get email to mails listed in 'ADMINS' settings in the "settings.py" file. | 0 | 0 | 0 | 0 | 2013-07-24T11:04:00.000 | 2 | 0 | false | 17,832,132 | 0 | 0 | 1 | 2 | Let's say I have console handler that prints DEBUG messages to console.
On production server where DEBUG=False, do debug messages displayed on console? Or they're only valid on development machine. |
Do debug messages being displayed on production server? | 17,853,247 | 1 | 0 | 124 | 0 | python,django | Django prints to apache's error.log when DEBUG=False. | 0 | 0 | 0 | 0 | 2013-07-24T11:04:00.000 | 2 | 0.099668 | false | 17,832,132 | 0 | 0 | 1 | 2 | Let's say I have console handler that prints DEBUG messages to console.
On production server where DEBUG=False, do debug messages displayed on console? Or they're only valid on development machine. |
Edit a file outside the web root | 17,833,204 | 1 | 0 | 126 | 0 | php,python,cgi | Probably by bind mounts (assuming Linux), so that the file is in it's original location as well as in the web root.
Or by priviledge separation. The web root sends a query to some worker job, that has access to all the needed files. | 0 | 0 | 0 | 0 | 2013-07-24T11:40:00.000 | 1 | 1.2 | true | 17,832,954 | 0 | 0 | 1 | 1 | I have developed a python desktop application and application itself having setup page to change some configurations in the application and it is saved as a configuration file.
Now I need do to give web interface to change those configurations by using web browser remotely. But I need to change the same configuration f... |
Django virtualenv layout | 17,837,797 | 1 | 15 | 6,964 | 0 | python,django,virtualenv | This goes to the very heart of how you use virtualenv: cd to the virtualenv directory, then activate it (or the other way around - it doesn't really matter). The usual way to do this on linux (or cygwin) is to source ./bin/activate/ from inside the virtualenv.
At that point, if you use pip or python they will be local ... | 0 | 0 | 0 | 0 | 2013-07-24T14:57:00.000 | 3 | 0.066568 | false | 17,837,723 | 1 | 0 | 1 | 1 | I am very new to django. I just have a very basic question about project layout using virtualenv. When we create virtualenv and install all the dependencies-django etc, do I need to switch my directory to the virtualenv and then create a project there? Or do I need to create my project outside of virtualenv. I apologiz... |
Google App Engine Remote API + OAuth | 20,981,524 | 0 | 5 | 907 | 0 | python,google-app-engine,oauth-2.0,google-oauth | You can't use OAuth2 to connect to your app with remote_api_stub/shell. This option is not provided. | 0 | 1 | 1 | 0 | 2013-07-25T11:45:00.000 | 2 | 0 | false | 17,857,138 | 0 | 0 | 1 | 1 | I'm using GAE remote api to access the data store of my app. The authentication to GAE is made using remote_api_stub.ConfigureRemoteApi with an authentication function that returns a user name and a password.
Is there a way for authenticating using an access_token, for example OAuth or OAuth 2.0? |
Switching between editor and console in PyDev | 17,857,465 | 1 | 0 | 264 | 0 | python,eclipse,pydev | In the preferences of Eclipse, go to "PyDev/Editor/Interactive Console" and uncheck "Focus console when an evaluate command is sent from the editor". This will leave the focus in the editor, while evaluating the code in the console. | 0 | 0 | 0 | 0 | 2013-07-25T11:49:00.000 | 1 | 1.2 | true | 17,857,189 | 1 | 0 | 1 | 1 | I usually use the key combination Ctrl+Alt+Enter to send a code selection from the Eclipse (Juno) PyDev editor to the interactive console. But this passes control to the console.
I was wondering if there is any way to automatically (or using a shortcut) return control to the code editor. |
Refresh Webpage using python | 17,868,479 | 1 | 2 | 3,417 | 0 | python,html,refresh | Without diving into complex modern things like WebSockets, there's no way for the server to 'push' a notice to a web browser. What you can do, however, it make the client check for updates in a way that is not visible to the user.
It will involve writing Javascript & writing an extra file. When writing your main webp... | 0 | 0 | 1 | 0 | 2013-07-25T19:50:00.000 | 1 | 1.2 | true | 17,867,471 | 0 | 0 | 1 | 1 | I have a webpage showing some data. I have a python script that continuously updates the data(fetches the data from database, and writes it to the html page).It takes about 5 minutes for the script to fetch the data. I have the html page set to refresh every 60 seconds using the meta tag. However, I want to change this... |
What is the difference between Scrapy's spider middleware and downloader middleware? | 17,872,865 | 21 | 18 | 3,140 | 0 | python,scrapy,web-crawler | While they have almost identical interfaces, they serve different purposes:
Downloader middlewares modify requests and responses or generate requests in response to responses. They don't directly interact with spiders. Some examples are middlewares that implement cookies, caching, proxies, redirects, setting user-agen... | 0 | 0 | 1 | 0 | 2013-07-26T04:10:00.000 | 1 | 1.2 | true | 17,872,753 | 0 | 0 | 1 | 1 | Both middleware can process Request and Response. But what is the difference? |
Escape quotes in Javascript/Chameleon template | 17,876,341 | 1 | 0 | 414 | 0 | javascript,python,chameleon | You need to JSON encode the dictionary. You don't then need to put quotes around the dictionary, and JavaScript will see it as a JavaScript object. | 0 | 0 | 0 | 0 | 2013-07-26T07:39:00.000 | 3 | 0.066568 | false | 17,875,627 | 0 | 0 | 1 | 2 | I am trying to pass a python dictionary from a chameleon template to a javascript function. But since the dictionary contains single quotes or ' which need to be escaped I get an error in firebug that says : SyntaxError: missing ) after argument list.
My code looks like this:
<div id = "divsfp">
<input type="button" i... |
Escape quotes in Javascript/Chameleon template | 17,876,140 | 0 | 0 | 414 | 0 | javascript,python,chameleon | You can try this, if this helps
"get_sfp('"+${dict_value}+"')"
Also from your implementation it seems that the dict_value is the variable you already know. So whats the problem accessing it from the get_sfp function.
Sorry couldn't comment as I still don't have that privilege. | 0 | 0 | 0 | 0 | 2013-07-26T07:39:00.000 | 3 | 0 | false | 17,875,627 | 0 | 0 | 1 | 2 | I am trying to pass a python dictionary from a chameleon template to a javascript function. But since the dictionary contains single quotes or ' which need to be escaped I get an error in firebug that says : SyntaxError: missing ) after argument list.
My code looks like this:
<div id = "divsfp">
<input type="button" i... |
Passing paramaters to flask __init__.py | 17,984,932 | 0 | 0 | 236 | 0 | python-2.7,configuration,flask | The solution hybrid solution between my inital plan and Seans suggestion. I use multiple config files and set a environment variable before each kind of app instance. This means that you need to use
from os import environ
environ["APP_SETTINGS"] = "config.py"
before every import app call. The best approach to this pro... | 0 | 0 | 0 | 1 | 2013-07-27T00:39:00.000 | 1 | 1.2 | true | 17,893,099 | 0 | 0 | 1 | 1 | I have a flask application that I would like to operate different when in production, unit testing, functional testing, and performance testing. Flasks one debug operation doesn't cover what I want to do, I was wondering if there is any way to pass parameters to flasks __init__.py.
I have several different scripts whi... |
Django - Privatizing Code - Which files are served to a user? | 17,893,390 | 3 | 0 | 43 | 0 | python,django | Django only serves the responses that you explicitly create and return from your views. There is no general ability to request files from it.
Make sure your source code isn't in a directory that your web server is configured to serve from, and make sure your settings.py value for DEBUG is False, and you should be fine... | 0 | 0 | 0 | 0 | 2013-07-27T01:23:00.000 | 2 | 1.2 | true | 17,893,360 | 0 | 0 | 1 | 2 | I am using Django to develop an API using an algorithm I wrote.
When someone requests a url, my urls.py calls a function in views.py which serves
page that returns a JSON string.
If my algorithm is in my views.py file, or in another file on my server, would it be possible for a user to view the contents of this file, ... |
Django - Privatizing Code - Which files are served to a user? | 17,893,392 | 1 | 0 | 43 | 0 | python,django | As long as nobody has shell access to your server, people will never see more than the actual HTML output of your page. .py files are not shown to the user that has requested an url in the browser. | 0 | 0 | 0 | 0 | 2013-07-27T01:23:00.000 | 2 | 0.099668 | false | 17,893,360 | 0 | 0 | 1 | 2 | I am using Django to develop an API using an algorithm I wrote.
When someone requests a url, my urls.py calls a function in views.py which serves
page that returns a JSON string.
If my algorithm is in my views.py file, or in another file on my server, would it be possible for a user to view the contents of this file, ... |
How to structure Python code to support multiple releases of MY project (i.e. not multiple versions of Python) | 17,898,532 | 0 | 0 | 133 | 0 | python,subprocess | There are a couple of tricks - they basically reply on discipline on the development teams part:
Publish an API and stick to it all V2 functions of the same name must accept the same parameters and return compatible results when so called.
Have a general interface say fred that just wraps your V1 functions
Make use o... | 0 | 0 | 0 | 0 | 2013-07-27T13:24:00.000 | 3 | 0 | false | 17,898,306 | 1 | 0 | 1 | 2 | I'm working on the back end of a web-based system. My code will receive calls from our web site and perform the actions requested by the user. We would like to support multiple versions of our front end simultaneously. So, for example, I might receive a request from V1 of our front end or from V2 of it. I need to r... |
How to structure Python code to support multiple releases of MY project (i.e. not multiple versions of Python) | 17,898,413 | 0 | 0 | 133 | 0 | python,subprocess | Your subprocess offers an API to the web sites.
The trick is to make it so that API v2 of the subprocess code can handle calls from both v1 and v2 web sites. This is called backward compatibility.
Also, it's nice if the v1 web site is not too picky about the data it receives and can for instance handle a v2 answer from... | 0 | 0 | 0 | 0 | 2013-07-27T13:24:00.000 | 3 | 0 | false | 17,898,306 | 1 | 0 | 1 | 2 | I'm working on the back end of a web-based system. My code will receive calls from our web site and perform the actions requested by the user. We would like to support multiple versions of our front end simultaneously. So, for example, I might receive a request from V1 of our front end or from V2 of it. I need to r... |
Pyramid: Tween or WSGI middleware for custom logger and external entitlement system? | 17,915,346 | 2 | 3 | 792 | 0 | python,pyramid,middleware,tween | Everything is better as WSGI middleware unless you need framework-specific details. Especially if you're smart and use the webob decorators to turn the complex WSGI protocol into simple request/response objects. For example when integrating with permissions I'm not even sure a tween makes sense. From within your groupf... | 0 | 0 | 0 | 0 | 2013-07-27T20:38:00.000 | 2 | 1.2 | true | 17,902,229 | 0 | 0 | 1 | 1 | I would like to get a clear understanding of what would be the most pythonic and cleaner way to implement:
a custom logger.
a piece of code which connects via REST to a third-party entitlement system to be combined with the internal Pyramid ACLs and permission system.
Should I rather write a WSGI middleware which get... |
GAE Blobstore file-like API deprecation timeline (py 2.7 runtime) | 17,959,762 | 1 | 5 | 677 | 0 | google-app-engine,python-2.7 | Official response from Chris Ramsdale, Product Manager, Google App Engine:
while there's currently no defined date for decommissioning this API, we are committed to supporting it throughout the remainder of the year (2013). please don't hesitate to reach out to me directly [redacted], if you have further questions (t... | 0 | 1 | 0 | 0 | 2013-07-27T22:20:00.000 | 1 | 1.2 | true | 17,903,025 | 0 | 0 | 1 | 1 | This is a question for the App Engine team.
Last week we realized that the App Engine team had marked the file-like API for writing and reading to the blobstore as being deprecated and likely to be removed in the future. We have quite a bit of infrastructure relying on that API that now we need to port to the alternati... |
Run both php and python at the same time on google app engine | 17,911,235 | 1 | 0 | 431 | 0 | php,python,google-app-engine,runtime | Quite simply, no. You'll have to use separate modules, or pick one language and use it for both of the things you describe. | 0 | 1 | 0 | 1 | 2013-07-28T15:15:00.000 | 3 | 0.066568 | false | 17,909,688 | 0 | 0 | 1 | 3 | I heard that this was possible using the new modules features for the google app engine, but this will require two different modules, which basically is like two different apps. I would like to be able to run my python and php in the same application. Im getting some results via python and I want to parse them using ph... |
Run both php and python at the same time on google app engine | 17,911,325 | 0 | 0 | 431 | 0 | php,python,google-app-engine,runtime | Segregate your applications in different modules and communicate between the two using the GAE Data Store or Memcache.
Your applications can signal each other using a GET request with the name of the Memcache key or the url safe data store key. | 0 | 1 | 0 | 1 | 2013-07-28T15:15:00.000 | 3 | 0 | false | 17,909,688 | 0 | 0 | 1 | 3 | I heard that this was possible using the new modules features for the google app engine, but this will require two different modules, which basically is like two different apps. I would like to be able to run my python and php in the same application. Im getting some results via python and I want to parse them using ph... |
Run both php and python at the same time on google app engine | 17,914,860 | 0 | 0 | 431 | 0 | php,python,google-app-engine,runtime | You can achieve the proxy pattern by simply making http requests from one module to the other, using the URLFetch service. | 0 | 1 | 0 | 1 | 2013-07-28T15:15:00.000 | 3 | 0 | false | 17,909,688 | 0 | 0 | 1 | 3 | I heard that this was possible using the new modules features for the google app engine, but this will require two different modules, which basically is like two different apps. I would like to be able to run my python and php in the same application. Im getting some results via python and I want to parse them using ph... |
Running GAE remote_api_shell.py in a iPython notebook web interface | 17,931,783 | 0 | 0 | 259 | 0 | google-app-engine,ipython,ipython-notebook | iPython Notebook has profile directories in ~/.ipython, which have a startup directory for Python scripts that can be used to do the customization of sys.path and login credentials as remote_api_shell.py does. | 0 | 1 | 0 | 0 | 2013-07-28T20:46:00.000 | 1 | 1.2 | true | 17,912,720 | 0 | 0 | 1 | 1 | I'd like to run modified remote_api_shell.py in an iPython notebook web interface, so that non-technical users with a basic grasp of Python could have read-only access to our production database.
Has anyone set something like this up, and what's the best way of going about it? |
How to call a *.jsl script from python script | 34,890,487 | 0 | 4 | 4,983 | 0 | python-3.x,sas-jmp,jsl | Make sure jmp.exe is available in your system environment so that if you type "jmp.exe" in the command line, it would launch jmp. Then have your *.jsl ready.
use python procees to run this command "jmp.exe *.jsl" and that would open jmp and run the *.jsl script and then you can import whatever you generate from jmp bac... | 0 | 0 | 0 | 0 | 2013-07-29T18:27:00.000 | 3 | 0 | false | 17,931,476 | 0 | 0 | 1 | 1 | I have a python script running. I want to call *.jsl script in my running python script and want to make use of it's output in python. May I know how can I do that? |
Copying files in the same Amazon S3 bucket | 20,389,005 | 0 | 1 | 995 | 1 | python,amazon-web-services,amazon-s3,boto,s3cmd | Since your source path contains your destination path, you may actually be copying things more than once -- first into the destination path, and then again when that destination path matches your source prefix. This would also explain why copying to a different bucket is faster than within the same bucket.
If you're us... | 0 | 0 | 0 | 0 | 2013-07-29T18:32:00.000 | 1 | 0 | false | 17,931,579 | 0 | 0 | 1 | 1 | I am trying to copy the entire /contentstore/ folder on a bucket to a timestamped version. Basically /contenstore/ would be copied to /contentstore/20130729/.
My entire script uses s3s3mirror first to clone my production S3 bucket to a backup. I then want to rename the backup to a timestamped copy so that I can keep mu... |
Using guardian's assign_perm in a south migration | 27,130,661 | 0 | 1 | 193 | 0 | python,django-south,django-guardian | I used get_user_model() instead of orm['auth.User'] | 0 | 0 | 0 | 0 | 2013-07-29T19:33:00.000 | 1 | 0 | false | 17,932,649 | 0 | 0 | 1 | 1 | I can't get django-guardian assign_perm to work in a south datamigration ... the reason it is not working seems to be because guardian is not using the frozen ORM. How can I get other apps in general and django-guardian specifically to use frozen models. |
Update a MySQL table from an HTML table with thousands of rows | 17,940,205 | 0 | 1 | 509 | 1 | python,mysql,beautifulsoup,mysql-python | My Suggestion is instead of updating values row by row try to use Bulk Insert in temporary table and then move the data into an actual table based on some timing key. If you have key column that will be good for reading the recent rows as you added. | 0 | 0 | 0 | 0 | 2013-07-30T06:33:00.000 | 2 | 0 | false | 17,939,824 | 0 | 0 | 1 | 1 | I have an html file on network which updates almost every minute with new rows in a table. At any point, the file contains close to 15000 rows I want to create a MySQL table with all data in the table, and then some more that I compute from the available data.
The said HTML table contains, say rows from the last 3 days... |
Implementing social login in Flask | 28,427,169 | 1 | 5 | 2,924 | 0 | python,flask,flask-login,flask-security | Mark Hildreth is correct.
flask-social allows you to log in via a form (username/password) or via social.
So you can use it in conjunction with flask-security, flask-login, or whatever password-based authentication you want. I have used flask-social in conjunction with flask-security and can confirm they work quite we... | 0 | 0 | 0 | 0 | 2013-07-30T15:59:00.000 | 1 | 0.197375 | false | 17,951,872 | 0 | 0 | 1 | 1 | Looking to implement social authentication in our application with LinkedIn, Google, Facebook. I'm currently using flask-security to help manage users/roles in our application. I'm looking for some guidance on best practices with Flask/Flask-Security and Social Authentication.
I've seen the flask-social plugin, but I'... |
I have a static website built using HTML, CSS and Javascript. How do I integrate this with a SQLite3 database accessed with the Python API? | 18,099,967 | 1 | 5 | 1,713 | 1 | python,sqlite,static-site | It looks like your needs has changed and you are going into direction where static web site is not sufficient any more.
Firstly, I would pick appropriate Python framework for your needs. if static website was sufficient until recently Django can be perfect for you.
Next I would suggest describing your DB schema for ORM... | 0 | 0 | 0 | 0 | 2013-07-30T17:29:00.000 | 3 | 0.066568 | false | 17,953,552 | 0 | 0 | 1 | 1 | Title question says it all. I was trying to figure out how I could go about integrating the database created by sqlite3 and communicate with it through Python from my website.
If any further information is required about the development environment, please let me know. |
Push information from Django to iOS locally | 17,957,913 | 0 | 0 | 114 | 0 | python,ios,django,sockets,push | Once your app is no longer in the foreground, the only way to communicate with it at all is via push notification.
If the app is open, you could create some kind of listener socket, register it with your Django server, and have the server talk to the socket. Otherwise your best bet would be to just poll the server eve... | 0 | 0 | 0 | 0 | 2013-07-30T21:20:00.000 | 1 | 0 | false | 17,957,619 | 0 | 0 | 1 | 1 | Is it possible to push information from Django to an iOS application over a local intranet? Whenever there is a specific POST request to the Django-server, I would like to either push out some information to the devices, or just send a signal to the devices, asking them to pull from the API.
This problem would normally... |
Django-CMS Type Error "a float is required" | 18,367,549 | 0 | 0 | 397 | 0 | python,django,deployment,django-cms,bluehost | As I wondered, the problem was that I was accessing the site using my temporary link from BlueHost, which the function throwing the error could not handle.
When my clients finally pointed their domain name at the server this problem and a few others (CSS inconsistencies in the Django admin, trouble with .htaccess) disa... | 0 | 0 | 0 | 0 | 2013-07-31T01:42:00.000 | 1 | 1.2 | true | 17,960,261 | 0 | 0 | 1 | 1 | I'm deploying my first Django app on a BlueHost shared server. It is a simple site powered by Django-CMS, and portions of it are working, however there are some deal-breaking quirks.
A main recurring one reads TypeError, a float is required. The exception location each time is .../python/lib/python2.7/site-packages/dj... |
Serve static files through a custom handler or register in app.yaml? | 17,979,219 | 0 | 0 | 105 | 0 | python,google-app-engine,webapp2 | Use the static handler:
You don't need to startup an instance to serve your file. This generally means it'll be served quicker, and you save on CPU hours.
You don't have to worry edge caching.
The cons might be that the files are static, and it might require more manual intervention with your framework. | 0 | 0 | 0 | 0 | 2013-07-31T09:03:00.000 | 1 | 1.2 | true | 17,966,015 | 0 | 0 | 1 | 1 | In a project I'm developing I'm using several Python projects as dependencies. These projects each come with static files (JavaScript, images, etc.) and a set of handlers (with default URLs). To register the URLs for the handlers I add them to the routes in the WSGI application. The static files however need to be regi... |
Putting something on your system path | 17,968,753 | 1 | 1 | 77 | 0 | python,django,linux,ubuntu | System path is an system environment variable that contains the path for some folders where the os will search for applications, scripts, etc.
In windows django-admin.py is in C:\Python\scripts, so if you have set the PYTHONPATH environment variable and added all the required python folder in that variable like C:\Pyth... | 0 | 0 | 0 | 0 | 2013-07-31T10:54:00.000 | 3 | 0.066568 | false | 17,968,422 | 0 | 0 | 1 | 2 | I am trying a python, django tutorial. It says type django-admin.py however I get 'command not found' with this.
Someone told me that the problem could be that django is not in your system path, what does that mean?
I am using ubuntu. |
Putting something on your system path | 17,972,309 | 0 | 1 | 77 | 0 | python,django,linux,ubuntu | If you installed Django from the Ubuntu repositories via apt-get or synaptic, the script will be simply django-admin (without the .py). | 0 | 0 | 0 | 0 | 2013-07-31T10:54:00.000 | 3 | 0 | false | 17,968,422 | 0 | 0 | 1 | 2 | I am trying a python, django tutorial. It says type django-admin.py however I get 'command not found' with this.
Someone told me that the problem could be that django is not in your system path, what does that mean?
I am using ubuntu. |
Reading the app engine logs.db file? | 18,027,540 | 0 | 0 | 67 | 0 | python,google-app-engine | It's an sqlite file, can just read it with sqlite3 module. | 0 | 1 | 0 | 0 | 2013-07-31T23:55:00.000 | 1 | 1.2 | true | 17,982,992 | 0 | 0 | 1 | 1 | I want to read the logs.db file with an external script, but I don't know what format it's in (it's binary) to know what to read it with. It's a massive rabbit hole to try to figure out the log_service module, and I'm hoping I can shortcut that and just open it into readable text some other way.
Any ideas? |
What is the best way to track / record the current programming project u work on | 18,004,681 | 0 | 3 | 278 | 0 | python,coding-style,project-management,jira,issue-tracking | Every time you revisit code, make a list of the information you are not finding. Then the next time you create code, make sure that information is present. It can be in comments, Wiki, bugs or even text notes in a separate file. Make the notes useful for other people, so private notebooks aren't a good idea except for ... | 0 | 0 | 0 | 1 | 2013-08-01T03:42:00.000 | 2 | 0 | false | 17,984,890 | 0 | 0 | 1 | 1 | I have been in this problem for long time and i want to know how its done in real / big companies project.
Suppose i have the project to build a website. now i divide the project into sub tasks and do it.
But u know that suppose i have task1 in hand like export the page to pdf. Now i spend 3 days to do that , came accr... |
Django admin tools new version model changes | 18,301,020 | 0 | 2 | 500 | 0 | python,django,django-admin-tools | After upgrading django admin tools I faced the same problem and ended up dropping tables admin_tools_dashboard_preferences and admin_tools_menu_bookmark and recreating them using python manage.py syncdb. Obviously, it will erase all custom parameters you may set before so make sure you made a backup. | 0 | 0 | 0 | 0 | 2013-08-01T10:14:00.000 | 2 | 0 | false | 17,991,190 | 0 | 0 | 1 | 1 | I upgraded Django admin_tools to the latest version 0.5 . And I'm using Django 1.3
Now I am getting this error when I go to admin pages:
OperationalError: (1054, "Unknown column 'admin_tools_dashboard_preferences.dashboard_id' in 'field list'")
There are no instructions mentioned in the documentation for fixing this. W... |
How to abort a workflow transition in Plone | 18,020,552 | 3 | 4 | 298 | 0 | python,workflow,plone | The recommended way is to set a guard instead.
The guard expression should be able to look up a view to facilitate more complex guard code, but when a guard returns False the transition isn't even listed as available. | 0 | 0 | 0 | 0 | 2013-08-01T18:39:00.000 | 2 | 0.291313 | false | 18,001,984 | 0 | 0 | 1 | 1 | I am working on a complex validation in a dexterity content type which should check the dependencies across several fields at the workflow transition time - I want it to work in the SimplePublicationWorkflow being triggered when the content is sent from "private" to "pending".
I've registered an event listener for IBef... |
Python bottle vs uwsgi/bottle vs nginx/uwsgi/bottle | 49,163,067 | 2 | 11 | 7,565 | 0 | python,nginx,uwsgi,bottle | I also suggest you look at running bottle via gevent.pywsgi server. It's awesome, super simple to setup, asynchronous, and very fast.
Plus bottle has an adapter built for it already, so even easier.
I love bottle, and this concept that it is not meant for large projects is ridiculous. It's one of the most efficient... | 0 | 1 | 0 | 1 | 2013-08-01T22:53:00.000 | 3 | 0.132549 | false | 18,006,014 | 0 | 0 | 1 | 2 | I am developing a Python based application (HTTP -- REST or jsonrpc interface) that will be used in a production automated testing environment. This will connect to a Java client that runs all the test scripts. I.e., no need for human access (except for testing the app itself).
We hope to deploy this on Raspberry Pi's,... |
Python bottle vs uwsgi/bottle vs nginx/uwsgi/bottle | 18,006,120 | 15 | 11 | 7,565 | 0 | python,nginx,uwsgi,bottle | Flask vs Bottle comes down to a couple of things for me.
How simple is the app. If it is very simple, then bottle is my choice. If not, then I got with Flask. The fact that bottle is a single file makes it incredibly simple to deploy with by just including the file in our source. But the fact that bottle is a sing... | 0 | 1 | 0 | 1 | 2013-08-01T22:53:00.000 | 3 | 1.2 | true | 18,006,014 | 0 | 0 | 1 | 2 | I am developing a Python based application (HTTP -- REST or jsonrpc interface) that will be used in a production automated testing environment. This will connect to a Java client that runs all the test scripts. I.e., no need for human access (except for testing the app itself).
We hope to deploy this on Raspberry Pi's,... |
best practice for graph-like entities on appengine ndb | 18,035,092 | 1 | 1 | 478 | 1 | python,google-app-engine,app-engine-ndb,graph-databases | There's two ways to implement one-to-many relationships in App Engine.
Inside entity A, store a list of keys to entities B1, B2, B3. In th old DB, you'd use a ListProperty of db.Key. In ndb you'd use a KeyProperty with repeated = True.
Inside entity B1, B2, B3, store a KeyProperty to entity A.
If you use 1:
When y... | 0 | 1 | 0 | 0 | 2013-08-02T12:42:00.000 | 2 | 0.099668 | false | 18,017,150 | 0 | 0 | 1 | 1 | I'm designing a g+ application for a big international brand. the entities I need to create are pretty much in form of a graph, hence a lot of many-to-many relations (arcs) connecting nodes that can be traversed in both directions. I'm reading all the readable docs online, but I haven't found anything so far specific t... |
GAE, Python: How to define db object classes in only one place? | 18,020,650 | 2 | 2 | 65 | 0 | python,class,google-app-engine | Make a seperate .py file called something like classes and variables, place all classes you use in your code in that file and call it upon startup for both files. | 0 | 0 | 0 | 0 | 2013-08-02T15:20:00.000 | 2 | 0.197375 | false | 18,020,557 | 0 | 0 | 1 | 1 | I have a main.py which contains class definitions for objects that are fetched from db and displayed.
I also have a scrape.py that fetches these same sorts of objects from the web, and stores them to the db.
How do I avoid having to have class definitions for these objects in both main.py and scrape.py? |
Python 2.7 - Codenvy - Debugging issues | 23,685,697 | 1 | 2 | 427 | 0 | google-app-engine,python-2.7,codenvy | I discovered that if you go to the Google App Developper Console, there is a menu on the left. Click on App Engine, then click on Logs. There you can see the internal server error (error 500) log, which pretty much tell you what went wrong. | 0 | 1 | 0 | 0 | 2013-08-03T02:58:00.000 | 2 | 0.099668 | false | 18,028,841 | 0 | 0 | 1 | 1 | I'm working with Codenvy writing a Google Appengine app, and I have found it to be INSANELY difficult to debug. If there's a syntax error I have to find it manually as the web page that loads when testing give me and error:500. Also, I often want to print but Codenvy doesn't support printing for python (that or I don't... |
Django admin radio-button for one-to-one relationship | 18,045,653 | 0 | 1 | 419 | 0 | python,django,one-to-one,modeladmin | Add OneToOneField for Photo in House model (you will need to reference it as "YOUR_APP.Photo" to avoid circular references), provide ModelAdmin with custom form, and in that form's constructor filter queryset for that field to display only photos for current house.
Different approach is to add highlighted flag in Photo... | 0 | 0 | 0 | 0 | 2013-08-04T13:37:00.000 | 1 | 0 | false | 18,043,529 | 0 | 0 | 1 | 1 | I have 2 model classes in my django app:
1: House (name, location, id...)
2: Photo (description, id, house -foreign key-).
In the admin interface, the photo is displayed as inline for the house form, but now, I want the user to be able to choose ONE picture as highlighted for that house.
My question is: there's somewa... |
how to set name of a field dynamically in openerp? | 18,071,459 | 2 | 0 | 939 | 0 | python,eclipse,openerp | Do you mean you want a dynamic field on the form/tree view or in the model?
If it is in the view then you override fields_view_get, call super and then process the returned XML for the form type you want adding in the field or manipulating the XML. ElementTree is your friend here.
If you are talking about having a dyn... | 0 | 0 | 0 | 0 | 2013-08-05T04:50:00.000 | 2 | 0.197375 | false | 18,050,770 | 0 | 0 | 1 | 2 | Hi I am working on an openerp module . I want to make a field dynamically . I want to take a name of a field from user and then create a field to it . How this can be done ? Can I do it with fields.function to return name, char type ? Plz help |
how to set name of a field dynamically in openerp? | 18,071,982 | 0 | 0 | 939 | 0 | python,eclipse,openerp | You can create Fields Dynamically by the help of class self.pool.get('ir.model.fields')
Use Create Function. | 0 | 0 | 0 | 0 | 2013-08-05T04:50:00.000 | 2 | 0 | false | 18,050,770 | 0 | 0 | 1 | 2 | Hi I am working on an openerp module . I want to make a field dynamically . I want to take a name of a field from user and then create a field to it . How this can be done ? Can I do it with fields.function to return name, char type ? Plz help |
Django strange behavior: manage.py commands do not end | 18,085,375 | 1 | 1 | 1,139 | 0 | python,django,django-manage.py | Some dependency might be starting a thread. Django will wait for all threads to finish when autoreloading on code changes, or executing a management command. Inspect all dependencies to identify which one might be causing this problem. | 0 | 0 | 0 | 0 | 2013-08-05T07:16:00.000 | 1 | 1.2 | true | 18,052,515 | 0 | 0 | 1 | 1 | during the last days I am observing a very strange behavior in one of my django projects:
When I run some manage.py commands I see that although the commands are executed they do not end. For instance, if I try running syncdb:
c:\django> python manage.py syncdb
Syncing...
Creating tables ...
Creating table questions_c... |
How to prevent concurrent access to a resource such as a USB device? | 18,089,913 | 1 | 1 | 1,351 | 0 | python,concurrency,locking,semaphore,superglobals | Not exactly an answer to your question, but maybe another idea about how to tackle this with out using globals.
Why don't you write a small program for controlling your USB device. This script runs once (one instance) on your server and takes care of communicating with the device in the manner you need. It also takes c... | 0 | 0 | 0 | 0 | 2013-08-06T19:40:00.000 | 3 | 0.066568 | false | 18,089,022 | 0 | 0 | 1 | 1 | I would like to be able to use a USB device from several applications (for instance I run a Flask web application), making sure only one uses it at a time.
In my case I am using a relay to open / close a door. The door takes about 20 seconds to open. During that time the relay should not be activated, because this woul... |
Use of Mechanize Library with Python 2.7 and Django | 27,438,161 | 0 | 1 | 277 | 0 | django,mechanize,mechanize-python | As per comments, the answer is:
pip install mechanize
then just open a python interpreter and import mechanize to confirm.
That should be it, you can start using mechanize in your Django project. | 0 | 0 | 0 | 0 | 2013-08-07T02:10:00.000 | 1 | 0 | false | 18,093,487 | 0 | 0 | 1 | 1 | How do I use the mechanize library with Django?
I read online that I could put it in a directory (e.g. /lib/) and include as needed.
The problem is, the the source I had found didn't show how to use it from configuration to initial use. Unfortunately, I also looked high and low elsewhere on google with nothing to find.... |
Google App Engine shows notice to Upgrade Python to 2.7 | 18,107,791 | 3 | 0 | 427 | 0 | python,google-app-engine | Here's the deal.
You have to migrate. They have announced the deprecation of the Python 2.5 runtime and will continue to support it in accordance with the Google App Engine Terms of Service. Here is the section you should concern yourself with...
7.3 Deprecation Policy.
Google will announce if we intend to discontinu... | 0 | 1 | 0 | 0 | 2013-08-07T04:31:00.000 | 1 | 1.2 | true | 18,094,718 | 0 | 0 | 1 | 1 | I hope this posting is in the right location.
I am very new to Google App Engine, in fact its part of a iOS Application that I purchased from another developer, so bear with me please.
The iOS Application currently has 20,000 active users. There is no way I can break the system and their Application...so my question ... |
Keep form fields from being editable | 18,111,276 | 1 | 0 | 139 | 0 | php,python,codeigniter | You could add a disable tag in your input if the user is not logged in. For example: <input type="text" name="lname" disabled> | 0 | 0 | 0 | 0 | 2013-08-07T18:37:00.000 | 4 | 0.049958 | false | 18,111,203 | 0 | 0 | 1 | 1 | I have a form that's pre-populated with values from a database. If a user is logged in and has sufficient permissions, the user can edit the fields. That all works well; however, if the user is not logged in, the fields should not be able to be changed. I have it so that any changes the bad user makes won't save to ... |
Boto randomly connecting to different regions for S3 transfers | 18,366,790 | 0 | 0 | 878 | 1 | python,amazon-web-services,amazon-s3,boto | The problem ended up being an internal billing error at AWS and was not related to either S3 or Boto. | 0 | 0 | 1 | 0 | 2013-08-07T20:42:00.000 | 2 | 0 | false | 18,113,426 | 0 | 0 | 1 | 1 | I have several S3 buckets containing a total of 40 TB of data across 761 million objects. I undertook a project to copy these objects to EBS storage. To my knowledge, all buckets were created in us-east-1. I know for certain that all of the EC2 instances used for the export to EBS were within us-east-1.
The problem ... |
I cannot import beautiful soup on python | 29,046,403 | 3 | 8 | 29,930 | 0 | python,beautifulsoup,python-import | Make sure you give 'B' and 'S' as capital while typing 'BeautifulSoup' | 0 | 0 | 0 | 0 | 2013-08-08T08:50:00.000 | 3 | 0.197375 | false | 18,121,715 | 0 | 0 | 1 | 2 | I installed Beautiful Soup library, and it seems to be well set up as there is the bs4 folder in C:\Python33\Lib\site-packages.
(I changed the name into bs4 before installation, and it went the same after install)
But when I type in from bs4 import beautifulsoup in the code, it says there is no such library.
And I don'... |
I cannot import beautiful soup on python | 57,383,104 | 0 | 8 | 29,930 | 0 | python,beautifulsoup,python-import | If you have a file in the same directory called bs4.py, This is the problem, don't name your files as package names, and btw package names are case-sensitive. | 0 | 0 | 0 | 0 | 2013-08-08T08:50:00.000 | 3 | 0 | false | 18,121,715 | 0 | 0 | 1 | 2 | I installed Beautiful Soup library, and it seems to be well set up as there is the bs4 folder in C:\Python33\Lib\site-packages.
(I changed the name into bs4 before installation, and it went the same after install)
But when I type in from bs4 import beautifulsoup in the code, it says there is no such library.
And I don'... |
Time out issues with chrome and flask | 18,130,320 | 0 | 8 | 13,355 | 0 | python,google-chrome,web-applications,flask | Let's assume:
This is not a server issue, so we don't have to go fiddle with Apache, nginx, etc. timeout settings.
The delay is minutes, not hours or days, just to make the scenario manageable.
You control the web page on which the user hits submit, and from which user interaction is managed.
If those obtain, I'd su... | 0 | 0 | 1 | 0 | 2013-08-08T13:20:00.000 | 3 | 0 | false | 18,127,128 | 0 | 0 | 1 | 1 | I have a web application which acts as an interface to an offsite server which runs a very long task. The user enters information and hits submit and then chrome waits for the response, and loads a new webpage when it receives it. However depending on the network, input of the user, the task can take a pretty long ti... |
Django/Python requirements.txt get always recent package | 18,146,782 | 3 | 1 | 107 | 0 | python,django | Well, this is a bit of a bad idea. The idea of having a requirements.txt is that you can perfectly replicate what you have on the machine you develop on, i.e exactly the environment it works on.
You can do what you want by just not specifying a version number in requirements.txt, but you are better off manually upgradi... | 0 | 0 | 0 | 0 | 2013-08-09T12:26:00.000 | 2 | 0.291313 | false | 18,146,661 | 1 | 0 | 1 | 1 | When I create my requirements.txt I always want it to get the most recent package, without me having to know a version number, how can I do this?
For example I want this to get the latest version of Django:
requirements.txt
Django>=
South==0.7.6 |
OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") | 66,405,102 | 0 | 26 | 101,165 | 1 | python,mysql,django,mysql.sock | I faced this problem when connecting MySQL with Django when using Docker.
Try 'PORT':'0.0.0.0'.
Do not use 'PORT': 'db'. This will not work if you tried to run your app outside Docker. | 0 | 0 | 0 | 0 | 2013-08-09T15:55:00.000 | 5 | 0 | false | 18,150,858 | 0 | 0 | 1 | 3 | when connecting to mysql database in Django ,I get the error.
I'm sure mysql server is running.
/var/run/mysqld/mysqld.sock doesn't exist.
When I run $ find / -name *.sock -type s, I only get /tmp/mysql.sock and some other irrelevant output.
I added socket = /tmp/mysql.sock to /etc/my.cnf. And then restared mysql, exi... |
OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") | 56,762,083 | 0 | 26 | 101,165 | 1 | python,mysql,django,mysql.sock | in flask, you may use that
app=Flask(__name__)
app.config["MYSQL_HOST"]="127.0.0.1
app.config["MYSQL_USER"]="root"... | 0 | 0 | 0 | 0 | 2013-08-09T15:55:00.000 | 5 | 0 | false | 18,150,858 | 0 | 0 | 1 | 3 | when connecting to mysql database in Django ,I get the error.
I'm sure mysql server is running.
/var/run/mysqld/mysqld.sock doesn't exist.
When I run $ find / -name *.sock -type s, I only get /tmp/mysql.sock and some other irrelevant output.
I added socket = /tmp/mysql.sock to /etc/my.cnf. And then restared mysql, exi... |
OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") | 72,389,079 | 0 | 26 | 101,165 | 1 | python,mysql,django,mysql.sock | You need to change your HOST from 'localhost' to '127.0.0.1' and check your django app :) | 0 | 0 | 0 | 0 | 2013-08-09T15:55:00.000 | 5 | 0 | false | 18,150,858 | 0 | 0 | 1 | 3 | when connecting to mysql database in Django ,I get the error.
I'm sure mysql server is running.
/var/run/mysqld/mysqld.sock doesn't exist.
When I run $ find / -name *.sock -type s, I only get /tmp/mysql.sock and some other irrelevant output.
I added socket = /tmp/mysql.sock to /etc/my.cnf. And then restared mysql, exi... |
Python Tornado Websocket Handler blocks while receiving data | 18,156,111 | 0 | 1 | 407 | 0 | python,python-3.x,websocket,tornado | Tornado works well with large amount of short concurrent requests.
It does not split long request into smaller ones. So process blocks.
Why you passing big amount of data using sockets? Final solution depends on answer to this question.
If you don't have big requests too often - just use haproxy in front of multiple t... | 0 | 1 | 0 | 0 | 2013-08-09T21:19:00.000 | 1 | 1.2 | true | 18,155,811 | 0 | 0 | 1 | 1 | I have two pretty simple Tornado-based websocket handlers running in the same process, each of which function properly on their own. However, when one is receiving a large amount of data (>8MB) the process blocks and the other is unable to process messages until all of the data has been received. Is there any way I can... |
Jinja2 template rendering multiple or single file | 18,184,565 | 0 | 0 | 1,032 | 0 | python,templates,flask,jinja2 | There is not any performance loss when using template inheritance,You will have to use it in any projects because of Re-usability.But that does not mean you can indefinitely inherit because it will have file read overheads. | 0 | 0 | 0 | 0 | 2013-08-10T15:48:00.000 | 1 | 0 | false | 18,163,556 | 1 | 0 | 1 | 1 | I just wonder whether single template rendering's performance is better than multiple template rendering's.
What are the cons and pros of single template rendering considering multiple template rendering? |
Convert to virtualenv an existing project by copying site-packages | 18,164,661 | 1 | 0 | 952 | 0 | python | No, you can't. Python packages often have filesystem paths written to various metadata files. Just take the time to go through the site-packages and install the things into a fresh virtualenv, then call pip freeze to get a serialized list that you can use going forward. | 0 | 0 | 0 | 0 | 2013-08-10T17:40:00.000 | 1 | 1.2 | true | 18,164,647 | 1 | 0 | 1 | 1 | I have an old Django project that I want to convert to use virtualenv. If I could copy the current global Python packages to the new env, I think I'd be assured that I'd have the same environment and would save myself some time over creating a requirements file by hand. So, could I just copy the global site-packages co... |
Different Django Interfaces for Different user Groups | 23,327,908 | 0 | 0 | 104 | 0 | python,django,django-models,django-forms,django-templates | I ended up using request.get_host() to provide different interfaces for each subdomain, and check in login for the correct group type of the would-be-logged-in user. | 0 | 0 | 0 | 0 | 2013-08-11T16:37:00.000 | 1 | 1.2 | true | 18,174,212 | 0 | 0 | 1 | 1 | I have different user groups based on functionality: customer support, editors...etc
I want to use the same user system and database, but I want to have different interfaces (login, functionality, sub domain) for the different groups that I have, separate from the normal user website interface and login.
How would you ... |
Templating library in node.js similar to Jinja2 in Python? | 63,772,013 | 1 | 22 | 14,114 | 0 | python,node.js,jinja2,language-comparisons | The ejs is the npm module which you are looking for.
This is the name written in my package.json file --> "ejs": "^3.1.3"
EJS is a simple templating language that lets you generate HTML markup with plain JavaScript.(Credits: Ejs website) | 0 | 0 | 1 | 0 | 2013-08-11T18:49:00.000 | 5 | 0.039979 | false | 18,175,466 | 0 | 0 | 1 | 1 | What would be a node.js templating library that is similar to Jinja2 in Python? |
Why would running scheduled tasks with Celery be preferable over crontab? | 18,190,019 | 49 | 47 | 15,773 | 0 | python,django,celery,django-celery | I've been using cron for a production website, and have switched to celery on a current project.
I'm far more into celery than cron, here is why:
Celery + Celerybeat has finer granularity than cron. Cron cannot run more than once a minute, while celery can (I have a task run every 90 seconds which checks an email queu... | 0 | 1 | 0 | 0 | 2013-08-12T13:05:00.000 | 2 | 1.2 | true | 18,187,751 | 0 | 0 | 1 | 2 | Considering Celery is already a part of the stack to run task queues (i.e. it is not being added just for running crons, that seems an overkill IMHO ).
How can its "periodic tasks" feature be beneficial as a replacement for crontab ?
Specifically looking for following points.
Major pros/cons over crontab
Use cases whe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.