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
How to format multiple python datetime instances to a simple format?
9,356,001
2
1
169
0
python,django,datetime,pattern-matching
It sounds like something that is fundamentally "business logic." For example, if the dates happen to all be Easter on consecutive years, do you expect that to be picked up? What about if they are all the last day of Hanukkah? This isn't likely to be something that's handled by a language or library directly--you'll ...
0
0
0
0
2012-02-20T03:48:00.000
2
1.2
true
9,355,952
1
0
1
1
I've got a Django app that needs to take a list of multiple datetimes and print out a simple string that explains what the pattern is. Example: With 3 datetime instances for Monday, Wednesday, and Friday at 3pm, the simple output would be something like Monday, Wednesday, Friday at 3:00pm With 3 datetime instances of...
How can i print unhandled exception to the Console instead of the Browser in Django?
9,356,177
10
3
408
0
python,django
Run the server with --traceback option and set DEBUG=False in settings.py. You will get the traceback on console.
0
0
0
0
2012-02-20T04:07:00.000
2
1.2
true
9,356,053
0
0
1
1
I got 500 errors in Django console but it doesn't print any information to the Console about the error. How can i print the detail to Console ?
Deploying a Python Script on a Server (CentOS): Where to start?
9,357,006
1
1
865
1
python,django,centos
Copy script to server test script manually on server set cron, "crontab -e" to a value that will test it soon once you've debugged issues set cron to the appropriate time.
0
1
0
0
2012-02-20T06:14:00.000
3
0.066568
false
9,356,926
0
0
1
1
I'm new to Python (relatively new to programing in general) and I have created a small python script that scrape some data off of a site once a week and stores it to a local database (I'm trying to do some statistical analysis on downloaded music). I've tested it on my Mac and would like to put it up onto my server (VP...
AppEngine python send email api is marked as SPAM by Gmail email reader
9,374,887
1
3
691
0
python,google-app-engine,email,gmail,spam-prevention
My guess would be that the content of the mail looks "spammy" for Google, but you can do some things that might help you. I would suggest you, since this is a confirmation mail, add another admin for your app an email like: do-not-reply@domain.com and use that one for the confirmation emails. Add more text to the body...
0
1
0
1
2012-02-20T19:16:00.000
1
0.197375
false
9,367,049
0
0
1
1
We send email using appengine's python send_mail api. Is there any way to tell why an email that is sent to only one recipient would be marked as SPAM. This seems to only happen when appengine's python send_mail api sends to Gmail. In our case we are sending email as one of the administrators of our appengine applica...
ISO-8859-1 Not working on IE
9,370,450
4
3
1,203
0
python,html,utf-8,iso-8859-1
It is better to use UTF-8. Note that "iso-8859-1" is a common mislabeling of "windows-1252", also known as "cp1252". Try being more explicit and see if this resolves your issues.
0
0
1
1
2012-02-21T00:08:00.000
2
0.379949
false
9,370,343
0
0
1
2
I am working on some programs in spanish, so I need to use accent marks. This is why I use # -*- coding: iso-8859-1 -*- and <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> on all my programs (python). I tested in chrome,firefox and safari and they all work puttin the accent marks. The only on...
ISO-8859-1 Not working on IE
9,370,369
2
3
1,203
0
python,html,utf-8,iso-8859-1
Yes, it is better to use UTF-8 instead. Your question really cannot be answered unless you also provide the bytes that you are sending.
0
0
1
1
2012-02-21T00:08:00.000
2
1.2
true
9,370,343
0
0
1
2
I am working on some programs in spanish, so I need to use accent marks. This is why I use # -*- coding: iso-8859-1 -*- and <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> on all my programs (python). I tested in chrome,firefox and safari and they all work puttin the accent marks. The only on...
Ruby equivalent of Sphinx documentation generator?
37,973,198
0
6
3,534
0
ruby,markdown,documentation-generation,python-sphinx,restructuredtext
Another couple of options would be to use Middleman which is a static site generator that accepts either Kramdown or Markdown as input. There are also frameworks that are designed specifically for technical documentation that use Middleman (both of which are on GitHub) including lord/slate and pnerger/dpslate (the la...
0
0
0
0
2012-02-21T04:29:00.000
3
0
false
9,372,188
0
0
1
1
Ruby has a few good document generators like Yard, rDoc, even Glyph. The thing is that Sphinx does websites, PDF's, epub, LaTex...etc. It does all these things in restructuredtext. Is there an alternative to this in the Ruby world? Maybe a combination of programs? If I could use Markdown as well that would be eve...
Send image as an attachment in browser
9,378,819
1
4
219
1
python,browser,flask
You can force the contents to be a downloadable attachment using http headers. In PHP that would be: $fileName = 'dummy.jpg'; header("Content-Disposition: attachment; filename=$fileName"); Then, the script dumps the raw contents of the file.
0
0
0
0
2012-02-21T13:46:00.000
2
0.099668
false
9,378,664
0
0
1
1
I have a static folder that is managed by apache where images are stored. I wonder if it's possible by configuring apache to send all files from that folder as downloadable files, not opening them as images inside browser? I suppose I can do it by creating a special view in Flask, but I think it would be nicer if I cou...
How to keep track of all the components used by my Django app
9,379,383
7
1
100
0
python,django
Use virtualenv. Create a virtualenv, activate it, install what you need, then do pip freeze > requirements.txt to create a file listing all your requirements. Then on your new machine (also inside a virtualenv) you can do pip install -r requirements.txt to reinstall all those libraries.
0
0
0
0
2012-02-21T14:31:00.000
1
1.2
true
9,379,307
0
0
1
1
I've been developing a Django app and in the process I installed a couple of component using pip (e.g. pip install django-ajax-selects). I just realized that those components aren't installed in my app directory but somewhere which is machine specific. First, how do I keep track of all the components I installed. Seco...
How to make a variable accessible across all pages in HTML / Template (Django)..?
9,381,932
0
2
487
0
javascript,python,html,django
Well, presumably you are dealing with form posts whenever you want to access the option you refer to. You could either have your whole page be contained by a form, or use javascript to set a hidden field within your main form which is submitted. You can then access it as a raw property of the POST object, or bind a Fo...
0
0
0
0
2012-02-21T17:02:00.000
2
0
false
9,381,772
0
0
1
1
I am using Django-Python for my project..I have created a "Master HTML page" and all other pages extends this master page.. There is a Drop down (Select Menu) in Master page..and i want to access the value of selected option across all Django Function and views.. How can i achieve that..??
How can I detect Heroku's environment?
41,711,924
2
42
13,817
0
python,django,deployment,heroku,environment
The most reliable way would be to set an environment variable as above. If that's not possible, there are a few signs you can look for in the filesystem, but they may not be / are not foolproof Heroku instances all have the path /app - the files and scripts that are running will be under this too, so you can check for...
0
0
0
0
2012-02-21T18:58:00.000
7
0.057081
false
9,383,450
0
0
1
1
I have a Django webapp, and I'd like to check if it's running on the Heroku stack (for conditional enabling of debugging, etc.) Is there any simple way to do this? An environment variable, perhaps? I know I can probably also do it the other way around - that is, have it detect if it's running on a developer machine, bu...
Plone: Query Archetype content items/objects inside a particular folder during content submission
9,405,455
0
0
153
0
python,plone,archetypes
Alternative 1: Use PloneFormGen, make a form with a button and an action adapter. The button is called "Apply". The action adapter has a python script that checks if user has already applied, if so redirects to edit view of existing item, if not calls invokeFactory on the Applications folder. You may want to hide the "...
0
0
0
0
2012-02-22T07:15:00.000
1
0
false
9,390,586
0
0
1
1
Is it possible to access or navigate saved content items under the same folder during every content submission so that every content submitted must be verified to avoid submission of content that already exists? I have application content type where members can submit their applications but shouldn't accept application...
Does django AppDirectoriesFinder looks in compressed files?
9,406,387
0
0
213
0
python,django
Looks like Django does not look inside zipped eggs. But you can make your own ZipFileFinder based on Django's FileFinder, I think it will not be very much to code.
0
0
0
0
2012-02-22T09:15:00.000
1
0
false
9,391,963
0
0
1
1
I have several third party django apps downloaded from pip as python eggs. Some of them have zip-safe flag set so they are compressed. I've noticed that django collectstatic command can't find static files from compressed eggs. Is there any posibility to make django taking staticfiles out of zipped eggs?
python 2.7 import a class from the same directory
9,413,623
1
0
2,369
0
python,python-2.7
Because there is an order in which Python searches for models. Amongst the paths Python looks for is your current directory (but not the directory above it). When you are inside your blimp folder there is no blimp.models, only a models. The solution is to always run your code from one directory up (e.g. python -m blimp...
0
0
0
0
2012-02-23T12:58:00.000
2
0.099668
false
9,413,559
1
0
1
1
I have a folder blimp with an __init__.py, models.py and views.py When I import from outside the folder I use from blimp.models import .. but inside folder it gives an import error unless I use from models import .. I was wondering why this is? Thanks
Show different profile based on user type
9,421,485
1
1
225
0
python,django
Create a profile model and link the user to this profile model. (via a foreign key) The profile model will then have different attributes for different behaviours. These different behaviours would then be exposed in the web application either by branching the template (as you say using if in the template) or returning ...
0
0
0
0
2012-02-23T21:09:00.000
3
0.066568
false
9,421,345
0
0
1
1
I have two types of users. After a user logs in, I take the user to their user profile at /profile Based on the type of user, their profile may contain different navigation items and forms. Is there an easier way to construct the navigation based on the user type instead of putting {% if %} tags everywhere in the templ...
What is the best way to run a django project on aws?
9,424,119
11
5
2,360
0
python,django,deployment,amazon-web-services
It depends on your configuration. We are using the following stack for our environment on Rackspace, but you can setup the same thing on AWS with EC2 instances. Ubuntu 11.04 Varnish (in memory cache) to avoid disk seeks NginX to server static content Apache to server dynamic content (MOD-WSGI) Python 2.7.2 with Django...
0
0
0
0
2012-02-24T00:27:00.000
3
1.2
true
9,423,620
0
0
1
1
How should the project be deployed and run. There are loads of tools in this space. Which should be used and why? Supervisor Gunocorn Ngnix Fabric Boto Pip Virtualenv Load balancers
Google App Engine - prohibitively slow and expensive backup and restore?
13,692,611
5
11
1,978
0
python,google-app-engine,backup,restore
Bet you've found a solution by now Yasser, but for anyone else ending up here from Google, here's an updated answer: The backup option in the appstore admin has been upgraded to support both datastore and cloud storage. It also uses mapreduce to do the backup, which makes the query much lighter on the system.
0
1
0
0
2012-02-24T10:48:00.000
4
0.244919
false
9,429,436
0
0
1
1
After working on several GAE apps, some of which are being used for production, I have come to the conclusion that on this platform, backing up your production data is slow enough and expensive enough for us to transition to some other cloud based technology stack. In one of our production apps, we have around a mill...
Generating DOC (and DOCX) templates using Python or Java with absolute positioned boxes
9,431,308
1
0
1,110
0
java,python,ms-word,docx,doc
Anything you can do with word, you can do with the word com object. Install PythonWin. Use the object browser under "Tools->COM browser" to find what you need.
0
0
0
0
2012-02-24T12:31:00.000
3
0.066568
false
9,430,829
0
0
1
1
For a web-to-print we need to generate a .doc (Microsoft Word 2003+) compatible templates/documents where we need to position some data inside the document (basically we need to auto-generated letter heads for address, phone, contact information etc.). Which Python or Java based solutions can be used here that providin...
Update python in server running centos/whm?
9,775,582
0
1
2,583
0
python,django,centos,cpanel,yum
You can install any version of python from source as long as you don't overwrite cPanel's python 2.4 installation at /usr/bin. To do this, use the -prefix= option when you configure the python 2.x or python 3.x source for build.
0
1
0
0
2012-02-24T17:29:00.000
4
0
false
9,435,259
0
0
1
2
I have a server which is running CentOS with cpanel/whm. Otherwise, it is pretty much a standard set up. My problem is that such server is running python 2.4 and I need python 2.6 or later. How do I upgrade without breaking anything? By the way, I currently have a django application running on that server, which I woul...
Update python in server running centos/whm?
10,049,589
0
1
2,583
0
python,django,centos,cpanel,yum
The simplest way to install an alternate version of Python is to download the source and compile it. When you've finished running ./configure and make, you'll want to install using make altinstall, with python 2.6 you'd end up with an interpreter named python26
0
1
0
0
2012-02-24T17:29:00.000
4
0
false
9,435,259
0
0
1
2
I have a server which is running CentOS with cpanel/whm. Otherwise, it is pretty much a standard set up. My problem is that such server is running python 2.4 and I need python 2.6 or later. How do I upgrade without breaking anything? By the way, I currently have a django application running on that server, which I woul...
upload file with python script in plone
9,456,924
1
2
890
1
python,plone,zope
You are not saving the file on the filesystem, but in the Zope object database. You'd have to use python code (not a python script) to open a filepath with the open built-in function to save the data to.
0
0
0
0
2012-02-25T18:27:00.000
1
0.197375
false
9,446,769
0
0
1
1
I am using plone to build my site. In one page template, I have the <input type="file" name="file"> and this form: <form method="post" action="addintoDb" enctype="multipart/form-data" The addintoDb is a python script that save my information into db:context.addParam(name=request.name, path=request['file']). in my db ...
Do HTML5 mobile app run on server and are accessed via web browser of sorts?
10,339,850
1
1
1,089
0
android,python,html,cordova,titanium
PhoneGap: Simply put your HTML(5), JavaScript and CSS code. You can use 3rd party JavaScript libraries like jQuery, MooTools, etc. You need to code or use libraries to get native feel/UI look. Nothing much different than straight way. PhoneGap just gives you additional mobile features and events which you can bring nat...
0
0
0
0
2012-02-26T07:03:00.000
1
0.197375
false
9,451,214
0
0
1
1
I don't have much experience developing native mobile apps. But I am in need of developing an app that runs in all mobile platforms. I came across Titanium and Phonegap as possible solution. And I am not sure how they work? Is it basically that you create a web-app that runs on server. And PhoneGap/Titatnium simply wra...
How to get logged in user in django views across different apps
9,459,943
1
1
229
0
python,django,views,request
If applications placed in one project (work in one site) doesn't matter what application. But if applications runs in different sites you need, for example, shared between sites session storage and, i think, user table.
0
0
0
0
2012-02-27T03:44:00.000
1
0.197375
false
9,459,780
0
0
1
1
I have a django application called 'main'. user authentication and everything seems fine. And I created a new app called 'upload' from startapp command. user can login on 'main' app but I can not get the logged in user from request.user on views of another app ('upload' app). It returns Anonymous user all the time. any...
Password Protect Static Page AppEngine HowTo?
9,461,964
2
0
1,804
0
python,google-app-engine,.htaccess,openid,.htpasswd
AFAIK, GAE does not support such setup (static password after OpenID login). The only way I see to make this work would be to serve static content via your handler: Client makes a request for static content Your handler is registered to handle this URL Handler checks is user is authenticated. If not, requests a passw...
0
1
0
0
2012-02-27T06:49:00.000
2
0.197375
false
9,461,085
0
0
1
1
So I'm working with AppEngine (Python) and what I want to do is to provide OpenID Login setting a Default provider so the user can Log-In without problems using that provider. The thing is, I want to prompt the user a Password right after they login in order to show static content (HTML Pages); If the user doesn't ente...
Import Error: No module named django
47,015,891
47
30
170,766
0
python,django,centos,pythonpath
I had the same error, and this fix my issue python -m pip install django :) Done!
0
0
0
0
2012-02-27T08:48:00.000
8
1
false
9,462,212
0
0
1
2
I am using centos linux. I had python 2.6 with django and now i upgraded to python 2.7. Python 2.6 is located in /usr/lib/python2.6. Python 2.7 is located in /usr/local/lib/python2.7. They both have site-packages directory and they both contain django 1.2. If i run python i get the 2.7 version. My problem is that if t...
Import Error: No module named django
66,738,274
1
30
170,766
0
python,django,centos,pythonpath
python3 -m django --version1 for me it was that^
0
0
0
0
2012-02-27T08:48:00.000
8
0.024995
false
9,462,212
0
0
1
2
I am using centos linux. I had python 2.6 with django and now i upgraded to python 2.7. Python 2.6 is located in /usr/lib/python2.6. Python 2.7 is located in /usr/local/lib/python2.7. They both have site-packages directory and they both contain django 1.2. If i run python i get the 2.7 version. My problem is that if t...
Using QWebFrame.setContent() with unicode (Python+PySide)
9,470,209
1
0
284
0
python,pyside,qwebpage
The way to get a byte array out of a unicode is to encode it.
1
0
0
0
2012-02-27T18:25:00.000
1
1.2
true
9,470,170
0
0
1
1
I'm using QWebKit to render a a pdf-page. Untill now, I used setHtml(), to feed the html code to the QMainFrame and then render() to print the content or export it to pdf. So far so good, but I want to use setContent() to include inline-svg-images to the frame, which get not displayed, using setHtml(). But setContent()...
Ipython in pydev interactive debugging console(eclipse)
9,502,749
0
4
1,810
0
pydev,ipython
Actually, Eclipse itself can have multiple consoles open at the same time... if you want, you can create multiple console views and pin a different console to each view (if you don't pin the console, one console will be shown on top of the other and you'll have to do the switching from one to the other manually). As it...
0
0
0
0
2012-02-28T01:18:00.000
2
0
false
9,475,014
1
0
1
1
I have ipython working in pydev when using the normal interactive console, however when entering debug mode the console reverts to the standard pydev console. If I close this console and re-open it, ipython returns and I can use it as normal. Am I missing something, or is this a bug? -Eric
Can I turn off the "no_cookies" option in Google App Engine Launcher (version 1.6.2) on Windows?
9,477,977
0
1
650
0
python,windows,google-app-engine,deployment,credentials
The launcher will always prompt you for credentials, it uses the no_cookies flag to make sure the given credentials are passed and not the one stored in the system. What you can do is create a batch file that will deploy the application, you can provide credentials using the --email and --passin flags.
0
1
0
0
2012-02-28T01:24:00.000
1
1.2
true
9,475,063
0
0
1
1
When I deploy an application using the Google App Engine Launcher (version 1.6.2) on Windows, the following command options show in the output window: Running command: "[u'C:\Python27\pythonw.exe', '-u', u'C:\Program Files (x86)\Google\google_appengine\appcfg.py', '--no_cookies', u'--email=xxxx.xxxx@xxxx.xxx', '--...
Do multiple Python interpreters on a server share pages in memory?
9,475,336
1
0
94
0
python,operating-system,multiprocessing
Not on purpose. They let the OS worry about sharing pages between the instances of the library.
0
0
0
0
2012-02-28T01:55:00.000
2
0.099668
false
9,475,290
0
0
1
2
One of the more clever things Android does to conserve memory and increase startup time is share pages between multiple Dalvik interpreters by forking processes from a the zygote process. When an application loads, the static, readonly library code pages are shared between the parent and the child. Does python or mult...
Do multiple Python interpreters on a server share pages in memory?
9,475,484
2
0
94
0
python,operating-system,multiprocessing
This is an operating system feature (not a language feature) that at least Linux and probably most OSes offer. It's nothing unique to Android. So yes, Python and multiprocessing do essentially the same thing if you are running on Linux, simply because they use fork() to spawn additional processes.
0
0
0
0
2012-02-28T01:55:00.000
2
1.2
true
9,475,290
0
0
1
2
One of the more clever things Android does to conserve memory and increase startup time is share pages between multiple Dalvik interpreters by forking processes from a the zygote process. When an application loads, the static, readonly library code pages are shared between the parent and the child. Does python or mult...
Mixing HTML5 Canvas and Python
9,485,888
2
13
29,496
0
python,django,html,google-app-engine
A viable approach for a rich client widget like this is to use a stack like: [ your javascript user interface ] [ a js lib for your graphics ] backbone.js for managing your objects client side django-tastypie for wrapping your django objects in a RESTful API django for defining your backend
0
0
1
0
2012-02-28T16:27:00.000
3
0.132549
false
9,485,761
0
0
1
2
I have used both of these (Python and HTML5) seperately, however I'm keen to use the full power of Python over the web using HTML5 to draw things and handle the client side of things. I guess I'm looking for avenues to go down in terms of implementation. Here are some things I'd like to do if possible: Have very inter...
Mixing HTML5 Canvas and Python
9,486,058
4
13
29,496
0
python,django,html,google-app-engine
I do exactly what you have mentioned using Django on the server side and HTML5 canvas/javascript on the client side. I'm pretty happy with the results but would like to point out that what you do with a Canvas on the client side doesn't have anything to do with what you use on the server side for Python.
0
0
1
0
2012-02-28T16:27:00.000
3
0.26052
false
9,485,761
0
0
1
2
I have used both of these (Python and HTML5) seperately, however I'm keen to use the full power of Python over the web using HTML5 to draw things and handle the client side of things. I guess I'm looking for avenues to go down in terms of implementation. Here are some things I'd like to do if possible: Have very inter...
What should be used to store data in GAE?
9,498,169
0
1
109
0
python,google-app-engine,memcached,google-cloud-datastore
I'd suggest you split your entities in a root entity and a couple linked ones holding each some of the 150 attributes - this way, when you update one attribute, you only need to save one (or two, if the update reflects on the root entity) smaller entities to the datastore instead of a huge one. Use memcache to prevent ...
0
1
0
0
2012-02-28T17:16:00.000
3
0
false
9,486,574
0
0
1
3
My web application will have ~150 fields and when value is changed in any field (at least one), I should save changed value. How should I store such values with GAE? Should I save them directly in datastore? Should I use memcache temporarily and then save all values at once in datastore? Or, some other approach should...
What should be used to store data in GAE?
9,487,492
0
1
109
0
python,google-app-engine,memcached,google-cloud-datastore
First of all you should find out how you are going to use your data. Which queries are you planning to make? What is the size of your entities? Datastore is very different from relational databases. That is It doesn't really matter how many properties are changed, because there is no way to update a property on its own...
0
1
0
0
2012-02-28T17:16:00.000
3
0
false
9,486,574
0
0
1
3
My web application will have ~150 fields and when value is changed in any field (at least one), I should save changed value. How should I store such values with GAE? Should I save them directly in datastore? Should I use memcache temporarily and then save all values at once in datastore? Or, some other approach should...
What should be used to store data in GAE?
9,486,718
3
1
109
0
python,google-app-engine,memcached,google-cloud-datastore
The datastore is your database. Memcache is to store data that's fetched from the datastore and kept temporarily in memory to avoid too many calls back to the database. You should first design your app around the datastore and then use memcache to improve performance. Depending on your programming language of choice (j...
0
1
0
0
2012-02-28T17:16:00.000
3
0.197375
false
9,486,574
0
0
1
3
My web application will have ~150 fields and when value is changed in any field (at least one), I should save changed value. How should I store such values with GAE? Should I save them directly in datastore? Should I use memcache temporarily and then save all values at once in datastore? Or, some other approach should...
How to handle merges/conflicts in my git based wiki?
9,489,348
2
1
311
0
python,git,merge,conflict,resolve
Study how other systems (like e.g. ikiwiki) handle these things. Commit requests will come in sequentially. Try to commit them. If there are conflicts or if a commit request is based on a previous HEAD, report that back to the person sending the commit request complete with the differences of the edits with the current...
0
0
0
0
2012-02-28T19:40:00.000
1
0.379949
false
9,488,543
1
0
1
1
I'm working on a django-based wiki. It has section edit capabilities (the sections being delimited by the markdown headers) and it is using git (a single repo) to store the revisions, via the Git Python library. I'm trying to figure out how I can handle several concurrent edits of the same page (using git-python). Than...
GAE-ready asynchronous operations in Python?
9,491,366
1
3
182
0
python,http,google-app-engine,asynchronous,web2py
If you're brave, you might try the Experimental new DB api, NDB. It has async APIs for working with the datastore + URL fetch. If those are the things you hoped to do async-ly, then you're in luck.
0
1
0
0
2012-02-28T23:07:00.000
3
0.066568
false
9,491,227
1
0
1
1
I've got a Python app making 3 different api calls one after another in the same block of code. I'd like to execute these calls asynchronously, and then perform an action when they're all complete. A couple notes: Other answers regarding async actions point to frameworks like Twisted and Celery, but I'm building a Web...
How to properly redirect to another site without breaking the browser back button?
9,499,524
2
2
219
0
python,http,redirect,pylons
The correct way is sending HTTP status code 302 instead of 200 and adding Location: <url> to response headers. How to do this depends on the WEB framework you are running your Python app on.
0
0
1
0
2012-02-29T12:27:00.000
1
1.2
true
9,499,173
0
0
1
1
I am trying to make a redirection from a python app to another site. I am currently doing it in the controller which works just fine but breaks the back browser button. I know that a redirection with meta refresh or js, will allow me to add a delay so the user will have time to go back but I read everywhere that these ...
Django to share login session with Jasperserver
10,683,426
0
0
506
0
python,django,jasperserver
You could, for example, in an iframe, do a post to j_spring_security_check to authenticate the user, that way when you redirect him to the login page, the user would be authenticated
0
0
0
0
2012-02-29T16:10:00.000
2
0
false
9,502,596
0
0
1
1
I have a Django application and I use Jasperserver to generate reports. Can I somehow share the login session from Django to jasperserver to eliminate login step in jasperserver ? Thanks.
Check a SWF's Flash Version and ActionScript version from Python?
9,521,701
0
0
587
0
python,django,actionscript,flash
Hexagonit.swfheader checks Flash version, which is part of Michael's question, but doesn't cover ActionScript version, does it?
0
0
1
0
2012-03-01T04:20:00.000
2
0
false
9,510,565
0
0
1
1
I need to validate an uploaded SWF to ensure it meets certain Flash and ActionScript version limitations. Anyone know a good Python library to parse metadata out of a SWF?
Concurrency handling in python based webapp
9,521,531
6
1
2,325
0
python,multithreading,postgresql,web-applications,concurrency
Flask will execute each request in a separate thread or even in separate processes. The number of threads and processes to spawn is determined by the WSGI server (for example, Apache with mod_wsgi). If you use SQLAlchemy ScopedSessions, the session is perfectly thread-safe. You must not share ORM-controlled objects acr...
0
0
0
0
2012-03-01T13:26:00.000
1
1.2
true
9,517,054
0
0
1
1
I am developing web app on flask, python, sqlalchemy and postgresql. My question is here regarding concurrency handling in this app. How I wrote the app : I take the example of adding user in database. I post the form and a view is called. I process all the form data and then call add_user(*arg) which uses sqlalchemy ...
django: creating a model for Person who can be Writer or Actor or both
9,517,891
2
1
98
0
python,django,django-models
It sounds like you want each category to have a ForeignKey to Person.
0
0
0
0
2012-03-01T14:22:00.000
3
0.132549
false
9,517,829
0
0
1
2
i am new to both python and Django, trying to create a database that hold general information about people, so i have this: a model for a Person (contain general info). a model for a Category that a person belongs to (a person can be in multiple categories at the same time). each category contain its own extra data (...
django: creating a model for Person who can be Writer or Actor or both
9,519,078
0
1
98
0
python,django,django-models
The multiple 1to1 rel is the way to go. Define an ActorProfile model, a WriterProfile model etc, with each having a fk to User. Use some orm magic to load then when necessary. It's basic that the FK is in the profile model, otherwise you'll need to add a new column on the user table each time you need a new kind of pro...
0
0
0
0
2012-03-01T14:22:00.000
3
0
false
9,517,829
0
0
1
2
i am new to both python and Django, trying to create a database that hold general information about people, so i have this: a model for a Person (contain general info). a model for a Category that a person belongs to (a person can be in multiple categories at the same time). each category contain its own extra data (...
cursor and with_cursor() in GAE
9,521,520
0
0
550
1
python,google-app-engine
i am not 100% sure about that but what i used to do is compare the last cursor with the actual cursor and i think i noticed that they were the same so i came to the conclusion that it was the last cursor.
0
1
0
0
2012-03-01T17:47:00.000
3
0
false
9,521,289
0
0
1
1
I am fetching records from gae model using cursor() and with_cursor() logic as used in paging. but i am not sure how to check that there is no any other record in db that is pointed by cursor. i am fetching these records in chunks within some iterations.when i got my required results in the first iteration then in next...
Website to computer communications
9,523,459
0
3
232
0
php,python,web
You can set up a web server also on the remote computer, perhaps using the same software as on the public server, so you do not need to learn another technology. The public server can make HTTP requests and the remote server responds by communicating with the serial device.
0
0
1
1
2012-03-01T20:02:00.000
2
0
false
9,523,147
0
0
1
1
I am working on my senior project at university and I have a question. My advisor and other workers don't know much more on the matter so I thought I would toss it out to SO and see if you could help. We want to make a website that will be hosted on a server that we are configuring. That website will have buttons on it...
What's the best way to have value object using Django data model?
9,540,376
0
1
676
0
python,json,django-models
Once I dropped the notion of Value Object carried over from JAVA background, and started to focus on what I really want, I found a simple way to get this: to custom build a dictionary in views.py, based on the data coming back from related models. And then add each dictionary to a list bucket and use json dumps prio...
0
0
0
0
2012-03-01T21:41:00.000
2
0
false
9,524,574
0
0
1
1
Our Django data model objects are nicely mapped to database tables. We want a way to package data from two or more tables into a customized structure, so that we can easily serve it up as JSON feed, having all the attributes and is in the desired format. It is kind of like "value objects" (POJO) in other environment s...
how to find the authentication used on a website
9,542,705
0
0
829
0
python,http,authentication,screen-scraping,web-scraping
It's very unlikely that any of the sites you are interested in use basic auth. You will need a library like mechanize that manages cookies and you will need to submit the login information to the site's login page.
0
0
1
1
2012-03-02T05:23:00.000
1
0
false
9,528,395
0
0
1
1
I've been reading about beautifulSoup, http headers, authentication, cookies and something about mechanize. I'm trying to scrape my favorite art websites with python. Like deviant art which I found a scraper for. Right now I'm trying to login but the basic authentication code examples I try don't work. So question, How...
First project what should I look out for
9,528,803
2
2
177
0
python,django
The first thing to look out for is overplanning. This, along with overengineering, is even more true for your second project. You have lots of ideas about how this program will behave, but don't get ahead of yourself. Remember what the problem is you want to solve, and try to keep focused on the simplest way to solve t...
0
0
0
0
2012-03-02T06:02:00.000
1
1.2
true
9,528,748
1
0
1
1
I want to create a program that will take user input and create a calendar using the input. example: John,Conner 1/3/10 birthday This information will also be sortable by the obvious: last name,first name, date, (other). It will be able to print this information as a list or a calendar. It will have to have excepti...
How to transfer message between different request in web.py?
9,531,601
0
0
569
0
python,web.py
you can use a Get Variable: web.seeother('/somepage?message=hello') bye
0
0
1
0
2012-03-02T06:39:00.000
2
0
false
9,529,113
0
0
1
1
In web.py, I use web.seeother() to redirect to another page, is there a way to transfer some message to that page too?
Django - Managing page content in Django Admin
9,537,653
0
0
984
0
python,django,django-models,content-management-system,django-admin
I would find out how much they need to change? If they plan a complete redesign every week then you're still looking for an answer. If they just need a dynamic front page then you can split it up into variables and let them edit sections of html. Much safer and less prone to breaking the html.
0
0
0
0
2012-03-02T17:01:00.000
3
0
false
9,537,326
0
0
1
3
I'm new to working with Django and am developing for a client who wants to be able to change page content in the Django Admin. They need to be able to change the html of the index page without editing the files on the server. I know about flatfiles but I'm not sure that's completely what I'm after as I can't display st...
Django - Managing page content in Django Admin
9,537,377
0
0
984
0
python,django,django-models,content-management-system,django-admin
I don't believe that is possible at this time. Of course you can edit your models but templates, I think not.
0
0
0
0
2012-03-02T17:01:00.000
3
0
false
9,537,326
0
0
1
3
I'm new to working with Django and am developing for a client who wants to be able to change page content in the Django Admin. They need to be able to change the html of the index page without editing the files on the server. I know about flatfiles but I'm not sure that's completely what I'm after as I can't display st...
Django - Managing page content in Django Admin
9,537,635
1
0
984
0
python,django,django-models,content-management-system,django-admin
Honestly, the scope of what you're looking for is too huge to cover in this format. There's a number of ways this could be done, but they're all going to require some work and customization based on the client's needs. Flatpages could work if you allow HTML content and make sure the content is rendered as "safe" in the...
0
0
0
0
2012-03-02T17:01:00.000
3
1.2
true
9,537,326
0
0
1
3
I'm new to working with Django and am developing for a client who wants to be able to change page content in the Django Admin. They need to be able to change the html of the index page without editing the files on the server. I know about flatfiles but I'm not sure that's completely what I'm after as I can't display st...
Which database engine to choose for Django app?
9,540,685
6
48
41,120
1
python,database,django,sqlite
MySQL and PostgreSQL work best with Django. I would highly suggest that when you choose one that you change your development settings to use it while development (opposed to using sqlite3 in dev mode and a "real" database in prod) as there are subtle behavioral differences that can caused lots of headaches in the futur...
0
0
0
0
2012-03-02T20:49:00.000
4
1
false
9,540,154
0
0
1
1
I'm new to Django and have only been using sqlite3 as a database engine in Django. Now one of the applications I'm working on is getting pretty big, both in terms of models' complexity and requests/second. How do database engines supported by Django compare in terms of performance? Any pitfalls in using any of them? An...
Global variables in Python and Apache mod_wsgi
9,541,433
3
4
3,538
0
python,apache,mod-wsgi
Web-apps are generally “shared-nothing”. In the context of WSGI, that means you have no idea how many times your application (and the counter with it) will be instantiated; that choice is up to the WSGI server which acts as your app's container. If you want some notion of user sessions, you have to implement it explici...
0
0
0
0
2012-03-02T22:31:00.000
2
1.2
true
9,541,301
1
0
1
1
I know there are frameworks that exist, but I am trying to use wsgi directly to improve my own understanding. I have my wsgi handler, and up at the top I have declared a variable i = 0. In my application(environ, start_response) function, I declare global i, then I increment i whenever a button is pressed. It is my und...
In need of a light, changing database/storage solution
9,545,480
1
3
168
1
python,database,flask
You might look at mongoengine we use it in production with flask(there's an extension) and it has suited our needs well, there's also mongoalchemy which I haven't tried but seems to be decently popular. The downside to using mongo is that there is no expire automatically, having said that you might take a look at usin...
0
0
0
0
2012-03-03T08:17:00.000
1
1.2
true
9,544,618
0
0
1
1
I have a Python Flask app I'm writing, and I'm about to start on the backend. The main part of it involves users POSTing data to the backend, usually a small piece of data every second or so, to later be retrieved by other users. The data will always be retrieved within under an hour, and could be retrieved in as low a...
Scraping with JQuery or Python?
9,551,356
0
0
1,586
0
jquery,python,screen-scraping
If I'm reading your question right, you're not trying to build a web app (client- or server-side), but rather a standalone app that simply requests and downloads pages from the Web. You can write a standalone app in JavaScript, but it's not common. The primary use of JavaScript is for code that's going to run in a user...
0
0
1
0
2012-03-03T23:13:00.000
2
0
false
9,550,690
0
0
1
2
So lets say I'm scraping multiple pages (lets say a 1000) on a website. I want to know which language is best to use to scrape those pages with - javascript or python. Further, I've heard about javascript scrapers being faster (due to multiple get requests), but am unsure how to implement this - can anyone enlighten m...
Scraping with JQuery or Python?
9,551,757
3
0
1,586
0
jquery,python,screen-scraping
This is just my opinion but I would rank them like this javascript might be the best choice but only if you have a node environment already set up. The advantage of javascript scrapers is they can interpret the js in the pages you're scraping. next is a three way tie between perl python and ruby. They all have a mecha...
0
0
1
0
2012-03-03T23:13:00.000
2
1.2
true
9,550,690
0
0
1
2
So lets say I'm scraping multiple pages (lets say a 1000) on a website. I want to know which language is best to use to scrape those pages with - javascript or python. Further, I've heard about javascript scrapers being faster (due to multiple get requests), but am unsure how to implement this - can anyone enlighten m...
besides google and bing, what other search engine has an python api?
10,133,419
1
0
332
0
python,search-engine
pySearch is no longer supported, the only way to search yahoo is to use their BOSS API. The BOOS api would require payments for every 1000 queries.
0
0
1
0
2012-03-04T00:16:00.000
2
1.2
true
9,551,108
0
0
1
1
Google and Bing are both free, for Google I use urllib and json to get the results. For Bing i use pyBing. Yahoo requires me to pay per 1000 queries, which I don't want to do for a homework assignment. Is there any other SEs that has a python api? Or has something similar to Google's ajax googleapis?
Overloading DateTimeShortcuts.js in Django
9,768,878
1
0
1,664
0
javascript,python,django
Yeah I had to edit the widget contained in the django install (... site-packages/django/contrib/admin/media/js/admin/DateTimeShortcuts.js). I was getting confused as even when I edited it, it was not working. It was my fault, as even though I was working on a local machine the settings were still pointing to the remo...
0
0
0
0
2012-03-04T11:48:00.000
1
1.2
true
9,554,610
0
0
1
1
Simple question really, is there any programmatic way to over load the "choose a time" options in django for the DateTimeShortcuts.js when used in the admin? The options they present aren't very helpful the last option of the day is noon. I was hoping to have every hour of the day as an option
Setup Cherrypy with Google App Engine
15,619,684
1
1
1,132
0
python,google-app-engine,cgi,wsgi,cherrypy
The problem was that cherrypy was not in the root of the working directory, all of which I uploaded with the app engine tool. Not 100% sure if its the correct way to use GAE but it works.
0
1
0
0
2012-03-04T15:46:00.000
1
1.2
true
9,556,280
0
0
1
1
Can someone please show me how to get cherrypy to work with Google App Engine, I have made applications with cherrypys built in server, but I have no idea how to make an app that works with WSGI and GAE. I have read the documentation for cherrypy and GAE but can't find anything. And I would prefer cherrypy to the webap...
Redis and RDBMS coexistence (hopefully cooperation) in Flask applications
9,557,895
3
4
532
1
python,nosql,redis,rdbms,flask
You should have no problem using an ORM because, in the end, it just stores strings, numbers and other values. So you could have a game in progress, and keep its state in Redis, including the players' IDs from the SQL player table, because the ID is just a unique integer.
0
0
0
0
2012-03-04T18:17:00.000
1
1.2
true
9,557,552
0
0
1
1
I'm developing a multi-player game in Python with a Flask frontend, and I'm using it as an opportunity to learn more about the NoSQL way of doing things. Redis seems to be a good fit for some of the things I need for this app, including storage of server-side sessions and other transient data, e.g. what games are in pr...
What is the possibility of using a Python app, deployed online, that has access to a users local disk?
9,561,004
2
0
139
0
python,google-app-engine,web.py
You could create a signed java applet that will run along side the javascript and allow access to local files. You may be able to find an applet already developed that you can call from javascript. You have to be careful with this though because once the user trusts the applet it's installed and any site can call the a...
0
1
0
0
2012-03-05T02:30:00.000
2
0.197375
false
9,560,950
0
0
1
2
I currently have a local python application that scans a users drive, maps it into a tree and displays this information with javascript. I would really like to try to develop something with a Drop-Box like system to manage drive trees. I have searched and read that App Engine specifically doesn't allow access to a use...
What is the possibility of using a Python app, deployed online, that has access to a users local disk?
9,560,968
4
0
139
0
python,google-app-engine,web.py
You'd have to create a "client" and "server" type of interface to do this. So it wouldn't be a solely JavaScript with Python on the server program. They'd have to have something running on their end as well, communicating in the background. HTML5 allows some local storage, but not what you're looking for.
0
1
0
0
2012-03-05T02:30:00.000
2
1.2
true
9,560,950
0
0
1
2
I currently have a local python application that scans a users drive, maps it into a tree and displays this information with javascript. I would really like to try to develop something with a Drop-Box like system to manage drive trees. I have searched and read that App Engine specifically doesn't allow access to a use...
removing buttons/links in django admin
9,564,009
7
2
2,890
0
python,django,django-admin
Do not remove or change anything in the admin. Instead remove user's/group's permission to delete given model. If user does not have the permission to delete, the delete button won't appear at any page related to that model.
0
0
0
0
2012-03-05T08:59:00.000
2
1.2
true
9,563,935
0
0
1
1
I have an apps and I am making used of django admin, but my apps does not allow deleting of data and django admin have a delete button/link. I have already removed the delete action. my question is, how can i remove the delete button/link in admin page in django?
Django models - field dependency
9,586,795
1
3
2,667
0
python,django,validation,model
Case 1: Don't do it like that, have a different table for telephone numbers and have a ForeignKey from the Person (I'm assuming it's a person) to the the telephone number. If you have more than one telephone number per person, do it the other way around, otherwise consider using a OneToOne. Obviously you'll want the Fo...
0
0
0
0
2012-03-05T14:30:00.000
2
0.099668
false
9,568,336
0
0
1
1
How can I have field dependency? Case 1: If boolean field call_me is set, then telephone must be set, else it should be blank Case 2: If many to many field category (with values sale, rent) has one of the values as sale, then price_sale must be set, else it should be blank
Do I need to create a separate class in my models.py when using the django.contrib.auth.models import user?
9,575,013
0
0
104
0
python,django
All installed apps can contribute to the database schema. django.contrib.auth.models contributes, among others, the auth_user table behind the django.contrib.auth.models.User model, therefore you do not have to worry about recreating it unless you have a specific reason to do so.
0
0
0
0
2012-03-05T22:23:00.000
4
1.2
true
9,574,970
0
0
1
2
The import statement import the needed parts. but is the "user" class already made when you put that into your installed apps? or do you still need to clarify in models.py in order to make the table in the db? or can someone expand on how to use django users and sessions? I'm looking over the django docs right now and ...
Do I need to create a separate class in my models.py when using the django.contrib.auth.models import user?
9,575,285
0
0
104
0
python,django
There's a number of things going on here. As you're aware, Django comes with a number of "contrib" packages that can be used in your app. You "activate" these by putting them into your INSTALLED_APPS. When you run python manage.py syncdb, Django parse the models.py files of every app in INSTALLED_APPS and creates the a...
0
0
0
0
2012-03-05T22:23:00.000
4
0
false
9,574,970
0
0
1
2
The import statement import the needed parts. but is the "user" class already made when you put that into your installed apps? or do you still need to clarify in models.py in order to make the table in the db? or can someone expand on how to use django users and sessions? I'm looking over the django docs right now and ...
Is cookie a common and secure implementation of session?
9,576,386
2
1
365
0
python,session,cookies,pyramid
In general, the cookie stored with the client is just a long, hard-to-guess hash code string that can be used as a key into a database. On the server side, you have a table mapping those session hashes to primary keys (a session hash should never be a primary key) and expiration timestamps. So when you get a request, f...
0
0
0
1
2012-03-06T00:35:00.000
3
1.2
true
9,576,263
0
0
1
2
I'm using pyramid web framework. I was confused by the relationship between the cookie and session. After looked up in wikipedia, did I know that session is an abstract concept and cookie may just be an kind of approach (on the client side). So, my question is, what's the most common implementation (on both the client ...
Is cookie a common and secure implementation of session?
9,576,390
1
1
365
0
python,session,cookies,pyramid
A session is (usually) a cookie that has a unique value. This value maps to a value in a database or held in memory that then tells you what session to load. PHP has an alternate method where it appends a unique value to the end of every URL (if you've ever seen PHPSESSID in a URL you now know why) but that has securit...
0
0
0
1
2012-03-06T00:35:00.000
3
0.066568
false
9,576,263
0
0
1
2
I'm using pyramid web framework. I was confused by the relationship between the cookie and session. After looked up in wikipedia, did I know that session is an abstract concept and cookie may just be an kind of approach (on the client side). So, my question is, what's the most common implementation (on both the client ...
django-admin-tools : change header 'Django Administration'
9,588,284
1
0
2,081
0
python,django,django-admin
The django-admin-tools header is controlled by the theming.css file which is by default sitting under \admin_tools\theming\static\admin_tools\css\theming.css, and the default header should display the "Django" png that comes with django-admin-tools and is placed under \admin_tools\theming\static\admin_tools\images\djan...
0
0
0
0
2012-03-06T01:50:00.000
1
1.2
true
9,576,822
0
0
1
1
I am using django-admin-tool to customized my django admin page. my problem is, how can I change the header of 'Django Administration' with django-admin-tools? i know how to change it using base_site.html but the problem is my custom menu that i have done in django-admin-tools is not appearing.
dreamhost+django: cannot get domain name using site framework
9,588,891
0
0
152
0
python,django,web,dreamhost,domain-name
The problem waas that it was executing the old instance of webapp (that didn't use sites module) So i have resolved with pkill python command.
0
0
0
0
2012-03-06T03:44:00.000
1
1.2
true
9,577,614
0
0
1
1
In my view i execute Site.objects.get_current().domain but the result is empty string. So, how can i get the domain name to compose right url? Hosting is dreamhost.
Need to send a HTTP request in Python that'll authenticate with Google Accounts
9,596,143
2
0
425
0
python,google-app-engine,cookies,oauth
Can you use OAUth to authenticate with Google, then use the OAuth token to ensure the messages are legitimate?
0
0
1
0
2012-03-06T23:39:00.000
2
0.197375
false
9,593,659
0
0
1
1
I have an app which amounts to a Python script, running on the user's phone, and a JS client, running in the user's browser. The Python script sends messages to App Engine as HTTP requests. The server then pushes the messages to the JS client. The problem is authentication: The server can easily use Google Accounts to ...
Cross Platform Event Notification
9,595,261
0
0
335
0
python,notifications,push-notification,server-push
Maybe have a look at www.pubnub.com .. its commercial, but lets you send 5 million messages a month for free. Essentially it lets you create a named channel, and have X number of clients connect to it and send messages back and forth. Using one of these services would of course require you to write a client to distrib...
0
0
0
1
2012-03-07T02:39:00.000
2
0
false
9,595,076
0
0
1
1
I hope you guys can spare a moment with some ideas on how to develop my idea. I have an Asterisk-based telephone switch . When an incoming call is arriving, I can make sure the server runs an external script of any language. Here comes my development work. I would like to notify a group of listening clients about the c...
How do I redirect an user back to the page they were trying to access once they log in? (Django)
9,595,612
0
1
135
0
python,django
You can pass a url parameter back to your login page and use that to direct the user once they complete the login successfully.
0
0
0
0
2012-03-07T03:43:00.000
3
0
false
9,595,497
0
0
1
1
So currently I'm using @login_required to block certain pages from users and redirect them, telling them they need to log in. but what I can't understand is how do I "let them" go to the page they were trying to go to once they log in. Currently I'm just using a typical render_to_response('with a certain view') but wha...
Is there a way to send html emails with django-mailer?
9,677,080
4
1
1,554
0
python,django
Roam's answer pointed me in the right direction, but it wasn't a complete answer. The real answer to this is that you can't normally send html emails with django-mailer. It might be possible to hack django-mailer or work around it in someother way - but I haven't yet heard of any way of doing that. The better alternat...
0
0
0
0
2012-03-07T06:48:00.000
2
1.2
true
9,596,975
0
0
1
1
I am developing a site using Django and Python. I am using django-mailer to send out a newsletter to registered subscribers. It can do text emails ok, but passing html into the send_mail function doesn't have the desired result. Is it possible to use django-mailer to send html or otherwise is there a way I can adjust/...
Django JSON De-serialization Security
9,604,106
3
12
2,992
0
python,django,json,security
I'm having trouble working out what you think could be insecure (or secure) about JSON. JSON is a text-based data exchange format. It doesn't have any security built-in. Django comes with some functions to serialize and deserialize querysets to JSON. But these can't be "malicious" or "insecure" - they're just data. Som...
0
0
0
0
2012-03-07T15:02:00.000
2
0.291313
false
9,603,841
1
0
1
1
Are there any known security vulnerabilities with Django's JSON deserializer? Regarding Python deserializing protocols, the general concensus seems to be they're completely insecure, so avoid parsing untrusted data. However, I'm considering a distributed web application where different servers exchange model records, f...
apache mpm worker run only single process
9,608,216
1
0
452
0
python,django,apache,process
Another alternative could be to use something like mod_wsgi in daemon mode configured with only one process, then hand off to that. This is all assuming that your web server only ever needs to be single process, and that no other request should be served in parallel? Do you have other views which aren't rate limited? I...
0
1
0
0
2012-03-07T16:50:00.000
1
1.2
true
9,605,759
0
0
1
1
I need to make apache mpm worker use only a single process to run my django server . I have a view which needs to be run only once when the first request hits the apache . But i see it running twice. I made the runprocess configuration from 2 to 1 . what else should i do to make apache run only one process..
Django Template Test Coverage
9,618,165
1
24
1,443
0
python,django,unit-testing,code-coverage
Templates do not store any kind of line number information like python source code does. The best you could do is monkey patch the NodeList object to record how many times each node has been evaluated, and then re-render the templates in a special mode that will show which nodes are evaluated. EDIT: I have been correct...
0
0
0
0
2012-03-08T06:30:00.000
3
0.066568
false
9,613,759
0
0
1
1
Is there any way to produce a report containing the code coverage in my django test suite for my site's templates? I already have coverage for python, but coverage for templates to identify dead or untested template code would be awesome. To clarify: I want to find lines in my templates that are never executed or emitt...
How to properly handle page refresh?
9,615,608
0
1
279
0
javascript,jquery,python,google-app-engine,google-cloud-datastore
The two scenarios you have explained are behaviours built into your browser. Most browsers will try to resubmit form data if you press F5 on a page where data has been submitted. This is to try to avoid data being lost by the average user. It is as though you were to enter the site, complete the form and click Submit a...
0
0
0
0
2012-03-08T09:41:00.000
3
0
false
9,615,514
0
0
1
3
I have a form on my page with many fields. I save field values in the datastore once user input a value (without waiting for form submission). Some score is calculated based on field values and displayed to the user. I also generate user's client id and store that in user's cookies for one hour. I am not sure what shou...
How to properly handle page refresh?
9,615,888
0
1
279
0
javascript,jquery,python,google-app-engine,google-cloud-datastore
Create a SESSION ID when the user enters the Registration page and store it in the database. I think session id will change only when user close the browser. If user refresh the page retrive the values from the database with the SESSION ID. When user click submit button and successfully query the values to database. De...
0
0
0
0
2012-03-08T09:41:00.000
3
0
false
9,615,514
0
0
1
3
I have a form on my page with many fields. I save field values in the datastore once user input a value (without waiting for form submission). Some score is calculated based on field values and displayed to the user. I also generate user's client id and store that in user's cookies for one hour. I am not sure what shou...
How to properly handle page refresh?
9,616,023
0
1
279
0
javascript,jquery,python,google-app-engine,google-cloud-datastore
The best way, when you load the page, you should check it if there was any content for each form field already saved in db otherwise try some client side form field cache technique.
0
0
0
0
2012-03-08T09:41:00.000
3
0
false
9,615,514
0
0
1
3
I have a form on my page with many fields. I save field values in the datastore once user input a value (without waiting for form submission). Some score is calculated based on field values and displayed to the user. I also generate user's client id and store that in user's cookies for one hour. I am not sure what shou...
How to ensure several Python processes access the data base one by one?
9,618,894
0
0
157
0
python,database,queue
You could create a function that each process must call in order to talk to the DB. You could re-write the scripts so that they must call that function rather than talk directly to the DB. Within that function, you could have a scope-based lock so that only one process would be talking to the DB at a time.
0
0
0
0
2012-03-08T13:59:00.000
3
0
false
9,618,773
0
0
1
2
I got a lot scripts running: scrappers, checkers, cleaners, etc. They have some things in common: they are forever running; they have no time constrain to finish their job; they all access the same MYSQL DB, writting and reading. Accumulating them, it's starting to slow down the website, which runs on the same system...
How to ensure several Python processes access the data base one by one?
9,619,460
1
0
157
0
python,database,queue
You say that your dataset is <1GB, the problem is CPU bound. Now start analyzing what is eating CPU cycles: Which queries are really slow and executed often. MySQL can log those queries. What about the slow queries? Can they be accelerated by using an index? Are there unused indices? Drop them! Nothing helps? Can you ...
0
0
0
0
2012-03-08T13:59:00.000
3
0.066568
false
9,618,773
0
0
1
2
I got a lot scripts running: scrappers, checkers, cleaners, etc. They have some things in common: they are forever running; they have no time constrain to finish their job; they all access the same MYSQL DB, writting and reading. Accumulating them, it's starting to slow down the website, which runs on the same system...
How can I get the HTML generated with javascript?
9,618,891
3
3
2,524
0
javascript,python,html
The only way I know of to do this from your server is to run the page in an actual browser engine that will parse the HTML, build the normal DOM environment, run the javascript in the page and then reach into that DOM engine and get the innerHTML from the body tag. This could be done by firing up Chrome with the approp...
0
0
1
0
2012-03-08T13:59:00.000
3
0.197375
false
9,618,776
0
0
1
2
I want to get the HTML content of a web page but most of the content is generated by javascript. Is it posible to get this generated HTML (with python if posible)?
How can I get the HTML generated with javascript?
9,618,929
0
3
2,524
0
javascript,python,html
If most of the content is generated by Javascript then the Javascript may be doing ajax calls to retrieve the content. You may be able to call those server side scripts from your Python app. Do check that it doesn't violate the website's terms though and get permission.
0
0
1
0
2012-03-08T13:59:00.000
3
0
false
9,618,776
0
0
1
2
I want to get the HTML content of a web page but most of the content is generated by javascript. Is it posible to get this generated HTML (with python if posible)?
What alternatives to pinax exists?
10,642,779
0
7
1,366
0
python,django,pinax
I don't think there's any alternative, luckily it's active again lately.
0
0
0
0
2012-03-08T16:44:00.000
1
0
false
9,621,385
0
0
1
1
I am planning on transferring my django site to pinax so I dont have to deal with the user registration and what not. Before I make this move, I was wondering what the alternative options are so I dont have to make this transfer twice. So what alternatives to pinax exists? and which one is your favorite?
celery with multiple django instances
9,635,351
1
5
1,580
0
python,django,linux,celery
If you make changes in tasks.py for celery, then you will have to restart it once to apply changes by running command ./manage.py celeryd start or python manage.py celeryd start --settings=settings for using settings.py as configuration for celery. It will not be affected by the changes in your projects until you make ...
0
1
0
0
2012-03-09T13:26:00.000
2
0.099668
false
9,634,800
0
0
1
1
I'm using several django instances, each in a virtualenv, on the same server. How can I start the celery server and make sure it is always running and updated? I.e. after a server restart or code update? The /etc/init.d script and the config file assume a single Django installation. Do I have to use the ./manage.p...
Is that possible to develop a ACM ONLINE JUDGE system using NODE.JS(or PYTHON)?
9,636,911
0
4
1,228
0
javascript,python,node.js,compiler-construction
To accomplish the sandbox, it would be fairly easy to do this by simply running your code inside of a closure that reassigns all of the worrisome calls to NaN for instance, if the code executes inside a closure where eval=NaN
0
0
1
0
2012-03-09T15:06:00.000
2
0
false
9,636,294
0
0
1
1
I'm a newer and if the question is so easy I apologize for that. Assume I want to dev a classical online judge system, obviously the core part is get users' code to a file compile it on server run it on server (with some sandbox things to prevent damage) the program exit itself, then check the answer. or get the sign...
Log parser solutions python/perl vs Java
9,642,425
0
0
838
0
java,python,parsing,logging
I recently started writing python scripts, but recently i wrote a java gc log parser to print the timestamp when a gc happened and counts etc, and i found Python real easy in writing it. What kind of fields are you interested while parsing the syslogs? I think if you know what you are looking for in the logs(patterns e...
0
0
0
1
2012-03-09T22:42:00.000
2
1.2
true
9,641,974
0
0
1
2
I know perl and python is tested solution for this kind of log parsing and data mining - Anybody have experience dealing with syslog parsing with Java ? I have to create a Java demon anyway to load the parsed output to DB .. So I was thinking why not going all the way - python might be useful when I will be runnin...
Log parser solutions python/perl vs Java
11,693,757
1
0
838
0
java,python,parsing,logging
I translated some Java GC log parser/analyzer from Perl to Java. In Java the code looked like more lines and the code obviously more verbose but the execution was at least 5 times faster.
0
0
0
1
2012-03-09T22:42:00.000
2
0.099668
false
9,641,974
0
0
1
2
I know perl and python is tested solution for this kind of log parsing and data mining - Anybody have experience dealing with syslog parsing with Java ? I have to create a Java demon anyway to load the parsed output to DB .. So I was thinking why not going all the way - python might be useful when I will be runnin...
How can I run a python script through a webserver and return results to javascript?
9,642,671
0
0
703
0
php,javascript,python,gearman
Put your Python script in your CGI directory and use the cgi and json modules in your script to read AJAX from post/get params. Of course you can do a system call from PHP to run a Python script, but I can't think of a good reason why you would.
0
0
1
1
2012-03-09T23:18:00.000
2
0
false
9,642,259
0
0
1
1
I want to take results from a web page, sent from dom as json through ajax, then send this data to a python script, run it, then return the new results back as json. I was told a php script running gearman would be a good bet, but I'm still not sure how that would work.
Is it secure to host Django Admin media on a public folder on AWS
9,644,524
1
0
176
0
python,django,security,heroku
I don't see any reason why it wouldn't be. After all, when you login to the admin panel, the links to the css and js are always public. Meaning at that point they are just like any other static resource and they don't require to be logged in order to view them. So you can store them whenever you want and as long as the...
0
0
0
0
2012-03-10T04:39:00.000
1
1.2
true
9,643,975
0
0
1
1
I have a Django app hosted in the cloud (Heroku if that makes a difference though I can't see how) and am looking to move all static content to AWS (images, CSS etc). Is it secure to have Django's Admin media (ie the media/ css/ and js/ folders) hosted on a publicly accessible site?
Why does altering STATIC_URL in Django disrupt ADMIN_MEDIA_PREFIX
9,645,186
1
1
565
0
python,django
Which version of Django do you use? Before Django 1.4, the STATIC_URL and ADMIN_MEDIA_PREFIX are indeed different parts. In Django 1.4, ADMIN_MEDIA_PREFIX is deprecated and STATIC_URL is used solely. The way you're using to serve corresponding files is important also. You could check the URLs of media files in the adm...
0
0
0
0
2012-03-10T05:15:00.000
1
0.197375
false
9,644,121
0
0
1
1
Trying to gain some high level clarity on how Django serves (admin) static files. When altering the STATIC_URL setting in Django's settings.py to a new location (I'm serving images from a 3rd party server) it seems to disrupt ADMIN_MEDIA_PREFIX and thus stop the Admin media (css, images, js) from being served. Why does...
Python get data from secured website
9,647,462
3
2
2,748
0
python,post,cookies,get,urllib2
This is a part of Web-Scraping : Web-scraping is a standard task that can serve various needs. Scraping data out of secure-website means https Handling https is not a problem with mechanize and BeautifulSoup Although urllib2 with HTTPCookieJar also works fine If managing the cookies is the problem, then I would recomm...
0
0
1
0
2012-03-10T14:53:00.000
1
0.53705
false
9,647,381
0
0
1
1
Id like to know if there is a way to get information from my banking website with Python, Id like to retrieve my card history and display it, and possibly save it into a text document each month. I have found the urls ext to login and get the information from the website, which works from a browser, but I have been usi...
Generate admin panel automatically
9,654,945
0
0
93
0
python
I dont hear about of these libraries, but you can try SqlAlchemy and WTForms.
0
0
0
0
2012-03-11T11:30:00.000
1
0
false
9,654,527
0
0
1
1
I'm looking for python-libraries which can make autogenerated panel for administer site (like django) using models (ORM) or descriptions of tables from database.
What are the extra capabilities Python gives when used with Java?
9,663,378
2
3
124
0
java,python,jython
I know how to use python with java through jython, but backwards ... try to ask your question to jython community.
0
0
0
0
2012-03-12T07:44:00.000
3
0.132549
false
9,663,321
1
0
1
3
I am a Java developer. I would like to know what capabilities and/or positives I can add to a Java application, by including Python as a development language. I am posting this here as I am not getting a good answer from google. I would request that you don't vote down, marking it to be a descriptive question, so that ...
What are the extra capabilities Python gives when used with Java?
9,663,439
1
3
124
0
java,python,jython
1st: jython is many times slower than java. 2nd: as I recall integration in direction jython -> java is not very seemless. 3rd: you get python syntax, maybe some batteries (i don't really know this). This is a plus. 4th: you get good heavy multithreading support in python instead of green thread and GIL. That can be a ...
0
0
0
0
2012-03-12T07:44:00.000
3
0.066568
false
9,663,321
1
0
1
3
I am a Java developer. I would like to know what capabilities and/or positives I can add to a Java application, by including Python as a development language. I am posting this here as I am not getting a good answer from google. I would request that you don't vote down, marking it to be a descriptive question, so that ...
What are the extra capabilities Python gives when used with Java?
9,663,494
8
3
124
0
java,python,jython
In general, there are no (overall) benefits for doing this. You're simply adding in another language with its own set of runtime features, that, for the most part does the same things that you can do in Java. Unless you have specific reason to add Python integration into your Java application, it would be a very poor i...
0
0
0
0
2012-03-12T07:44:00.000
3
1
false
9,663,321
1
0
1
3
I am a Java developer. I would like to know what capabilities and/or positives I can add to a Java application, by including Python as a development language. I am posting this here as I am not getting a good answer from google. I would request that you don't vote down, marking it to be a descriptive question, so that ...
How to disable a button after clicking it in OpenERP
9,667,268
0
4
2,267
0
python,openerp
If we talking about web interface then you could disable it by javascript.
0
0
1
0
2012-03-12T11:46:00.000
3
0
false
9,666,425
0
0
1
1
This might be a simple question.but,does any one know how to disable a button after clicking it in OpenERP? Please help!!!!! Thanks for all your help....