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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Why would running scheduled tasks with Celery be preferable over crontab? | 18,451,537 | 4 | 47 | 15,773 | 0 | python,django,celery,django-celery | Celery is indicated any time you need to coordinate jobs across multiple machines, ensure jobs run even as machines are added or dropped from a workgroup, have the ability to set expiration times for jobs, define multi-step jobs with graph-style rather than linear dependency flow, or have a single repository of schedul... | 0 | 1 | 0 | 0 | 2013-08-12T13:05:00.000 | 2 | 0.379949 | false | 18,187,751 | 0 | 0 | 1 | 2 | Considering Celery is already a part of the stack to run task queues (i.e. it is not being added just for running crons, that seems an overkill IMHO ).
How can its "periodic tasks" feature be beneficial as a replacement for crontab ?
Specifically looking for following points.
Major pros/cons over crontab
Use cases whe... |
Detecting multiple sessions from same user on Google App Engine | 18,197,132 | 0 | 0 | 84 | 0 | python,google-app-engine,user-management | Yes you can, but you'll have to build the session tracking functionality yourself. | 0 | 1 | 0 | 0 | 2013-08-12T18:23:00.000 | 1 | 0 | false | 18,193,967 | 0 | 0 | 1 | 1 | I am writing an application which uses the Google user API and anyone having a google account can login. I would want to prevent from multiple users using the same google account to login simultaneously. Basically, I would like to allow only 1 user / account to be using my application. As I am running a subscription se... |
connect server-side computing with client-side visualization | 18,213,493 | 0 | 0 | 288 | 0 | javascript,python,plot,visualization,data-visualization | First of all, I would suggest JSON rather than XML to be used for exchange format, it is much easier to parse JSON at the javascript side.
Then, speaking about the architecture of your app, I think that it is better to write a server web application in Python to generate JSON content on the fly than to modify and serve... | 0 | 0 | 1 | 0 | 2013-08-13T15:19:00.000 | 1 | 1.2 | true | 18,212,995 | 0 | 0 | 1 | 1 | I am working on a project which would animate points on a plain by certain methods. I intend to compute the movements of the points in python on server-side and to do the visualization on client-side by a javascript library (raphaeljs.com).
First I thought of the following: Running the process(python) and saving the st... |
django internationalization didn't work on webfaction | 20,224,198 | 0 | 0 | 65 | 0 | python,django,internationalization,web-deployment | it works now i was passing wrong url to LOCALE_PATHS | 0 | 0 | 0 | 0 | 2013-08-13T16:12:00.000 | 1 | 1.2 | true | 18,214,098 | 0 | 0 | 1 | 1 | I have a Django project that works fine on my local server but when I
deploy it to web faction, internationalization doesn't work anymore.
How can I resolve this issue? |
Reusing an object from a context after submitting a form | 18,214,393 | 0 | 0 | 51 | 0 | python,django | This is not related to django. It's how the web works. HTTP is stateless.
When you generate the page, you've finished with that task.
The model instance is destroyed.
When the user submits the form or sends the modifications in any other way, a new connection starts with a new request and a new context.
At this point y... | 0 | 0 | 0 | 0 | 2013-08-13T16:12:00.000 | 3 | 1.2 | true | 18,214,104 | 0 | 0 | 1 | 1 | I'm trying to do something that may appear to be simple, but I can't figure it out. As always, django surprises me with its complexity...
My view generates an instance of a model and "passes it on" in a context to a template. On that template, the user fills a form and submits it. And this is what should happen next: t... |
C pointer equivalents on other languages | 18,257,064 | 0 | 0 | 188 | 0 | php,javascript,python,c,pointers | In Java:
Instead of having a pointer to a struct that you allocate with malloc, you have a reference to an instance of a class that you instantiate with "new". (In Java, you cannot allocate memory for objects on the heap directly as you can in C/C++)
Primitives have no pointers, BUT there are libraries built into the ... | 0 | 0 | 0 | 1 | 2013-08-15T16:13:00.000 | 3 | 0 | false | 18,256,915 | 0 | 0 | 1 | 2 | As a undergraduate in CS, I started with C, where pointer is an important data type. Thereafter I touched on Java, JavaScript, PHP, Python. None of them have pointer per se.
So why? Do they have some equivalents in their languages that perform like pointer, or is the functionality of pointer not important anymore?
I ro... |
C pointer equivalents on other languages | 18,257,037 | 5 | 0 | 188 | 0 | php,javascript,python,c,pointers | So why?
In general, pointers are considered too dangerous, so modern languages try to avoid their direct use.
Do they have some equivalents in their languages that perform like pointer, or is the functionality of pointer not important anymore?
The functionality is VERY important. But to make them less dangerous, the... | 0 | 0 | 0 | 1 | 2013-08-15T16:13:00.000 | 3 | 1.2 | true | 18,256,915 | 0 | 0 | 1 | 2 | As a undergraduate in CS, I started with C, where pointer is an important data type. Thereafter I touched on Java, JavaScript, PHP, Python. None of them have pointer per se.
So why? Do they have some equivalents in their languages that perform like pointer, or is the functionality of pointer not important anymore?
I ro... |
App Engine deserializing records in python: is it really this slow? | 18,281,029 | 7 | 6 | 264 | 0 | python,google-app-engine,app-engine-ndb | Short answer: yes.
I find deserialization in Python to be very slow, especially where repeated properties are involved. Apparently, GAE-Python deserialization creates boatloads of objects. It's known to be inefficient, but also apparently, no one wants to touch it because it's so far down the stack.
It's unfortunate. W... | 0 | 1 | 0 | 0 | 2013-08-15T18:58:00.000 | 1 | 1.2 | true | 18,259,697 | 0 | 0 | 1 | 1 | In profiling my python2.7 App Engine app, I find that it's taking an average of 7ms per record to deserialize records fetched from ndb into python objects. (In pb_to_query_result, pb_to_entity and their descendants—this does not include the RPC time to query the database and receive the raw records.)
Is this expected? ... |
Python Development Enviorment | 18,260,621 | 0 | 3 | 163 | 0 | python,django,web | The answer to this question would be pretty subjective, but lets try.
Minimal requirements
Knowledge about Python (basics, idioms, language characteristics),
Some server solution (if you want to put it live; otherwise local development is possible without web server),
At that point you are already able to code. You c... | 0 | 0 | 0 | 0 | 2013-08-15T19:44:00.000 | 6 | 0 | false | 18,260,514 | 1 | 0 | 1 | 1 | I guess I am having a hard time understanding what is needed to start web development with Python. I am new to both web development and Python and I am having a hard time figuring out what really is needed for a "Python Development Environment. I have heard that I should use virtualenv for all my developing. Others say... |
Django-sphinx How to get a list of keywords | 18,271,689 | 0 | 0 | 87 | 0 | javascript,jquery,python,django,sphinx | You cant get a list of works as such. Morphology processing to produce a stem is a one way process.
But Sphinx does include a BuildExceprts function! This understands morphology settings and will highlight the relevent matching words. | 0 | 0 | 0 | 0 | 2013-08-16T06:53:00.000 | 1 | 0 | false | 18,267,445 | 1 | 0 | 1 | 1 | If I type in the search for "Home", the answer I get the same word "Homes", etc.
I need to highlight the words on the client, as a result of the search. How to get a list of keywords based on the morphology of the client? |
Do I need to use virtualenv with Vagrant? | 18,271,644 | 12 | 22 | 13,000 | 0 | python,django,virtual-machine,virtualenv,vagrant | If you run one vagrant VM per project, then there is no direct reason to use virtualenv.
If other contributors do not use vagrant, but do use virtualenv, then you might want to use it and support it to make their lives easier. | 0 | 0 | 0 | 0 | 2013-08-16T10:09:00.000 | 3 | 1.2 | true | 18,270,859 | 1 | 0 | 1 | 2 | I was used VirtualBox manual setups with virtualenvs inside them to run Django projects on my local machine. Recently I discovered Vagrant and decided to switch to it, because it seems very easy and useful.
But I can not figure - do I need still use virtualenv Vagrant VM, is it encouraged practice or forbidden? |
Do I need to use virtualenv with Vagrant? | 28,601,794 | 9 | 22 | 13,000 | 0 | python,django,virtual-machine,virtualenv,vagrant | Virtualenv and other forms of isolation (Docker, dedicated VM, ...) are not necessarily mutually exclusive. Using virtualenv is still a good idea, even in an isolated environment, to shield the virtual system Python from your project packages. *nix systems use plethora of Python based utilities dependent on specific ve... | 0 | 0 | 0 | 0 | 2013-08-16T10:09:00.000 | 3 | 1 | false | 18,270,859 | 1 | 0 | 1 | 2 | I was used VirtualBox manual setups with virtualenvs inside them to run Django projects on my local machine. Recently I discovered Vagrant and decided to switch to it, because it seems very easy and useful.
But I can not figure - do I need still use virtualenv Vagrant VM, is it encouraged practice or forbidden? |
django inspectdb not getting all my tables | 18,277,208 | 0 | 0 | 847 | 0 | python,django,legacy,inspectdb | figured it out, my 'Name' in my settings.py was incorrect so it was looking at the wrong database | 0 | 0 | 0 | 0 | 2013-08-16T15:25:00.000 | 1 | 0 | false | 18,276,893 | 0 | 0 | 1 | 1 | Running the "inspectdb" with django and it returns a model file but the model file is missing some of the tables in my db. It actually has a table that was put in awhile ago but later deleted or replaced. Do I need to update my DB or something, it seems like django is looking at an older "version" of the db. |
Caching large objects in a python Flask/Gevent web service | 18,286,160 | 0 | 3 | 1,511 | 0 | python,caching,flask,nlp,gevent | Can't you unpickle the files when the sever is instanciated, and then keep the unpickled data into the global namespace? This way, it'll be available for each requests, and as you're not planning to write anything in it, you do not have to fear any race conditions. | 0 | 0 | 0 | 0 | 2013-08-16T19:08:00.000 | 2 | 0 | false | 18,280,454 | 1 | 0 | 1 | 2 | I am building a python based web service that provides natural language processing support to our main app API. Since it's so NLP heavy, it requires unpickling a few very large (50-300MB) corpus files from the disk before it can do any kind of analyses.
How can I load these files into memory so that they are available... |
Caching large objects in a python Flask/Gevent web service | 18,284,611 | 1 | 3 | 1,511 | 0 | python,caching,flask,nlp,gevent | If you are using Gevent you can have your read-only data structures in the global scope of your process and they will be shared by all the greenlets. With Gevent your server will be contained in a single process, so the data can be loaded once and shared among all the worker greenlets.
A good way to encapsulate access ... | 0 | 0 | 0 | 0 | 2013-08-16T19:08:00.000 | 2 | 1.2 | true | 18,280,454 | 1 | 0 | 1 | 2 | I am building a python based web service that provides natural language processing support to our main app API. Since it's so NLP heavy, it requires unpickling a few very large (50-300MB) corpus files from the disk before it can do any kind of analyses.
How can I load these files into memory so that they are available... |
How to run custom python code when server starts with django framework? | 18,290,626 | 3 | 2 | 895 | 0 | python,django | put your code in __init__.py file of your app folder. | 0 | 0 | 0 | 0 | 2013-08-17T15:19:00.000 | 1 | 1.2 | true | 18,290,296 | 0 | 0 | 1 | 1 | I have a python file in my app folder in my django project, I want it to run when the server starts, How do I do that ? |
Python: running process in the background with ability to kill them | 18,293,596 | 1 | 0 | 124 | 0 | python,subprocess,gevent | It depends on your application logic. If you just feed the data into the database without any CPU intensive tasks, then most of your application time will be spent on IO and threads would be sufficient. If you are doing some CPU intensive suff then you should use the multiprocessing module so you can use all your CPU c... | 0 | 1 | 0 | 0 | 2013-08-17T21:05:00.000 | 1 | 0.197375 | false | 18,293,345 | 0 | 0 | 1 | 1 | I need to constantly load a number of data feeds. The data feeds can take 20-30 seconds to load. I know what feeds to load by checking a MySQL database every hour.
I could have up to 20 feeds to load at the same time. It's important that non of the feeds block each other as I need to refresh them constantly.
When I ... |
Building the web app with json only data with javascript and ORM | 18,331,119 | 1 | 2 | 191 | 0 | php,javascript,jquery,python,extjs | I'm working on a Django project for the past six months, where I'm using Django for the backend service, returning only json responses, and the frontend code is completely separate.
jQuery by itself would result in unmaintainable code, even on a smaller scale, so you definitely need a high level frontend framework. I ... | 0 | 0 | 0 | 0 | 2013-08-20T01:18:00.000 | 1 | 1.2 | true | 18,325,521 | 0 | 0 | 1 | 1 | I have given the new project to complete where i have separate components which talk to each other via services calls
They are not linked directly.
The technical head wants to build the entire frontend in ExtJS or jquery and then use JSON to load the data. I mean all forms , login etc will be JSON.
Now i ahve not done ... |
How to authenticate android user POST request with Django REST API? | 18,334,430 | 0 | 4 | 9,898 | 0 | java,android,python,django,authentication | You may want to use the Django Sessions middleware, which will set a cookie with a django session_id. On the following requests, the sessions middleware will set an attribute on your request object called user and you can then test if user is authenticated by request.user.is_authenticated() ( or login_required decorat... | 0 | 0 | 0 | 0 | 2013-08-20T08:57:00.000 | 3 | 0 | false | 18,330,916 | 0 | 0 | 1 | 1 | As of now, I have a Django REST API and everything is hunky dory for the web app, wherein I have implemented User Auth in the backend. The "login_required" condition serves well for the web app, which is cookie based.
I have an Android app now that needs to access the same API. I am able to sign in the user. What I nee... |
Celery - how to susbstitute 'None' in logs | 18,336,614 | 1 | 0 | 281 | 0 | python,django,celery | Are you defining your tasks with ignore_result=True (or did you set CELERY_IGNORE_RESULT to True)? If you did, you should try disabling it. | 0 | 1 | 0 | 0 | 2013-08-20T12:19:00.000 | 1 | 1.2 | true | 18,334,877 | 0 | 0 | 1 | 1 | In Celery's logs there are
Task blabla.bla.bla[arguments] succeeded in 0.757446050644s: None
How to replace this None with something more meaningfull? I tried to set return value in tasks but no luck. |
Safely retrieving data from POST or GET in django | 18,354,920 | 3 | 2 | 2,083 | 0 | python,django,security | r prefixes to strings are not retained in the string value. 'a\\b' and r'a\b' are exactly the same string, which has a single backslash. u prefixes determine whether the string holds bytes or Unicode characters. In general strings in Django apps should be Unicode strings, but Python will automatically convert bytes to ... | 0 | 0 | 0 | 0 | 2013-08-20T20:23:00.000 | 1 | 1.2 | true | 18,344,338 | 0 | 0 | 1 | 1 | I was wondering about the safest way to retrieve data from the POST or GET variable in Django. Sometimes I use the variable that is directly passed into the view function by url patterns in urls.py. I am told (not sure) that they are safe to use when I start the pattern a ''r''. But I dont know why this is the case.
Fo... |
How to get IP address of hostname inside jinja template | 37,210,237 | 4 | 12 | 21,366 | 0 | python,jinja2,salt-stack | This is a very old post, but it is highly ranked in Google for getting the ipv4 address. As of salt 2015.5.8, the best way to get the primary ipv4 address is {{ grains['ipv4'][0] }}. | 0 | 0 | 0 | 0 | 2013-08-21T14:42:00.000 | 7 | 0.113791 | false | 18,360,528 | 0 | 0 | 1 | 1 | Our saltstack is based on hostnames (webN., dbN., etc.). But for various things I need IPs of those servers. For now I had them stored in pillars, but the number of places I need to sync grows.
I tried to use publish + network.ip_addrs, but that kinda sucks, because it needs to do the whole salt-roundtrip just to reso... |
how to define reserved template for python file for eclipse | 18,384,978 | 2 | 1 | 379 | 0 | python,eclipse,ide,pydev | You can define the templates used in PyDev (both for code-completion and for new modules) in window > preferences > pydev > editor > templates.
Anything with the context 'new module' there will be shown to you when you create a new module (and you can have many templates, such as one for unittests, empty modules, class... | 0 | 0 | 0 | 0 | 2013-08-21T23:35:00.000 | 1 | 1.2 | true | 18,369,347 | 1 | 0 | 1 | 1 | I need to use a default template for my files, such as first heading : description of file, author, shebang line and so on. But PyDev and eclipse don't do it for me.
When i want to create a new file in my project, how i have them? |
Google App engine change parent of entity that is not stored | 18,377,368 | 1 | 0 | 35 | 0 | python,google-app-engine | create a new model with the data from the existing one..
or don't create the model until you have all the facts. | 0 | 1 | 0 | 0 | 2013-08-22T09:57:00.000 | 2 | 0.099668 | false | 18,377,222 | 0 | 0 | 1 | 2 | I know we cant change the parent of an entity that is stored , but can we change the parent of the entity that is not stored? For example i am declaring a model as
my_model = MyModel(parent = ParentModel1.key)
but after some checks i may have to change the parent of my_model (i have not run my_model.put() ) to Par... |
Google App engine change parent of entity that is not stored | 18,377,371 | 1 | 0 | 35 | 0 | python,google-app-engine | You still can't do it. You should probably delay instantiation of the MyModel object until you know its parent. Perhaps you could collect the attributes in a dictionary, then when it comes to instantiation you can do my_instance = MyModel(parent=parent_instance, **kwargs). | 0 | 1 | 0 | 0 | 2013-08-22T09:57:00.000 | 2 | 1.2 | true | 18,377,222 | 0 | 0 | 1 | 2 | I know we cant change the parent of an entity that is stored , but can we change the parent of the entity that is not stored? For example i am declaring a model as
my_model = MyModel(parent = ParentModel1.key)
but after some checks i may have to change the parent of my_model (i have not run my_model.put() ) to Par... |
I need a script that searches files for SSI and replaces the include with the actual HTML | 22,432,278 | 0 | 1 | 417 | 0 | python,html,ruby,bash,ssi | On your dev machine, use your browser to display the web page, and then save the 'result' with an appropriate file name/in an output directory.
Thus, if you had mainfile.html which executed various time/last-mod directives and which included fileA.inc and fileB.inc at appropriate places, the resulting display (and save... | 0 | 1 | 0 | 0 | 2013-08-22T10:11:00.000 | 2 | 0 | false | 18,377,549 | 0 | 0 | 1 | 1 | I am developing the front end code of a website which I will be handing over to some developers for them to integrate it with the backend. The site will be written in .NET but I'm developing the front end code with static HTML files (and a bit of javascript).
Because the header, footer and a few other elements are the ... |
How to install NLTK modules in Heroku | 62,639,159 | 0 | 13 | 8,697 | 0 | python,heroku,nltk | You need to follow the below steps.
nltk.txt needs to present at the root folder
Add the modules you want to download like punkt, stopwords as separate row items
Change the line ending from windows to UNIX
Changing the line ending is a very important step. Can be easily done through Sublime Text or Notepad++. In Subl... | 0 | 0 | 0 | 0 | 2013-08-22T15:51:00.000 | 4 | 0 | false | 18,385,303 | 0 | 0 | 1 | 3 | Hey i'd like to install the NLTK pos_tag on my Heroku server. How can i do so. Please give me the steps as im new to the Heroku server system. |
How to install NLTK modules in Heroku | 42,257,701 | 17 | 13 | 8,697 | 0 | python,heroku,nltk | I just added official nltk support to the buildpack!
Simply add a nltk.txt file with a list of corpora you want installed, and everything should work as expected. | 0 | 0 | 0 | 0 | 2013-08-22T15:51:00.000 | 4 | 1 | false | 18,385,303 | 0 | 0 | 1 | 3 | Hey i'd like to install the NLTK pos_tag on my Heroku server. How can i do so. Please give me the steps as im new to the Heroku server system. |
How to install NLTK modules in Heroku | 44,803,942 | 2 | 13 | 8,697 | 0 | python,heroku,nltk | If you want to use simple functionalities like pos_tag, tokenizer, stemming, etc. then you can do the following steps
mention nltk in requirements.txt
mention following modules in nltk.txt
wordnet
pros_cons
reuters
hmm_treebank_pos_tagger
maxent_treebank_pos_tagger
universal_tagset
punkt
averaged_perceptron_tag... | 0 | 0 | 0 | 0 | 2013-08-22T15:51:00.000 | 4 | 0.099668 | false | 18,385,303 | 0 | 0 | 1 | 3 | Hey i'd like to install the NLTK pos_tag on my Heroku server. How can i do so. Please give me the steps as im new to the Heroku server system. |
How to get content of element in embeded python codes in web2py view | 18,414,025 | 0 | 0 | 79 | 0 | javascript,python,web2py | I used a Form to achieve this. Working quite well. | 0 | 0 | 1 | 0 | 2013-08-22T16:24:00.000 | 1 | 1.2 | true | 18,386,023 | 0 | 0 | 1 | 1 | I want to know how I can get content of a certain element by a dynamic id/name in embeded python codes in web2py view page?
Basically I want something like:
{{for task in tasks:}}
...
{{=TEXTAREA(task['remark'], _name='remark'+str(task['id']), _id='remark'+str(task['id']), _rows=2)}}
{{=A('OK', _class='button', _href=U... |
Scapy fields under encryption | 19,122,626 | 1 | 2 | 635 | 0 | python,scapy | OK, at the beginning I put the fields behind the encryption in a packet, and do all the encryption magic in post_build (encrypt) and pre_dissect (decrypt), but that was really tricky... so Instead I created another packet (EncryptedPacket) which overloads addfield and getfield to do all the encryption stuff, this solut... | 0 | 0 | 0 | 0 | 2013-08-22T21:12:00.000 | 1 | 1.2 | true | 18,390,935 | 0 | 0 | 1 | 1 | I have a protocol with encrypted fields.
I want to be able when dissecting the packet, decrypt them
and when building it will encrypt them (lets say I know the private\public key...).
Need this for changing the fields under the encryption.
What is the best way to do this with scapy...
I couldn't find anything usefull.... |
Is it possible to use both cheaper and emperor with uWSGI | 18,396,906 | 2 | 1 | 304 | 0 | python,django,wsgi,uwsgi | There are no problems as each "vassal" can be configured with its special cheaper mode. In this way you can have QoS for your customers. | 0 | 1 | 0 | 0 | 2013-08-22T21:48:00.000 | 1 | 0.379949 | false | 18,391,405 | 0 | 0 | 1 | 1 | I need to host multiple Django sites (quite a lot of sites actually) and currently I am using Apache+mod_wsgi but I want to switch to uWSGI.
One of the nice features of uWSGI is cheaper mode that spawns processes as needed and shuts them down as needed as well. On the other hand, it seems that the way to make it run m... |
Feeding ES directly - Is a queue needed? | 18,465,751 | 3 | 2 | 205 | 0 | python,performance,search,queue,elasticsearch | I am new here, but I will try to share my own experience with ES.
Here, we are using couchDB to store the json we are indexing into ES. However, we do heavy modifications on those docs, like creating new nodes, etc etc. The docs are big, hundreds of fields, more than 15 nested collections.
Finally, there are thousands ... | 0 | 0 | 0 | 0 | 2013-08-23T12:59:00.000 | 2 | 0.291313 | false | 18,403,526 | 0 | 0 | 1 | 1 | I am looking at the possibility of using ES without a database, constructing my data from my python application and sending it straight to ES in real time. It says me a lot of complexity, however my concern is that I might be generating data very quickly and sending requests relentlessly, even when ES might not be read... |
Connecting iOS app to Windows/Linux apps | 18,773,687 | 0 | 4 | 1,265 | 0 | python,ios,windows,web,bonjour | I would definitely suggest a webapp. And the answer to your questions are given below:
How would I receive and send notifications over a local network.
Use a REST based web service to communicate with the server.
You have to use polling to receive data:-(
How could I connect to the server using NSURLConnection if ... | 1 | 1 | 0 | 0 | 2013-08-23T14:46:00.000 | 2 | 0 | false | 18,405,726 | 0 | 0 | 1 | 1 | Background:
I am just about to start development on an mobile and desktop app. They will both be connected to a local wifi network (no internet connection) and will need to communicate with one another. At the outset we are targeting iOS and Windows as the two platforms, with the intention of adding Linux, OSX, and And... |
Google App Engine, Change which python version | 18,955,756 | 1 | 2 | 1,807 | 0 | python,google-app-engine,path,google-cloud-storage,sys.path | In GAE change the python path via Preferences settings, set Python Path to match your python 27 path. | 0 | 1 | 0 | 0 | 2013-08-23T16:05:00.000 | 1 | 0.197375 | false | 18,407,249 | 0 | 0 | 1 | 1 | I'm trying to use the GCS client library with my app engine app and I ran into this -
"In order to use the client library in your app, put the /src/cloudstorage directory in your sys.path so Python can find it."
First, does this mean I need to move the directory into my sys.path OR does it need to add the ~/src/clouds... |
Python Frameworks vs Firebase | 18,420,953 | 4 | 0 | 2,929 | 0 | python,django,pyramid,firebase,bottle | Some contras of using Firebase:
Your data is in an external server (deal-breaker for sensitive data)
It costs money
You have an additional dependency that you don't fully control (if they go out of service/business you might be in trouble)
You know the pros. If you think these are not relevant to you then go for it. | 0 | 0 | 0 | 1 | 2013-08-24T16:48:00.000 | 1 | 0.664037 | false | 18,420,854 | 0 | 0 | 1 | 1 | Since Firebase can do user login as well as hold a lot of other stuff about users and their interactions with my app.
What are some of the advantages and disadvantages of using Firebase solely as a web framework, instead of using django, pyramids, bottle, etc etc?
http routing, etc etc.... I have that sorta stuff handl... |
How to debug Django unittests with PyDev? | 19,337,234 | 5 | 1 | 1,988 | 0 | python,django,unit-testing,debugging,pydev | Setup a new debug configuration.
Run -> Debug Configurations...
Select 'PyDev Django'
Click 'New Launch Configuration (top left corner)
Name your new configuration
Set the project to your project
Set the module to your manage.py (browse to your manage.py)
Go to the 'Arguments' tab and enter 'test' under 'Program argum... | 0 | 0 | 0 | 1 | 2013-08-25T00:28:00.000 | 1 | 0.761594 | false | 18,424,495 | 0 | 0 | 1 | 1 | i've written a few unittests for a Django project. I'd like to debug them. I've set a break point on the server side. what should I click to run the Django unittest with debugging enabled in PyDev Eclipse?
It seems I can run the manage.py test command from Pydev, but then there's no debugging. If I run the unittest wit... |
Django not installed in venv? | 51,107,469 | 0 | 1 | 1,802 | 0 | django,python-venv | What happened to me was that I was trying to install django from outside the environment directory/folder.
So make sure you are inside the environment directory and then use pip install django | 0 | 0 | 0 | 0 | 2013-08-25T10:50:00.000 | 3 | 0 | false | 18,428,204 | 1 | 0 | 1 | 2 | Would anyone know possible reasons why Django is being installed in the global site package and not my venv's site package folder?
Here's my set up and what I did, this is a bit detailed since I'm new to Python/Django and not sure which information is important:
Python 3.3 is installed in c:\python33
I have virtualen... |
Django not installed in venv? | 18,429,225 | 1 | 1 | 1,802 | 0 | django,python-venv | Pip should be installed when you create the virtual environment. Don't change directory into C:\Python33\Scripts before running pip. It looks like that means you use the base install's pip instead of your virtual environment's pip.
You should be able to run pip from any other directory. However I'm not familiar with p... | 0 | 0 | 0 | 0 | 2013-08-25T10:50:00.000 | 3 | 1.2 | true | 18,428,204 | 1 | 0 | 1 | 2 | Would anyone know possible reasons why Django is being installed in the global site package and not my venv's site package folder?
Here's my set up and what I did, this is a bit detailed since I'm new to Python/Django and not sure which information is important:
Python 3.3 is installed in c:\python33
I have virtualen... |
Does Google App Engine's git Push-to-Deploy also update backends? | 18,455,561 | 2 | 1 | 157 | 0 | git,google-app-engine,python-2.7 | No -- It doesn't update backends.
(My cron jobs ran last night and failed because they were running old code.)
Nothin' like good ol' appcfg.py update ./ --backends | 0 | 1 | 0 | 0 | 2013-08-25T23:15:00.000 | 1 | 1.2 | true | 18,434,685 | 0 | 0 | 1 | 1 | When using appcfg.py, I had to specify backends to update them.
What about when I'm using Push-to-Deploy?
I ask because I see two of my Versions don't have the same "deployed" date -- the backend still says "6 days ago". I didn't change backends.yaml, but I did change the code that runs on that backend.
Should I see ... |
What's the difference between self.browse() and self.pool.get() in OpenERP development? | 18,457,696 | 8 | 4 | 11,039 | 0 | python,odoo | self.pool.get is used to get the Singleton instance of the orm model from the registry pool for the database in use. self.browse is a method of the orm model to return a browse record.
As a rough analogy, think of self.pool.get as getting a database cursor and self.browse as a sql select of a records by Id. Note if y... | 0 | 0 | 1 | 0 | 2013-08-26T05:27:00.000 | 2 | 1.2 | true | 18,437,202 | 0 | 0 | 1 | 1 | I have been working on developing a module in OpenERP 7.0. I have been using Python and the Eclipse IDE for development. I wanted to know the difference between self.browse() and self.pool.get() in OpenERP development.
Thanks. |
How do I make files downloadable for a particular role in Plone? | 18,516,979 | 2 | 1 | 155 | 0 | python,plone | The codeless way to do this is to make use of Plone's workflow system.
Out-of-the-box, Plone's file and image content types do not have their own workflow. That means that files and images will simply inherit the publication state of their parent folder. This is easy and sensible, but it doesn't meet the need you're de... | 0 | 0 | 0 | 0 | 2013-08-26T05:36:00.000 | 2 | 1.2 | true | 18,437,284 | 0 | 0 | 1 | 1 | I wish to make the contents of a folder in Plone downloadable only for certain roles. Can this be done easily? At present anybody who clicks the hyperlink for file name in the folder contents can download the file easily. I know about the site-wide option of overriding the at_download code using ZMI. |
Can i generate reporting using google calendar | 52,007,377 | 0 | 3 | 3,005 | 0 | python,django,reporting,google-calendar-api | I'm probably going to write a Python script for this soon.
I had written a reporting app before in C#, but it's badly written and I think Google has changed their API again so it's not working anymore.
The way I did it was to use tags. I wanted my total work hours per client. I would enter them into Google Calendar a... | 0 | 0 | 0 | 0 | 2013-08-27T00:42:00.000 | 3 | 0 | false | 18,455,213 | 0 | 0 | 1 | 1 | I am planning my all day activities in Google calendar LIke
Offcie time
sleeping
playing
Gym
I am happy with Google but issue is that i don't get reporting so that i can see how much time is spent in each category.
I know python and django so i was thinking is it possible that i still log all events in Google calenda... |
Extracting links from HTML in Python | 18,456,494 | 1 | 1 | 718 | 0 | python,html,python-3.x,html-parsing | try to use HTML.Parser library or re library
they will help you to do that
and i think you can use regex to do it
r'http[s]?://[^\s<>"]+|www.[^\s<>"]+ | 0 | 0 | 1 | 0 | 2013-08-27T02:27:00.000 | 2 | 0.099668 | false | 18,455,991 | 0 | 0 | 1 | 1 | i have to basically make a program that take a user-input web address and parses html to find links . then stores all the links in another HTML file in a certain format. i only have access to builtin python modules (python 3) . im able to get the HTML code from the link using urllib.request and put that into a string. ... |
Most efficient way to migrate from one model to another? | 18,468,452 | 0 | 0 | 46 | 0 | python,google-app-engine,app-engine-ndb | You haven't described many limitations, so I assume it's just a simple copy operation you're after. "Best way" is kinda vague, I don't know what you're comparing against. The only thing that you'd want to be careful about is to do the actual work of creating the new entity, copying data over, and deleting the old ent... | 0 | 0 | 0 | 0 | 2013-08-27T04:17:00.000 | 2 | 0 | false | 18,456,841 | 0 | 0 | 1 | 1 | I want to consolidate my logging data into a single StatisticStore model. Right now, my logging data is scattered around 3 models, which is a mess.
What would be the best way to iterate over all those records of all 3 models, and create a copy of each in the new StatisticStore model? |
Reducing Google App Engine costs | 18,468,740 | 3 | 2 | 638 | 0 | javascript,python,google-app-engine | I'm assuming you're paying a lot in instance hours. Reading from the GAE filesystem is rather slow. So the easiest way to optimize is only read from the static file once on your instance startup, keep the js file in memory (ie a global variable), and print it.
Secondly, make sure your js is being cached by the custom... | 0 | 1 | 0 | 0 | 2013-08-27T13:43:00.000 | 3 | 0.197375 | false | 18,467,222 | 0 | 0 | 1 | 1 | We have a piece of Javascript which is served to millions of browsers daily.
In order to handle the load, we decided to go for Google App Engine.
One particular thing about this piece of Javascript is that it is (very) slightly different per company using our service.
So far we are handling this by serving everything t... |
hasattr() throws AttributeError | 18,474,264 | 3 | 0 | 361 | 0 | python,django | The error is complaining about LargeImage. That's being caused by this expression: product.LargeImage. You might want to check for that first, or even better, put this in a try/except block. | 0 | 0 | 1 | 0 | 2013-08-27T19:50:00.000 | 1 | 1.2 | true | 18,474,222 | 0 | 0 | 1 | 1 | I'm trying to check if some xml in a django app has certain elements/nodes and if not just to skip that code block. I'm checking for the elements existance using hasattr(), which should return false if the element doesn't exist:
if hasattr(product.ItemAttributes, 'ListPrice') \ and hasattr(product.Offers.Offer.OfferL... |
virtualenv/virtualenvwrapper confusion - how to properly use | 18,475,165 | 2 | 0 | 329 | 0 | python,django,virtualenv,virtualenvwrapper | When i do tutorials like "Effective Django" they use the virtualenv command on an empty folder, then activate it. That works, until tomorrow when I want to work on the app again at which point the virtualenv is gone.
I strongly doubt that this is the case, unless something is deleting your directories overnight. If t... | 0 | 0 | 0 | 0 | 2013-08-27T20:43:00.000 | 1 | 0.379949 | false | 18,475,116 | 1 | 0 | 1 | 1 | Sorry if this is dumb but every piece of documentation i read doesn't ever seem to answer this question in a direct way. How do i properly use virtualenv so that I have a virtualenv i can call with workon?
When i do tutorials like "Effective Django" they use the virtualenv command on an empty folder, then activate it.... |
Digits in Eclipse's console after HTTP status codes | 18,476,086 | 1 | 0 | 45 | 0 | python,django,eclipse,http,pydev | It's the size of the response, in bytes.
Note that this has nothing to do with Eclipse, it's just the way Django's runserver formats its output. | 0 | 0 | 1 | 0 | 2013-08-27T20:56:00.000 | 1 | 1.2 | true | 18,475,321 | 0 | 0 | 1 | 1 | I am a programming newbie, and I recently installed Python + Django, and successfully created a very small web app. Everything works fine, but I am puzzled about 4 digits that appear after HTTP status codes in Eclipse's console following any request I make to my server.
Example: [27/Aug/2013 22:53:32] "GET / HTTP/1.1" ... |
Py4J has bigger overhead than Jython and JPype | 21,098,619 | 1 | 7 | 6,465 | 0 | java,python,mahout,py4j | I don't know Mahout. But think about that: At least with JPype and Py4J you will have performance impact when converting types from Java to Python and vice versa. Try to minimize calls between the languages. Maybe it's an alternative for you to code a thin wrapper in Java that condenses many Javacalls to one python2jav... | 0 | 0 | 0 | 0 | 2013-08-28T10:03:00.000 | 5 | 0.039979 | false | 18,484,879 | 1 | 0 | 1 | 1 | After searching for an option to run Java code from Django application(python), I found out that Py4J is the best option for me. I tried Jython, JPype and Python subprocess and each of them have certain limitations:
Jython. My app runs in python.
JPype is buggy. You can start JVM just once after that it fails to start... |
Django MVT design: Should I have all the code in models or views? | 18,494,672 | 0 | 3 | 166 | 0 | python,django | Experienced Django users seem to always err on the side of putting code in models. In part, that's because it's a lot easier to unit test models - they're usually pretty self-contained, whereas views touch both models and templates.
Beyond that, I would just ask yourself if the code pertains to the model itself or whet... | 0 | 0 | 0 | 0 | 2013-08-28T14:39:00.000 | 2 | 0 | false | 18,491,040 | 0 | 0 | 1 | 1 | I'm pretty novice so I'll try to explain in a way that you can understand what I mean.
I'm coding a simple application in Django to track cash operations, track amounts, etc.
So I have an Account Model (with an amount field to track how many money is inside) and an Operation Model(with an amount field as well).
I've cr... |
Forking Django DB connections | 18,496,589 | 0 | 2 | 941 | 1 | python,django,postgresql | The libpq driver, which is what the psycopg2 driver usually used by django is built on, does not support forking an active connection. I'm not sure if there might be another driver does not, but I would assume not - the protocol does not support multiplexing multiple sessions on the same connection.
The proper solution... | 0 | 1 | 0 | 0 | 2013-08-28T15:42:00.000 | 2 | 0 | false | 18,492,467 | 0 | 0 | 1 | 2 | I have an application which receives data over a TCP connection and writes it to a postgres database. I then use a django web front end to provide a gui to this data. Since django provides useful database access methods my TCP receiver also uses the django models to write to the database.
My issue is that I need to use... |
Forking Django DB connections | 18,531,322 | 1 | 2 | 941 | 1 | python,django,postgresql | So one solution I found is to create a new thread to spawn from. Django opens a new connection per thread so spawning from a new thread ensures you pass a new connection to the new process.
In retrospect I wish I'd used psycopg2 directly from the beginning rather than Django. Django is great for the web front end but ... | 0 | 1 | 0 | 0 | 2013-08-28T15:42:00.000 | 2 | 0.099668 | false | 18,492,467 | 0 | 0 | 1 | 2 | I have an application which receives data over a TCP connection and writes it to a postgres database. I then use a django web front end to provide a gui to this data. Since django provides useful database access methods my TCP receiver also uses the django models to write to the database.
My issue is that I need to use... |
Can a Django application authenticate with MySQL using its linux user? | 18,496,083 | 1 | 3 | 691 | 1 | python,mysql,django | MySQL controls access to tables from its own list of users, so it's better to create MySQL users with permissions. You might want to create roles instead of users so you don't have as many to manage: an Admin, a read/write role, a read-only role, etc.
A Django application always runs as the web server user. You could... | 0 | 0 | 0 | 0 | 2013-08-28T18:39:00.000 | 1 | 0.197375 | false | 18,495,773 | 0 | 0 | 1 | 1 | The company I work for is starting development of a Django business application that will use MySQL as the database engine. I'm looking for a way to keep from having database credentials stored in a plain-text config file.
I'm coming from a Windows/IIS background where a vhost can impersonate an existing Windows/AD use... |
How to separate languages in Django Model / Database | 18,507,451 | 2 | 1 | 82 | 0 | python,database,django,model,internationalization | I have alreay made a project like this. I have used one table with mixed languages, with a column to specify which language it is. I have no problem with this implementation.
An other approach I had thought is to create dynamically a table like content_ and to fill in. But very boring (you have to manage id dependancy ... | 0 | 0 | 0 | 0 | 2013-08-29T09:35:00.000 | 2 | 0.197375 | false | 18,507,246 | 0 | 0 | 1 | 1 | In my Django Project I am using the i18n internationalization to translate all templates. Now, depending on the chosen language I also would like to separate the data that users are submitting to the database. I do not want to have mixed languages in one table. What is the best approach how to solve this problem? I am ... |
Is there a efficient way to override get() and put() method in an appengine entity to make it use memcache? | 18,520,162 | 2 | 1 | 148 | 0 | python,google-app-engine,optimization,memcached,entity | If you're not using NDB, use NDB. Your data won't change, just the way you interface with the datastore will. NDB entities are automatically cached so any requests by key are searched for in memcache first and then the datastore if the entity is not found.
NDB is the new standard anyways, so you might as well switch n... | 0 | 1 | 0 | 0 | 2013-08-29T14:14:00.000 | 1 | 1.2 | true | 18,513,411 | 0 | 0 | 1 | 1 | I have several appengine entities that are frequently read at different places of my applications and not so frequently updated.
I'd like to use memcache to reduce the number of datastore reads of my app, but i don't really want to update my code everywhere.
I was wondering if there is a decent way to override the get(... |
How do I package a Scrapy script into a standalone application? | 18,535,442 | 0 | 3 | 2,202 | 0 | python,scrapy,desktop-application,py2exe,pyinstaller | The simplest way is write a script in python for them I guess...
If you are running a Windows Server you can even schedule the comand that you use (scrapy crawl yoursprider) to run the spiders. | 0 | 0 | 0 | 0 | 2013-08-30T12:09:00.000 | 3 | 0 | false | 18,532,596 | 0 | 0 | 1 | 1 | I have a set of Scrapy spiders. They need to be run daily from a desktop application.
What is the simplest way (from user's point of view) to install and run it on another windows machine? |
Python Integration with Java / C | 18,609,443 | 0 | 1 | 251 | 0 | java,c++,python,interface,integration | gcj (gcc compiler for java) supports java 1.5 syntax (1.4 is working better on it) and therefore some Java programs may be compiled to native code. gcjh (or javah) can produce headers for java libraries, so you can write C extensions for python. Of course some libraries could not be compiled with gcj (like Apache Commo... | 1 | 0 | 0 | 0 | 2013-08-30T17:09:00.000 | 3 | 1.2 | true | 18,538,170 | 0 | 0 | 1 | 2 | I implemented most of my projects in C++ and python. However, we recently got a new database interface that I could only use Java to retrieve data.
I want to stay with my Python/C++ tools but I am wondering if there is a good solution to integrate Java to my Python application. I heard about Jython, but it is a differ... |
Python Integration with Java / C | 18,538,315 | 0 | 1 | 251 | 0 | java,c++,python,interface,integration | One way to do this is to write web services. A web service can accept an HTTP request, marshal it into a data request, pass that to a Java class that get the data out, map the quert results into a response of some kind, and send it back.
Any client that can send an HTTP request, accept the response and unmarshal it ca... | 1 | 0 | 0 | 0 | 2013-08-30T17:09:00.000 | 3 | 0 | false | 18,538,170 | 0 | 0 | 1 | 2 | I implemented most of my projects in C++ and python. However, we recently got a new database interface that I could only use Java to retrieve data.
I want to stay with my Python/C++ tools but I am wondering if there is a good solution to integrate Java to my Python application. I heard about Jython, but it is a differ... |
Fastest text search in Python | 18,541,075 | 0 | 0 | 1,008 | 0 | python,sqlite,search,flask,typeahead | You are looking for "partial matches". I would load all possible names into an array, and sort them. Then I would separately create a (26x26) lookup array that shows the index of the first element in the list of names that corresponds to a combination of the first two letters; you might also have a dict (rather than an... | 0 | 0 | 0 | 1 | 2013-08-30T20:28:00.000 | 2 | 0 | false | 18,540,987 | 0 | 0 | 1 | 1 | I am developing my first Flask application (with sqlite as a database). It takes a single name from user as a query, and displays information about this name as a response.
All working well, but I want to implement typeahead.js to make better user experience. Typeahead.js sends requests to server as user types, and sug... |
Efficient session variable server-side caching with Python+Flask | 21,949,675 | 1 | 7 | 2,346 | 0 | python,flask,web,session,caching | Your instinct is correct, it's probably not the way to do it.
Session data should only be ephemeral information that is not too troublesome to lose and recreate. For example, the user will just have to login again to restore it.
Configuration data or anything else that's necessary on the server and that must survive a ... | 0 | 0 | 0 | 0 | 2013-09-01T19:18:00.000 | 2 | 0.099668 | false | 18,562,006 | 0 | 0 | 1 | 1 | Scenario:
Major web app w. Python+Flask
Flask login and Flask.session for basic session variables (user-id and session-id)
Flask.session and limitations? (Cookies)
Cookie based and basically persist only at the client side.
For some session variables that will be regularly read (ie, user permissions, custom applica... |
How to execute a function when uwsgi is stopped | 18,570,411 | 2 | 0 | 890 | 0 | python,flask,uwsgi | you can use the python atexit module or the uwsgi.atexit hook | 0 | 0 | 0 | 0 | 2013-09-02T08:49:00.000 | 1 | 1.2 | true | 18,569,056 | 0 | 0 | 1 | 1 | i am using flask and uwsgi.. At some point i need to know when uwsgi is stopped or when my app (Flask) object is destroyed and when it happens, execute a function.
Any ideas ??
Please |
Startup building and mokup | 18,577,154 | 2 | 0 | 70 | 0 | php,python,mysql,mongodb,startup | The idea that PHP/MySQL is easier or simpler than say Python/MongoDB is just inconsistent.
If you compare for example, Django (the most popular python web framework) with symfony(PHP) you will find that they are almost identical in terms of features and architecture (symfony is actually slightly more complex but also ... | 0 | 0 | 0 | 1 | 2013-09-02T15:44:00.000 | 1 | 0.379949 | false | 18,576,838 | 0 | 0 | 1 | 1 | since about two years ago, I did find my interest in code (Hardware/Sytems/Web) and now, I've found a project which motivates me a lot (It takes all my free time indeed).
Starting this point and because my project could soon switch from a free time project to a daily job, I'm currently developing a mockup of this proje... |
Django bootstrap/middleware/enter-exit | 18,594,433 | 0 | 0 | 216 | 0 | python,django,request | Middleware is very certainly not thread-safe. You should not store anything per-request either on the middleware object, or in the global namespace.
The usual way to do this is sort of thing to annotate it onto the request object. Middleware and views have access to this, but to get it anywhere else (eg in the model) y... | 0 | 0 | 0 | 0 | 2013-09-03T13:58:00.000 | 2 | 0 | false | 18,594,248 | 0 | 0 | 1 | 1 | I have following problem. I want to add to django some kind of setup/teardown for each request. For example at the beginning of per user request I want to collect start data collection and at the end of request dump all data to database (1).
What comes to my mind right now, at the start of middleware instantiate an obj... |
ImportError: Could not import settings 'company.foo.settings' (Is it on sys.path?): No module named foo.settings | 18,644,769 | 0 | 2 | 1,119 | 0 | python,django,namespaces,setuptools | The only way I found for now is the following:
Do not use the namespace_packages parameter in setuptools.setup()
Instead, explicitly define "namespace" packages with this in the __init__.py file:
__import__('pkg_resources').declare_namespace(__name__)
I have not done a lot of testings as to if this will work if I don... | 0 | 0 | 0 | 0 | 2013-09-03T16:16:00.000 | 3 | 1.2 | true | 18,596,971 | 0 | 0 | 1 | 1 | I was asked to split a big project into some reusable libraries (packages). So the idea was to do this:
company-django-shared
company-django-shared-dev
company-python-shared
company-python-shared-dev
These are installable with setuptools and namespaces:
company
company.packagename
company.packagename.tests
company.u... |
Pip doesn't install packages to activated virtualenv, ignores requirements.txt | 25,869,799 | 3 | 11 | 6,391 | 0 | python,django,git,virtualenv,virtualenvwrapper | Struggled with some variation of this issue not long ago; it ended up being my cluttered .bash_profile file.
Make sure you don't have anything that might mess up your virtualenv inside your .bash_profile/.bashrc, such as $VIRTUAL_ENV or $PYTHONHOME or $PYTHONPATH environment variables. | 0 | 1 | 0 | 0 | 2013-09-03T23:57:00.000 | 3 | 0.197375 | false | 18,603,302 | 1 | 0 | 1 | 2 | I am attempting to setup a development environment on my new dev machine at home. I have just installed Ubuntu and now I am attempting to clone a remote repo from our web-server and install its dependencies so I can begin work.
So far I have manually installed virtualenv and virtualenvwrapper from pypi and edited my b... |
Pip doesn't install packages to activated virtualenv, ignores requirements.txt | 32,925,897 | 2 | 11 | 6,391 | 0 | python,django,git,virtualenv,virtualenvwrapper | I know this is an old post, but I just encountered a similar problem. In my case the cause was that I was running the pip install command using sudo. This made the command run globally and the packages install in the global python path.
Hope that helps somebody. | 0 | 1 | 0 | 0 | 2013-09-03T23:57:00.000 | 3 | 0.132549 | false | 18,603,302 | 1 | 0 | 1 | 2 | I am attempting to setup a development environment on my new dev machine at home. I have just installed Ubuntu and now I am attempting to clone a remote repo from our web-server and install its dependencies so I can begin work.
So far I have manually installed virtualenv and virtualenvwrapper from pypi and edited my b... |
How to deserialize xml created by to_xml() in google appengine | 20,461,649 | 0 | 4 | 190 | 0 | python,xml,google-app-engine | Just to clarify, I'm going to assume that you're asking about the Model.to_xml() method, and that by efficient you mean a single method which you can call which will provide you with a model object.
As you noted, there is no such method on the Model class for the datastore API. I think the intention is that the purpose... | 0 | 1 | 0 | 0 | 2013-09-04T17:33:00.000 | 1 | 0 | false | 18,620,311 | 0 | 0 | 1 | 1 | In Google App Engine, I can serialize an object by calling its to_xml() method.
There doesnt appear to be an equivalent from_xml() method to deserialize the xml.
Is there an efficient way to deserialize back to an object? |
GAE Python Server initiating Angular Routes from Responses | 18,626,669 | 0 | 0 | 298 | 0 | python,google-app-engine,angularjs,routes,webapp2 | I'm working on the same stack and the way we do it is that we have the main pages (index, login, signup) configured as regular individual pages where we use angular without routing. Any page that anonymous users will access will be such pages which work over server side routing. But once the user login is successful we... | 0 | 1 | 0 | 0 | 2013-09-04T23:31:00.000 | 2 | 0 | false | 18,625,446 | 0 | 0 | 1 | 2 | I'm currently building a web application using AngularJS, Webapp2, and the Python Google App Engine environment. This app is supposed to have all the features of modern social networks (users, posts, likes, comments). I want the page hierarchy to look like this, the main pages are from the server and the sub pages are ... |
GAE Python Server initiating Angular Routes from Responses | 21,590,989 | 0 | 0 | 298 | 0 | python,google-app-engine,angularjs,routes,webapp2 | Make both GAE and Angular understand your routes. You will need to define them for one, why not both?
You just have to organise your markup and structure so it can support complete page loading and ajax loading. For example, initial load is done on any route by GAE, then Angular can take over, loading each page "conten... | 0 | 1 | 0 | 0 | 2013-09-04T23:31:00.000 | 2 | 0 | false | 18,625,446 | 0 | 0 | 1 | 2 | I'm currently building a web application using AngularJS, Webapp2, and the Python Google App Engine environment. This app is supposed to have all the features of modern social networks (users, posts, likes, comments). I want the page hierarchy to look like this, the main pages are from the server and the sub pages are ... |
Django custom user VS user profile | 18,625,653 | 1 | 0 | 907 | 0 | python,django,django-authentication,django-registration,django-1.5 | When you have it all in one table, then database access is faster. With the old way you had to join on the auxiliary table to get all the information of the user.
Usually when you see a One-to-One relation, it would be better just to merge them in one table.
But the new custom User model solves also another problem, wh... | 0 | 0 | 0 | 0 | 2013-09-04T23:47:00.000 | 1 | 1.2 | true | 18,625,601 | 0 | 0 | 1 | 1 | I'm currently using Django 1.5.1 and using a custom user as described in the official documentation. I realized everything is stored under one table, the auth_user one.
My question is, why is it better to have everything in one big table, instead of having 2 tables like it used to be prior to 1.5 by using a user_profil... |
Get Shape from selected Edges | 18,669,628 | 0 | 0 | 1,151 | 0 | python,maya,pymel | We can find the shape from the edge, by simply listing it's immediate connection with the use of node()
PYMEL:
pm.PyNode(selection[0].node().getParent())
No need to split the string, or re map the array. | 0 | 0 | 0 | 0 | 2013-09-05T12:13:00.000 | 2 | 1.2 | true | 18,636,019 | 0 | 0 | 1 | 1 | Im using Maya to perform a certain task on selected edges.
Let's say I save these edges like this:
edges = pm.filterExpand(sm=32)
From here, I can just select the first edge, and get the object by splitting the unicode string:
'pSphere1.e[274]'
Here's how I split it, and it gave me pSphere1, however calling getShape() ... |
Django 1.3 authentication | 19,995,173 | 0 | 0 | 31 | 0 | django,python-2.7,django-1.3 | I will try to answer why this was happening for us, i worked on it long time ago so will try to recollect as much as i can.
We were allowing admins to modify the login id of the user, This would go and change the email id int he partial digest table. A lot of times they would use this to disable an account by changing... | 0 | 0 | 0 | 0 | 2013-09-05T12:20:00.000 | 1 | 0 | false | 18,636,159 | 0 | 0 | 1 | 1 | We have digest authentication in our application. For some reason we are seeing for a few users having different id, username as in "auth_user" table but for some reason in the django_digest_partialdigest the user_id is different but the "login" column has the same username.
I Am not able find out what scenario would ... |
JavaScript client failed to send WebSocket frame to WebSocket server on Amazon EC2 | 20,952,263 | 1 | 0 | 1,419 | 0 | python,amazon-web-services,amazon-ec2,websocket | This could be caused by to a Chrome Extension. | 0 | 1 | 1 | 0 | 2013-09-05T22:46:00.000 | 1 | 0.197375 | false | 18,647,154 | 0 | 0 | 1 | 1 | I have a web socket server running on an Ubuntu 12.04 EC2 Instance. My web socket server is written in Python, I am using Autobahn WebSockets.
I have a JavaScript client that uses WebRTC to capture webcam frames and send them to the web socket server.
My webserver (where the JavaScript is hosted) is not deployed on EC2... |
How to properly decouple Django from an AJAX application? | 18,650,699 | 1 | 1 | 275 | 0 | javascript,python,django,client-server,tastypie | A mobile client doesn't care if the Javascript comes from Django or any other web server. So go ahead and put all your JavaScript and static HTML on another server.
If you want your mobile app to see if the user is logged in, it should make an AJAX call to your Django backend (where the request is authenticated). The... | 0 | 0 | 0 | 0 | 2013-09-06T05:30:00.000 | 1 | 1.2 | true | 18,650,551 | 0 | 0 | 1 | 1 | I'm using TastyPie and Django to build out my backend for an application that will have browser and mobile (native iOS) clients.
I have been through the TastyPie and Django docs, can authenticate successfully either using the TastyPie resources I set up, or using Djangos built in views. I see a lot of examples on inclu... |
Test an app in django and connect to local database | 18,655,003 | 0 | 0 | 129 | 0 | python,django | Can't you specify the details of your development database in settings.py? This would connect you to the existing database and remove the need to create a new test instance. | 0 | 0 | 0 | 0 | 2013-09-06T06:49:00.000 | 1 | 0 | false | 18,651,617 | 0 | 0 | 1 | 1 | How can I test my app in django, so that it connects to my local database and does NOT require me to create a test database? |
Light Weight Python Web FrameWork | 18,658,647 | 0 | 0 | 379 | 0 | python,html | Flask. Just use Flask.
Honestly you'll finish your project in 20 minutes. | 0 | 0 | 0 | 0 | 2013-09-06T12:21:00.000 | 1 | 1.2 | true | 18,657,777 | 0 | 0 | 1 | 1 | I have a database that can be fetched using mysql query and send the data as response for an ajax jquery request. Which python framework would be best suitable to satisfy this primary need?
Thanks in advance. |
Convert Web Friendly Django app to a Mobile friendly django app | 29,824,864 | 1 | 4 | 4,667 | 0 | python,django,user-interface,packages | Use the bootstrap. I developed the django app too using the bootstrap and it works fine in all smartphone, tablet and desktop devices. | 0 | 0 | 0 | 0 | 2013-09-06T20:40:00.000 | 2 | 0.099668 | false | 18,666,243 | 0 | 0 | 1 | 1 | I've made a desktop-friendly django app and would prefer not to have to rewrite all of the html/css to allow proper view on mobile browsers.
I'm on django 1.5 and python 2.7
Is there a package or library or quicker way to efficiently create a mobile version of my django (web) app instead of having to re-write a whole n... |
Python: Parsing out publication dates from html pages | 18,669,461 | 1 | 1 | 506 | 0 | python,regex | I don't see why a collection of regexs wouldn't work. There are a variety of different formats, but there are really only a handful that are most common. With, say, a dozen easy regex, you could probably scrub 90% of the dates out there.
Another (partial) approach would be to scan for month names and abbreviations, and... | 0 | 0 | 0 | 0 | 2013-09-07T03:25:00.000 | 2 | 0.099668 | false | 18,669,374 | 1 | 0 | 1 | 1 | For html pages, and news-related pages especially, it would be very helpful and incredibly useful if there were a mechanism for parsing out the publication dates.
Unfortunately, there is not one set regex/pattern for dates on the internet. CNN may publish it like MONTH DD, YYYY and HuffingtonPost may publish as MM/DD/Y... |
Persistence of a large number of objects | 18,674,706 | 0 | 0 | 95 | 1 | python,persistence | Martijn's suggestion could be one of the alternatives.
You may consider to store the pickle objects directly in a sqlite database which still can manage from the python standard library.
Use a StringIO object to convert between the database column and python object.
You didn't mention the size of each object you are pi... | 0 | 0 | 0 | 0 | 2013-09-07T15:02:00.000 | 1 | 0 | false | 18,674,630 | 0 | 0 | 1 | 1 | I have some code that I am working on that scrapes some data from a website, and then extracts certain key information from that website and stores it in an object. I create a couple hundred of these objects each day, each from unique url's. This is working quite well, however, I'm inexperienced in what options are a... |
openERP restrict users | 18,828,239 | 0 | 0 | 404 | 0 | python,openerp,restrict | For your cases:
You can try using Many2Many relation so as to choose the record of users.
Use Groups to obtain your desired result.
For example:
<field name="user_id" groups="your_group" />
By doing this you can provide what fields to be visible to which user based on access rights provided in your GROUPS. | 0 | 0 | 0 | 0 | 2013-09-09T14:48:00.000 | 1 | 0 | false | 18,700,969 | 0 | 0 | 1 | 1 | I'm facing a complex problem, at least for me.
I have a form called "Task", which contains all the normal info, and I would like to add users to that Task.
If I want to add multiple users to that task, I should use the widget one2many, am I right? If so, is it possible to display a dropdown or something and add the us... |
BeautifulSoup installation or alternative without easy_install | 18,701,653 | 1 | 0 | 4,503 | 0 | python,beautifulsoup,windows-7-x64 | You just need to add to download it and add it to your python search path directly. (Which is in sys.path, if you need to check it.)
From the documentation:
Beautiful Soup is licensed under the MIT license, so you can also download the tarball, drop the bs4/ directory into almost any Python application (or into your l... | 0 | 0 | 0 | 0 | 2013-09-09T15:11:00.000 | 3 | 0.066568 | false | 18,701,464 | 1 | 0 | 1 | 1 | I wanted to write a program to scrape a website from python. Since there is no built-in possibility to do so, I decided to give the BeautifulSoup module a try.
Unfortunately I encountered some problems using pip and ez_install, since I use Windows 7 64 bit and Python 3.3.
Is there a way to get the BeautifulSoup module ... |
Run unit tests for two Django applications in PyCharm | 18,716,562 | 0 | 1 | 701 | 0 | python,django,pycharm | OK, I've found solution.
If you want to launch many test suits with one test launcher in PyCharm, you should add names of your applications separated by a space to Target field of your Django tests Run/Debug configuration. | 0 | 0 | 0 | 0 | 2013-09-09T19:02:00.000 | 1 | 1.2 | true | 18,705,107 | 0 | 0 | 1 | 1 | I've Django project with two applications with added unit tests (django.test.TestCase). In PyCharm I have created two Django test launchers (one for every app). In this configuration everything works correctly. Now I want to create one test launcher, which will be able to start unit test for both applications at once.
... |
How to create text box in plone site | 18,714,130 | 5 | 0 | 111 | 0 | python,html,plone | You can create a static text portlet in that context you need it: folder, page. | 1 | 0 | 0 | 0 | 2013-09-10T06:12:00.000 | 1 | 1.2 | true | 18,711,815 | 0 | 0 | 1 | 1 | Hi want to add text box and label in plone site
but, that plone site does not display text box
how can i create text box in plone site
thanks! |
How to print report in EXCEL format (XLS) | 18,716,823 | 0 | 1 | 2,902 | 1 | python,openerp | In python library are available to export data in pdf and excel
For excel you can use:
1)xlwt
2)Elementtree
For pdf genration :
1)Pypdf
2)Reportlab
are available | 0 | 0 | 0 | 0 | 2013-09-10T10:34:00.000 | 3 | 0 | false | 18,716,623 | 0 | 0 | 1 | 1 | I'm a beginner of openerp 7. i just want to know the details regarding how to generate report in openerp 7 in xls format.
The formats supported in OpenERP report types are : pdf, odt, raw, sxw, etc..
Is there any direct feature that is available in OpenERP 7 regarding printing the report in EXCEL format(XLS) |
How can I deploy a Flask application on Koding.com | 18,719,851 | 5 | 1 | 626 | 0 | python,flask | Use 0.0.0.0 as source IP. Also remember that, your VM will be turned off 15 minutes after logout. | 0 | 0 | 0 | 0 | 2013-09-10T11:32:00.000 | 1 | 1.2 | true | 18,717,844 | 0 | 0 | 1 | 1 | I am working on a Flask app, and want to deploy it on Koding so that my other team members can also view/edit it. I cloned the git repository inside a VM ( on Koding.com ), install PIP, installed dependencies, but when I start the flask server, it displays that the server has started and is running on 127.0.0.1:5000.
B... |
Python/Cherrypy: set cookie on redirect | 18,746,486 | 2 | 2 | 816 | 0 | python,redirect,cookies,cherrypy | To answer my own question: It would appear that if I add cherrypy.response.cookie[<tag>]['path'] = '/' after setting the cookie value, it works as desired. | 0 | 0 | 1 | 0 | 2013-09-11T16:13:00.000 | 1 | 1.2 | true | 18,746,272 | 0 | 0 | 1 | 1 | I am trying to figure out how to set a cookie just before a redirect from Cherrypy. My situation is this:
when a user logs in, I would like to set a cookie with the users username for use in
client-side code (specifically, inserting the users name into each
page to show who is currently logged in).
The way my login... |
Storing Images In DB Using Django Models | 70,710,224 | 0 | 13 | 27,585 | 0 | python,database,django | I think the best approach is to store the 'main file' in your media path of your project and save the address of file(path to the file) in your model. this way you dont need to convert.... | 0 | 0 | 0 | 0 | 2013-09-11T17:34:00.000 | 4 | 0 | false | 18,747,730 | 0 | 0 | 1 | 1 | I am using Django for creating one Web service and I want that web service to return Images. I am deciding the basic architecture of my Web service. What I came up to conclusion after stumbling on google is:
I should store Images in DB after encoding them to Base64 format.
Transferring the Images would be easy when di... |
Upgrading to Python 2.7 Google App Engine 500 server error | 18,774,464 | 2 | 0 | 198 | 0 | python,google-app-engine,python-2.7,server-error | I'm not sure if this is your formatting when you loaded your code here, but where you define app in main.py should not be part of the contacts class. If it is, your reference to main.app in your app.yaml won't work and your page won't load. | 0 | 1 | 0 | 0 | 2013-09-12T02:08:00.000 | 3 | 0.132549 | false | 18,754,202 | 0 | 0 | 1 | 3 | I just started using Google App Engine and I am very new to Python. I may have made a stupid mistake or a fatal error, I don't know, but I realized that the basic "template" I downloaded from a website was old and used Python 2.5.
So, I decided to update to Python 2.7 (after recieving a warning in the site's dashboard)... |
Upgrading to Python 2.7 Google App Engine 500 server error | 18,778,368 | 0 | 0 | 198 | 0 | python,google-app-engine,python-2.7,server-error | Thank you everyone for your respective answers and comments, but I recently stumbled upon GAE boilerplate and decided to use that and everything's fine. I kept having very odd problems with GAE beforehand, but the boilerplate is simple and seems to be working fine so far. Anyways, thanks again. (Note: I would delete th... | 0 | 1 | 0 | 0 | 2013-09-12T02:08:00.000 | 3 | 1.2 | true | 18,754,202 | 0 | 0 | 1 | 3 | I just started using Google App Engine and I am very new to Python. I may have made a stupid mistake or a fatal error, I don't know, but I realized that the basic "template" I downloaded from a website was old and used Python 2.5.
So, I decided to update to Python 2.7 (after recieving a warning in the site's dashboard)... |
Upgrading to Python 2.7 Google App Engine 500 server error | 18,754,606 | 2 | 0 | 198 | 0 | python,google-app-engine,python-2.7,server-error | I'm submitting as an answer because I'm relatively new to SO and don't have enough rep to comment, so sorry about that... But line 7 of your new main.py uses webapp instead of webapp2, so that may be causing some troubles, but likely isn't the reason that it's not working. Could you also provide the contact.html templa... | 0 | 1 | 0 | 0 | 2013-09-12T02:08:00.000 | 3 | 0.132549 | false | 18,754,202 | 0 | 0 | 1 | 3 | I just started using Google App Engine and I am very new to Python. I may have made a stupid mistake or a fatal error, I don't know, but I realized that the basic "template" I downloaded from a website was old and used Python 2.5.
So, I decided to update to Python 2.7 (after recieving a warning in the site's dashboard)... |
Django Clear All Admin List Filters | 18,755,121 | 0 | 3 | 1,347 | 0 | python,django,list | If you have at least one entry in search_fields and therefore are showing a search box on your admin changelist page, if you have any filters or search terms in effect you should see information to the right of it showing the number of rows that match your current filter and search criteria. It'll be worded as somethi... | 0 | 0 | 0 | 0 | 2013-09-12T03:49:00.000 | 1 | 0 | false | 18,755,024 | 0 | 0 | 1 | 1 | I have a Django admin control panel and in each list of objects there are lots and lots of list filters. I want to be able to clear all the filters with a click of a button, but can't find where this ability is, if it already exists in Django.
Routes I'm considering (but cannot figure out):
Make the last item in the b... |
How to run django tests in Eclipse to make debugging possible, but on test database | 19,786,166 | 1 | 2 | 1,473 | 0 | python,django,eclipse,unit-testing,pydev | You can create a new PyDev django debug configuration in eclipse and set the program arguments to 'test'.
In this case, the debug configuration will execute the following command: `python manage.py test' and your breakpoints inside test cases will get hit. | 0 | 0 | 0 | 1 | 2013-09-12T15:58:00.000 | 1 | 1.2 | true | 18,769,092 | 0 | 0 | 1 | 1 | I've got problem concerning me a long time. I either run tests from eclipse (Python unittest) using Pydev or Nose test runner. That way it's possible to debug tests and watch them in PyUnit view. But that way test database is not created, manage.py is not used.
Or I run them via manage.py test - test db is being creat... |
How to avoid repeated pre-calculation in django view | 18,794,763 | 1 | 0 | 161 | 0 | python,django | You could add a model (with a db table) that stores values for a, b and x. Then for each query, you could look for an instance with a and b and return the associated x. | 0 | 0 | 0 | 0 | 2013-09-13T15:43:00.000 | 2 | 0.099668 | false | 18,790,301 | 1 | 0 | 1 | 2 | I am writing an API which returns json according to queries. For example: localhost/api/query?a=1&b=2. To return the json, I need to do some pre-calculations to calculate a value, say, x. The pre-calculation takes long time (several hundred milliseconds). For example, The json file returns the value of x+a+b.
When the ... |
How to avoid repeated pre-calculation in django view | 18,790,769 | 2 | 0 | 161 | 0 | python,django | If you are using some sort of cache (memcached, redis) you can store it there. You can try to serialize the object with pickle, msgpack etc. That you can retrieve and deserialze it. | 0 | 0 | 0 | 0 | 2013-09-13T15:43:00.000 | 2 | 0.197375 | false | 18,790,301 | 1 | 0 | 1 | 2 | I am writing an API which returns json according to queries. For example: localhost/api/query?a=1&b=2. To return the json, I need to do some pre-calculations to calculate a value, say, x. The pre-calculation takes long time (several hundred milliseconds). For example, The json file returns the value of x+a+b.
When the ... |
Import XML data into a PDF form using Python | 18,794,296 | 0 | 2 | 935 | 0 | python,xml,pdf | Perhaps what you are looking for is whether Adobe LiveCycle Designer support command-line arguments to do that. You could then automate this with python by issuing the command-line, hum, commands. | 0 | 0 | 1 | 0 | 2013-09-13T18:03:00.000 | 1 | 1.2 | true | 18,792,536 | 0 | 0 | 1 | 1 | At my office we had PDFs designed using Adobe LiveCycle Designer that allows you to import xml data into the form to populate it. I would like to know if I could automate the process of importing the xml data into the form using python.
Ideally I would like it if I didn't have to re-create the form using python since ... |
Do I need to reinstall Django for new virtualenv? | 18,795,383 | 2 | 5 | 3,791 | 0 | python,django,virtualenv,virtualenvwrapper | I would recommend just starting from scratch with a new virtualenv. That is the reason that they are built: one virtualenv can house a project that uses one version of Django, but another project can use a separate version of Django (perhaps an older version because an app you're using doesn't yet work with the newer v... | 0 | 0 | 0 | 0 | 2013-09-13T20:54:00.000 | 4 | 1.2 | true | 18,795,081 | 1 | 0 | 1 | 1 | Using virtualenvwrapper, I installed Django for one virtualenv. Now I can't reach it outside that environment. I want to be able to start new Django projects both outside any virtualenv, and inside new virtualenvs.
Do I need to reinstall Django or can I somehow import the installation from my first virtualenv? |
Debugging Cloud Endpoints: Error making request, but no request appears in logs | 18,817,455 | 0 | 0 | 177 | 0 | python,google-app-engine,google-cloud-endpoints | Check if you are running out of resources. | 0 | 1 | 0 | 0 | 2013-09-14T14:48:00.000 | 2 | 0 | false | 18,802,940 | 0 | 0 | 1 | 1 | I have an issue with debugging and Cloud Endpoints. I'm using tons of endpoints in my application, and one endpoint consistently returns with error code 500, message "Internal Error".
This endpoint does not appear in my app's logs, and when I run its code directly in the interactive console (in production), everything ... |
Where to hold static information for game logic? | 18,807,184 | 1 | 0 | 209 | 1 | python,google-app-engine,google-cloud-datastore | If the logic is fixed, keep it in your code. Maybe you can procedurally generate the dicts on startup. If there is a dynamic component to the logic (something you want to update frequently), a data store might be a better bet, but it sounds like that's not applicable here. Unless the number of combinations runs over th... | 0 | 0 | 0 | 0 | 2013-09-14T22:29:00.000 | 2 | 0.099668 | false | 18,807,022 | 1 | 0 | 1 | 1 | The context for this question is:
A Google App Engine backend for a two-person multiplayer turn-based card game
The game revolves around different combinations of cards giving rise to different scores in the game
Obviously, one would store the state of a game in the GAE datastore, but I'm not sure on the approach for... |
Where does Web2py save project files OS X? | 18,813,520 | 2 | 4 | 912 | 0 | python,macos,web2py | If you are using the Mac binary, I think the applications are in /web2py/web2py.app/Contents/Resources/applications/.
Note, you can also run the source version of web2py, in which case, the applications will be in /web2py/applications/. | 0 | 1 | 0 | 0 | 2013-09-15T14:07:00.000 | 1 | 1.2 | true | 18,813,288 | 0 | 0 | 1 | 1 | I am pulling my hair out trying to figure out where web2py stores the project files by default in OS X. It is not located in the same directoy as the web2py.app .
I can launch the web interface and see project in the admin view but want to edit the files from sublime text as opposed to the admin web interface.
I've loo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.