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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Seeding random in django | 1,156,536 | 0 | 4 | 2,315 | 0 | python,django,random,django-views | It really depends on what you need the random number for. Use some experimentation to find out if it makes any difference. You should also consider that there is actually a pattern to pseudo-random numbers. Does it make a difference to you if someone can possible guess the next random number? If not, seed it once a... | 0 | 0 | 0 | 0 | 2009-07-20T23:26:00.000 | 3 | 0 | false | 1,156,511 | 0 | 0 | 1 | 3 | In a view in django I use random.random(). How often do I have to call random.seed()?
One time for every request?
One time for every season?
One time while the webserver is running? |
Seeding random in django | 1,157,735 | 4 | 4 | 2,315 | 0 | python,django,random,django-views | Don't set the seed.
The only time you want to set the seed is if you want to make sure that the same events keep happening. For example, if you don't want to let players cheat in your game you can save the seed, and then set it when they load their game. Then no matter how many times they save + reload, it still gives ... | 0 | 0 | 0 | 0 | 2009-07-20T23:26:00.000 | 3 | 0.26052 | false | 1,156,511 | 0 | 0 | 1 | 3 | In a view in django I use random.random(). How often do I have to call random.seed()?
One time for every request?
One time for every season?
One time while the webserver is running? |
models.py getting huge, what is the best way to break it up? | 1,160,607 | 64 | 94 | 18,179 | 0 | python,django,django-models,models | Django is designed to let you build many small applications instead of one big application.
Inside every large application are many small applications struggling to be free.
If your models.py feels big, you're doing too much. Stop. Relax. Decompose.
Find smaller, potentially reusable small application components, or... | 0 | 0 | 0 | 0 | 2009-07-21T17:27:00.000 | 3 | 1.2 | true | 1,160,579 | 0 | 0 | 1 | 1 | Directions from my supervisor:
"I want to avoid putting any logic in the models.py. From here on out, let's use that as only classes for accessing the database, and keep all logic in external classes that use the models classes, or wrap them."
I feel like this is the wrong way to go. I feel that keeping logic out of t... |
How would you model this database relationship? | 1,162,884 | 0 | 2 | 358 | 1 | python,database,django,database-design | I agree with your conclusion. I would store the physician type in the many-to-many linking table. | 0 | 0 | 0 | 0 | 2009-07-22T03:05:00.000 | 3 | 0 | false | 1,162,877 | 0 | 0 | 1 | 1 | I'm modeling a database relationship in django, and I'd like to have other opinions. The relationship is kind of a two-to-many relationship. For example, a patient can have two physicians: an attending and a primary. A physician obviously has many patients.
The application does need to know which one is which; further,... |
Cost of scaling Rails vs cost of scaling PHP vs Python frameworks | 1,163,341 | 4 | 7 | 2,847 | 0 | php,python,ruby-on-rails,scaling | IMHO I don't think the cost of scaling is going to be any different between those three because none of them have "scalability batteries" included. I just don't see any huge architectural differences between those three choices that would cause a significant difference in scaling.
In other words, your application arch... | 0 | 0 | 0 | 1 | 2009-07-22T04:07:00.000 | 3 | 0.26052 | false | 1,163,012 | 0 | 0 | 1 | 2 | I guess this question has been asked a lot around. I know Rails can scale because I have worked on it and it's awesome. And there is not much doubt about that as far as PHP frameworks are concerned.
I don't want to know which frameworks are better.
How much is difference in cost of scaling Rails vs other frameworks (P... |
Cost of scaling Rails vs cost of scaling PHP vs Python frameworks | 1,163,208 | 5 | 7 | 2,847 | 0 | php,python,ruby-on-rails,scaling | One major factor in this is that isn't affected by choice of framework is database access. No matter what approach you take, you likely put data in a relational database. Then the question is how efficiently you can get the data out of the database. This primarily depends on the RDBMS (Oracle vs. Postgres vs. MySQL), a... | 0 | 0 | 0 | 1 | 2009-07-22T04:07:00.000 | 3 | 1.2 | true | 1,163,012 | 0 | 0 | 1 | 2 | I guess this question has been asked a lot around. I know Rails can scale because I have worked on it and it's awesome. And there is not much doubt about that as far as PHP frameworks are concerned.
I don't want to know which frameworks are better.
How much is difference in cost of scaling Rails vs other frameworks (P... |
Is it safe to track trunk in Django? | 1,165,715 | 0 | 2 | 263 | 0 | python,django | As with the trunk of any software project, it's only as stable as the people commiting things test for. Typically this is probably pretty stable, but you need to be aware that if you get caught with a 'bad' version (which can happen), your site/s just might come down over it temporarily. | 0 | 0 | 0 | 0 | 2009-07-22T14:22:00.000 | 5 | 0 | false | 1,165,631 | 0 | 0 | 1 | 2 | I'm currently using Django 1.1 beta for some personal projects, and plan to start messing arround with the trunk to see the new stuff under the hood. But I might start using it on a professional basis, and I'd need to know if trunk is stable enough for using in production, or I should stick to 1.0 for mission critical ... |
Is it safe to track trunk in Django? | 1,165,718 | 2 | 2 | 263 | 0 | python,django | You probably shouldn't pull Django trunk every day, sometimes there are big commits that might break some things on your site. Also it depends what features you use, the new ones will of cause be a bit more buggy than older features. But all in all there shouldn't be a problem using trunk for production. You just need ... | 0 | 0 | 0 | 0 | 2009-07-22T14:22:00.000 | 5 | 0.07983 | false | 1,165,631 | 0 | 0 | 1 | 2 | I'm currently using Django 1.1 beta for some personal projects, and plan to start messing arround with the trunk to see the new stuff under the hood. But I might start using it on a professional basis, and I'd need to know if trunk is stable enough for using in production, or I should stick to 1.0 for mission critical ... |
need help on ADO.net connection string | 1,169,704 | 0 | 0 | 1,035 | 1 | .net,ado.net,ironpython,connection-string | Data Source=xx.xx.xx.xx;Initial Catalog=;Integrated Security="SSPI"
How are you connecting to SQL. Do you use sql server authentication or windows authentication? Once you know that, then if you use a DNS name or IP that will go to the server correctly, you have the instance name correct AND you have permissions on t... | 0 | 0 | 0 | 0 | 2009-07-23T04:52:00.000 | 2 | 0 | false | 1,169,668 | 0 | 0 | 1 | 2 | I have to get the data from a User site. If I would work on their site, I would VPN and then remote into their server using username and password.
I thought getting data into my local machine than getting into their server where my work is not secured.
So, I thought of using Ironpython to get data from the remote serve... |
need help on ADO.net connection string | 1,169,755 | 0 | 0 | 1,035 | 1 | .net,ado.net,ironpython,connection-string | Is that user granted login abilities in SQL?
If using SQL 2005, you go to Security->Logins
Double click the user, and click Status.
------Edit ----
Create a file on your desktop called TEST.UDL. Double click it.
setup your connection until it works.
View the UDL in notepad, there's your connection string. Though I t... | 0 | 0 | 0 | 0 | 2009-07-23T04:52:00.000 | 2 | 0 | false | 1,169,668 | 0 | 0 | 1 | 2 | I have to get the data from a User site. If I would work on their site, I would VPN and then remote into their server using username and password.
I thought getting data into my local machine than getting into their server where my work is not secured.
So, I thought of using Ironpython to get data from the remote serve... |
Trying to understand Django's sorl-thumbnail | 1,232,375 | 2 | 6 | 2,437 | 0 | python,django,image-processing | I'm one of the sorl-thumbnail developers.
Firstly, you don't need to {% load thumbnail %} unless you're just using the thumbnail tag rather than a thumbnail field.
Currently, a thumbnail is only ever created the first time it is used - even if you use the field [I'll get around to changing that one day if no-one else d... | 0 | 0 | 0 | 0 | 2009-07-23T13:22:00.000 | 2 | 0.197375 | false | 1,171,680 | 0 | 0 | 1 | 2 | I have been playing around with sorl-thumbnail for Django. And trying to understand how it works better.
I've read the guide for it, installed it in my site-packages, made sure PIL is installed correctly, put sorl.thumbnail in the INSTALLED APPS in my settings.py, put from sorl.thumbnail.fields import ImageWithThumbna... |
Trying to understand Django's sorl-thumbnail | 2,178,420 | 0 | 6 | 2,437 | 0 | python,django,image-processing | how about adding some jCrop in the admin to specify area of thumbnail ? Woul be pretty cool :) | 0 | 0 | 0 | 0 | 2009-07-23T13:22:00.000 | 2 | 0 | false | 1,171,680 | 0 | 0 | 1 | 2 | I have been playing around with sorl-thumbnail for Django. And trying to understand how it works better.
I've read the guide for it, installed it in my site-packages, made sure PIL is installed correctly, put sorl.thumbnail in the INSTALLED APPS in my settings.py, put from sorl.thumbnail.fields import ImageWithThumbna... |
How can I launch a background process in Pylons? | 1,182,609 | 1 | 3 | 1,069 | 0 | python,background,pylons | I think this has little to do with pylons. I would do it (in whatever framework) in these steps:
generate some ID for the new job, and add a record in the database.
create a new process, e.g. through the subprocess module, and pass the ID on the command line (*).
have the process write its output to /tmp/project/ID
in... | 0 | 1 | 0 | 0 | 2009-07-25T17:36:00.000 | 2 | 0.099668 | false | 1,182,587 | 0 | 0 | 1 | 1 | I am trying to write an application that will allow a user to launch a fairly long-running process (5-30 seconds). It should then allow the user to check the output of the process as it is generated. The output will only be needed for the user's current session so nothing needs to be stored long-term. I have two questi... |
Storing files for testbin/pastebin in Python | 1,184,170 | 0 | 0 | 578 | 0 | python,web-applications | Plain files are definitely more effective. Save your database for more complex queries.
If you need some formatting to be done on files, such as highlighting the code properly, it is better to do it before you save the file with that code. That way you don't need to apply formatting every time the file is shown.
You de... | 0 | 0 | 0 | 1 | 2009-07-26T09:23:00.000 | 3 | 0 | false | 1,184,116 | 1 | 0 | 1 | 1 | I'm basically trying to setup my own private pastebin where I can save html files on my private server to test and fool around - have some sort of textarea for the initial input, save the file, and after saving I'd like to be able to view all the files I saved.
I'm trying to write this in python, just wondering what th... |
Appengine and GWT - feeding the python some java | 1,391,971 | 0 | 3 | 3,162 | 0 | java,python,google-app-engine,gwt | I agree with your evaluation of Python's text processing and GWT's quality. Have you considered using Jython? Googling "pyparsing jython" gives some mixed reviews, but it seems there has been some success with recent versions of Jython. | 0 | 1 | 0 | 0 | 2009-07-27T02:16:00.000 | 4 | 0 | false | 1,186,155 | 0 | 0 | 1 | 1 | I realize this is a dated question since appengine now comes in java, but I have a python appengine app that I want to access via GWT. Python is just better for server-side text processing (using pyparsing of course!). I have tried to interpret GWT's client-side RPC and that is convoluted since there is no python cou... |
How do I use Python serverside with shared hosting? | 1,199,744 | 2 | 3 | 2,969 | 0 | python,server-side | If your server is running Apache HTTP server, then you need something like mod_wsgi or mod_python installed and running as a module (your server signature may tell you this).
Once running, you may need to add a handler to your apache config, or a default may be setup.
After that, look at the documentation for the middl... | 0 | 0 | 0 | 1 | 2009-07-29T11:49:00.000 | 4 | 1.2 | true | 1,199,703 | 0 | 0 | 1 | 1 | I've been told by my hosting company that Python is installed on their servers. How would I go about using it to output a simple HTML page? This is just as a learning exercise at the moment, but one day I'd like to use Python in the same way as I currently use PHP. |
Java Wrapper to Perl/Python code | 1,201,722 | 4 | 4 | 2,709 | 0 | java,python,perl,web-services,wrapper | This depends heavily upon your needs. If Jython is an option for the Python code (it isn't always 100% compatible), then it is probably the best option there. Otherwise, you will need to use Java's Process Builder to call the interpretters directly and return the results on their output stream. This will not be fast... | 0 | 1 | 0 | 1 | 2009-07-29T16:53:00.000 | 5 | 1.2 | true | 1,201,628 | 0 | 0 | 1 | 1 | I have to deploy some Web Services on a server that only supports the Java ones, but some of them will be done using perl or python. I want to know if is possible to develop a Java wrapper to call a specific code written in perl or python. So, I want to have all the Web Services in Java, but some of them will call some... |
Django and File Permissions: Best Practices? | 1,201,895 | 0 | 0 | 915 | 0 | python,django | I'd go with option number 2. I don't think your django user is any more likely to get compromised than your Tkinter user. If there's something else under apache that you're worried about, run it under a separate apache with the right user. | 0 | 0 | 0 | 0 | 2009-07-29T17:17:00.000 | 1 | 0 | false | 1,201,785 | 0 | 0 | 1 | 1 | I am integrating "legacy" code with Django, and have problems when the process executing Django must write to legacy code directories where it lacks write permissions. (The legacy code is a Python backend to a Tkinter GUI, which I'm repurposing to a browser-based UI.)
I could:
Make the legacy directory writeable
to a... |
can't see records inserted by django test case | 1,203,393 | 1 | 6 | 1,488 | 0 | python,django,testing,sqlite | The test framework is not saving the data to the database, the data is cleaned once the tests have finished. | 0 | 0 | 0 | 0 | 2009-07-29T21:55:00.000 | 3 | 0.066568 | false | 1,203,295 | 0 | 0 | 1 | 1 | I'm trying to provide integration to my django application from subversion through the post commit hook.
I have a django test case (a subclass of unittest.TestCase) that (a) inserts a couple of records into a table, (b) spawns an svn commit, (c) svn commit runs a hook that uses my django model to look up info.
I'm usin... |
Django .."join" query? | 1,211,756 | -10 | 4 | 5,258 | 0 | python,django | SQL Join queries are a hack because SQL doesn't have objects or navigation among objects.
Objects don't need "joins". Just access the related objects. | 0 | 0 | 0 | 0 | 2009-07-31T04:38:00.000 | 3 | -1 | false | 1,210,711 | 0 | 0 | 1 | 2 | guys, how or where is the "join" query in Django?
i think that Django dont have "join"..but how ill make join?
Thanks |
Django .."join" query? | 1,211,769 | 4 | 4 | 5,258 | 0 | python,django | If you're using models, the select_related method will return the object for any foreign keys you have set up (up to a limit you specify) within that model. | 0 | 0 | 0 | 0 | 2009-07-31T04:38:00.000 | 3 | 1.2 | true | 1,210,711 | 0 | 0 | 1 | 2 | guys, how or where is the "join" query in Django?
i think that Django dont have "join"..but how ill make join?
Thanks |
downloading files to users machine? | 1,211,434 | 2 | 0 | 170 | 0 | python,django,web-applications | Don't do this.
Most files are cached anyway.
But if you really want to add this (because users asked for it), make it optional (default off). | 0 | 0 | 1 | 0 | 2009-07-31T08:47:00.000 | 3 | 0.132549 | false | 1,211,363 | 0 | 0 | 1 | 2 | I am trying to download mp3 file to users machine without his/her consent while they are listening the song.So, next time they visit that web page they would not have to download same mp3, but palypack from the local file. this will save some bandwidth for me and for them. it something pandora used to do but I really d... |
downloading files to users machine? | 1,211,370 | 4 | 0 | 170 | 0 | python,django,web-applications | You can't forcefully download files to a user without his consent. If that was possible you can only imagine what severe security flaw that would be.
You can do one of two things:
count on the browser to cache the media file
serve the media via some 3rd party plugin (Flash, for example) | 0 | 0 | 1 | 0 | 2009-07-31T08:47:00.000 | 3 | 1.2 | true | 1,211,363 | 0 | 0 | 1 | 2 | I am trying to download mp3 file to users machine without his/her consent while they are listening the song.So, next time they visit that web page they would not have to download same mp3, but palypack from the local file. this will save some bandwidth for me and for them. it something pandora used to do but I really d... |
"Connection Reset" error on Django Admin file upload | 19,777,706 | 2 | 2 | 1,962 | 0 | python,django,apache,nginx,centos | The problem is in the max body size
If you are using NGinx, add client_max_body_size 35m
And if you are using Apache you have to increase this size too. | 0 | 0 | 0 | 0 | 2009-07-31T16:05:00.000 | 1 | 0.379949 | false | 1,213,427 | 0 | 0 | 1 | 1 | WheneverI try to upload an mp3 file through a CMS I built with the Django Admin contrib pacakage, the server takes a couple minutes, then gives me a "Connection was reset" error.
I'm running Django on a CentOS server using NGINX which is proxying Apache with mod_wsgi for python. Could this be a server settings issue? |
Remove the "Add" functionality in Django admin | 3,144,134 | 2 | 8 | 6,592 | 0 | python,django,admin | If you change the permissions to restrict access then you'll still get the plus sign by a FK/MtM field. Clicking that will open a popup window with 'Permission Denied' in it.
You can actually completely remove the plus sign by not simply not registering the model with the admin.
I have a situation where I have predefin... | 0 | 0 | 0 | 0 | 2009-08-02T00:51:00.000 | 6 | 0.066568 | false | 1,217,901 | 0 | 0 | 1 | 4 | Is there a way to remove the "Add" functionality on the Django admin site? For certain entities, I only want the Django admin to be able to view them or change existing ones, but not add new ones. |
Remove the "Add" functionality in Django admin | 8,795,993 | 1 | 8 | 6,592 | 0 | python,django,admin | An easy effective way is to set max_num=0 for that particular inline. | 0 | 0 | 0 | 0 | 2009-08-02T00:51:00.000 | 6 | 0.033321 | false | 1,217,901 | 0 | 0 | 1 | 4 | Is there a way to remove the "Add" functionality on the Django admin site? For certain entities, I only want the Django admin to be able to view them or change existing ones, but not add new ones. |
Remove the "Add" functionality in Django admin | 1,218,080 | 3 | 8 | 6,592 | 0 | python,django,admin | You can customize the permission for each user group from within the admin interface: try going to /admin/auth/group and it should be straightforward from there.
This won't be as granular as the solution offered by the earlier answer, but it will take care of most of your needs without needing to customize the admin. | 0 | 0 | 0 | 0 | 2009-08-02T00:51:00.000 | 6 | 0.099668 | false | 1,217,901 | 0 | 0 | 1 | 4 | Is there a way to remove the "Add" functionality on the Django admin site? For certain entities, I only want the Django admin to be able to view them or change existing ones, but not add new ones. |
Remove the "Add" functionality in Django admin | 13,954,260 | 0 | 8 | 6,592 | 0 | python,django,admin | Satya's suggestion of setting max_num=0 works perfectly.
Per the Django docs on the ModelForm class:
For users with JavaScript-enabled browsers, an "Add another" link is provided to enable any number of additional inlines to be added in addition to those provided as a result of the extra argument.
The dynamic link wi... | 0 | 0 | 0 | 0 | 2009-08-02T00:51:00.000 | 6 | 0 | false | 1,217,901 | 0 | 0 | 1 | 4 | Is there a way to remove the "Add" functionality on the Django admin site? For certain entities, I only want the Django admin to be able to view them or change existing ones, but not add new ones. |
Two parter: Django book recommendation + Django real world advice | 1,242,238 | 5 | 16 | 3,014 | 0 | python,django | The single greatest thing you can do to make your life with Django better is -Learn Python-
I have watched people inundate the mailing lists and IRC with problems directly related to their lack of language knowledge. I am not even talking about hard concepts, but rather things like this example interaction:
User: How ... | 0 | 0 | 0 | 0 | 2009-08-04T21:47:00.000 | 9 | 0.110656 | false | 1,230,089 | 0 | 0 | 1 | 2 | First question:
What is your favorite Django book or online learning material? CodeProject examples + Django documentation, O'Reilly, etc.
Second Question: What are some good tips and advice you have picked up along the way which helps you to use Django more effectively? Certain design patterns, language idioms, fra... |
Two parter: Django book recommendation + Django real world advice | 1,242,465 | 1 | 16 | 3,014 | 0 | python,django | I Just finished the Practical Django Projects (for version 1.1)as mentioned in piquadrat, Travis' and Alasdairs' answers. I had a lot of aha moments and many more I'll need to get back to that again to fully digest moments.
When James Bennet, the author gets the code samples into the Mercurial repository on BitBucket i... | 0 | 0 | 0 | 0 | 2009-08-04T21:47:00.000 | 9 | 0.022219 | false | 1,230,089 | 0 | 0 | 1 | 2 | First question:
What is your favorite Django book or online learning material? CodeProject examples + Django documentation, O'Reilly, etc.
Second Question: What are some good tips and advice you have picked up along the way which helps you to use Django more effectively? Certain design patterns, language idioms, fra... |
Does Django have a built in way of getting the last app url the current user visited? | 1,230,419 | 0 | 0 | 747 | 0 | python,django | you can just write a middleware that does exactly that, no need to repeat logging code on every view function. | 0 | 0 | 0 | 0 | 2009-08-04T23:17:00.000 | 2 | 0 | false | 1,230,392 | 0 | 0 | 1 | 1 | I was hoping that Django had a built in way of getting the last url that was visited in the app itself. As I write this I realize that there are some complications in doing something like that (excluding pages that redirect, for example) but i thought I'd give it a shot.
if there isn't a built-in for this, what stra... |
new django app's from 1.1 causing 500 error | 1,252,372 | 1 | 0 | 301 | 0 | python,django,centos | Didn't we solve this for you in IRC the other day? If not, there was someone with the same OS and vague problem description.
Turned out to be a third-party app causing the problem, not the newly added one (which a review of the trackback proved if read carefully) | 0 | 0 | 0 | 0 | 2009-08-05T21:10:00.000 | 2 | 1.2 | true | 1,235,777 | 0 | 0 | 1 | 1 | i'm running on wsgi on centos 5...
i've recently updated locally from 1.0 to 1.1
I updated the server using svn update
now when I apply a new app developed locally to the server it returns with a 500 error.
all i'm doing is python manage.py startapp appname
adding the app into installed_apps in the settings file and ... |
How do I see stdout when running Django tests? | 1,239,545 | 46 | 54 | 33,876 | 0 | python,django,debugging,testing,stdout | Checked TEST_RUNNER in settings.py, it's using a project-specific runner that calls out to Nose. Nose has the -s option to stop it from capturing stdout, but if I run:
./manage.py test -s
manage.py captures it first and throws a "no such option" error. The help for manage.py doesn't mention this, but I found that if I ... | 0 | 0 | 0 | 0 | 2009-08-05T23:34:00.000 | 5 | 1.2 | true | 1,236,285 | 0 | 0 | 1 | 2 | When I run tests with ./manage.py test, whatever I send to the standard output through print doesn't show. When tests fail, I see an "stdout" block per failed test, so I guess Django traps it (but doesn't show it when tests pass). |
How do I see stdout when running Django tests? | 1,236,326 | 4 | 54 | 33,876 | 0 | python,django,debugging,testing,stdout | You probably have some intermediate test runner, such as Nose, intercepting and storing stdout. Try either running the Django tests directly, or write to stderr instead. | 0 | 0 | 0 | 0 | 2009-08-05T23:34:00.000 | 5 | 0.158649 | false | 1,236,285 | 0 | 0 | 1 | 2 | When I run tests with ./manage.py test, whatever I send to the standard output through print doesn't show. When tests fail, I see an "stdout" block per failed test, so I guess Django traps it (but doesn't show it when tests pass). |
Cron job python Google App Engine | 1,237,224 | 0 | 0 | 1,453 | 0 | python,google-app-engine,cron,scheduled-tasks | "fetch" your OWN url (on appspot.com probably, but, who cares -- use a relative url anywau1-), not google.com, the homepage of the search engine -- what's that got to do w/your app anyway?!-)... | 0 | 1 | 0 | 0 | 2009-08-06T05:32:00.000 | 1 | 0 | false | 1,237,126 | 0 | 0 | 1 | 1 | I want to add a scheduled task to fetch a URL via cron job using google app engine. I am continuously getting a failure. I am just fetching www.google.com. Why is the url fetch failing? Am I missing something? |
Choose the filename of an uploaded file with Django | 1,237,762 | -1 | 8 | 7,557 | 0 | python,django,django-models | My initial instinct when reading this was that you need to overload the save method on the model, and use the os.rename() method, but that causes a lot of overhead, and is just generally a hassle from start to finish. If you simply want to rename the file, but don't want to make any physical changes to it (resizing, du... | 0 | 0 | 0 | 0 | 2009-08-06T08:26:00.000 | 2 | -0.099668 | false | 1,237,602 | 0 | 0 | 1 | 1 | I'm uploading images (represented by a FileField) and I need to rename those files when they are uploaded.
I want them to be formated like that:
"%d-%d-%s.%s" % (width, height, md5hash, original_extension)
I've read the documentation but I don't know if I need to write my own FileSystemStorage class or my own FileField... |
django binary (no source code) deployment | 1,248,531 | 14 | 14 | 7,256 | 0 | python,django,binary | Oh, again that old one... Simply stated, you can't deploy an application in a non-compiled language (Python, Perl, PHP, Ruby...) in a source-safe way - all existing tricks are extremely easy to circumvent. Anyway, that doesn't matter at all: the contract you have with your customer does. Even for Java there are neat d... | 0 | 0 | 0 | 0 | 2009-08-06T22:11:00.000 | 3 | 1 | false | 1,241,813 | 0 | 0 | 1 | 2 | is there possible only to deploy binary version of web application based on django , no source code publish?
Thanks |
django binary (no source code) deployment | 1,248,511 | 3 | 14 | 7,256 | 0 | python,django,binary | No, there isn't a reliable to do this at the moment. Even compiled code like referenced in the answer above this one isn't 100% secure.
My advice: clean open code for your clients and a good relation with them is the only way to go. Keeping your code hidden can be good from a business point of view but from a client re... | 0 | 0 | 0 | 0 | 2009-08-06T22:11:00.000 | 3 | 0.197375 | false | 1,241,813 | 0 | 0 | 1 | 2 | is there possible only to deploy binary version of web application based on django , no source code publish?
Thanks |
Python library for converting files to MP3 and setting their quality | 1,334,217 | 2 | 21 | 51,200 | 0 | python,audio,compression | You may use ctypes module to call functions directly from dynamic libraries. It doesn't require you to install external Python libs and it has better performance than command line tools, but it's usually harder to implement (plus of course you need to provide external library). | 0 | 0 | 1 | 0 | 2009-08-07T17:51:00.000 | 6 | 0.066568 | false | 1,246,131 | 0 | 0 | 1 | 2 | I'm trying to find a Python library that would take an audio file (e.g. .ogg, .wav) and convert it into mp3 for playback on a webpage.
Also, any thoughts on setting its quality for playback would be great.
Thank you. |
Python library for converting files to MP3 and setting their quality | 1,246,816 | 1 | 21 | 51,200 | 0 | python,audio,compression | Another option to avoid installing Python modules for this simple task would be to just exec "lame" or other command line encoder from the Python script (with the popen module.) | 0 | 0 | 1 | 0 | 2009-08-07T17:51:00.000 | 6 | 0.033321 | false | 1,246,131 | 0 | 0 | 1 | 2 | I'm trying to find a Python library that would take an audio file (e.g. .ogg, .wav) and convert it into mp3 for playback on a webpage.
Also, any thoughts on setting its quality for playback would be great.
Thank you. |
django extreme slowness | 1,247,506 | 0 | 2 | 3,386 | 0 | python,django | Then I thought it might be a DNS
issue, but the site loads instantly
when served with Apache2.
How are you serving your Django site? I presume you're running mod_python on Apache2?
You may want to start by running an Apache2 locally on you computer (use MAMP or WAMP and install mod_python there) and seeing if it'... | 0 | 0 | 0 | 0 | 2009-08-07T23:47:00.000 | 4 | 0 | false | 1,247,501 | 0 | 0 | 1 | 3 | I have a slowness problem with Django and I can't find the source .. I'm not sure what I'm doing wrong, but at least twice while working on projects Django became really slow.
Requests takes age to complete (~15 seconds) and Validating model when starting the development server is also very slow (12+ seconds on a quad ... |
django extreme slowness | 1,247,774 | 0 | 2 | 3,386 | 0 | python,django | I've once used remote edit to develop my Django site. The validating process seem to be very slow too. But, everything else is fine not like yours.
It's come from the webserver can't add/change .pyc in that directory. | 0 | 0 | 0 | 0 | 2009-08-07T23:47:00.000 | 4 | 0 | false | 1,247,501 | 0 | 0 | 1 | 3 | I have a slowness problem with Django and I can't find the source .. I'm not sure what I'm doing wrong, but at least twice while working on projects Django became really slow.
Requests takes age to complete (~15 seconds) and Validating model when starting the development server is also very slow (12+ seconds on a quad ... |
django extreme slowness | 1,248,504 | 0 | 2 | 3,386 | 0 | python,django | If the validating models takes forever don't search for anything else. On a dual core some of my largest enterprise applications (+30 models) take less then a second to validate.
The problem must lie somewhere with your models but without source code it's hard to tell what the problem is.
Kind regards,
Michael
Open Sou... | 0 | 0 | 0 | 0 | 2009-08-07T23:47:00.000 | 4 | 0 | false | 1,247,501 | 0 | 0 | 1 | 3 | I have a slowness problem with Django and I can't find the source .. I'm not sure what I'm doing wrong, but at least twice while working on projects Django became really slow.
Requests takes age to complete (~15 seconds) and Validating model when starting the development server is also very slow (12+ seconds on a quad ... |
Manipulate MP3 programmatically: Muting certain parts? | 5,060,666 | 1 | 5 | 1,648 | 0 | java,python,audio,mp3 | One (somehow pretentious) idea: record a mute (silent) mp3 in bitrate that your mp3 is. Then, copy all the frames from original mp3 up to the point when you want your silence to start. Then, copy as much muted frames you need from your 'silence file'. Then, copy the rest from the original file.
You'll have muted fi... | 0 | 1 | 0 | 0 | 2009-08-08T22:57:00.000 | 4 | 0.049958 | false | 1,250,086 | 0 | 0 | 1 | 1 | I'm trying to write a batch process that can take an MP3 file and mute certain parts of it, ideally in Python or Java.
Take this example: Given a 2 minute MP3, I want to mute the time between 1:20 and 1:30. When saved back to a file, the rest of the MP3 will play normally -- only that portion will be silent.
Any advice... |
Creating alternative login to Google Users for Google app engine | 1,251,369 | 1 | 4 | 928 | 0 | python,google-app-engine,model-view-controller,google-cloud-datastore | If you roll your own user model, you're going to need to do your own session handling as well; the App Engine Users API creates login sessions for you behind the scenes.
Also, while this should be obvious, you shouldn't store the user's password in plaintext; store an SHA-1 hash and compare it to a hash of the user's... | 0 | 1 | 0 | 0 | 2009-08-09T02:46:00.000 | 2 | 0.099668 | false | 1,250,437 | 0 | 0 | 1 | 1 | How does one handle logging in and out/creating users, without using Google Users? I'd like a few more options then just email and password. Is it just a case of making a user model with the fields I need? Is that secure enough?
Alternatively, is there a way to get the user to log in using the Google ID, but without be... |
Has anyone succeeded in using Google App Engine with Python version 2.6? | 1,255,893 | 6 | 9 | 3,409 | 0 | python,google-app-engine | There are a few issues with using Python 2.6 with the SDK, mostly related to the SDK's sandboxing, which is designed to imitate the sandbox limitations in production. Note, of course, that even if you get Python 2.6 running with the SDK, your code will still have to run under 2.5 in production. | 0 | 1 | 0 | 0 | 2009-08-10T09:58:00.000 | 2 | 1 | false | 1,254,028 | 0 | 0 | 1 | 1 | Since Python 2.6 is backward compatible to 2.52 , did anyone succeeded in using it with Google app Engine ( which supports 2.52 officially ).
I know i should try it myself. But i am a python and web-apps new bee and for me installation and configuration is the hardest part while getting started with something new in t... |
Call PHP code from Python | 1,256,684 | 0 | 2 | 3,234 | 0 | php,python | I've done this in the past by serving the PHP portions directly via Apache. You could either put them in with your media files, (/site_media/php/) or if you prefer to use something more lightweight for your media server (like lighttpd), you can set up another portion of the site that goes through apache with PHP enabl... | 0 | 0 | 0 | 1 | 2009-08-10T13:13:00.000 | 3 | 0 | false | 1,254,802 | 0 | 0 | 1 | 1 | I'm trying to integrate an old PHP ad management system into a (Django) Python-based web application. The PHP and the Python code are both installed on the same hosts, PHP is executed by mod_php5 and Python through mod_wsgi, usually.
Now I wonder what's the best way to call this PHP ad management code from within my Py... |
What's Python's equivalent to Java InputStream's available method? | 1,257,332 | 3 | 2 | 2,424 | 0 | java,python,sockets | You've got to tell us what type of object you're working with. I'm assuming you're talking about a socket read. Either you read the socket with blocking or you read without blocking. You can measure how you have just read in a non-blocking read, if you are interested in that. However, it sounds like you are trying ... | 0 | 0 | 0 | 0 | 2009-08-10T21:16:00.000 | 2 | 0.291313 | false | 1,257,264 | 0 | 0 | 1 | 1 | Java's InputStream provides a method named available which returns the number of bytes that can be read without blocking.
How can I achieve this in Python? |
technology recommendation for LAN Dashboard | 1,264,058 | 0 | 1 | 706 | 0 | python,ruby-on-rails,django,dashboard,filemaker | Both of these technologies are certainly mature enough to run Mission Critical applications, you just need to look at the number of big sites already on the internet that are running these technologies, so from that point of view you shouldn't be concerned.
You only need to worry about your learning curve, if you feel ... | 0 | 0 | 0 | 0 | 2009-08-12T01:01:00.000 | 4 | 0 | false | 1,263,756 | 0 | 0 | 1 | 4 | I'm about to start a fairly large project for a mid-sized business
with a lot of integration with other systems (POS, accounting,
website, inventory, purchasing, etc.) The purpose of the system is to
try to reduce current data siloing and give employees role-based
access to the specific data entry and reports they need... |
technology recommendation for LAN Dashboard | 1,265,425 | 0 | 1 | 706 | 0 | python,ruby-on-rails,django,dashboard,filemaker | You could also take a look at ExtJS for the frontend. I've made an ExtJS frontend for a company Dashboard, and using a Django backend managing the URL dispatching, the ORM and the data retrieval (communicating with the frontend with JSON webservices) and users love it, because it's almost as interactive as a local appl... | 0 | 0 | 0 | 0 | 2009-08-12T01:01:00.000 | 4 | 0 | false | 1,263,756 | 0 | 0 | 1 | 4 | I'm about to start a fairly large project for a mid-sized business
with a lot of integration with other systems (POS, accounting,
website, inventory, purchasing, etc.) The purpose of the system is to
try to reduce current data siloing and give employees role-based
access to the specific data entry and reports they need... |
technology recommendation for LAN Dashboard | 1,263,768 | 1 | 1 | 706 | 0 | python,ruby-on-rails,django,dashboard,filemaker | If you're comfortable with a LAMP-style stack with PHP, then there's no reason you can't use either Django or Rails. Both are mature, well documented platforms with active, helpful communities.
Based on what you've described, there's no reason that you can't use either technology. | 0 | 0 | 0 | 0 | 2009-08-12T01:01:00.000 | 4 | 0.049958 | false | 1,263,756 | 0 | 0 | 1 | 4 | I'm about to start a fairly large project for a mid-sized business
with a lot of integration with other systems (POS, accounting,
website, inventory, purchasing, etc.) The purpose of the system is to
try to reduce current data siloing and give employees role-based
access to the specific data entry and reports they need... |
technology recommendation for LAN Dashboard | 1,275,182 | 0 | 1 | 706 | 0 | python,ruby-on-rails,django,dashboard,filemaker | Thank you everyone for your helpful answers! I think they address most of the issues raised by the question. But I think the key to the "final answer" (IMO) rests on the "multiple database" aspect. Railsninja suggested a piece of software he used for a project to extend rails functionality in this manner - thank you... | 0 | 0 | 0 | 0 | 2009-08-12T01:01:00.000 | 4 | 1.2 | true | 1,263,756 | 0 | 0 | 1 | 4 | I'm about to start a fairly large project for a mid-sized business
with a lot of integration with other systems (POS, accounting,
website, inventory, purchasing, etc.) The purpose of the system is to
try to reduce current data siloing and give employees role-based
access to the specific data entry and reports they need... |
How to check the TEMPLATE_DEBUG flag in a django template? | 1,271,873 | 0 | 69 | 31,654 | 0 | python,django,templates | You will need to add the DEBUG flag to your context_processors.
There may not even be an alternative way. At least, none that I know of. | 0 | 0 | 0 | 0 | 2009-08-13T12:25:00.000 | 6 | 0 | false | 1,271,631 | 0 | 0 | 1 | 1 | Do you know if it is possible to know in a django template if the TEMPLATE_DEBUG flag is set?
I would like to disable my google analytics script when I am running my django app on my development machine. Something like a {% if debug %} template tag would be perfect. Unfortunately, I didn't find something like that in t... |
Alternatives to mod_python's CGI handler | 1,272,579 | 2 | 2 | 1,222 | 1 | python,cgi,mod-python | You could always write your own handler, which is the way mod_python is normally intended to be used. You would have to set some HTTP headers (and you could have a look at the publisher handler's source code for inspiration on that), but otherwise I don't think it's much more complicated than what you've been trying to... | 0 | 0 | 0 | 1 | 2009-08-13T14:29:00.000 | 1 | 1.2 | true | 1,272,325 | 0 | 0 | 1 | 1 | I'm looking for the simplest way of using python and SQLAlchemy to produce some XML for a jQuery based HTTP client. Right now I'm using mod_python's CGI handler but I'm unhappy with the fact that I can't persist stuff like the SQLAlchemy session.
The mod_python publisher handler that is apparently capable of persisting... |
Scraping Ajax - Using python | 3,134,226 | 2 | 2 | 4,364 | 0 | python,ajax,screen-scraping | Here is how I would do it: Install Firebug on Firefox, then turn the NET on in firebug and click on the desired link on YouTube. Now see what happens and what pages are requested. Find the one that are responsible for the AJAX part of page. Now you can use urllib or Mechanize to fetch the link. If you CAN pull the same... | 0 | 0 | 1 | 0 | 2009-08-15T03:34:00.000 | 5 | 0.07983 | false | 1,281,075 | 0 | 0 | 1 | 1 | I'm trying to scrap a page in youtube with python which has lot of ajax in it
I've to call the java script each time to get the info. But i'm not really sure how to go about it. I'm using the urllib2 module to open URLs. Any help would be appreciated. |
Entity Framwework-like ORM NOT for .NET | 1,325,558 | 0 | 2 | 433 | 1 | php,python,entity-framework,open-source | I have heard iBattis is good. A few companies fall back to iBattis when their programmer teams are not capable of understanding Hibernate (time issue).
Personally, I still like Linq2Sql. Yes, the first time someone needs to delete and redrag over a table seems like too much work, but it really is not. And the time t... | 0 | 1 | 0 | 0 | 2009-08-16T07:03:00.000 | 3 | 0 | false | 1,283,646 | 0 | 0 | 1 | 1 | What I really like about Entity framework is its drag and drop way of making up the whole model layer of your application. You select the tables, it joins them and you're done. If you update the database scheda, right click -> update and you're done again.
This seems to me miles ahead the competiting ORMs, like the mes... |
Stackless python stopped mod_python/apache from working | 1,284,586 | 2 | 0 | 672 | 1 | python,mod-wsgi,mod-python,stackless,python-stackless | When you install a new version of Python (whether stackless or not) you also need to reinstall all of the third party modules you need -- either from sources, which you say you don't want to do, or from packages built for the new version of Python you've just installed.
So, check the repository from which you installe... | 0 | 0 | 0 | 0 | 2009-08-16T09:14:00.000 | 1 | 1.2 | true | 1,283,856 | 0 | 0 | 1 | 1 | I installed stackless pyton 2.6.2 after reading several sites that said its fully compatible with vanilla python. After installing i found that my django applications do not work any more.
I did reinstall django (1.1) again and now im kind of lost. The error that i get is 500:
Internal Server Error
The server encounter... |
Implement Comet / Server push in Google App Engine in Python | 2,784,805 | 1 | 25 | 11,567 | 0 | python,google-app-engine,comet,server-push,channel-api | 30 seconds is more than enough; either way you should return a no-op message when a time passed and no new events occur.
This prevents client timeouts and is done by everybody who does comet.
Just send the request, and on the server make it wait until an event or timeout after 25 seconds. | 0 | 1 | 0 | 0 | 2009-08-16T19:34:00.000 | 6 | 0.033321 | false | 1,285,150 | 0 | 0 | 1 | 4 | How can I implement Comet / Server push in Google App Engine in Python? |
Implement Comet / Server push in Google App Engine in Python | 3,918,651 | 0 | 25 | 11,567 | 0 | python,google-app-engine,comet,server-push,channel-api | Looking inside the App Engine 1.3.8-pre release, I see the Channel API service stub and more code. So it looks like we can start trying it out locally. | 0 | 1 | 0 | 0 | 2009-08-16T19:34:00.000 | 6 | 0 | false | 1,285,150 | 0 | 0 | 1 | 4 | How can I implement Comet / Server push in Google App Engine in Python? |
Implement Comet / Server push in Google App Engine in Python | 1,285,251 | 3 | 25 | 11,567 | 0 | python,google-app-engine,comet,server-push,channel-api | At this time, I would rule out doing Comet in App Engine (any language). Comet is based on long-lived HTTP connections, and App Engine will time out any single connection in about 30 seconds or so at most; it's hard to conceive of a worse match! | 0 | 1 | 0 | 0 | 2009-08-16T19:34:00.000 | 6 | 0.099668 | false | 1,285,150 | 0 | 0 | 1 | 4 | How can I implement Comet / Server push in Google App Engine in Python? |
Implement Comet / Server push in Google App Engine in Python | 4,480,891 | 0 | 25 | 11,567 | 0 | python,google-app-engine,comet,server-push,channel-api | Google App Engine supports server push using the Channel API since 2nd December. | 0 | 1 | 0 | 0 | 2009-08-16T19:34:00.000 | 6 | 0 | false | 1,285,150 | 0 | 0 | 1 | 4 | How can I implement Comet / Server push in Google App Engine in Python? |
Where can i get technical information on how the internals of Django works? | 1,286,187 | 1 | 8 | 1,249 | 0 | python,django | I doubt there are technical manuals on the subject. It might take a bit of digging, but the API documentation and the source code are your best bets for reliable, up-to-date information. | 0 | 0 | 0 | 0 | 2009-08-17T04:38:00.000 | 6 | 0.033321 | false | 1,286,176 | 0 | 0 | 1 | 2 | Where can i get the technical manuals/details of how django internals work, i.e. i would like to know when a request comes in from a client;
which django function receives it?
what middleware get called?
how is the request object created? and what class/function creates it?
What function maps the request to the nece... |
Where can i get technical information on how the internals of Django works? | 1,286,186 | 12 | 8 | 1,249 | 0 | python,django | "Use the source, Luke." The beauty of open source software is that you can view (and modify) the code yourself. | 0 | 0 | 0 | 0 | 2009-08-17T04:38:00.000 | 6 | 1 | false | 1,286,176 | 0 | 0 | 1 | 2 | Where can i get the technical manuals/details of how django internals work, i.e. i would like to know when a request comes in from a client;
which django function receives it?
what middleware get called?
how is the request object created? and what class/function creates it?
What function maps the request to the nece... |
Web Application Frameworks: C++ vs Python | 1,475,164 | 0 | 12 | 10,487 | 0 | c++,python,wt | Having looked several ones, like django, pylos, web2py, wt. My recommendation is web2py. It's a python version of "ruby on rails" and easy to learn. | 1 | 0 | 0 | 0 | 2009-08-17T19:33:00.000 | 7 | 0 | false | 1,289,941 | 0 | 0 | 1 | 2 | I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development.
Some things I'm looking for:
It has to be intuitive. I recognize that Wt exists and it follows the model of Qt. ... |
Web Application Frameworks: C++ vs Python | 1,290,620 | 1 | 12 | 10,487 | 0 | c++,python,wt | I think you better go firt python in your case, meanwhile you can extend cppCMS functionalities and write your own framework arround it.
wt was a good idea design, but somehow not that suitable. | 1 | 0 | 0 | 0 | 2009-08-17T19:33:00.000 | 7 | 0.028564 | false | 1,289,941 | 0 | 0 | 1 | 2 | I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development.
Some things I'm looking for:
It has to be intuitive. I recognize that Wt exists and it follows the model of Qt. ... |
Django Admin Inline Change List | 1,330,208 | 3 | 7 | 2,622 | 0 | python,django,django-admin | There's no such functionality built in, but I don't think it would be hard to create your own AdminInline subclass (and an accompanying template for it) that would do this. Just model it off TabularInline, but display fields' data directly instead of rendering form fields. | 0 | 0 | 0 | 0 | 2009-08-17T21:10:00.000 | 2 | 0.291313 | false | 1,290,470 | 0 | 0 | 1 | 1 | I can edit a parent child relationship using the TablularInline and StackedInline classes, however I would prefer to list the child relationships as a change list as there is a lot of information and the forms are too big. Is there an inline change list available in DJango admin or a way or creating one? |
How can I tell whether my Django application is running on development server or not? | 1,291,769 | 2 | 59 | 26,741 | 0 | python,django,wsgi | settings.DEBUG could be True and running under Apache or some other non-development server. It will still run. As far as I can tell, there is nothing in the run-time environment short of examining the pid and comparing to pids in the OS that will give you this information. | 0 | 0 | 0 | 0 | 2009-08-18T04:10:00.000 | 13 | 0.03076 | false | 1,291,755 | 0 | 0 | 1 | 1 | How can I be certain that my application is running on development server or not? I suppose I could check value of settings.DEBUG and assume if DEBUG is True then it's running on development server, but I'd prefer to know for sure than relying on convention. |
how to register more than 10 apps in Google App Engine | 1,294,678 | 3 | 14 | 1,877 | 0 | python,google-app-engine,registration | Call or write to Google! Google's policies are very exact and very strict, because they are catering to thousands of developers, and thus need those standards and uniformity. But if you have a good reason for needing more than 10, and you can get a real person at the end of a telephone line, I'd think you'd have a good... | 0 | 1 | 0 | 0 | 2009-08-18T15:25:00.000 | 1 | 0.53705 | false | 1,294,618 | 0 | 0 | 1 | 1 | Anyone knows any "legal" way to surpass the 10-app-limit Google imposes?
I wouldn't mind to pay, or anything, but I wasn't able to find a way to have more
than 10 apps and can't either remove one. |
Apache/Django freezing after a few requests | 2,368,542 | 0 | 1 | 435 | 1 | python,django,postgresql,apache2,mod-wsgi | Found it! I'm using eventlet in some other code and I imported one of my modules into a django model. So eventlet was taking over and putting everything to "sleep". | 0 | 0 | 0 | 0 | 2009-08-19T14:09:00.000 | 2 | 1.2 | true | 1,300,213 | 0 | 0 | 1 | 1 | I'm running Django through mod_wsgi and Apache (2.2.8) on Ubuntu 8.04.
I've been running Django on this setup for about 6 months without any problems. Yesterday, I moved my database (postgres 8.3) to its own server, and my Django site started refusing to load (the browser spinner would just keep spinning).
It works fo... |
mod_python problem? | 1,301,029 | 0 | 0 | 192 | 1 | python,sqlalchemy,mod-python | Not that I've ever heard of, but it's impossible to tell without some code to look at.
Maybe you initialised your result set list as a global, or shared member, and then appended results to it when the application was called without resetting it to empty? A classic way of re-using lists accidentally is to put one in a ... | 0 | 0 | 0 | 0 | 2009-08-19T16:08:00.000 | 2 | 1.2 | true | 1,301,000 | 0 | 0 | 1 | 1 | I have been working on a website using mod_python, python, and SQL Alchemy when I ran into a strange problem: When I query the database for all of the records, it returns the correct result set; however, when I refresh the page, it returns me a result set with that same result set appended to it. I get more result sets... |
Why is Standard Input is not displayed as I type in Mac OS X Terminal application? | 2,623,452 | 25 | 11 | 2,868 | 0 | python,django,macos,shell,terminal | Maybe this is because there was an error while running Django. Sometimes it happens that the std input disappears because stty was used. You can manually hide your input by typing:
$ stty -echo
Now you won't see what you typed. To restore this and solve your problem just type
$ stty echo
This could help. | 0 | 1 | 0 | 0 | 2009-08-19T18:44:00.000 | 3 | 1 | false | 1,301,887 | 0 | 0 | 1 | 2 | I'm confused by some behavior of my Mac OS X Terminal and my Django manage.py shell and pdb.
When I start a new terminal, the Standard Input is displayed as I type. However, if there is an error, suddenly Standard Input does not appear on the screen. This error continues until I shut down that terminal window.
The Inpu... |
Why is Standard Input is not displayed as I type in Mac OS X Terminal application? | 2,018,573 | 3 | 11 | 2,868 | 0 | python,django,macos,shell,terminal | If you exit pdb you can type reset and standard input echo will return. I'm not sure if you can execute something similar within pdb. It will erase what is currently displayed however. | 0 | 1 | 0 | 0 | 2009-08-19T18:44:00.000 | 3 | 0.197375 | false | 1,301,887 | 0 | 0 | 1 | 2 | I'm confused by some behavior of my Mac OS X Terminal and my Django manage.py shell and pdb.
When I start a new terminal, the Standard Input is displayed as I type. However, if there is an error, suddenly Standard Input does not appear on the screen. This error continues until I shut down that terminal window.
The Inpu... |
cutdown uuid further to make short string | 1,302,155 | 3 | 9 | 9,264 | 0 | c#,python,string,uniqueidentifier,uuid | If you are using MS-SQL you should probably just use the uniqueindentifier datatype, it is both compact (16 bytes) and since the SQL engine knows about it it can optimize indexes and queries using it. | 0 | 0 | 0 | 0 | 2009-08-19T19:13:00.000 | 5 | 0.119427 | false | 1,302,057 | 0 | 0 | 1 | 3 | I need to generate unique record id for the given unique string.
I tried using uuid format which seems to be good.
But we feel that is lengthly.
so we need to cutdown the uuid string 9f218a38-12cd-5942-b877-80adc0589315 to smaller. By removing '-' we can save 4 chars. What is the safest part to remove from uuid? We ... |
cutdown uuid further to make short string | 1,302,532 | 2 | 9 | 9,264 | 0 | c#,python,string,uniqueidentifier,uuid | An UUID provides (almost) 128 bits of uniqueness. You may shorten it to 16 binary bytes, or 22 base64-encoded characters. I wouldn't recommend removing any part of a UUID, otherwise, it just loses its sense. UUIDs were designed so that all the 128 bits have meaning. If you want less than that, you should use some other... | 0 | 0 | 0 | 0 | 2009-08-19T19:13:00.000 | 5 | 0.07983 | false | 1,302,057 | 0 | 0 | 1 | 3 | I need to generate unique record id for the given unique string.
I tried using uuid format which seems to be good.
But we feel that is lengthly.
so we need to cutdown the uuid string 9f218a38-12cd-5942-b877-80adc0589315 to smaller. By removing '-' we can save 4 chars. What is the safest part to remove from uuid? We ... |
cutdown uuid further to make short string | 1,302,665 | 2 | 9 | 9,264 | 0 | c#,python,string,uniqueidentifier,uuid | The UUID is 128 bits or 16 bytes. With no encoding, you could get it as low as 16 bytes. UUIDs are commonly written in hexadecimal, making them 32 byte readable strings. With other encodings, you get different results:
base-64 turns 3 8-bit bytes into 4 6-bit characters, so 16 bytes of data becomes 22 characters long
... | 0 | 0 | 0 | 0 | 2009-08-19T19:13:00.000 | 5 | 0.07983 | false | 1,302,057 | 0 | 0 | 1 | 3 | I need to generate unique record id for the given unique string.
I tried using uuid format which seems to be good.
But we feel that is lengthly.
so we need to cutdown the uuid string 9f218a38-12cd-5942-b877-80adc0589315 to smaller. By removing '-' we can save 4 chars. What is the safest part to remove from uuid? We ... |
Lua vs PHP/Python/JSP/etc | 2,008,551 | 1 | 7 | 11,188 | 0 | php,python,web-applications,lua | If it's only the language, then I agree with Norman. If the web development framework is important to you, then you have to consider Ruby because RoR is a very mature framework. I love Python, but there seems to be quite a few frameworks to choose from, none of them is dominant. CherryPy, Django, Pylons, web2py, Zope 2... | 0 | 0 | 0 | 0 | 2009-08-20T00:00:00.000 | 6 | 0.033321 | false | 1,303,270 | 1 | 0 | 1 | 2 | I'm about to begin my next web development project and wanted to hear about the merits of Lua within the web-development space.
How does Lua compare to PHP/Python/JSP/etc.. for web development?
Any reason why Lua would be a poor choice for a web application language vs the others? |
Lua vs PHP/Python/JSP/etc | 1,303,300 | 7 | 7 | 11,188 | 0 | php,python,web-applications,lua | Using Lua for web development is pretty rare...you could do it, but it will be a lot more time consuming than using a language that has matured as a web developing language (PHP) or has good web related libraries (python/ruby/etc.) If you do go with Lua, this means you may end up "recreating the wheel" a lot for what ... | 0 | 0 | 0 | 0 | 2009-08-20T00:00:00.000 | 6 | 1 | false | 1,303,270 | 1 | 0 | 1 | 2 | I'm about to begin my next web development project and wanted to hear about the merits of Lua within the web-development space.
How does Lua compare to PHP/Python/JSP/etc.. for web development?
Any reason why Lua would be a poor choice for a web application language vs the others? |
Threaded Django task doesn't automatically handle transactions or db connections? | 1,346,401 | 111 | 59 | 10,095 | 1 | python,database,django,multithreading,transactions | After weeks of testing and reading the Django source code, I've found the answer to my own question:
Transactions
Django's default autocommit behavior still holds true for my threaded function. However, it states in the Django docs:
As soon as you perform an action that needs to write to the database, Django produces ... | 0 | 0 | 0 | 0 | 2009-08-20T02:26:00.000 | 1 | 1.2 | true | 1,303,654 | 0 | 0 | 1 | 1 | I've got Django set up to run some recurring tasks in their own threads, and I noticed that they were always leaving behind unfinished database connection processes (pgsql "Idle In Transaction").
I looked through the Postgres logs and found that the transactions weren't being completed (no ROLLBACK). I tried using the ... |
User-specific model in Django | 1,304,634 | 0 | 0 | 282 | 0 | python,django,django-models | One way to do this would be to break the Item model up into the parts that are individually assignable to a user. If you have fixed user types (admin, customer, team etc.) who can always see the same set of fields, these parts would be whole groups of fields. If it's very dynamic and you want to be able to set up indiv... | 0 | 0 | 0 | 0 | 2009-08-20T07:50:00.000 | 2 | 0 | false | 1,304,608 | 0 | 0 | 1 | 1 | I have a model containing items, which has many different fields. There is another model which assigns a set of this field to each user using a m2m-relation.
I want to achieve, that in the end, every user has access to a defined set of fields of the item model, and he only sees these field in views, he can only edit th... |
Django - Edit data in db | 37,114,696 | 0 | 0 | 525 | 0 | python,django | You can use Django authenticaion system to create users and giving them permissions to modify the data. | 0 | 0 | 0 | 0 | 2009-08-20T10:13:00.000 | 2 | 0 | false | 1,305,182 | 0 | 0 | 1 | 1 | I have a question regarding editing/saving data in database using Django.
I have template that show data from database. And after each record i have link that link you to edit page.
But now is the question how to edit data in db without using admin panel?
I run thought tutorial in djangobook but i didn't see how to ac... |
How do I programmatically pull lists/arrays of (itunes urls to) apps in the iphone app store? | 1,307,656 | 1 | 0 | 151 | 0 | python,iphone,arrays,google-app-engine,app-store | Unfortunately the only API that seems to be around for Apple's app store is a commercial offering from ABTO; nobody seems to have developed a free one. I'm afraid you'll have to resort to "screen scraping" -- urlget things, use beautifulsoup or the like for interpreting the HTML you get, and be ready to fix breakages w... | 0 | 0 | 0 | 0 | 2009-08-20T16:21:00.000 | 1 | 1.2 | true | 1,307,322 | 0 | 0 | 1 | 1 | I'd like to know how to pragmatically pull lists of apps from the iphone app store. I'd code this in python (via the google app engine) or in an iphone app. My goal would be to select maybe 5 of them and present them to the user. (for instance a top 5 kind of thing, or advanced filtering or queries) |
Do any Python ORMs (SQLAlchemy?) work with Google App Engine? | 11,325,656 | 2 | 11 | 5,333 | 1 | python,google-app-engine,sqlalchemy,orm | Nowadays they do since Google has launched Cloud SQL | 0 | 1 | 0 | 0 | 2009-08-20T19:39:00.000 | 2 | 0.197375 | false | 1,308,376 | 0 | 0 | 1 | 1 | I'd like to use the Python version of App Engine but rather than write my code specifically for the Google Data Store, I'd like to create my models with a generic Python ORM that could be attached to Big Table, or, if I prefer, a regular database at some later time. Is there any Python ORM such as SQLAlchemy that would... |
How to tame the location of third party contributions in Django | 1,309,619 | 0 | 1 | 330 | 0 | python,django | Make sure that site-dependencies, django, registration, sorl, and typogrify all have __init__.py files in them. | 0 | 0 | 0 | 0 | 2009-08-21T00:59:00.000 | 4 | 0 | false | 1,309,606 | 0 | 0 | 1 | 1 | I have a django project which is laid out like this...
myproject
apps
media
templates
django
registration
sorl
typogrify
I'd like to change it to this...
myproject
apps
media
templates
site-deps
django
registration
sorl
typogrify
When I attempt it the 'site-dependencies' all break. Is there a way to imple... |
Django without additional tables? | 1,315,203 | 0 | 1 | 409 | 0 | python,django,database | Just commentize the django app strings of the INSTALLED_APPS tuple in your project settings.py file (at the beginning of the project, before running syncdb). | 0 | 0 | 0 | 0 | 2009-08-21T17:56:00.000 | 5 | 0 | false | 1,313,362 | 0 | 0 | 1 | 3 | is it possible to write Django apps, for example for internal/personal use with existing databases, without having the 'overhead' of Djangos own tables that are usually installed when starting a project? I would like to use existing tables via models, but not have all the other stuff that is surely useful on normal web... |
Django without additional tables? | 1,313,406 | 3 | 1 | 409 | 0 | python,django,database | Django doesn't install any tables by itself. It comes with some pre-fabricated applications, which install tables, but those are easily disabled by removing them from the INSTALLED_APPS setting. | 0 | 0 | 0 | 0 | 2009-08-21T17:56:00.000 | 5 | 0.119427 | false | 1,313,362 | 0 | 0 | 1 | 3 | is it possible to write Django apps, for example for internal/personal use with existing databases, without having the 'overhead' of Djangos own tables that are usually installed when starting a project? I would like to use existing tables via models, but not have all the other stuff that is surely useful on normal web... |
Django without additional tables? | 1,313,575 | 0 | 1 | 409 | 0 | python,django,database | Don't install any of Django's built-in apps and don't use any models.py in your apps. Your database will have zero tables in it.
You won't have users, sites or sessions -- those are Django features that use the database.
AFAIK you should still, however, have a SQLite database. I think that parts of Django assume you'... | 0 | 0 | 0 | 0 | 2009-08-21T17:56:00.000 | 5 | 0 | false | 1,313,362 | 0 | 0 | 1 | 3 | is it possible to write Django apps, for example for internal/personal use with existing databases, without having the 'overhead' of Djangos own tables that are usually installed when starting a project? I would like to use existing tables via models, but not have all the other stuff that is surely useful on normal web... |
Where is the best place to put cache-evicting logic in an AppEngine application? | 1,348,633 | 1 | 2 | 306 | 0 | python,google-app-engine,optimization,caching,memcached | A couple of alternatives to regular eviction:
The obvious one: Don't evict, and set a timer instead. Even a really short one - a few seconds - can cut down on effort a huge amount for a popular app, without users even noticing data may be a few seconds stale.
Instead of evicting, generate the cache key based on criter... | 0 | 1 | 0 | 0 | 2009-08-21T18:44:00.000 | 2 | 0.099668 | false | 1,313,626 | 0 | 0 | 1 | 1 | I've written an application for Google AppEngine, and I'd like to make use of the memcache API to cut down on per-request CPU time. I've profiled the application and found that a large chunk of the CPU time is in template rendering and API calls to the datastore, and after chatting with a co-worker I jumped (perhaps a ... |
How can Django projects be deployed with minimal installation work? | 1,314,005 | 1 | 3 | 1,978 | 1 | python,django | You didn't have to do anything when deploying a PHP site because your hosting provider had already installed it. Web hosts which support Django typically install and configure it for you. | 0 | 0 | 0 | 0 | 2009-08-21T20:11:00.000 | 7 | 0.028564 | false | 1,313,989 | 0 | 0 | 1 | 1 | To deploy a site with Python/Django/MySQL I had to do these on the server (RedHat Linux):
Install MySQLPython
Install ModPython
Install Django (using python setup.py install)
Add some directives on httpd.conf file (or use .htaccess)
But, when I deployed another site with PHP (using CodeIgniter) I had to do nothing. I... |
How to migrate packages to a new Python installation? | 1,315,764 | 1 | 2 | 2,862 | 0 | python,migration,packages | As Vinay says, there are some parts of common installations that can't be just copied over. Also, keep in mind that setup.py scripts can perform arbitrary work, for example, they could test for the version of Python, and change how they install things, or they could write registry entries, or create .rc files, etc.
... | 0 | 0 | 0 | 0 | 2009-08-22T08:38:00.000 | 3 | 0.066568 | false | 1,315,511 | 1 | 0 | 1 | 2 | How can i quickly migrate/copy my python packages that i have installed over time to a new machine?
This is my scenario;
Am upgrading from an old laptop running python2.5 & Django1.0, to a new laptop which i intend to install python 2.6.2 & Django 1.1. In time i have downloaded and installed many python packages in my ... |
How to migrate packages to a new Python installation? | 1,315,529 | 3 | 2 | 2,862 | 0 | python,migration,packages | If they're pure Python, then in theory you could just copy them across from one Lib\site-packages directory to the other. However, this will not work for any packages which include C extensions (as these need to be recompiled anew for every Python version). You also need to consider e.g. .pth files which have been crea... | 0 | 0 | 0 | 0 | 2009-08-22T08:38:00.000 | 3 | 0.197375 | false | 1,315,511 | 1 | 0 | 1 | 2 | How can i quickly migrate/copy my python packages that i have installed over time to a new machine?
This is my scenario;
Am upgrading from an old laptop running python2.5 & Django1.0, to a new laptop which i intend to install python 2.6.2 & Django 1.1. In time i have downloaded and installed many python packages in my ... |
How to submit data of a flash form? [python] | 1,320,103 | 0 | 3 | 458 | 0 | python,flash,forms | For your flash app, there's no difference if the backend is python, php or anything, so you can follow a normal "php + flash contact form" guide and then build the backend using django or any other python web framework, receive the information from the http request (GET or POST, probably the last one) and do whatever y... | 0 | 0 | 0 | 0 | 2009-08-23T23:42:00.000 | 2 | 0 | false | 1,319,895 | 0 | 0 | 1 | 2 | I would like to know if it is possible to submit a flash form from python and, if it is, how?
I have done form submitting from python before, but the forms were HTML not flash. I really have no idea on how to do this. In my research about this I kept getting 'Ming'. However, Ming is only to create .swf files and that's... |
How to submit data of a flash form? [python] | 1,319,907 | 1 | 3 | 458 | 0 | python,flash,forms | You can set the url attribute (I think it's url, please correct me if I'm wrong) on a Flash form control to a Python script - then it will pass it through HTTP POST like any normal HTML form.
You've got nothing to be afraid of, it uses the same protocol to communicate, it's just a different submission process. | 0 | 0 | 0 | 0 | 2009-08-23T23:42:00.000 | 2 | 1.2 | true | 1,319,895 | 0 | 0 | 1 | 2 | I would like to know if it is possible to submit a flash form from python and, if it is, how?
I have done form submitting from python before, but the forms were HTML not flash. I really have no idea on how to do this. In my research about this I kept getting 'Ming'. However, Ming is only to create .swf files and that's... |
Django Admin - Bulk editing data? | 1,322,450 | -1 | 4 | 6,630 | 0 | python,django,django-models,django-admin | You have SQL. You can write SQL UPDATE statements.
You have Python for writing batch scripts that interact with the Django ORM. This works really, really well for bulk changes. | 0 | 0 | 0 | 0 | 2009-08-24T13:30:00.000 | 3 | -0.066568 | false | 1,322,425 | 0 | 0 | 1 | 1 | Are there any admin extensions to let bulk editing data in Django Admin? (ie. Changing the picture fields of all product models at once. Note that this is needed for a users POV so scripting doesn't count.) Any thoughts on subject welcome. |
What is the fastest template system for Python? | 1,698,458 | 3 | 53 | 30,594 | 0 | python,django-templates,template-engine,mako,jinja2 | If you can throw caching in the mix (like memcached) then choose based on features and ease of use rather than optimization.
I use Mako because I like the syntax and features. Fortunately it is one of the fastest as well. | 0 | 0 | 0 | 0 | 2009-08-24T19:28:00.000 | 5 | 0.119427 | false | 1,324,238 | 0 | 0 | 1 | 3 | Jinja2 and Mako are both apparently pretty fast.
How do these compare to (the less featured but probably good enough for what I'm doing) string.Template ? |
What is the fastest template system for Python? | 1,324,515 | 1 | 53 | 30,594 | 0 | python,django-templates,template-engine,mako,jinja2 | In general you will have to do profiling to answer that question, as it depends on how you use the templates and what for.
string.Template is the fastest, but so primitive it can hardly be called a template in the same breath as the other templating systems, as it only does string replacements, and has no conditions or... | 0 | 0 | 0 | 0 | 2009-08-24T19:28:00.000 | 5 | 0.039979 | false | 1,324,238 | 0 | 0 | 1 | 3 | Jinja2 and Mako are both apparently pretty fast.
How do these compare to (the less featured but probably good enough for what I'm doing) string.Template ? |
What is the fastest template system for Python? | 1,325,478 | -4 | 53 | 30,594 | 0 | python,django-templates,template-engine,mako,jinja2 | I think Cheetah might be the fastest, as it's implemented in C. | 0 | 0 | 0 | 0 | 2009-08-24T19:28:00.000 | 5 | -1 | false | 1,324,238 | 0 | 0 | 1 | 3 | Jinja2 and Mako are both apparently pretty fast.
How do these compare to (the less featured but probably good enough for what I'm doing) string.Template ? |
How can I access the iphone / ipod clipboard using python? | 1,333,976 | 0 | 1 | 994 | 0 | iphone,python,clipboard,ipod-touch | Sorry no, I'm assuming since you mention python that this is a web-based application? If so there is no way you can put something into/take something out of the user's clipboard automatically. However if it is webbased the user will be able to select any text/image and copy to paste elsewhere. | 0 | 0 | 0 | 0 | 2009-08-26T07:08:00.000 | 1 | 0 | false | 1,332,846 | 0 | 0 | 1 | 1 | I want to modify a python application written for the ipod/iphone.
It should copy a string into the clipboard so that I can use it in another application.
Is it possible to access the iphone clipboard using python?
Thanks in advance.
UPDATE:
Thanks for replying.
A bit of background: The python program is a vocabulary p... |
Renaming a HTML file with Python | 1,332,899 | 0 | 0 | 531 | 0 | python,html | If you rename the folder, I'm not sure how you can get around parsing the .htm file and replacing instances of _files with the new suffix. Perhaps you can use a folder alias (shortcut?) but then that's not a very clean solution. | 0 | 0 | 0 | 0 | 2009-08-26T07:15:00.000 | 3 | 0 | false | 1,332,876 | 0 | 0 | 1 | 1 | A bit of background:
When I save a web page from e.g. IE8 as "webpage, complete", the images and such that the page contains are placed in a subfolder with the postfix "_files". This convention allows Windows to synchronize the .htm file and the accompanying folder.
Now, in order to keep the synchronization intact, whe... |
Can I write Python applications using PyObjC that target NON-jailbroken iPhones? | 1,338,105 | 1 | 3 | 653 | 0 | iphone,python,pyobjc | No: it's Apple's deliberate policy decision (no doubt with some technical underpinnings) to not support interpreters/runtimes on iPhone for most languages -- ObjC (and Javascript within Safari) is what Apple wants you to use, not Python, Java, Ruby, and so forth. | 0 | 0 | 0 | 0 | 2009-08-26T23:18:00.000 | 2 | 1.2 | true | 1,338,095 | 1 | 0 | 1 | 2 | Is it currently possible to compile Python and PyObjC for the iPhone such that AppStore applications can written in Python?
If not, is this a purely technical issue or a deliberate policy decision by Apple? |
Can I write Python applications using PyObjC that target NON-jailbroken iPhones? | 1,338,097 | 0 | 3 | 653 | 0 | iphone,python,pyobjc | no, apple strictly forbids running any kind of interpreter on iphone, and it is completely policy issue. | 0 | 0 | 0 | 0 | 2009-08-26T23:18:00.000 | 2 | 0 | false | 1,338,095 | 1 | 0 | 1 | 2 | Is it currently possible to compile Python and PyObjC for the iPhone such that AppStore applications can written in Python?
If not, is this a purely technical issue or a deliberate policy decision by Apple? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.