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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Unable to get Python to POST on html | 16,411,935 | 2 | 0 | 299 | 0 | python,html,google-app-engine | You're getting '405 method not allowed' because the POST is going to the same url that served up the page, but the handler for that path (MainPage) does not have a post method.
That's the same diagnosis that you were given when you asked this question two hours earlier under a different user id.
Stepping back further t... | 0 | 0 | 0 | 0 | 2013-05-07T04:19:00.000 | 1 | 0.379949 | false | 16,411,136 | 0 | 0 | 1 | 1 | I've been trying to get my python code to post. I have tried using the Postman Plugin to test the post method and I would get a 405 method error. I am planning to have the user post the information and have it displayed.
Currently if I press submit I would get a error loading page, changing the form to get results in t... |
Managing Django project with mercurial and PyCharm - choosing root folder | 16,415,301 | 2 | 0 | 207 | 0 | python,django,mercurial,pycharm | I assume you use Django >= 1.4. When you create a Django project using this Django version, by default it creates a folder with manage.py and inside it a subfolder with settings.py.
What you should do is to use the folder with manage.py as the root for your PyCharm project and Mercurial repo. This way all your applicat... | 0 | 0 | 0 | 0 | 2013-05-07T06:41:00.000 | 1 | 0.379949 | false | 16,412,763 | 1 | 0 | 1 | 1 | What is best/preferred/right/conventional way:
- Root of repository and PyCharm project = Django project folder with settings.py
- Root of repo and PyCharm project is the parent directory of Django project.
Never used Hg before, and this simple problem is hinder me. |
Django - overriding save/delete functions of the model vs doing it in the view | 16,412,820 | 6 | 1 | 107 | 0 | python,django,django-models,django-views | The general consensus is, thick models and helpers, thin views. In other words, your views should be as simple as possible; your models as rich as possible, and plenty of helper code for the outlying bits.
Also keep in mind that if you override the model methods, you are offering a sort of "guarantee" that no matter ho... | 0 | 0 | 0 | 0 | 2013-05-07T06:41:00.000 | 1 | 1.2 | true | 16,412,772 | 0 | 0 | 1 | 1 | I have a model Quote, which has a foreign key to the user model. A user can have between 0 and 10 quotes, and if there s/he has one or more quotes, one of them should be the primary quote(primary is a field of the Quote model).
When a quote is added by the user, it is checked whether the user has other quotes, if not t... |
Which one is better to create a web application? web2py or cherrypy | 16,431,335 | 1 | 2 | 1,858 | 0 | javascript,python,web2py,cherrypy | web2py is using MVC model and each of the scripts are nicely separated. It can be deployed at pythoneverywhere.com. not too sure about cherrypy. | 0 | 0 | 0 | 1 | 2013-05-08T01:27:00.000 | 2 | 0.099668 | false | 16,431,207 | 0 | 0 | 1 | 1 | I am using Raspberry Pi to function as a mini web server. At first, i came across web2py and started to learn it. It was tough for a beginner like me. Later, a friend in a forum introduced CherryPy to me and i started to work on the web application skeleton that he gave me. Soon, I abandoned web2py and proceeded with c... |
data bridge between Java and Python daemons | 16,444,115 | 1 | 1 | 368 | 0 | java,python,database,distributed-computing,in-memory-database | Given the relatively low volume of data you need, I would say the easiest way would be to use a TCP socket to communicate between the two processes. The data speed on the loopback interface is more than enough for your needs. | 0 | 1 | 0 | 0 | 2013-05-08T05:05:00.000 | 3 | 0.066568 | false | 16,433,047 | 0 | 0 | 1 | 1 | I have two background processes running on linux machine. One is Java and second one is in Python. What would be most efficient way to exchange data between these two apps ? I am talking about text / images data below < 10Mb approx each 5 minutes (not streamed). Due high cost of refactoring we cannot migrate fully to P... |
flask application timeout with amazon load balancer | 17,628,337 | 0 | 7 | 1,897 | 0 | python,flask,gunicorn,werkzeug | The easiest way is to force all connections is to make sure you are using HTTP/1.0 and not adding the header Connection: Keep-Alive to the response.
Please checkout werkzeug.http.remove_hop_by_hop_headers(). | 0 | 0 | 0 | 0 | 2013-05-08T15:09:00.000 | 4 | 0 | false | 16,444,190 | 0 | 0 | 1 | 4 | I'm trying to use a Flask application behind an Amazon Load Balancer and the Flask threads keep timing out. It appears that the load balancer is sending a Connection: keep-alive header and this is causing the Flask process to never return (or takes a long time). With gunicorn in front the processes are killed and new o... |
flask application timeout with amazon load balancer | 17,667,952 | 1 | 7 | 1,897 | 0 | python,flask,gunicorn,werkzeug | Did you remember to set session.permanent = True and app.permanent_session_lifetime? | 0 | 0 | 0 | 0 | 2013-05-08T15:09:00.000 | 4 | 0.049958 | false | 16,444,190 | 0 | 0 | 1 | 4 | I'm trying to use a Flask application behind an Amazon Load Balancer and the Flask threads keep timing out. It appears that the load balancer is sending a Connection: keep-alive header and this is causing the Flask process to never return (or takes a long time). With gunicorn in front the processes are killed and new o... |
flask application timeout with amazon load balancer | 17,648,222 | 8 | 7 | 1,897 | 0 | python,flask,gunicorn,werkzeug | The solution I have now is using gunicorn as a wrapper around the flask application. For the worker_class I am using eventlet with several workers. This combination seems stable and responsive. Gunicorn is also configured for HTTPS.
I assume it is a defect in Flask that causes the problem and this is an effective worka... | 0 | 0 | 0 | 0 | 2013-05-08T15:09:00.000 | 4 | 1.2 | true | 16,444,190 | 0 | 0 | 1 | 4 | I'm trying to use a Flask application behind an Amazon Load Balancer and the Flask threads keep timing out. It appears that the load balancer is sending a Connection: keep-alive header and this is causing the Flask process to never return (or takes a long time). With gunicorn in front the processes are killed and new o... |
flask application timeout with amazon load balancer | 17,656,907 | 0 | 7 | 1,897 | 0 | python,flask,gunicorn,werkzeug | Do you need an HTTP load balancer? Using a layer 4 balancer might just as well solve your problem, because it does not interfere with higher protocol levels. | 0 | 0 | 0 | 0 | 2013-05-08T15:09:00.000 | 4 | 0 | false | 16,444,190 | 0 | 0 | 1 | 4 | I'm trying to use a Flask application behind an Amazon Load Balancer and the Flask threads keep timing out. It appears that the load balancer is sending a Connection: keep-alive header and this is causing the Flask process to never return (or takes a long time). With gunicorn in front the processes are killed and new o... |
How to run Three different websites in single Django project | 16,456,275 | 1 | 1 | 84 | 0 | python,django | I have tried your scenario...I have included a flag variable to settings.py you can set flag values to 1,2 or 3 and based on the flag values you can then load templates and static DIR...then you can use same views.py,urls.py,models.py....but make sure you use the app's DB file for the all three websites but name can be... | 0 | 0 | 0 | 0 | 2013-05-08T16:36:00.000 | 1 | 1.2 | true | 16,445,795 | 0 | 0 | 1 | 1 | I want to run Three websites in single Django project...
Site_1,Site_2,Site_3 has same models.py,same views.py and same urls.py file..
But different sqlite.db file..different template Dir.will it be possible to run sites under this scenario |
Any advantage of using node.js for task queue worker instead of other languages? | 16,471,242 | 0 | 2 | 1,154 | 0 | php,python,ruby,node.js,redis | I have used Node.js for task worker for jobs that call runnable webpages written in PHP or running commands on certain hosts. In both these instances Node is just initializing (triggering) the job, waiting for and then evaluating the result. The heavy lifting / CPU intensive work is done by another system / program.
Ho... | 0 | 1 | 0 | 1 | 2013-05-09T07:31:00.000 | 2 | 0 | false | 16,456,682 | 0 | 0 | 1 | 1 | Will i have any advantage of using Node.js for task queue worker instead of any other language, like PHP/Python/Ruby?
I want to learn Redis for simple task queue tasks like sending big ammounts of email and do not want keeping users to wait for establishing connection etc.
So the questions is: does async nature of node... |
Can't connect to localhost:8080 when trying to run Google App Engine program | 18,885,291 | 1 | 1 | 10,838 | 0 | google-app-engine,python-2.7 | I have to manually start python and make it point to my app folder, for instance in a command line window on Windows I am using python. I installed python in C:\Python27 and my sample app is in c:\GoogleApps\guestbook
C:\Python27>dev_appserver.py c:\GoogleApps\guestbook
and then I can start my app in the Google App En... | 0 | 1 | 0 | 0 | 2013-05-10T02:00:00.000 | 5 | 0.039979 | false | 16,474,027 | 0 | 0 | 1 | 2 | I'm trying to run the Google App Engine Python 2.7 Hello World program and view it in a browser via Google App Engine Launcher. I followed the install and program instructions to the letter. I copied and pasted the code in the instructions to the helloworld.py file and app.yam1 and verified that they are correct and in... |
Can't connect to localhost:8080 when trying to run Google App Engine program | 18,226,152 | 1 | 1 | 10,838 | 0 | google-app-engine,python-2.7 | I had the same problem. This seemed to fix it:
cd to google_appengine, run
python dev_appserver.py --port=8080 --host=127.0.0.1 /path/to/application
at this point there is a prompt to allow updates on running, I said Yes.
At this point the app was running as it should, also when I quit this and went in using the launch... | 0 | 1 | 0 | 0 | 2013-05-10T02:00:00.000 | 5 | 0.039979 | false | 16,474,027 | 0 | 0 | 1 | 2 | I'm trying to run the Google App Engine Python 2.7 Hello World program and view it in a browser via Google App Engine Launcher. I followed the install and program instructions to the letter. I copied and pasted the code in the instructions to the helloworld.py file and app.yam1 and verified that they are correct and in... |
How to count the threads and process of WSGI? | 16,480,852 | 2 | 3 | 1,298 | 0 | multithreading,wsgi,python-multithreading | You mean why do you have 3 extra per mod_wsgi daemon process.
For your configuration, 15 new threads will be created for handling the requests. The other 3 in a process are due to:
The main thread which the process was started as. It will wait until the appropriate signal is received to shutdown the process.
A monitor... | 0 | 1 | 0 | 0 | 2013-05-10T09:35:00.000 | 1 | 1.2 | true | 16,479,249 | 0 | 0 | 1 | 1 | I have deployed a wsgi application on the apache and I have configured it like this:
WSGIDaemonProcess wsgi-pcapi user= group= processes=2 threads=15
After I restart the apache I am counting the number of threads:
ps -efL | grep | grep -c httpd
The local apache is running only one wsgi app but the number I get back is... |
How can I find out which line of code is leaving a file open? | 16,488,072 | 0 | 1 | 88 | 0 | python,django | Are you depending on the garbage collector to close your files? I.E. the handle goes out of scope and even though you've "closed" the file, it won't go away until GC runs. If the object chain never goes out of scope, GC cannot collect it. Also, if GC does not get an opportunity to run, they won't be collected either.
I... | 0 | 0 | 0 | 0 | 2013-05-10T17:34:00.000 | 2 | 0 | false | 16,487,863 | 0 | 0 | 1 | 1 | I recently got an exception on my server about "Too many open files". I checked lsof, and sure enough, there are a bunch of PDF files that remain open (all in the same directory). This particular file is managed through a Django FileField. I've tried to track down any places in my project that explicitly open the file ... |
Using an alternate Scripting Language to be interpreted by the browser instead of Javascript | 16,503,582 | 0 | 0 | 392 | 0 | javascript,python,ruby,browser | One of the reasons you don't find browsers supporting languages like Ruby or Python, is because of the user's security. JavaScript was originally embedded in browsers for convenience, but, because that was an established relationship, as security issues occurred, JavaScript was locked down, as was the browser, to remov... | 0 | 0 | 0 | 0 | 2013-05-12T01:10:00.000 | 3 | 0 | false | 16,503,242 | 0 | 0 | 1 | 1 | Can a scripting language like Python or Ruby replace Javascript as the browser's interpreted language so that we could be writing .py or .rb files instead of .js for frontend work? If so, would that be a good idea? If not, why? If it's a good idea, why isn't it done that way? If Python/Ruby can't replace JS in the brow... |
Running a Python interpreter from Rails | 16,525,800 | 0 | 3 | 73 | 0 | python,ruby-on-rails | Right now I am using Flask with localtunnel. It works. | 0 | 0 | 0 | 0 | 2013-05-12T05:26:00.000 | 1 | 0 | false | 16,504,470 | 0 | 0 | 1 | 1 | I have a webapp that is built in Rails, but I'm working with graphs and Python has far better graph libraries (namely, Graph-Tool). There are on the order of 10k lines of code written already, so it would be a hassle to switch to Django. However, the work I'm doing involves querying very, very large graphs, ones that w... |
Using Extensions with Selenium (Python) | 61,971,091 | 1 | 24 | 52,452 | 0 | python,google-chrome,selenium,selenium-webdriver | I also needed to add an extention to chrome while using selenium. What I did was first open the browser using selenium then add extention to the browser in the normal way like you would do in google chrome. | 0 | 0 | 1 | 0 | 2013-05-12T19:49:00.000 | 6 | 0.033321 | false | 16,511,384 | 0 | 0 | 1 | 1 | I am currently using Selenium to run instances of Chrome to test web pages. Each time my script runs, a clean instance of Chrome starts up (clean of extensions, bookmarks, browsing history, etc). I was wondering if it's possible to run my script with Chrome extensions. I've tried searching for a Python example, but not... |
Formencode and empty values | 16,554,536 | 0 | 0 | 430 | 0 | python,formencode | I ended up moving from FormEncode to WTForms and everything is now a whole lot easier. Seems to me like Formencode wasn't very well thought out. | 0 | 0 | 0 | 0 | 2013-05-13T05:20:00.000 | 2 | 1.2 | true | 16,515,314 | 0 | 0 | 1 | 1 | How can I write a custom validator which is always executed, even when the user has submitted an empty or missing value?
I've tried overriding the to_python, validate_python, _to_python, _validate_python (and more) methods but none of these seem to get run if the user has submitted an empty or None value |
How to get tests coverage using Django, Jenkins and Sonar? | 19,887,503 | 0 | 4 | 6,621 | 0 | python,django,jenkins,code-coverage,sonarqube | On Jenkins I found that coverage.xml has paths that are relative to the directory in which manage.py jenkins is run.
In my case I need to run unit tests on a different machine than Jenkins. To allow Sonar to use the generated coverage.xml, it was necessary for me to run the tests from a folder in the same spot relative... | 0 | 0 | 0 | 1 | 2013-05-13T08:46:00.000 | 3 | 0 | false | 16,518,002 | 0 | 0 | 1 | 1 | I'm trying to get test unit coverage with Sonar. To do so, I have followed these steps :
Generating report with python manage.py jenkins --coverage-html-report=report_coverage
Setting properties in /sonar/sonar-3.5.1/conf/sonar.properties:
sonar.dynamicAnalysis=reuseReports
sonar.cobertura.reportPath=/var/lib/jenkins... |
How can i remove the GET parameters from url in django | 16,518,803 | 6 | 1 | 3,872 | 0 | python,django | The whole point of GET is that they are retrieved from the URL itself, removing them from the URL removes them entirely.
If you want them 'hidden' you will need to use POST. | 0 | 0 | 0 | 0 | 2013-05-13T09:26:00.000 | 2 | 1 | false | 16,518,733 | 0 | 0 | 1 | 1 | I have the form which i am showing by normal view. Then i am send the GET parameters to djnago ChangeList view like django does for lookups like this
student/?region__id__exact=1&status__exact=Published
now is there any way to remove that from the URL in the address bar.
I don't users to see what i am doing |
How to find out if an image is loaded? | 16,520,285 | 0 | 0 | 195 | 0 | python,django,image,django-views | This can be only by serving your images with your custom views. E.g you should write your own view that will return static resources, and you will not use a standard django static handler | 0 | 0 | 0 | 0 | 2013-05-13T10:08:00.000 | 5 | 0 | false | 16,519,506 | 0 | 0 | 1 | 2 | I have a django project which is running (for example) on localhost:8000.
I have an image in this address localhost:8000/static/test.jpg . A user may open just this image by going to it's url and not open the containing page.
I want to find out if this image is loaded in a user's browser (by loading the containing page... |
How to find out if an image is loaded? | 16,767,630 | 0 | 0 | 195 | 0 | python,django,image,django-views | Your way goes fine but bot for a high traffic. In that case you can use XSendFile library witch works with Apache | 0 | 0 | 0 | 0 | 2013-05-13T10:08:00.000 | 5 | 0 | false | 16,519,506 | 0 | 0 | 1 | 2 | I have a django project which is running (for example) on localhost:8000.
I have an image in this address localhost:8000/static/test.jpg . A user may open just this image by going to it's url and not open the containing page.
I want to find out if this image is loaded in a user's browser (by loading the containing page... |
Writing to file with SL4A Python | 16,633,755 | 0 | 1 | 1,062 | 0 | android,python,sl4a | Ok, so I was silly to look for a droid command to write files.
The standard Python open, write, read, close commands work fine. | 0 | 0 | 1 | 0 | 2013-05-13T12:49:00.000 | 1 | 1.2 | true | 16,522,493 | 0 | 0 | 1 | 1 | Is there an API call for opening, reading and writing to text files on an Android device using SL4A and Python?
If not, what options are available for persistent storage?
e.g. database, preferences, dropbox, google drive. |
Django-allauth loads wrong base.html template | 39,067,085 | 1 | 9 | 2,348 | 0 | python,django,django-allauth | Allauth tries to extend myproject/templates/base.html. The easiest ways are to move base.html to myproject/templates/site/ in order to get myproject/templates/site/base.html or simply rename base.html | 0 | 0 | 0 | 0 | 2013-05-13T15:58:00.000 | 6 | 0.033321 | false | 16,526,314 | 0 | 0 | 1 | 3 | I've been trying to get django-allauth working for a couple days now and I finally found out what was going on.
Instead of loading the base.html template that installs with django-allauth, the app loads the base.html file that I use for the rest of my website.
How do i tell django-allauth to use the base.html templ... |
Django-allauth loads wrong base.html template | 16,526,472 | 7 | 9 | 2,348 | 0 | python,django,django-allauth | Unless called directly, your base.html is an extension of the templates that you define.
For example, if you render a template called Page.html - at the top you will have {% extends "base.html" %}.
When defined as above, base.html is located in the path that you defined in your settings.py under TEMPLATE_DIRS = () - wh... | 0 | 0 | 0 | 0 | 2013-05-13T15:58:00.000 | 6 | 1.2 | true | 16,526,314 | 0 | 0 | 1 | 3 | I've been trying to get django-allauth working for a couple days now and I finally found out what was going on.
Instead of loading the base.html template that installs with django-allauth, the app loads the base.html file that I use for the rest of my website.
How do i tell django-allauth to use the base.html templ... |
Django-allauth loads wrong base.html template | 53,967,402 | 2 | 9 | 2,348 | 0 | python,django,django-allauth | All of the answers provided force you to rewrite files and modify your own project to fit in with allauth, which is a completely unacceptable workflow. Such a third-party application should not have such manipulative power over your own project.
Truly, the easiest way to handle this situation, especially based on the ... | 0 | 0 | 0 | 0 | 2013-05-13T15:58:00.000 | 6 | 0.066568 | false | 16,526,314 | 0 | 0 | 1 | 3 | I've been trying to get django-allauth working for a couple days now and I finally found out what was going on.
Instead of loading the base.html template that installs with django-allauth, the app loads the base.html file that I use for the rest of my website.
How do i tell django-allauth to use the base.html templ... |
Python - Can a web server avoid imporing for every request? | 16,538,939 | 3 | 1 | 216 | 0 | python,django,import,request,nlp | Django, under most deployment mechanism, does not import modules for every request. Even the development server only reloads code when it changes. I don't know how you're verifying that all the imports are re-run each time, but that certainly shouldn't be happening. | 0 | 0 | 1 | 0 | 2013-05-13T22:39:00.000 | 1 | 1.2 | true | 16,532,314 | 0 | 0 | 1 | 1 | I'm working on a Python project, currently using Django, which does quite a bit of NLP work in a form post process. I'm using the NLTK package, and profiling my code and experimenting I've realised that the majority of the time the code takes is performing the import process of NLTK and various other packages. My quest... |
Should I store static files (photos) local or in the cloud? | 16,565,006 | 2 | 0 | 128 | 0 | python,django,cloud-hosting,photo-gallery | Pros:
You don't have to pay extra for your S3 servers after it crosses the 20GB limit.
Cons
Your server will slow down as it will not be able to take the load after certain limit.
Performance of the server will go down, in worst case your servers may crash.
Your node will also have limit on the disk space, which you... | 0 | 0 | 0 | 0 | 2013-05-15T12:16:00.000 | 1 | 0.379949 | false | 16,564,791 | 0 | 0 | 1 | 1 | I have this small app in Django, hosted on cheap linode. We want to add photo-sharing functionality so I am wondering should I put all user uploaded static photo files locally on linode serwer or it is better to use Amazon S3 or similar cloud soulution ?
What are pros and cons of both solutions ? |
Are ModelForms in django used only for POSTing? | 16,568,130 | 0 | 0 | 84 | 0 | python,django,django-models,django-forms | ModelForms are for creating/updating objects. Authentication doesn't modify the model instance (the User), therefore use a normal form instead.
From the docs:
The save() method
Every form produced by ModelForm also has a save() method. This method
creates and saves a database object from the data bound to the form. ... | 0 | 0 | 0 | 0 | 2013-05-15T14:26:00.000 | 1 | 1.2 | true | 16,567,751 | 0 | 0 | 1 | 1 | ModelForms are a nice way to prevent repeating the definitions of models one creates. What I would like to do is take advantage of that feature and use it for more than just processing POST requests. I use forms a lot for validation.
Example:
Say you have a User model with the fields (email, password, first_name, last_... |
Extracting Visual Event 2 output into script | 16,579,794 | 0 | 0 | 67 | 0 | javascript,python,ruby,perl | There is no way to accomplish this very oddly specific task without digging through the code, although this isn't as hard as it seems considering it's quite legible and easy to build on your own system, even if you don't have any previous experience with JavaScript. | 0 | 0 | 0 | 1 | 2013-05-16T01:43:00.000 | 1 | 1.2 | true | 16,577,725 | 0 | 0 | 1 | 1 | In the Visual Event description, it says that it extracts "which elements have events attached to them". I can confirm this by running the bookmarklet and seeing all the colour highlights.
I would like to extract this information without the fancy presentation so that I can play around with it into a script (Ruby/Pytho... |
Need to extract data from website and push to a program | 16,578,621 | 0 | 0 | 225 | 0 | python,web-crawler | Well you should probably start by learning the language in general it would make it alot easier to do
but for the Web stuff you can use something called urllib and urllib2 these can open up the browser to get the data without actually opening the window
also there are a few automated web browsers like selenium which a... | 0 | 0 | 1 | 0 | 2013-05-16T03:30:00.000 | 2 | 1.2 | true | 16,578,545 | 0 | 0 | 1 | 1 | So i've been looking around trying to figure out how i could extract some specific data such as just the text, and push that data into a program that organizes the data.
So if you took homedepot.com for example and wanted to extract from each item listed under "2x4 wood" and from each item you are needing to grab the ... |
how to invoke python script in jsp/servlet? | 16,597,278 | 0 | 0 | 1,132 | 0 | python,html,jsp,beautifulsoup | I assume you are talking about web scraping which is pulling information from other websites.
You are not going to be able to do something like this in somebody's browser because it violates Javascript's same origin policy, AND there is no way a browser is going to let you download and execute a script on a client's co... | 0 | 0 | 0 | 0 | 2013-05-16T20:45:00.000 | 1 | 0 | false | 16,597,149 | 0 | 0 | 1 | 1 | I am trying to invoke a python code for screen scraping (using Beautiful Soup) from my jsp servlet. Or it would also work if it can be directly invoked from the HTML.
Looked through few threads but couldn't get any solution.
What I want is to give the python program some arguments and want it to do some screen scrappin... |
Upload files via email in Django. General algorithm | 16,599,805 | 1 | 1 | 99 | 0 | python,django,email,django-email | Are you trying to read from a mailbox and write the information into the database? If so, then you want to:
1) Open a connection to the mail server using poplib or imaplib from the standard library
2) Retrieve messages from the server (again with poplib or imaplib)
3) Parse the messages with the email package from the... | 0 | 0 | 0 | 0 | 2013-05-16T21:23:00.000 | 1 | 1.2 | true | 16,597,739 | 0 | 0 | 1 | 1 | How to implement something like this:
If someone send email with file in attachment to system@mail.com, this file is added automatically to database.
Please general algorithm how to do or suggest existing app |
Azure - Running an http server on an VM | 16,604,662 | 0 | 1 | 453 | 0 | python,azure,azure-virtual-machine | Could it be that port 81 is blocked by firewall in Ubuntu? | 0 | 1 | 0 | 0 | 2013-05-17T08:10:00.000 | 1 | 0 | false | 16,604,372 | 0 | 0 | 1 | 1 | I have created a VM on Windows Azure with Ubuntu 12.04 running on it.
I have two end-points
End-point1
public port: 50348
private port: 22
End-point2
public port: 81
private port: 81
Now, I have a simple python HTTP server running on the Virtual Machine, which is listening on port 81.
When I try to connect to localho... |
Splice 2 PDF pages into one with Python | 16,631,012 | 0 | 0 | 255 | 0 | python,pdf-generation | Turns that Adobe's reader has a "Booklet" option in the printing options. Worked out nicely. | 0 | 0 | 0 | 0 | 2013-05-19T01:12:00.000 | 1 | 0 | false | 16,630,537 | 0 | 0 | 1 | 1 | I'm trying to write a novel and I am trying to print out my own book prototypes.
I have a PDF of the book. Now I want to merge the pages so that I can print it double-sided, fold it in half, and staple it like a boss.
The problem I need to solve is how to splice 2 pages together with a left and right side. I looked at ... |
web2py on a Virtual Machine | 16,634,500 | 1 | 0 | 169 | 0 | python,web2py | Can you share the error details? If you can't access the error dump file via the admin app, use some other tool to view the file under ...web2py/theapp/errors. The file format isn't easily readable, but the last few lines are usually pretty informative. | 0 | 0 | 0 | 0 | 2013-05-19T02:26:00.000 | 1 | 0.197375 | false | 16,630,885 | 0 | 0 | 1 | 1 | I have a web2py app I developed on my local machine. I tried to move the application to a Windows Server 2003 Virtual Machine but when I run it on the VM the app simply errors out on start up and when I click to see the error it prompts me for the admin password. When I enter it, the app errors again. There are no erro... |
Cannot scrape with beautifulsoup and urllib because of javascript variable | 23,974,667 | 1 | 0 | 169 | 0 | javascript,python,beautifulsoup,urllib2 | I came back after a long time just to answer quickly my own question..
I found many solutions and tutorials on the web and most of them were suggesting using Selenium and xpath but this method was more complex than I needed..
So I ended up using Selenium ONLY for emulating the Browser (firefox in my case) and grabbing ... | 0 | 0 | 1 | 0 | 2013-05-19T18:12:00.000 | 1 | 1.2 | true | 16,637,879 | 0 | 0 | 1 | 1 | Unfortunately I am newbie with beautifulsoup and urllib so I might not even ask correctly what I need..
There is a website www.example.com
I need to extract some data from this website which displays a random message.
The problem is the message is displayed after the user presses a button, otherwise it shows a general... |
Looking for techniques to debug external Python Flask Extensions | 16,696,027 | 0 | 1 | 145 | 0 | python,flask,flask-extensions,flask-security | I'm going to just answer my own question and say the best/easiest thing to do is just pull the extensions code into my project and modify as I need it.
Seems like this will be the case with several Flask-extensions that involve more view/template code than pure infrastructure (like flask-security/flask-login, etc.) | 0 | 0 | 0 | 0 | 2013-05-20T13:01:00.000 | 1 | 1.2 | true | 16,650,124 | 0 | 0 | 1 | 1 | I'm using several third party flask-extensions (flask-login, flask-security, flask-principal, flask-mongoengine etc...the list is about 12 deep) in an application that is failing silently in production environment (currently AppFog Paas)
I'm specifically trying to debug an issue with flask-security (I "think", but it c... |
Unit testing Cherrypy HTTPRedirect. | 16,652,717 | 0 | 0 | 190 | 0 | python,cherrypy,nose,nosetests | With python unit tests, you are basically testing the server. And the correct response from server is the redirect exception and not the redirected page itself. I would recommend you testing this behaviour in two steps:
test if the first page/url throws correctly initialized (code, url) HTTPRedirect exception
test con... | 0 | 0 | 1 | 1 | 2013-05-20T15:01:00.000 | 1 | 1.2 | true | 16,652,406 | 0 | 0 | 1 | 1 | I’m writing a cherrypy application that needs to redirect to a particular page and I use HTTPRedirect(‘mynewurl’, status=303) to achieve this. This works inasmuch as the browser (Safari) redirects to ‘mynewurl’ without asking the user. However, when I attempt to unit test using nosetests with assertInBody(), I get a ... |
PHP cURL vs Python Scrapy? | 16,659,313 | 3 | 0 | 1,634 | 0 | php,python,scrapy | Scrapy is a framework. You can define pipelines and systematic ways of crawling a URL; cURL is simply boiler plate code to query a page or download files over a protocol like HTTP.
If you are building an extensive scraping system or project, Scrapy is probably a better bet. Otherwise for hacky or one time things, cURL... | 0 | 0 | 1 | 0 | 2013-05-20T18:13:00.000 | 1 | 0.53705 | false | 16,655,681 | 0 | 0 | 1 | 1 | I've been into scraping websites data using Python Scrapy although I have a strong experience in PHP cURL. I don't know which is better for scraping data and manipulating the returned values and the speed and the memory usage.
And what is (yield) function in Python Scrapy supposed to do? |
How can I programmatically interact with a website that uses an AJAX JBoss RichTree component? | 16,662,103 | 1 | 0 | 601 | 0 | python,ajax,jboss,richfaces,screen-scraping | You need to make the AJAX calls from your client to the server and interpret the data. Interpreting the AJAX data is easier and less error-prone than scraping HTML any way.
Although it can be a bit tricky to figure out the AJAX API if it isn't documented. A network sniffer tool like wireshark can be helpful there, the... | 0 | 0 | 1 | 0 | 2013-05-21T03:48:00.000 | 2 | 0.099668 | false | 16,661,801 | 0 | 0 | 1 | 1 | I'm writing a python script to do some screen scraping of a public website. This is going fine, until I want to interact with an AJAX-implemented tree control. Evidently, there is a large amount of javascript controlling the AJAX requests. It seems that the tree control is a JBoss RichFaces RichTree component.
How shou... |
IntelliJ 12 Python - Issues with manage.py Tasks | 16,706,964 | 4 | 2 | 1,462 | 0 | python,intellij-idea,pycharm,manage.py | Okay, so apparently the culprit is the IntelliJ IDEA Project Creation Wizard.
If you create a new project within PyCharms and choose Django Project as desired Project type, it just works. You don't have to configure anything else.
To do this in IntelliJ IDEA, create a new Project, choose "Python Module" as type and che... | 0 | 0 | 0 | 0 | 2013-05-21T07:46:00.000 | 1 | 1.2 | true | 16,664,714 | 0 | 0 | 1 | 1 | I'm currently looking for a nifty Python/Django IDE and came across PyCharm from JetBrains which I tested for about a week now and I'm quite impressed by this piece of software.
However, I've read that IntelliJ Ultimate with JetBrains own Python Plugin offers about the same Features as PyCharm itself, so I went ahead a... |
How to get google ID from email | 16,673,012 | 2 | 1 | 1,883 | 0 | python,google-app-engine,authentication,google-plus | First of all you should store the email property always in lowercase since the case is not relevant. Now if you also want to take into the account the dot or the plus symbols and being able to query on them, you should then store in another (hidden) property the stripped out version of the email and execute your querie... | 0 | 1 | 0 | 0 | 2013-05-21T14:43:00.000 | 2 | 1.2 | true | 16,672,846 | 0 | 0 | 1 | 1 | I'm using google ID as the datastore id for my user objects.
Sometimes I want to find a user by email. The gmail address can appear with dots or without, capital letters and other variations. How can I retrieve the user id from the given email? |
Executing a Python Script when Web Page is loaded | 16,698,568 | 0 | 0 | 4,778 | 0 | javascript,python,html,web | I had to do this too. I had a python script(which gets me data from another website) which gets executed when you click on a button.
I used Ruby on Rails for my client side code. I embedded the script file in my ruby controller which then gets called by my form and hence it gets executed.
eg:
cmd = " python getData.py... | 0 | 0 | 0 | 0 | 2013-05-22T17:36:00.000 | 2 | 0 | false | 16,698,220 | 0 | 0 | 1 | 1 | I'm trying to have it so that when my web page is loaded, a python script is executed. The website is run on an apache server and the script is in the same directory as the index.html (it's a very small project).
Is there anyway I can do this? I'm not trying to output the data from the python file to the webpage, nor a... |
Google App Engine import NLTK error | 16,700,974 | 0 | 0 | 423 | 0 | google-app-engine,python-2.7,nltk | Where do you have nltk installed?
GAE libraries need to be available in your app folder. If you have nltk elsewhere in your pythonpath it won't work. | 0 | 1 | 0 | 0 | 2013-05-22T17:38:00.000 | 1 | 0 | false | 16,698,260 | 0 | 0 | 1 | 1 | I am trying to import NLTK library in Google App Engine it gives error, I created another module "testx.py" and this module works without error but I dont know why NLTK does not work.
My code
nltk_test.py
import webapp2
import path_changer
import testx
import nltk
class MainPage(webapp2.RequestHandler):
def get... |
Django "Table already exists" on testing | 50,297,908 | 0 | 1 | 2,226 | 0 | python,django,python-2.7 | you should use python manage.py migrate app_name rather than python manage.py migrate.Because you had used it before | 0 | 0 | 0 | 0 | 2013-05-22T17:40:00.000 | 2 | 0 | false | 16,698,296 | 0 | 0 | 1 | 1 | I've tried to solve the following issue:
I'm running python manage.py test to test my application.
After creating a new test_app database, I'm getting
DatabaseError: (1050, "Table 'auth_group' already exists")
I haven't installed South (it's not on the INSTALLED_APPS list), how do I solve this? |
django select app(s) for syncdb | 34,055,679 | 0 | 0 | 2,970 | 0 | python,django,django-syncdb,syncdb,django-manage.py | This seems to work - python manage.py syncdb --database=NEW_APP_DB | 0 | 0 | 0 | 0 | 2013-05-22T19:56:00.000 | 4 | 0 | false | 16,700,526 | 0 | 0 | 1 | 1 | First of all: please don't ask me: "Why would you need this?".
Now the question itself: I have several applications installed in INSTALLED_APPS. Database is now empty and I want to synchronise only some of apps. What's the simplest way to do this?
I know I can write my custom management command based on syncdb. But it'... |
optimizing google protocol buffer | 19,603,923 | 0 | 2 | 1,004 | 0 | java,python,protocol-buffers | Unfortunately the Python protobuf deserialization is just pretty slow (as of 2013) compared to the other languages. | 0 | 1 | 0 | 0 | 2013-05-22T20:01:00.000 | 2 | 0 | false | 16,700,600 | 0 | 0 | 1 | 1 | I'm new to google's protocol buffers and looking into some insight. I have a large object that is serialized in java which I am de-serializing in python. The upstream tells me that the file is serialized in about 4 to 5 seconds. Where it takes me 37 seconds to de-serialize. Any ideas on why it is such a huge difference... |
Using Scrapy DjangoItem with Django best way | 16,755,838 | 2 | 3 | 896 | 0 | django,python-2.7,scrapy | I generally put my scrapy project somewhere inside my Django project root folder. Just remember you will need to make sure both projects are in the python path. This is easy to do if you are using virtualenv properly.
Aside from that as long as you can import your Django models from Scrapy i think everything else in th... | 0 | 0 | 0 | 0 | 2013-05-22T20:28:00.000 | 1 | 1.2 | true | 16,701,027 | 0 | 0 | 1 | 1 | I am am new to Django / Scrapy and well to programming in general. I am trying to make a Django site to help me learn.
What I want to do is Scrape product information from different sites and store them in my postgres database using DjangoItem from Scrapy.
I have read all the docs from both Scrapy and Django. I have ... |
How can I load data files in a Jython module? | 16,947,188 | 0 | 4 | 739 | 0 | java,python,jython | Maybe I'm just missing the point, but can't you use getResourceAsStream() on a Java class? | 0 | 0 | 0 | 0 | 2013-05-22T21:19:00.000 | 3 | 0 | false | 16,701,764 | 1 | 0 | 1 | 1 | I have some Jython modules that I'm trying to make work from within a JAR. Everything is set up fine except that some modules expect to open files from the filesystem that are located in the same directory as the Python script itself. This doesn't work anymore because those files are now bundled into the JAR.
Basical... |
What's the Google App Engine equivalent of ASP.NET's Server.Transfer? | 16,705,889 | 0 | 0 | 210 | 0 | python,google-app-engine,webapp2 | Usually, you just have to call the corresponding method.
For being more specific... Which flavour of AppEngine are you using? Java, Python, Go... Php? | 0 | 1 | 0 | 0 | 2013-05-23T04:29:00.000 | 3 | 0 | false | 16,705,684 | 0 | 0 | 1 | 1 | Server.Transfer is sort of like a Redirect except instead of requesting the browser to do another page fetch, it triggers an internal request that makes the request handler "go to" another request handler.
Is there a Python equivalent to this in Google App Engine?
Edit: webapp2 |
Viewing a django-cms page via the slug | 16,723,428 | 0 | 0 | 581 | 0 | python,django,django-cms | After digging through the code, I discovered that django-cms doesn't actually expose pages via their slug unless they're created UNDER a home page. The code that looks up a page via their slug looks in the cms_title table, and it stores '' for the slug for any page that's not a child. Very unintuitive, but after I re-c... | 0 | 0 | 0 | 0 | 2013-05-23T18:04:00.000 | 2 | 1.2 | true | 16,720,883 | 0 | 0 | 1 | 2 | How do you view a published django-cms page using a path that incorporates the slug?
I installed django-cms without error, and I can view the default cms homepage just fine. I created and published a simple "About" page with the slug "about", but when I visit http://localhost:8000/about/ I get a 404 error. I can see th... |
Viewing a django-cms page via the slug | 16,721,162 | 0 | 0 | 581 | 0 | python,django,django-cms | you won't get access until you check the published in cms page list view in admin.
View on site help with a preview before page is published. | 0 | 0 | 0 | 0 | 2013-05-23T18:04:00.000 | 2 | 0 | false | 16,720,883 | 0 | 0 | 1 | 2 | How do you view a published django-cms page using a path that incorporates the slug?
I installed django-cms without error, and I can view the default cms homepage just fine. I created and published a simple "About" page with the slug "about", but when I visit http://localhost:8000/about/ I get a 404 error. I can see th... |
Does GoogleAppEngine(Python SDK) disturb GoogleAppEngine(PHP SDK)? | 17,073,068 | 0 | 0 | 209 | 0 | php,python,google-app-engine | Thanks very much, hakre. I know what happened. The problem is I also have a python version Google-App-Engine.Thus, I need to specify the "development server" to GAE-PHP-SDK and it works well now!! Thanks again, I think I will deliver such a kindness to others in the future. – moshaholo May 26 at 12:16
Can any one tell ... | 0 | 1 | 0 | 0 | 2013-05-24T14:25:00.000 | 1 | 0 | false | 16,737,308 | 0 | 0 | 1 | 1 | The new launched GoodleAppEngine(PHP Version) does not work on my computer.
Every time I type in "localhost:8080", the running server returns me a "GET / HTTP/1.1" 500".
And it give me a fatal ERROR:
Fatal error: require_once(): Failed opening required
'google/appengine/runtime/ApiProxy.php'
(include_path='/Users/... |
Beautiful Soup "not supported" Google App Engine | 16,737,623 | 0 | 0 | 1,031 | 0 | python,google-app-engine,beautifulsoup | It seems uploading the whole directory where the bs4 module resides in to the GAE app folder would work. | 0 | 1 | 0 | 0 | 2013-05-24T14:29:00.000 | 2 | 0 | false | 16,737,386 | 0 | 0 | 1 | 1 | I am working in python on a GAE app. Beautiful soup, which the app uses, works fine on my dev server locally. When I try and upload it to google's servers however, I get the following error: "Error parsing yaml file: the library "bs4" is not supported".
I am not sure how to fix this. Does anyone have any idea?
Thank yo... |
How to add multitouch support for ChromeEmbeddedFramework browser on windows 8? | 16,913,113 | 0 | 1 | 652 | 0 | python,windows-8,multi-touch,chromium-embedded | The problem was fixed by using CEF3 rather than CEF1 | 0 | 0 | 1 | 0 | 2013-05-24T14:58:00.000 | 1 | 1.2 | true | 16,737,962 | 0 | 0 | 1 | 1 | I 've develooped a basic custom browser with CEF (Chromium Embedded Framework) Python . This browser is meant to run into an interactive kiosk with windows 8. It has a multi-touch screen for all user interactions.
If I run Google Chrome on the machine, the multi-touch gestures (scroll and virtual keyboard) are supporte... |
Unable to write code in pydev for django project | 16,835,207 | 0 | 7 | 136 | 0 | python,django | try to restart development server | 0 | 0 | 0 | 0 | 2013-05-26T12:54:00.000 | 3 | 0 | false | 16,759,430 | 0 | 0 | 1 | 1 | I am just the beginner in django. I use pydev eclipse in windows 8. First I write a "Hello World " program and display the string in browser but when I changed the code the change in the output is not appear. Whatever I change nothing change in output. But when I close the eclipse and shutdown the computer and restart ... |
Concurrency doubts in Django | 16,771,514 | 4 | 3 | 1,239 | 0 | python,django,concurrency | Its webserver specific. If you configure it to run in different process, request will be handled in new process. If you configure to have threads it will be in threads.
Yes. Imagine case when, user1 is viewing/editing a object A (retrieved from DB). user2 deletes that object. And then user1 tries to save it. You need t... | 0 | 0 | 0 | 0 | 2013-05-27T10:42:00.000 | 2 | 1.2 | true | 16,771,391 | 0 | 0 | 1 | 1 | I'm developing a website with Django 1.5.1 and I have two doubts regarding concurrence. Now I'm runing on the development server.
When multiple users access the website at the same time, by default, does Django run each request in a different execution thread? Or must it be configured in the webserver e.g. Apache?
Wil... |
A way to optimize reading from a datastore which updates once a day | 16,775,062 | 1 | 1 | 53 | 1 | python,django,google-app-engine | Your total amout of data is very small and looks like a dict. Why not save it (this object) as a single entry in the database or the blobstore and you can cache this entry. | 0 | 1 | 0 | 0 | 2013-05-27T13:08:00.000 | 1 | 1.2 | true | 16,773,961 | 0 | 0 | 1 | 1 | I am running my Django site on appengine. In the datastore, there is an entity kind / table X which is only updated once every 24 hours.
X has around 15K entries and each entry is of form ("unique string of length <20", integer).
In some context, a user request involves fetching an average of 200 entries from X, which... |
Counter in OpenErp - Python | 16,789,456 | 1 | 0 | 171 | 0 | python,orm,module,openerp | there is a model called 'ir.sequence'. You can create a sequence type and sequence for your model and then just by calling the code of the sequence you will be able to generate new sequences | 0 | 0 | 0 | 0 | 2013-05-28T05:09:00.000 | 1 | 1.2 | true | 16,784,271 | 0 | 0 | 1 | 1 | I need a field which adds a counter to a specific item i add in the product section of a custom module.
Like an automatic number generated by the system, for let's say Internal Reference, so every time i save a new product this field will create a number for it in this field, like IN0001, IN0002, IN0003, etc...
I've l... |
How to store sensitive information that needs to be shared across different users? | 16,795,862 | 2 | 1 | 2,061 | 0 | python,django,django-models,security | Storing passwords using a reversible encryption is about as safe as plain text. Use OAuth or something similar, or prepare for serious troubles when (not "if" - "when") someone will hack your database. | 0 | 0 | 0 | 0 | 2013-05-28T14:46:00.000 | 4 | 0.099668 | false | 16,795,018 | 0 | 0 | 1 | 1 | I have to store some sensitive information in my database using Django.
I have a Client model and each client has a bunch of SocialAccounts (twitter, fb, etc) with an URL, client and password.
Considering ALL users that belong to the group "Administrator" should be able to see the passwords. What's a safe way to store ... |
web2py and d3.js compatibility | 16,812,347 | 1 | 1 | 358 | 0 | python,d3.js,web2py | No, there should not be any compatibility issues. web2py is primarily a server-side framework, and D3 is all client-side. They are completely independent. web2py does provide some client-side scaffolding, but it is optional and won't interfere with D3 anyway. | 0 | 0 | 0 | 0 | 2013-05-29T07:54:00.000 | 1 | 1.2 | true | 16,808,328 | 0 | 0 | 1 | 1 | I'm a relatively unexperienced developer starting on a new project to expose some pre-existing Python analytical libraries' functions in a web application through javascript visualization library d3.js. I've explored the web2py framework for Python, and would just like to ask a simple question:
Are there any compatibil... |
Scrapy ImportError | 16,818,251 | 2 | 3 | 907 | 0 | python,twisted,scrapy,importerror | Verify that you have zope.interface 4.0.5 installed on the same version of Python as you are using to run scrapy. Most likely you have more than one version of Python installed and scrapy is using a different version than you expect. | 0 | 0 | 0 | 0 | 2013-05-29T14:41:00.000 | 1 | 0.379949 | false | 16,816,929 | 1 | 0 | 1 | 1 | When I try to run Scrapy I get an ImportError stating that Twisted requires zope.interface 3.6.0 or later. The version of zope.interface I have is 4.0.5, so I'm perplexed by this error. I've read other suggestions recommending installing zope.interface via pip, but that did not work. I'd like some help figuring out how... |
Android to Playstation and other consoles | 16,818,550 | 0 | 1 | 150 | 0 | java,android,python,bluetooth,playstation | Im pretty sure you need an emulator for this. Correct me if Im wrong. | 0 | 0 | 0 | 1 | 2013-05-29T15:17:00.000 | 2 | 0 | false | 16,817,777 | 0 | 0 | 1 | 1 | i am trying to find if it is possible to send a message over Bluetooth to consoles like playstation 3 to make it turn on or off? since it is possible to be done from controllers. I been reading around about it. but was wondering if there is any information or exapmles that could help. as all i could find was python cod... |
Why won't python webassets pyscss regenerate css from scss files in debug mode? | 16,826,275 | 5 | 3 | 850 | 0 | python,css,debugging,sass,webassets | Figured it out. Webassets does not pick up on changes to scss files that are included in other scss files using @import. The only solution is to always make a change to the including scss file if you make a change to the included one. | 0 | 0 | 0 | 0 | 2013-05-30T00:51:00.000 | 2 | 0.462117 | false | 16,826,233 | 0 | 0 | 1 | 1 | I'm using the pyscss compiler in the python webassets library with webassets debug configs all set to true. But when I make changes to an scss file and reload the page that includes the generated css file, I see that the css file has not be regenerated and does not include my changes. Why is this happening? |
Can Not execute Python .py file using RobotFramework like Javascript | 16,847,883 | 1 | 1 | 635 | 0 | python,robotframework | The Execute Javascript extension isn't a part of RobotFramework, it's something added by the Selenium integration, it would therefore follow that you can't use Selenium to execute a .py file.
That said, RobotFramework is written in Python and can obviously be extended with a Python script.
Can you clear up what you're ... | 0 | 0 | 1 | 0 | 2013-05-30T00:59:00.000 | 1 | 0.197375 | false | 16,826,304 | 0 | 0 | 1 | 1 | Has anyone found a method for executing their .py files from the Robot Framework like you can for JS?
RobotFramework:
Executes the given JavaScript code.
code may contain multiple statements and the return value of last
statement is returned by this keyword.
code may be divided into multiple cells in the test data... |
Does a Django site with a Tastypie interface need two codebases? | 16,846,436 | 3 | 2 | 134 | 0 | python,django,web-applications | For this to be meaningful, you likely need to connect to the same database
Why would you need two codebases? You have two copies of a single codebase. | 0 | 0 | 0 | 0 | 2013-05-30T21:45:00.000 | 4 | 0.148885 | false | 16,846,391 | 0 | 0 | 1 | 3 | I have a Django project with several apps. My project is now getting to the point it needs an API. I'm planning to have the API on a different server using tastypie. However, the API will use the same models as the website.
So far I see my only option is as follows...
Copy the apps to the server which means I have two... |
Does a Django site with a Tastypie interface need two codebases? | 16,846,450 | 1 | 2 | 134 | 0 | python,django,web-applications | Why don't you run the api on the same server on a different port? that will save you a lot of problems to start with. Sharing database connections cross servers will likely require you to think about security, a lot.
Also if you are reusing the same apps in different projects you might want to package and version your ... | 0 | 0 | 0 | 0 | 2013-05-30T21:45:00.000 | 4 | 0.049958 | false | 16,846,391 | 0 | 0 | 1 | 3 | I have a Django project with several apps. My project is now getting to the point it needs an API. I'm planning to have the API on a different server using tastypie. However, the API will use the same models as the website.
So far I see my only option is as follows...
Copy the apps to the server which means I have two... |
Does a Django site with a Tastypie interface need two codebases? | 16,855,093 | 2 | 2 | 134 | 0 | python,django,web-applications | I wouldn't recommend splitting your project like this.
Every time you edit a model you have to edit it on both immediately or risk things getting out of sync. This will get very very painful, instead;
Is the server the bottleneck? Split site and api machines (but using the same models.py) and share the connection to t... | 0 | 0 | 0 | 0 | 2013-05-30T21:45:00.000 | 4 | 1.2 | true | 16,846,391 | 0 | 0 | 1 | 3 | I have a Django project with several apps. My project is now getting to the point it needs an API. I'm planning to have the API on a different server using tastypie. However, the API will use the same models as the website.
So far I see my only option is as follows...
Copy the apps to the server which means I have two... |
Test if string is valid key prior to memcache.get() | 16,866,096 | 0 | 1 | 581 | 0 | python,google-app-engine,python-memcached | Any object is a valid key, provided that the object can be serialized using pickle. If pickle.dumps(key) succeeds, then you shouldn't get a BadKeyError. | 0 | 1 | 0 | 0 | 2013-05-31T14:27:00.000 | 3 | 0 | false | 16,859,674 | 0 | 0 | 1 | 2 | Is there a function in Google App Engine to test if a string is valid 'string key' prior to calling memcache.get(key) without using db.get() or db.get_by_key_name() first?
In my case the key is being passed from the user's get request:
obj = memcache.get(self.request.get("obj"))
Somehow I'd like to know if that string... |
Test if string is valid key prior to memcache.get() | 16,867,410 | 1 | 1 | 581 | 0 | python,google-app-engine,python-memcached | A db module key sent to a client should pass through str(the_key) which gives you an URL safe encoded key. Your templating environment etc.. will do this for you just by rendering the key into a template.
On passing the key back from a client, you should recreate the key with
key = db.Key(encoded=self.request.get("ob... | 0 | 1 | 0 | 0 | 2013-05-31T14:27:00.000 | 3 | 0.066568 | false | 16,859,674 | 0 | 0 | 1 | 2 | Is there a function in Google App Engine to test if a string is valid 'string key' prior to calling memcache.get(key) without using db.get() or db.get_by_key_name() first?
In my case the key is being passed from the user's get request:
obj = memcache.get(self.request.get("obj"))
Somehow I'd like to know if that string... |
threading programming in python | 16,891,362 | 1 | 2 | 2,730 | 0 | python,flask | I have not threading solution: I'm using celery for hard operations: send email, fetch url, create many database records, periodic tasks.
+ you can use flask application and celery instances on different servers
- you need backend (rabbitmq, redis, mongodb and etc.) | 0 | 0 | 0 | 0 | 2013-06-01T08:44:00.000 | 3 | 0.066568 | false | 16,870,858 | 1 | 0 | 1 | 1 | Recently I've been practicing to build a website with flask. Now i encounter a problem.There is a function which to achieve registration. The code like this:
def register():
...
some judgment
...
if true:
sendmail()
return redirect(url_for('onepage'))
My question is... |
Does using a virtual environment influence the performance of a web app? | 16,871,438 | 12 | 8 | 2,134 | 0 | python,django,virtualenv | Nope, it doesnt infuence the performance. Basically all what it do is changing python path to the virtualenvs ones. So there shouldn`t be any difference with performance. | 0 | 0 | 0 | 0 | 2013-06-01T09:33:00.000 | 1 | 1.2 | true | 16,871,254 | 1 | 0 | 1 | 1 | I have a django app up and running. I never encountered any performance problems, though the app is hosted on a shared hosting platform.
The provider asked my recently to use python's virtualenv. Since then the performance has been really bad, though I can't detect the change in CPU usage or any other statistic.
So m... |
How to overwrite the default email message for user account activation in django-userna? | 16,879,697 | 1 | 0 | 173 | 0 | python,django | You don't need to copy whole django-userena module in you project directory. You only need to copy "emails" folder from userena/templates/userena/ into you project template directory with same directory structure.
For Example : you_project_dir/templates/userena/emails
After that just change activation_email_message.tx... | 0 | 0 | 0 | 0 | 2013-06-02T02:45:00.000 | 1 | 1.2 | true | 16,879,278 | 0 | 0 | 1 | 1 | I want to replace the default django-userna email message for user account activation with one that is website specific.
I've thought of some ways to do this like copying the entire installed django-userna module into a project specific app and replacing the default message stored in the module, but, all of my solutio... |
Efficient way to check whether a page changed (while storing as little info as possible)? | 16,890,397 | 2 | 0 | 89 | 0 | python,hash,web-scraping | You can keep track of the date of the last version you got and use the If-Modified-Since header in your request. However, some resources ignore that header. (In general it's difficult to handle it for dynamically-generated content.) In that case you'll have to fall back to less efficient method. | 0 | 0 | 1 | 0 | 2013-06-03T04:54:00.000 | 2 | 0.197375 | false | 16,890,209 | 0 | 0 | 1 | 2 | I have some webpages where I'm collecting data over time. I don't care about the content itself, just whether the page has changed.
Currently, I use Python's requests.get to fetch a page, hash the page (md5), and store that hash value to compare in the future.
Is there a computationally cheaper or smaller-storage stra... |
Efficient way to check whether a page changed (while storing as little info as possible)? | 16,890,487 | 0 | 0 | 89 | 0 | python,hash,web-scraping | A hash would be the most trustable source of change detection. I would use CRC32. It's only 32 bits as opposed to 128bits for md5. Also, even in browser Javascript it can be very fast. I have personal experience in improving the speed for a JS implementation of CRC32 for very large datasets. | 0 | 0 | 1 | 0 | 2013-06-03T04:54:00.000 | 2 | 1.2 | true | 16,890,209 | 0 | 0 | 1 | 2 | I have some webpages where I'm collecting data over time. I don't care about the content itself, just whether the page has changed.
Currently, I use Python's requests.get to fetch a page, hash the page (md5), and store that hash value to compare in the future.
Is there a computationally cheaper or smaller-storage stra... |
What is the best way to store large session data in web applications? | 16,898,841 | 0 | 1 | 758 | 0 | javascript,python,html,web-applications,flask | Yuo should try localstorage . | 0 | 0 | 0 | 0 | 2013-06-03T13:57:00.000 | 3 | 0 | false | 16,898,520 | 0 | 0 | 1 | 1 | I am building a website that does not require people to login, but still needs large session data.
Example: a person uploads a 0.5 MB file. I want to able to manipulate this this from now and then. Where should I store it? I would prefer something like a cookie system, but obviously this is too small. Redis seems like ... |
Can a django app have more than one views.py? | 16,899,786 | 0 | 3 | 1,066 | 0 | python,django,django-views | You can totally do that, it is only a convention to use views.py.
Now, the question is: do you really need to create a new file to put your views inside ? Shouldn't these regrouped in a new application ?
Think of an other person reviewing your code: would the reason of the separation be crystal clear to him ? | 0 | 0 | 0 | 0 | 2013-06-03T14:51:00.000 | 3 | 0 | false | 16,899,597 | 0 | 0 | 1 | 1 | I have just started learning Django. I was wondering if Django app can have more than one views file? Let's say, I have two separate classes. Should I keep them in one views file or can I make two views files?
Thanks in advance! |
Django return .html file directly without parsing for template tags at all | 16,900,507 | 4 | 2 | 2,717 | 0 | python,django,javascriptmvc | If you don't want to render a template, simply don't render it. Django won't render anything unless you specifically call template.render or one of the shortcuts.
If you just want to return an HTML file, you could just open it as a normal file, read it, then return the content as the response.
Alternatively, as suggest... | 0 | 0 | 0 | 0 | 2013-06-03T15:20:00.000 | 1 | 0.664037 | false | 16,900,215 | 0 | 0 | 1 | 1 | I'm writing a single view Javascript application with a Django backend that only needs to return the initial index.html and all other templates come from a CDN. My problem is that this first index.html file is parsing out some of my "{{}}" handlebars which I wanted to leave for the JS library to interpret.
I DO NOT wan... |
How to shutdown all dynamic instances in Google App Engine without re-deploying the app? | 23,557,544 | 1 | 1 | 1,179 | 0 | java,python,google-app-engine,load-testing | We had a similar problem - I found that disabling the app in Application Settings and then re-enabling it terminated all 88 instances we had running, without any other adverse effects. | 0 | 1 | 0 | 0 | 2013-06-03T20:29:00.000 | 2 | 0.099668 | false | 16,905,303 | 0 | 0 | 1 | 2 | We are running multiple load tests every day against one of our GAE apps. We use the following pattern:
Start a load test and let it run for a few hours.
Look at graphs.
Optionally deploy a new version of our app with performance improvements.
Go back to 1.
Each load test creates a couple hundred front end instances.... |
How to shutdown all dynamic instances in Google App Engine without re-deploying the app? | 16,909,149 | 0 | 1 | 1,179 | 0 | java,python,google-app-engine,load-testing | Maybe have them all periodically probe the datastore (or memcache) for a kill value? | 0 | 1 | 0 | 0 | 2013-06-03T20:29:00.000 | 2 | 0 | false | 16,905,303 | 0 | 0 | 1 | 2 | We are running multiple load tests every day against one of our GAE apps. We use the following pattern:
Start a load test and let it run for a few hours.
Look at graphs.
Optionally deploy a new version of our app with performance improvements.
Go back to 1.
Each load test creates a couple hundred front end instances.... |
Django reusable application with linked FK? | 16,914,965 | 1 | 3 | 115 | 0 | python,django | Often it's ok to import models between apps. This just creates a dependency, something many apps have. Of course it's more flexible to have your app be independently pluggable, but the important thing is that you document any dependencies for anyone else trying to use your app(s).
If you really want your app to be... | 0 | 0 | 0 | 0 | 2013-06-04T08:34:00.000 | 2 | 0.099668 | false | 16,913,178 | 0 | 0 | 1 | 1 | I have the following scenario.
I have an existing application called ‘Contacts’ with it's model I have number and name.
I want to create a new application called ‘unsubscribe’ and I want to make it reusable.
This is my issue:
In the new app called unsubscribe it's model will need a foreign key relationg to the contact... |
How do I debug my web.py project in Eclipse? | 16,931,564 | 0 | 0 | 337 | 0 | python,eclipse,debugging,web.py | It's actually very easily, and applies to most projects.
1) Go to your "Debug Configurations" window (under "Debug As").
2) Under "Python Run", add a new configuration.
3) Enter the name of the project.
4) Under "Main Module", click on "Browse" and select the script that you've been starting from the command-line.
5) S... | 0 | 0 | 0 | 0 | 2013-06-05T04:27:00.000 | 1 | 1.2 | true | 16,931,563 | 0 | 0 | 1 | 1 | I have my web.py project open in Eclipse, but how can I:
1) Start my project from within Eclipse (and not the console)?
2) Debug my project from within Eclipse (breakpoints, etc..)?
There's no readily-accessible information about this. |
Should South be used to rename files and/or instances of a keyword in code? | 16,932,331 | 1 | 0 | 70 | 0 | python,django,django-south | In a scale of one to madness, I think it's a terrible idea. Your version control system would commit suicide as soon as you tried to update the code further since your VCS would only have the old values while your migration would change the existing files.
I think it's reasonable to have the migration rename uploaded f... | 0 | 0 | 0 | 0 | 2013-06-05T04:47:00.000 | 1 | 1.2 | true | 16,931,757 | 0 | 0 | 1 | 1 | I recently found out that, during my coding, I inadvertently named one of the Models of a Django app as a subtly mispelled version of an English word. This was not too long ago, but now there are exactly 300 occurrences of the same mispelled word across models, views, tests and my old grandmother's last will and testam... |
How to View My Postgres DB Schema from Command Line | 16,942,831 | 3 | 2 | 3,348 | 1 | python,django,postgresql,heroku,django-south | From the command line you should be able to do heroku pg:psql to connect directly via PSQL to your database and from in there \dt will show you your tables and \d <tablename> will show you your table schema. | 0 | 0 | 0 | 0 | 2013-06-05T14:15:00.000 | 3 | 1.2 | true | 16,942,317 | 0 | 0 | 1 | 1 | So I have my Django app running and I just added South. I performed some migrations which worked fine locally, but I am seeing some database errors on my Heroku version. I'd like to view the current schema for my database both locally and on Heroku so I can compare and see exactly what is different. Is there an easy wa... |
Dropzonejs - Doesn't show progress bar / complete status and doesnt hide fallback form | 17,276,082 | 0 | 1 | 1,443 | 0 | python,django,dropzone.js | This sounds as if you didn't include the CSS files that come along with Dropzone.
Or you didn't add the dropzone or dropzone-previews class to your form. | 0 | 0 | 1 | 0 | 2013-06-05T17:53:00.000 | 2 | 0 | false | 16,946,659 | 0 | 0 | 1 | 1 | I'm using latest dropzone.js, version 3.2.0. I downloaded the folder and have all files needed. Using latest Chrome.
When i drop a file, dropzone sends it to the server, and i successfully save it, but nothing visual happens on the front end.
I guess i'm missing something trivial. How to make dropzone show upload prog... |
Interpretation of Java or Ruby neccessary with every access? | 16,951,499 | 1 | 0 | 38 | 0 | java,php,javascript,python,ruby | No. Bytecode caches are available for PHP (e.g. Zend Accelerator); Java is compiled to bytecode. Can't speak for Python. | 0 | 0 | 0 | 0 | 2013-06-05T23:28:00.000 | 2 | 0.099668 | false | 16,951,484 | 0 | 0 | 1 | 2 | JavaScript on the server can be interpreted to mashine code using Google's V8 Javascript Engine. But PHP and Ruby and Python and Java all have to run through an interpreter every time they're accessed and it interpretation will be less fast.
Is that true? I read this in an article about Google's V8 Javascript Engine. |
Interpretation of Java or Ruby neccessary with every access? | 16,951,649 | 1 | 0 | 38 | 0 | java,php,javascript,python,ruby | Java is compiled to bytecode, and then (usually) compiled to machine code using a Just-In-Time (JIT) compiler. Java servers don't launch a new process for every request (most just launch a new thread), so the cost of the JIT compile is amortized across the entire lifetime of your server. In practice, this means that... | 0 | 0 | 0 | 0 | 2013-06-05T23:28:00.000 | 2 | 1.2 | true | 16,951,484 | 0 | 0 | 1 | 2 | JavaScript on the server can be interpreted to mashine code using Google's V8 Javascript Engine. But PHP and Ruby and Python and Java all have to run through an interpreter every time they're accessed and it interpretation will be less fast.
Is that true? I read this in an article about Google's V8 Javascript Engine. |
What is the best way to download number of pages from a list of urls? | 16,961,651 | 0 | 5 | 1,273 | 0 | python,multithreading,multiprocessing,scrapy,web-crawler | Scrapy is still an option.
Speed/performance/efficiency
Scrapy is written with Twisted, a popular event-driven networking
framework for Python. Thus, it’s implemented using a non-blocking (aka
asynchronous) code for concurrency.
Database pipelining
You mentioned that you want your data to be pipelined into the d... | 0 | 0 | 1 | 0 | 2013-06-06T08:32:00.000 | 4 | 0 | false | 16,957,276 | 0 | 0 | 1 | 1 | I have a >100,000 urls (different domains) in a list that I want to download and save in a database for further processing and tinkering.
Would it be wise to use scrapy instead of python's multiprocessing / multithreading? If yes, how do I write a standalone script to do the same?
Also, feel free to suggest other aweso... |
Pyramid with Jinja2 running Python 3.3 | 16,975,273 | 1 | 1 | 347 | 0 | python-3.x,pyramid,jinja2 | There appears to be issues with the dev version of jinja2 that you are installing as they reimplement the python 3 port using a single codebase. I'd suggest going back to a previous release that is using 2to3. | 0 | 0 | 0 | 0 | 2013-06-06T14:02:00.000 | 2 | 0.099668 | false | 16,964,137 | 0 | 0 | 1 | 2 | I can't make Jinja2 2.8 work with Pyramid 1.4.2 and Python 3.3.2. I got this error:
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Jinja2-2.8_devdev_20130604-py3.3.egg/jinja2/environment.py", line 765, in _load_template
template = self.loader.load(self, name, globals)
File ... |
Pyramid with Jinja2 running Python 3.3 | 16,996,264 | 1 | 1 | 347 | 0 | python-3.x,pyramid,jinja2 | I had the same issue with Jinja2 2.7.
pip install jinja2==2.6 solved the problem for me. | 0 | 0 | 0 | 0 | 2013-06-06T14:02:00.000 | 2 | 1.2 | true | 16,964,137 | 0 | 0 | 1 | 2 | I can't make Jinja2 2.8 work with Pyramid 1.4.2 and Python 3.3.2. I got this error:
File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/Jinja2-2.8_devdev_20130604-py3.3.egg/jinja2/environment.py", line 765, in _load_template
template = self.loader.load(self, name, globals)
File ... |
PyV8 disable automatic garbage collection | 17,597,335 | 4 | 4 | 482 | 0 | javascript,python,garbage-collection,v8,pyv8 | It's possible to disable garbage collection for good by changing the source code of V8.
In V8's source, edit src/heap.cc, and put a return statement in the beginning of Heap::CollectGarbage.
Other than that, it's not possible (AFAICT): V8 will always invoke garbage collection when it's about to run out of memory. There... | 0 | 0 | 0 | 1 | 2013-06-09T03:30:00.000 | 1 | 1.2 | true | 17,006,134 | 1 | 0 | 1 | 1 | I'm having an issue which seems to be related with the way Python & PyV8's garbage collection interact. I've temporarily solved the issue by disabling python's garbage collection, and calling gc.collect and PyV8.JSEngine.collect together every few seconds when no JavaScript is being run. However, this seems like a pret... |
How to recognize user login when log in comes from cookie? | 17,010,697 | 3 | 1 | 124 | 0 | python,django,session,cookies,login | I would do this in middleware. Have an attribute in the profile, or the session, which records the date the user was last seen, and in the middleware check if it is < today: if so, award the points and update the field. | 0 | 0 | 0 | 0 | 2013-06-09T14:28:00.000 | 1 | 1.2 | true | 17,010,636 | 0 | 0 | 1 | 1 | In our project we give the users points for every day they visit the site.
The issue is that the user doesn't always log in in an explicit way (e.g. submitting login form), but often when he comes back he's logged in thanks to the cookie session id set by Django and we can't recognize his login in any way.
How can I ch... |
Database access strategy for a Python web app | 17,012,369 | 4 | 4 | 351 | 1 | python,psycopg2 | Have you looked in to SQLAlchemy at all? It takes care of a lot of the dirty details - it maintains a pool of connections, and reuses/closes them as necessary. | 0 | 0 | 0 | 0 | 2013-06-09T17:36:00.000 | 2 | 1.2 | true | 17,012,349 | 0 | 0 | 1 | 1 | I've been writing a Python web app (in Flask) for a while now, and I don't believe I fully grasp how database access should work across multiple request/response cycles. Prior to Python my web programming experience was in PHP (several years worth) and I'm afraid that my PHP experience is misleading some of my Python w... |
Pay Per Request in Django | 17,021,455 | 3 | 0 | 228 | 0 | python,django | You can do everything web with Django just like with any other webframework/weblibrary.
Probably the easiest way would be to have a user-profile, and as soon as the payment has been working out you add this video to the users "allowed" list. This makes it quite easy to show the users available videos.
The redirection t... | 0 | 0 | 0 | 0 | 2013-06-10T10:03:00.000 | 2 | 1.2 | true | 17,021,318 | 0 | 0 | 1 | 2 | Is it possible to implement this in django: In a video site, for every video a user want to watch he/she must pay a fee before watching the video. If it's possible, what's the best way to implement this. And after every successful payment, how can the user be redirected back to the particular video he paid for? |
Pay Per Request in Django | 17,021,565 | 0 | 0 | 228 | 0 | python,django | I believe this is possible.
What you can do is have a check on your video page for a certain receipt that you can add as an entry in the UserProfile model that you'll have for your django website.
Now this receipt will only be generated when your user goes through the complete payment path which you can handle by scr... | 0 | 0 | 0 | 0 | 2013-06-10T10:03:00.000 | 2 | 0 | false | 17,021,318 | 0 | 0 | 1 | 2 | Is it possible to implement this in django: In a video site, for every video a user want to watch he/she must pay a fee before watching the video. If it's possible, what's the best way to implement this. And after every successful payment, how can the user be redirected back to the particular video he paid for? |
Set break points in Tornado app | 20,555,024 | 2 | 3 | 1,963 | 0 | debugging,python-2.7,tornado | If you are running your app using foreman you would set you environment variable in .env file in root project folder.
Setting the below env variable in my .env file did the tick form me.
PYTHONUNBUFFERED=true
Now I can set code breakpoints in my app, and also print output to server logs while running the app using for... | 0 | 1 | 0 | 0 | 2013-06-10T18:46:00.000 | 2 | 1.2 | true | 17,030,677 | 0 | 0 | 1 | 1 | How could I set a break point in my tornado app?
I tried pdb, but Tornado app seams to be ignoring my pdb.set_trace() command in my app. |
How to implement unsubscribe usecase for website | 17,033,151 | 1 | 0 | 138 | 0 | google-app-engine,email,python-2.7,webapp2,unsubscribe | Each new class implies a new query, which adds to the total cost. Pack as much information that is practical into the User class. A simple boolean in the User class should work for active/inactive or subscribe/unsubscribe. Your app needs to accept emails to receive the Unsubscribe request and set the associated bool... | 0 | 1 | 0 | 0 | 2013-06-10T19:12:00.000 | 1 | 1.2 | true | 17,031,075 | 0 | 0 | 1 | 1 | I'm sending automated emails and hence I should deliver an unsubscribe function. I have a User entity that is not used much, only when a user registers and the emails can be send to users who are not registered as Users. So when I send an email and I must include an unsubscribe link, should I keep a whole separate enti... |
Communicating with a Node.js server application | 17,039,955 | 2 | 1 | 361 | 0 | python,node.js,socket.io | Expose a Restful API on the chat server. Then your Django web application can easily make API calls to modify state in the chat server.
Doing anything else is more complicated and most likely unnecessary. | 0 | 0 | 1 | 0 | 2013-06-11T08:44:00.000 | 1 | 0.379949 | false | 17,039,873 | 0 | 0 | 1 | 1 | I am building a chat application that consists of a Django web backend with a Node.js/socket.io powered chat server. There will be instances when changes made via the web interface (e.g. banning a user) need to be pushed immediately to the chat server. I can think of the following options:
Use a Python-based socket.io... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.