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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pydev not recognizing python installation with django | 4,049,594 | 0 | 15 | 11,629 | 0 | python,django,eclipse,pydev | I think I've got the same problem, Eclipse 3.5.2 on Fedora. In my PyDev Python interpreter settings I've got the site-packages/django folder (site-packages/django/bin too, just in case), but when I try to create a django project I get an error dialogue saying "It seems that the selected interpreter does not have Django... | 0 | 0 | 0 | 0 | 2010-10-15T06:11:00.000 | 10 | 0 | false | 3,939,877 | 1 | 0 | 1 | 10 | I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be? |
pydev not recognizing python installation with django | 4,241,222 | 21 | 15 | 11,629 | 0 | python,django,eclipse,pydev | I had the same problem and this is what I did just after installing eclipse:
Preferences > Interpreter Python
Pressed Auto-config
Selected /Library/Python/x.x/site-packages, which was not selected
(some django folders were in there, persumably the installation)
Clicked apply / OK
Creating a Django project afterwards ... | 0 | 0 | 0 | 0 | 2010-10-15T06:11:00.000 | 10 | 1 | false | 3,939,877 | 1 | 0 | 1 | 10 | I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be? |
pydev not recognizing python installation with django | 4,563,129 | 1 | 15 | 11,629 | 0 | python,django,eclipse,pydev | Use auto config in the preferences option and then click apply and then ok. | 0 | 0 | 0 | 0 | 2010-10-15T06:11:00.000 | 10 | 0.019997 | false | 3,939,877 | 1 | 0 | 1 | 10 | I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be? |
pydev not recognizing python installation with django | 4,961,144 | 1 | 15 | 11,629 | 0 | python,django,eclipse,pydev | If everything is done as said above, and still showing "Django not found" while your are trying to create django project, let try to double click 'django-admin' python file that in scripts folder of python. And try to create django project | 0 | 0 | 0 | 0 | 2010-10-15T06:11:00.000 | 10 | 0.019997 | false | 3,939,877 | 1 | 0 | 1 | 10 | I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be? |
pydev not recognizing python installation with django | 5,612,184 | 2 | 15 | 11,629 | 0 | python,django,eclipse,pydev | I was having this same exact problem today, and I just wanted to add some notes to help people out. You can follow the instructions of antonkeren above, but there's one thing to note that was not mentioned. After adding the django directory to the path you must QUIT ECLIPSE OR APTANA STUDIO. After you restart it and tr... | 0 | 0 | 0 | 0 | 2010-10-15T06:11:00.000 | 10 | 0.039979 | false | 3,939,877 | 1 | 0 | 1 | 10 | I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be? |
pydev not recognizing python installation with django | 4,438,527 | 1 | 15 | 11,629 | 0 | python,django,eclipse,pydev | I had the same problem and had solved it by adding the python home directory to the PATH variable and reconfigure the python interpreter on pydev. | 0 | 0 | 0 | 0 | 2010-10-15T06:11:00.000 | 10 | 0.019997 | false | 3,939,877 | 1 | 0 | 1 | 10 | I have python installed with django. I know the installation is there because I installed it following the directions and in the command line I can do "import python" and there is no crash.
When I try creating a django project in pydev, I get an error: "Django not found."
What could the problem be? |
Is it technically possible to take a screenshot of a website programmatically? | 3,940,121 | 0 | 6 | 2,523 | 0 | python,google-app-engine,screenshot | It's certainly technically possible.
You would probably have to render the HTML directly onto an image file (or more likely, onto an in-memory bitmap that's written to an image file once completed).
I don't know any libraries to do this for you (apart from a modified WebKit, perhaps)... but there's certainly websites t... | 0 | 0 | 1 | 0 | 2010-10-15T06:53:00.000 | 5 | 0 | false | 3,940,098 | 0 | 0 | 1 | 1 | Do you think is technically possible to take a screeshot of a website programmatically?
I would like to craft a scheduled Python task that crawls a list of websites taking an homepage screenshot of them.
Do you think is technically feasible or do you know third party website that offer a service like that (Input: url -... |
Server Upgrade Script | 3,943,924 | 0 | 0 | 88 | 0 | python,django,sysadmin | I think you're pretty much covering everything. Identify what's important to you and you're business practices: that's what counts. | 0 | 0 | 0 | 0 | 2010-10-15T15:16:00.000 | 2 | 0 | false | 3,943,598 | 0 | 0 | 1 | 1 | Does anyone have or know of a good template / plan for doing automated server upgrades? In this case I am upgrading a python/django server, but am going to have to apply this update to many machines, and want to be sure that the operation is fully testable and recoverable should anything go wrong.
Am picturing somethi... |
Python unittests almost never check types | 3,944,260 | 5 | 3 | 187 | 0 | java,python,unit-testing | Python unit tests do check types. All the time. In fact, that's the only thing they are doing.
Python is duck-typed. Duck typing means that the type of an object is defined by its behavior. Unit tests test behavior. Ergo, they test types. | 0 | 0 | 0 | 1 | 2010-10-15T15:43:00.000 | 3 | 0.321513 | false | 3,943,808 | 0 | 0 | 1 | 1 | I was going through a few tests written in Java using JUnit and I could'nt help noticing the emphasis which is laid on checking the "type" of objects. This is something I have never seen in Python test-suites.
Java being statically-typed and Python being dynamically-typed, should'nt the reverse be the case? |
Find a specific tag with BeautifulSoup | 45,193,575 | 9 | 29 | 62,029 | 0 | python,beautifulsoup | with bs4 things have changed a little. so the code should look like this
soup = BeautifulSoup(htmlstring,'lxml')
soup.find_all('div', {'style':"width=300px;"}) | 0 | 0 | 1 | 0 | 2010-10-15T20:11:00.000 | 2 | 1 | false | 3,945,750 | 0 | 0 | 1 | 1 | I can traverse generic tags easily with BS, but I don't know how to find specific tags. For example, how can I find all occurances of <div style="width=300px;">? Is this possible with BS? |
Google App Engine development server is slow to start up when using WingIDE | 3,957,947 | 2 | 1 | 713 | 0 | python,google-app-engine,performance,wing-ide | Probably because you've got a debugger hooked up - debuggers slow code down a lot by instrumenting everything, and deserializing your datastore is a lot of work.
Using the --use_sqlite flag will enable an experimental sqlite-based local datastore, which should require less startup time. Note that it'll require you to w... | 0 | 1 | 0 | 0 | 2010-10-16T02:36:00.000 | 2 | 1.2 | true | 3,947,443 | 0 | 0 | 1 | 1 | I'm developing on Google App Engine. I am using WingIDE (a python IDE) to debug on the development server. I have several thousand entities in my datastore and I can see that when the development server starts up, it has to go through DatastoreFileStub.Read() and do something which each entity.
The problem is, when I r... |
How to turn an encoded link such as "http%3A%2F%2Fexample.com%2Fwhatever" into "http://example.com/whatever" in python? | 5,693,726 | 0 | 0 | 797 | 0 | python,html | urllib.unquote() on its own may still cause problems by throwing the exception:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position n: ordinal not in range(128)
In that case try:
print urllib.unquote("Ober%C3%B6sterreich.txt").decode("utf8") | 0 | 0 | 1 | 0 | 2010-10-16T16:33:00.000 | 2 | 0 | false | 3,949,739 | 0 | 0 | 1 | 1 | I always found links in html source stored in such format, the question is how do I change such links back to what it's normally like?
Thanks a lot! |
Preparing a web site for international usage | 3,970,432 | 0 | 1 | 98 | 0 | python,django,internationalization,project-planning | One big change in your project: you need to build in time to localize your strings. Depending on your schedules, you may have to rearrange work so that all the string-changing work is at the front so that you have time to get the translations done before launching.
Or, alternately, you have to build in a buffer at the... | 0 | 0 | 0 | 1 | 2010-10-16T21:21:00.000 | 2 | 0 | false | 3,950,851 | 0 | 0 | 1 | 1 | I am preparing to develop a web application that will (hopefully) be used by an audience with many different native languages.
What should I do to prepare my software project to have the user interface be almost entirely internationalized?
Are there any software stacks that make this easier? |
How to change email account details in appcfg.py google appengine SDK | 4,927,348 | 0 | 9 | 6,689 | 0 | python,google-app-engine | Answer of Adam Bernier also can apply when you use the
appcfg.py download_app for downloading app from appengine servers. | 0 | 1 | 0 | 0 | 2010-10-16T22:29:00.000 | 5 | 0 | false | 3,951,089 | 0 | 0 | 1 | 1 | I have hosted GAE apps with two different email ids! When i first time used appcfg.py to update my app then it prompted me for email id and password but later it doesnot. How to i change the saved email id and password? I tried to use --email= flag with appcfg.py, but it dint worked. |
When would we need a javascript client template engine? | 3,954,282 | 0 | 2 | 308 | 0 | javascript,python,client-side,template-engine | I'll address your first question.
You can store data in JavaScript objects (instead of SQL databases, for example). Those JavaScript objects can be stored in .js files, or inline as part of the HTML document. You can take a look at the source code of my w3viewer.com. All data is stored inside a JavaScript array.
In... | 0 | 0 | 0 | 0 | 2010-10-17T16:24:00.000 | 3 | 0 | false | 3,954,099 | 0 | 0 | 1 | 3 | Recently, I found out that jQuery has an official template engine which was contributed by the Microsoft team.
Also I had heard about jTemplate from my friends, but I'm still confused:
When & where might I need to use these plugins?
How should I choose between the many client side template engines? |
When would we need a javascript client template engine? | 3,954,332 | 0 | 2 | 308 | 0 | javascript,python,client-side,template-engine | A template-engine prevents unnecessary HTML-code in the actual code. This makes it much easier to read. | 0 | 0 | 0 | 0 | 2010-10-17T16:24:00.000 | 3 | 0 | false | 3,954,099 | 0 | 0 | 1 | 3 | Recently, I found out that jQuery has an official template engine which was contributed by the Microsoft team.
Also I had heard about jTemplate from my friends, but I'm still confused:
When & where might I need to use these plugins?
How should I choose between the many client side template engines? |
When would we need a javascript client template engine? | 3,954,142 | 1 | 2 | 308 | 0 | javascript,python,client-side,template-engine | The reason for a jQuery template engine is this: developers write Javascript code to create new chunks of HTML to inject into the page. This usually is done by concatenating many strings with variables for values, and it becomes difficult to maintain.
With a jQuery template engine, the process of creating HTML at the... | 0 | 0 | 0 | 0 | 2010-10-17T16:24:00.000 | 3 | 1.2 | true | 3,954,099 | 0 | 0 | 1 | 3 | Recently, I found out that jQuery has an official template engine which was contributed by the Microsoft team.
Also I had heard about jTemplate from my friends, but I'm still confused:
When & where might I need to use these plugins?
How should I choose between the many client side template engines? |
Reading files in GAE using python | 3,957,752 | 2 | 2 | 613 | 0 | python,django,google-app-engine | os.path.normpath() on "content_includes" is a no-op - normpath just removes double slashes and other denormalizations. What you probably want is to build a path relative to the script, in which case you should do something like os.path.join(os.path.dirname(__file__), 'content_includes', pageName + '.inc'). | 0 | 1 | 0 | 0 | 2010-10-17T21:22:00.000 | 2 | 1.2 | true | 3,955,361 | 0 | 0 | 1 | 2 | I created a simple python project that serves up a couple of pages. I'm using the 'webapp' framework and django. What I'm trying to do is use one template file, and load 'content files' that contain the actual page text.
When I try to read the content files using os.open, I get the following error:
pageContent = os.op... |
Reading files in GAE using python | 3,994,580 | 0 | 2 | 613 | 0 | python,django,google-app-engine | If you dig in the dev_appserver.py source code and related files you see that the server does some incarnate checking to ensure that you open only files from below your applications root (in fact the rules seem even more complex).
For file access troubled I instrumented that "path permission checking" code from the dev... | 0 | 1 | 0 | 0 | 2010-10-17T21:22:00.000 | 2 | 0 | false | 3,955,361 | 0 | 0 | 1 | 2 | I created a simple python project that serves up a couple of pages. I'm using the 'webapp' framework and django. What I'm trying to do is use one template file, and load 'content files' that contain the actual page text.
When I try to read the content files using os.open, I get the following error:
pageContent = os.op... |
What does a audio frame contain? | 9,184,327 | 6 | 23 | 39,854 | 0 | python,wav | The first thing you should do is a fourier transformation to transform the data into its frequencies. It is rather complex however. I wouldn't use voice recognition libraries here as it sounds like you don't record voices only. You would then try different time shifts (in case the sounds are not exactly aligned) and us... | 0 | 0 | 0 | 1 | 2010-10-18T06:38:00.000 | 4 | 1 | false | 3,957,025 | 1 | 0 | 1 | 4 | I'm doing some research on how to compare sound files(wave). Basically, I want to compare stored soundfiles (wav) with sound from a microphone. So in the end I would like to pre-store some voice commands of my own and then when I'm running my app I would like to compare the pre-stored files with input from the micropho... |
What does a audio frame contain? | 20,810,191 | 7 | 23 | 39,854 | 0 | python,wav | I believe the accepted description to be slightly incorrect.
A frame appears to be somewhat like stride in graphics formats. For interleaved stereo @ 16 bits/sample, the frame size is 2*sizeof(short)=4 bytes. For non-interleaved stereo @ 16 bits/sample, the samples of the left channel are all one after another, so th... | 0 | 0 | 0 | 1 | 2010-10-18T06:38:00.000 | 4 | 1 | false | 3,957,025 | 1 | 0 | 1 | 4 | I'm doing some research on how to compare sound files(wave). Basically, I want to compare stored soundfiles (wav) with sound from a microphone. So in the end I would like to pre-store some voice commands of my own and then when I'm running my app I would like to compare the pre-stored files with input from the micropho... |
What does a audio frame contain? | 3,957,097 | 8 | 23 | 39,854 | 0 | python,wav | A simple byte-by-byte comparison has almost no chance of a successful match, even with some tolerance thrown in. Voice-pattern recognition is a very complex and subtle problem that is still the subject of much research. | 0 | 0 | 0 | 1 | 2010-10-18T06:38:00.000 | 4 | 1 | false | 3,957,025 | 1 | 0 | 1 | 4 | I'm doing some research on how to compare sound files(wave). Basically, I want to compare stored soundfiles (wav) with sound from a microphone. So in the end I would like to pre-store some voice commands of my own and then when I'm running my app I would like to compare the pre-stored files with input from the micropho... |
What does a audio frame contain? | 3,957,230 | 47 | 23 | 39,854 | 0 | python,wav | An audio frame, or sample, contains amplitude (loudness) information at that particular point in time. To produce sound, tens of thousands of frames are played in sequence to produce frequencies.
In the case of CD quality audio or uncompressed wave audio, there are around 44,100 frames/samples per second. Each of tho... | 0 | 0 | 0 | 1 | 2010-10-18T06:38:00.000 | 4 | 1.2 | true | 3,957,025 | 1 | 0 | 1 | 4 | I'm doing some research on how to compare sound files(wave). Basically, I want to compare stored soundfiles (wav) with sound from a microphone. So in the end I would like to pre-store some voice commands of my own and then when I'm running my app I would like to compare the pre-stored files with input from the micropho... |
Uploading images from a django application to a Google AppEngine application | 3,959,150 | 1 | 1 | 269 | 0 | python,google-app-engine | Afaik you can not store files in App Engine programmatically. You can just store them, when uploading your app.
You can however store information in its data store. So you would need to deploy an app, that authenticates your user and then writs the image to the gae's data store | 0 | 1 | 0 | 0 | 2010-10-18T10:24:00.000 | 2 | 0.099668 | false | 3,958,224 | 0 | 0 | 1 | 1 | I am not running Django on AppEngine. I just want to use AppEngine as a content delivery network, basically a place I can host and serve images for free. It's for a personal side project.
The situation is this: I have the URL of an image hosted on another server/provider. Instead of hotlinking to that image its better ... |
Handle GPS Coordinate in Django | 3,962,335 | 0 | 1 | 1,957 | 0 | python,django,gps | Save them as double/float with adequate precision in the input data | 0 | 0 | 0 | 0 | 2010-10-18T18:46:00.000 | 2 | 1.2 | true | 3,962,304 | 0 | 0 | 1 | 1 | What is the best way to manage GPS coordinates (latitude and longitude) in django models ?
I know that there is a module called GeoDjango but reading the tutorial seems dedicated to GIS and not simply to manage the latitude and longitude.
I do not care to have convenient interface for the admin because int the applicat... |
Can I gzip JavaScript and CSS files in Django? | 3,968,783 | 4 | 4 | 4,916 | 0 | python,django,compression,gzip,static-files | You should think about placing your django application behind an HTTP reverse proxy.
You can configure apache to act as a reverse proxy to your django application, although a number of people seem to prefer using nginx or lighttpd for this scenario.
An HTTP reverse proxy basically is a proxy set up directly in front of... | 0 | 0 | 0 | 0 | 2010-10-19T13:09:00.000 | 4 | 0.197375 | false | 3,968,650 | 0 | 0 | 1 | 2 | I tried profiling my web application and one of the bottlenecks reported was the lack of gzip compression. I proceeded to install the gzip middleware in Django and got a bit of a boost but a new report shows that it is only gzipping the HTML files i.e. any content processed by Django. Is there a way I could kludge/hack... |
Can I gzip JavaScript and CSS files in Django? | 3,975,710 | 2 | 4 | 4,916 | 0 | python,django,compression,gzip,static-files | Thanks everyone.
It seems that the GzipMiddleware in Django DOES compress CSS and JS.
I was using Google's Page Speed plugin for Firebug to profile my page and it seems that it was generating reports based on old copies (non-gzipped versions) of the CSSs and JSs in my local cache. These copies were there from the tim... | 0 | 0 | 0 | 0 | 2010-10-19T13:09:00.000 | 4 | 1.2 | true | 3,968,650 | 0 | 0 | 1 | 2 | I tried profiling my web application and one of the bottlenecks reported was the lack of gzip compression. I proceeded to install the gzip middleware in Django and got a bit of a boost but a new report shows that it is only gzipping the HTML files i.e. any content processed by Django. Is there a way I could kludge/hack... |
SHA-256 password generator | 3,974,224 | 0 | 1 | 1,380 | 0 | javascript,python,sha256 | SHA-256 generates very long strings. You're better off using random.choice() with a string a fixed number of times. | 0 | 0 | 0 | 1 | 2010-10-20T02:01:00.000 | 2 | 0 | false | 3,974,211 | 0 | 0 | 1 | 1 | i saw a javascript implementation of sha-256.
i waana ask if it is safe (pros/cons wathever) to use sha-256 (using javascript implementation or maybe python standard modules) alogrithm as a password generator:
i remember one password, put it in followed(etc) by the website address and use the generated text as the pass... |
How to handle multiple forms in google app engine? | 3,976,759 | 7 | 2 | 1,373 | 0 | python,google-app-engine,web-applications | The framework you use is irrelevant to how you handle forms. You have a couple of options: you can distinguish the forms by changing the URL they submit to - in which case, you can use the same handler or a different handler for each form - or you can distinguish them based on the contents of the form. The easiest way ... | 0 | 1 | 0 | 0 | 2010-10-20T09:23:00.000 | 2 | 1.2 | true | 3,976,368 | 0 | 0 | 1 | 1 | Say if I have multiple forms with multiple submit button in a single page, can I somehow make all of these buttons work using webapp as backend handler? If not, what are the alternatives? |
App Engine Version, Memcache | 3,976,845 | 12 | 6 | 371 | 0 | python,google-app-engine | The os.environ variable contains a key called CURRENT_VERSION_ID that you can use. It's value is composed of the version from app.yaml concatenated together with a period and what I suspect is the api_version. If I set version to 42 it gives me the value of 42.1. You should have no problems extracting the version numbe... | 0 | 1 | 0 | 0 | 2010-10-20T10:17:00.000 | 1 | 1.2 | true | 3,976,772 | 0 | 0 | 1 | 1 | I am developing an App Engine App that uses memcache. Since there is only a single memcache shared among all versions of your app I am potentially sending bad data from a new version to the production version memcache. To prevent this, I think I may append the app version to the memcache key string to allow various v... |
Encryption: simulate SSL in javascript and python | 3,978,603 | 1 | 5 | 2,770 | 0 | javascript,python,ssl | You can't stop the men in the middle from trapping your packets/messages, especially if they don't really care if you find out. What you can do is encrypt your messages so that trapping them does not enable them to read what you're sending and receiving. In theory that's fine, but in practice you can't do modern crypto... | 0 | 0 | 1 | 0 | 2010-10-20T11:29:00.000 | 4 | 0.049958 | false | 3,977,274 | 0 | 0 | 1 | 3 | Because of china Great Firewall has blocked google appengine's https port. So I want to simulate a Secure Socket Layer by javascript and python to protect my users information will not be capture by those ISP and GFW.
My plan:
Shake hands:
Browser request server, server generate a encrypt key k1, and decrypt key k2,... |
Encryption: simulate SSL in javascript and python | 3,977,301 | 0 | 5 | 2,770 | 0 | javascript,python,ssl | There's a big problem, if security really is a big concern: Your algorithm is going to be transfered unsecured. Can you trust the client at all? Can the client trust the server at all? | 0 | 0 | 1 | 0 | 2010-10-20T11:29:00.000 | 4 | 0 | false | 3,977,274 | 0 | 0 | 1 | 3 | Because of china Great Firewall has blocked google appengine's https port. So I want to simulate a Secure Socket Layer by javascript and python to protect my users information will not be capture by those ISP and GFW.
My plan:
Shake hands:
Browser request server, server generate a encrypt key k1, and decrypt key k2,... |
Encryption: simulate SSL in javascript and python | 3,977,325 | 2 | 5 | 2,770 | 0 | javascript,python,ssl | You have a fundamental problem in that a JavaScript implementation of SSL would have no built-in root certificates to establish trust, which makes it impossible to prevent a man-in-the-middle attack. Any certificates you deliver from your site, including a root certificate, could be intercepted and replaced by a spy.
N... | 0 | 0 | 1 | 0 | 2010-10-20T11:29:00.000 | 4 | 0.099668 | false | 3,977,274 | 0 | 0 | 1 | 3 | Because of china Great Firewall has blocked google appengine's https port. So I want to simulate a Secure Socket Layer by javascript and python to protect my users information will not be capture by those ISP and GFW.
My plan:
Shake hands:
Browser request server, server generate a encrypt key k1, and decrypt key k2,... |
A good way to encrypt database fields? | 3,979,447 | 2 | 17 | 13,590 | 1 | python,sql,sql-server,django,encryption | If you are storing things like passwords, you can do this:
store users' passwords as their SHA256 hashes
get the user's password
hash it
List item
check it against the stored password
You can create a SHA-256 hash in Python by using the hashlib module.
Hope this helps | 0 | 0 | 0 | 0 | 2010-10-20T15:12:00.000 | 4 | 0.099668 | false | 3,979,385 | 0 | 0 | 1 | 2 | I've been asked to encrypt various db fields within the db.
Problem is that these fields need be decrypted after being read.
I'm using Django and SQL Server 2005.
Any good ideas? |
A good way to encrypt database fields? | 3,979,446 | 6 | 17 | 13,590 | 1 | python,sql,sql-server,django,encryption | Yeah. Tell whoever told you to get real. Makes no / little sense. If it is about the stored values - enterprise edition 2008 can store encrypted DB files.
Otherwise, if you really need to (with all disadvantages) just encrypt them and store them as byte fields. | 0 | 0 | 0 | 0 | 2010-10-20T15:12:00.000 | 4 | 1.2 | true | 3,979,385 | 0 | 0 | 1 | 2 | I've been asked to encrypt various db fields within the db.
Problem is that these fields need be decrypted after being read.
I'm using Django and SQL Server 2005.
Any good ideas? |
Show pdf only to authenticated users | 4,025,388 | 0 | 1 | 216 | 0 | python,html,pdf,permissions,pylons | Maybe filename with md5 key will be enough?
48cd84ab06b0a18f3b6e024703cfd246-myfilename.pdf
You can use filename and datetime.now to generate md5 key. | 0 | 0 | 0 | 0 | 2010-10-20T18:01:00.000 | 4 | 0 | false | 3,980,878 | 0 | 0 | 1 | 3 | I'm building a web site from the old one and i need to show a lot of .pdf files.
I need users to get authenficated before the can't see any of my .pdf but i don't know how (and i can't put my pdf in my database).
I'm using Pylons with Python.
Thank for you help.
If you have any question, ask me! :) |
Show pdf only to authenticated users | 3,980,973 | 2 | 1 | 216 | 0 | python,html,pdf,permissions,pylons | Paul's suggestion of X-Sendfile is excellent - this is truly a great way to deal with actually getting the document back to the user. (+1 for Paul :)
As for the front end, do something like this:
Store your pdfs somewhere not accessible by the web (say /secure)
Offer a URL that looks like /unsecure/filename.pdf
Have y... | 0 | 0 | 0 | 0 | 2010-10-20T18:01:00.000 | 4 | 0.099668 | false | 3,980,878 | 0 | 0 | 1 | 3 | I'm building a web site from the old one and i need to show a lot of .pdf files.
I need users to get authenficated before the can't see any of my .pdf but i don't know how (and i can't put my pdf in my database).
I'm using Pylons with Python.
Thank for you help.
If you have any question, ask me! :) |
Show pdf only to authenticated users | 3,980,896 | 2 | 1 | 216 | 0 | python,html,pdf,permissions,pylons | You want to use the X-Sendfile header to send those files. Precise details will depend on which Http server you're using. | 0 | 0 | 0 | 0 | 2010-10-20T18:01:00.000 | 4 | 0.099668 | false | 3,980,878 | 0 | 0 | 1 | 3 | I'm building a web site from the old one and i need to show a lot of .pdf files.
I need users to get authenficated before the can't see any of my .pdf but i don't know how (and i can't put my pdf in my database).
I'm using Pylons with Python.
Thank for you help.
If you have any question, ask me! :) |
Serving static files with apache and mod_wsgi without changing apache's configuration? | 3,981,300 | 1 | 1 | 2,445 | 0 | python,django,apache,.htaccess,mod-wsgi | Serve the static files from a different virtual host. | 0 | 0 | 0 | 0 | 2010-10-20T18:52:00.000 | 2 | 0.099668 | false | 3,981,267 | 0 | 0 | 1 | 1 | I have a Django application, and I'm using a shared server hosting, so I cannot change apache's config files. The only thing that I can change is the .htaccess file in my application. I also have a standard django.wsgi python file, as an entry point.
In dev environment, I'm using Django to serve the static files, but i... |
Check facebook object type | 3,983,424 | 0 | 1 | 177 | 0 | python,facebook | You could hit up the graph api with the id and see what you get back.
https://graph.facebook.com/{OBJECTID} | 0 | 0 | 0 | 0 | 2010-10-20T23:38:00.000 | 1 | 0 | false | 3,983,168 | 0 | 0 | 1 | 1 | In my app, I have a form where user should submit a facebook page URL.
How to check that it's correct?
Presently, I'm just checking that it begins with 'http://www.facebook.com'
How can I check that it is a page (where you can become a fan) and not a profile, event or whatever?
I'm using the python api and appengine.
T... |
How to implement "autoincrement" on Google AppEngine | 3,986,265 | 25 | 31 | 11,536 | 0 | python,database,google-app-engine | If you absolutely have to have sequentially increasing numbers with no gaps, you'll need to use a single entity, which you update in a transaction to 'consume' each new number. You'll be limited, in practice, to about 1-5 numbers generated per second - which sounds like it'll be fine for your requirements. | 0 | 1 | 0 | 0 | 2010-10-21T09:02:00.000 | 9 | 1.2 | true | 3,985,812 | 0 | 0 | 1 | 4 | I have to label something in a "strong monotone increasing" fashion. Be it Invoice Numbers, shipping label numbers or the like.
A number MUST NOT BE used twice
Every number SHOULD BE used when exactly all smaller numbers have been used (no holes).
Fancy way of saying: I need to count 1,2,3,4 ...
The number Space I ha... |
How to implement "autoincrement" on Google AppEngine | 29,419,735 | 0 | 31 | 11,536 | 0 | python,database,google-app-engine | I'm thinking in using the following solution: use CloudSQL (MySQL) to insert the records and assign the sequential ID (maybe with a Task Queue), later (using a Cron Task) move the records from CloudSQL back to the Datastore.
The entities also can have a UUID, so we can map the entities from the Datastore in CloudSQL, a... | 0 | 1 | 0 | 0 | 2010-10-21T09:02:00.000 | 9 | 0 | false | 3,985,812 | 0 | 0 | 1 | 4 | I have to label something in a "strong monotone increasing" fashion. Be it Invoice Numbers, shipping label numbers or the like.
A number MUST NOT BE used twice
Every number SHOULD BE used when exactly all smaller numbers have been used (no holes).
Fancy way of saying: I need to count 1,2,3,4 ...
The number Space I ha... |
How to implement "autoincrement" on Google AppEngine | 15,731,054 | 0 | 31 | 11,536 | 0 | python,database,google-app-engine | Remember: Sharding increases the probability that you will get a unique, auto-increment value, but does not guarantee it. Please take Nick's advice if you MUST have a unique auto-incrment. | 0 | 1 | 0 | 0 | 2010-10-21T09:02:00.000 | 9 | 0 | false | 3,985,812 | 0 | 0 | 1 | 4 | I have to label something in a "strong monotone increasing" fashion. Be it Invoice Numbers, shipping label numbers or the like.
A number MUST NOT BE used twice
Every number SHOULD BE used when exactly all smaller numbers have been used (no holes).
Fancy way of saying: I need to count 1,2,3,4 ...
The number Space I ha... |
How to implement "autoincrement" on Google AppEngine | 4,056,817 | 7 | 31 | 11,536 | 0 | python,database,google-app-engine | If you drop the requirement that IDs must be strictly sequential, you can use a hierarchical allocation scheme. The basic idea/limitation is that transactions must not affect multiple storage groups.
For example, assuming you have the notion of "users", you can allocate a storage group for each user (creating some glob... | 0 | 1 | 0 | 0 | 2010-10-21T09:02:00.000 | 9 | 1 | false | 3,985,812 | 0 | 0 | 1 | 4 | I have to label something in a "strong monotone increasing" fashion. Be it Invoice Numbers, shipping label numbers or the like.
A number MUST NOT BE used twice
Every number SHOULD BE used when exactly all smaller numbers have been used (no holes).
Fancy way of saying: I need to count 1,2,3,4 ...
The number Space I ha... |
Python GeoModel alternative | 3,993,903 | 2 | 6 | 1,355 | 0 | python,google-app-engine,google-cloud-datastore,gis,geohashing | I can't point you to an existing library that has better performance, but as I recall, GeoModel is open source and the code isn't difficult to understand. We found that we could make some speed improvements by adjusting the code to fit our scenario.
For example, if you don't need nearest-n, you just need X results fro... | 0 | 1 | 0 | 0 | 2010-10-22T04:22:00.000 | 3 | 0.132549 | false | 3,993,862 | 0 | 0 | 1 | 1 | I'm looking for an alternative library for the app engine datastore that will do nearest-n or boxed geo-queries, currently i'm using GeoModel 0.2 and it runs quite slow ( > 1.5s in some cases). Does anyone have any suggestions?
Thanks! |
using django-jython | 4,676,968 | 0 | 0 | 121 | 0 | python,django,jython | I was able to get django 1.2 working just fine in jython 2.5. You will have to use the SVN build of django-jython.
I would recommend that you use Java 6 I was able to get it running in Java 5 but I had to rebuild the ruby file system jar and remove the Java 6 database drivers from the packaged war. So you wont end up ... | 0 | 0 | 0 | 0 | 2010-10-22T08:28:00.000 | 1 | 0 | false | 3,995,088 | 0 | 0 | 1 | 1 | I have read from the django-jython wiki that 1.1.1 is not compatible with django 1.2, and that jython does not works with the default django backend.
Does this means I'm unable to use django 1.2 with jython at the moment? |
HTML code processing | 3,998,246 | 1 | 3 | 933 | 0 | python,html-parsing | Depending on your needs, you could just use the regular expression /<(.|\n)*?>/ and replace all matches with empty strings. This works perfectly for manual cases, but if you're building this as an application feature then you'll need a more robust and secure option. | 0 | 0 | 0 | 0 | 2010-10-22T15:07:00.000 | 5 | 0.039979 | false | 3,998,165 | 0 | 0 | 1 | 1 | I want to process some HTML code and remove the tags as in the example:
"<p><b>This</b> is a very interesting paragraph.</p>" results in "This is a very interesting paragraph."
I'm using Python as technology; do you know any framework I may use to remove the HTML tags?
Thanks! |
Best way to keep an activity log in memcached | 4,006,612 | 0 | 0 | 351 | 1 | python,memcached,feed | If the list of keys is bounded in size then it should be ok. memcache by default has a 1MB item size limit.
Sounds like memcache is the only storage for the data, is it a good idea? | 0 | 0 | 0 | 0 | 2010-10-22T17:43:00.000 | 1 | 0 | false | 3,999,496 | 0 | 0 | 1 | 1 | I'd like to build a "feed" for recent activity related to a specific section of my site. I haven't used memcache before, but I'm thinking of something like this:
When a new piece of information is submitted to the site, assign a unique key to it and also add it to memcache.
Add this key to the end of an existing list... |
Logging into Facebook without a Browser | 4,000,963 | 5 | 4 | 4,595 | 0 | python,facebook | What you are trying to do is not possible. You are going to have to use a browser to get an access token one way or another. You cannot collect username and passwords (a big violation of Facebook's TOS). If you need a script that runs without user interaction you will still need to use a browser to authenticate, but on... | 0 | 0 | 1 | 0 | 2010-10-22T20:55:00.000 | 3 | 1.2 | true | 4,000,896 | 0 | 0 | 1 | 1 | I'm working on a script currently that needs to pull information down from a specific user's wall. The only problem is that it requires authentication, and the script needs to be able to run without any human interference. Unfortunately all I can find thus far tells me that I need to register an application, and then d... |
Can I reliably figure out the correct mime type to serve untrusted content? | 4,002,237 | 1 | 0 | 203 | 0 | python,web-applications,mime,mime-types | Beware of text files: there's no way of knowing what encoding they're in, and there's no reliable way of guessing, especially since most ones created in Windows are in 8-bit MBCS encodings which are indistinguishable without language heuristics. You need to know the encoding--not just the MIME type--to set the complet... | 0 | 0 | 0 | 1 | 2010-10-23T01:33:00.000 | 2 | 0.099668 | false | 4,002,015 | 0 | 0 | 1 | 1 | Say I let users upload files to my server, and I let users download them. I'd like to set the mime type to something other than just application/octet-stream, so that if the browser can just open them, it does (say, for images, pdf files, plain text files, etc.) Of course, since the files are uploaded by users, I can... |
Getting the Tasks in a Google App Engine TaskQueue | 4,059,302 | 1 | 6 | 2,402 | 0 | python,google-app-engine,task,dashboard,task-queue | A workaround, since they don't seem to support this yet, would be to model a Task datastore object. Create one on task queue add, update it when running, and delete it when your task fires. This can also be a nice way to get around the payload limits of the task queue api. | 0 | 1 | 0 | 0 | 2010-10-23T04:42:00.000 | 3 | 0.066568 | false | 4,002,514 | 0 | 0 | 1 | 1 | I know you can view the currently queued and running tasks in the Dashboard or development server console. However, is there any way to get that list programmatically? The docs only describe how to add tasks to the queue, but not how to list and/or cancel them.
In python please. |
Django development version vs stable release | 4,010,690 | 0 | 2 | 1,216 | 0 | python,django,google-app-engine | Another thing to consider is how you install. I'd be sure to install django from SVN, because it makes updating it MUCH easier.
I have been using the dev version for a while on my site, and haven't encountered a single bug yet, aside from one that affected the admin site in a minor way (which a svn up fixed).
I don't... | 0 | 1 | 0 | 0 | 2010-10-24T20:40:00.000 | 3 | 0 | false | 4,010,349 | 0 | 0 | 1 | 1 | I am about to start ramping up on Django and develop a web app that I want to deploy on Google App Engine. I learn that Google has Django 0.96 already installed on the APP engine, but the latest "official" version of Django I see is at 1.2.3 and its a bit of an effort to install it there.
I am curious which version of ... |
How do I forcefully clean a field and redisplay it in Django? | 4,013,095 | 0 | 3 | 220 | 0 | python,django | If, after you've cleaned your form with is_valid(), you render that cleaned form with your view, rather than redirect to a new page, you'll see the cleaned data in your page.
(If you wanted the user to see this cleaned data and then properly submit it, you could use a hidden field to track whether the form data has al... | 0 | 0 | 0 | 0 | 2010-10-24T21:17:00.000 | 1 | 0 | false | 4,010,507 | 0 | 0 | 1 | 1 | How can I clean the data in a form and have the cleaned data redisplayed instead of the submitted data?
There are several fields in my form, and every time the user submits it, it should be redisplayed with the values the user entered. However, some of the fields I would like to clean and update for the user. More spe... |
django multiple select in admin change-list | 4,030,636 | 0 | 0 | 559 | 0 | python,django,django-models,django-admin | say you have a product model
class Product(models.Model):
name=models.CharField(max_length=20)
cost=models.DecimalField(max_length=10)
you can subclass the admin's Modeladmin to show a list display for the products or you can do a custom modelform for the product which you can call in the product's admin
f... | 0 | 0 | 0 | 0 | 2010-10-25T10:38:00.000 | 1 | 0 | false | 4,013,733 | 0 | 0 | 1 | 1 | Our product model can have multiple campaigns. Our customers change these campaigns frequently and generally on multiple products. So what we need right now seems that we need to show a multiple select widget on a change-list of Product model where our customers can easily change the campaigns.
Any idea on this? Maybe... |
Loading New Content with Ajax | 4,027,614 | 1 | 2 | 261 | 0 | javascript,python,ajax,django | The reason to update all of the comments is to take in account other comments that other people may have also submitted in the meantime. to keep the site truly dynamic, you can do either that, or even, when the page is loaded, load up a variable with the newest submitted comment ID, and set a timer that goes back to ch... | 0 | 0 | 0 | 0 | 2010-10-26T20:02:00.000 | 3 | 0.066568 | false | 4,027,508 | 0 | 0 | 1 | 3 | This is a situation I've run into several times, not sure what the best approach is.
Let's say I have some kind of dynamic content that users can add to via Ajax. For example, take Stack Overflow's comments - people can add comments directly on to the page using Ajax.
The question is, how do I implement the addition it... |
Loading New Content with Ajax | 4,027,641 | 1 | 2 | 261 | 0 | javascript,python,ajax,django | I am not proficient neither with Django nor Python but I suppose the basic logic is similar for all server-side languages.
When weighing the pros and cons of either approach things depend on what you want to optimize. If bandwidth is important then obviously using pure JSON in communication reduces latency when compare... | 0 | 0 | 0 | 0 | 2010-10-26T20:02:00.000 | 3 | 0.066568 | false | 4,027,508 | 0 | 0 | 1 | 3 | This is a situation I've run into several times, not sure what the best approach is.
Let's say I have some kind of dynamic content that users can add to via Ajax. For example, take Stack Overflow's comments - people can add comments directly on to the page using Ajax.
The question is, how do I implement the addition it... |
Loading New Content with Ajax | 4,029,103 | 4 | 2 | 261 | 0 | javascript,python,ajax,django | If the content is simple, I would get JSON and build the HTML in jQuery. If it's complex, I would create a template and call render() on it on the server and return the HTML (which jQuery could either append to other content or replace existing content). | 0 | 0 | 0 | 0 | 2010-10-26T20:02:00.000 | 3 | 1.2 | true | 4,027,508 | 0 | 0 | 1 | 3 | This is a situation I've run into several times, not sure what the best approach is.
Let's say I have some kind of dynamic content that users can add to via Ajax. For example, take Stack Overflow's comments - people can add comments directly on to the page using Ajax.
The question is, how do I implement the addition it... |
Django Poll for new records | 4,029,976 | 0 | 0 | 92 | 0 | python,django,polling | Hmm. You could do it two ways that I can think of off the bat - there are surely more.
You can add a field called "already_retrieved" and set it to True for those fields that have already been retrieved, and then only grab Whatever.objects.filter(already_retrieved=False).
Also, if they are in order by a pk, you could ... | 0 | 0 | 0 | 0 | 2010-10-27T03:42:00.000 | 2 | 0 | false | 4,029,807 | 0 | 0 | 1 | 1 | In ajax I am polling a django url to retrieve the latest records. I do not want to display any records I have retrieved previously and I only want to retrieve 1 record for each poll request.
What would be the best way to do this? |
Any framework for PHP, as effective as Django for Python? | 4,030,033 | 3 | 0 | 3,514 | 0 | php,python,django,frameworks | I'd try Symfony.
What you're referring to sounds like "scaffolding" | 0 | 0 | 0 | 0 | 2010-10-27T04:44:00.000 | 5 | 0.119427 | false | 4,030,026 | 0 | 0 | 1 | 2 | I am using python with django. There I can simply make form from models and also it had builtin Admin.
I am eager to know corresponding framework for PHP with all this facilities.
I have encountered lot some similar questions like this, but they had not compared the frameworks with django. Experts Please Suggest. |
Any framework for PHP, as effective as Django for Python? | 4,030,038 | 2 | 0 | 3,514 | 0 | php,python,django,frameworks | I've had good success with Zend in the past. It has a lot of functionality in its libraries and it is all completely decoupled, so you can use whichever parts best fit your task, leaving out other things all together. | 0 | 0 | 0 | 0 | 2010-10-27T04:44:00.000 | 5 | 0.07983 | false | 4,030,026 | 0 | 0 | 1 | 2 | I am using python with django. There I can simply make form from models and also it had builtin Admin.
I am eager to know corresponding framework for PHP with all this facilities.
I have encountered lot some similar questions like this, but they had not compared the frameworks with django. Experts Please Suggest. |
One python multiprocess errors | 4,385,534 | 1 | 0 | 1,864 | 0 | python,multiprocess | Main proc is waiting for all child procs to be terminated before exits itself so there's a blocking call (i.e. wait4) registered as at_exit handles. The signal you sent interrupts that blocking call thus the stack trace.
The thing I'm not clear about is that if the signal sent to child would be redirected to the parent... | 0 | 1 | 0 | 0 | 2010-10-27T05:40:00.000 | 1 | 0.197375 | false | 4,030,277 | 1 | 0 | 1 | 1 | I have one multprocess demo here, and I met some problems with it. Researched for a night, I cannot resolve the reason.
Any one can help me?
I want to have one parent process acts as producer, when there are tasks come, the parent can fork some children to consume these tasks. The parent monitors the child, if any one ... |
3rd party applications inside iFrames? | 4,036,760 | 1 | 1 | 321 | 0 | javascript,python,html,ruby | If you meant "embed" rather than "extend" and you just want people to drop a little box on a page and that's it, then an iframe should be fine.
However, if you want two-way communication or mashupability — rather than "opaque blob of HTML and hope for the best" communication — then a JavaScript or REST API might be a b... | 0 | 0 | 0 | 0 | 2010-10-27T12:45:00.000 | 2 | 1.2 | true | 4,033,325 | 0 | 0 | 1 | 2 | I am about to build a web application and I want to allow other developers extend it with their own applications.
Should I do this with iFrames like Facebook?
Is this a good practice?
Are there other alternatives that let other developers extend my application (that is for the user it looks like it's from my applicatio... |
3rd party applications inside iFrames? | 4,033,372 | 0 | 1 | 321 | 0 | javascript,python,html,ruby | It depends on what you mean by "extend". When you use iFrames with 3rd parties, presumably vended from different domains than the host page, then you are constrained by cross-domain issues and cannot interact with the contents of those iFrames. If that's not an issue for you, then you can go ahead and try that strategy... | 0 | 0 | 0 | 0 | 2010-10-27T12:45:00.000 | 2 | 0 | false | 4,033,325 | 0 | 0 | 1 | 2 | I am about to build a web application and I want to allow other developers extend it with their own applications.
Should I do this with iFrames like Facebook?
Is this a good practice?
Are there other alternatives that let other developers extend my application (that is for the user it looks like it's from my applicatio... |
PHP front-end for installing Django | 4,039,483 | 1 | 0 | 208 | 0 | php,python,django | You should probably bundle Django with your project - or the parts of it that are needed. Users of your product will need to have python and the necessary libs installed. That is not something that you can do via PHP. Well, you could, but that would be like Webmin. When making a product for sale or for users to install... | 0 | 0 | 0 | 0 | 2010-10-27T13:02:00.000 | 1 | 1.2 | true | 4,033,492 | 0 | 0 | 1 | 1 | A simple question:
Is this possible?
Is it worth the time looking into it? |
What do i build my alpha platform on, PHP, Ruby, Python, .NET, etc? | 4,034,000 | 1 | 1 | 156 | 0 | php,.net,python,ruby-on-rails | Write in assembler if you're comfortable with that. :)
Some questions you should ask yourself:
Are there hosting restrictions? No point in coding ASP.net when you have a PHP-only host/server.
Are there technical restrictions? E.g. if you want to use SQL Server as a back-end, going with ASP.net may make your life easi... | 0 | 0 | 0 | 1 | 2010-10-27T13:26:00.000 | 2 | 0.099668 | false | 4,033,735 | 0 | 0 | 1 | 2 | I am developing a social networking website in the facebook/foursquare-ish space. I have gotten such varied feedback on what platform I should develop in. Of course it will be heavily influenced by who I hire, but i was hoping for a little additional feedback from the larger community. Thanks. |
What do i build my alpha platform on, PHP, Ruby, Python, .NET, etc? | 4,033,788 | 7 | 1 | 156 | 0 | php,.net,python,ruby-on-rails | It doesn't matter.
StackOverflow was written in ASP .NET MVC and it's awesome.
Twitter was written in Rails and it's super popular.
Facebook was written in PHP and half a billion people use it.
It's not the technology, it's the community. That's the hard part.
Just pick one and go. Your best bet might actually be t... | 0 | 0 | 0 | 1 | 2010-10-27T13:26:00.000 | 2 | 1 | false | 4,033,735 | 0 | 0 | 1 | 2 | I am developing a social networking website in the facebook/foursquare-ish space. I have gotten such varied feedback on what platform I should develop in. Of course it will be heavily influenced by who I hire, but i was hoping for a little additional feedback from the larger community. Thanks. |
How can I use HTML + Javascript to build a python GUI? | 17,223,197 | 0 | 22 | 24,264 | 0 | python,webkit | If you are thinking about real desktop applications that are multi-threaded and/or use multiple system component - forget about JavaScript. That requires a very good SDK (like PyQt4), and not a basic wrapper like Appcelerator Titanium. Note that developing such applications takes a lot of time.
Second option is to drop... | 0 | 0 | 0 | 0 | 2010-10-27T14:09:00.000 | 10 | 0 | false | 4,034,169 | 0 | 0 | 1 | 2 | I have been experimenting with Appcelerator Titanum yesterday and I think it's cool when it comes to Javascript.
Python features on Appcelerator Titanum are so limited (can't use some modules for example).
My question is How can I use html & javascript as a GUI tool for a real python application ?
I am running win... |
How can I use HTML + Javascript to build a python GUI? | 4,064,133 | 0 | 22 | 24,264 | 0 | python,webkit | I assume you are mobilizing a web-application for cross platform access.
If so have you considered abstracting the cross platform access at the web-app presentation layer ?
Appcelerator / Webkit does not provide true native look-and-feel on mobile devices but this is where a new technology can help. | 0 | 0 | 0 | 0 | 2010-10-27T14:09:00.000 | 10 | 0 | false | 4,034,169 | 0 | 0 | 1 | 2 | I have been experimenting with Appcelerator Titanum yesterday and I think it's cool when it comes to Javascript.
Python features on Appcelerator Titanum are so limited (can't use some modules for example).
My question is How can I use html & javascript as a GUI tool for a real python application ?
I am running win... |
A good way to make Django geolocation aware? - Django/Geolocation | 4,037,302 | 0 | 2 | 1,229 | 0 | python,django,geolocation | Geocoding datasets from yahoo and google can be a good starting poing, Also take a look at geopy library in django. | 0 | 0 | 0 | 0 | 2010-10-27T16:00:00.000 | 2 | 0 | false | 4,035,195 | 0 | 0 | 1 | 1 | I would like to be able to associate various models (Venues, places, landmarks) with a City/Country.
But I am not sure what some good ways of implementing this would be.
I'm following a simple route, I have implemented a Country and City model.
Whenever a new city or country is mentioned it is automatically created.
U... |
Advice on designing django model with "exclusive" foreign key relationships | 4,045,209 | 0 | 0 | 141 | 0 | python,django-models | What I have done is to inherit from a base class on all my models that will be related to tasks. Task models points to that base class on the ForeignKey with unique=True, and it seems like all subclasses inherit the relationship. Thanks. | 0 | 0 | 0 | 0 | 2010-10-27T16:12:00.000 | 2 | 0 | false | 4,035,298 | 0 | 0 | 1 | 1 | I want to design a Task model that can be associated to Project Models, another X model, and other Task models. The obvious choice is a foreign key, but I want any particular instance of that Task model to only be associated to only one of those model types, that is, if a Task model has a relationship with a Project mo... |
Django, Python: How do I know if users have closed their browser without click logout? | 4,039,366 | 4 | 0 | 982 | 0 | python,django | HTTP is a stateless protocol: you can't know at the server if the user has simply closed their browser without informing you. | 0 | 0 | 0 | 0 | 2010-10-28T02:30:00.000 | 3 | 0.26052 | false | 4,039,278 | 0 | 0 | 1 | 2 | Django, Python: How do I know if users have closed their browser without click logout?
Really seriously question, because I need to analyse the user activities. |
Django, Python: How do I know if users have closed their browser without click logout? | 4,039,425 | 0 | 0 | 982 | 0 | python,django | It's not pretty, but you could fire off ajax requests with the user's session info (or some cookie, or any way of identifying the user) every x seconds with javascript and if you haven't received anything from that user in 2*x seconds, then they're likely to have left the page/site. | 0 | 0 | 0 | 0 | 2010-10-28T02:30:00.000 | 3 | 0 | false | 4,039,278 | 0 | 0 | 1 | 2 | Django, Python: How do I know if users have closed their browser without click logout?
Really seriously question, because I need to analyse the user activities. |
Django: tracking all the database changes with values | 4,040,743 | 1 | 2 | 1,840 | 0 | python,django,django-models | fullhistory seems to do most of what you want - what part of the requirement does it not fulfil? It might be easier to enhance fullhistory.
Another option is to do it at the database level, if your database supports logging at that level. | 0 | 0 | 0 | 0 | 2010-10-28T07:21:00.000 | 2 | 0.099668 | false | 4,040,656 | 0 | 0 | 1 | 1 | I have to implement an application in django which will track all the changes in the database with the previous values,current value,action,date,time, user(who performed the changes) etc.
Is there any application/module available in python or django which can perform these actions with may be after some changes. I hav... |
How to add reference to a dynamic assembly for compiling another dynamic assembly? | 4,040,871 | 0 | 2 | 2,123 | 0 | c#,asp.net-mvc,clr,ironpython,razor | Not test, try use assembly.FullName instead of assembly.Location. | 0 | 0 | 0 | 0 | 2010-10-28T07:51:00.000 | 2 | 0 | false | 4,040,825 | 1 | 0 | 1 | 1 | In my AppDomain there are few dynamic assembly, when I try
codeDom.CompileAssemblyFromSource
to Compile another new assembly, I can't figure out a way to add those dynamic assemble to ReferencedAssemblies.
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
compilerParameters.ReferencedAssembl... |
Django : ORM objects come with nothing in _meta.local_fields | 4,042,630 | 0 | 0 | 280 | 0 | python,django | It seems that proxy objects don't have local_fields set, which would be logical. I've just found something in the existing code (exploiting the django python serializer) that works around the lack of local_fields...
I think my question is void :-/ | 0 | 0 | 0 | 0 | 2010-10-28T09:35:00.000 | 1 | 1.2 | true | 4,041,543 | 0 | 0 | 1 | 1 | [python 2.6 - django 1.1.1]
Hello.
I'm writing a custom serializer for my django application.
All the objects that I use are proxy objects derived from django model classes and implement special members that I must serialize (hence the custom serializer).
So I've begun to implement a new abstract serializer that inheri... |
Django: If I added new tables to database, how can I query them? | 4,042,305 | 0 | 0 | 78 | 1 | python,django,django-models,django-admin | Django doen't follow convention over configuration philosophy. you have to explicitly create the backing model for the table and in the meta tell it about the table name... | 0 | 0 | 0 | 0 | 2010-10-28T11:11:00.000 | 2 | 0 | false | 4,042,286 | 0 | 0 | 1 | 2 | Django: If I added new tables to database, how can I query them?
Do I need to create the relevant models first? Or django creates it by itself?
More specifically, I installed another django app, it created several database tables in database, and now I want to get some specific data from them? What are the correct app... |
Django: If I added new tables to database, how can I query them? | 4,042,337 | 1 | 0 | 78 | 1 | python,django,django-models,django-admin | I suppose another django app has all model files needed to access those tables, you should just try importing those packages and use this app's models. | 0 | 0 | 0 | 0 | 2010-10-28T11:11:00.000 | 2 | 1.2 | true | 4,042,286 | 0 | 0 | 1 | 2 | Django: If I added new tables to database, how can I query them?
Do I need to create the relevant models first? Or django creates it by itself?
More specifically, I installed another django app, it created several database tables in database, and now I want to get some specific data from them? What are the correct app... |
Defining Constants in Django | 4,042,429 | 3 | 23 | 31,657 | 0 | python,django,constants | Consider putting it into settings.py of your application. Of course, in order to use it in template you will need to make it available to template as any other usual variable. | 0 | 0 | 0 | 0 | 2010-10-28T11:27:00.000 | 7 | 0.085505 | false | 4,042,407 | 1 | 0 | 1 | 1 | I want to have some constants in a Django Projects. For example, let's say a constant called MIN_TIME_TEST.
I would like to be able to access this constant in two places: from within my Python code, and from within any Templates.
What's the best way to go about doing this?
EDIT:
To clarify, I know about Template Contex... |
What is the best way to serve small static images? | 4,046,258 | 1 | 3 | 547 | 0 | java,javascript,python,image | Data urls will definitely reduce the number of requests to the server, since the browser doesn't have to ask for the pixels in a separate request. But they are not supported in all browsers. You'll have to make the tradeoff. | 0 | 0 | 1 | 0 | 2010-10-28T18:54:00.000 | 4 | 0.049958 | false | 4,046,242 | 0 | 0 | 1 | 1 | Right now I'm base 64 encoding them and using data uris. The idea was that this will somehow lower the number of requests the browser needs to make. Does this bucket hold any water?
What is the best way of serving images in general? DB, from FS, S3?
I am most interested in python and java based answers, but all are wel... |
Date sensitive regression testing using python | 4,121,205 | 0 | 0 | 317 | 0 | python,date,automated-tests,regression-testing | Answering my own question:
Our current plan is to test on virtual machines and change the date/time on the VMs. This is a more complete solution as it gets the database and worker threads all at once.
I'll post an update with some real world experience when we come to actual do it. | 0 | 0 | 0 | 1 | 2010-10-28T20:46:00.000 | 2 | 0 | false | 4,047,049 | 0 | 0 | 1 | 1 | Hey,
I am helping to set up a regression testing suite for our python web application. Many of our tests are scheduling style tests where the current date is important. For example: create a recurring event that runs every week for a month starting on Feb 1.
In order to test this, what I really want to do is override t... |
Does FastCGI or Apache2 limit upload sizes? | 4,047,955 | 2 | 3 | 1,279 | 1 | python,mysql,file-upload,apache2,fastcgi | If the web server/gateway layer were truncating incoming form submissions I'd expect an error from FieldStorage, since the truncation would not just interrupt the file upload but also the whole multipart/form-data structure. Even if cgi.py tolerated this, it would be very unlikely to have truncated the multipart at jus... | 0 | 0 | 0 | 0 | 2010-10-28T23:16:00.000 | 1 | 1.2 | true | 4,047,899 | 0 | 0 | 1 | 1 | I'm having a problem with file uploading. I'm using FastCGI on Apache2 (unix) to run a WSGI-compliant application. File uploads, in the form of images, are begin saved in a MySQL database. However, larger images are being truncated at 65535 bytes. As far as I can tell, nothing should be limiting the size of the files a... |
What's the best way to start learning django? | 4,048,987 | 8 | 54 | 77,794 | 0 | python,django | Build something. Anything. Keep it relatively simple and short, but start building it and make sure you finish building it. The project you have in mind right there might be perfect.
Reading documentation and books is extremely helpful, of course, but like any programming the only way to really learn Django is to pr... | 0 | 0 | 0 | 0 | 2010-10-29T04:26:00.000 | 8 | 1 | false | 4,048,973 | 0 | 0 | 1 | 2 | I really want to build a web application; something simple, maybe a database of Pokémon cards for instance?
I've heard excellent things about Django. Where would be the best place to start? |
What's the best way to start learning django? | 4,050,115 | 7 | 54 | 77,794 | 0 | python,django | If you don't know Python, start your learning with that. People tend to get very frustrated when they try to learn a framework without knowing at least something about its programming language. | 0 | 0 | 0 | 0 | 2010-10-29T04:26:00.000 | 8 | 1 | false | 4,048,973 | 0 | 0 | 1 | 2 | I really want to build a web application; something simple, maybe a database of Pokémon cards for instance?
I've heard excellent things about Django. Where would be the best place to start? |
Django Apps extendability - How to make your django apps easily extendable? | 4,051,518 | 1 | 0 | 238 | 0 | python,django | use signals and dispatchers
in your app create files..
-litseners.py
-signals.py
and then implement signals for your models and forms (views not so much)
use the django plugins pattern
ducktyping for your classes | 0 | 0 | 0 | 0 | 2010-10-29T10:32:00.000 | 2 | 0.099668 | false | 4,051,010 | 0 | 0 | 1 | 1 | What are your best practises for making your django application easily extendable for other developers?
What are your approaches for enabling other to overwrite your
views
forms
templates
models
classes
In a way that enables a healthy environment for extensions to work well together? |
fit mysql db in memory | 4,061,902 | 1 | 1 | 1,165 | 1 | python,mysql,sqlalchemy,performance | I would create a read only slave to your mysql database and force its database engines to memory. You'd have to handle failures by re-initializing the read only database, but that can be scripted rather easily.
This way you still have your persistence in the regular mysql database and your read speed in the read only ... | 0 | 0 | 0 | 0 | 2010-10-31T04:18:00.000 | 3 | 1.2 | true | 4,061,828 | 0 | 0 | 1 | 2 | I am using Redis database where we store the navigational information. These data must be persistent and should be fetched faster. I don't have more than 200 MB data in this data set.
I face problem when writing admin modules for redis db and I really missing the sql schema and power of django style admin modules.
Now ... |
fit mysql db in memory | 4,061,848 | 0 | 1 | 1,165 | 1 | python,mysql,sqlalchemy,performance | I would think you could have a persistent table, copy all of the data into a MEMORY engine table whenever the server starts, and have triggers on the memory db for INSERT UPDATE and DELETE write to the persistent table so it is hidden for the user. Correct me if I'm wrong though, it's just the approach I would first t... | 0 | 0 | 0 | 0 | 2010-10-31T04:18:00.000 | 3 | 0 | false | 4,061,828 | 0 | 0 | 1 | 2 | I am using Redis database where we store the navigational information. These data must be persistent and should be fetched faster. I don't have more than 200 MB data in this data set.
I face problem when writing admin modules for redis db and I really missing the sql schema and power of django style admin modules.
Now ... |
Django Time issues | 4,065,182 | 2 | 2 | 274 | 0 | python,django | I'd make all my times UTC, as that's a good international-level reference point, and you can always shift that to a local time, given that you know the user's TZ.
I'd also use the time on the server (datetime.datetime.now()) rather than rely on the client's system clock, as this makes it easy to fake what time somethin... | 0 | 0 | 0 | 0 | 2010-10-31T21:12:00.000 | 3 | 0.132549 | false | 4,065,157 | 0 | 0 | 1 | 1 | My app in django requires to tell the user what time an action occurred. Aside from asking the user what timezone he/she is in, is it possible for me to generate the time on the client end?
Off the top of my head, are there a particular representation of time that is timezone independent, (unix time?), and then I can ... |
passing data between java and python | 40,502,477 | 0 | 5 | 5,214 | 0 | java,python,django,jython | It might be what you wanted to avoid.
but at the most simple way of things, using sockets / shared file with java will be the best solution.
python socket can send information and revise it from java.
On the other hand if that feel like a pain. if you use java and python at the same computer you can use a shared file, ... | 0 | 0 | 0 | 0 | 2010-11-01T10:20:00.000 | 4 | 0 | false | 4,068,052 | 0 | 0 | 1 | 1 | Apologies if my question is noob. I'm running Django 1.2 with pgsql 8.4 and I'm required to run a Java program after getting the inputs from the user, does some calculations and return the results back to the user.
May I know what is the best way to pass data between the Java and Python Django, such that the above scen... |
Django + alwaysdata.com Noob Question | 4,073,511 | 1 | 1 | 1,444 | 0 | python,django | The devserver included with django is for testing purposes, only on your local machine and should not be used on a web host. From the docs:
DO NOT USE THIS SERVER IN A PRODUCTION
SETTING. It has not gone through
security audits or performance tests.
(And that's how it's gonna stay. We're
in the business of mak... | 0 | 0 | 0 | 0 | 2010-11-01T21:47:00.000 | 4 | 0.049958 | false | 4,073,352 | 0 | 0 | 1 | 1 | I'm learning Django and working on sample sites.. I registered at alwaysdata but am unable to view the site after I go 'manage.py runserver' in the SSH (this is after I've created the project and navigated to the appropriate directory, of course).
I appreciate any help.
Thanks |
What is the best way to store change history of website articles? | 4,076,484 | 0 | 0 | 289 | 0 | php,.net,python,ruby | I presume you're using a CMS. If not, use one. WordPress is a good start.
If you're developing from scratch, the usual method is to have two tables: one for page information (so title, menu position etc.) and then a page_content table, which has columns for page_id, content, and timestamp.
As you save a page, instead o... | 0 | 0 | 1 | 1 | 2010-11-02T06:11:00.000 | 3 | 1.2 | true | 4,075,309 | 0 | 0 | 1 | 2 | Our client wants us to implement change history for website articles. What is the best way to do it? |
What is the best way to store change history of website articles? | 4,075,372 | -1 | 0 | 289 | 0 | php,.net,python,ruby | There is a wide variety of ways to do this as you alluded by tagging php, .net, python, and ruby. You missed a few off the top of my head perl and jsp. Each of these have their plusses and minuses and is really a question of what best suits your needs.
PHP is probably the fastest reward for time spent.
Ruby, i'm assu... | 0 | 0 | 1 | 1 | 2010-11-02T06:11:00.000 | 3 | -0.066568 | false | 4,075,309 | 0 | 0 | 1 | 2 | Our client wants us to implement change history for website articles. What is the best way to do it? |
Python - optimize by not importing at module level? | 4,080,823 | 15 | 5 | 1,475 | 0 | python,optimization,premature-optimization,python-import | No, don't do this. In a normal python execution environment on the web (mod_wsgi, gunicorn, etc.) when your process starts those imports will be executed, and then all subsequent requests will not re-execute the script. If you put the imports inside the functions they'll have to be processed every time the function i... | 0 | 0 | 0 | 0 | 2010-11-02T18:10:00.000 | 5 | 1.2 | true | 4,080,749 | 0 | 0 | 1 | 3 | In a framework such as Django, I'd imagine that if a user lands on a page (running a view function called "some_page"), and you have 8 imports at the top of module that are irrelevant to that view, you're wasting cycles on those imports. My questions are:
Is it a large enough amount of resources to make an impact on a... |
Python - optimize by not importing at module level? | 4,080,821 | 4 | 5 | 1,475 | 0 | python,optimization,premature-optimization,python-import | 1) The answer is no. Django/Python is not like PHP. Your whole module will not be reinterpreted with each pageview like happens with PHP includes. The module will be in memory and each page view will make a simple function call to your view.
2) Yes, it will be a counter-optimization to make imports at the view level. | 0 | 0 | 0 | 0 | 2010-11-02T18:10:00.000 | 5 | 0.158649 | false | 4,080,749 | 0 | 0 | 1 | 3 | In a framework such as Django, I'd imagine that if a user lands on a page (running a view function called "some_page"), and you have 8 imports at the top of module that are irrelevant to that view, you're wasting cycles on those imports. My questions are:
Is it a large enough amount of resources to make an impact on a... |
Python - optimize by not importing at module level? | 4,080,836 | 5 | 5 | 1,475 | 0 | python,optimization,premature-optimization,python-import | Yes, it is a bad practice to import at the function level. By using smarter imports at the top of the module, you create a one time, small cost. However, if you place an import in a function you will suffer the cost of the import each time that function is run. So, rather than import in the function, just import at the... | 0 | 0 | 0 | 0 | 2010-11-02T18:10:00.000 | 5 | 0.197375 | false | 4,080,749 | 0 | 0 | 1 | 3 | In a framework such as Django, I'd imagine that if a user lands on a page (running a view function called "some_page"), and you have 8 imports at the top of module that are irrelevant to that view, you're wasting cycles on those imports. My questions are:
Is it a large enough amount of resources to make an impact on a... |
feature mobile phone tracking application | 4,084,073 | 1 | 0 | 1,349 | 0 | python,security,mobile | As far as I know, there is no way to get Python code running on that kind of mobile platform.
Try looking up JavaME and/or Brew. Further, you will need the carrier and device maker to allow your app the get access to the phone's GPS information. This is not a given on the low-end devices.
As a first step, most carrie... | 0 | 0 | 0 | 0 | 2010-11-02T19:22:00.000 | 1 | 1.2 | true | 4,081,333 | 0 | 0 | 1 | 1 | I would like to build a mobile phone tracking application for feature phones which have minimum of gprs connectivity. I would like a user to log in to the application and be able to see the location of their phone through google maps. Any resources or information will be highly appreciated. I would preferably use pytho... |
Great flask / other python micro framework code I could learn from | 4,083,522 | 0 | 0 | 1,700 | 0 | python,web-applications,flask | IMHO your time would be better invested learning something like Django, because much of what you could improve in a micro framework is already builtin on a bigger framework. | 0 | 0 | 0 | 0 | 2010-11-03T01:07:00.000 | 2 | 0 | false | 4,083,440 | 0 | 0 | 1 | 1 | I'd like to look at some good web-app code written in python, just so I can learn some of the patterns / see how I can improve my code.
I've already googled around a bit, used google code search and run a search on github too - but haven't come across a well built, comprehensive app.
Perhaps a book could work as well. ... |
Issues when writing a medium/large system | 4,083,588 | 1 | 1 | 178 | 0 | java,python,ruby,system,enterprise | You make a valid point in saying that Java is more suited to enterprise software. That's really where Java shines: it works very well for enterprise programming.
However, your gripes about the tools in Python and Ruby are unfounded. PyDev for Eclipse takes full advantage of the same features that you would enjoy if you... | 0 | 0 | 0 | 0 | 2010-11-03T01:32:00.000 | 3 | 0.066568 | false | 4,083,554 | 1 | 0 | 1 | 3 | There is some hype with languages like Python (that I like very much) and Ruby but I was writing a medium-size system in Python and feel the lack of some tools that I would have if I was using Java: Eclipse features, JUnit integration and some language-features like catching some errors in compile time.
Some people say... |
Issues when writing a medium/large system | 4,083,633 | 0 | 1 | 178 | 0 | java,python,ruby,system,enterprise | All much of a muchness really. There are features in Python/Ruby that your aware of that make them a more appealing offering than say Java. Static typing can be your best friend most of the time, and a pain for the other.
Lack of tooling is related to adoption. Java/c# has a larger adoption.
Corporates/Enterprises and ... | 0 | 0 | 0 | 0 | 2010-11-03T01:32:00.000 | 3 | 0 | false | 4,083,554 | 1 | 0 | 1 | 3 | There is some hype with languages like Python (that I like very much) and Ruby but I was writing a medium-size system in Python and feel the lack of some tools that I would have if I was using Java: Eclipse features, JUnit integration and some language-features like catching some errors in compile time.
Some people say... |
Issues when writing a medium/large system | 4,083,662 | 1 | 1 | 178 | 0 | java,python,ruby,system,enterprise | This kind of question can get very argumentative... For enterprise software most of time the key factor is political, not technical.
If you own the business, stick with the technology that best fits your vision. If not, use Java - it is politically safer.
On the technical field, it is almost a tie. | 0 | 0 | 0 | 0 | 2010-11-03T01:32:00.000 | 3 | 0.066568 | false | 4,083,554 | 1 | 0 | 1 | 3 | There is some hype with languages like Python (that I like very much) and Ruby but I was writing a medium-size system in Python and feel the lack of some tools that I would have if I was using Java: Eclipse features, JUnit integration and some language-features like catching some errors in compile time.
Some people say... |
Is Django 1.2.3 competable with Python 2.6.5 | 4,085,840 | 3 | 0 | 102 | 0 | python,django | Yes. You're having other problems. | 0 | 0 | 0 | 0 | 2010-11-03T09:55:00.000 | 1 | 1.2 | true | 4,085,826 | 0 | 0 | 1 | 1 | Just curious to know, Test module won't work properly with django 1.2.3 when update from django 1.1.1 (now on python 2.6.5) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.