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
Django Check if Users are Logged In
21,296,452
0
0
339
0
python,django
You need to make sure their sessions expire after they log out. Then you need to query the django session model and to see who's online you need to match the friend with the session in the django session model sorry not much help code wise
0
0
0
0
2014-01-22T22:49:00.000
1
0
false
21,295,705
0
0
1
1
To be clear, I'm not trying to check if the user is authenticated. On my app, I want users to be able to see whether other users they are friends with are currently logged in or not. Can someone point me in the right direction.
How to avoid that that a user has two opened issues in Jira?
28,475,805
0
1
53
0
jira,python-jira
Technically, you can do that with Behaviours plugin. It needs a Groovy script that looks up the reporter's other issues and transitions them to a paused. Hovewer, I don't advise doing this, because you'll also need a carefully crafted workflow that supports your "Pause" transition on all statuses, a working Groovy scri...
0
0
0
0
2014-01-23T20:48:00.000
1
0
false
21,319,006
0
0
1
1
How to avoid that that a user has two opened issues in Jira? It's possible that Jira treat issue management in this way: when a user has a issue opened and will open another issue, this first one must be automatically paused?
downloading or displaying BlobProperties from Google App Engine
21,323,348
0
0
97
0
python,google-app-engine
It entirely depends on what you are currently storing in the BlobProperty. Since it is typically used to store data with an upper size limit of 1 MB, I am assuming that you are storing it for images or even some files, which are under that limit. In all probability, you might want to either provide a link to the user ...
0
1
0
0
2014-01-24T01:28:00.000
2
0
false
21,322,741
0
0
1
1
How would I go about selecting and downloading or displaying individual entries from the Datastore. Specifically if those entries contain a BlobProperty.
Bitcoinrpc connection to remote server
21,972,946
-1
0
1,399
0
python,django,heroku,rpc,bitcoin
You can use SSL with RPC to hide the password. rpcssl=1
0
0
0
0
2014-01-24T03:48:00.000
2
-0.099668
false
21,324,050
0
0
1
1
Hey I was wondering if anyone knew how to connect to a bitcoin wallet located on another server with bitcoinrpc I am running a web program made in django and using a python library called bitcoinrpc to make connections. When testing locally, I can use bitcoinrpc.connect_to_local), or even bitcoinrpc.connect_to_remote('...
Ironworker job done notification
21,348,604
-1
1
209
0
python,heroku,notifications,worker
Easiest way - push message to your api from worker - it's log or anything you need to have in your app
0
0
0
1
2014-01-24T16:59:00.000
2
-0.099668
false
21,338,216
0
0
1
1
I'm writing python app which currently is being hosted on Heroku. It is in early development stage, so I'm using free account with one web dyno. Still, I want my heavier tasks to be done asynchronously so I'm using iron worker add-on. I have it all set up and it does the simplest jobs like sending emails or anything th...
Avoiding a 100ms http request to slow down the REST API where it's called from
21,350,980
1
0
1,501
0
android,python,web,google-cloud-messaging,bottle
The problem is that your clients are waiting for your server to send the GCM push notifications. There is no logic to this behavior. You need to change your server-side code to process your API requests, close the connection to your client, and only then send the push notifications.
0
0
1
0
2014-01-25T10:39:00.000
3
0.066568
false
21,349,462
0
0
1
2
I'm developing a multiplayer Android game with push notifications by using Google GCM. My web server has a REST API. Most of the requests sent to this API send a request to Google GCM server to send a notification to the opponent. The thing is on average, a call to my API is ~140 ms long, and ~100 ms is due to the http...
Avoiding a 100ms http request to slow down the REST API where it's called from
21,349,485
0
0
1,501
0
android,python,web,google-cloud-messaging,bottle
The best thing you can do is making all networking asynchronous, if you don't do this yet. The issue is that there will always be users with a slow internet connection and there isn't a generic approach to bring them fast internet :/. Other than that, ideas are to send only few small packets or one huge in favor of m...
0
0
1
0
2014-01-25T10:39:00.000
3
0
false
21,349,462
0
0
1
2
I'm developing a multiplayer Android game with push notifications by using Google GCM. My web server has a REST API. Most of the requests sent to this API send a request to Google GCM server to send a notification to the opponent. The thing is on average, a call to my API is ~140 ms long, and ~100 ms is due to the http...
Best way to use ZeroRPC on Heroku server
35,026,440
0
5
464
0
python,heroku,flask
According to Heroku spec you are supposed to listen to single PORT which is given to your app in env. variable. In case your application needs only single port (for the ZeroRPC), you might be luck. But you shall expect your ZeroRPC being served on port 80. Possible problems: not sure, if Heroku allows other than HTTP ...
0
0
0
1
2014-01-26T04:03:00.000
1
0
false
21,359,542
0
0
1
1
We're using Heroku for historical reasons and I have this awesome ZeroRPC based server that I'd love to put up on the Heroku service. I'm a bit naive around exactly the constraints imposed for these 'cloud' based platforms but most do not allow the opening of an arbitrary socket. So I will either have to do some port-f...
Django / Python, continuosly add data to database via command line
21,368,318
1
0
408
0
python,django,streaming
You have a couple of options I can see, and for various projects I've used both of them without any significant problems (but not at the same time) Creating custom management command (as you mentioned). The only issue I've run into was that I had a log file that was by default owned by apache (since that was running ...
0
0
0
0
2014-01-26T16:40:00.000
1
0.197375
false
21,366,217
0
0
1
1
I'm in the process to write a new application, I was thinking in using django for the http side but I was thinking on the best way for handling the data. My problem is that I need to acquire continue data from different processes, save them as files and insert every related info into the database. The main scope is to...
custom _id fields Django MongoDB MongoEngine
21,498,341
6
0
2,413
1
python,django,mongodb,mongoengine
You can set the parameter primary_key=True on a Field. This will make the target Field your _id Field.
0
0
0
0
2014-01-26T23:51:00.000
1
1.2
true
21,370,889
0
0
1
1
is it possible to use custom _id fields with Django and MongoEngine? The problem is, if I try to save a string to the _id field it throws an Invalid ObjectId eror. What I want to do is using my own Id's. This never was a problem without using Django because I caught the DuplicateKeyError on creation if a given id was a...
Writing a java server for queueing incoming HTTP Request and processing them a little while later?
21,372,962
5
3
361
0
python,scala,clojure,netty,java-server
I did something similar with Scala Akka actors. Instead of HTTP Request I had unlimited number of job requests come in and get added to a queue (regular Queue). Worker Manager would manage that queue and dispatch work to worker actors whenever they are done processing previous tasks. Workers would notify Worker Manager...
0
0
0
0
2014-01-27T04:12:00.000
1
1.2
true
21,372,906
0
0
1
1
I want to write an Java Server may be using Netty or anything else suggested. The whole purpose is that I want to queue incoming HTTP Request for a while because the systems I'm targeting are doing Super Memory and Compute intensive tasks so if they are burdened with heavy load they eventually tend to get crashed. I w...
Django from Virtualenv Multiple processes running
21,577,197
0
0
311
0
python,django,bash,process,virtualenv
I've solved the mistery: Django was trying to send emails but it could not because of improper configuration, so it was hanging there forever trying to send those emails. Most probably (I'm not sure here) Django calls an OS function or a subprocess to do so. The point is that the main process was forking itself and ...
0
0
0
0
2014-01-27T10:36:00.000
1
1.2
true
21,378,559
0
0
1
1
I'm running a local django development server together with virtualenv and it's been a couple of days that it behaves in a weird way. Sometimes I don't see any log in the console sometimes I see them. A couple of times I've tried to quit the process and restart it and I've got the port already taken error, so I inspect...
business logic in Django
21,378,863
1
7
7,262
0
python,django
If the functionality fits well as a method of some model instance, put it there. After all, models are just classes. Otherwise, just write a Python module (some .py file) and put the code there, just like in any other Python library. Don't put it in the views. Views should be the only part of your code that is aware of...
0
0
0
0
2014-01-27T10:40:00.000
4
0.049958
false
21,378,653
0
0
1
3
I'd like to know where to put code that doesn't belong to a view, I mean, the logic. I've been reading a few similar posts, but couldn't arrive to a conclusion. What I could understand is: A View is like a controller, and lot of logic should not put in the controller. Models should not have a lot of logic either. S...
business logic in Django
24,603,223
7
7
7,262
0
python,django
Having a java background I can relate with this question. I have been working on python for quite some time. Even though I do my best to treat Java as Java and Python as Python, some times I mix them both so that I can get a good deal out of both. In short Put all model related stuff in models app, it could be from ...
0
0
0
0
2014-01-27T10:40:00.000
4
1
false
21,378,653
0
0
1
3
I'd like to know where to put code that doesn't belong to a view, I mean, the logic. I've been reading a few similar posts, but couldn't arrive to a conclusion. What I could understand is: A View is like a controller, and lot of logic should not put in the controller. Models should not have a lot of logic either. S...
business logic in Django
21,378,901
7
7
7,262
0
python,django
I don't know why you say we can't put a lot of logic in the controller, and we cannot have the models with a lot of logic either You can certainly put logic in either of those places. It depends to a great extent what that logic is: if it's specifically related to a single model class, it should go in the model. If h...
0
0
0
0
2014-01-27T10:40:00.000
4
1
false
21,378,653
0
0
1
3
I'd like to know where to put code that doesn't belong to a view, I mean, the logic. I've been reading a few similar posts, but couldn't arrive to a conclusion. What I could understand is: A View is like a controller, and lot of logic should not put in the controller. Models should not have a lot of logic either. S...
django replace old image uploaded by ImageField
21,394,103
1
0
1,118
0
python,django
This might get tricky, And a lot of times depends on what are your constraints. 1. Write your own save method for the model and then delete the old image a and replace with a new one. os.popen("rm %s" % str(info.photo.path)) Write a cron job to purge all the unreferenced files. But then again if disk space is ...
0
0
0
0
2014-01-27T23:09:00.000
2
0.099668
false
21,393,655
0
0
1
1
How I can replace one image uploaded by an ImageField (in my models) with the new one selected by the same ImageField? And, can I delete all images uploaded by an ImageField when I delete the model object (bulk delete)?
Why is it taking more time, When i upgrade a module in Openerp
21,398,386
0
0
155
0
python-2.7,openerp,base
why you going in installed modules and search for base module and update it? you have to only update that module in which you have done changes in xml file not event py file. if you have changes in xml file of those module you have to update only those module. if you going to update base module it will update all modul...
0
0
0
1
2014-01-28T05:30:00.000
2
0
false
21,397,605
0
0
1
2
I'm new to Openerp.I have modified the base module and when i goto installed modules and search for BASE module and click upgrade button it is nearly taking 5mins.Can any one please say me how can i reduce the time that is taking for up-gradation of existing module. Note: I have Messaging,Sales,Invoicing,Human-resource...
Why is it taking more time, When i upgrade a module in Openerp
21,398,452
1
0
155
0
python-2.7,openerp,base
As you have said that You are new to OpenERP, Let me tell you something which would be very helpful to you. i.e Never Do changes in Standard modules not in base. If you want to add or remove any functionality of any module, you can do this by creating a customzed module. in which inherit the object you want, and d...
0
0
0
1
2014-01-28T05:30:00.000
2
1.2
true
21,397,605
0
0
1
2
I'm new to Openerp.I have modified the base module and when i goto installed modules and search for BASE module and click upgrade button it is nearly taking 5mins.Can any one please say me how can i reduce the time that is taking for up-gradation of existing module. Note: I have Messaging,Sales,Invoicing,Human-resource...
Any python web framework with the following features?
21,403,116
-1
0
343
0
python,mongodb,deployment,architecture
Try Django.. im not sure but worth trying
0
0
0
0
2014-01-28T10:25:00.000
3
-0.066568
false
21,402,952
0
0
1
1
As the basic framework core: Request Lifecycle REST Routing Requests & Input Views & Responses Controllers Errors & Logging And these features would make our dev easy and fast: Authentication Cache Core Extension Events Facades Forms & HTML IoC Container Mail Pagination Queues Security Session SSH Templates Unit T...
Do I need to user schemamigration and migrate commands after changing a field name or a field data type in a model?
21,417,983
2
2
54
0
python,django
Yes, Django won't recognize the field if you change the name. I will say that the "field does not exist", so YES, you have to run Django's South migrate / schemamigration as you asked. Datatype YES as well. Django may be okay at first if you only change the field type depending, but may run into problems later depe...
0
0
0
0
2014-01-28T21:49:00.000
2
1.2
true
21,417,637
0
0
1
2
The problem is pretty self-explanatory in the title. Do I need to do that or I just need to edit the existing migration file?
Do I need to user schemamigration and migrate commands after changing a field name or a field data type in a model?
21,418,000
1
2
54
0
python,django
You need to do a schemamigration every time you change your models. On every call of python manage.py migrate command south record number of the latest migration applied into database migrationhistory table. So if you just change existing migration it won't be applied because south would think it's already applied. You...
0
0
0
0
2014-01-28T21:49:00.000
2
0.099668
false
21,417,637
0
0
1
2
The problem is pretty self-explanatory in the title. Do I need to do that or I just need to edit the existing migration file?
One login for multiple products
21,426,172
0
1
386
0
python,django,authorization,server-side
The authentification method in every application connects to the same webservice for autentification.
0
0
1
0
2014-01-29T08:44:00.000
3
0
false
21,426,024
0
0
1
2
There are multiple mobile apps. I want people using one app to login with their same login credentials into all other apps. What is the best approach to implement this? I'm thinking to create a separate authorization server that will issue tokens/secrets on registering and logins. It will have a validation API that wil...
One login for multiple products
21,427,549
1
1
386
0
python,django,authorization,server-side
First check if OAuth could be adapted to using this, that would save you a lot of work. Of course all the services and apps would have to talk to some backend network server to sync tokens issued to apps. Half-secure/maybe-abusable solution: have symmetric cipher encrypted cookie that webpages (and apps?) hold and use ...
0
0
1
0
2014-01-29T08:44:00.000
3
1.2
true
21,426,024
0
0
1
2
There are multiple mobile apps. I want people using one app to login with their same login credentials into all other apps. What is the best approach to implement this? I'm thinking to create a separate authorization server that will issue tokens/secrets on registering and logins. It will have a validation API that wil...
How to send an array from Python (client) to Java (Server)?
21,436,939
1
0
129
0
java,python,sockets
A meta-answer would be to use JSON, since JSON generators and parsers can be found for every major programming language.
0
0
0
1
2014-01-29T16:24:00.000
2
1.2
true
21,436,787
0
0
1
2
I am using OpenCV on my Raspberry Pi to track circular objects. Then, I want to send the coordinate and radius values in an array of floats across the LAN to the Java program I can send strings all fine with the code I have, but I'm having trouble trying to send numerical datatypes. What is the correct process for this...
How to send an array from Python (client) to Java (Server)?
21,437,109
1
0
129
0
java,python,sockets
Have you looked at BSON? It's like JSON, but optimised for a little more speed.
0
0
0
1
2014-01-29T16:24:00.000
2
0.099668
false
21,436,787
0
0
1
2
I am using OpenCV on my Raspberry Pi to track circular objects. Then, I want to send the coordinate and radius values in an array of floats across the LAN to the Java program I can send strings all fine with the code I have, but I'm having trouble trying to send numerical datatypes. What is the correct process for this...
Django admin project distribution and management
21,442,464
0
0
82
0
python,django,django-admin
What would be best to do is write your core project on one side, and store it in a repository (version control). Apart from that, write your sub-applications as requirements and store/track them on separate version control. Then, to keep everything working together and keep it all integrated, what you should do is that...
0
0
0
0
2014-01-29T19:42:00.000
1
0
false
21,440,987
0
0
1
1
I have core django admin project that when my customers purchase needs to be modified both in configuration and function. Each customer will have their own instance of the project installed on a different server. Currently I am using django apps to separate out the difference in clients and using settings.py to load th...
Creating a web service for Qualtrics written in Python on Google App Engine
21,449,385
0
0
909
0
python,web-services,google-app-engine,rest,qualtrics
I am familiar with Qualtrics but I will answer (b) first. You can write a Python Web Service in a variety of ways, depending on your choice: You could write a simple get handler Use Google Cloud Endpoints Use one of several Web Services Python libraries Having said that, a quick glance at Qualtrics indicated that it ...
0
1
0
0
2014-01-30T00:55:00.000
1
1.2
true
21,445,897
0
0
1
1
Has anyone out there created a a.) web service for Qualtrics or b.) a Python web service on Google App Engine? I need to build in some functionality to a Qualtrics survey that seems only a web service (in the Qualtrics Survey Flow) could do, like passing parameters to a web service then getting a response back. I've l...
Best Folder Structure For Abstract Models
21,447,135
2
1
590
0
python,django
Well, there's an amount of subjectivity in this choice. It does depend on whether all of these different documents are pretty much the same thing (just relatively minor variations but still more or less similar), or if they have a large amount of very specific functionality. I guess yours is probably the first, in whic...
0
0
0
0
2014-01-30T02:19:00.000
1
1.2
true
21,446,649
0
0
1
1
I have an abstract model called documents. Types of documents like "invoices" and "quotes" inherit from this class. This is my first Django project and I'm a bit unclear of the best folder structure. I was planning to make each type of document get its own app. So, there would be an app for "invoices" and an app for "...
Does OpenERP convert False value to NULL when affected to integer?
27,442,462
4
1
1,668
0
python,orm,openerp,odoo
Yes, when issuing a ORM '.search' query, pass in Python False to represent database nulls. The ORM has no 'is' operator, so you must query for ('column', '=', False). Similarly, when '.browse' returns rows, database nulls are converted into Python False. I believe the reason for this is that xmlrpc (which is used to se...
0
0
0
0
2014-01-30T10:37:00.000
1
0.664037
false
21,454,046
0
0
1
1
Within OpenERP, when you define a new char field in python and set False as default value, the field will be set to NULL in the db, the ORM taking care of the conversion. Does the ORM also convert integer type the same way, or should I be careful that it may convert it to 0 instead of NULL? Where could I find the on th...
Pelican restarting you server
50,008,098
0
3
990
0
python,pelican
When you press Ctrl + C or Ctrl + z, do not restart the HTTP server: it is running in the background, and that is the exact reason as why you are getting that error message. To see that the server is running in the background after pressing the any of the key combinations above, try to edit and save any file: you will...
0
0
0
0
2014-01-30T11:50:00.000
3
0
false
21,455,719
0
0
1
2
Hi I just started working with Pelican and it really suits my needs, I had tried to build blogs in Flask and other frameworks but I really just wanted something simple so I can post about math, and pelican just works. My question is when I am testing on my machine, I start the server; however when I stop the server to ...
Pelican restarting you server
27,992,709
2
3
990
0
python,pelican
For your development server, you can also use the script ./develop_server.sh that comes with the last versions of pelican (at least with the 3.5.0). Build the blog and load a server with ./develop_server.sh start: it reloads each time you edit your blog (except the settings). Simply stop with ./develop_server.sh stop w...
0
0
0
0
2014-01-30T11:50:00.000
3
0.132549
false
21,455,719
0
0
1
2
Hi I just started working with Pelican and it really suits my needs, I had tried to build blogs in Flask and other frameworks but I really just wanted something simple so I can post about math, and pelican just works. My question is when I am testing on my machine, I start the server; however when I stop the server to ...
How can I change Django admin language?
32,872,393
28
20
18,987
0
python,django,django-i18n
In your settings.py just add 'django.middleware.locale.LocaleMiddleware' to your MIDDLEWARE_CLASSES setting, making sure it appears after 'django.contrib.sessions.middleware.SessionMiddleware'.
0
0
0
0
2014-01-30T23:14:00.000
3
1
false
21,469,470
0
0
1
1
I have a django 1.6 site with i18n working. I can change the frontend language with a select box in the top of the template, but I don't know if there is a django app or trick to change the admin language, because it seems to store somewhere in session variable, and it keeps the first language I have used in the fronte...
sending image on client side takes too much time in django
21,473,553
0
0
83
0
python,django,image
Storing your images in database to serve them on a page is not a good idea. Upload them to a CDN , and store the URLs in your database.
0
0
0
0
2014-01-31T06:06:00.000
1
1.2
true
21,473,532
0
0
1
1
I am storing images as base64 string in database(MYSQL) and then when requested from client side(HTML webpages simply), sending base64 strings of images along with some other data from tables and then embedding this data in img tag on client side. These tags are built on dynamically using javascript. But this approach...
Eclipse, PyDev, Jython, external JAR
21,758,703
1
0
483
0
python,eclipse,jar,pydev,jython
Yes, PyDev is not able to read an 'aggregating' jar, so, you really have to add those other jars manually.
0
0
0
0
2014-01-31T12:52:00.000
1
1.2
true
21,480,554
1
0
1
1
I'm using Eclipse, PyDev and Jython together on a project. It works well, but I have a problem with an external jar. This jar is special, has no .class files inside it just a manifest which uses Class-Path attribute to list additional jars (just aggregating a bunch of jars). It seems like adding this as an external jar...
How to run a system command from a django web application?
21,489,049
1
0
148
0
python,linux,django,celery
Here is one approach: in your Django web application, write a message to a queue (e.g., RabbitMQ) containing the information that you need. In a separate system, read the message from the queue and perform any file actions. You can indeed use Celery for setting up this system.
0
1
0
0
2014-01-31T17:29:00.000
1
1.2
true
21,486,362
0
0
1
1
Does anyone knows of a proven and simple way of running a system command from a django application? Maybe using celery? ... From my research, it's a problematic task, since it involves permissions and insecure approaches to the problem. Am i right? EDIT: Use case: delete some files on a remote machine. Thanks
translating strings from database flask-babel
22,099,629
2
9
1,789
1
python,flask,python-babel,flask-babel
It's not possible to use Babel in database translations, as database content is dynamic and babel translations are static (they didn't change). If you read the strings from the database you must save the translations on the database. You can create a translation table, something like (locale, source, destination), and...
0
0
0
0
2014-02-01T11:31:00.000
2
0.197375
false
21,497,489
0
0
1
1
I'm using Flask-Babel for translating string. In some templates I'm reading the strings from the database(postgresql). How can I translate the strings from the database using Flask-Babel?
How do you return a Partial response in app engine python endpoints?
23,165,174
0
0
418
0
google-app-engine,python-2.7,google-cloud-endpoints
From what I gather, Google has enabled partial response for their APIs, but has not yet explained how to enable it for custom APIs. I'm assuming if they do let us know, it might entail annotations, and possibly overriding a method or two. I've been looking also, to no avail. I've been looking into this just due to a re...
0
1
1
0
2014-02-02T21:10:00.000
2
1.2
true
21,516,287
0
0
1
1
I am learning endpoints and saw that other Google APIs have this "fields" query attribute. Also it appears in the api explorer. I would like to get a partial response for my api also, but when using the fields selector from the api explorer it is simply ignored by the server. Do I need to implement something in the s...
How should I set up my dev enviornment for a django app so that I can pull on static s3 files?
21,518,701
1
0
41
1
python,django,mongodb,postgresql,amazon-s3
Its good to have different settings for production and dev. So you can just create a settings folder and have settings may be prod.py and dev.py. this will let you use diff apps for eg: you actually don't need debug tool bar on prod. And regarding the file, I feel you dont have to worry about the structure as such, ...
0
0
0
0
2014-02-03T00:53:00.000
1
1.2
true
21,518,268
0
0
1
1
I'm having trouble in establishing an ideal setup where I can distinguish between production and test environment for my django app. I'm using a postgresql database that stores a relative file path to a s3 bucket after I upload an image. Am I supposed to make a production copy of all the files in the s3 bucket and con...
How to get Sphinx working with Jython on an unnetworked Windows 7 computer?
21,824,353
1
1
376
0
windows,jython,python-sphinx,jython-2.5
I have managed to get it working. The problem was that the manual installation and the use of Jython meant that certain environment variables that were expected were not in place. Also, the use of Windows 7 (and I believe MS Windows in general) means that Python scripts without an extension cannot be run without callin...
0
0
0
0
2014-02-03T12:11:00.000
1
1.2
true
21,527,115
1
0
1
1
Once sphinx-apidoc has been run the command C:\path\to\doc\make html produces an error beginning: The 'sphinx-build' command was not found [snip] However the command does exist and the relevant environment variables are set. More detail: 1 - Trying to run sphinx_apidoc: 'C:\path\to\jython\bin\sphinx-apidoc' is not r...
Add plugin on Django-CMS page programatically in unit test
21,529,356
1
0
710
0
python,django,unit-testing,plugins,django-cms
create a page with cms.api... and then get the right placeholder form page.placeholders.all() and call the add_plugin() with this.
0
0
0
0
2014-02-03T13:55:00.000
1
1.2
true
21,529,226
0
0
1
1
My Django app needs a test that follows the following scenario: creates a page, edits it by adding a new plugin, then saves it. So far, I am stuck at adding the plugin to the page. How can I do this programatically in a test? I looked over add_plugin() from cms.api, but it needs a placeholder, which I have no idea how ...
Running unittest Test Cases and Robot Framework Test Cases Together
26,558,782
2
6
7,792
0
python,robotframework,python-unittest
Robot is not at all based on xunit technologies. Personally I think it makes a great unit testing framework for python code, since you can create keywords that can directly import your modules. I use this technique for some projects I work on. With robot, you can tag your unit tests or put them all in a separate hierar...
0
0
0
1
2014-02-03T18:37:00.000
3
0.132549
false
21,535,028
0
0
1
2
Our group is evaluating Robot Test Framework for our QA group, not just for BDD, but also to possibly cover a lot of our regular functionality testing needs. It certainly is a compelling project. To what extent, if any, is Robot Framework based on xunit (unittest) architecture? I see that unittest asserts can be used, ...
Running unittest Test Cases and Robot Framework Test Cases Together
21,565,221
10
6
7,792
0
python,robotframework,python-unittest
RobotFramework is not the right tool for unit testing. Unit-tests should be written in the same language of the units (modules, classes, etc.) The ability to describe scenarios in natural language (which is one of the strongest features of systems like RF) is worthless in unit tests. At this level of testing scenarios...
0
0
0
1
2014-02-03T18:37:00.000
3
1
false
21,535,028
0
0
1
2
Our group is evaluating Robot Test Framework for our QA group, not just for BDD, but also to possibly cover a lot of our regular functionality testing needs. It certainly is a compelling project. To what extent, if any, is Robot Framework based on xunit (unittest) architecture? I see that unittest asserts can be used, ...
Pycharm: set environment variable for run manage.py Task
22,899,916
39
45
74,590
0
python,django,pycharm
To set your environment variables in PyCharm do the following: Open the 'File' menu Click 'Settings' Click the '+' sign next to 'Console' Click Python Console Click the '...' button next to environment variables Click the '+' to add environment variables
0
0
0
0
2014-02-03T22:07:00.000
16
1
false
21,538,859
1
0
1
6
I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell. When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria...
Pycharm: set environment variable for run manage.py Task
21,603,624
15
45
74,590
0
python,django,pycharm
Same here, for some reason PyCharm cant see exported env vars. For now i set SECRET_KEY in PyCharm Run/Debug Configurations -> "Environment variables"
0
0
0
0
2014-02-03T22:07:00.000
16
1
false
21,538,859
1
0
1
6
I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell. When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria...
Pycharm: set environment variable for run manage.py Task
30,374,246
22
45
74,590
0
python,django,pycharm
Another option that's worked for me: Open a terminal Activate the virtualenv of the project which will cause the hooks to run and set the environment variables Launch PyCharm from this command line. Pycharm will then have access to the environment variables. Likely because of something having to do with the PyCharm ...
0
0
0
0
2014-02-03T22:07:00.000
16
1
false
21,538,859
1
0
1
6
I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell. When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria...
Pycharm: set environment variable for run manage.py Task
28,723,630
20
45
74,590
0
python,django,pycharm
You can set the manage.py task environment variables via: Preferences| Languages&Frameworks| Django| Manage.py tasks Setting the env vars via the run/debug/console configuration won't affect the built in pycharm's manage.py task.
0
0
0
0
2014-02-03T22:07:00.000
16
1
false
21,538,859
1
0
1
6
I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell. When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria...
Pycharm: set environment variable for run manage.py Task
41,200,535
0
45
74,590
0
python,django,pycharm
Please note that the answer mentioned by "nu everest" works but you will not see Console tab available unless you create a project in pycharm. As individual files can be run without creating a project in pycharm some people might be confused. Although you have also to note that settings are lost to run-configurations t...
0
0
0
0
2014-02-03T22:07:00.000
16
0
false
21,538,859
1
0
1
6
I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell. When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria...
Pycharm: set environment variable for run manage.py Task
65,267,215
4
45
74,590
0
python,django,pycharm
When using PyCharm along with Django, there are multiple sections where you can set environment variables (EVs): File > Settings > Languages and Frameworks > Django There's no purpose to set EVs here File > Settings > Build, Execution, Deployment > Console > Python Console There's no purpose to set EVs here File...
0
0
0
0
2014-02-03T22:07:00.000
16
0.049958
false
21,538,859
1
0
1
6
I have moved my SECRET_KEY value out of my settings file, and it gets set when I load my virtualenv. I can confirm the value is present from python manage.py shell. When I run the Django Console, SECRET_KEY is missing, as it should. So in preferences, I go to Console>Django Console and load SECRET_KEY and the appropria...
Pagination in Google App EngineSearch API
37,264,173
1
6
575
0
python,google-app-engine
Sorry to revive this old question, but I have a solution for this issue given a few constraints with possible workarounds. Basically, the cursors for previous pages can be stored and reused for revisiting that page. Constraints: This requires that pagination is done dynamically (e.g. with Javascript) so that older curs...
0
1
0
0
2014-02-04T06:40:00.000
2
0.099668
false
21,545,635
0
0
1
1
I want to do pagination in google app engine search api using cursors (not offset). the forward pagination is straight forward , the problem is how to implement the backward pagination.
how do I re-write/redirect URLs in Gunicorn web server configuration?
21,556,311
1
0
1,587
0
python,https,gunicorn,url-pattern
The protocol has nothing to do with django. That part is handled by your http server
0
0
0
0
2014-02-04T15:17:00.000
1
0.197375
false
21,556,278
0
0
1
1
I'm building a Django-based app, and I need it to use secure requests. The secure requests in my site are enabled and manually writing the url gets it through fine. As I have quite a lot of urls I don't want to do it manually, but instead do something so Django always sends secure requests. How can I make it so it alwa...
Redirect user when the worker is done
21,561,671
1
2
191
0
python,redirect,flask,worker
You can do it as follows: When the user presses the button the server starts the task, and then sends a response to the client, possibly a "please wait..." type page. Along with the response the server must include a task id that references the task accessible to Javascript. The client uses the task id to poll the ser...
0
0
0
0
2014-02-04T17:12:00.000
1
1.2
true
21,558,984
0
0
1
1
I have the app in python, using flask and iron worker. I'm looking to implement the following scenario: User presses the button on the site The task is queued for the worker Worker processes the task Worker finishes the task, notifies my app My app redirects the user to the new endpoint I'm currently stuck in the mid...
Keeping live audio stream synced
27,043,950
0
0
661
0
python,streaming,audio-streaming,ntp,gstreamer
Sorry for bring up an old question but this is something that I am looking into. I believe you need to look at Real Time Streaming Protocol (RTSP) is a network control protocol designed for use in entertainment and communications systems to control streaming media servers. The protocol is used for establishing and cont...
0
1
0
0
2014-02-04T19:18:00.000
2
0
false
21,561,405
0
0
1
2
I'm working on an application to provide multi-room audio to devices and have succeeded in keeping audio playing from a file (e.g. mp3) synced using GST and manually using NTP but I can't seem to get a live audio stream to sync. Essentially I want to be able to stream audio from one device to one or more other devices ...
Keeping live audio stream synced
21,566,534
1
0
661
0
python,streaming,audio-streaming,ntp,gstreamer
Unfortunately, delay as low as 10 milliseconds is noticeable to most folks. Musicians tend to appreciate even lower delay than that. And if you have any of the speakers from different devices within earshot of each other, you're going to run into phase issues at even the slightest unpredictable delay (which is inevit...
0
1
0
0
2014-02-04T19:18:00.000
2
0.099668
false
21,561,405
0
0
1
2
I'm working on an application to provide multi-room audio to devices and have succeeded in keeping audio playing from a file (e.g. mp3) synced using GST and manually using NTP but I can't seem to get a live audio stream to sync. Essentially I want to be able to stream audio from one device to one or more other devices ...
Reorder model objects in django admin panel
21,579,803
4
13
5,031
0
python,django,django-models,django-admin
I don't see an obvious solution to this — the models are sorted by their _meta.verbose_name_plural, and this happens inside the AdminSite.index view, with no obvious place to hook custom code, short of subclassing the AdminSite class and providing your own index method, which is however a huge monolithic method, very i...
0
0
0
0
2014-02-05T13:14:00.000
5
1.2
true
21,578,382
0
0
1
1
I have several configuration objects in django admin panel. They are listed in the following order Email config General config Network config Each object can be configured separately, but all of them are included in General config. So basically you will need mostly General config, so I want to move it to the top. I k...
Pycharm - Pyramid debugging request
21,599,084
3
1
399
0
python-3.x,pyramid,pycharm
Finally I have figured it out. It was my fault. The project gets deployed as an egg so that's where I was suppose to place my breakpoints. Thanks a lot for your time and consideration.
0
0
0
0
2014-02-05T13:16:00.000
1
0.53705
false
21,578,415
0
0
1
1
I am using Pycharm as IDE for one of my projects. The framework of choice is Pyramid and here comes my issue. I am not able to debug the request using PyCharm even though I start the application in debug mode. When a request is made from the browser the breakpoints from the views.py are not hit this does not apply for ...
How to automate Google Wallet order export data?
21,741,357
0
1
433
0
python,ruby,android-pay
analyticsPierce, I've asked the same question and have not received any answers. Here was my question, maybe we can work out a solution somehow. I've just about given up. "HttpWebRequest with Username/Password" on StackOverflow. Trey
0
0
1
0
2014-02-06T18:53:00.000
1
0
false
21,611,503
0
0
1
1
I am working to automate retrieving the Order data from the Google Wallet Merchant Center. This data is on the Orders screen and the export is through a button right above the data. Google has said this data is not available to export to a Google Cloud bucket like payments are and this data is not available through a ...
Algorithm for traversing website including forms
31,978,451
0
2
77
0
python,algorithm,web,hyperlink,traversal
The links in a set of web pages can be seen as a tree graph and hence you could use various tree traversal algorithms like depth first and breadth first search to find all links. The links and related form data can be saved in a queue or stack depending on what traversal algorithm you are using.
0
0
1
0
2014-02-06T19:32:00.000
1
0
false
21,612,246
0
0
1
1
I am successful to record all the links of the website but missed some of the links which can only be visible with the form posting (for example login). What i did is recorded all the links without login. And took the form values. Then i posted the data and recorded the new links, but here i missed the other forms and...
CKAN extension deployment not working
21,623,741
0
1
217
0
python,ckan
Do you need to clear your browser's cache? Are there any other settings (e.g. extra_public_paths) that are different between your dev and production machines?
0
0
0
1
2014-02-07T00:15:00.000
1
0
false
21,616,883
0
0
1
1
I have developed couple of extensions and never had any problem in deploying to the production server. I did try to installation a new extension today on my production server that works on my dev machine but doesn't work on the production server. I am suppose to see a new menu option as part on this new extension and I...
Where should I save the Amazon Manifest json file on an app hosted at PythonAnywhere?
21,627,045
2
1
155
0
json,pythonanywhere
You can get to /var/www/static in the File browser. Just click on the '/' in the path at the top of the page and then follow the links. You can also just copy things there from a Bash console. You may need to create the static folder in /var/www if it's not there already.
0
1
0
0
2014-02-07T01:25:00.000
2
0.197375
false
21,617,616
1
0
1
1
I am trying to have my app on Amazon appstore. In order to do this Amazon needs to park a small json file (web-app-manifest.json). If I upload it to the the root of my web site (as suggested), Amazon bot says it cannot access file. Amazon support mention I should save it to /var/www/static but either I don't know how ...
Accept permission request in chrome using selenium
21,686,531
8
9
21,421
0
google-chrome,python-2.7,selenium-webdriver
@ExperimentsWithCode Thank you for your answer again, I have spent almost the whole day today trying to figure out how to do this and I've also tried your suggestion where you add that flag --disable-user-media-security to chrome, unfortunately it didn't work for me. However I thought of a really simple solution: To ...
0
0
1
0
2014-02-07T13:23:00.000
8
1.2
true
21,628,904
0
0
1
1
I have a HTML/Javascript file with google's web speech api and I'm doing testing using selenium, however everytime I enter the site the browser requests permission to use my microphone and I have to click on 'ALLOW'. How do I make selenium click on ALLOW automatically ?
Get form data in pre_save
21,727,785
0
1
56
0
python,django,django-rest-framework
For anyone who has this problem this is my solution: I didn't use pre_save in the end and worked from validate, where you can access all the attributes.
0
0
0
0
2014-02-07T14:47:00.000
1
1.2
true
21,630,646
0
0
1
1
How can I access the form data in presave? More exactly I have a ManyToManyField (called user_list) in my models and I want to access the list from pre_save(self, obj) I've tryed self.object.user_list and even obj.user_list but I keep getting and error. Thanks
Google App Engine (Python): Allow entity 'previewing before 'submit'
21,631,790
4
1
54
0
python,google-app-engine,google-cloud-datastore,app-engine-ndb
It aint that difficult. Abstract: [User]-> Posts [Data] to the [EntityCreatorPreviewHandler] [EntityCreatorPreviewHandler]-> Recieves the data and creates the entity eg: book = Book(title='Test'). [EntityCreatorPreviewHandler]-> Templates the html and basically shows the entity with all it's attributes etc. [EntityC...
0
1
0
0
2014-02-07T15:25:00.000
1
1.2
true
21,631,528
0
0
1
1
I'd like users to create an entity, and preview it, before saving it in the datastore. For example: User completes entity form, then clicks "preview". Forwarded to an entity 'preview' page which allows the user to "submit" and save the entity in the datastore, or "go back" to edit the entity. How can I achieve this?
Getting connection object in generic model class
21,651,170
1
0
76
1
python,database-connection
Here's how I would do: Use a connection pool with a queue interface. You don't have to choose a connection object, you just pick the next on the line. This can be done whenever you need transaction, and put back afterwards. Unless you have some very specific needs, I would use a Singleton class for the database connec...
0
0
0
0
2014-02-08T19:39:00.000
1
1.2
true
21,650,889
0
0
1
1
I have a Model class which is part of my self-crafted ORM. It has all kind of methods like save(), create() and so on. Now, the thing is that all these methods require a connection object to act properly. And I have no clue on what's the best approach to feed a Model object with a connection object. What I though of so...
Simple explanation of Google App Engine NDB Datastore
21,658,988
13
17
7,423
1
python,google-app-engine,app-engine-ndb
I think you've overcomplicating things in your mind. When you create an entity, you can either give it a named key that you've chosen yourself, or leave that out and let the datastore choose a numeric ID. Either way, when you call put, the datastore will return the key, which is stored in the form [<entity_kind>, <id_o...
0
1
0
0
2014-02-09T05:53:00.000
2
1.2
true
21,655,862
0
0
1
1
I'm creating a Google App Engine application (python) and I'm learning about the general framework. I've been looking at the tutorial and documentation for the NDB datastore, and I'm having some difficulty wrapping my head around the concepts. I have a large background with SQL databases and I've never worked with any ...
Python cgi or wsgi
21,656,118
0
0
227
0
python,python-3.x,cgi,mod-wsgi,wsgi
Go ahead with your work.. It will be fine if you are using Common Gateway Interface but you should have a look at network traffic.
0
0
1
0
2014-02-09T06:17:00.000
1
0
false
21,656,058
0
0
1
1
Hi everyone i'm working on a social network project . I'm using Pythons Common Gateway Interface to write everything ,handle database , ajax . So i have a question , i heard that Web Server Gateway Interface is better than Common Gateway Interface and can handle more users and higher traffic but now i have already fini...
Using Groups in Django To Map Organizations
21,709,938
0
1
333
0
python,django
Sounds like the proper usecase for auth groups to me. Some sort of a department head role that can edit the name of a group they belong to (but not the permissions). Whoever IS creating the actual groups and setting permissions is a superuser. Even if you create your own model you can't escape the fact that authority m...
0
0
0
0
2014-02-09T21:40:00.000
1
1.2
true
21,665,412
0
0
1
1
I am creating a Django app where there will be organizations. Organizations will contain departments –– like human resources/sales –– that will each have their own permissions. The name and roles of groups must be set by the organization itself and won't be known in advance. There will also be different permissions gra...
Google Drive API + App Engine = time out
21,677,121
0
0
588
0
python,google-app-engine,oauth-2.0,google-drive-api,httplib2
You mention "AppEngine's oauth2 library", but then you say "Drive API calls time out". So modifying the Oauth http library won't affect Drive. Are you using the Google library for your Drive calls, or making direct REST HTTP calls? If the former, try ... HttpRequest.setConnectTimeout(55000) , if the latter just ... ...
0
1
0
0
2014-02-10T10:53:00.000
1
1.2
true
21,675,209
0
0
1
1
So I built an app on App Engine that takes users files and move them to certain folders in the same domain. I made REST api that calls Drive API to list files, rename files, and change permissions etc. On app load, it fires 4 ajax calls to the server to get name and id of folders and checking if certain folder exists. ...
Private Python API key when using Angular for frontend
21,684,701
0
0
82
0
python,security,angularjs,authentication
As long as you send the sensitive data outside, you are at risk. You can obfuscate your code so that first grade malicious users have a hard time finding the key, but basically breaking your security is just a matter of time as an attacker will have all the elements to analyse your protocol and exchanged data and desig...
0
0
0
1
2014-02-10T17:50:00.000
1
0
false
21,684,420
0
0
1
1
I have a server implementing a python API. I am calling functions from a frontend that uses Angular.js. Is there any way to add an authentication key to my calls so that random people cannot see the key through the Angular exposed code? Maybe file structure? I am not really sure.
Real-time timeline function like tweetdeck?
22,314,409
0
0
424
0
python,tweepy
Twitter is a Python library, so there's really no way to use it directly on a website. You could send the data from the stream to a browser using WebSockets or AJAX long polling, however. There's no way to have the Userstream endpoint send tweets to you any faster - all of that happens on Twitter's end. I'm not sure wh...
0
0
0
0
2014-02-10T20:26:00.000
1
0
false
21,687,216
0
0
1
1
I'm creating an app using python/tweepy I'm able to use the StreamListener to get real time "timeline" when indicating a "topic" or #, $, etc. Is there a way to have a real-time timeline function similar to tweetdeck or an embedded widget for a website for the user ID? non-stop When using api.user_timeline receiving t...
How do I find the postgres version running on my heroku app?
21,710,704
2
2
37
0
python-2.7,heroku-postgres
$ heroku pg:info --app yourapp
0
0
0
0
2014-02-11T11:39:00.000
1
1.2
true
21,700,792
0
0
1
1
I have a python / django app on heroku. how do i find the postgres version running on my app?
Python backend and html/ajax front end, need suggestions for my application
21,705,056
0
1
1,253
0
python,ajax
you should use Django framework for your app. You can integrate your scripts into Django views. And you can also use the loaddata system in order to insert your yaml data into the database
0
0
1
0
2014-02-11T14:44:00.000
2
0
false
21,704,977
0
0
1
1
Currently I have written a python script that extracts data from flickr site, and dump as a python class object and YAML file. I was planning to turn this into a website: and a simple html front page that can send a request to the backend, triggers the python scripts running on the backend the response will be pars...
Django queue function calls
21,718,657
0
0
297
0
python,django,post,dhtmlx
It seems like you should build the queue in django. If the rows need to be processed serially on the backend, then insert the change data into a queue and process the queue like an event handler. You could build a send queue using dhtmlx's event handlers and the ajax callback handler, yet why? The network is already s...
0
0
0
0
2014-02-11T14:45:00.000
1
0
false
21,704,996
0
0
1
1
I have small problem with the nature of the data processing and django. for starters. I have webpage with advanced dhtmlx table. While adding rows to table DHTMLX automatically send POST data to mine django backend where this is processed and return XML data is sent to webpage. All of it works just fine when adding 1 r...
Python - how to send file from filesystem with a unicode filename?
21,716,642
0
1
887
0
python,unicode,flask
OK, after wrestling with it under the hood for a while I fixed it, but not in a very elegant way, I had to modify the source of some werkzeug things. In "http.py", I replaced str(value) with unicode(value), and replaced every instance of "latin-1" with "utf-8" in both http.py and datastructures.py. It fixed the problem...
0
0
0
1
2014-02-11T23:07:00.000
1
1.2
true
21,715,132
0
0
1
1
So I am using Flask to serve some files. I recently downgraded the project from Python 3 to Python 2.7 so it would work with more extensions, and ran into a problem I did not have before. I am trying to serve a file from the filesystem with a Japanese filename, and when I try return send_from_directory(new_folder_path,...
Can serialized objects be accessed simultaneously by different processes, and how do they behave if so?
21,718,777
1
0
2,682
0
python,serialization,pickle,shelve
Without trying it out I'm fairly sure the answer is: They can both be served at once, however, if one user is reading while the other is writing the reading user may get strange results. Probably not. Once the tree has been read from the file into memory the other user will not see edits of the first user. If the tr...
0
0
0
0
2014-02-12T01:36:00.000
2
1.2
true
21,716,890
1
0
1
1
I have data that is best represented by a tree. Serializing the structure makes the most sense, because I don't want to sort it every time, and it would allow me to make persistent modifications to the data. On the other hand, this tree is going to be accessed from different processes on different machines, so I'm worr...
Google App Engine, Illegal string in dataset id when uploading to local datastore
21,805,320
0
0
141
0
python,google-app-engine
I managed to discover the problem on my own. The issue was with adding s~ before the app_id in the app.yaml file. Despite the Google App Engine documentation stating that s~ should be before the app_id for applications using the High Replication Datastore, this apparently causes an error when uploading the the developm...
0
1
0
0
2014-02-12T05:30:00.000
1
1.2
true
21,719,461
0
0
1
1
Using the bulk loader, I've downloaded the live datastore, and am now trying to upload it to the development server. When running the upload_data command to upload the datastore to the dev server I get the following error, BadRequestError: Illegal string "dev~s~app_id" in dataset id. The command I'm using the upload t...
In django It's correct create much models into file models.py
21,720,470
-2
0
181
0
python,django,django-models,django-admin
All tables creates in to the models.py and all the query can be write in to views.py
0
0
0
0
2014-02-12T05:50:00.000
2
-0.197375
false
21,719,726
0
0
1
1
I am create a new web application with django but I have one question, if I need create 30 o 40 tables into data base, I need put all models into file models.py? So I think that this is very complicated of maintain, because this file may growa lot This is my question, is optimum make that?
Generating entity id with easily distinguished types/groups
21,740,467
0
1
115
0
javascript,python,postgresql,redis,uniqueidentifier
UUID version 4 is basically 122 random bits + 4 bits for UUID version + 2 bits reserved. Its uniqueness relies on low probability of generating the same 122 bits. UUID version 5 is basically 122 hash bits + 4 bits for UUID version + 2 bits reserved. Its uniquess relies on low probability of collision for 122-bit trunca...
0
0
0
0
2014-02-12T14:35:00.000
2
0
false
21,730,906
0
0
1
1
I need to generate unique id in distributed environment. Catch is that each id has to have a group/type information that can be examined by simple script. Details: I have some, fixed, number of entity types (lets call them: message, resource, user, session, etc). I need to generate unique id in form: so i can know whe...
Django http connection timeout
47,601,617
3
7
14,680
0
python,django,apache,mod-wsgi
I solved this problem with: python manage.py runserver --http_timeout 120
0
0
0
0
2014-02-12T18:27:00.000
2
0.291313
false
21,736,489
0
0
1
1
I have Django + mod_wsgi + Apache server. I need to change default HTTP connection timeout. There is Timeout directive in apache config but it's not working. How can I set this up?
Find user's Facebook friends who are also registered users on my site in Django
21,740,472
0
1
220
0
python,django,facebook,facebook-graph-api,facebook-fql
Find friend button is inefficient indeed, I would search the database just once at user registration.
0
0
0
0
2014-02-12T18:39:00.000
1
0
false
21,736,742
0
0
1
1
I'm developing a Django site that has as a feature its own social network. Essentially, the site stores connections between users. I want users to be able to import their pre-existing Facebook connections (friends) to my site, so that they will automatically be connected to their existing Facebook friends who are users...
Need to read XML files as a stream using BeautifulSoup in Python
21,740,512
2
3
1,799
0
python,xml
Beautiful Soup has no streaming API that I know of. You have, however, alternatives. The classic approach for parsing large XML streams is using an event-oriented parser, namely SAX. In python, xml.sax.xmlreader. It will not choke with malformed XML. You can avoid erroneous portions of the file and extract information ...
0
0
1
0
2014-02-12T21:44:00.000
1
1.2
true
21,740,376
0
0
1
1
I have a dilemma. I need to read very large XML files from all kinds of sources, so the files are often invalid XML or malformed XML. I still must be able to read the files and extract some info from them. I do need to get tag information, so I need XML parser. Is it possible to use Beautiful Soup to read the data as a...
Best format to pack data for correlation determination?
21,740,743
1
1
73
0
python,csv,scipy,correlation
Each dataset is a column and all the datasets combined to make a CSV. It get read as a 2D array by numpy.genfromtxt() and then call numpy.corrcoef() to get correlation coefficients. Note: you should also consider the same data layout, but using pandas. Read CSV into a dataframe by pandas.read_csv() and get the correlat...
0
0
0
0
2014-02-12T21:50:00.000
1
1.2
true
21,740,498
0
1
1
1
I'm using a Java program to extract some data points, and am planning on using scipy to determine the correlation coefficients. I plan on extracting the data into a csv-style file. How should I format each corresponding dataset, so that I can easily read it into scipy?
How to know whether login using social account or website login in Django
21,747,354
0
0
313
0
python,django,django-socialauth
A simple solution (when someone don't know the actual implementation) can be Create a new table with user as foreign key and one more column with will work as flag for type of authentication. The flag can be 1 for django user and 2 for social auth user While creating the user in your system populate this table accord...
0
0
0
0
2014-02-13T06:12:00.000
2
1.2
true
21,746,564
0
0
1
2
I'm develop the site using Django and am using django social_auth API for social login authentication. Here in my website no need to display the change password option when am login using social account. So how to hide that option when am login with social account. OR If there is any possibility to know whether login u...
How to know whether login using social account or website login in Django
21,769,885
0
0
313
0
python,django,django-socialauth
Check the session value social_auth_last_login_backend, if it's set it will have the last social backend used to login, if it's not set, then it means that the user logged in with non-social auth.
0
0
0
0
2014-02-13T06:12:00.000
2
0
false
21,746,564
0
0
1
2
I'm develop the site using Django and am using django social_auth API for social login authentication. Here in my website no need to display the change password option when am login using social account. So how to hide that option when am login with social account. OR If there is any possibility to know whether login u...
Django 1.4 - django.db.models.FileField.save(filename, file, save=True) produces error with non-ascii filename
21,777,287
0
1
1,378
0
python,django,unicode,encoding,utf-8
In your FileField definition the 'upload_to' argument might be like os.path.join(u'uploaded', 'files', '%Y', '%m', '%d') (see the first u'uploaded' started with u') so all string will be of type unicode and this may help you.
0
0
0
0
2014-02-13T07:26:00.000
2
0
false
21,747,765
0
0
1
1
I'm making a fileupload feature using django.db.models.FileField of Django 1.4 When I try to upload a file whose name includes non-ascii characters, it produces error below. 'ascii' codec can't encode characters in position 109-115: ordinal not in range(128) The actual code is like below file = models.FileField(_(...
Cronjob at given interval
21,785,587
0
0
52
0
python,cron,raspberry-pi
You can always add the unix command sleep xx to the cronjob before executing your command. Example: */15 * * * * (sleep 20; /root/crontabjob.sh) Now the job will run every 15 minutes and 20 seconds (00:15:20, 00:30:20), 00:45:20 ....)
0
0
0
1
2014-02-13T17:25:00.000
2
0
false
21,761,216
0
0
1
1
I have a python script that loads up a webpage on a raspberry. This script MUST run at startup, and then every 15 minutes. In future there will be many of these, maybe 1000 or even more. Currently i am doing this with a cronjob, but the problem with that is that all 1000 raspberries will connect to the webpage at the v...
Reload single module in cherrypy?
21,762,864
5
0
468
0
python,cherrypy
Reloading modules is very, very hard to do in a sane way. It leads to the potential of stale objects in your code with impossible-to-interrogate state and subtle bugs. It's not something you want to do. What real web applications tend to do is to have a server that stays alive in front of their application, such as Apa...
0
0
0
0
2014-02-13T18:29:00.000
1
1.2
true
21,762,574
0
0
1
1
Is it possible to use the python reload command (or similar) on a single module in a standalone cherrypy web app? I have a CherryPy based web application that often is under continual usage. From time to time I'll make an "important" change that only affects one module. I would like to be able to reload just that modu...
Simple way to send emails asynchronously
21,764,727
0
0
345
0
django,python-multithreading,django-commands
If you don't want to implement celery (which in my opinion isn't terribly difficult to setup), then your best bet is probably implementing a very simple queue using either your database. It would probably work along the lines of this: System determines that an email needs to be sent and creates a row in the database ...
0
1
0
0
2014-02-13T19:38:00.000
2
0
false
21,763,924
0
0
1
1
I'm running a django app and when some event occurs I'd like to send email to a list of recipients. I know that using Celery would be an intelligent choice, but I'd like to know if there's another, most simple way to do it without having to install a broker server, supervisor to handle the daemon process running in th...
Python in the browser (Skulpt/Codeskulptor) + tests?
21,801,491
0
0
324
0
python,codeskulptor
This is probably an insecure solution but it works for my current purposes. My PHP script calls shell_exec('python3 -c "X") where X is the user-supplied code appended with the code I use for testing, e.g. calling their created functions etc.
0
0
0
0
2014-02-13T19:51:00.000
1
1.2
true
21,764,170
1
0
1
1
For a school project I want to make a small Codecademy-like site that teaches programming for beginners. I want the site to teach Python as it has a syntax that is suitable for beginners to learn, and for this reason I found Skulpt to be useful as it has both browser text and drawing output capabilities. My question no...
Does Django Block When Celery Queue Fills?
21,765,816
1
0
400
0
python,django,multithreading,rabbitmq,celery
It's impossible to really answer your question without an in-depth analysis of your actual code AND benchmark protocol, and while having some working experience with Python, Django and Celery I wouldn't be able to do such an in-depth analysis. Now there are a couple very obvious points : if your workers are running o...
0
1
0
0
2014-02-13T20:54:00.000
2
1.2
true
21,765,266
0
0
1
2
I'm doing some metric analysis on on my web app, which makes extensive use of celery. I have one metric which measures the full trip from a post_save signal through a celery task (which itself calls a number of different celery tasks) to the end of that task. I've been hitting the server with up to 100 requests in 5 se...
Does Django Block When Celery Queue Fills?
34,550,948
0
0
400
0
python,django,multithreading,rabbitmq,celery
I'm not sure about slowing down, but it can cause your application to hang. I've had this problem where one application would backup several other queues with no workers. My application could then no longer queue messages. If you open up a django shell and try to queue a task. Then hit ctrl+c. I can't quite remember wh...
0
1
0
0
2014-02-13T20:54:00.000
2
0
false
21,765,266
0
0
1
2
I'm doing some metric analysis on on my web app, which makes extensive use of celery. I have one metric which measures the full trip from a post_save signal through a celery task (which itself calls a number of different celery tasks) to the end of that task. I've been hitting the server with up to 100 requests in 5 se...
Selenium webdriver, Python - target partial CSS selector?
22,903,875
0
2
2,815
0
python,selenium-webdriver
css=span.error -- Error css=span.warning -- Warning css=span.critical -- Critical Error Simple above are the CSS Selectors we can use.
0
0
1
0
2014-02-13T21:00:00.000
3
0
false
21,765,396
0
0
1
1
I am trying to target specific CSS elements on a page, but the problem is that they have varying selector names. For instance, input#dp156435476435.textinput.wihtinnextyear.datepicker.hasDatepicker.error. I need to target the CSS because i am specifcally looking for the .error at the end of the element, and that is o...
Django and external sqlite db driven by python script
21,768,188
1
0
1,298
1
python,django,sqlite
If you care about taking control over every single aspect of how you want to render your data in HTML and serve it to others, Then for sure Django is a great tool to solve your problem. Django's ORM models make it easier for you to read and write to your database, and they're database-agnostic. Which means that you can...
0
0
0
0
2014-02-13T22:48:00.000
2
1.2
true
21,767,229
0
0
1
1
I am just beginning learning Django and working through the tutorial, so sorry if this is very obvious. I have already a set of Python scripts whose ultimate result is an sqlite3 db that gets constantly updated; is Django the right tool for turning this sqlite db something like a pretty HTML table for a website? I ca...
Does NDB still index with default=None or properties set to None?
21,767,994
6
2
363
0
google-app-engine,python-2.7
Explicitly setting a property to None is defining a value, and yes defaults work and the property will be indexed. This assumes None is a valid value for a particular property type. Some issues will arise, as you pointed out, often you use None as a sentinal value, so how do you tell between no Value provided and an e...
0
0
0
0
2014-02-13T23:35:00.000
1
1
false
21,767,951
0
0
1
1
I'd like to be able to run a query like: MyModel.query(MyModel.some_property == None) and get results. I know that if I don't put a default=<some default> in a property, I won't be able to query for it, but if I set default=None will it index it? Similarly, does setting values to None cause properties to be indexed in ...
How to add path for the file today.html in views.py and settings.py in django
21,795,994
0
0
1,522
0
python,django
First copy the file today.html into your projects template folder. Add the path in settings.py file. ie your project-path/your file-path(today.html). Then create a function to open today.html file in views.py. Now in urls.py file give the url. ie. url(r'^today/$', 'your project-path.views.today', name='today'), that's ...
0
0
0
0
2014-02-14T06:53:00.000
3
0
false
21,772,673
0
0
1
2
I have a html file in my home directory named today.html I have to load that file on a click of a link using django. How to add the file path in views.py and settings.py files.
How to add path for the file today.html in views.py and settings.py in django
21,772,731
0
0
1,522
0
python,django
You could add your home directory path to the TEMPLATE_DIRS setting in your project's settings.py file. Then when you try to render the template in your view, Django will be able to find it.
0
0
0
0
2014-02-14T06:53:00.000
3
0
false
21,772,673
0
0
1
2
I have a html file in my home directory named today.html I have to load that file on a click of a link using django. How to add the file path in views.py and settings.py files.
Django Middleware, single action after login
21,784,110
0
0
795
0
django,python-2.7,login,django-middleware
Maybe you should try to use user_logged_in signal instead of middleware? Also you can check user object from request for is_anonymous, maybe it can helps
0
0
0
0
2014-02-14T15:11:00.000
2
0
false
21,782,897
0
0
1
1
Let's say I created a Middleware which should redirect user after login to a view with "next" parameter taken from LOGIN_REDIRECT_URL. But it should do it only once directly after logging, not with every request to LOGIN_REDIRECT_URL. At the moment I check User.last_login and compare it with datetime.datetime.now(), ...
GAE Request Timeout when user uploads csv file and receives new csv file as response
21,802,072
2
0
79
0
python,google-app-engine
You have many options: Use a timer in your client to check periodically (i.e. every 15 seconds) if the file is ready. This is the simplest option that requires only a few lines of code. Use the Channel API. It's elegant, but it's an overkill unless you face similar problems frequently. Email the results to the user.
0
1
0
0
2014-02-15T17:05:00.000
2
0.197375
false
21,800,806
0
0
1
1
I have an app on GAE that takes csv input from a web form and stores it to a blob, does some stuff to obtain new information using input from the csv file, then uses csv.writer on self.response.out to write a new csv file and prompt the user to download it. It works well, but my problem is if it takes over 60 seconds ...
Is there a way to tell a browser to download a file as a different name than as it exists on disk?
21,817,783
0
0
143
1
python,amazon-s3,flask
I'm stupid. Right in the Flask API docs it says you can include the parameter attachment_filename in send_from_directory if it differs from the filename in the filesystem.
0
0
0
0
2014-02-16T03:48:00.000
1
1.2
true
21,807,032
0
0
1
1
I am trying to serve up some user uploaded files with Flask, and have an odd problem, or at least one that I couldn't turn up any solutions for by searching. I need the files to retain their original filenames after being uploaded, so they will have the same name when the user downloads them. Originally I did not want ...
What is the difference between mod_wsgi and uwsgi?
21,814,847
3
6
5,775
0
python,apache,nginx,wsgi,uwsgi
They are just 2 different ways of running WSGI applications. Have you tried googling for mod_wsgi nginx? Any wsgi compliant server has that entry point, that's what the wsgi specification requires. Yes, but that's only how uwsgi communicates with Nginx. With mod_wsgi the Python part is run from within Nginx, with uwsg...
0
1
0
1
2014-02-16T17:14:00.000
1
1.2
true
21,814,585
0
0
1
1
There seems to be mod_wsgi module in Apache and uwsgi module in Nginx. And there also seems to be the wsgi protocol and uwsgi protocol. I have the following questions. Are mod_wsgi and uwsgi just different implementations to provide WSGI capabilities to the Python web developer? Is there a mod_wsgi for Nginx? Does uws...
Installing RIDE(Robot Framework)
51,078,298
0
3
21,961
0
automated-tests,wxpython,robotframework,python-2.6
You probably have the different versions for wxPython and Python in your machine. Always make sure you should install the wxPython version same as the python version i.e. Python 2.7.
0
0
0
0
2014-02-17T09:23:00.000
3
0
false
21,825,122
0
0
1
1
For automated testing on RIDE(Robot framework), I had already installed PYTHON 2.6 and wxPython 3.0 version,PATH had already been updated in Environment variables, and when I jumped to the last phase i.e Installing RIDE(version -"robotframework-ride-1.3.win32.exe") through Windows Installer, application is been install...