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 at the start of a session or when the server first starts up.
Seeding once at the start of the session would probably make the most sense, IMO. This way the user will get a set of pseudo-random numbers throughout their session. If you seed every time a page is served, they aren't guaranteed this.
| 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 the same outcomes.
| 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 pieces. You don't have to actually reuse them. Just think about them as potentially reusable.
Consider your upgrade paths and decompose applications that you might want to replace some day. You don't have to actually replace them, but you can consider them as a stand-alone "module" of programming that might get replaced with something cooler in the future.
We have about a dozen applications, each model.py is no more than about 400 lines of code. They're all pretty focused on less than about half-dozen discrete class definitions. (These aren't hard limits, they're observations about our code.)
We decompose early and often.
| 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 the models just to keep the file small is a bad idea. If the logic is best in the model, that's where it really should go regardless of file size.
So is there a simple way to just use includes? In PHP-speak, I'd like to propose to the supervisor that we just have models.py include() the model classes from other places. Conceptually, this would allow the models to have all the logic we want, yet keep file size down via increasing the number of files (which leads to less revision control problems like conflicts, etc.).
So, is there a simple way to remove model classes from the models.py file, but still have the models work with all of the Django tools? Or, is there a completely different yet elegant solution to the general problem of a "large" models.py file? Any input would be appreciated.
|
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, there are cases where an attending physician of one patient can be the primary of another. Lastly, both attending and primary are often the same.
At first, I was thinking two foreign keys from the patient table into the physician table. However, I think django disallows this. Additionally, on second thought, this is really a many(two)-to-many relationship.
Therefore, how can I model this relationship with django while maintaining the physician type as it pertains to a patient? Perhaps I will need to store the physician type on the many-to-many association table?
Thanks,
Pete
|
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 architecture is going to dominate how the application scales regardless of which of the three languages.
If you need memory caching you're going to at least use memcached (or something similar which will interface with all three languages). Maybe you help your scalability using nginx to serve directly from memcache, but that's obviously not going to change the performance of php/perl/python/ruby.
If you use MySQL or Postgresql you're still going to have to design your database correctly for scaling regardless of your app language, and any tool you use to start clustering / mirroring is going to be outside of your app.
I think in terms of memory usage Python (with mod_wsgi daemon mode) and Ruby (enterprise ruby with passenger/mod_rack) have pretty decent footprints at least comparable to PHP under fcgi and probably better than PHP under mod_php (i.e. apache MPM prefork + php in all the apache processes sucks a lot of memory).
Where this question might be interesting is trying to compare those 3 languages vs. something like Erlang where you (supposedly) have cheap built-in scalability automatically in all Erlang processes, but even then you'll have a RDBMS database bottleneck unless your app nicely fits into one of the Erlang database ways of doing things, e.g. couchdb.
| 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 (PHP, Python) assuming a large app with 1 million visits per month?
This is something I get asked a lot. I can explain to people that "Rails does scale pretty well" but in the long run, what are the economics?
If somebody can provide some metrics, that'd be great.
|
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), and not on the framework - except that some data mapping library may make inefficient use of SQL.
For the pure "number of visits" parameter, the question really is how fast your HTML templating system works. So the question is: how many pages can you render per second? I would make this the primary metrics to determine how good a system would scale.
Of course, different pages may have different costs; for some, you can use caching, but not for others. So in measuring scalability, split your 1 million visits into cheap and expensive pages, and measure them separately. Together, they should give a good estimate of the load your system can take (or the number of systems you need to satisfy demand).
There is also the issue of memory usage. If you have the data in SQL, this shouldn't matter - but with caching, you may also need to consider scalability wrt. main memory usage.
| 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 (PHP, Python) assuming a large app with 1 million visits per month?
This is something I get asked a lot. I can explain to people that "Rails does scale pretty well" but in the long run, what are the economics?
If somebody can provide some metrics, that'd be great.
|
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 systems.
Edit
Putting all the information in answer for correctness.
|
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 to be careful when updating to latest revision.
You could for example set up a new virtual environment to test, before updating the live site. There are many ways to do something simelar, but I will let you take your pick.
| 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 systems.
Edit
Putting all the information in answer for correctness.
|
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 the account to access the server you can connect.
Heres a quick test. From the system you are using to connect to your SQL Server with, can you open the SQL Server management studio and connect to the remote database. If you can, tell me what settings you needed to do that, and I'll give you a connection string that will work.
| 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 server.
So, I still VPN'd to their domain, but when I was using the ADO.net connection string to connect to their database, it does not work.
connection string:
Data Source=xx.xx.xx.xx;Initial Catalog=;User ID=;Password=;
and the error says:
login failed for
Well, one thing to notice is: when i remote into their server, I provide username and password once. Then when i log on to SQL Server, I dont have to provide username and password. It s windows authenticated. So, in the above connection string, I used the same username and password that I use while remoting in. I hope this gives an idea to ya'll what i might be missing.
Help appreciated!!!
|
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 think you take out the first part which includes provider info.
| 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 server.
So, I still VPN'd to their domain, but when I was using the ADO.net connection string to connect to their database, it does not work.
connection string:
Data Source=xx.xx.xx.xx;Initial Catalog=;User ID=;Password=;
and the error says:
login failed for
Well, one thing to notice is: when i remote into their server, I provide username and password once. Then when i log on to SQL Server, I dont have to provide username and password. It s windows authenticated. So, in the above connection string, I used the same username and password that I use while remoting in. I hope this gives an idea to ya'll what i might be missing.
Help appreciated!!!
|
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 does first]. The advantage of the field is that you can specify the sizing rather than giving the freedom to the designer in the template level [and making it easier for an admin thumbnail].
Both ways work, you get to decide which works best for you.
| 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 ImageWithThumbnailsField at the top in my models.py, added image = ImageWithThumbnailsField(upload to="images/", thumbnail={'size':(80, 80)}) as one of my model fields, passed the model through my view to the template, and in the template added {% load thumbnail %} at the top and put in the variable {{ mymodel.image.thumbnail_tag }} in there too.
But from what I understood is that when I upload an image through the admin, it would create the thumbnail straight away, but it only actually creates in when I see my template in the browser? Is this correct? The thumbnail shows fine, it looks great in fact, but I thought that adding the model field part of it would create the thumbnail instantly once the image has uploaded? ...Why not just use the models.ImageField in my model instead?
...or have I done this all OK and I've just got the way it works wrong?
|
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 ImageWithThumbnailsField at the top in my models.py, added image = ImageWithThumbnailsField(upload to="images/", thumbnail={'size':(80, 80)}) as one of my model fields, passed the model through my view to the template, and in the template added {% load thumbnail %} at the top and put in the variable {{ mymodel.image.thumbnail_tag }} in there too.
But from what I understood is that when I upload an image through the admin, it would create the thumbnail straight away, but it only actually creates in when I see my template in the browser? Is this correct? The thumbnail shows fine, it looks great in fact, but I thought that adding the model field part of it would create the thumbnail instantly once the image has uploaded? ...Why not just use the models.ImageField in my model instead?
...or have I done this all OK and I've just got the way it works wrong?
|
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 pylons, implement URLs of the form /job/ID or /job?id=ID. That will look into the database whether the job is completed or not, and merge the temporary output into the page.
(*) It might be better for the subprocess to create another process immediately, and have the pylons process wait for the first child, so that there will be no zombie processes.
| 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 questions regarding how to accomplish this while taking advantage of the Pylons framework:
What is the best way to launch a background process such as this with a Pylons controller?
What is the best way to get the output of the background process back to the user? (Should I store the output in a database, in session data, etc.?)
Edit:
The problem is if I launch a command using subprocess in a controller, the controller waits for the subprocess to finish before continuing, showing the user a blank page that is just loading until the process is complete. I want to be able to redirect the user to a status page immediately after starting the subprocess, allowing it to complete on its own.
|
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 definitely would need somehow ensure all file names are unique, but this task is trivial, since you can just check, if the file already exists on the disk and if it does, add some number to its name and check again and so on.
Don't store them all in one directory either, since filesystem can perform much worse if there are A LOT (~ 1 million) files in the single directory, so you can structure your storage like this:
FILE_DIR/YEAR/MONTH/FileID.html and store the "YEAR/MONTH/FileID" Part in the database as a unique ID for the file.
Of course, if you don't worry about performance (not many users, for example) you can just go with storing everything in the database, which is much easier to manage.
| 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 the most practical way would be of storing the file(s) or the code? SQLite? Straight up flat files?
One other thing I'm worried about is the uniqueness of the files, obviously I don't want conflicting filenames ( maybe save using 'title' and timestamp? ) - how should I structure it?
|
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 counterpart (python-gwt-rpc is out of date). I just tried using JSON and RequestBuilder, but that fails when using SSL. Does anyone have a good solution for putting a GWT frontend on a python appengine app?
|
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 middleware of the module you are running, then maybe go on and use something like Django.
| 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 (but then again, Jython isn't that fast either, relative to regular Java code), but it is an extremely flexible solution.
| 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 code using other languages.
Thanks in advance.
Regards,
Ukrania
|
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 all, but this seems like bad
practice.
Find the userid of the Django
execution process, assign that to a
group and give that group write
permissions to the whole legacy
directory. (I suspect this is the
user running apache.) This too seems
bad -- if that user is
compromised,the whole directory is at
risk.
Isolate the "write" calls in the
code, ensure they all go somewhere in
a designated subdirectory tree, and
make that tree world (or Django user
group) writeable. This seems the
least risky, but also the most work.
Any other ideas? Am I missing some obvious fix? I'm completely new to this.
|
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 using an sqlite3 db. The test is not using the :memory: db, it is using a real file. I have modified the django test code (for debugging this issue) to avoid deleting the test db when it is finished so I can inspect it.
The test code dumps model.MyModel.objects.all() and the records are there between (a) and (b).
When the hook fires at (c) it also dumps the model and there are no records. When I inspect the db manually after the test runs, there are no records.
Is there something going on in the django test framework that isn't commiting the records to the db file?
To clarify: (d) end the test case. Thus the svn commit hook is run before the test case terminates, and before any django db cleanup code should be run.
Extra info: I added a 15 second delay between (b) and (b) so that I could examine the db file manually in the middle of the test. The records aren't in the file.
|
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 don't know how to.
any ideas?
|
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 don't know how to.
any ideas?
|
"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 predefined categories that I want users to be able to select more than one of. The best way to do this is with a models.ManyToMany field. You can register the model with the admin, enter the data as required and then remove the registration.
| 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 will not appear if the number of currently displayed forms exceeds max_num, or if the user does not have JavaScript enabled.
and
As with regular formsets, you can use the max_num and extra parameters to modelformset_factory to limit the number of extra forms displayed.
max_num does not prevent existing objects from being displayed
| 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 do I display all the things in a query
Developer: It's an iterable list. You do it the same way you would with any list
User: Uh, I'm new to python how do I do that.
That is an example of what you don't want to be asking when you try to get django help.
| 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, frameworks which tie into Django well, etc.
Thanks!
|
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 it will improve my overall rating of the book since you will presumably be able to test the code as it progresses through the book (only the first three chapters' code is up there at the moment). The last sections of the book on development methods are in particular very helpful.
If you decide to buy the book, it's a good excuse to learn the basics of revision control with Mercurial.
I believe in picking up operating projects and working them though, helps me learn better and also seeing good practices. A new pretty comprehensive blog engine is Mingus on bit bucket, worth a look, still early stage, but is teaching me a lot, there are others take your pick.
| 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, frameworks which tie into Django well, etc.
Thanks!
|
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 strategy would you use? I mean other than just storing a url in the session manually and referring to that when redirecting. That would work, of course, but I hate the thought of having to remember to do that for each view. Seems error-prone and not very elegant.
Oh, and I'd rather not depend on server specific referral environment variables.
|
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 uploading
this then causes a 500 error... anything that would be causing this?
|
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 run:
./manage.py test -- -s
it ignores the -s and lets me capture it on the custom runner's side, passing it to Nose without a problem.
| 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, duplicating, etc.), then I'd definitely recommend the approach arcanum suggests above.
| 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 class or ... ? Everything is so linked I don't know where to start.
|
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 decompilers.
If your customer wants to redeploy by hand your application on another machine, he could anyway even if the application was in C. Unless you wrote a dongle-protected anti-piracy scheme? Come on. You have to build a relation with your client. This is a social, commercial and legal problem that can't be solved with a technical stunt.
| 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 relation point of view it's a real show stopper. Advertise: "Our code is open!", which doesn't mean your clients can do anything they want with it.
| 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's still slow. Then you can tell whether it's a django/python issue or an Apache/mod_python issue
| 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 core..)
I've tried many solution found on the net for similar problem, but they don't seem related to me.
The problem doesn't seem to come from Django's development server since the request are also very slow on the production server with apache and mod_python.
Then I thought it might be a DNS issue, but the site loads instantly when served with Apache2.
I tried to strace the development server, but I didn't find anything interesting.
Even commenting all the apps (except django apps) didn't change anything.. models still take age to validate.
I really don't know where I should be looking now ..
Anybody has an idea ?
|
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 core..)
I've tried many solution found on the net for similar problem, but they don't seem related to me.
The problem doesn't seem to come from Django's development server since the request are also very slow on the production server with apache and mod_python.
Then I thought it might be a DNS issue, but the site loads instantly when served with Apache2.
I tried to strace the development server, but I didn't find anything interesting.
Even commenting all the apps (except django apps) didn't change anything.. models still take age to validate.
I really don't know where I should be looking now ..
Anybody has an idea ?
|
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 Source Consultant
| 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 core..)
I've tried many solution found on the net for similar problem, but they don't seem related to me.
The problem doesn't seem to come from Django's development server since the request are also very slow on the production server with apache and mod_python.
Then I thought it might be a DNS issue, but the site loads instantly when served with Apache2.
I tried to strace the development server, but I didn't find anything interesting.
Even commenting all the apps (except django apps) didn't change anything.. models still take age to validate.
I really don't know where I should be looking now ..
Anybody has an idea ?
|
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 file without re-encoding the file!
| 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 for setting this up in a way that's easy to automate/run on the command line would be fantastic!
|
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 submitted password when they login.
| 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 being redirected to the actual Google page?
|
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 this domain.
( .... I am trying it myself in the meanwhile ....)
Thanks
|
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 enabled.
From there, you can either take the ajax route in your templates, or you can load the PHP from your views using urllib(2) or httplib(2). Better yet, wrap the urllib2 call in a templatetag, and call that in your templates.
| 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 Python code in a most efficient manner (the ad management code has to be called multiple times for each page)?
The solutions I came up with so far, are the following:
Write SOAP interface in PHP for the ad management code and write a SOAP client in Python which then calls the appropriate functions.
The problem I see is, that will slow down the execution of the Python code considerably, since for each page served, multiple SOAP client requests are necessary in the background.
Call the PHP code through os.execvp() or subprocess.Popen() using PHP command line interface.
The problem here is that the PHP code makes use of the Apache environment ($_SERVER vars and other superglobals). I'm not sure if this can be simulated correctly.
Rewrite the ad management code in Python.
This will probably be the last resort. This ad management code just runs and runs, and there is no one remaining who wrote a piece of code for this :) I'd be quite afraid to do this ;)
Any other ideas or hints how this can be done?
Thanks.
|
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 to bend python into a java.io style stream-buffer paradigm that it just doesn't support in detail.
| 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 confident in learning them well enough to write quality code for your client then go for it. Have a look at each of them, decide which technology you would prefer and get coding.
Hope your application goes well :)
| 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, as well as to
replace some manual and redundant business processes. The system needs
to be cross-platform (Windows/Linux), open source and is primarily for
LAN use.
My experience is mostly PHP/web/app development, but I have developed
a few LAN apps using Java/Servoy (like Filemaker). I found Servoy to be very rapid and to easily make use of different data providers (DB products), but it's not open source, and any non-standard development is in Java/Swing (which is verbose and takes a lot of time).
I'm interested in learning Python/Django or Ruby/Rails - but I'm not sure if these are the best solutions for building a mission critical data entry/reporting LAN app. Is a web client/server really a good choice for this type of application?
Thanks in advance for any tips/ advice.
|
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 application (use something modern like Firefox 3.5, Chrome, Safari 4 or Explorer 8 for better javascript performance) but easy to manage for programmers and administrators (no installations, no local backups, no upgrade problems, etc.)
| 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, as well as to
replace some manual and redundant business processes. The system needs
to be cross-platform (Windows/Linux), open source and is primarily for
LAN use.
My experience is mostly PHP/web/app development, but I have developed
a few LAN apps using Java/Servoy (like Filemaker). I found Servoy to be very rapid and to easily make use of different data providers (DB products), but it's not open source, and any non-standard development is in Java/Swing (which is verbose and takes a lot of time).
I'm interested in learning Python/Django or Ruby/Rails - but I'm not sure if these are the best solutions for building a mission critical data entry/reporting LAN app. Is a web client/server really a good choice for this type of application?
Thanks in advance for any tips/ advice.
|
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, as well as to
replace some manual and redundant business processes. The system needs
to be cross-platform (Windows/Linux), open source and is primarily for
LAN use.
My experience is mostly PHP/web/app development, but I have developed
a few LAN apps using Java/Servoy (like Filemaker). I found Servoy to be very rapid and to easily make use of different data providers (DB products), but it's not open source, and any non-standard development is in Java/Swing (which is verbose and takes a lot of time).
I'm interested in learning Python/Django or Ruby/Rails - but I'm not sure if these are the best solutions for building a mission critical data entry/reporting LAN app. Is a web client/server really a good choice for this type of application?
Thanks in advance for any tips/ advice.
|
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 for the link! That could have been a possible solution - but it sounds like it was used for one project, and I worry about the testing since it is not a part of the mainstream Rails build.
Then I found out that multi-db support is just around the corner for a Django core update (eta late August 2009). So I think I am going to dive in to the project with Django.
| 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, as well as to
replace some manual and redundant business processes. The system needs
to be cross-platform (Windows/Linux), open source and is primarily for
LAN use.
My experience is mostly PHP/web/app development, but I have developed
a few LAN apps using Java/Servoy (like Filemaker). I found Servoy to be very rapid and to easily make use of different data providers (DB products), but it's not open source, and any non-standard development is in Java/Swing (which is verbose and takes a lot of time).
I'm interested in learning Python/Django or Ruby/Rails - but I'm not sure if these are the best solutions for building a mission critical data entry/reporting LAN app. Is a web client/server really a good choice for this type of application?
Thanks in advance for any tips/ advice.
|
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 the documentation.
For sure, I can add this flag to the context but I would like to know if there is a better way to do that.
|
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 do.
Though as long as you're at it, I would suggest trying mod_wsgi instead of mod_python, which is probably eventually going to supersede mod_python. WSGI is a Python standard for writing web applications.
| 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 stuff does not allow requests with XML content type (as used by jQuery's ajax stuff) so I can't use it.
What other options are there?
|
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 content this way, then you have what you are looking for, then just parse the content. If you CAN'T pull the content this way, then that would suggest that the requested page might be looking at user login credentials, sessions info or other header fields such as HTTP_REFERER ... etc. Then you might want to look at something more extensive like the scrapy ... etc. I would suggest that you always follow the simple path first. Good luck and happy "responsibly" scraping! :)
| 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 that it doesn't update your class code when you save is really a pain, but you simply control-a your tables and drag them over again. Total remakes are very quick and painless. The classes it creates are extremely simple. You can even create multiple table entities if you like with SPs for CRUD.
Linking SPs to CRUD is similar to EF: You simply setup your SP with the same parameters as your table, then drag it over your table, and poof, it matches the data types.
A lot of people go out of their way to take IQueryable away from the repository, but you can limit what you link in linq2Sql, so IQueryable is not too bad.
Come to think of it, I wonder if there is a way to restrict the relations (and foreign keys).
| 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 mess of XML (n)Hibernate requires or the hard-to-update Django Models.
Without concentrating on the fact that maybe sometimes more control over the mapping process may be good, are there similar one-click (or one-command) solutions for other (mainly open source like python or php) programming languages or frameworks?
Thanks
|
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 installed Python 2.6.2 with aptitude: does it also have versions for that specific Python of mod_python, mysqldb, django, and any other third party stuff you may need? There really is no "silver bullet" for package management and I know of no "sumo distribution" of Python bundling all the packages you could ever possibly need (if there were, it would have to be many 10s of GB;-).
| 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 encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.11 (Ubuntu) DAV/2 PHP/5.2.6-3ubuntu4.1 with Suhosin-Patch mod_python/3.3.1 Python/2.6.2 mod_ruby/1.2.6 Ruby/1.8.7(2008-08-11) mod_ssl/2.2.11 OpenSSL/0.9.8g Server at 127.0.0.1 Port 80
What else, could or should i do?
Edit: From 1st comment i understand that the problem is not in django but mod_python & apache? so i edited my question title.
Edit2: I think something is wrong with some paths setup. I tried going from mod_python to mod_wsgi, managed to finally set it up correctly only to get next error:
[Sun Aug 16 12:38:22 2009] [error] [client 127.0.0.1] raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
[Sun Aug 16 12:38:22 2009] [error] [client 127.0.0.1] ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
Alan
|
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 necessary view?
How does your code/view get called
?
etc...
Paul.G
|
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 necessary view?
How does your code/view get called
?
etc...
Paul.G
|
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. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the "public slots:" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides.
The less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets.
I'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on "fun stuff" (e.g. less boilerplate, more meat of the app).
Any tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.
|
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. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the "public slots:" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides.
The less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets.
I'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on "fun stuff" (e.g. less boilerplate, more meat of the app).
Any tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.
|
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 chance of getting the limit raised.
Alternatively, you could just get a friend or co-worker to register. That seems like it ought to be legal...but check the User Agreement first.
| 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 for about 10 mintues, then just stops. Apache is still able to serve static files. Just nothing through Django.
I've checked the apache error logs, and I don't see any entries that could be related. I'm not sure if this is a WSGI, Django, Apache, or Postgres issue?
Any ideas?
Thanks for your help!
|
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 default argument value to a function.
(The same could happen in mod_wsgi of course.)
| 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 "stacked" on top of eachother as I refresh the page more.
For example:
First page load: 10 results
Second page load: 20 results (two of each)
Third page load: 30 results (three of each)
etc...
Is this some underlying problem with mod_python? I don't recall running into this when using mod_wsgi.
|
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 Input is still being captured as I can see the Standard Output.
E.g. in pdb.set_trace() I can 'l' to display where I'm at in the code. However, the 'l' will not be displayed, just an empty prompt.
This makes it hard to debug because I can't determine what I'm typing in.
What could be going wrong and what can I do to fix it?
|
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 Input is still being captured as I can see the Standard Output.
E.g. in pdb.set_trace() I can 'l' to display where I'm at in the code. However, the 'l' will not be displayed, just an empty prompt.
This makes it hard to debug because I can't determine what I'm typing in.
What could be going wrong and what can I do to fix it?
|
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 don't need universally unique id but we like to use uuid as a source but cut down strings.
We need unique id specific to site/database (SQL Server/ADO.NET Data services).
Any idea or sample from any language is fine
Thanks in advance
|
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 schema.
For example, if you could guarantee that only version 4 UUIDs are used, then you could take just the first 32 bits, or just the last 32 bits. You lose uniqueness, but you have pretty random numbers. Just avoid the bits that are fixed (version and variant).
But if you can't guarantee that, you will have real problems. For version 1 UUIDs, the first bits will not be unique for UUIDs generated in the same day, and the last bits will not be unique for UUIDs generated in the same system. Even if you CRC the UUID, it is not guaranteed that you will have 16 or 32 bits of uniqueness.
In this case, just use some other scheme. Generate a 32-bit random number using the system random number generator and use that as your unique ID. Don't rely on UUIDs if you intend on stripping its length.
| 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 don't need universally unique id but we like to use uuid as a source but cut down strings.
We need unique id specific to site/database (SQL Server/ADO.NET Data services).
Any idea or sample from any language is fine
Thanks in advance
|
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
base-85 turns 4 8-bit bytes into 5 6.4-bit characters, so 16 bytes of data becomes 20 characters long
It all depends on if you want readable strings and how standard/common an encoding you want to use.
| 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 don't need universally unique id but we like to use uuid as a source but cut down strings.
We need unique id specific to site/database (SQL Server/ADO.NET Data services).
Any idea or sample from any language is fine
Thanks in advance
|
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, Zope 3, etc. One important indicator to me is that there are more RoR jobs on the market than any other (language, framework).
| 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 may be easily available in mature web languages.
The better question is, what does Lua offer that you need which is not offered in the other languages you listed? Or do you want to help Lua become a better web development platform by creating a Lua MVC framework like Rails did for Ruby?
| 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 the INSERT/UPDATE/DELETE statements and then does the COMMIT. There’s no implicit ROLLBACK.
That last sentence is very literal. It DOES NOT issue a ROLLBACK command unless something in Django has set the dirty flag. Since my function was only doing SELECT statements it never set the dirty flag and didn't trigger a COMMIT.
This goes against the fact that PostgreSQL thinks the transaction requires a ROLLBACK because Django issued a SET command for the timezone. In reviewing the logs, I threw myself off because I kept seeing these ROLLBACK statements and assumed Django's transaction management was the source. Turns out it's not, and that's OK.
Connections
The connection management is where things do get tricky. It turns out Django uses signals.request_finished.connect(close_connection) to close the database connection it normally uses. Since nothing normally happens in Django that doesn't involve a request, you take this behavior for granted.
In my case, though, there was no request because the job was scheduled. No request means no signal. No signal means the database connection was never closed.
Going back to transactions, it turns out that simply issuing a call to connection.close() in the absence of any changes to the transaction management issues the ROLLBACK statement in the PostgreSQL log that I'd been looking for.
Solution
The solution is to allow the normal Django transaction management to proceed as normal and to simply close the connection one of three ways:
Write a decorator that closes the connection and wrap the necessary functions in it.
Hook into the existing request signals to have Django close the connection.
Close the connection manually at the end of the function.
Any of those three will (and do) work.
This has driven me crazy for weeks. I hope this helps someone else in the future!
| 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 various transaction decorators on my functions, no luck.
I switched to manual transaction management and did the rollback manually, that worked, but still left the processes as "Idle".
So then I called connection.close(), and all is well.
But I'm left wondering, why doesn't Django's typical transaction and connection management work for these threaded tasks that are being spawned from the main Django thread?
|
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 individual fields for each user, each field is a part of its own.
That way, you would have a meta-Item which consists solely of an Id that the parts can refer to. This holds together the parts. Then, you would map a user not to the Item but to the parts and reconstruct the item view from the common Id of the parts.
| 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 these field etc.
Is there any generic way to set this up?
|
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 achieve this without using the shell
Thanks in advice!
|
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 whenever Apple tweaks their formats &c. It seems Apple has no interest in making such a thing available to developers (although as far as I can't tell they're not actively fighting against it either, they appear to just not care).
| 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 allow this?
|
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 implement this structure? I tried adding site-deps to the PYTHONPATH without joy...
|
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 webpages.
The reason would be to build small personal inspection/admin tools without being to invasive on legacy databases.
|
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 webpages.
The reason would be to build small personal inspection/admin tools without being to invasive on legacy databases.
|
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've got a database connection and it may try to establish this connection.
It's an easy experiment to try.
| 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 webpages.
The reason would be to build small personal inspection/admin tools without being to invasive on legacy databases.
|
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 criteria that change when the data does. For example, if retrieving the key of the most recent announcement is cheap, you could use that as part of the key of the cached data. When a new announcement is posted, you go looking for a key that doesn't exist, and create a new one as a result.
| 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 bit early?) to the conclusion that caching a chunk of a page's rendered HTML would cut down on the CPU time per request significantly. The caching pattern is pretty clean, but the question of where to put this logic of caching and evicting is a bit of a mystery to me.
For example, imagine an application's main page has an Announcements section. This section would need to be re-rendered after:
first read for anyone in the account,
a new announcement being added, and
an old announcement being deleted
Some options of where to put the evict_announcements_section_from_cache() method call:
in the Announcement Model's .delete(), and .put() methods
in the RequestHandler's .post() method
anywhere else?
Then in the RequestHandler's get page, I could potentially call get_announcements_section() which would follow the standard memcache pattern (check cache, add to cache on miss, return value) and pass that HTML down to the template for that chunk of the page.
Is it the typical design pattern to put the cache-evicting logic in the Model, or the Controller/RequestHandler, or somewhere else? Ideally I'd like to avoid having evicting logic with tentacles all over the code.
|
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 faced some problems while deploying a Django project on a shared server. Now, my questions are:
Can the deployment process of Django project be made easier?
Am I doing too much?
Can some of the steps be omitted?
What is the best way to deploy django site on a shared server?
|
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.
I concur: re-install the packages. The time you save by trying to just copy everything over will be completely lost the first time something mysteriously doesn't work and you try to debug it.
Also, another benefit to re-installation: if you only do it when you need the package, then you won't bother reinstalling the packages you no longer need.
| 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 old machine(e.f pygame,pyro genshi,py2exe bla bla bla many...), is there an easier way i can copy my packages to the new laptop without running installation file for each individual package?
Gath
|
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 created by the installation packages, deleting pre-existing .pyc files etc.
I'd advise just reinstalling the packages.
| 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 old machine(e.f pygame,pyro genshi,py2exe bla bla bla many...), is there an easier way i can copy my packages to the new laptop without running installation file for each individual package?
Gath
|
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 you wanted to do with them.
Notice the response from python to flash works the same as with php, it's just http content, so you can use XML or even better, JSON.
| 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 not what I intend to do.
Any help on this is greatly appreciated.
|
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 not what I intend to do.
Any help on this is greatly appreciated.
|
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 loops, making it pretty useless in practice.
| 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 program running locally on my ipod.
Often I want to look up the vocabulary in a dictionary.
Then I always have to repeat the following steps:
Select and copy the word.
Close the vocabulary program.
Open the dictionary.
Paste the word into the text field.
Press search.
I want to automate the process, therefore I want the python program to copy the word into the clipboard automatically and start the dictionary.
I figured out the part with the starting already, using URL schemes.
I was hoping to be able to automate the copying as well.
|
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, when I rename the HTML file from my Python script I want the "_files" folder to be renamed also. Is there an easy way to do this, or will I need to
- rename the .htm file
- rename the _files folder
- parse the .htm file and replace all references to the old _files folder name with the new name?
|
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.