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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Create_user() in custom manager or save() method in Django custom user model for processing field before creating new record? | 20,015,389 | 2 | 1 | 878 | 0 | python,django,django-models,django-users,django-managers | The point of save() and create_user() method is to save the object to the database. The difference is that the save() method need you to instantiate the object first, while create_user() automatically create the object and save into the database. There is no the absolute right way. You can use both of the as you want. ... | 0 | 0 | 0 | 0 | 2013-11-15T00:04:00.000 | 1 | 0.379949 | false | 19,990,997 | 0 | 0 | 1 | 1 | I have a Django custom user model with a save() method that tests for self.pk is None and does some extra processing to a field before creating a new user record. Is this the right place to put that or is it supposed to go into the create_user() method of the custom user manager? Does it make a difference? |
Python Web Server - mod_wsgi | 19,992,498 | 1 | 0 | 203 | 0 | python,apache2,mod-wsgi | Python is different from PHP in that PHP executes your entire program separately for each hit to your website, whereas Python runs "worker processes" that stay resident in memory.
You need some sort of web framework to do this work for you (you could write your own, but using someone else's framework makes it much easi... | 0 | 0 | 0 | 1 | 2013-11-15T02:13:00.000 | 1 | 1.2 | true | 19,992,294 | 0 | 0 | 1 | 1 | I have been looking at setting up a web server to use Python and I have installed Apache 2.2.22 on Debian 7 Wheezy with mod_wsgi. I have gotten the initial page up and going and the Apache will display the contents of the wsgi file that I have in my directory.
However, I have been researching on how to deploy a Python... |
HTML in Spotfire and IronPython | 62,234,196 | 0 | 0 | 3,779 | 0 | html,ironpython,spotfire | What you can do is add a new text area. Then, add a drop down list in this text area. You can create a new Document.Properties linked to this drop down list.
You can create many options in your drop down list, and your Document.Properties will have the selected value of your drop down list.
Text Area could be designed ... | 0 | 0 | 0 | 0 | 2013-11-15T04:03:00.000 | 3 | 0 | false | 19,993,323 | 0 | 0 | 1 | 1 | I want to make a drop down list in spotfire using html. So based on choice selected I want to show custom divs. How to implement that ?? Can anyone help with the ironpython script |
Django REST Framework, pre_save() and serializer.is_valid(), how do they work? | 22,542,900 | 2 | 11 | 9,143 | 0 | python,django,rest,django-rest-framework | It turned out the problem was that I was using ListAPIView as the base class for my view class and it doesn't have the pre_save method defined. When I added some of the mixins which had it defined everything started working.
Seems weird that something used in a lot of the basic tutorials doesn't support such a basic fe... | 0 | 0 | 0 | 0 | 2013-11-15T05:08:00.000 | 5 | 1.2 | true | 19,993,951 | 0 | 0 | 1 | 1 | I need to attach a user to a request, this seems like a fairly common thing to need to do, but it's turning out to be damn near impossible.
The docs for the Django REST Framework suggest using the pre_save method of the serializer class, which I did, but it doesn't get called when serializer.is_valid() is called, which... |
Can one source code be deployed to Openshift, Heroku and Google App Engine at once? | 20,003,022 | 3 | 1 | 244 | 0 | python,google-app-engine,heroku,openshift | I work on Openshift and at this time I'm not aware of anything that will deploy your code to GAE and Openshift at the same time.
You might be able to write your own script for it. | 0 | 1 | 0 | 0 | 2013-11-15T10:31:00.000 | 2 | 1.2 | true | 19,998,958 | 0 | 0 | 1 | 2 | As subject, is is possible with just one source code, we can deploy our code to Openshift or Google App Engine? Heroku is not necessarily in my case.
My application is using Python Flask + PostgreSQL 9.1. I love the easiness in Openshift when I configure my technology stack, but is the case will be same with GAE?
Than... |
Can one source code be deployed to Openshift, Heroku and Google App Engine at once? | 20,003,075 | 1 | 1 | 244 | 0 | python,google-app-engine,heroku,openshift | PostgreSQL is not available on GAE, so this code will definitely not run there. | 0 | 1 | 0 | 0 | 2013-11-15T10:31:00.000 | 2 | 0.099668 | false | 19,998,958 | 0 | 0 | 1 | 2 | As subject, is is possible with just one source code, we can deploy our code to Openshift or Google App Engine? Heroku is not necessarily in my case.
My application is using Python Flask + PostgreSQL 9.1. I love the easiness in Openshift when I configure my technology stack, but is the case will be same with GAE?
Than... |
How to print django-nose exception below log | 20,023,533 | 3 | 0 | 401 | 0 | python,django,nose | Nose keeps track of standard output (stdout) and logging (python logging module) in separate containers. You can control the capturing process of the output during the test run for both buffers. So if you want to disable capturing of the recorded log with --nocapture and --nologcapture your tests will end with stack tr... | 0 | 0 | 0 | 0 | 2013-11-15T11:40:00.000 | 1 | 1.2 | true | 20,000,286 | 0 | 0 | 1 | 1 | Django-nose prints the exception and stack trace somewhere hidden in the middle of two logs in the following format:
Live Log (as it is being executed)
The exception and stack trace
The recorded log
This is really unhelpful if the logs are very long (hundreds of lines) as one has to find the "in between" stack trace ... |
Django, Detecting if variable is a number | 20,003,855 | 7 | 7 | 8,638 | 0 | python,django,string,integer | What about: if isinstance(data, int): | 0 | 0 | 0 | 0 | 2013-11-15T14:26:00.000 | 3 | 1 | false | 20,003,295 | 1 | 0 | 1 | 1 | In a function in Django, the user can send me a number or a string, and I want to know if I received a number or a String (Tip: The number will always be an integer between 1-6)
I want to know if it's possible to detect this and how (with an example), as the number or string I'm getting will tell me what to do next. |
Finding the cause of of 403 forbidden error in django admin | 36,814,048 | 1 | 2 | 6,383 | 0 | python,django | If you're using Firefox (or any browser) with Web Developer Toolbar, make sure you have cookies enabled. I temporarily had cookies turned off and forgot to turn it back on.
Cookies => Disable Cookies => Disable All Cookies
Solved my problem in Django 1.9. | 0 | 0 | 0 | 0 | 2013-11-15T20:36:00.000 | 2 | 0.099668 | false | 20,010,125 | 0 | 0 | 1 | 1 | I have multiple users in django auth setup and a few simple models.
For superusers I can view my model objects. For non superusers that have is_staff checked I get
a 403 Permission denied when trying to view my models.
I have tried adding all permissions to those users to find out if that was the cause but still receiv... |
uWSGI with Django gives Broken pipe | 20,015,756 | 0 | 0 | 338 | 0 | python,django,pipe,uwsgi | check the timeout of your frontend server, generally if there is no activity, the connection is closed. For example nginx has 60 seconds timeout | 0 | 0 | 0 | 0 | 2013-11-16T06:53:00.000 | 1 | 0 | false | 20,015,701 | 0 | 0 | 1 | 1 | I am using uWsgi + Django to write web services for an android application to submit survey data which is normally not very large set of data but, the application sends multiple calls to the server. If the surveyor has done 50 surveys, he'll tap one button on his mobile and all the surveys will be sent to the server on... |
Difference between Socket Programming and Django Form submission | 20,038,319 | 1 | 1 | 684 | 0 | python,django,sockets,django-forms | Sockets are just one method of communicating between client and server, but not the method Django is using when processing a form submission. It is most likely sending a HTTP POST request with parameters that the server listens for. | 0 | 0 | 0 | 0 | 2013-11-18T00:48:00.000 | 3 | 0.066568 | false | 20,038,238 | 0 | 0 | 1 | 1 | i am learning socket programming and Django web developing. As what i know socket is used for the communication between client and server. Dose this mean that when using and submitting Form in Django, there will be a socket created and submitted to the server? |
Remote control of an embedded system from Website | 20,039,992 | 0 | 0 | 469 | 0 | python,django,sockets,web,remote-server | You basically have one major thing to decide:
Is your embedded machine going to open up a port that allows any
thing that knows it's IP and port details to control it and your web
page write to that IP/Port OR
Is your embedded device going to poll the web app to find out which
state it should be in.
The first option ... | 0 | 0 | 1 | 0 | 2013-11-18T03:36:00.000 | 1 | 1.2 | true | 20,039,657 | 0 | 0 | 1 | 1 | I am now using Django frame work to build a website which has the ability to control a remote embedded system (simply with functions like "Turn ON/OFF"). What i can image now is to use Socket Programming with Python (because Django is pure Python). As i have learnt, i only know how to send and receive messages with soc... |
@auth.requires_permission not working | 20,102,474 | 0 | 0 | 174 | 0 | python,web2py | When entering a record in the db.auth_permission table, there is a table field in addition to the name field (note, table doesn't have to refer to a database table -- it can be any name representing any type of object). When a permission is checked, both the name and the table must match.
If you insert a permission rec... | 0 | 0 | 0 | 0 | 2013-11-18T07:33:00.000 | 1 | 1.2 | true | 20,042,386 | 0 | 0 | 1 | 1 | I have an application where I am using web2py's access control system. I have various users in auth_user table. To be more specific I have admin1@mysite.com user whose id is 4. There is a group admin with group id 1 in auth_group table. In auth_membership table I have user_id 4 related to group_id 1. It means that admi... |
Nginx(Django) ImportError: cannot import name celeryd | 20,312,840 | 1 | 0 | 700 | 0 | python,django,nginx,celery,celerybeat | It turned out I used different version of Django in my remote server.
In Celery 3.1, there is no command named celeryd. | 0 | 1 | 0 | 0 | 2013-11-18T19:45:00.000 | 1 | 1.2 | true | 20,056,399 | 0 | 0 | 1 | 1 | I tested my project in my local machine, and it worked fine. But after uploading to a remote server(CentOS), I cannot execute celerybeat.
Here is my command.
python manage.py celeryd --events --loglevel=INFO -c 5 --settings=[settings-directory].production
This command works in the local machine(with --settings=[setting... |
Google App Engine. How to create constant in application scope? | 20,065,052 | 2 | 1 | 154 | 0 | python,google-app-engine | You can define the dict with in a module, then import it where ever you wish to refer to it, or you could load it from the datastore, and set the value in the module. You would do this during a warmup request.
Defining it in a module, means to alter the contents will require de-deploying the app.
Defining it in the da... | 0 | 1 | 0 | 0 | 2013-11-19T06:43:00.000 | 1 | 0.379949 | false | 20,064,915 | 1 | 0 | 1 | 1 | I want to create global scope constant dict, that would be accessed by multiple views.
For now I see scenario after deploy:
Fetching big file, creating a dict, holding this dict in memory. This process can be re-executed by administrator. |
Best way to show a user random data from an SQL database? | 20,081,554 | 1 | 1 | 512 | 1 | python,sql,flask,flask-sqlalchemy | The easiest way is to do the random number generation in javascript at the client end...
Tell the client what the highest number row is, then the client page keeps track of which ids it has requested (just a simple js array). Then when the "request next random page" button is clicked, it generates a new random number ... | 0 | 0 | 0 | 0 | 2013-11-19T13:03:00.000 | 2 | 0.099668 | false | 20,072,309 | 0 | 0 | 1 | 1 | I'm working on a web app in Python (Flask) that, essentially, shows the user information from a PostgreSQL database (via Flask-SQLAlchemy) in a random order, with each set of information being shown on one page. Hitting a Next button will direct the user to the next set of data by replacing all data on the page with ne... |
PyDev Eclipse Plugin fails to update in Eclipse Update Manager | 41,791,350 | 1 | 3 | 1,251 | 0 | python,eclipse,pydev | It seems that the best resolution for this is to update from Eclipse 3.7 to 4.3+. | 0 | 1 | 0 | 0 | 2013-11-19T18:06:00.000 | 1 | 1.2 | true | 20,078,776 | 0 | 0 | 1 | 1 | I'm trying to update some software in Eclipse, and mostly haven't had problems, but when I try to update PyDev (Python plugin) I get this error:
An error occurred while collecting items to be installed
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, ... |
RabbitMQ: Preventing jobs to run simultaneously on two different workers | 20,095,672 | 1 | 2 | 155 | 0 | python,django,rabbitmq,pika | You will have to use some locking mechanism, perhaps based on database.
When a worker is working on a django object, it marks the work in database. a MySQL example:
worker_id | object_id | task_type
22 44 3 // entry inserted to mark the work
When another worker picks up a django object, it check... | 0 | 0 | 0 | 0 | 2013-11-20T12:02:00.000 | 1 | 0.197375 | false | 20,095,451 | 0 | 0 | 1 | 1 | I have a Python Django project with two RabbitMQ workers, using the pika lib, which receives jobs to perform actions on a certain Django object which is specified in the request.
The thing is, I don't want the workers, A and B, to perform their actions on the same Django object, x, at the same time as that might cause... |
TastyPie authentication for pure javascript site | 20,102,341 | 2 | 1 | 57 | 0 | python,django,tastypie | will see basic read only info from the Django API.
It sounds like you probably just want to make those bits of the API publicly available for read-only access, and then not use any authentication method.
As you say attempting to hide a key isn't a sensible way to go, and if there's no kind of user login then you can't... | 0 | 0 | 0 | 0 | 2013-11-20T17:03:00.000 | 1 | 1.2 | true | 20,102,228 | 0 | 0 | 1 | 1 | I'm using Django TastyPie for my API. I have a completely separate HTML application that my user views and will see basic read only info from the Django API. My question is what authentication method should I use in this situation. The HTML application is technically me not the user and they don't login. The app is not... |
Google Cloud Storage Client Library 400 error on devserver as of update 1.8.8 | 20,105,749 | 1 | 1 | 164 | 0 | python,google-app-engine,google-cloud-storage,client-library | have you updated gcs client to 1.8.8 version from the downloads list, or to SVN head? Thanks. | 0 | 1 | 0 | 0 | 2013-11-20T19:29:00.000 | 1 | 1.2 | true | 20,105,156 | 0 | 0 | 1 | 1 | I haven't changed any code, but when I try to upload an image file using the GCS Client library on app engine's dev server, I am now getting this fatal error:
Expect status [201] from Google Storage. But got status 400.
This was working until I made the update from Google to 1.8.8 as of 11/19/13.
Anybody else seeing th... |
twisted web for production server service | 20,114,092 | 0 | 2 | 805 | 0 | python,web,twisted | I have found several good references for launching daemon processes with python. See daemoncmd from pypi.
Im still coming up a little short on the monitoring/alert solutions (in python). | 0 | 1 | 0 | 0 | 2013-11-21T02:21:00.000 | 1 | 0 | false | 20,111,254 | 0 | 0 | 1 | 1 | I would like to deploy several WSGI web applications with Twisted on a debian server, and need some direction for a solid production setup. These applications will be running 24/7.
I need to run several configurations, each binding to different ports/interfaces/privileges.
I want to do as much of this in python as po... |
Django authentication via external provider | 21,763,143 | 1 | 1 | 743 | 0 | python,django,authentication | This sounds quite reasonable. There are several ways to achieve this: use a third party library like django-social-auth which handles using third party applications to authenticate users via the Django user model. The other way to do this is to write your own custom backend that uses OAuth2 protocol to authenticate use... | 0 | 0 | 0 | 0 | 2013-11-21T02:42:00.000 | 2 | 0.099668 | false | 20,111,456 | 0 | 0 | 1 | 1 | I am just learning python and django and I put up a pretty decent website to manage a database and also a search page. The new requirement that I am a bit confused now is that the authentication should be done through an external provider (unknown yet, but probably LDAP or Kerberos Tickets).
My idea was to authenticat... |
How Apache Solr works with Django 1.5? | 20,115,328 | 1 | 1 | 103 | 0 | python,django,apache,solr,django-haystack | Django and Apache Solr have no relation with each other.
You can use django like you would use normally, and use pysolr or sunburnt python module to fetch/write data to SOLR.
I would recommend pysolr for its simplicity. | 0 | 0 | 0 | 0 | 2013-11-21T07:48:00.000 | 1 | 0.197375 | false | 20,115,202 | 0 | 0 | 1 | 1 | I am new on Django framework. So please help me work with solr and Django.
I am trying with some tutorial available on different site but all worked with older versions of Django and Apache Solr those are not compatible with new versions. |
Django Admin: Register extra staff Admin | 20,132,972 | 0 | 0 | 114 | 0 | python,django | You only have to set the is_staff flag on your user to True. Superusers bypass user perrmissions (all is permited). | 0 | 0 | 0 | 0 | 2013-11-21T21:45:00.000 | 1 | 0 | false | 20,132,603 | 0 | 0 | 1 | 1 | Is there a way to register extra staff Admins such as a log in or sign up? or is the only way to add them in the Superuser Admin? |
Calling exe in Windows from Linux | 20,140,905 | 0 | 0 | 252 | 0 | python,linux,django,windows,apache | I can think of some ways to do this:
Use web services with real REST protocol and cross-site scripting protection
Use WINE (As OneOfOnes suggested in his comment)
But this is very risky for real production and might not work at all (or just when the load will become heavier)
Write some code in the windows machine a... | 0 | 1 | 0 | 0 | 2013-11-22T08:09:00.000 | 1 | 0 | false | 20,139,979 | 0 | 0 | 1 | 1 | Background knowledge: Website in Django run under apache.
Briefly speaking, I need to call an .exe program in a windows machine from a Linux machine.
The reason for this is our website runs on Linux, but one module relies on Windows DLL. So we plan to put it on a separate windows server, and use some methods to call ... |
mykey.get() method doesn't work in google app engine project | 20,156,917 | 3 | 0 | 99 | 0 | google-app-engine,python-2.7,app-engine-ndb | A few things are wrong here.
Firstly Subcategory.get_by_id(subcategoryId) probably won't work as you example key has an ancestor defined. You need to include the ancestor(s) in get_by_id
Given you are using a mySubcategorykey.get() and you don't retrieve an entity then it means the key is incorrect. a get by key won'... | 0 | 1 | 0 | 0 | 2013-11-23T00:00:00.000 | 1 | 1.2 | true | 20,156,694 | 0 | 0 | 1 | 1 | I am passing one of my projects to the google app engine, just for the sake of learning. However I have some problems with the ndb datastore. My root entity would be Categories and these have Subcategories as child entities. So let's say I have Category Foods which has Subcategory Main Dishes. So the key for this Entit... |
AppEngine Push to Deploy and Modules | 20,196,135 | 4 | 3 | 347 | 0 | python,git,google-app-engine | Lack of support for App Engine modules is a known issue for the push-to-deploy feature, and is something we're actively working on addressing at this time. | 0 | 1 | 0 | 0 | 2013-11-23T06:08:00.000 | 1 | 1.2 | true | 20,159,232 | 0 | 0 | 1 | 1 | Can I use AppEngines "Push to Deploy" (deploying by pushing a GIT repository) to update a multiple module Python application?
Where do I get the repo url for the non default modules? |
Multiple DB tables with django models possible? | 20,162,808 | 1 | 0 | 196 | 0 | python,django | Django seems to do one DB table per model
Actually you'd better think about it the other way round : a Django "Model" is the representation of one DB table.
But I think that means all of the registrations for every race (via a
foreign key) will be in it...one table for all of them. Maybe it's not
that many, but i... | 0 | 0 | 0 | 0 | 2013-11-23T12:57:00.000 | 1 | 1.2 | true | 20,162,566 | 0 | 0 | 1 | 1 | I am slowly learning Django trying to write an app to replace the complicated PHP mess we have now. In the end what we need is pretty simple, but I am trying to wrap my head around what the best way (or "django way") is to do things. Here's what we do:
We manage races (what I'll call events) and do online registrations... |
App can't be tested because of conflit with django.contrib.messages | 20,166,747 | 0 | 0 | 38 | 0 | python,django,django-testing | You need to make sure your application appears in your settings.py INSTALLED_APPS before django.contrib.messages does. | 0 | 0 | 0 | 0 | 2013-11-23T19:12:00.000 | 1 | 1.2 | true | 20,166,638 | 0 | 0 | 1 | 1 | In my django project, I'm having trouble testing my homemade app named "messages". If I write a single test in messages/tests.py and try to run it with python manage.py test messages, it will perform 74 tests from, I guess, the django.contrib.messages library.
How can I run my local app tests instead of the library one... |
Using Soundcloud Python library in Google App Engine - what files do I need to move? | 20,177,193 | 0 | 0 | 241 | 0 | python,google-app-engine,pip,soundcloud | Ok, I think I figured out. What I needed to do what copy the soundcloud folder, along with the fudge, simplejson and requests folders into the root folder of my webapp. Thank you VooDooNOFX -- although you didn't directly answer the precise question, you sparked the thinking that helped me figure it out. | 0 | 1 | 0 | 0 | 2013-11-23T19:19:00.000 | 2 | 0 | false | 20,166,720 | 0 | 0 | 1 | 1 | I want to use the soundcloud python library in a web app I am developing in Google App Engine. However, I can't find any file called "soundcloud.py" in the soundcloud library files I downloaded. When using pip install it works fine on my local computer.
What files exactly do I need to move - or what exact steps do I... |
Best way to implement long running subprocess in Django? | 20,231,324 | 5 | 4 | 1,377 | 0 | python,django,python-2.7,subprocess,celery | If you don't want something as complex as Celery, then you can use subprocess + nohup to start long running tasks off, dump the PID to a file (check the subprocess documentation for how to do that) and then check if the PID contained in the file is still running (using ps). And if you wanted, you could write a very sm... | 0 | 1 | 0 | 0 | 2013-11-23T21:37:00.000 | 2 | 0.462117 | false | 20,168,198 | 1 | 0 | 1 | 1 | I know there are many questions similar to this one, but as far as my research has taken me, none of them answers my specific question. I hope you will take your time to help me out, as I have been struggling with this for days without finding a proper answer.
I am trying to find the best way to implement a subprocess ... |
UnicodeEncodeError with django: inconsistent behavior | 20,192,605 | 0 | 0 | 372 | 0 | python,django,apache | This error comes because of filename or file contents cotains garbage collection or in another language (except english)..
So you can add unicode() for this. or check NLTK library of handling this situation. | 0 | 0 | 0 | 0 | 2013-11-25T09:30:00.000 | 3 | 0 | false | 20,188,586 | 0 | 0 | 1 | 1 | I deployed a project on webfaction with djanog. All went fine until recently, when all of a sudden I started to get this error: UnicodeEncodeError: 'ascii' codec can't encode characters in position 64-68: ordinal not in range(128)
The url is with Russian characters. But the matter is, when I restart Apache, there is no... |
Multiple external packages with same name | 20,195,470 | 0 | 1 | 78 | 0 | python,django | If those different sites use the same controller (file.py) then the packages must have different name. | 0 | 0 | 0 | 0 | 2013-11-25T14:13:00.000 | 2 | 0 | false | 20,195,265 | 0 | 0 | 1 | 1 | I have a problem, where I have two packages that I use quite often, in different sites, with the same name. Namely, they are django-simple-captcha and django-recaptcha. They are both just called captcha.
In addition, these are shared between several people who may work on them, so I can't just have them as different na... |
What is uWSGI master mode? | 20,199,153 | 5 | 11 | 4,022 | 0 | python,uwsgi | upstart is only a process manager, the uWSGI master has access to lot of memory areas of workers (well it is the opposite indeed) so it can make truly monitoring of the behaviour of workers, in addition to this it allows graceful reloading, exports statistics and dozens of other things. Running without it is not a good... | 0 | 1 | 0 | 1 | 2013-11-25T15:49:00.000 | 1 | 1.2 | true | 20,197,259 | 0 | 0 | 1 | 1 | What are the benefits of running uWSGI in master mode if I'm only running a single app? Does master mode offer process management benefits that make it more reliable than, say, running via Upstart? |
Making android app work with a python web server | 20,198,995 | 0 | 0 | 682 | 0 | android,python,eclipse | You don't seem to have a clue about how the android app and the web app are supposed to work together...
You can (theoretically) use just any language and techno you find appropriate for the web app since the communication between the android app and the web app will be http requests / responses.
Also, you can use wha... | 0 | 0 | 0 | 0 | 2013-11-25T17:00:00.000 | 2 | 0 | false | 20,198,826 | 0 | 0 | 1 | 1 | I have a small android application made in eclipse.
Now i need to build a web server with python so they could work together.
Should i make a new python projekt then in some way link it to my application?
Or
Should i use jython and rebuild the app in a jython project?
I have used Visual studio before, and eclipse is n... |
Running python from a mounted filesystem | 62,098,699 | 0 | 0 | 417 | 0 | python,django,virtualbox,vagrant | One solution I found was to mount my shared folder with cifs into the VM. That seems to work flawlessly. I did not found a solution for the vboxsf. | 0 | 0 | 0 | 0 | 2013-11-25T18:33:00.000 | 3 | 0 | false | 20,200,556 | 1 | 0 | 1 | 1 | I have a django-based application that I'm running from a virtualbox-shared folder. When starting using 'runserver' I get an error indicating that a module could not be found. After copying the same exact code to a directory on the local filesystem, it starts and runs as expected.
Anyone seen anything like this when wo... |
How do I stream an openCV video to an HTML webpage? | 35,518,047 | 2 | 22 | 32,863 | 0 | c++,python,html,opencv | Under lab conditions you send full images
You seem to be under lab conditions, so there is a simplistic, yet usable solution, just stream PNG's in Base64 using Websockets. On the client side (web browser) you just receive the base64 images and directly load them into the src of an <img>. It works for lab scenarios very... | 0 | 0 | 0 | 1 | 2013-11-25T23:08:00.000 | 4 | 0.099668 | false | 20,205,358 | 0 | 0 | 1 | 1 | I am making a robot that will have a webcam on it to provide some simple object detection. For right now, I would like to simply stream the video to a webpage hosted on the robot and be able to view it from another device. I have written a simple test script in Python ( I will eventually move to C++, my language of ch... |
Google Compute Engine OpenERP | 23,682,731 | 0 | 2 | 513 | 0 | python,debian,openerp,google-compute-engine | you could limit access to your OpenERP instance by specifying --allowed_ip_sources="x.x.x.x" the IP or the CIDR range from where you expect the application to be accessed.
Additionally limit access of 8060 port only to your OpenERP instance, by tagging the instance as say ERP and apply --target_tags="ERP" to limit tra... | 0 | 1 | 0 | 0 | 2013-11-26T02:36:00.000 | 2 | 0 | false | 20,207,499 | 0 | 0 | 1 | 1 | I already install OpenERP and PostgreSQL in google compute engine.
Using debian 7. when i check with ifconfig as root user. I just got 2 ip addres.
127.0.0.1 and my internal ip address. My external IP/IP Public can't detected by debian 7.
I use ephemeral ip address for my external IP.
I allready try run OpenERP service... |
Run compiled Python | 20,207,935 | 3 | 1 | 115 | 0 | python,django | can you execute Python programs from .pyc files where there is no .py file?
Yes. Simply place the .pyc file wherever the .py file would normally be used (except into your text editor, of course).
If yes, is this also possible in Django? How?
No difference. The interpreter handles the files the same way regardless of... | 0 | 0 | 0 | 1 | 2013-11-26T03:19:00.000 | 2 | 1.2 | true | 20,207,882 | 0 | 0 | 1 | 1 | So I've been entering the world of Python just recently, and directed it to quick, personal programs made for myself and professional use for web application design with Django. I've taken a few introductory Python tutorials and most Django tutorials, and have been reading Python documentation whenever possible.
I've r... |
Recommendation engine using collaborative filtering in Python | 20,237,347 | 0 | 0 | 1,190 | 0 | python,algorithm,neo4j,recommendation-engine | I think you won't find any out-of-the box solution for you problem, as it is quite specific. What you could do with Neo4j is to store all your data that you use for building recommendations (users, friendships links, users' restaurants recommendations and reviews etc) and then build you recommendation engine on this da... | 0 | 0 | 0 | 0 | 2013-11-26T20:59:00.000 | 1 | 1.2 | true | 20,227,834 | 0 | 0 | 1 | 1 | I have developed a search engine for restaurants. I have a social network wherein users can add friends and form groups and recommend restaurants to each other. Each restaurant may serve multiple cuisines. All of this in Python.
So based on what restaurants a user has recommended, we can zero in on the kind of cuisines... |
user system with social authentication in django | 20,229,262 | 1 | 0 | 74 | 0 | python,django,facebook,authentication | There is an app called django-allauth. If you read their official documentation, it is pretty easy to follow. As per their instructions, you install the core app, and any other authentication you need (like facebook, oauth which google uses). Then, you have to go to facebook, get developers key, and add it to your djan... | 0 | 0 | 0 | 0 | 2013-11-26T22:11:00.000 | 1 | 0.197375 | false | 20,229,048 | 0 | 0 | 1 | 1 | I've read about a lot of different apps for django for integrating social authentication to django projects. But, I'm having some trouble understanding how this integration works
Does it extends the default USER models? Where do I find those kind of information in the applications?
I basically need a user system that h... |
Django-tables2 Sorting TemplateColumn | 21,063,484 | 0 | 2 | 448 | 0 | python,django,sorting,django-tables2 | In the matter of fact, this can't be done. if TemplateColumn name is based on name in model, sorting works fine. As far as I am concerned If you want present other data it is impossible. | 0 | 0 | 0 | 0 | 2013-11-27T13:28:00.000 | 1 | 1.2 | true | 20,243,803 | 0 | 0 | 1 | 1 | Is it somehow possible, to add custom sort method to values generated using TemplateColumn? because on basic it tries to find column name in model and returns FieldError: Cannot resolve keyword u'coulmn_name' into field. Choices are: [all fields in model]. |
How to install django for python 3.3 | 33,155,616 | 1 | 14 | 16,364 | 0 | python,django,macos | to setup django in pyton3
sudo apt-get install python3-pip
sudo pip3 install virtualenv
virtualenv -p /usr/bin/python3.X venv
source venv/bin/activate
congrats you have setup python3 django and now have many packages to work with
Note: X stands for the version of python | 0 | 0 | 0 | 0 | 2013-11-27T19:39:00.000 | 4 | 0.049958 | false | 20,251,562 | 1 | 0 | 1 | 2 | I had python 2.6.1 because it was old I decide to install python 3.3.2 but, when I type "python" in my mac it prints it is version 2.6.1 and when I type python3 it shows that this is 3.3.2. I installed django 1.6 but when I check, understand that it is installed for old version of python (python 2.6.1). I want to insta... |
How to install django for python 3.3 | 46,796,659 | 0 | 14 | 16,364 | 0 | python,django,macos | To install django for python3, you need to use pip3 instead of pip.
python defaults to python2.
pip defaults to pip for python2.
So, when you install pip using whatever package manager you have, you are essentially installing pip for python2.
To remove Python2: $sudo apt remove python
To install pip for python3:
$sudo ... | 0 | 0 | 0 | 0 | 2013-11-27T19:39:00.000 | 4 | 0 | false | 20,251,562 | 1 | 0 | 1 | 2 | I had python 2.6.1 because it was old I decide to install python 3.3.2 but, when I type "python" in my mac it prints it is version 2.6.1 and when I type python3 it shows that this is 3.3.2. I installed django 1.6 but when I check, understand that it is installed for old version of python (python 2.6.1). I want to insta... |
Mac OS deploy Django + Apache on Amazon EC2 | 20,256,055 | 1 | 0 | 304 | 0 | python,django,apache,deployment,amazon-ec2 | You use Terminal to SSH into your AWS EC2 environment. All commands past there are 100% platform based (ubuntu, amazon linux, red hat, etc).
You wouldn't use any Mac OS commands besides creating the SSH connection. There's a tutorial on how to do that through the EC2 console. | 0 | 1 | 0 | 0 | 2013-11-27T20:35:00.000 | 1 | 1.2 | true | 20,252,595 | 0 | 0 | 1 | 1 | I am trying to deploy Django and Apache to Amazon EC2 server. Currently, i have already got the AWS account and lunched the instance on server. But the problem is that i cannot find a tutorial about how to deploy Django and Apache to Amazon EC2 WITH Mac OS, all i can find are Linux system deploying tutorials. Where can... |
Writing user.get_profile() custom function which should create auth profile if there is not any | 20,254,928 | 1 | 1 | 84 | 0 | python,django | I am a bit confused. Are you trying to let users create account and sign in? Then use django-registration which is easy and works out of the box. | 0 | 0 | 0 | 0 | 2013-11-27T21:28:00.000 | 2 | 0.099668 | false | 20,253,410 | 0 | 0 | 1 | 1 | I am trying to write custom get_profile() function which should create user profile for users who are registered thru admin or any other way where post_save was not called.
How can I start this? |
create module in openerp through interface | 23,950,717 | 0 | 0 | 226 | 0 | python,xml,module,openerp | i had the same error just a while ago
you need to give a proper name to your model without upper case
my example : Remise is the designation and x_remise is the module name | 0 | 0 | 0 | 0 | 2013-11-28T09:33:00.000 | 1 | 0 | false | 20,262,330 | 0 | 0 | 1 | 1 | when i create a module through interface it shows me error when click on save button error in create m2o screen
ERROR ValidateError
Error occurred while validating the field(s) res_model,src_model: Invalid model name in the action definition. |
Change Property of db.Model to custom Type | 20,269,288 | 0 | 0 | 49 | 0 | google-app-engine,python-2.7 | Its not sql. You dont clone or delete 'tables', no such thing in the datastore.
To do the migration you would use task queues to run through a query. You probably need to stop your frontend while doing so. Task queues have a longer limit than the 60sec you mention and each taskqueue will create another one until you f... | 0 | 1 | 0 | 0 | 2013-11-28T12:58:00.000 | 1 | 0 | false | 20,266,882 | 0 | 0 | 1 | 1 | I'm trying to change the Property several Fields on my GAE AppEngine to a custom Type (Encrypted Content).
Most of them are currently String or Text Properties. Since we have multiple millions of Entries in our DB, migration is not an easy task. I'm looking for a best practise, here is what I think will work best but t... |
Django Nginx Gunicorn = 504 Timeout | 20,278,315 | 6 | 8 | 5,881 | 0 | python,django,nginx,gunicorn | When you hold down F5:
You've started hundreds of requests.
Those requests have filled your gunicorn request queue.
The request handlers have not been culled as soon as the connection drops.
Your latest requests are stuck in the queue behind all the previous requests.
Nginx times out.
For everyone.
Solutions:
Set up... | 0 | 0 | 0 | 0 | 2013-11-29T02:40:00.000 | 2 | 1.2 | true | 20,277,537 | 0 | 0 | 1 | 1 | I'm trying to publish a Django application on the production server using Nginx + Gunicorn. When I doing a simple stress test on the server (holding the F5 key for a minute) the server returns a 504 Gateway Time-out error. Why does this happen? This error only appears for the user when doing multiple concurrent reque... |
Iterate through 2 loops in GAE Python templates | 20,301,699 | 0 | 0 | 86 | 0 | python,list,google-app-engine,jinja2 | It sounds like you want to use itertools.product(list1, list2). This will create all combinations of list1 and list2.
For example, if list1 = [1,2] and list2 = [1,2,3] then itertools.products(list1,list2) = [ (1,1),(2,1),(3,1),(2,1),(2,2),(2,3)] | 0 | 0 | 0 | 0 | 2013-11-29T17:53:00.000 | 2 | 0 | false | 20,291,176 | 0 | 0 | 1 | 1 | I am using Jinja2 template in python for Google App Engine. I need to iterate through 2 lists list1 and list2 in the same loop in the html file. I tried using zip as described in some of the posts but it is not working.
Something similar in C : for(i=0.j=0; I<len(list1) && j < len(list2) ; I++,j++)
Can anyone suggest ... |
Restrict Python API access to single Arduino entity | 20,298,873 | 1 | 0 | 78 | 0 | python,api,flask,arduino | Configure your WSGI container or its associated web server to only allow access to the Flask application from the IP address assigned to the Arduino's network interface. | 0 | 0 | 0 | 1 | 2013-11-30T09:53:00.000 | 2 | 0.099668 | false | 20,298,833 | 0 | 0 | 1 | 1 | I am basically writing an API in Python, using Flask, and I would like to restrict access to its endpoints so that only an entity, namely an Arduino, can have GET and POST access. How should I make this possible and what should I be looking for? |
How to save Information in Database using BeautifulSoup | 20,305,193 | 0 | 0 | 861 | 1 | python,database,python-2.7,beautifulsoup,mysql-python | You're doing it wrong!
Make an object that represents a row in the database, use __getitem__ to pretend it's a dictionary.
Put your database logic in that.
Don't go all noSQL unless your tables are not related. Just by being tables they are ideal for SQL! | 0 | 0 | 0 | 0 | 2013-11-30T19:46:00.000 | 4 | 0 | false | 20,304,863 | 1 | 0 | 1 | 2 | I'm getting different information for a particular thing and i'm storing those information in a dictionary
e.g. {property1:val , property2:val, property3:val}
now I have several dictionary of this type (as I get many things ..each dictionary is for a thing)
now I want to save information in DB so there would be as ma... |
How to save Information in Database using BeautifulSoup | 20,305,076 | 0 | 0 | 861 | 1 | python,database,python-2.7,beautifulsoup,mysql-python | If your dictionaries all have the same keys, and each key always has the same value-type, it would be pretty straight-forward to map this to a relational database like MySQL.
Alternatively, you could convert your dictionaries to objects and use an ORM like SQLAlchemy to do the back-end work. | 0 | 0 | 0 | 0 | 2013-11-30T19:46:00.000 | 4 | 0 | false | 20,304,863 | 1 | 0 | 1 | 2 | I'm getting different information for a particular thing and i'm storing those information in a dictionary
e.g. {property1:val , property2:val, property3:val}
now I have several dictionary of this type (as I get many things ..each dictionary is for a thing)
now I want to save information in DB so there would be as ma... |
Periodic OperationalError: (2006, 'MySQL server has gone away') | 20,309,286 | 4 | 2 | 2,432 | 1 | python,mysql,mysql-python,pythonanywhere | It normally because your mysql network connect be disconnected, may by your network gateway/router, so you have two options. One is always build a mysql connect before every query (not using connect pool etc). Second is try and catch this error, then get connect and query db again. | 0 | 0 | 0 | 0 | 2013-12-01T02:33:00.000 | 1 | 1.2 | true | 20,308,097 | 0 | 0 | 1 | 1 | I am hosting a web app at pythonanywhere.com and experiencing a strange problem. Every half-hour or so I am getting the OperationalError: (2006, 'MySQL server has gone away'). However, if I resave my wsgi.py file, the error disappears. And then appears again some half-an-hour later...
During the loading of the main pag... |
ImportError: No module named _csv . Qpython for android logs | 31,173,939 | 0 | 0 | 840 | 0 | importerror,qpython | To install _csv or any other module, follow these steps. Here's what I did to install websocket (and all of its dependencies):
To install websocket on the phone:
Start QPython
Click the big button
Select “run local script”
Select “pip_console.py”
Type “pip install websocket” | 1 | 0 | 0 | 0 | 2013-12-01T04:17:00.000 | 2 | 0 | false | 20,308,674 | 0 | 1 | 1 | 2 | I put goog_appengine inside android located at /mnt/sdcard
I also put wsgiref folder at same location.
from Qpython I manage to "send control key" + "d"
I got sh $
I put command like the ff:
"$python /mnt/sdcard/google_appengine/appcfg.py"
But Igot ImportError: no module _csv
I feel putting these is not same architect... |
ImportError: No module named _csv . Qpython for android logs | 21,482,814 | 0 | 0 | 840 | 0 | importerror,qpython | You can install _csv from QPython's system. ( You can find system icon in qpython's new version 0.9.6.2 ) | 1 | 0 | 0 | 0 | 2013-12-01T04:17:00.000 | 2 | 0 | false | 20,308,674 | 0 | 1 | 1 | 2 | I put goog_appengine inside android located at /mnt/sdcard
I also put wsgiref folder at same location.
from Qpython I manage to "send control key" + "d"
I got sh $
I put command like the ff:
"$python /mnt/sdcard/google_appengine/appcfg.py"
But Igot ImportError: no module _csv
I feel putting these is not same architect... |
Why does Django say there is no module named views? | 20,308,829 | 1 | 1 | 166 | 0 | python,django | The views.py must be in the same folder as in the urls.py. If not, while importing the views.py, its better to specify the exact path of the views.py, from the SYS_PATH of the project (from the folder where you have the manage.py file), which will help | 0 | 0 | 0 | 0 | 2013-12-01T04:41:00.000 | 2 | 0.099668 | false | 20,308,788 | 0 | 0 | 1 | 1 | I have a Django project that I wrote. I am testing it on the development server. It is saying that there is no module named views, even though the file views.py is one level higher than it in the directory views. Why is this? Does the views.py need to be in the same folder as the urls.py? Is that causing this? |
Change menu name openerp | 20,322,373 | 3 | 2 | 325 | 0 | python,xml,openerp,overwrite | yes you can. you just need to create a module with two files. one is __openerp__.py with correct dependency to the base modules and an xml file for updating the menu name. | 0 | 0 | 0 | 0 | 2013-12-01T17:29:00.000 | 1 | 1.2 | true | 20,315,057 | 0 | 0 | 1 | 1 | I want to change an openerp module menu name.
I know how to do it, i'ts actually pretty easy, but this one is a core module sale and i don't want to touch it's code, because of updates issues and stuff.
So, i'll need to inherit this view and change it's name, from another module, can i do this without a module.py or a ... |
Keeping JVM running | 20,315,993 | 1 | 0 | 469 | 0 | java,python,jvm | Without fixing python so it doesn't do you this, you can start a java service which calls your code and have python talk to it via TCP e.g. using protobuf. This way the service can be running all the time. | 0 | 1 | 0 | 0 | 2013-12-01T19:03:00.000 | 1 | 0.197375 | false | 20,315,970 | 1 | 0 | 1 | 1 | We've been working on a web application using Django. One library we needed to use was written in java, so I made a single jar file containing all the java code we need to use. The python script simply calls the java program using subprocess module and resumes its execution.
Everytime the java program is called, it ini... |
I need to overwrite an existing Python installation in ubuntu 12.04.3 | 20,324,883 | 0 | 0 | 533 | 0 | python,django,ubuntu | Sounds like an issue with your path - python not finding django becuase it doesnt know where to look for it. Look up issues regarding path and see if those help. | 0 | 1 | 0 | 1 | 2013-12-02T09:29:00.000 | 2 | 1.2 | true | 20,324,828 | 0 | 0 | 1 | 1 | and thanks ahead of time.
I am relatively new to Linux and am using Ubuntu 12.04.3. Basically, I've been messing around with some files trying to get Django to work. Well, I though I should do another install of Python2.7 for some reason. Stupidly, I manually installed it. Now when I open the Python shell and do 'i... |
Which is a better practice - global import or local import | 20,346,290 | 23 | 17 | 4,974 | 0 | python,django,import | You surely must have noticed that almost all Python code does the imports at the top of the file. There's a reason for that: the overhead of importing is minimal, and the likelihood is that you will be importing the code at some point during the process lifetime anyway, so you may as well get it out of the way.
The onl... | 0 | 0 | 0 | 0 | 2013-12-03T08:31:00.000 | 3 | 1.2 | true | 20,346,189 | 1 | 0 | 1 | 2 | I am developing an app in django and I had a doubt if importing a library at the global level has any impact over the memory or performance than importing at the local ( per-function) level. If it is imported per function or view, the modules that are needed alone are imported saving space right? Or are there any negat... |
Which is a better practice - global import or local import | 20,346,377 | -2 | 17 | 4,974 | 0 | python,django,import | When the script is run, it will store the modules in memory, i'm sure you understand that.
If you're importing on a local scope, the module will be imported each time the client calls the function. But if the module is imported at a global level, there will be no need for that!
So, in this case: global import wins. | 0 | 0 | 0 | 0 | 2013-12-03T08:31:00.000 | 3 | -0.132549 | false | 20,346,189 | 1 | 0 | 1 | 2 | I am developing an app in django and I had a doubt if importing a library at the global level has any impact over the memory or performance than importing at the local ( per-function) level. If it is imported per function or view, the modules that are needed alone are imported saving space right? Or are there any negat... |
Is it possible to run scripts on django using only ftp? | 20,346,988 | 2 | 0 | 219 | 0 | python,mysql,django,ftp | ftp stands for "file transfer protocol", not for "remote shell", so no, you cannot use ftp to execute a command / program / script / whatever. But why don't you just ask your hosting how to get a dump of your data ? | 0 | 0 | 0 | 0 | 2013-12-03T09:02:00.000 | 1 | 1.2 | true | 20,346,778 | 0 | 0 | 1 | 1 | I am newbie to python and django, but this time I need a fast solution. I've got a problems, using hosting where my django application is deployed so I need to migrate to another server, but I have no ssh or telnet to server, only ftp connection for this server. I need to export data from django database. I wanted to w... |
Identify Browser alert messges in Mechanize - Python | 22,406,798 | 0 | 0 | 244 | 0 | python,mechanize,mechanize-python | Answering my own question. Browser giving an alert message simply means that our the node is injected into DOM. By simply looking for the string that I injected in the response body, I could determine whether the given input is reflected through the browser without proper sanitization. | 0 | 0 | 1 | 1 | 2013-12-03T09:24:00.000 | 1 | 1.2 | true | 20,347,235 | 0 | 0 | 1 | 1 | I am trying to develop a small automated tool in python that can check Forms inputs of a web application for XSS vulnerability. I hope to do this using python mechanize library so that I can automate form filling and submit and get the response from the python code. Though mechanize is also works as a browser, is there... |
How to run Python server without command prompt | 20,349,538 | 3 | 2 | 1,565 | 0 | python,django | You run the runserver command only when you develop. After you deploy, the client does not need to run python manage.py runserver command. Calling the url will execute the required view. So it need not be a concern | 0 | 0 | 0 | 0 | 2013-12-03T11:08:00.000 | 3 | 0.197375 | false | 20,349,474 | 0 | 0 | 1 | 1 | I'm developing some Python project with Django. When we render the Python/Django application, we need to open the command prompt and type in python manage.py runserver. That's ok on for the development server. But for production, it looks funny. Is there anyway to run the Python/Django project without opening the comma... |
Modifying JSON response via Flask after_request | 20,365,707 | 1 | 0 | 1,188 | 0 | python,json,http,flask | I never needed to do something like this myself, but you can probably do this by subclassing the Response class.
Let's say you create a JSONResponse class as a subclass of Response. The constructor of this class takes the same arguments as the parent class, but instead of a string for the body it takes a dictionary.
So... | 0 | 0 | 0 | 0 | 2013-12-04T01:52:00.000 | 1 | 1.2 | true | 20,365,356 | 1 | 0 | 1 | 1 | I'm (attempting) to create a RESTlike API via Flask and would like to include the HTTP response code inside the returned json response. I've found the flask.jsonify() very helpful in generating my responses and I can manipulate the response via the app.after_request decorator.
The issue I have is that the response dat... |
Unable to start phantomjs with ghostdriver | 26,636,714 | 0 | 2 | 2,389 | 0 | python,selenium,phantomjs | Not sure what version of Ghostdriver you are on, but I got that error on 1.9.7 until I upgraded to selenium 2.40 | 0 | 0 | 1 | 0 | 2013-12-04T03:56:00.000 | 2 | 0 | false | 20,366,522 | 0 | 0 | 1 | 2 | I am running a code that has selenium component, which requires phantomJS.
I am getting the following error message:
Unable to start phantomjs with ghostdriver.' ; Screenshot: available
In my code, I specified my phantomJS path(the bin path), but such measure didn't work.
I have placed the phantomJS-osx folder at the ... |
Unable to start phantomjs with ghostdriver | 20,742,773 | -2 | 2 | 2,389 | 0 | python,selenium,phantomjs | This is a bug. Please use selenium 2.37.2 | 0 | 0 | 1 | 0 | 2013-12-04T03:56:00.000 | 2 | -0.197375 | false | 20,366,522 | 0 | 0 | 1 | 2 | I am running a code that has selenium component, which requires phantomJS.
I am getting the following error message:
Unable to start phantomjs with ghostdriver.' ; Screenshot: available
In my code, I specified my phantomJS path(the bin path), but such measure didn't work.
I have placed the phantomJS-osx folder at the ... |
How to "merge" two Python twisted applications? | 20,429,005 | 0 | 2 | 247 | 0 | python,asynchronous,twisted,tornado,reactor | So far I found, that if you merge two twisted applications, you should remove reactor.run() from one of them, leaving only one reactor.run() in the end. And be sure that twisted.reactor implementation is same for both applications.
More comments welcome. | 0 | 1 | 0 | 0 | 2013-12-05T15:28:00.000 | 2 | 0 | false | 20,403,921 | 0 | 0 | 1 | 1 | I have two applications, written on twisted framework, for example one using twisted.web, and other using twisted.protocols.*, not web. How can I "merge" them in one, effectively sharing one reactor for both apps?
What are the best practices for that tasks? Actually I need to connect SIPSimpleApp and TornadoWeb. They b... |
PHP / Python / Ruby - Long running tasks with short previews | 20,409,383 | 2 | 0 | 81 | 0 | php,python,ruby | Language is irrelevant.
Just put "short" operation in function (object, if it is complex) and use it from 2 places:
web-code which needs "preview" will call it once and get its piece of data
long-running background process will call it iteratively as much as needed and will store result of function in DB instead of re... | 0 | 0 | 0 | 1 | 2013-12-05T17:44:00.000 | 1 | 1.2 | true | 20,406,998 | 0 | 0 | 1 | 1 | I have a web frontend which uses data from a task that must be run frequently in bulk (which takes more time than I'd like to use PHP for). The data can be stored in a database so I was planning on writing a Java application to run the task and use the database as a middleman to get the results of this task accessible ... |
Using relative URL's | 20,422,180 | 1 | 2 | 195 | 0 | python,cherrypy | Try <img src="/page_first/my_image.png"/> | 0 | 0 | 1 | 0 | 2013-12-06T09:59:00.000 | 2 | 0.099668 | false | 20,421,001 | 0 | 0 | 1 | 2 | I do a simple web application written in Python using cherrypy and Mako. So, my question is also simple.
I have one page with URL http://1.2.3.4/a/page_first. Also there is an image that available on URL http://1.2.3.4/a/page_first/my_image.png. And I want to locate my_image.png on the page_first.
I added a tag <img ... |
Using relative URL's | 20,422,773 | 2 | 2 | 195 | 0 | python,cherrypy | The page address needs to be http://1.2.3.4/a/page_first/ (with trailing slash).
ADDED:
You don't seem to understand relative URLs, so let me explain. When you reference an image like this <img src="my_image.png"/>, the image URL in the tag doesn't have any host/path info, so path is taken from the address of the HTML ... | 0 | 0 | 1 | 0 | 2013-12-06T09:59:00.000 | 2 | 1.2 | true | 20,421,001 | 0 | 0 | 1 | 2 | I do a simple web application written in Python using cherrypy and Mako. So, my question is also simple.
I have one page with URL http://1.2.3.4/a/page_first. Also there is an image that available on URL http://1.2.3.4/a/page_first/my_image.png. And I want to locate my_image.png on the page_first.
I added a tag <img ... |
How do I store files in googleappengine datastore | 20,424,484 | 0 | 0 | 71 | 1 | python,google-app-engine,blob,google-cloud-datastore | Datastore has a limit on the size of objects stored there, thats why all examples and documentation say to use the blobstore or cloud storage. Do that. | 0 | 1 | 0 | 0 | 2013-12-06T10:47:00.000 | 1 | 0 | false | 20,421,965 | 0 | 0 | 1 | 1 | Just wondering how to store files in the google app engine datastore.
There are lots of examples on the internet, but they are using blobstore
I have tried importing db.BlobProperty, but when i put() the data
it shows up as a <Blob> i think. It appears like there is no data
Similar to None for a string
Are there any ex... |
Web2py launch script | 20,437,241 | 1 | 0 | 1,158 | 0 | python,web2py | Look at section 4.17.1 of the web2py manual (or Google "web2py cron").
You can run a script on startup of web2py by registering it in the crontab file as:
"@reboot web2py *scripts/myscript.py"
web2py should be the username that it will run as, which should be the same as what web2py runs as. In my setup I have a user n... | 0 | 0 | 0 | 1 | 2013-12-06T15:09:00.000 | 1 | 1.2 | true | 20,427,217 | 0 | 0 | 1 | 1 | I need a launch script which has access to "db" and other web2py modules. This script must be running constantly. I know that Web2py has launch parameters from which you can run python files in the web2py enviroment, but i don't know how that works. Can this parameter solve my problem and if so, how do I go about it? T... |
RS-485 Serial Port Baud Rate Performance Efficiency | 20,437,926 | 5 | 3 | 1,777 | 0 | python,performance,serial-port,baud-rate | You're going to give up some time when the direction of communication is reversed. So there's some "dead time" between when one side receives the last stop bit and when it loads the first response byte into the UART transmitter and starts driving the first start bit.
I'm calculating that this dead time is 5 ms (almost ... | 0 | 0 | 0 | 1 | 2013-12-07T04:49:00.000 | 1 | 1.2 | true | 20,437,735 | 0 | 0 | 1 | 1 | I am developing an application in Python that communicates to a device over RS-485 two wire, half-duplex.
I have enough of the application working that I can perform some performance tests.
I am using a laptop with a USB to 485 converter. The communications is setup as 9600,N,8,1.
For my speed test I send a message wi... |
How do I try and run code that I have written in ACE Cloud 9? | 20,442,855 | 0 | 0 | 530 | 0 | javascript,php,python,vbscript,cloud9-ide | You could possibly make a temporary file in your system, and in an iframe, open the file.
Important Note
This could be insecure as they could get the URL and execute code to delete ../../../ or something, which could harm your files. | 0 | 0 | 0 | 1 | 2013-12-07T11:07:00.000 | 1 | 0 | false | 20,440,581 | 0 | 0 | 1 | 1 | I am using ACE to allow people to code freely on my website. How would I run this code.
I would like a run button in the bottom left corner (I can do that in css), but how would I run it, as it is python. I have added extra tags, as you can write these languages in the ace editor. When I mean, a run button, I mean li... |
Disadvantages of using multiple apps django | 20,473,908 | 6 | 2 | 373 | 0 | python,django,django-apps | Divide et impera.
This is one of the basic rule of programming.
Divide your problem in smaller pieces and on the long run you will be happy:
Code re-usability
Maintenance
Elegance?
Also if you are working on an opensource project your main goal would be to find someone else who is interested in it and that could hel... | 0 | 0 | 0 | 0 | 2013-12-09T15:06:00.000 | 1 | 1.2 | true | 20,473,837 | 0 | 0 | 1 | 1 | In django,What is the difference between creating multiple applications and using the same application and using all models and views in the same application? Will the latter create any problems? |
How to add verbose name after a field in Admin - Django | 20,495,156 | 3 | 1 | 597 | 0 | python,django,verbose | you just need to go to.
/admin/templates/admin/includes/fieldset.html
template.
Here you can see source code like.
{% if field.is_checkbox %}
{{ field.field }} {{ field.label_tag }}
Just change code to :
{% if field.is_checkbox %}
{{ field.label_t... | 0 | 0 | 0 | 0 | 2013-12-10T11:02:00.000 | 2 | 1.2 | true | 20,492,683 | 0 | 0 | 1 | 1 | I have inserted a verbose name for a field in my models (Boolean Field) and when displaying in the admin, the checkbox is shown before the verbose name.
How can I do so that the checkbox shows after the verbose name in the admin console?!
Or is there another way of assigning a specific label to a field other than the... |
Which platform to use for fastest neo4j graph traversal? | 20,512,703 | 5 | 0 | 208 | 0 | java,python,performance,neo4j | In general, the fastest way to do traversals in neo4j is with the Java API.
You might consider testing to see if it is fast enough before potentially prematurely optimizing. Try one of the python libraries w/ Cypher to see how it performs.
If you do have to resort to the Java API, you can usually get away with writin... | 0 | 0 | 0 | 0 | 2013-12-11T06:48:00.000 | 1 | 0.761594 | false | 20,512,397 | 0 | 0 | 1 | 1 | I have to do traversals on neo4j graph in real time. The graph contains around 200,000 nodes and 300,000 relationships. My main concern is that results should be super fast.
Should I write the traversal algorithms in Java? Does Using python (py2neo or bulbflow) for the same has significant performance issues? My perso... |
What would be the more practical uses for a Django application w/out a database? | 20,525,176 | 1 | 0 | 70 | 0 | python,django | I do not recommend using Django if you are not interested in using a database. Having written that disclaimer, if you insist on still using it, you can just scan over the documentation and identify what is still available to you if you do not have a database:
You can use Django's security features to help protect agai... | 0 | 0 | 0 | 0 | 2013-12-11T16:03:00.000 | 2 | 1.2 | true | 20,524,025 | 0 | 0 | 1 | 1 | I recently got into Django out of curiosity after developing for quite a while w/ Ruby on Rails and Node.js, and found that it's splendid for working w/ databases. Django is primarily known for working with databases and every tutorial I've ever found on it has included databases. Django supports not requiring database... |
Run python program on windows 2008 server with web gui | 20,571,773 | 0 | 0 | 143 | 0 | python,python-2.7,windows-server-2008-r2 | Yes, this is possible. However, you need to decouple execution of your programme from your web interface.
Probably the simplest setup is to use supervisor to run both your program and your web interface. How your program and your web interface interact is up to you. You could even have your web interface control super... | 0 | 0 | 0 | 0 | 2013-12-13T16:41:00.000 | 2 | 1.2 | true | 20,571,568 | 1 | 0 | 1 | 1 | I have made this python (2.7) program that takes a few hours to complete, looping through stuff all the time. I also have a windows 2008 server which I want to use to run this program, I can run it just fine on its own and leave it alone for a while, but I want to use a web interface to achieve the same effect.
I curre... |
Distribution Python package to Debian package with installing additional things | 20,574,224 | 0 | 0 | 98 | 0 | python,django,debian-packaging | How to install not only Django project, but also Python and Django with it? What and where and how should I write the script?
If you created a deb file, as it gets interpreted, you should write the python dependency in the debian/control file.
This project demand diffrent additions, such as grappelli, tinymce, filebr... | 0 | 0 | 0 | 0 | 2013-12-13T19:04:00.000 | 1 | 0 | false | 20,574,073 | 1 | 0 | 1 | 1 | I have a Django project needed to be installed in Debian. I make packages via stdeb. I do not understand two things, on which I can`t find answers:
How to install not only Django project, but also Python and Django with it? What and where and how should I write the script?
This project demand different additions, such... |
How do I unlock the app engine database when localhost runs? | 20,578,822 | 9 | 7 | 3,369 | 0 | python,google-app-engine,localhost,google-cloud-datastore | This can happen if you're running multiple instances of dev_appserver without giving them distinct datastore files/directories. If you need to be running multiple instances, see dev_appserver.py --help and look at the options for specifying paths/files. | 0 | 1 | 0 | 0 | 2013-12-14T01:42:00.000 | 4 | 1 | false | 20,578,757 | 0 | 0 | 1 | 2 | Right now I get a blank page when localhost runs, but the deployed app is fine. The logs show the "database is locked". How do I "unlock" the database for localhost? |
How do I unlock the app engine database when localhost runs? | 59,824,595 | 0 | 7 | 3,369 | 0 | python,google-app-engine,localhost,google-cloud-datastore | So with your command to start the server which should be
start_in_shell.sh -f -p 8xxx -a 8xxx
do include a -s flag after the -f as below:
start_in_shell.sh -f -s -p 8xxx -a 8xxx
Sometimes some unanticipated error somewhere causes this issue. Remember to keep only one of the instances with this flag(-s) and others sho... | 0 | 1 | 0 | 0 | 2013-12-14T01:42:00.000 | 4 | 0 | false | 20,578,757 | 0 | 0 | 1 | 2 | Right now I get a blank page when localhost runs, but the deployed app is fine. The logs show the "database is locked". How do I "unlock" the database for localhost? |
How suitable is opting for RethinkDB instead of traditional SQL for a JSON API? | 20,600,546 | 14 | 11 | 2,835 | 1 | python,sql,database,nosql,rethinkdb | I'm working at RethinkDB, but that's my unbiased answer as a web developer (at least as unbiased as I can).
Flexible schema are nice from a developer point of view (and in your case). Like you said, with something like PostgreSQL you would have to format all the data you pull from third parties (SoundCloud, Facebook e... | 0 | 0 | 0 | 0 | 2013-12-15T17:37:00.000 | 1 | 1.2 | true | 20,597,590 | 0 | 0 | 1 | 1 | I am building the back-end for my web app; it would act as an API for the front-end and it will be written in Python (Flask, to be precise).
After taking some decisions regarding design and implementation, I got to the database part. And I started thinking whether NoSQL data storage may be more appropriate for my proje... |
Web page building with python 3.3? | 20,601,999 | 0 | 2 | 104 | 0 | python,web,wsgi | It will be hard, between python2 and python3 there is a lot of incompatibility, and somehow the developers of the most python frameworks somehow won't understand, why they should port their software to the newer version of the language.
The simplest way if you use python 2.
The best way were to start an independent, py... | 0 | 0 | 0 | 0 | 2013-12-16T00:55:00.000 | 2 | 0 | false | 20,601,898 | 0 | 0 | 1 | 1 | I am going through a tutorial on building a website with django. It suggests using mod_python but I have heard to stay away from that and use wsgi instead. Problem is I am running python 3.3 (and apache 2.4.2 for that matter, everything seems to be compatible with apache 2.2). Is there any way to get all of this workin... |
Validation when displaying already existing element | 20,622,467 | 1 | 0 | 31 | 0 | python,django | Errors are shown for the "data" parameter ( or instance if it's a modelform ), not "initial". You need to pass the original values as the data parameter if you want to display errors.
And then just use the usual validation methods ( raising ValidationError in clean_* methods , field specific validation, etc. ). I would... | 0 | 0 | 0 | 0 | 2013-12-16T13:04:00.000 | 2 | 1.2 | true | 20,611,656 | 0 | 0 | 1 | 1 | When editing an already existing element in Django, I would like to show ValidationErrors for fields that are not good (because somewhere else something changed). I've tried to overload the __init__ of the form and set form_obj.errors['__all__']="something" but it doesn't display any errors. How should I approach this? |
I want to locate the specific building the user is in. Should I use html5 geolocation or build my own custom map? | 20,619,667 | 1 | 0 | 213 | 0 | python,html,google-app-engine,geolocation,gps | How precise HTML5 geolocation is depends entirely on what the user's browser supports.
On a phone, it may have access to the phone's idea of the user's location (based on GPS plus cell and WiFi triangulation); on a desktop machine, there's little to go on besides IPs, so it can't do any better than you could do yoursel... | 0 | 0 | 1 | 0 | 2013-12-16T19:44:00.000 | 1 | 0.197375 | false | 20,619,533 | 0 | 0 | 1 | 1 | I'm building a web app with google app engine and python. I've read that html5 geolocation is much more precise than IP geolocation, but is that precise enough to pinpoint buildings? Or is building my own map with customized coordinates a better option? |
How to I determine whether a character is valid-for/rendered-in html? | 20,629,430 | 0 | 1 | 120 | 0 | python,html | What is a valid character in HTML depends on your definition for “HTML” and “valid”. Different HTML versions have different rules for formally valid characters, and they may have characters that are valid but not recommended. Moreover, there are general policies such as favoring Normalization Form C; though not part of... | 0 | 0 | 1 | 0 | 2013-12-17T07:58:00.000 | 2 | 0 | false | 20,628,825 | 0 | 0 | 1 | 1 | Some characters, such as ordinal 22 or 8, don't display in html (using chrome, for example when copy-and-pasting them into this 'Ask question' editor; I am assuming utf-8). How do I determine which characters are valid html, and of the valid, which are rendered?
A table/reference would be helpful (I couldn't find one b... |
How to structure backend of a fantasy sports analytics website on Django? | 20,646,874 | 3 | 2 | 1,392 | 0 | python,database,django,model-view-controller,analytics | There isn't a right answer to this question. Different programmers use different structures. We can, however, provide advice.
Your project will definitely have a core application, in charge of users and account management. All common functionality should be provided by this app. Login/logout/recovery functions fall int... | 0 | 0 | 0 | 0 | 2013-12-17T23:25:00.000 | 1 | 1.2 | true | 20,646,758 | 0 | 0 | 1 | 1 | I'm looking to make an analytics fantasy sports site and I need a little help thinking how to structure the site as a whole. It's most definitely been done before but I'm doing this for educational purposes and because this is a hobby of mine!
The idea for the site is:
Users can create an account
It'll use the Yahoo/E... |
Is using django auth Group the right way to solve this? | 20,653,824 | 0 | 2 | 144 | 0 | python,django,usergroups | You can make an many-to-many relationship between users, groups and classrooms (additional model that will point to these three models, giving group for user in specified classroom) | 0 | 0 | 0 | 0 | 2013-12-18T01:34:00.000 | 1 | 0 | false | 20,648,128 | 0 | 0 | 1 | 1 | A little background: I am building a discussion board app aimed at educators. It's essentially a reddit-style discussion board where responses to a prompt are 'up-voted' or 'down-voted'. The content creators are anonymous to everyone except an admin/teacher user.
So far it works for a single "classroom"; i.e., there ca... |
Install Scrapy for Python 2.6 | 22,181,034 | 0 | 2 | 1,711 | 0 | python,scrapy,python-2.6 | easy_install Scrapy==0.18.4 worked for me | 0 | 0 | 0 | 0 | 2013-12-18T06:55:00.000 | 2 | 0 | false | 20,651,529 | 1 | 0 | 1 | 1 | I am using CentOS and my default Python version is 2.6. I installed Scrapy using pip install Scrapy and I executed the code below
from scrapy.selector import Selector
And I got this message: Scrapy 0.20.2 requires Python 2.7. I can't just upgrade my current version of Python because I have lots of programs that depends... |
Implementing session-like storage in python application | 20,670,147 | 1 | 1 | 375 | 0 | python,authentication | If you're using Unix, rely on the fact that it's a multi user system. That is, the user has already logged in using his own credentials, so you don't need to do anything, just use its home directory to store the data, taking care to block other users from accessing it by using permissions. You can improve this to provi... | 0 | 0 | 0 | 0 | 2013-12-18T21:54:00.000 | 3 | 0.066568 | false | 20,669,240 | 0 | 0 | 1 | 3 | I will keep it short.
Can someone please point me in the right direction in:
How to authenticate users in native applications written in Python?
I know in web there are sessions, but I can't think of a way to implement authentication, that will 'live' for some time and on expiry I can logout the user?
EDIT:
I am ref... |
Implementing session-like storage in python application | 20,669,715 | 1 | 1 | 375 | 0 | python,authentication | You seem to be very confused and fixated on "sessions" for some reasons, maybe because your background is in the web apps?
Any-who you don't need "sessions" because with desktop application you have no trouble telling who is using the software without needing some elaborate tools. You don't need server, you don't need ... | 0 | 0 | 0 | 0 | 2013-12-18T21:54:00.000 | 3 | 0.066568 | false | 20,669,240 | 0 | 0 | 1 | 3 | I will keep it short.
Can someone please point me in the right direction in:
How to authenticate users in native applications written in Python?
I know in web there are sessions, but I can't think of a way to implement authentication, that will 'live' for some time and on expiry I can logout the user?
EDIT:
I am ref... |
Implementing session-like storage in python application | 20,669,948 | 1 | 1 | 375 | 0 | python,authentication | It’s not entirely clear what kind of security you are expecting.
In general, if the end user has physical access to the machine and a screwdriver, you’re pretty much screwed—they can do whatever they want on that machine.
If you take hardware security as a given, but want to ensure software security, then you’re going... | 0 | 0 | 0 | 0 | 2013-12-18T21:54:00.000 | 3 | 1.2 | true | 20,669,240 | 0 | 0 | 1 | 3 | I will keep it short.
Can someone please point me in the right direction in:
How to authenticate users in native applications written in Python?
I know in web there are sessions, but I can't think of a way to implement authentication, that will 'live' for some time and on expiry I can logout the user?
EDIT:
I am ref... |
Prevent creating of expensive object on each request | 20,676,165 | 0 | 3 | 56 | 0 | python,python-2.7,web.py | Assuming your application is served by a long running process (as opposed to something like plain CGI), AND your database is never updated, you always have the option to instantiate your Object_X at the module's top-level (making it a global), so it will only be created once per process. Now it means that you'll have s... | 0 | 0 | 1 | 0 | 2013-12-19T04:07:00.000 | 2 | 0 | false | 20,673,260 | 0 | 0 | 1 | 1 | I have an object which loads all the data from DB Object_X.
This object has a few methods defined. I pass some parameter and based on parameter I call one of the functions in Object_X, it uses pre-populated data in object and parameter to get some result.
I have created a web service which invokes any method defined i... |
Is this possible - Python script to fill a Google spreadsheet? | 50,629,830 | 0 | 0 | 3,149 | 1 | python,google-sheets | Yes, it is possible and this is how I am personally doing it so.
search for "doGet" and "doPost(e) | 0 | 0 | 0 | 0 | 2013-12-19T22:45:00.000 | 3 | 0 | false | 20,693,168 | 0 | 0 | 1 | 1 | I dont even know if this is possible. But if it is, can someone give me the broadstrokes on how I can use a Python script to populate a Google spreadsheet?
I want to scrape data from a web site and dump it into a google spreadsheet. I can imagine what the Python looks like (scrapy, etc). But does the language support w... |
CGI with Python2.7 | 20,701,061 | 0 | 0 | 326 | 0 | python,http,webserver,cgi | To use it as CGI you must move your script into cgi-bin or similar directory of HTTP server. Then point your browser into http://127.0.0.1/cgi-bin/my_scipt.py and see results. In case of problems see at HTTP server error log.
In case of strange errors show us what HTTP server and OS you use, example "Apache 2.2 on WinX... | 0 | 0 | 0 | 1 | 2013-12-20T09:50:00.000 | 1 | 1.2 | true | 20,700,738 | 0 | 0 | 1 | 1 | Am using python2.7. My task is to create a web page say login screen in browser using python. I tried CGI. My code is showing HTML file(all the html code from to ) in CMD screen. Whereas i want them in browser as web page. Any help?. |
Data truncated for column 'temp' at row 1 | 20,712,349 | 1 | 0 | 2,106 | 1 | python,mysql,database,django,amazon-ec2 | Your column is only 2 chars wide, but you are trying to store the strings 'HIGH', 'MEDIUM', 'LOW' from your TEMP choices (the first value of each tuple is saved in the database). Increase max_length or choose different values for choices, e.g. TEMP = ( ('H', 'High'), ('M', 'Medium'), ('L', 'Low'), ).
It worked fine in... | 0 | 0 | 0 | 0 | 2013-12-20T21:24:00.000 | 2 | 1.2 | true | 20,712,174 | 0 | 0 | 1 | 1 | i have deployed a simple Django application on AWS. The database i use is MySQL. Most parts of this application runs well. But there happens to be a problem when i submitted a form and store data from the form into a model. The error page presents Data truncated for column 'temp' at row 1. temp is a ChoiceField like th... |
Add variable in HtmlXPathSelector select function | 20,721,196 | 1 | 0 | 145 | 0 | python,scrapy | Use str.format to insert variable value into xpath expression:
sel.select('//a[contains(@href, "{0}")]/@href'.format(url_type)).extract() | 0 | 0 | 1 | 0 | 2013-12-21T16:35:00.000 | 1 | 1.2 | true | 20,721,145 | 0 | 0 | 1 | 1 | Instead of "rss", I want to add a global variable to it. So that I don't have to change it again and again.
sel.select('//a[contains(@href, "rss")]/@href').extract() to something like this:
sel.select('//a[contains(@href, url_type)]/@href').extract() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.