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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Custom logs in AppEngine | 8,844,141 | 2 | 2 | 228 | 0 | python,google-app-engine,logging | Your best option is to store this data in the datastore. If you're concerned about latency, you can either use asynchronous operations, and start the write as soon as possible, or you can use the task queue to do the writes offline. | 0 | 1 | 0 | 0 | 2012-01-12T16:08:00.000 | 2 | 0.197375 | false | 8,838,243 | 0 | 0 | 1 | 2 | I have an application for which I would like to record some statistics for later analysis but which are not at all needed within the application itself. i.e. The data will never need to be read by the application. Whatever system is used for storing these statistics, I just need to be able to take periodic dumps of t... |
appengine datastore - filter by string or integer | 8,844,099 | 2 | 1 | 276 | 0 | python,google-app-engine,google-cloud-datastore | Practically speaking, no. Any difference in the efficiency of comparing different datatypes is insignificant compared to disk access times. | 0 | 1 | 0 | 0 | 2012-01-12T19:20:00.000 | 1 | 1.2 | true | 8,840,999 | 0 | 0 | 1 | 1 | Will a query with a filter over IntegerProperty perform any better than a query with a filter over String Property?
(same indexes) |
Browser charsets order of precedence | 8,841,681 | 2 | 1 | 114 | 0 | python,html,character-encoding | The request header Accept-Charset (which may get mapped to HTTP_ACCEPT_CHARSET server-side) expresses the client’s preferences, to be used when the server is capable to serving the resource in different encodings. The server may ignore it, and often will.
If your page is UTF-8 encoded and declared as such, then any for... | 0 | 0 | 1 | 0 | 2012-01-12T19:38:00.000 | 2 | 1.2 | true | 8,841,227 | 0 | 0 | 1 | 1 | Client browsers are sending the header HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.3. I only serve webpages as utf8 with the correct header but browsers are posting data from forms encoded with the ISO-8859-1 charset. My question is, will a browser always prefer charsets in the order of its ACCEPT_CHARSET head... |
Is learning Django without initial knowledge of Python possible? | 8,841,829 | 2 | 4 | 7,541 | 0 | python,django | I would suggest it's possible, but definitely steepens the learning curve. When learning a new language, I usually enjoy using it to actually do something useful rather than just writing Hello World programs. Learning Django while learning Python at the same time might be a good way to do this.
I did learn Ruby at th... | 0 | 0 | 0 | 0 | 2012-01-12T20:19:00.000 | 5 | 0.07983 | false | 8,841,705 | 0 | 0 | 1 | 5 | I am coming from procedural PHP with fair amount of knowledge on it. I want to learn Django but I don't have initial knowledge of Python. Can I learn Django at the same time also learning Python? Thank you so much! |
Is learning Django without initial knowledge of Python possible? | 8,841,861 | 1 | 4 | 7,541 | 0 | python,django | Short answer: no.
Long answer: Learning a framework for a particular language is essentially taking the basic syntax with its nuances, and adding a new level of complexity to it. You're coming from a different language with a different semantic structure, so you would require time to both understand what Python's do... | 0 | 0 | 0 | 0 | 2012-01-12T20:19:00.000 | 5 | 0.039979 | false | 8,841,705 | 0 | 0 | 1 | 5 | I am coming from procedural PHP with fair amount of knowledge on it. I want to learn Django but I don't have initial knowledge of Python. Can I learn Django at the same time also learning Python? Thank you so much! |
Is learning Django without initial knowledge of Python possible? | 25,205,713 | 0 | 4 | 7,541 | 0 | python,django | Learning Python through Django is like learning PHP through wordpress. You will learn python, but Django is it's own beast. If you are experienced in another language or web programming then you will be fine jumping into Django. If this is your first language then you need to learn basic python first.
I also recommen... | 0 | 0 | 0 | 0 | 2012-01-12T20:19:00.000 | 5 | 0 | false | 8,841,705 | 0 | 0 | 1 | 5 | I am coming from procedural PHP with fair amount of knowledge on it. I want to learn Django but I don't have initial knowledge of Python. Can I learn Django at the same time also learning Python? Thank you so much! |
Is learning Django without initial knowledge of Python possible? | 8,842,267 | 6 | 4 | 7,541 | 0 | python,django | Yes! It's called 'immersion.' You learn Spanish by speaking Spanish. You learn Python by writing Python. Having a concrete project ("I'm going to make webapp that does xyz in Django") in mind gives you something to work on and towards. If you have the time and the determination to stick with it, and useful resources at... | 0 | 0 | 0 | 0 | 2012-01-12T20:19:00.000 | 5 | 1 | false | 8,841,705 | 0 | 0 | 1 | 5 | I am coming from procedural PHP with fair amount of knowledge on it. I want to learn Django but I don't have initial knowledge of Python. Can I learn Django at the same time also learning Python? Thank you so much! |
Is learning Django without initial knowledge of Python possible? | 8,841,721 | 11 | 4 | 7,541 | 0 | python,django | No. You'll be writing Python code. In Python. You'll have to learn Python.
A little bit of your project will be CSS, JavaScript and HTML with template tags inserted.
Most of your project will be Python. | 0 | 0 | 0 | 0 | 2012-01-12T20:19:00.000 | 5 | 1.2 | true | 8,841,705 | 0 | 0 | 1 | 5 | I am coming from procedural PHP with fair amount of knowledge on it. I want to learn Django but I don't have initial knowledge of Python. Can I learn Django at the same time also learning Python? Thank you so much! |
Google App Engine Go-Python/Java hybrid application | 8,847,345 | 5 | 1 | 469 | 0 | java,python,google-app-engine,go,hybrid | You can deploy several "versions" of the same application at once. Each version will be accessible using a fully qualified URL, and they can all be in different languages. | 0 | 1 | 0 | 0 | 2012-01-13T07:31:00.000 | 1 | 1.2 | true | 8,847,266 | 0 | 0 | 1 | 1 | Can one write a hybrid Go-Python/Java application and run it on Google App Engine as one application, or do they need to be split into two apps and communicate with each other through HTTP calls? Is there any tutorial or example on something like this being done? |
Python in Desktop Application Development | 8,848,472 | 4 | 15 | 14,031 | 0 | java,python,desktop-application | It is entirely possible to build a SWING GUI application with Python. Look for Jython, which is Python for the JVM. Any pure Python (no compiled C code) libraries for Python will work with Jython including most of the Python standard libraries.
Also, because Jython is a JVM language, it has access to objects provided b... | 0 | 0 | 0 | 0 | 2012-01-13T09:21:00.000 | 2 | 0.379949 | false | 8,848,285 | 0 | 0 | 1 | 1 | My company is revamping the IT infrastructure and systems, so we are at the middle of finalizing the technology for developing the new system.
We have come to two candidates; Java & Python.
The main criteria of the choice is the language must be complete; in a sense that it must be able to use for web & desktop applica... |
Django. Edit model form in popup in admin | 9,381,961 | 8 | 2 | 8,165 | 0 | python,django,django-admin | If you want to open a popup, simply create a link to your 'add' view with the following attribute on that link onclick='return showAddAnotherPopup(this);' | 0 | 0 | 0 | 0 | 2012-01-13T12:02:00.000 | 2 | 1.2 | true | 8,850,273 | 0 | 0 | 1 | 1 | Is there any ready apps for django admin, that allows to edit model in popup?
I want next functionallity:
View edit form for model in popup.
On model save - update row in list of models.
Motivation: reduce page reloads.
Also, if there any solutions oriented on massive manual data updates for django? I've taken a l... |
How can I use the mongolab add-on to Heroku from python? | 8,859,701 | 4 | 3 | 6,640 | 0 | python,mongodb,heroku,mlab | Get the connection string settings by running heroku config on the command line after installed the add-on to your heroku app.
There will be an entry with the key MONGOLAB_URI in this form:
MONGOLAB_URI => mongodb://user:pass@xxx.mongolab.com:27707/db
Simply the info from the uri in python by creating a connection from... | 0 | 0 | 0 | 1 | 2012-01-14T01:57:00.000 | 5 | 0.158649 | false | 8,859,532 | 0 | 0 | 1 | 1 | The documentation only talks about how to do it from ruby. |
Jinja nested rendering on variable content | 16,856,530 | 2 | 9 | 9,958 | 0 | python,jinja2 | I thought of an interesting way to do this:
Set up a dictionary
Wrap a DictLoader around it (but keep a reference to the dictionary around)
Pass a ChainLoader with the DictLoader and your normal Loader to the environment
Implement a custom filter that adds its parameters to the aforementioned dictionary
Use the includ... | 0 | 0 | 0 | 0 | 2012-01-14T14:13:00.000 | 7 | 0.057081 | false | 8,862,731 | 0 | 0 | 1 | 1 | Say I have actual jinja template code in a variable X. Let us say the content of X is "{{ some_other_variable }}".
How can I display X while also rendering its content?
e.g., this does not work:
{{ X }}
As it simply renders this to screen "{{ some_other_variable }}" rather than the contents of some_other_variable.
The ... |
Django - saving fields in invalid form submissions | 8,869,942 | 1 | 2 | 739 | 0 | python,django,django-forms | You will need to provide your own clean method to deal with the non-validating fields, and prevent cleaned_data being clobbered.
You will need to also provide your own save method which knows to only save the right fields. | 0 | 0 | 0 | 0 | 2012-01-15T13:21:00.000 | 1 | 1.2 | true | 8,869,918 | 0 | 0 | 1 | 1 | What is the recommended way of handling a "save"-style form submission (created from a ModelForm) when:
A non-empty subset of the form's fields validate
A non-empty subset of the form's fields do not validate
I want to save the subset of fields that are valid to the instance in question, and not the invalid ones.
I'm... |
Is there RequestHandler an equivalent of finalize() call for python? | 8,875,514 | 1 | 1 | 88 | 0 | python,google-app-engine | You could override __del__, but this is dangerous (can introduce GC loops and uncollectable objects), and doesn't gain you anything.
You don't gain anything because the App Engine runtime does not return the response to the user until the WSGI application has returned, which does not happen until all user code has fini... | 0 | 0 | 0 | 0 | 2012-01-16T00:18:00.000 | 1 | 1.2 | true | 8,874,580 | 0 | 0 | 1 | 1 | webapp.RequestHandler based Handlers can override initialize () to carry out setup. Is there a similar finalize() ? Could I override del() to achieve this ?
Basically, I am looking to making some journal entries after the post/get functions have completed such that this is not in the critical path of the Response back ... |
Django RSS-feed escaping € | 8,880,484 | 5 | 2 | 196 | 0 | python,django,rss,escaping | € is a perfectly valid utf-8 character. You are almost certainly creating utf-8 output, therefore it doesn't need escaping. | 0 | 0 | 0 | 0 | 2012-01-16T12:37:00.000 | 1 | 1.2 | true | 8,880,138 | 0 | 0 | 1 | 1 | I've made a rss-feed in django and i wish to turn € into €. I already use |escape to escape link tags and such. But somehow |escape doesn't work on €.
Does anybody now a way to also escape € ? |
PyCharm: Forcing Django Template Syntax Highligting | 8,880,818 | 56 | 32 | 8,350 | 0 | python,django,pycharm | File » Settings » Template language, do you have Template language setting set to django? | 0 | 0 | 0 | 0 | 2012-01-16T13:26:00.000 | 1 | 1.2 | true | 8,880,652 | 0 | 0 | 1 | 1 | I've just installed PyCharm, and have opened an existing project with multiple apps.
When I open django templates, they are highlighted as if plain HTML, i.e. {% block %} elements and {{variable}} references are not treated specially.
Is there any way I can force it to use the django template syntax highlighter for t... |
Choosing Python/SQLObject webframework | 8,896,107 | 0 | 0 | 375 | 1 | python,sqlobject | Try the pyramid, it does not impose anything you like as opposed to Django. And has a wealth of features for building Web applications at any level. | 0 | 0 | 0 | 0 | 2012-01-17T14:05:00.000 | 2 | 0 | false | 8,895,942 | 0 | 0 | 1 | 1 | I have a regular desktop application which is written in Python/GTK and SQLObject as ORM. My goal is to create a webinterface where a user can login and sync/edit the database. My application is split up in different modules, so the database and gtk code are completly separate, so I would like to run the same database ... |
Simple and effective solution for combining Java, Python, PyTables and HDF5 | 8,904,389 | 3 | 2 | 1,638 | 0 | java,python,jython,hdf5,pytables | For me is not cool writing scripts from Java using java.io.*.
Same here -- you have already parsed the data from the XML into some internal representation in Java, and then you re-write this data into a Python script, and then the Python interpreter will re-parse the data into an internal representation for writing to... | 0 | 0 | 0 | 0 | 2012-01-18T02:12:00.000 | 2 | 0.291313 | false | 8,904,318 | 0 | 0 | 1 | 1 | I'm a newbie in Python, PyTables and HDF5. I'm looking for simple and best solution for my problem.
Problem is next. On one side I have many XML files with data. I just wanna parse these files and put data in hdf5 file on other side. Later, I will use this data trough some search criteria.Why HDF5? Because need to put... |
Rendering a page after jQuery POST | 8,906,825 | 5 | 0 | 376 | 0 | javascript,jquery,python,web.py | Don't use Ajax to do this. If posting data to the server should result in a new page being displayed, just use the traditional model. You gain nothing by using Ajax in this case. | 0 | 0 | 0 | 0 | 2012-01-18T07:44:00.000 | 2 | 1.2 | true | 8,906,766 | 0 | 0 | 1 | 2 | I have a problem with web.py. Basically the user clicks a button, which makes a POST request to the server. The POST request returns "render.edit()", which is short hand for rendering the "edit" template. However, since I'm making the POST request via jQuery, the HTML of the page is simply in the callback function and ... |
Rendering a page after jQuery POST | 8,924,998 | 0 | 0 | 376 | 0 | javascript,jquery,python,web.py | you can also try raise web.seeother('URL') inside the POST of python script, but in this case it will also run all GET instructions of the class. | 0 | 0 | 0 | 0 | 2012-01-18T07:44:00.000 | 2 | 0 | false | 8,906,766 | 0 | 0 | 1 | 2 | I have a problem with web.py. Basically the user clicks a button, which makes a POST request to the server. The POST request returns "render.edit()", which is short hand for rendering the "edit" template. However, since I'm making the POST request via jQuery, the HTML of the page is simply in the callback function and ... |
How I can request a local url in my app engine application? | 8,915,133 | 2 | 1 | 165 | 0 | python,json,google-app-engine,url,blob | This wouldn't on the development server (but will work on the production server) because its single threaded and you can't do a request to yourself from within a request.
There are several workarounds for your issue:
Use the file write API to store the data.
Use the multithread dev_server (required to switch to pyth... | 0 | 1 | 0 | 0 | 2012-01-18T18:04:00.000 | 2 | 0.197375 | false | 8,915,042 | 0 | 0 | 1 | 1 | I am using Blobs to store json files for my application. What I am trying to achieve is to request an internal url of my application in order to get the relevant file. I have tried urllib, urllib2, urlfetch but every time I am getting a 5 second DeadlineExceededError: 5 timed out error. Is there a way to retrieve my bl... |
Reportlab can't find _imaging module using production server | 8,930,498 | 2 | 0 | 847 | 0 | python,django,python-imaging-library,reportlab | PIL should be installed before library which uses it. I got similar problem with libimaging - PIL wasn't installed before libimaging so libimaging was compiled without it. Solution was uninstall libimaging and install it again with PIL already present in system. | 0 | 0 | 0 | 0 | 2012-01-19T16:32:00.000 | 2 | 0.197375 | false | 8,929,695 | 0 | 0 | 1 | 1 | I'm trying to push a django app to the production server, but for some reason it fails and says:
ImportError: The _imaging C module is not installed
The weird part is that when I use the development server on the same machine, it works just fine. PIL is installed, and I can import the _imaging module by hand in the ... |
Trigger Javascript event on remote website with Python | 8,943,959 | 2 | 3 | 2,574 | 0 | javascript,python,dom,web-scraping | Figure out the AJAX request URL and request it directly. :-) | 0 | 0 | 1 | 0 | 2012-01-20T05:38:00.000 | 1 | 1.2 | true | 8,937,190 | 0 | 0 | 1 | 1 | I wrote some basic Python code to scrape a remote webpage and grab a few pieces of data. On a different page I'm trying to scrape, the data is hidden from view, and only appears after changing the value of a <select> box.
After de-minifying and digging through the remote website's javascript, I confirmed that it is us... |
python appengine memcache optimization | 8,980,637 | 1 | 0 | 259 | 0 | python,google-app-engine,memcached,djangoappengine | Cache everything that might be frequent, and let Memcache's LRU policy evict items that aren't accessed frequently enough to warrant remaining in the cache. | 0 | 1 | 0 | 0 | 2012-01-20T12:05:00.000 | 2 | 0.099668 | false | 8,941,192 | 0 | 0 | 1 | 1 | I am developing an api on google appengine django nonrel that will serve a lot of requests. I would like to cache repeated requests.
It is estimated that there will be some really frequent queries to the api, and I would like to be able to find out what these queries are on the fly so that I may pre-cache them. Is ther... |
Django post initialization modules | 8,957,923 | 2 | 0 | 74 | 0 | python,django | Probably, the best place for this is the end of the settings.py ;-) | 0 | 0 | 0 | 0 | 2012-01-21T23:42:00.000 | 1 | 0.379949 | false | 8,957,711 | 0 | 0 | 1 | 1 | Is there a way that I can call some functions/modules right after all the settings in Django have been imported? |
How do I learn Python 2 if I already know Python 3? | 8,965,225 | 5 | 7 | 501 | 0 | python,django,python-3.x,python-2.x | If you already are familiar with Python 3, then there are almost no differences you will have to worry about when coding in Python 2. The most user-visible differences have to do with details of the print statement, which you probably won't be using for Django anyway.
So, just write code, and ask about any specific pro... | 0 | 0 | 0 | 0 | 2012-01-22T22:01:00.000 | 5 | 0.197375 | false | 8,965,120 | 1 | 0 | 1 | 1 | I have some knowledge of Python 3 (I'm not a beginner, but I'm not an expert). I'm interested in web development, so I want to use Django. What are the differences between the two versions of Python? How should I switch from 3 to 2.x? |
Using Regex to Search for HTML links near keywords | 8,966,597 | 0 | 4 | 366 | 0 | python,regex,negative-lookahead | I don't think you can do this one with regex alone (especially looking before the keyword match) as it has no sense of comparing distances.
I think you're best off doing something like this:
find all occurences of sales & get substring index, called salesIndex
find all occurences of https?://[-A-Za-z0-9./]+ and get t... | 0 | 0 | 1 | 0 | 2012-01-23T01:05:00.000 | 4 | 0 | false | 8,966,244 | 0 | 0 | 1 | 1 | If I'm looking for the keyword "sales" and I want to get the nearest "http://www.somewebsite.com" even if there is multiple links in the file. I want the nearest link not the first link. This means I need to search for the link that comes just before the keyword match.
This doesn't work...
regex = (http|https)://[-A... |
How do you restrict large file uploads in wsgi? | 8,975,702 | 3 | 5 | 1,729 | 0 | python,http,wsgi,webob | It would depend on your front-end server. If it has any configuration to block big request even before it goes into your app, use it.
If you want to block this with your code I see two approaches:
Look ate the Content-Length HTTP Header. If it's bigger than you can handle, deny the request right away.
Don't trust the ... | 0 | 0 | 0 | 0 | 2012-01-23T11:12:00.000 | 2 | 1.2 | true | 8,970,713 | 0 | 0 | 1 | 1 | I'm trying to get an understanding of the best way of handling file uploads safely in a wsgi app. It seems a lot of solutions involve using FieldStorage from the cgi module to parse form data. From what I understand about FieldStorage it performs a bit of 'magic' behind the scenes by streaming data into a tempfile.
Wha... |
url-enabled access to ressources with pyramid | 8,973,728 | 2 | 0 | 88 | 0 | python,session,authorization,pyramid | If you've figured out how to do this for authenticated users, it should be obvious how to do it for anonymous users as well. They will have the pyramid.security.Everyone principal, which you can use in your ACLs to assign various permissions.
Route factories will allow you to assign custom ACLs to individual routes. Th... | 0 | 0 | 0 | 1 | 2012-01-23T11:47:00.000 | 1 | 1.2 | true | 8,971,115 | 0 | 0 | 1 | 1 | I'm setting up a pyramid application where access to ressources can be shared across registered users.
I would also like to give access to non-members, using non-trivial links to files or directories.
While I see how to do this for registered members, I'm not sure how to do this with anonymous users. Do I need to crea... |
App Engine Blobstore download all blobs at once | 8,981,549 | 5 | 2 | 578 | 0 | python,google-app-engine,blobstore | No, there's no way to do this. The blobstore can be aribrarily large, far larger than is practical to download in a single file. | 0 | 1 | 0 | 0 | 2012-01-24T01:42:00.000 | 4 | 0.244919 | false | 8,981,103 | 0 | 0 | 1 | 3 | I would like to download all blobs as a single zipped file (or another way) to my computer. Anyway to do that? I use the python SDK. |
App Engine Blobstore download all blobs at once | 8,993,546 | 1 | 2 | 578 | 0 | python,google-app-engine,blobstore | It's probably better to download them one at a time anyway. That way if your job dies part way through you can restart for where it failed rather than starting over again from scratch. | 0 | 1 | 0 | 0 | 2012-01-24T01:42:00.000 | 4 | 0.049958 | false | 8,981,103 | 0 | 0 | 1 | 3 | I would like to download all blobs as a single zipped file (or another way) to my computer. Anyway to do that? I use the python SDK. |
App Engine Blobstore download all blobs at once | 9,376,684 | -1 | 2 | 578 | 0 | python,google-app-engine,blobstore | How about copy the blobs to google storage and then use gsutil to download the blobs from there? | 0 | 1 | 0 | 0 | 2012-01-24T01:42:00.000 | 4 | -0.049958 | false | 8,981,103 | 0 | 0 | 1 | 3 | I would like to download all blobs as a single zipped file (or another way) to my computer. Anyway to do that? I use the python SDK. |
Parser for command line parameters in Java/C/C++/Python/shell | 8,993,917 | 1 | 4 | 393 | 0 | java,python,c,parsing,command-line | getopt is also usable in Python and shell. Python has the argparse module, which is much easier to use (particularly for more complex argument parsing), but if you want consistency across all those languages, I don't know of any better option than getopt. If Java doesn't have a getopt implementation, you could possibl... | 0 | 1 | 0 | 1 | 2012-01-24T18:31:00.000 | 1 | 1.2 | true | 8,992,077 | 0 | 0 | 1 | 1 | I am looking for a library to parse command-line parameters that would work identically in Java, C/C++, Python and (preferably) shell. By "identical" I mean (1) have exactly the same rules for parsing of the parameters in all three languages, (2) use the same configuration files or have similar API to specify the para... |
General : always saving settings on close vs saving only when changed | 9,001,676 | 1 | 1 | 84 | 0 | python,coding-style | I don't think this is even python related. In general you'll have something like this:
Load settings from file
Use and maybe modify settings in memory.
Write settings to file.
Detecting a settings modification would either introduce a change in 2 (keep a "changed" state) or in 3 (diff with the current persisted setti... | 0 | 0 | 0 | 0 | 2012-01-25T10:49:00.000 | 2 | 0.099668 | false | 9,001,434 | 1 | 0 | 1 | 1 | I am kind of beta testing a small python app - whenever the app is closed the settings are saved, even when I made no changes. I was wondering if this is general practice - sounds like settings should be saved only when a change is made but are there reasons (apart from the reduced complexity) pro saving settings alway... |
What's a good strategy for generating unique hash keys for a very large collection of images in Python? | 9,008,635 | -1 | 1 | 2,116 | 0 | python,hash,unique,key | MD5 of datetime.now() (at a time of file upload) will be OK, imho. | 0 | 0 | 0 | 0 | 2012-01-25T18:55:00.000 | 3 | -0.066568 | false | 9,008,502 | 0 | 0 | 1 | 1 | I have a listing of millions of files and am uploading them to Amazon's S3. I need to create unique keys for each of the images. I'd rather not use md5 because it requires scanning the entire file, which can be slow. Additionally, there could be duplicate images, which is allowed in our application. Any suggestion for ... |
Django project loads in site-packages | 9,020,680 | 0 | 0 | 290 | 0 | python,django,django-templates,setup.py | Either you chose a name for your project that conflicts with an existing python package and it's merely coincidental, or you somehow managed to build your project as an egg. I'm not sure how you would do that and not realize you had done that, though.
Regardless, check the package to make sure that it is in fact your c... | 0 | 0 | 0 | 0 | 2012-01-26T15:34:00.000 | 1 | 0 | false | 9,020,589 | 0 | 0 | 1 | 1 | After I run setup.py to install a project, the project admin works fine but here's the problem.
Except of the project running from my c:\project.
It's runs from another location at C:\Python27\Lib\site-packages\project-0.1-py2.7.egg\project
Why does it clone my project to the site-packages location?
And why does it run... |
How to create columns in a csv file and insert row under them in python scrapy | 9,144,538 | 0 | 0 | 506 | 0 | python,scrapy | 1)you can use custom Csv feed exporter each item key will be treated as a column heading and value as column value.
2) you can write a pipeline that can write data in csv file using python csv lib. | 0 | 0 | 0 | 0 | 2012-01-27T09:01:00.000 | 2 | 0 | false | 9,030,953 | 0 | 1 | 1 | 2 | Please help me in creating columns and inserting rows under them in a csv file using python scrapy. I need to write scraped data into 3 columns. So first of all three columns are to be created and then data is to be entered in each row. |
How to create columns in a csv file and insert row under them in python scrapy | 9,032,800 | 1 | 0 | 506 | 0 | python,scrapy | CSV is a Comma Saparated Values format. That basically means that it is a text file with some strings separated by commas and line-downs.
Each line down creates a row and each comma creates a column in that row.
I guess the simplest way to create a CSV file would be to create a Pythonic dict where each key is a column ... | 0 | 0 | 0 | 0 | 2012-01-27T09:01:00.000 | 2 | 0.099668 | false | 9,030,953 | 0 | 1 | 1 | 2 | Please help me in creating columns and inserting rows under them in a csv file using python scrapy. I need to write scraped data into 3 columns. So first of all three columns are to be created and then data is to be entered in each row. |
How to import a java class i created in jython and call a method | 9,047,483 | 3 | 2 | 5,286 | 0 | java,python,jython | Jython supports loading Java classes as if they were Python modules. It searches the directories in sys.path for .class files.
First, make sure your Java class has already been compiled with javac.
Then, do a sys.path.append(d), where d is the directory containing the package. So if your class says package foo.bar; at ... | 0 | 0 | 0 | 0 | 2012-01-27T18:52:00.000 | 2 | 1.2 | true | 9,038,505 | 1 | 0 | 1 | 1 | I have made a java class that calls other java classes and then prints to a screen. i am trying to build a python interface that calls my java class, runs the one method within it, and terminates. i cannot get access to my method. i have used the line "import directory.directory2.myClass.java (and .jar and .class) i ma... |
Python database widgets/environment like MSAccess | 15,711,432 | 1 | 3 | 684 | 1 | python,database,widget,rad | I am also looking for something similar to Kexi. Unfortunately python scripting is not supported in Kexi for windows. I would like to find something better than MS Access, and it does not have to be based on python. So far I have looked at quite a few IDE's but have not found anything where a GUI and database applicati... | 1 | 0 | 0 | 0 | 2012-01-28T13:49:00.000 | 2 | 0.099668 | false | 9,045,723 | 0 | 0 | 1 | 1 | First of all, I am sorry if this question doesn't belong to SO since I don't know where else to post it, anyway...
I am looking for a decent python based database development RAD framework with nice data aware widgets and grids. A desktop framework would be much preferable to a web framework (I've developed heavy DB-ce... |
Task Queues or Multi Threading on google app engine | 9,047,335 | 1 | 1 | 980 | 0 | python,multithreading,google-app-engine,web2py,task-queue | maybe i'm misunderstanding something, but thos sounds like the perfect match for a task queue, and i can't see how multithreading will help, as i thought this only ment that you can serve many responses simultaneously, it won't help if your responses take longer than the 30 second limit.
With a task you can add it, the... | 0 | 1 | 0 | 0 | 2012-01-28T17:25:00.000 | 3 | 0.066568 | false | 9,047,267 | 0 | 0 | 1 | 2 | I have my server on Google App Engine
One of my jobs is to match a huge set of records with another.
This takes very long, if i have to match 10000 records with 100.
Whats the best way of implementing this.
Im, using Web2py stack and deployed my application on Google App Engine. |
Task Queues or Multi Threading on google app engine | 9,047,823 | 1 | 1 | 980 | 0 | python,multithreading,google-app-engine,web2py,task-queue | Multithreading your code is not supported on GAE so you can not explicitly use it.
GAE itself can be multithreaded, which means that one frontend instance can handle multiple http requests simultaneously.
In your case, best way to achieve parallel task execution is Task Queue. | 0 | 1 | 0 | 0 | 2012-01-28T17:25:00.000 | 3 | 0.066568 | false | 9,047,267 | 0 | 0 | 1 | 2 | I have my server on Google App Engine
One of my jobs is to match a huge set of records with another.
This takes very long, if i have to match 10000 records with 100.
Whats the best way of implementing this.
Im, using Web2py stack and deployed my application on Google App Engine. |
Django RawQuerySet.__repr__ : not enough arguments for format string | 9,047,552 | 2 | 1 | 1,159 | 0 | python,django,string-formatting,django-queryset | I eventually found the explanation. I'm not sure this will be of much help to others, but anyways.
The problem came from the fact that params in the call was a list. It appears you can use a list to instantiate a RawQuerySet, but it is not converted into a tuple so you can't use it for string-formatting later on.
Concl... | 0 | 0 | 0 | 0 | 2012-01-28T17:37:00.000 | 1 | 1.2 | true | 9,047,378 | 0 | 0 | 1 | 1 | I'm using a RawQuerySet in Django, and I need to pass it a few parameters (5).
I'm able to call the constructor using MyModel.objects.raw(SQL, params). The SQL is pretty long and not that relevant, but params is [991L, 991L, 991L, 7L, 3].
I do get a RawQuerySet in return. Hence, the call is OK.
However, my problem is ... |
Django Overriding Model Clean() vs Save() | 9,048,338 | 49 | 40 | 10,208 | 0 | python,django,django-models,django-admin | You should use clean to do validation-related work, and to parse/change/otherwise clean the input. Capitalizing fields and generating a slug can happen here. I also use clean to force a field like post_type to a specific value in proxy models. If you raise django.core.exceptions.ValidationError('error text') inside ... | 0 | 0 | 0 | 0 | 2012-01-28T19:57:00.000 | 1 | 1.2 | true | 9,048,108 | 0 | 0 | 1 | 1 | I have a couple of actions to perform when saving a models, especially from the admin. I capitalize a couple of fields and check to make sure that either one field or the other is filled. I also create the field slug. RIght now these are split between overriding the clean and the save functions. It works now, but I am ... |
{% url %} not work in Django | 9,054,738 | 0 | 1 | 417 | 0 | python,django,google-app-engine,internationalization,django-templates | There is an earlier error that you did not yet fix:
Error Importing data store piston.gae_store OAuth: "No module named piston.gae_store"
This does not seem to be related to the lines that you change. It will probably even occur when your remove the {% url ...%} completely, right? Try to fix the existing error first. | 0 | 0 | 0 | 0 | 2012-01-28T20:52:00.000 | 2 | 0 | false | 9,048,513 | 0 | 0 | 1 | 1 | I have a problem using the tag {% url%} in Django on GAE, I found the problem applying internationalization in JavaScript files, writing:
{% url django.views.i18n.javascript_catalog %}
Django throws the error:
TemplateSyntaxError at / view / test /
Caught ImproperlyConfigured while rendering: Error Importing data
st... |
Documents requests and memory issue using MongoDB | 9,056,220 | 1 | 0 | 66 | 0 | python,performance,memory,mongodb | If you are going to display all of the data on the web interface anyways, start simple: Get a the whole document. It reduces your latency by requiring less round trips to the database. | 0 | 0 | 0 | 0 | 2012-01-29T18:33:00.000 | 2 | 1.2 | true | 9,055,624 | 1 | 0 | 1 | 2 | I have documents in Mongo that contain questionnaire-like data (company's name, address, phone numbers, etc.). I should have this data displayed in web interface.
How to make it better: get the whole document as dict into a variable and fill webform from its data or make lots of database requests to fill each field of... |
Documents requests and memory issue using MongoDB | 9,057,896 | 1 | 0 | 66 | 0 | python,performance,memory,mongodb | Agree with GPS - if you need all, or most, of the data then it should be a better option to retrieve the document in one request as opposed to hitting the database x number of times. | 0 | 0 | 0 | 0 | 2012-01-29T18:33:00.000 | 2 | 0.099668 | false | 9,055,624 | 1 | 0 | 1 | 2 | I have documents in Mongo that contain questionnaire-like data (company's name, address, phone numbers, etc.). I should have this data displayed in web interface.
How to make it better: get the whole document as dict into a variable and fill webform from its data or make lots of database requests to fill each field of... |
Ensure a page has downloaded correctly in Python | 9,081,637 | 0 | 0 | 109 | 0 | python,beautifulsoup,mechanize | The most generic solution is to check that the </html> closing tag exists. That will allow you to detect truncation of the page.
Anything else, and you will have to describe your failure mode more clearly. | 0 | 0 | 1 | 0 | 2012-01-31T13:52:00.000 | 3 | 0 | false | 9,080,634 | 0 | 0 | 1 | 2 | I am writing a basic screen scraping script using Mechanize and BeautifulSoup (BS) in Python. However, the problem I am running into is that for some reason the requested page does not download correctly every time. I am concluding this because when searching the downloaded pages using BS for present tags, I get an err... |
Ensure a page has downloaded correctly in Python | 9,081,631 | 0 | 0 | 109 | 0 | python,beautifulsoup,mechanize | I think you may simple search for html ending tag if this tag is in - this is a valid page. | 0 | 0 | 1 | 0 | 2012-01-31T13:52:00.000 | 3 | 0 | false | 9,080,634 | 0 | 0 | 1 | 2 | I am writing a basic screen scraping script using Mechanize and BeautifulSoup (BS) in Python. However, the problem I am running into is that for some reason the requested page does not download correctly every time. I am concluding this because when searching the downloaded pages using BS for present tags, I get an err... |
Is Django for the frontend or backend? | 9,081,163 | 5 | 62 | 151,975 | 0 | python,django,architecture | (a) Django is a framework, not a language
(b) I'm not sure what you're missing - there is no reason why you can't have business logic in a web application. In Django, you would normally expect presentation logic to be separated from business logic. Just because it is hosted in the same application server, it doesn't fo... | 0 | 0 | 0 | 0 | 2012-01-31T14:23:00.000 | 3 | 0.321513 | false | 9,081,123 | 0 | 0 | 1 | 3 | I often see people claiming their backend is implemented in Django, but isn't Django supposed to be for the frontend? I'd assume the backend refers to the business logic where the frontend refers to the presentation. Am I missing something? |
Is Django for the frontend or backend? | 9,081,179 | 107 | 62 | 151,975 | 0 | python,django,architecture | Neither.
Django is a framework, not a language. Python is the language in which Django is written.
Django is a collection of Python libs allowing you to quickly and efficiently create a quality Web application, and is suitable for both frontend and backend.
However, Django is pretty famous for its "Django admin", an au... | 0 | 0 | 0 | 0 | 2012-01-31T14:23:00.000 | 3 | 1.2 | true | 9,081,123 | 0 | 0 | 1 | 3 | I often see people claiming their backend is implemented in Django, but isn't Django supposed to be for the frontend? I'd assume the backend refers to the business logic where the frontend refers to the presentation. Am I missing something? |
Is Django for the frontend or backend? | 9,082,219 | 13 | 62 | 151,975 | 0 | python,django,architecture | It seems you're actually talking about an MVC (Model-View-Controller) pattern, where logic is separated into various "tiers". Django, as a framework, follows MVC (loosely). You have models that contain your business logic and relate directly to tables in your database, views which in effect act like the controller, han... | 0 | 0 | 0 | 0 | 2012-01-31T14:23:00.000 | 3 | 1 | false | 9,081,123 | 0 | 0 | 1 | 3 | I often see people claiming their backend is implemented in Django, but isn't Django supposed to be for the frontend? I'd assume the backend refers to the business logic where the frontend refers to the presentation. Am I missing something? |
Design issue: client side or server side? | 9,095,840 | 1 | 1 | 215 | 0 | javascript,python,ruby | String manipulation is pretty fast in the server side but it's fine to do on the client side too. However make sure to validate the string once it arrives at the server side because any client can replicate requests to your server with a string and try to cause trouble. | 0 | 0 | 1 | 0 | 2012-02-01T12:24:00.000 | 4 | 0.049958 | false | 9,095,758 | 0 | 0 | 1 | 4 | Whenever there is dilemma to do a particular task, which can be accomplished either by client side code or by using a server code, which should be preferred?
For example:
I can iterate through a javascript object and construct a string and then send it to server, or should i send the javascript object and process it in... |
Design issue: client side or server side? | 9,095,857 | 0 | 1 | 215 | 0 | javascript,python,ruby | You must take into consideration a lot of factors, including and especially security ones. For example, if you must do some complicated form validation, then it is extremely important to do it server-side, even if that puts a little more load on the server.
Always keep in mind that a bad guy can change/break your javas... | 0 | 0 | 1 | 0 | 2012-02-01T12:24:00.000 | 4 | 0 | false | 9,095,758 | 0 | 0 | 1 | 4 | Whenever there is dilemma to do a particular task, which can be accomplished either by client side code or by using a server code, which should be preferred?
For example:
I can iterate through a javascript object and construct a string and then send it to server, or should i send the javascript object and process it in... |
Design issue: client side or server side? | 9,096,236 | 1 | 1 | 215 | 0 | javascript,python,ruby | (This answer assumes a web programming context)
I personally put a lot of front-end logic in Javascript running on the client side, because it makes things very responsive, even for people with a slow connection. This also means that some functionality continues working even if the user goes offline. I find some progra... | 0 | 0 | 1 | 0 | 2012-02-01T12:24:00.000 | 4 | 1.2 | true | 9,095,758 | 0 | 0 | 1 | 4 | Whenever there is dilemma to do a particular task, which can be accomplished either by client side code or by using a server code, which should be preferred?
For example:
I can iterate through a javascript object and construct a string and then send it to server, or should i send the javascript object and process it in... |
Design issue: client side or server side? | 9,095,862 | 0 | 1 | 215 | 0 | javascript,python,ruby | I am a django/python developer and my logic is "templates should be used for rendering". I keep my load minimum on the client side and all computation is done on the server side.
Another reason for doing this is because a user cannot be trusted. Keep the equation simple for the user. | 0 | 0 | 1 | 0 | 2012-02-01T12:24:00.000 | 4 | 0 | false | 9,095,758 | 0 | 0 | 1 | 4 | Whenever there is dilemma to do a particular task, which can be accomplished either by client side code or by using a server code, which should be preferred?
For example:
I can iterate through a javascript object and construct a string and then send it to server, or should i send the javascript object and process it in... |
Python should I use threading | 9,297,208 | 0 | 4 | 269 | 0 | python | I have decided to adopt a process rather than a threaded approach to resolving this issue. The primary factor in this decision is simplicity. The second factor is whilst one of these applications will be carrying out data acquisition the other will be communicating with a modem on an ad-hoc basis (receiving calls) I do... | 0 | 0 | 0 | 0 | 2012-02-01T14:52:00.000 | 4 | 0 | false | 9,097,911 | 1 | 0 | 1 | 3 | I currently have a couple of small applications < 500 lines. I am intending to eventually run them on a small LINUX ARM box. Is it better to combine these applications and use threading, or continue to have them as two separate applications?
These applications plus a very small website use a small sqlite database, thou... |
Python should I use threading | 9,098,387 | 2 | 4 | 269 | 0 | python | For performance purpose, I will suggest you to use threads, process consumes much more resources than threads, it will be faster to create and need less memory (usefull in embedded environment), but of course, you'll have to deal with the common traps of multithreading programmation (concurent access solved by locks, b... | 0 | 0 | 0 | 0 | 2012-02-01T14:52:00.000 | 4 | 0.099668 | false | 9,097,911 | 1 | 0 | 1 | 3 | I currently have a couple of small applications < 500 lines. I am intending to eventually run them on a small LINUX ARM box. Is it better to combine these applications and use threading, or continue to have them as two separate applications?
These applications plus a very small website use a small sqlite database, thou... |
Python should I use threading | 9,097,976 | 4 | 4 | 269 | 0 | python | Depends on whether you need them to share data and how involved the sharing is. Other than that, from a speed point of view, for a multiprocessing machine, threading won't give you much of an advantage over separate processes.
If sharing can easily take place via a flat file or database then just let them be separate r... | 0 | 0 | 0 | 0 | 2012-02-01T14:52:00.000 | 4 | 0.197375 | false | 9,097,911 | 1 | 0 | 1 | 3 | I currently have a couple of small applications < 500 lines. I am intending to eventually run them on a small LINUX ARM box. Is it better to combine these applications and use threading, or continue to have them as two separate applications?
These applications plus a very small website use a small sqlite database, thou... |
converting NavigableString to unicode string | 41,417,621 | 0 | 2 | 7,115 | 0 | python,string,unicode,beautifulsoup | There should not be any problem just using python's str() method on the navigable string object you have. From my experience with NavigableString's they are already in unicode so if you want a string on which .lower will work then you need to cast it to a python string (UTF-8) then recast it back to unicode. | 0 | 0 | 0 | 0 | 2012-02-01T16:34:00.000 | 2 | 0 | false | 9,099,523 | 1 | 0 | 1 | 1 | When I run the following code:
if substr in movie.lowercase:
I get the following error
AttributeError: 'NavigableString' object has no attribute 'lowercase'
movie is from here:
movie = row.td.div.h4.string
I tried to change it to (without success)
movie = row.td.div.h4.string.string
or
movie = unicode(row.td.div.h4.str... |
What are the limitations of Django's ORM? | 9,112,738 | 0 | 20 | 8,580 | 0 | python,django,orm | One of the biggest problem that come to mind is that Building inheritance into Django ORM's is difficult. Essentially this is due to the fact that (Django) ORM layers are trying to bridge the gap by being both relational & OO. Another thing is of course multiple field foreign keys.
One charge leveled at Django ORM is t... | 0 | 0 | 0 | 0 | 2012-02-02T12:47:00.000 | 6 | 0 | false | 9,112,571 | 0 | 0 | 1 | 1 | I've heard developers not wanting to use ORM, but don't know why. What are the shortcomings of the ORM? |
How do I install in-house requirements for Python Heroku projects? | 9,112,921 | 0 | 9 | 1,227 | 0 | python,heroku,pip | You can write, say, "-e git+ssh://git@.../PIL#egg=PIL" instead of "PIL" in your requirements.txt file and it'll fetch it from there.
However, this would require you to somehow specify the ssh private key to be used by heroku when pulling. | 0 | 0 | 0 | 0 | 2012-02-02T13:02:00.000 | 4 | 0 | false | 9,112,784 | 1 | 0 | 1 | 1 | We have a few in-house libraries that we've split off (for several reasons, mostly administrative or to have the possibility to easily open source them later). They live in private Github repositories, if that matters.
I'd like to deploy an app to Heroku to try it out. It depends on one of those libraries.
I'm supposed... |
Django url template confusion | 9,117,883 | 2 | 0 | 163 | 0 | python,django,django-urls | Use the application name in the url tag, e.g. {% url myapp.views.contest_overview %} | 0 | 0 | 0 | 0 | 2012-02-02T18:11:00.000 | 2 | 0.197375 | false | 9,117,590 | 0 | 0 | 1 | 1 | Okay I am having a bit of an issue.
I want to create a button with a link, and right now I am using action={% url views.contest_overview %} in hopes that the reverse lookup by Django will match (r'^category/$', views.contest_overview), in my urls.py. However, this is not working and I can't figure out the proper no... |
How to upload/publish products to Amazon via Amazon MWS API? | 9,312,763 | 2 | 6 | 2,077 | 0 | python,amazon-mws | The general gist of it is you use SubmitFeed to send your product list. Then you must check the status of the submission. Once the submission is complete you can then get the results. You have to repeat these steps for images, pricing and availability.
It's a bit of a pain to get started with it, Amazon supply a LOT of... | 0 | 0 | 1 | 0 | 2012-02-03T04:40:00.000 | 1 | 0.379949 | false | 9,123,764 | 0 | 0 | 1 | 1 | I heard SubmitFeed API is for adding products. But i didn't find any example.
By the way, i need a Python solution.
Thanks a lot. |
Caching the entire response (HTML, js, json, ecc) only for non-logged in users | 9,134,197 | 1 | 1 | 184 | 0 | python,django | Have you tried CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True? Assuming whatever caching you're using utilizes Django's cache framework, that should do the trick. | 0 | 0 | 0 | 0 | 2012-02-03T18:33:00.000 | 1 | 0.197375 | false | 9,133,704 | 0 | 0 | 1 | 1 | I love django-staticgenerator. Unfortunately you can't use it in cases in which you have to display different content depending on the user, plus is not being actively developed.
Is it possible to return the cached response only to non-logged in users?
I saw an app that used nginx to do it, is it possible to do it with... |
Background job/task monitor for Django | 9,178,073 | 1 | 4 | 719 | 0 | python,django | I used django-chronograph for managing my scheduled jobs and django-peavy for logging. That provided everything I needed. | 0 | 0 | 0 | 0 | 2012-02-04T11:13:00.000 | 3 | 1.2 | true | 9,140,441 | 0 | 0 | 1 | 1 | I have a few management commands for my Django poject that is run automatically by cron. Are there any django packages that allow me to monitor the status of my background jobs?
Currently I have to trudge through my log files to find out if everything went okay or not and I'm confident that writing a simple job/task mo... |
Serialization with JDBC with MySQL, JAVA REST and Python REST | 9,158,709 | 1 | 0 | 253 | 1 | java,python,mysql,rest,jdbc | Of course they need to be thread safe. You should be writing your Java server as if it were single threaded, because a Java EE app server will assign a thread per incoming request.
You also need to think about database isolation and table locking. Will you allow "dirty reads" or should your transactions be serializab... | 0 | 0 | 0 | 0 | 2012-02-06T10:16:00.000 | 1 | 1.2 | true | 9,158,578 | 0 | 0 | 1 | 1 | I have a project in which i use JDBC with MySQL to store some user information, Java REST for the server and Python REST for the client.
My question is: by default(i haven't changed anything in the configurations), are the http requests from the client serialized on the server's side? I ask this because i'd like to kno... |
Only allow a subset of users to access a google app project | 9,171,764 | 1 | 0 | 122 | 0 | python,google-app-engine | Wouldn't it be easier to write a user model rather than access it with the Google accounts API? That way you could define user groups and access without having to rely on Google.
The Google Accounts API in the example is really for low-level init debugging. | 0 | 1 | 0 | 0 | 2012-02-07T04:38:00.000 | 1 | 1.2 | true | 9,171,080 | 0 | 0 | 1 | 1 | We are trying to develop a project in google app engine for a senior project, and its set up in such a way that only a subset of user at our college should be able to login to it. Our college uses google domains for email, so that is currently out login requirement (a college email though google that is), but how can ... |
Realtime data server architecture | 9,189,761 | 0 | 2 | 319 | 1 | python,real-time | I would say, run the two on the same machien to start with, and see how the performance goes. Why spend money on a second machine if you don’t have to?
As for “dealing with the ever growing amount of data”—do you need to keep old data around? If not, your second task can simply delete old data when it’s done with it. P... | 0 | 0 | 0 | 0 | 2012-02-07T19:56:00.000 | 1 | 1.2 | true | 9,182,936 | 0 | 0 | 1 | 1 | I wanted your advice for the best design approach at the following Python project.
I am building a web service system that is split into 2 parts:
This part grabs realtime data from a 3rd party API and puts the data in a DB.
This part exposes a json API to access data from the DB mentioned in 1).
Some background... |
pip uninstall broken w/ --environment flag? | 9,184,903 | 7 | 3 | 2,999 | 0 | python,virtualenv,pip | Appears to be a bug in pip 1.0. Seems to work if I pip install --upgrade pip and then try it. | 0 | 0 | 0 | 0 | 2012-02-07T22:19:00.000 | 1 | 1.2 | true | 9,184,873 | 1 | 0 | 1 | 1 | I can't seem to get pip to uninstall a package when using the environment flag.
I've created a virtual environment:
virtualenv --no-site-packages /path/to/testenv
While not in the virtual environment, I issue:
pip install --environment /path/to/testenv django
Django is downloaded and installed.
If I do the same command... |
Overloading a part of or entire Django app for a specific User | 9,189,836 | 0 | 0 | 53 | 0 | python,django | In short, you can't (or, at least, it would be fairly tricky and magical).
In longer: apart from performing the checks in the apps themselves, you might want to consider creating a router app which handles the requests, then decides which sub-app should be responsible for them.
If you can give some more details, it wou... | 0 | 0 | 0 | 0 | 2012-02-08T08:23:00.000 | 1 | 0 | false | 9,189,795 | 0 | 0 | 1 | 1 | I am developing a large Django site where some of the users are going to have specific needs. So I am looking for a way to overload part of a Django app if the user meets specific conditions.
I would prefer to be able to dynamically load a user tailored version of an app, instead of loading the standard app all togethe... |
Getting Credentials File in the boto.cfg for Python | 33,725,689 | 5 | 4 | 14,015 | 0 | python,amazon-web-services,boto | For anyone looking for information on the now-current boto3, it does not use a separate configuration file but rather respects the default one created by the aws cli when running aws configure (Ie, it will look at ~/.aws/config) | 0 | 1 | 0 | 0 | 2012-02-08T16:27:00.000 | 3 | 0.321513 | false | 9,197,385 | 0 | 0 | 1 | 1 | I'm using AWS for the first time and have just installed boto for python. I'm stuck at the step where it advices to:
"You can place this file either at /etc/boto.cfg for system-wide use or in the home directory of the user executing the commands as ~/.boto."
Honestly, I have no idea what to do. First, I can't find th... |
How to Copy/Clone a Virtual Environment from Server to Local Machine | 12,794,019 | 2 | 30 | 19,745 | 0 | python,django,ubuntu,webserver,virtualenv | Please using Freeze command and you will get text file with all the versions of packages.
Then install them using easy install or pip install | 0 | 0 | 0 | 0 | 2012-02-09T08:21:00.000 | 2 | 0.197375 | false | 9,207,430 | 1 | 0 | 1 | 2 | I have an existing Python django Project running in Web Server. Now the client needs to make some changes in the existing code. So I need to set it up in my Local Machine. All the packages needed for this project is installed in a Virtual environment. How can I copy or clone this virtual environment to my Local machine... |
How to Copy/Clone a Virtual Environment from Server to Local Machine | 9,207,511 | 51 | 30 | 19,745 | 0 | python,django,ubuntu,webserver,virtualenv | Run pip freeze > requirements.txt on the remote machine
Copy that requirements.txt file to your local machine
In your local virtual environment, run pip install -r requirements.txt
And, so long as all of the requirements are well behaved Python packages, you should be good to go. | 0 | 0 | 0 | 0 | 2012-02-09T08:21:00.000 | 2 | 1.2 | true | 9,207,430 | 1 | 0 | 1 | 2 | I have an existing Python django Project running in Web Server. Now the client needs to make some changes in the existing code. So I need to set it up in my Local Machine. All the packages needed for this project is installed in a Virtual environment. How can I copy or clone this virtual environment to my Local machine... |
Isolated debugging session with PyDev | 9,226,643 | 0 | 0 | 79 | 0 | python,eclipse,debugging,pydev | I don't think this is possible out of the box... you'd need to architecture your production server so that this would be possible (i.e.: when you send a given request it should spawn a different interpreter just to handle your request for debugging purposes and shutdown that interpreter after the debug session ends), b... | 0 | 1 | 0 | 1 | 2012-02-09T23:20:00.000 | 1 | 0 | false | 9,220,493 | 0 | 0 | 1 | 1 | I'm using Eclipse + PyDev to work on python web projects.
Sometimes I need to run debug session on production server rather then locally, due to specific environment.
I was wondering if there is a way to run isolated remote debugging session, so the other users don't experience any issues, and code execution doesn't su... |
get_login_url goes to blank page when coming from naked url | 9,221,655 | 1 | 0 | 84 | 0 | python,google-app-engine | When accessing the site via "example.com", self.request.uri is from that domain, which is the domain where the cookie is created. When it then redirects back, it goes to "www.example.com", which has no cookie, but your site is expecting a user to be logged in.
Suggestions: use a relative path like / (or webapp2's uri r... | 0 | 0 | 0 | 0 | 2012-02-10T00:44:00.000 | 1 | 1.2 | true | 9,221,195 | 0 | 0 | 1 | 1 | I just started hosting my app on a new domain. I selected a url forwarding option with my registrar. Which seems to work. example.com didn't work before (as opposed to the subdomain www.example.com) but now it does.
The problem is that if I access the site via example.com and try to login, users.create_login_url(self.... |
Localhost web-app. Get full path to file in browser | 18,676,841 | 2 | 1 | 1,581 | 0 | python,file,select,browser,path | One approach is to communicate with your server; your client would start with the path "home" (or empty string) and the server would return the physical path ("c:\users\me" or "/home/me"), and the list of subfolders and files in the folder... And then if you give any other path to the server, it will return you info ab... | 0 | 0 | 0 | 0 | 2012-02-10T19:57:00.000 | 1 | 1.2 | true | 9,234,029 | 0 | 0 | 1 | 1 | My question may seem strange, I'd love suggestions if you have a better way to go about what I'm doing:
I'm running a local web server with the Bottle web framework for python. I'm using jQuery, HTML, and CSS to write the graphical front end to my "app", and just navigating to the address of the local host in a browser... |
Full text search with google app engine using ndb models | 9,243,456 | 1 | 4 | 2,635 | 0 | python,google-app-engine,full-text-search,google-cloud-datastore | The best solution is to wait until app engine's full text search is released. They are currently in trusted tester phase, so it's coming soon. If you roll your own solution now, you may end up redoing it in a few months. | 0 | 1 | 0 | 0 | 2012-02-11T10:45:00.000 | 3 | 0.066568 | false | 9,239,575 | 0 | 0 | 1 | 1 | I have made a google app using next db module (ndb) to create my models. Now the problem is i want to deploy search over the fields of these models, and i have found two modules to do that: 1. The officially shipped with google app engine (appengine/google/ext/search) and 2. gae text search (http://code.google.com/p/ga... |
How do set Python path to run Django with WSGI and Apache? | 9,253,022 | 3 | 1 | 1,793 | 0 | python,django | You need to build mod_wsgi against python 2.7 and load this module into apache instead of the current mod_wsgi version you are using that links against python 2.4.
This requires root access to the machine. | 0 | 0 | 0 | 0 | 2012-02-12T21:43:00.000 | 4 | 1.2 | true | 9,252,986 | 0 | 0 | 1 | 3 | The default Python on the server is 2.4, but Django needs version 2.5 or higher. So I installed Python 2.7 in different directory and trying to run Apache with WSGI.
Now, how do I specify for Apache/WSGI to use Python 2.7 to run the Django project?
[edit]
I can't update Python 2.4 because CentOS depends on that versio... |
How do set Python path to run Django with WSGI and Apache? | 9,253,191 | 0 | 1 | 1,793 | 0 | python,django | "You got peanut butter on my chocolate!"
"You got chocolate in my peanut butter!"
Two great tastes that go together.
As Thiefmaster says, you need to use the correct version of wsgi. As Alex says, you need to run in a virtualenv for the later python so that you don't mess up everything else.
Install all your python stu... | 0 | 0 | 0 | 0 | 2012-02-12T21:43:00.000 | 4 | 0 | false | 9,252,986 | 0 | 0 | 1 | 3 | The default Python on the server is 2.4, but Django needs version 2.5 or higher. So I installed Python 2.7 in different directory and trying to run Apache with WSGI.
Now, how do I specify for Apache/WSGI to use Python 2.7 to run the Django project?
[edit]
I can't update Python 2.4 because CentOS depends on that versio... |
How do set Python path to run Django with WSGI and Apache? | 9,253,152 | 0 | 1 | 1,793 | 0 | python,django | You can run Django 1.3 in Python 2.4 without problems. I think it's the best choice for CentOS, and you won't have to upgrade Python.
I've installed django on Centos 5 with Apache+mod_wsgi and Cherokee+uwsgi (I prefer the last one) | 0 | 0 | 0 | 0 | 2012-02-12T21:43:00.000 | 4 | 0 | false | 9,252,986 | 0 | 0 | 1 | 3 | The default Python on the server is 2.4, but Django needs version 2.5 or higher. So I installed Python 2.7 in different directory and trying to run Apache with WSGI.
Now, how do I specify for Apache/WSGI to use Python 2.7 to run the Django project?
[edit]
I can't update Python 2.4 because CentOS depends on that versio... |
Django : Project consuming data from REST API, How to use external apps in this system? | 9,451,170 | -2 | 8 | 2,102 | 0 | python,database,django,rest | I'm facing a similar obstacle with a new ecommerce project.
The project is a front end to a full-fledged store management software (CMS+ERP+CRM). It needs to use the master product database, but have its own entries for product reviews, ratings and so on.
The initial thought was to make a cached copy of the master data... | 0 | 0 | 0 | 0 | 2012-02-13T04:55:00.000 | 3 | -0.132549 | false | 9,255,776 | 0 | 0 | 1 | 1 | I have a Django web front-end that consumes data from a REST API backend.
Even the users are made and created on the backend.
My Problem :
How to use 3rd party apps within this system, that heavily depend on django models/ORM ?
Is there something that can provide some bridge between the REST API resources and the ORM?... |
Django : Which approach is better [ virtualenv + pip ] vs [manually carrying packages in svn]? | 19,614,229 | 0 | 2 | 699 | 0 | python,django,directory-structure | Virtualenv and pip are fantastic for working on multiple django projects on one machine. However, if you only have one project that you are editing, it is not necessary to use virtualenv. | 0 | 0 | 0 | 0 | 2012-02-13T05:19:00.000 | 3 | 0 | false | 9,255,930 | 0 | 0 | 1 | 1 | I have a django project that uses a lot of 3rd party apps, so wanted to decide out of the two approaches to manage my situation :
I can use [ virtualenv + pip ] along with pip freeze as requirements file to manage my project dependencies.
I don't have to worry about the apps, but can't have that committed with my co... |
Django return json and html depending on client python | 9,260,320 | 7 | 3 | 3,193 | 0 | python,html,django,json | Use different URLs for the JSON and HTML versions.
I suggest that your JSON version be available on a url like r'normal/api(?P<json_flag>/json/?)$', and have a parameter in your view to receive the json flag. You can then serve appropriately.
Naturally, your view will have to use different logic to generate HTML and J... | 0 | 0 | 0 | 0 | 2012-02-13T12:07:00.000 | 1 | 1.2 | true | 9,260,249 | 0 | 0 | 1 | 1 | I have a django app which has html templates and I also have a command line python api which can do GET and POST requests to the django app on the server. The api can pretty much do everything that the django app can do. How do I make it such that when I access the django app through the browser it returns html but whe... |
Python: Running Daemon Processes in Windows7 | 9,271,567 | -1 | 5 | 8,604 | 0 | python,windows | You simply need to leave your program running! Please google "python daemon" and see how to implement a persistent background process in Python.
Now, you cannot know when a website changes unless you poll it. If the website is well designed, the page you are trying to poll will have a "Last-Modified" header, you can ma... | 0 | 0 | 0 | 0 | 2012-02-14T04:04:00.000 | 4 | -0.049958 | false | 9,271,525 | 0 | 0 | 1 | 2 | I had a program that Scraped certain data from certain Web-Pages, and when the Web-Pages changed, acted accordingly.
How would one set up the program so it continues to run in the background?
I don't need any specifics
I'm just really confused on this concept and would appreciate whatever help anybody has to offer. |
Python: Running Daemon Processes in Windows7 | 9,274,957 | 10 | 5 | 8,604 | 0 | python,windows | start path-to-pythonw.exe your-code.py
pythonw means without console.
start means start on background.
if your python is installed system-wide, you can probably start your-code.pyw
.pyw is associated with pythonw.exe
remember you cannot use print (to stdout) in this case. | 0 | 0 | 0 | 0 | 2012-02-14T04:04:00.000 | 4 | 1 | false | 9,271,525 | 0 | 0 | 1 | 2 | I had a program that Scraped certain data from certain Web-Pages, and when the Web-Pages changed, acted accordingly.
How would one set up the program so it continues to run in the background?
I don't need any specifics
I'm just really confused on this concept and would appreciate whatever help anybody has to offer. |
How to include plug-n-play widget statics [CSS/JS] without repetition? | 9,272,857 | 0 | 0 | 162 | 0 | php,python,django,templates,include | Depending on your use case a few options:
Use a separate base template for all pages that need the widget; in that base add the required js/css files. For all views that need the widget, inherit from the modified base.
Using javascript implement conditional includes. | 0 | 0 | 0 | 0 | 2012-02-14T06:35:00.000 | 1 | 1.2 | true | 9,272,710 | 0 | 0 | 1 | 1 | I have a reusable google-maps widget that can be plugged into any page that might want to use it.
Widget has :
Google maps specific js includes.
Map specific css to style the map.
Problem:
Widget code gets included as server-side include.
Widget specific js and css has to included with the widget code.
Therefore, if... |
Why use werkzeug when there is flask | 9,288,773 | 13 | 9 | 3,175 | 0 | python,flask,werkzeug | Flask and Werkzeug are different things. Flask contains Werkzeug as one of the things in it, but also has much more (which might be unwanted).
Flask is a web microframework. Werkzeug is a WSGI middleware. | 0 | 0 | 0 | 0 | 2012-02-15T06:16:00.000 | 1 | 1.2 | true | 9,288,747 | 0 | 0 | 1 | 1 | I am just curious to know as why should we use werkzeug when flask is there. Any specific reason to consider werkzeug over flask. |
Retrieve a list of browsers/agents installed in client system | 9,307,042 | 0 | 1 | 300 | 0 | java,javascript,python,django,web-applications | "Scanning" a client from a server may be possible if you break their security or get them to break it for you through some extension (see windows udate, for example). Either way, it's evil. | 0 | 0 | 0 | 0 | 2012-02-16T06:16:00.000 | 4 | 0 | false | 9,306,460 | 0 | 0 | 1 | 4 | I would like to write a web application (in django) which scans the client/remote computers (assumption is windows) and retrieve the list of software's(mainly browsers) installed. Looking for suggestions to implement it.
Is this possible without asking the user to download any scritps/exe's?
If so, is it possible via ... |
Retrieve a list of browsers/agents installed in client system | 9,306,601 | 3 | 1 | 300 | 0 | java,javascript,python,django,web-applications | Short answer: No, it is not possible
Long answer: This is something that any sane (operating) system designer / administrator would try to prevent - scanning of local system by a web page. However, you could use a plug-in component, such as a java applet, to do so - but in practice you probably would need to handle ea... | 0 | 0 | 0 | 0 | 2012-02-16T06:16:00.000 | 4 | 1.2 | true | 9,306,460 | 0 | 0 | 1 | 4 | I would like to write a web application (in django) which scans the client/remote computers (assumption is windows) and retrieve the list of software's(mainly browsers) installed. Looking for suggestions to implement it.
Is this possible without asking the user to download any scritps/exe's?
If so, is it possible via ... |
Retrieve a list of browsers/agents installed in client system | 9,307,607 | 1 | 1 | 300 | 0 | java,javascript,python,django,web-applications | You want to access the data from the client side so from the conceptual/logically its not good to access the client system. You have to use some medium which run on client side on behalf of server.
JavaScript and JavaApplet is good in this. You can get the data by JavaScript or Applet and in backend you can send data ... | 0 | 0 | 0 | 0 | 2012-02-16T06:16:00.000 | 4 | 0.049958 | false | 9,306,460 | 0 | 0 | 1 | 4 | I would like to write a web application (in django) which scans the client/remote computers (assumption is windows) and retrieve the list of software's(mainly browsers) installed. Looking for suggestions to implement it.
Is this possible without asking the user to download any scritps/exe's?
If so, is it possible via ... |
Retrieve a list of browsers/agents installed in client system | 9,306,570 | 0 | 1 | 300 | 0 | java,javascript,python,django,web-applications | You cannot do this unless you have some signed control installed on the client computer; or have them download a program which runs (separate from a browser) and sends the information to your server, where your django app can access it.
This is not possible using javascript (as it runs in a sandbox). | 0 | 0 | 0 | 0 | 2012-02-16T06:16:00.000 | 4 | 0 | false | 9,306,460 | 0 | 0 | 1 | 4 | I would like to write a web application (in django) which scans the client/remote computers (assumption is windows) and retrieve the list of software's(mainly browsers) installed. Looking for suggestions to implement it.
Is this possible without asking the user to download any scritps/exe's?
If so, is it possible via ... |
What does thread local mean in Flask framework? | 9,317,857 | 4 | 9 | 1,559 | 0 | python,web-services,scalability,flask | It's not really a scalability issue, rather it can make it more difficult to maintain a complex code-base. This is because thread locals are used as a global data store, to avoid passing state via function arguments, which makes it harder to follow what's going on.
Speed-wise, thread locals are not particularly slow, b... | 0 | 0 | 0 | 0 | 2012-02-16T18:44:00.000 | 1 | 0.664037 | false | 9,317,168 | 1 | 0 | 1 | 1 | I am evaluating python frameworks to build a REST API. I have gone through many frameworks including flask and found Flask pretty interesting and easy to use with all the features needed to build a REST web service.
One thing i don get is in flask docs it is mentioned that it uses "thread local and has issues with scal... |
How to keep WSGI from launching multiple instances | 9,321,430 | 2 | 0 | 676 | 0 | python,apache,wsgi | Put the WSGI app in daemon mode and tell it to use a single process. Note that this could have a detrimental effect on performance. | 0 | 0 | 0 | 1 | 2012-02-17T00:38:00.000 | 2 | 0.197375 | false | 9,321,335 | 0 | 0 | 1 | 1 | I have a python web application that I have configured in apache as:
WSGIScriptAlias /firetalk /scripts/firetalkServer2
When I access this from javascript using XMLHttpRequest, WSGI/Apache end up launching multiple instances which breaks what I am trying to accomplish.
So, is there any way to limit WSGI/Apache to a... |
Is virtualenv recommended for django production server? | 9,337,514 | 50 | 80 | 20,184 | 0 | python,django,deployment | I would do it that way if you ever think you'll run more than one project on the webserver. As soon as you have two projects you run the risk of a future upgrade of any python package breaking the other site. | 0 | 0 | 0 | 0 | 2012-02-18T00:03:00.000 | 6 | 1.2 | true | 9,337,149 | 0 | 0 | 1 | 4 | I have always been using virtualenv for testing my app in localhost since I have isolated environment and can safely test new release of packages.
Now It comes the time when I have to deploy my app to a production server. I am wondering if I should also use virtualenv for production server or just normal installation s... |
Is virtualenv recommended for django production server? | 41,409,586 | 0 | 80 | 20,184 | 0 | python,django,deployment | Using Docker containers for both development and production deployment is pretty popular now, so if you're considering following this trend, you won't need virtualenv anymore. | 0 | 0 | 0 | 0 | 2012-02-18T00:03:00.000 | 6 | 0 | false | 9,337,149 | 0 | 0 | 1 | 4 | I have always been using virtualenv for testing my app in localhost since I have isolated environment and can safely test new release of packages.
Now It comes the time when I have to deploy my app to a production server. I am wondering if I should also use virtualenv for production server or just normal installation s... |
Is virtualenv recommended for django production server? | 9,340,145 | 3 | 80 | 20,184 | 0 | python,django,deployment | In most cases I would agree it is best to have a virtualenv even if it doesn't seem like you need it when you first set up the server. That said if you are using some kind of cloud service and spinning up servers for a specific task for a short time then I don't see the point of using a virtualenv. | 0 | 0 | 0 | 0 | 2012-02-18T00:03:00.000 | 6 | 0.099668 | false | 9,337,149 | 0 | 0 | 1 | 4 | I have always been using virtualenv for testing my app in localhost since I have isolated environment and can safely test new release of packages.
Now It comes the time when I have to deploy my app to a production server. I am wondering if I should also use virtualenv for production server or just normal installation s... |
Is virtualenv recommended for django production server? | 9,339,816 | 15 | 80 | 20,184 | 0 | python,django,deployment | Is virtualenv recommended for django production server?
Yes, it makes your project not depend on certain aspects of the system environment and also it allows you to make the deployment process more clear and configurable.
I use fabric, pip and virtualenv to deploy all my Django projects. | 0 | 0 | 0 | 0 | 2012-02-18T00:03:00.000 | 6 | 1 | false | 9,337,149 | 0 | 0 | 1 | 4 | I have always been using virtualenv for testing my app in localhost since I have isolated environment and can safely test new release of packages.
Now It comes the time when I have to deploy my app to a production server. I am wondering if I should also use virtualenv for production server or just normal installation s... |
Python Computer -to- Android Phone | 9,356,229 | 2 | 2 | 604 | 0 | android,python,sl4a | You are talking about Client-Server to set the location of your client. You have to create one server which will be provide you a webservice to submit your data.
You can you any web service like xmlrpc, soap ... to fulfill your needs. Python provide the module to develop this services.
You have to use SL4A to develop ... | 1 | 0 | 0 | 0 | 2012-02-20T03:19:00.000 | 1 | 1.2 | true | 9,355,779 | 0 | 0 | 1 | 1 | I am trying to write server code for my python computer and make the android phone a client. The client needs to be able to send its location as well as be able to get data from the server and should run in the background and start itself every 5 minutes or so and send location data to the server. The python side shoul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.