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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Permission to view, but not to change! - Django
| 3,069,023 | 3 | 27 | 25,793 | 0 |
python,django,django-admin
|
One workaround would be to have an additional "save" permission on your model and check in the modeladmin's save_model method if the user has this permissions, if he has not, that would mean he can do everything in this modeladmin, except saving edited data!
| 0 | 0 | 0 | 0 |
2010-06-18T10:30:00.000
| 12 | 0.049958 | false | 3,068,843 | 0 | 0 | 1 | 3 |
is it possible to give users the permission to view, but not to change or delete.
currently in the only permissions I see are "add", "change" and "delete"... but there is no "read/view" in there.
I really need this as some users will only be able to consult the admin panel, in order to see what has been added in.
|
Permission to view, but not to change! - Django
| 3,180,399 | 2 | 27 | 25,793 | 0 |
python,django,django-admin
|
You can do this by following way:
1)You can make the fields read only if the object has been created.But doing this noone will be able to change the fields
2)You can use databrowse
3)You can use form validation ,if user is not in the selected list throw validation error if any field is changed
4)you can create a view ,if user is in your list then redirect it to normal flow or else redirect him to simple html readonly page
5)Use jquery to make the fields readonly is user is not in the list and override the save method to check any smartness.In your save method you throw error any form has changed and user is not in your list.username=request.user.username
| 0 | 0 | 0 | 0 |
2010-06-18T10:30:00.000
| 12 | 0.033321 | false | 3,068,843 | 0 | 0 | 1 | 3 |
is it possible to give users the permission to view, but not to change or delete.
currently in the only permissions I see are "add", "change" and "delete"... but there is no "read/view" in there.
I really need this as some users will only be able to consult the admin panel, in order to see what has been added in.
|
Permission to view, but not to change! - Django
| 5,363,776 | 0 | 27 | 25,793 | 0 |
python,django,django-admin
|
You may also override ModelAdmin.change_view (as stated in the Django docs). Just make sure you also override save_model to make sure the user can't update the data
| 0 | 0 | 0 | 0 |
2010-06-18T10:30:00.000
| 12 | 0 | false | 3,068,843 | 0 | 0 | 1 | 3 |
is it possible to give users the permission to view, but not to change or delete.
currently in the only permissions I see are "add", "change" and "delete"... but there is no "read/view" in there.
I really need this as some users will only be able to consult the admin panel, in order to see what has been added in.
|
Some kind of event functionality in Django?
| 3,069,642 | 0 | 0 | 79 | 0 |
python,django
|
Personnaly, I use the exception mechanism for this kind of stuff and I don't really see why I shouldn't
| 0 | 0 | 0 | 0 |
2010-06-18T12:34:00.000
| 2 | 1.2 | true | 3,069,583 | 0 | 0 | 1 | 2 |
I have a view my Django application which when invoked calls my backend. My backend logic sometimes reaches a point when it needs user input to continue. When this happens, I pickle dump my backend data into the session so that i can resume it later on.
Currently i have defined the scenario when user input is required as a custom exception which i raise. This exception bubbles up all the way to the view where I trap it and do the needful. This works but it isn't really an exception. Is there some kind of event functionality in Django that I could use? Is there a better way to accomplish this?
|
Some kind of event functionality in Django?
| 3,070,920 | 0 | 0 | 79 | 0 |
python,django
|
I'd say there are two ways: You assume that data should be present and if they are not, custom exception should be raised as mentioned.
However, if it's part of expected workflow and it may just be present in a state, I'd handle it accordingly, i.e. by checking results from view calls.
(And I'd say that continuations from Seaside are best solution for this, as far as I understand them)
Definitely, signals are not for this; they are designed to "hook" on specific events, which is not what You want.
| 0 | 0 | 0 | 0 |
2010-06-18T12:34:00.000
| 2 | 0 | false | 3,069,583 | 0 | 0 | 1 | 2 |
I have a view my Django application which when invoked calls my backend. My backend logic sometimes reaches a point when it needs user input to continue. When this happens, I pickle dump my backend data into the session so that i can resume it later on.
Currently i have defined the scenario when user input is required as a custom exception which i raise. This exception bubbles up all the way to the view where I trap it and do the needful. This works but it isn't really an exception. Is there some kind of event functionality in Django that I could use? Is there a better way to accomplish this?
|
From the web to games
| 3,074,113 | 0 | 6 | 471 | 0 |
php,javascript,python
|
Looking at your tags, web games are mostly client side, and since you aren't going to use flash, i would say JavaScript would work for 2D. With all the libraries and plug-ins out there, JavaScript can actually handle it.
| 0 | 0 | 0 | 1 |
2010-06-19T02:38:00.000
| 6 | 0 | false | 3,074,103 | 0 | 0 | 1 | 4 |
I'm a basic web developer. I know PHP, a little bit of Python and Ruby. JavaScript as well [some stuff]. I'm not a hardcore developer. I know what it takes do develop most of web cases.
Now, I have this desire to go deeper and start developing games. I know it sounds a huge leap, but that is why I'm asking here. I already have some games ideas. It would be simple 2d plataform games, and I would like to know what is the best way to start.
I don't want to start with Flash. I'm looking for working with other stuff. I already started to look around for the Unity 3D framework and UDK, but I just don't know how to get started.
So, any hints, tips or sugestions to make?
|
From the web to games
| 3,074,138 | 0 | 6 | 471 | 0 |
php,javascript,python
|
Taking a look at OpenGL may not be a terrible idea. You can use the library in many languages, and is supported with in HTML5 (WebGL). There are several excellent tutorials out there.
| 0 | 0 | 0 | 1 |
2010-06-19T02:38:00.000
| 6 | 0 | false | 3,074,103 | 0 | 0 | 1 | 4 |
I'm a basic web developer. I know PHP, a little bit of Python and Ruby. JavaScript as well [some stuff]. I'm not a hardcore developer. I know what it takes do develop most of web cases.
Now, I have this desire to go deeper and start developing games. I know it sounds a huge leap, but that is why I'm asking here. I already have some games ideas. It would be simple 2d plataform games, and I would like to know what is the best way to start.
I don't want to start with Flash. I'm looking for working with other stuff. I already started to look around for the Unity 3D framework and UDK, but I just don't know how to get started.
So, any hints, tips or sugestions to make?
|
From the web to games
| 3,074,736 | 0 | 6 | 471 | 0 |
php,javascript,python
|
If you want to learn more Python while doing so, you may want to take PyGame or an equivalent program. PHP, Ruby and JavaScript aren't going to help you in the video game section, though. They're all related to the internet.
If you want to start of real easy, try out Genesis3D. you can make awesome 3D FPS games, and its quite easy to get the hang of too. Took me only 5 days :D
Unity made me sick to my stomach, and so did Blender3D's game engine, so I personally say not to use those. It intimidated me.
| 0 | 0 | 0 | 1 |
2010-06-19T02:38:00.000
| 6 | 0 | false | 3,074,103 | 0 | 0 | 1 | 4 |
I'm a basic web developer. I know PHP, a little bit of Python and Ruby. JavaScript as well [some stuff]. I'm not a hardcore developer. I know what it takes do develop most of web cases.
Now, I have this desire to go deeper and start developing games. I know it sounds a huge leap, but that is why I'm asking here. I already have some games ideas. It would be simple 2d plataform games, and I would like to know what is the best way to start.
I don't want to start with Flash. I'm looking for working with other stuff. I already started to look around for the Unity 3D framework and UDK, but I just don't know how to get started.
So, any hints, tips or sugestions to make?
|
From the web to games
| 3,075,334 | 3 | 6 | 471 | 0 |
php,javascript,python
|
Python's Pygame is certainly a good choice as others have said. If you want to get in to deep video game programming though.. move on to something like C++ or another lower level language.. from experience, most higher level languages tend to put artificial hurdles up in regards to decent video games. Though for a simple 2d game you cant go wrong with python.
another decent environment to use is Ogre3d, but you would need C++ or the PyOgre bindings (which are not up to date, but I hear they do work okay).
Going from web to game design really is a decent step, as long as you have a good sense of design. the physics and game logic can be learned, but ive yet to see anyone who could properly learn how to write a decent GUI.. as is seen in most cases these days, the final GUI lay out tends to be a process of elimination or beta with trial and error.
Only suggestion i have left is keep your game logic as far away as possible from your graphics. Be Modular.
-edit-
oh and a note.. stay away from Tkinter in python for anything more than a simple tool.. I have found it most frustrating to use. there is wxPython, GTK, pygame, and PyQT.. and all of them (in my opinion) are far better graphic frameworks.
| 0 | 0 | 0 | 1 |
2010-06-19T02:38:00.000
| 6 | 0.099668 | false | 3,074,103 | 0 | 0 | 1 | 4 |
I'm a basic web developer. I know PHP, a little bit of Python and Ruby. JavaScript as well [some stuff]. I'm not a hardcore developer. I know what it takes do develop most of web cases.
Now, I have this desire to go deeper and start developing games. I know it sounds a huge leap, but that is why I'm asking here. I already have some games ideas. It would be simple 2d plataform games, and I would like to know what is the best way to start.
I don't want to start with Flash. I'm looking for working with other stuff. I already started to look around for the Unity 3D framework and UDK, but I just don't know how to get started.
So, any hints, tips or sugestions to make?
|
How to make django messages StackOverflow style?
| 3,076,590 | 2 | 11 | 4,960 | 0 |
python,ajax,django,django-users
|
Django messages might seem like a good starting point, but require contortions to get to where you want to go, and I wouldn't trust that future release of Django wouldn't break your hacks.
Implementing your own UserMessage model will probably serve you better in the long run. That gives you complete, unambiguous control over the message lifecycle. It might make a nice reusable app, too.
| 0 | 0 | 0 | 0 |
2010-06-19T16:52:00.000
| 4 | 0.099668 | false | 3,076,365 | 0 | 0 | 1 | 2 |
I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page.
I am stumped with two issues:
How do I make the messages' context processor not delete the messages once they are accessed?
How do I later on delete the message from the DB explicitly once the user clicks on the "remove" button (which invokes an ajax call)?
Thanks!
|
How to make django messages StackOverflow style?
| 3,084,273 | 8 | 11 | 4,960 | 0 |
python,ajax,django,django-users
|
In your case django.contrib.messages won't bring you anywhere good. It's a message system inspired by RoR flash system, where messages aren't supposed to stay around
You should create your own messaging system (django-persistent-messages maybe?) that would save messages for registered users in database.
It's a fairly trivial task to implement
a model with a foreign key on User
a context processor to have the messages available in the templates
a view to consume a message
maybe a helper function to create the messages
Don't forget to make it available to others if you do so =)
| 0 | 0 | 0 | 0 |
2010-06-19T16:52:00.000
| 4 | 1.2 | true | 3,076,365 | 0 | 0 | 1 | 2 |
I'd like to use Django's Messages module, however, I would like my messages to persist until the user clicks an X next to the message as opposed to having messages disappear as soon as the user reloads the page.
I am stumped with two issues:
How do I make the messages' context processor not delete the messages once they are accessed?
How do I later on delete the message from the DB explicitly once the user clicks on the "remove" button (which invokes an ajax call)?
Thanks!
|
Does GQL automatically add an "ID" Property
| 3,078,018 | 4 | 1 | 282 | 1 |
python,google-app-engine,gql
|
An object has a Key, part of which is either an automatically-generated numeric ID, or an assigned key name. IDs are not guaranteed to be increasing, and they're almost never going to be consecutive because they're allocated to an instance in big chunks, and IDs unused by the instance to which they're allocated will never be used by another instance (at least, not currently). They're also only unique within the same entity group for a kind; they're not unique to the entire kind if you have parent relationships.
| 0 | 1 | 0 | 0 |
2010-06-19T20:38:00.000
| 3 | 0.26052 | false | 3,077,156 | 0 | 0 | 1 | 2 |
I currently work with Google's AppEngine and I could not find out, whether a Google DataStorage Object Entry has an ID by default, and if not, how I add such a field and let it increase automatically?
regards,
|
Does GQL automatically add an "ID" Property
| 3,077,170 | 3 | 1 | 282 | 1 |
python,google-app-engine,gql
|
Yes, they have id's by default, and it is named ID as you mentioned.
| 0 | 1 | 0 | 0 |
2010-06-19T20:38:00.000
| 3 | 1.2 | true | 3,077,156 | 0 | 0 | 1 | 2 |
I currently work with Google's AppEngine and I could not find out, whether a Google DataStorage Object Entry has an ID by default, and if not, how I add such a field and let it increase automatically?
regards,
|
OpenSSL for HTTPS without a certificate
| 3,078,518 | 2 | 1 | 703 | 0 |
python,ssl,openssl,m2crypto
|
You will need a SSL cert, and let the web server handle the HTTPS.
| 0 | 0 | 1 | 0 |
2010-06-20T07:17:00.000
| 2 | 0.197375 | false | 3,078,487 | 0 | 0 | 1 | 1 |
I'm looking to create an application in Django which will allow for each client to point their domain to my server. At this point, I would want their domain to be accessed via https protocol and have a valid SSL connection. With OpenSSL, more specifically M2Crypto, can I do this right out the gate? Or, do I still need to purchase an SSL cert? Also, if the former is true (can do without purchase), does this mean I need to have a Python-based web server listening on 443 or does this all somehow still work with NGINX, et al?
Any help is appreciated.
|
Ruby HAML with Django?
| 3,144,408 | 0 | 19 | 3,831 | 0 |
python,ruby,django,haml
|
While this could end up being more trouble than it is worth, it is PROBABLY possible to leverage the Java or .NET platform and still run your Django application in Jython or IronPython (with some minor adjustments I'm sure) and also be able to leverage Ruby's HAML gem via jRuby or IronRuby.
I'm sure there will be some quirks in getting this to work, but I'm sure it would be possible.
Again, this is probably a lot more trouble than it's worth (considering that you'd have to move your application to a completely new platform), but it would be a pretty fun project to work on.
| 0 | 0 | 0 | 0 |
2010-06-20T13:24:00.000
| 4 | 0 | false | 3,079,368 | 0 | 0 | 1 | 2 |
Ok, so I really love HAML. Particularly, I love the integration with RedCloth and BlueCloth, so I can use Markdown and Textile intermixed with my HAML.
I also love Python and Django.
So, I would like to use HAML with Django. Now, I already understand that there are some attempts at cloning HAML-like syntax in Python (SHPAML and others). I've tried these, and while they aren't bad, I've found that I really just want the real HAML. Partially for its syntax, but also for things like RedCloth and BlueCloth.
So, my question is, how to make HAML and Django work together?
One solution, I think, would be to create HAML templates, and then compile them into HTML using the command line tool every time they're updated.
Quesiton 1: Will I run into any problems here?
I also wonder if there's a way to get Python and Ruby to play together a little more. One idea I had was actually forking out Ruby processes. This is probably a bad idea, but anyone have any thoughts about this?
Question 2: What about using Python to call the real Ruby HAML?
Finally, if anyone knows of a Python implementation of HAML that is complete, and that supports either Textile or Markdown, as well as plaintext passthru, then let me know.
Question 3: Is there a full translation of HAML to Python including Markdown or Textile support?
Thanks!
|
Ruby HAML with Django?
| 7,147,104 | 1 | 19 | 3,831 | 0 |
python,ruby,django,haml
|
I strongly recommend that you do not fork any processes out of your django views, because the overhead is significant.
You should have a persistent ruby process to serve your templates for you, and invoke it from your django code. I leave the IPC technology to you, but the obvious choices would either be some kind of message queuing technology, or speaking HTTP over a socket to the ruby process.
| 0 | 0 | 0 | 0 |
2010-06-20T13:24:00.000
| 4 | 0.049958 | false | 3,079,368 | 0 | 0 | 1 | 2 |
Ok, so I really love HAML. Particularly, I love the integration with RedCloth and BlueCloth, so I can use Markdown and Textile intermixed with my HAML.
I also love Python and Django.
So, I would like to use HAML with Django. Now, I already understand that there are some attempts at cloning HAML-like syntax in Python (SHPAML and others). I've tried these, and while they aren't bad, I've found that I really just want the real HAML. Partially for its syntax, but also for things like RedCloth and BlueCloth.
So, my question is, how to make HAML and Django work together?
One solution, I think, would be to create HAML templates, and then compile them into HTML using the command line tool every time they're updated.
Quesiton 1: Will I run into any problems here?
I also wonder if there's a way to get Python and Ruby to play together a little more. One idea I had was actually forking out Ruby processes. This is probably a bad idea, but anyone have any thoughts about this?
Question 2: What about using Python to call the real Ruby HAML?
Finally, if anyone knows of a Python implementation of HAML that is complete, and that supports either Textile or Markdown, as well as plaintext passthru, then let me know.
Question 3: Is there a full translation of HAML to Python including Markdown or Textile support?
Thanks!
|
Can I use Ruby and Python together?
| 3,079,547 | 8 | 8 | 662 | 0 |
python,ruby
|
If you develop for the .NET Framework Version 4.0, you can write code in IronRuby that calls methods that were written in IronPython and vice versa.
| 0 | 0 | 0 | 1 |
2010-06-20T14:15:00.000
| 4 | 1.2 | true | 3,079,531 | 0 | 0 | 1 | 1 |
Is there something like JRuby but for Ruby and Python?
Not that it would actually be useful to me, but just wondering.
|
What methods and tools do you use to design and analyze the workflow in a web application (for a tiny team)
| 3,081,567 | 1 | 5 | 141 | 0 |
python
|
+1 for a good question.
Web development is not much different to any other development.
P.20 of that venerable classic breaks a typical project down into 1/3 planning, 1/6 coding, 1/4 component test and 1/4 system test. I might catch some flak for that, YMMV and all, but that looks about right to me.
Whether or not you agree with the proportions, the message is "don't jump right in and code; think about it first (measure twice, cut once). How often have you jumped in and coded only to get near to "then end" and discover that you have a fundamental design flaw and have to through away much of your code & rewrite chunks more?
You need methodologies (Processes) and Tools, and each can necessitate the other.
Methodologies
Design it first! Gather requirements, make a system level design document then detailed design. If you are more than one, have these reviewed by someone (client can maybe review the high level docs?). If if you are alone, the simple act of writing it down forces you to slow down and think and will uncover problems. A good idea is to have a requirements traceability matrix to ensure that each requirement gets designed, implemented and tested somewhere.
After you review the high level design, you can being the detailed design, and after you review that, you can begin to implement. When the high level design is reviewed you can, in parallel, or later, produce a high level test spec. When the detailed level design is reviewed you can, in parallel, or later, produce unit test specs.
Note that test cases should be automated and should require no human interaction. Get into the habit of running regression tests after every code change - automate this if you can, with nightly build and or coupled with check-in to your version control system.
When everything is thoroughly unit tested, you can begin your system level testing.
Tools
At the very least you ought to be considering these:
A good IDE (WYSIWYG for web design), preferably with debugging capabilities, and it would be nice if it interfaced with your version control system, bug tracker, etc. A spill chuker is useful for websites ;-)
A project management tool to plan the project (Open Workbench does some nice Gantt charts)
A version control system.
A change request and bug tracker.
An automated test system.
An automated build system like Hudson (it may not seem relevant if you don't compile and link, but at least it can verify that all files exist and can schedule regression testing for you)
A backup system in case of disk crash, laptop loss, etc.
And if all that seems like too much "extra" to do, I was sceptical too once, until I saw that it actually saves time because you discover problems earlier when they cost less to fix. In fact, I am so sure of this that I do all of my personal one-man hobby projects this way. All of them.
| 0 | 0 | 0 | 0 |
2010-06-20T23:58:00.000
| 3 | 0.066568 | false | 3,081,412 | 0 | 0 | 1 | 2 |
Note: I use TRAC integrated with SVN, framework testing tools, an excellent mixture of staging servers, development servers, and other tools to speed development and keep track of tasks.
I am asking about the specific process of design, and even more specifically, the design of functionality and flow in a web application.
--- Original question ---
So far I spend a lot of time with my text editor open basically talking to myself, then coding for a while, then talking to myself again. When there is more than just me we do some whiteboarding, but that's about it.
What do you find works well, specifically for projects for very small teams or one-developer shows.
BTW I usually develop with Django, this last project also involves RabbitMQ and Orbited, plus a fair chunk of jquery-assisted JavaScript.
|
What methods and tools do you use to design and analyze the workflow in a web application (for a tiny team)
| 3,097,921 | 1 | 5 | 141 | 0 |
python
|
Pencils!
Seriously, we use JIRA to track work/issue, Confluence to track requirements before they're baked enough to put in JIRA.. Anything to scratch together wire-frames, etc. (Including OmniGraffle, and Pencils).
I find the combination of JIRA and Confluence for tracking chunks of work and longer-lived concepts and standards pretty darned effective.
| 0 | 0 | 0 | 0 |
2010-06-20T23:58:00.000
| 3 | 1.2 | true | 3,081,412 | 0 | 0 | 1 | 2 |
Note: I use TRAC integrated with SVN, framework testing tools, an excellent mixture of staging servers, development servers, and other tools to speed development and keep track of tasks.
I am asking about the specific process of design, and even more specifically, the design of functionality and flow in a web application.
--- Original question ---
So far I spend a lot of time with my text editor open basically talking to myself, then coding for a while, then talking to myself again. When there is more than just me we do some whiteboarding, but that's about it.
What do you find works well, specifically for projects for very small teams or one-developer shows.
BTW I usually develop with Django, this last project also involves RabbitMQ and Orbited, plus a fair chunk of jquery-assisted JavaScript.
|
What's a good document standard to use programmatically?
| 3,082,556 | 0 | 3 | 581 | 0 |
python,pyqt,document
|
Creating XML documents, transforming them to XSL/fo and rendering with Fop or RenderX. If you use docbook as the primary input, there are toolchains freely available for converting that to PDF, RTF, HTML and so forth.
It is rather quirky to use and not my idea of fun, but is does deliver and can be embedded in an application, AFAICT.
Creating docbook is very straightforward as it has a wide range of semantic tags, table support etc to give a "meaningful" markup which can be reliably formatted. The XSL stylesheets are modular and allow parts to be customized or replaced to generate your own look and feel.
It works well for relatively free flow documents with lots of text.
For filling in the blanks kind of documents, a regular reporting engine may be a better fit, or some straighforward XSL stylesheets spitting out the XSL-fo directly.
| 0 | 0 | 0 | 0 |
2010-06-21T06:25:00.000
| 5 | 0 | false | 3,082,502 | 0 | 0 | 1 | 1 |
I'm writing a program that requires input in the form of a document, it needs to replace a few values, insert a table, and convert it to PDF. It's written in Python + Qt (PyQt). Is there any well known document standard which can be easily used programmatically? It must be cross platform, and preferably open.
I have looked into Microsoft Doc and Docx, which are binary formats and I can't edit them. Python has bindings for it, but they're only on Windows.
Open Office's ODT/ODF is zipped in an xml file, so I can edit that one but there's no command line utilities or any way to programmatically convert the file to a PDF. Open Office provides bindings, but you need to run Open Office from the command line, start a server, etc. And my clients may not have Open Office installed.
RTF is readable from Python, but I couldn't find any way/libraries to convert RTF documents to PDF.
At the moment I'm exporting from Microsoft Word to HTML, replacing the values and using PyQt to convert it to a PDF. However it loses formatting features and looks awful. I'm surprised there isn't a well known library which lets you edit a variety of document formats and convert them into other formats, am I missing something?
Update: Thanks for the advice, I'll have a look at using Latex.
Thanks,
Jackson
|
Using Crypto by placing folder in python path? - Python
| 3,085,685 | 1 | 0 | 317 | 0 |
python,django,aes,pycrypto
|
You'll need to build pycrypto before you upload it. This will need to be done on a machine with as similar an environment to your server as possible.
To build, run python setup.py build from inside the pycrypto-2.1.0 directory. This will create build\lib.win32-2.6\Crypto (the name of the libxxx directory might be a little different).
FTP the Crypto folder to somewhere on your server's python path. Inside the Django project folder may or may not work. A safe bet is to put it right in your site-packages folder, if you have access to it.
I don't know much about deploying on Windows, but usually you need to restart the server to reload the application whenever you make any changes. Hopefully that's what you meant by 'code refresh'
| 0 | 0 | 0 | 0 |
2010-06-21T09:16:00.000
| 1 | 0.197375 | false | 3,083,366 | 0 | 0 | 1 | 1 |
I'm using Django in order to serve a web service. I have only access to FTP and code refresh at the moment. No access to command-line or executing any kind of executable.
I am using a Windows Server 2005 machine.
Would I be able to use Crypto just by placing the folder within my Django project?
Are there any good alternatives if not?
Help would be amazing guys!!!
|
How do I get tags/keywords from a webpage/feed?
| 3,250,807 | 0 | 1 | 226 | 0 |
python,tags,visualization,keyword
|
What you have is a rough 1st order approximation. I think if you then go back through the data and search for frequency of 2-word phrases, then 3 word phrases, up till the total number of words that can be considered a tag, you'll get a better representation of keyword frequency.
You can refine this rough search pattern by specifying certain words that can be contained as part of a phrase (pronouns ect).
| 0 | 0 | 1 | 0 |
2010-06-21T10:17:00.000
| 1 | 0 | false | 3,083,784 | 0 | 0 | 1 | 1 |
I have to build a tag cloud out of a webpage/feed. Once you get the word frequency table of tags, it's easy to build the tagcloud. But my doubt is how do I retrieve the tags/keywords from the webpage/feed?
This is what I'm doing now:
Get the content -> strip HTML -> split them with \s\n\t(space,newline,tab) -> Keyword list
But this does not work great.
Is there a better way?
|
How to click and verify the existence of a pop up (alert)
| 3,103,295 | 1 | 2 | 3,169 | 0 |
python,selenium
|
as far as I know you have to use always in alerts
selenium.get_confirmation()
from python doc:
If an confirmation is generated but you do not consume it with getConfirmation, the next Selenium action will fail.
| 0 | 0 | 1 | 0 |
2010-06-21T13:01:00.000
| 3 | 0.066568 | false | 3,084,850 | 0 | 0 | 1 | 1 |
I'm working with selenium.
while trying to click a button it creates a pop up (alert) and doesn’t return a page object.
Because of that I can’t use “click” alone as this method expects a page object and eventually fails because of a timeout.
I can use the “chooseOkOnNextConfirmation()” but this will click the pop up and i also want to verify that the pop up actually appeared.
Is there any method that will click and verify this alert?
|
Pros and cons for different configuration formats?
| 3,086,515 | 6 | 52 | 21,947 | 0 |
python,json,xml,google-app-engine,configuration-files
|
Note, this is pure opinion and speculation on my part but I suspect that the single biggest reason for the plethora of formats is likely due to the lack of a readily available, omnipresent configuration file parsing library. Lacking that, most programs have to write their own parsers so it would often come down to balance between how complex the configuration structure needs to be (hierarchical vs flat, purely data vs embedded logic like if statements, etc), how much effort the developers were willing to spend on writing a configuration file parser, and how much of a pain it should be for the end user. However, probably every reason you've listed and could think has likely been the motivation for a project or two in choosing their format.
For my own projects I tend to use .ini simply because there's an excellent parser already built in to Python and it's been "good enough" for most of my use cases. In the couple of cases it's been insufficient, I've used an XML based configuration file due, again, to the relative simplicity of implementation.
| 0 | 0 | 0 | 0 |
2010-06-21T13:26:00.000
| 4 | 1 | false | 3,085,029 | 0 | 0 | 1 | 4 |
I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django).
My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less verbose) or a Python one (sometimes you have a Python app and don't want to use a specific module just to parse a config file), but what about the other approaches?
I know there are even more formats than those configuration files I exemplified. What are really their advantages in comparison to each other? Historical reasons? Compatibility with different systems?
If you would start an application to read some kind of configuration files (with a plugin ecosystem), which one would you use?
Which ones that I gave as example are the oldest ones? Do you know it's history?
|
Pros and cons for different configuration formats?
| 3,086,617 | 32 | 52 | 21,947 | 0 |
python,json,xml,google-app-engine,configuration-files
|
It's mostly personal preference, purpose, and available libraries. Personally I think xml is way too verbose for config files, but it is popular and has great libraries.
.cfg, .ini are legacy formats that work well and many languages have an included library that reads them. I've used it in Java, Python, C++ without issues. It doesn't really work as a data interchange format and if I am passing data I will probably use the same format for config and data interchange.
yaml, and json are between xml and cfg/ini. You can define many data structures in both, or it can be a simple key-value like with cfg. Both of these formats have great libraries in python and I'm assuming many other languages have libraries as well. I believe json is subset of yaml.
I've never used a python file as config, but it does seem to work well for django. It does allow you to have some code in the config which might be useful.
Last time I was choosing a format I chose yaml. It's simple but has some nice features, and the python library was easy to install and really good. Json was a close second and since the yaml library parsed json I chose yaml over it.
| 0 | 0 | 0 | 0 |
2010-06-21T13:26:00.000
| 4 | 1.2 | true | 3,085,029 | 0 | 0 | 1 | 4 |
I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django).
My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less verbose) or a Python one (sometimes you have a Python app and don't want to use a specific module just to parse a config file), but what about the other approaches?
I know there are even more formats than those configuration files I exemplified. What are really their advantages in comparison to each other? Historical reasons? Compatibility with different systems?
If you would start an application to read some kind of configuration files (with a plugin ecosystem), which one would you use?
Which ones that I gave as example are the oldest ones? Do you know it's history?
|
Pros and cons for different configuration formats?
| 59,535,927 | 1 | 52 | 21,947 | 0 |
python,json,xml,google-app-engine,configuration-files
|
It really depends on whether the reader/writer of the configuration file is, or can be, a non-programmer human or if it has strictly programmatic access.
XML, JSON, etc., are totally unsuitable for human consumption, while the INI format is half-way reasonable for humans.
If the configuration file has only programmatic access (with occasional editing by a programmer), then any of the supported formats (XML, JSON, or INI) are suitable. The INI file is not suitable for structured parameters, where XML and JSON can support arrays, structs/objects, etc.
| 0 | 0 | 0 | 0 |
2010-06-21T13:26:00.000
| 4 | 0.049958 | false | 3,085,029 | 0 | 0 | 1 | 4 |
I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django).
My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less verbose) or a Python one (sometimes you have a Python app and don't want to use a specific module just to parse a config file), but what about the other approaches?
I know there are even more formats than those configuration files I exemplified. What are really their advantages in comparison to each other? Historical reasons? Compatibility with different systems?
If you would start an application to read some kind of configuration files (with a plugin ecosystem), which one would you use?
Which ones that I gave as example are the oldest ones? Do you know it's history?
|
Pros and cons for different configuration formats?
| 62,036,718 | 0 | 52 | 21,947 | 0 |
python,json,xml,google-app-engine,configuration-files
|
According to Python official docs, 'future enhancements to configuration functionality will
be added to dictConfig()'.
So any config file which can be used with dictconfig() should be fine.
| 0 | 0 | 0 | 0 |
2010-06-21T13:26:00.000
| 4 | 0 | false | 3,085,029 | 0 | 0 | 1 | 4 |
I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django).
My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less verbose) or a Python one (sometimes you have a Python app and don't want to use a specific module just to parse a config file), but what about the other approaches?
I know there are even more formats than those configuration files I exemplified. What are really their advantages in comparison to each other? Historical reasons? Compatibility with different systems?
If you would start an application to read some kind of configuration files (with a plugin ecosystem), which one would you use?
Which ones that I gave as example are the oldest ones? Do you know it's history?
|
Confused, are languages like python, ruby single threaded? unlike say java? (for web apps)
| 3,088,843 | 17 | 61 | 37,252 | 0 |
java,python,ruby,multithreading
|
A confused question with a lot of confused answers...
First, threading and concurrent execution are different things. Python supports threads just fine; it doesn't support concurrent execution in any real-world implementation. (In all serious implementations, only one VM thread can execute at a time; the many attempts to decouple VM threads have all failed.)
Second, this is irrelevant for web apps. You don't need Python backends to execute concurrently in the same process. You spawn separate processes for each backend, which can then each handle requests in parallel because they're not tied together at all.
Using threads for web backends is a bad idea. Why introduce the perils of threading--locking, race conditions, deadlocks--to something inherently embarrassingly parallel? It's much safer to tuck each backend away in its own isolated process, avoiding the potential for all of these problems.
(There are advantages to sharing memory space--it saves memory, by sharing static code--but that can be solved without threads.)
| 0 | 0 | 0 | 0 |
2010-06-21T16:29:00.000
| 13 | 1 | false | 3,086,467 | 1 | 0 | 1 | 9 |
I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server have a pool of threads to work with in all cases?
|
Confused, are languages like python, ruby single threaded? unlike say java? (for web apps)
| 3,086,520 | 6 | 61 | 37,252 | 0 |
java,python,ruby,multithreading
|
Certainly the webserver will have a pool of threads. That's only outside the control of your program. Those threads are used to handle HTTP requests. Each HTTP request is handled in a separate thread and the thread is released back to pool when the associated HTTP response is finished. If the webserver doesn't have such a pool, it would have been extremely slow in serving.
Whether a programming language is singlethreaded or multithreaded dependens on the possibility to programmatically spawn new threads using the language in question. If that isn't possible, then the language is singlethreaded, for example PHP. As far as I can see, both Ruby and Python supports multithreading.
| 0 | 0 | 0 | 0 |
2010-06-21T16:29:00.000
| 13 | 1 | false | 3,086,467 | 1 | 0 | 1 | 9 |
I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server have a pool of threads to work with in all cases?
|
Confused, are languages like python, ruby single threaded? unlike say java? (for web apps)
| 3,086,582 | 60 | 61 | 37,252 | 0 |
java,python,ruby,multithreading
|
Both Python and Ruby have full support for multi-threading. There are some implementations (e.g. CPython, MRI, YARV) which cannot actually run threads in parallel, but that's a limitation of those specific implementations, not the language. This is similar to Java, where there are also some implementations which cannot run threads in parallel, but that doesn't mean that Java is single-threaded.
Note that in both cases there are lots of implementations which can run threads in parallel: PyPy, IronPython, Jython, IronRuby and JRuby are only few of the examples.
The main difference between Clojure on the one side and Python, Ruby, Java, C#, C++, C, PHP and pretty much every other mainstream and not-so-mainstream language on the other side is that Clojure has a sane concurrency model. All the other languages use threads, which we have known to be a bad concurrency model for at least 40 years. Clojure OTOH has a sane update model which allows it to not only present one but actually multiple sane concurrency models to the programmer: atomic updates, software transactional memory, asynchronous agents, concurrency-aware thread-local global variables, futures, promises, dataflow concurrency and in the future possibly even more.
| 0 | 0 | 0 | 0 |
2010-06-21T16:29:00.000
| 13 | 1.2 | true | 3,086,467 | 1 | 0 | 1 | 9 |
I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server have a pool of threads to work with in all cases?
|
Confused, are languages like python, ruby single threaded? unlike say java? (for web apps)
| 3,086,550 | 4 | 61 | 37,252 | 0 |
java,python,ruby,multithreading
|
Most languages don't define single or multithreading. Usually, that is left up to the libraries to implement.
That being said, some languages are better at it than others. CPython, for instance, has issues with interpreter locking during multithreading, Jython (python running on the JVM) does not.
Some of the real power of Clojure (IMO) is that it runs on the JVM. You get multithreading and tons of libraries for free.
| 0 | 0 | 0 | 0 |
2010-06-21T16:29:00.000
| 13 | 0.061461 | false | 3,086,467 | 1 | 0 | 1 | 9 |
I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server have a pool of threads to work with in all cases?
|
Confused, are languages like python, ruby single threaded? unlike say java? (for web apps)
| 3,086,571 | 0 | 61 | 37,252 | 0 |
java,python,ruby,multithreading
|
How to untangle the knots in al those threads...
Clojure did not invent threading, however it has particularly strong support for it with Software Transactional Memory, Atoms, Agents, parallel map operations, ...
All other have accumulated threading support. Ruby is a special case as it has green threads in some implementations which are a kind of software emulated threads and do not use all the cores. 1.9 will put this to rest.
Regarding web servers, no they do not always work multithreaded, apache has traditionally ran as a flock of daemons which are a pool of separate single threaded processes. Now currently there are more options to run apache servers.
To summarize all modern languages support threading in one form or another.
The newer languages like scala and clojure are adding specific support to improve working with multiple threads without explicit locking as this has traditionally be the great pitfall of multithreading.
| 0 | 0 | 0 | 0 |
2010-06-21T16:29:00.000
| 13 | 0 | false | 3,086,467 | 1 | 0 | 1 | 9 |
I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server have a pool of threads to work with in all cases?
|
Confused, are languages like python, ruby single threaded? unlike say java? (for web apps)
| 3,086,584 | 5 | 61 | 37,252 | 0 |
java,python,ruby,multithreading
|
The short answer is yes, they are single threaded.
The long answer is it depends.
JRuby is multithreaded and can be run in tomcat like other java code. MRI (default ruby) and Python both have a GIL (Global Interpreter Lock) and are thus single threaded.
The way it works for web servers is further complicated by the number of available server configurations. For most ruby applications there are (at least) two levels of servers, a proxy/static file server like nginx and then the ruby app server.
Nginx does not use threads like apache or tomcat, it uses non-blocking events (and I think forked worker processes). This allows it to deal with higher levels of concurrency than would be allowed with the overhead and scheduling inefficiencies of native threads.
The various ruby apps servers also work in different ways to get high throughput and concurrency without threads. Thin uses libev and the asynchronous evented model like Nginx. Mongrel uses a round-robin pool of worker processes. Unicorn uses native Unix IPC (select on a socket) to load balance to a pool of forked processes through one master proxy socket.
Threads are only one way to address concurrency. Multiple processes and evented models are a different approach that ties in well with the Unix base. This is fundamentally different from the way Java treats the world.
| 0 | 0 | 0 | 0 |
2010-06-21T16:29:00.000
| 13 | 0.076772 | false | 3,086,467 | 1 | 0 | 1 | 9 |
I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server have a pool of threads to work with in all cases?
|
Confused, are languages like python, ruby single threaded? unlike say java? (for web apps)
| 3,086,920 | 0 | 61 | 37,252 | 0 |
java,python,ruby,multithreading
|
Reading these answers here... A lot of them try to sound smarter than they really are imho (im mostly talking about Ruby related stuff as thats the one i'm most familiar with).
In fact, JRuby is currently the only Ruby implementation that supports true concurrency. On JVM Ruby threads are mapped to OS native threads, without GIL interfering. So its totally correct to say that Ruby is not multithreaded.
In 1.8.x Ruby is actually run inside one OS thread, and while you do have the fake feeling of concurrency with green threads, then in reality GIL will pretty much prevent you from having true concurrency.
In Ruby 1.9 this changed a bit, as now a Ruby process can have many OS threads attached to it (plus the green threads), but again GIL will totally destroy the point and become the bottleneck.
In practice, from a regular webapp standpoint, it should not matter much if its single or multithreaded. The problem mostly arises on the server side anyhow and it mostly is a matter of scaling technique difference.
| 0 | 0 | 0 | 0 |
2010-06-21T16:29:00.000
| 13 | 0 | false | 3,086,467 | 1 | 0 | 1 | 9 |
I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server have a pool of threads to work with in all cases?
|
Confused, are languages like python, ruby single threaded? unlike say java? (for web apps)
| 3,087,997 | 0 | 61 | 37,252 | 0 |
java,python,ruby,multithreading
|
Yes Ruby and Python can handle multi-threading, but for many cases (web) is better to rely on the threads generated by the http requests from the client to the server. Even if you generate many threads on a same application to low the runtime cost or to handle many task at time, in a web application case that's usually too much time, no one will wait happily more than some fractions of a second for the response of your application in a single page, it's more wise to use AJAX (Asynchronous JavaScript And XML) techniques: make sure the design of your web shows up rapidly, and make an asynchronous insertion of those hard-coding things later.
That does not mean that multi-threading is useless for web! It's highly recommended to low the charge of your server if you want to run recursive-complicated-hardcore-applications (not for a website, I mean), but what that thing return must end in files or in databases, so then could be softly served by a http response.
| 0 | 0 | 0 | 0 |
2010-06-21T16:29:00.000
| 13 | 0 | false | 3,086,467 | 1 | 0 | 1 | 9 |
I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server have a pool of threads to work with in all cases?
|
Confused, are languages like python, ruby single threaded? unlike say java? (for web apps)
| 60,181,609 | 1 | 61 | 37,252 | 0 |
java,python,ruby,multithreading
|
keeping this very short..
Python supports Multi Threading.
Python does NOT support parallel execution of its Threads.
Exception:
Above statement may vary with implementations of Python not using GIL (Global Interpreter Locking).
If a particular implementation is not using GIL, then, that would be Multi Threaded as well as support Parallel Execution
| 0 | 0 | 0 | 0 |
2010-06-21T16:29:00.000
| 13 | 0.015383 | false | 3,086,467 | 1 | 0 | 1 | 9 |
I was reading how Clojure is 'cool' because of its syntax + it runs on the JVM so it is multithreaded etc. etc.
Are languages like ruby and python single threaded in nature then? (when running as a web app).
What are the underlying differences between python/ruby and say java running on tomcat?
Doesn't the web server have a pool of threads to work with in all cases?
|
SimpleDB query performance improvement using boto
| 9,012,699 | 0 | 2 | 1,743 | 1 |
python,amazon-simpledb,boto
|
I have had the same issue as you Charlie. After profiling the code, I have narrowed the performance problem down to SSL. It seems like that is where it is spending most of it's time and hence CPU cycles.
I have read of a problem in the httplib library (which boto uses for SSL) where the performance doesn't increase unless the packets are over a certain size, though that was for Python 2.5 and may have already been fixed.
| 0 | 0 | 0 | 0 |
2010-06-23T15:38:00.000
| 3 | 0 | false | 3,103,145 | 0 | 0 | 1 | 1 |
I am trying to use the SimpleDB in following way.
I want to keep 48 hrs worth data at anytime into simpledb and query it for different purposes.
Each domain has 1 hr worth data, so at any time there are 48 domains present in the simpledb.
As the new data is constantly uploaded, I delete the oldest domain and create a new domain for each new hour.
Each domain is about 50MB in size, the total size of all the domains is around 2.2 GB.
The item in the domain has following type of attributes
identifier - around 50 characters long -- 1 per item
timestamp - timestamp value -- 1 per item
serial_n_data - 500-1000 bytes data -- 200 per item
I'm using python boto library to upload and query the data.
I send 1 item/sec with around 200 attributes in the domain.
For one of the application of this data, I need to get all the data from all the 48 domains.
The Query looks like, "SELECT * FROM domain", for all the domains.
I use 8 threads to query data with each thread taking responsibility of few domains.
e.g domain 1-6 thread 1
domain 7-12 thread 2 and so on
It takes close to 13 minutes to get the entire data.I am using boto's select method for this.I need much more faster performance than this. Any suggestions on speed up the querying process? Is there any other language that I can use, which can speed up the things?
|
Finding images with pure colours
| 3,106,854 | 1 | 1 | 381 | 0 |
python,image,image-processing,colors
|
How about doing this?
Blur the image using some fast blurring algorithm. (Search for stack blur or box blur)
Compute standard deviation of the pixels in RGB domain, once for each color.
Discard the image if the standard deviation is beyond a certain threshold.
| 0 | 0 | 0 | 0 |
2010-06-24T02:02:00.000
| 2 | 1.2 | true | 3,106,788 | 0 | 1 | 1 | 1 |
I've read a number of questions on finding the colour palette of an image, but my problem is slightly different. I'm looking for images made up of pure colours: pictures of the open sky, colourful photo backgrounds, red brick walls etc.
So far I've used the App Engine Image.histogram() function to produce a histogram, filter out values below a certain occurrence threshold, and average the remaining ones down. That still seems to leave in a lot of extraneous photographs where there are blobs of pure colour in a mixed bag of other photos.
Any ideas much appreciated!
|
Django Template Ternary Operator
| 3,110,234 | 5 | 70 | 35,699 | 0 |
python,django,templates,ternary-operator
|
You don't. The Django {% if %} templatetag has only just started supporting ==, and, etc. {% if cond %}{% else %}{% endif %} is as compact as it gets for now.
| 0 | 0 | 0 | 0 |
2010-06-24T13:05:00.000
| 6 | 0.16514 | false | 3,110,166 | 0 | 0 | 1 | 1 |
I was wondering if there was a ternary operator (condition ? true-value : false-value) that could be used in a Django template. I see there is a python one (true-value if condition else false-value) but I'm unsure how to use that inside a Django template to display the html given by one of the values. Any ideas?
|
PHP vs. Other Languages in Hadoop/MapReduce implementations, and in the Cloud generally
| 3,113,643 | 10 | 3 | 906 | 0 |
java,php,python,hadoop,mapreduce
|
PHP is designed primarily as a language for displaying output to a browser. Most jobs being run on MapReduce/Hadoop clusters have nothing to do with displaying output.
They instead tend to lean much more heavily towards data processing. PHP is not the most commonly supported language for data processing, by far. Thus, it's logical that the most common supported languages for data processing-related technologies don't include PHP.
| 0 | 1 | 0 | 1 |
2010-06-24T20:18:00.000
| 3 | 1.2 | true | 3,113,573 | 0 | 0 | 1 | 2 |
I'm beginning to learn some Hadoop/MapReduce, coming mostly from a PHP background, with a little bit of Java and Python.
But, it seems like most implementations of MapReduce out there are in Java, Ruby, C++ or Python.
I've looked, and it looks like there are some Hadoop/MapReduce in PHP, but the overwhelming body of the literature seems to be dedicated to those 4 languages.
Is there a good reason why PHP is a 2nd class language in cloud computing projects like those that involve Hadoop/MapReduce? This is particularly surprising, considering that, outside of cloud computing world, PHP seems like its the most commonly supported language, to the detriment of the 3 above (sans C++) languages.
If this is arbitrary--if PHP is just as good at handling these operations as, say, Python, what libraries/projects should I look into?
|
PHP vs. Other Languages in Hadoop/MapReduce implementations, and in the Cloud generally
| 3,113,644 | 1 | 3 | 906 | 0 |
java,php,python,hadoop,mapreduce
|
The reason is PHP lack of support for multi-threading and process communication.
| 0 | 1 | 0 | 1 |
2010-06-24T20:18:00.000
| 3 | 0.066568 | false | 3,113,573 | 0 | 0 | 1 | 2 |
I'm beginning to learn some Hadoop/MapReduce, coming mostly from a PHP background, with a little bit of Java and Python.
But, it seems like most implementations of MapReduce out there are in Java, Ruby, C++ or Python.
I've looked, and it looks like there are some Hadoop/MapReduce in PHP, but the overwhelming body of the literature seems to be dedicated to those 4 languages.
Is there a good reason why PHP is a 2nd class language in cloud computing projects like those that involve Hadoop/MapReduce? This is particularly surprising, considering that, outside of cloud computing world, PHP seems like its the most commonly supported language, to the detriment of the 3 above (sans C++) languages.
If this is arbitrary--if PHP is just as good at handling these operations as, say, Python, what libraries/projects should I look into?
|
Update datastore in Google App Engine from the iPhone
| 3,113,823 | 5 | 2 | 411 | 0 |
java,iphone,python,google-app-engine,google-cloud-datastore
|
Why not have the iPhone application communicate this information to app engine by making a simple HTTP request?
Specifically, I would do an HTTP POST to the server and include the relevant fields. Then your app engine request handler would simply store the information in the datastore.
| 0 | 1 | 0 | 0 |
2010-06-24T20:44:00.000
| 1 | 1.2 | true | 3,113,734 | 0 | 0 | 1 | 1 |
I'm working on an app that communicates with Google App Engine to update and retrieve user information, but I can't think of a way to modify elements in the datastore.
For example, every user for my app is represented by a User object in the datastore. If this user inputs things like email, phone number, etc into fields inside the iPhone application, I want to be able to update those objects in the datastore. The datastore can be in Java or Python, I'm just looking for an idea that will work.
Thanks
|
What's a good swiss-army framework for the next 5 years?
| 3,114,814 | 0 | 0 | 385 | 0 |
python,ruby-on-rails,ruby,frameworks
|
Rails will still be around in 5 years. So will C# (.net), silverlight etc. The Microsoft stack is too widely used to vanish.
| 0 | 0 | 0 | 0 |
2010-06-25T00:12:00.000
| 3 | 0 | false | 3,114,788 | 0 | 0 | 1 | 2 |
Basically, we want to use no flash, and eschew php where possible (for marketing reasons).
Right now, I'm looking at Ruby on Rails and like what I see... but I'm not really a programmer, having working primarily with Wordpress, Drupal, and Joomla for the past 10 years.
Our sites need to have a lot of custom apps built into them (video uploading and galleries, user accounts, employee time logging, and more) with consistant looks. We don't expect to have any high-traffic sites (nothing in excess of 500 unique views in a day).
Anyone think that Rails is Not a good choice for the next 5 years or so?
|
What's a good swiss-army framework for the next 5 years?
| 3,114,824 | 1 | 0 | 385 | 0 |
python,ruby-on-rails,ruby,frameworks
|
I'd say python/Django over RoR.
If you weren't avoiding PHP, Zend would be a safe(ish) bet for the next 5 years (probably).
Mind you, you're by your own admission not a programmer and you're at least partially basing an engineering/technical decision on marketing (OMFG), so I'd be more worried about you lasting 5 years than any framework you choose...
| 0 | 0 | 0 | 0 |
2010-06-25T00:12:00.000
| 3 | 0.066568 | false | 3,114,788 | 0 | 0 | 1 | 2 |
Basically, we want to use no flash, and eschew php where possible (for marketing reasons).
Right now, I'm looking at Ruby on Rails and like what I see... but I'm not really a programmer, having working primarily with Wordpress, Drupal, and Joomla for the past 10 years.
Our sites need to have a lot of custom apps built into them (video uploading and galleries, user accounts, employee time logging, and more) with consistant looks. We don't expect to have any high-traffic sites (nothing in excess of 500 unique views in a day).
Anyone think that Rails is Not a good choice for the next 5 years or so?
|
Django to do its own NTLM Authentication (HTTP Headers & all)
| 3,787,434 | 1 | 0 | 1,765 | 0 |
python,django,active-directory,ldap,ntlm
|
Partial answer:
You can (and should) pass the NTLM auth off to an external helper. Basically, install Samba on the machine, configure it, join the domain, enable winbind, then use the "ntlm_auth" helper binary, probably in "pipe" mode.
Authenticating an NTLM session requires a secure pipe to the domain controller, which needs credentials (e.g. a Samba/domain-member machine account). This is the quickest route to get there.
Squid (the webcache) has code for doing NTLM auth using the external helper; FreeRadius does something similar.
The NTLM auth itself does not provide any group info; if you're running winbind you could of course use calls to "wbinfo" to get user groups.
| 0 | 0 | 0 | 0 |
2010-06-25T19:47:00.000
| 1 | 1.2 | true | 3,120,956 | 0 | 0 | 1 | 1 |
I'm considering moving from Apache to Lighttpd for an internal web application, written with python. The problem is that I'm relying on libapache2-mod-auth-ntlm-winbind ... which doesn't actually seem to be a well support & updated package (though that could be because it really does work well).
I'm looking for suggestions and hints about what it would take to use django itself to handle the HTTP authentication. This would allow me to be web-server-agnostic, and could potentially be a grand learning experience.
Some topical concerns:
Is it reasonable to have the custom application perform true HTTP authentication?
How involved is getting my python code connected to windows domain controller to this kind of authentication without prompting the user for a password?
Does NTLM provide any access to user details & group memberships so that I can stop searching through yet another connection to the windows domain controller via LDAP?
I would love to be able to write a module to simplify this technique which could be shared with the community.
|
Django: vibrant community and future?
| 3,123,190 | 0 | 0 | 1,687 | 0 |
python,ruby-on-rails,ruby,django
|
From what I have seen neither one looks like it will become a niche any time soon, both have active communities and dedicated developers. Ruby and python are both great languages, and both are being actively developed as well. At some point Django will have to migrate from python 2.x to 3.y, which may be a little bit painful, but the same sort of thing can be expected from rails at some point in the future.
I think you have narrowed it down to the right two for being main stream yet not stagnant. They both have advantages and disadvantages, and if there isn't a clear reason to chose one or the other for your project, I would say go with the language you prefer. Python is my language of choice, so baring some killer reason to chose RoR, Django is the natural way to go to continue developing the way I like to. If you prefer ruby, I would recommend going with RoR unless Django seems to fit your application in a way RoR does not.
| 0 | 0 | 0 | 0 |
2010-06-26T06:10:00.000
| 3 | 0 | false | 3,122,923 | 0 | 0 | 1 | 2 |
I'm in that horrible questioning state. I'm trying to decide between Django and Rails.
From what I've read, Django probably fits my needs better, both from a "cultural" and goal point of view. The baked-in admin interface pretty much sells me alone. However, I have one critical concern: it looks like the Rails community is much larger. This could be a plus OR a minus; read on.
I have experience hanging my hat on a technology that does not have as vibrant a commmunity as its "competitor." I run a Mac consulting firm in the Bay Area. Up until very, very recently (like the last year!), finding resources for very difficult issues (especially server- and network-related) was so difficult that it was often not even worth trying. This is now changing rapidly due to the Halo Effect, but if it wasn't for Steve Jobs' return to Apple and the iPhone, the future would look just as bleak as the past.
So, while Django looks awesome, I am concerned about pigeonholing myself in yet another niche. I'm less concerned with my theoretical job prospects as a Django developer (I like my job) than I am with simply having resources available to create and maintain cutting-edge projects that can evolve with the Web, and not lag too far behind.
From the above point of view, it looks like Rails has the advantage. However, here's a problem I've noticed that seems to come from the vibrancy of the Rails community: Want to accomplish a particular Rails programming task you've never done before? Google it; you'll find three to six+ different plugins, each with as many advocates as detractors. How do you decide which to use without spending hours and hours learning and prototyping? How do you know that the one you choose won't be end-of-lifed in 12 months, and you'll have to redo that part of your app in order to stay current with the latest Rails distribution?
My latter point brings me right back to where I started: Django seems like a time-saver. Except now I have two reasons to think so, not just one.
I should mention that I've already spent a significant amount of time learning Ruby and Rails, dabbled a bit in Python, and quite prefer Ruby.
Would love your thoughts.
|
Django: vibrant community and future?
| 3,122,993 | 0 | 0 | 1,687 | 0 |
python,ruby-on-rails,ruby,django
|
What about Pylons?
| 0 | 0 | 0 | 0 |
2010-06-26T06:10:00.000
| 3 | 0 | false | 3,122,923 | 0 | 0 | 1 | 2 |
I'm in that horrible questioning state. I'm trying to decide between Django and Rails.
From what I've read, Django probably fits my needs better, both from a "cultural" and goal point of view. The baked-in admin interface pretty much sells me alone. However, I have one critical concern: it looks like the Rails community is much larger. This could be a plus OR a minus; read on.
I have experience hanging my hat on a technology that does not have as vibrant a commmunity as its "competitor." I run a Mac consulting firm in the Bay Area. Up until very, very recently (like the last year!), finding resources for very difficult issues (especially server- and network-related) was so difficult that it was often not even worth trying. This is now changing rapidly due to the Halo Effect, but if it wasn't for Steve Jobs' return to Apple and the iPhone, the future would look just as bleak as the past.
So, while Django looks awesome, I am concerned about pigeonholing myself in yet another niche. I'm less concerned with my theoretical job prospects as a Django developer (I like my job) than I am with simply having resources available to create and maintain cutting-edge projects that can evolve with the Web, and not lag too far behind.
From the above point of view, it looks like Rails has the advantage. However, here's a problem I've noticed that seems to come from the vibrancy of the Rails community: Want to accomplish a particular Rails programming task you've never done before? Google it; you'll find three to six+ different plugins, each with as many advocates as detractors. How do you decide which to use without spending hours and hours learning and prototyping? How do you know that the one you choose won't be end-of-lifed in 12 months, and you'll have to redo that part of your app in order to stay current with the latest Rails distribution?
My latter point brings me right back to where I started: Django seems like a time-saver. Except now I have two reasons to think so, not just one.
I should mention that I've already spent a significant amount of time learning Ruby and Rails, dabbled a bit in Python, and quite prefer Ruby.
Would love your thoughts.
|
Django for a simple web application
| 3,123,705 | 0 | 3 | 2,020 | 0 |
python,django
|
You definitely don't have to use a database with Django. Whether it fits your needs, only you can tell. There are other Python web frameworks that you can use.
| 0 | 0 | 0 | 0 |
2010-06-26T11:25:00.000
| 5 | 0 | false | 3,123,683 | 0 | 0 | 1 | 1 |
I'm developing an app (an API) in python and I would like to offer some of its functionality through a web interface (like web services do).
I've been looking at django, but I don't know if really fits well in my idea. I only want to create a web page that invokes to my API methods in order to acomplish the functionality that offers that web page. But, after followed the tutorial, I feel a little confused about the point of django. It seems to me to be more related with an ORM than a classic web application.
Is django a solution so heavy for such a simple development (as I mentioned, make calls to my API through the web)? Do I always have to use a database?
Thanks.
|
Remote execution of commands using the Django ORM
| 3,125,012 | 1 | 0 | 121 | 1 |
python,django,orm
|
If you can connect to the database remotely, then you can simply specify its host/port in settings.py exactly as you would a local one.
| 0 | 0 | 0 | 0 |
2010-06-26T12:05:00.000
| 1 | 0.197375 | false | 3,123,801 | 0 | 0 | 1 | 1 |
Can I somehow work with remote databases (if they can do it) with the Django ORM?
It is understood that the sitting has spelled out the local database. And periodically to make connection to various external databases and perform any sort of commands such as load dump.
|
Terminating android ASE shell from within the script
| 3,125,831 | 1 | 2 | 329 | 0 |
python,android,ase
|
You should use android.exit().
| 0 | 1 | 0 | 0 |
2010-06-26T19:56:00.000
| 2 | 0.099668 | false | 3,125,325 | 0 | 0 | 1 | 2 |
I'm using android scripting environment with python (ASE), and I'd like to terminate the shell executing the script when the script terminates.
Is there a good way to do this?
I have tried executing on the last line:
os.system( 'kill %d' % os.getppid() )
but to no avail.
|
Terminating android ASE shell from within the script
| 3,304,337 | 0 | 2 | 329 | 0 |
python,android,ase
|
My guess is that the above answer ought to be android.Android().exit()
| 0 | 1 | 0 | 0 |
2010-06-26T19:56:00.000
| 2 | 0 | false | 3,125,325 | 0 | 0 | 1 | 2 |
I'm using android scripting environment with python (ASE), and I'd like to terminate the shell executing the script when the script terminates.
Is there a good way to do this?
I have tried executing on the last line:
os.system( 'kill %d' % os.getppid() )
but to no avail.
|
What should I use for the backend of a 'social' website?
| 3,126,208 | 2 | 4 | 749 | 1 |
python,sql,mysql,database
|
MySQL is really your best choice for the database unless you want to go proprietary.
As for the actual language, pick whatever you are familiar with. While Youtube and Reddit are written in python, many of the other large sites use Ruby (Hulu, Twitter, Techcrunch) or C++ (Google) or PHP (Facebook, Yahoo, etc).
| 0 | 0 | 0 | 0 |
2010-06-27T02:19:00.000
| 4 | 0.099668 | false | 3,126,155 | 0 | 0 | 1 | 1 |
My two main requirements for the site are related to degrees of separation and graph matching (given two graphs, return some kind of similarity score).
My first thought was to use MySql to do it, which would probably work out okay for storing how I want to manage 'friends' (similar to Twitter), but I'm thinking if I want to show users results which will make use of graphing algorithms (like shortest path between two people) maybe it isn't the way to go for that.
My language of choice for the front end, would be Python using something like Pylons but I haven't committed to anything specific yet and would be willing to budge if it fitted well with a good backend solution.
I'm thinking of using MySQL for storing user profile data, neo4j for the graph information of relations between users and then have a Python application talk to both of them.
Maybe there is a simpler/more efficient way to do this kind of thing. At the moment for me it's more getting a suitable prototype done than worrying about scalability but I'm willing to invest some time learning something new if it'll save me time rewriting/porting in the future.
PS: I'm more of a programmer than a database designer, so I'd prefer having rewrite the frontend later rather than say porting over the database, which is the main reason I'm looking for advice.
|
URLs and side effects (Django)
| 3,127,296 | 2 | 4 | 334 | 0 |
python,django,url,post,django-views
|
A modified option #1 is the best approach. Consider this: suppose we weren't talking about a web app, but instead were just designing an inbox class. Which do you like better, a number of methods (delete_message(), mark_as_spam(), etc), or one big method (do_stuff(action))? Of course you would use the separate methods.
A separate URL for each action, each with a separate view, is far preferable. If you don't like the redirect at the end, then don't use it. Instead, have a render_inbox(request) method that returns an HttpResponse, and call the method at the end of each of your views. Of course, redirecting after a POST is a good way to prevent double-actions, and always leaves the user with a consistent URL.
Even better might be to use Ajax to hide the actions, but that is more involved.
| 0 | 0 | 0 | 0 |
2010-06-27T09:36:00.000
| 4 | 1.2 | true | 3,126,969 | 0 | 0 | 1 | 4 |
I'm wondering if it's considered okay (particularly, in Django) to have a URL that's only intended for actions with side effects, that's only intended to be accessed by POST, and that is basically invisible to the user. Let's say, for the sake of making this concrete, I have a little messaging system on my site, and from their inbox, a user should be able to do a bunch of things like:
Delete a message
Mark a message as read
Report a message as spam
With all of those things causing a page refresh, but leading back to the same page. I'm wondering how to design my URLs and views around this. I see (at least) two options, and I have no idea which is more idiomatic.
Option 1)
Have a separate URL and view for each action. So, /inbox/delete-message/ maps to views.delete_message, and so on. At the end of each of those views, it redirects back to /inbox/.
I like the way things are clearly separated with this option. If a user somehow finds themselves sending a GET request to /inbox/delete-message/, that presents a sort of weird situation though (do I throw up an error page? silently redirect them?).
Option 2)
Use the same URL and view for each action, and have a POST parameter that identifies the action. So I would have one rather long inbox view, which would have a bunch of if statements testing whether request.POST['action'] == 'delete', or request.POST['delete'] == 'true' or whatever.
This option feels less clean to me, but I also feel like it's more common.
Which would be preferred by Djangonauts? Or is there another option that's better than either of the above?
|
URLs and side effects (Django)
| 3,127,290 | 1 | 4 | 334 | 0 |
python,django,url,post,django-views
|
If you're writing a web 2.0 messaging app, you would be using AJAX calls and wouldn't be loading a new page at all. The process would proceed like so:
User clicks [delete] for a message. This button has a javascript action bound to it. This action does the following:
i. Change the UI to indicate that something is happening (grey the message or put up an hourglass).
ii. Send a request to /messages/inbox/1234/delete. (where 1234 is some identifier that indicates which message)
iii. When the response from the server comes back, it should indicate success or failure. Reflect this status in the current UI. For example, on success, refresh the inbox view (or just remove the deleted item).
On the server side, now you can create a URL handler for each desired action (i.e. /delete, /flag, etc.).
If want to use an even more RESTful approach, you would use the HTTP action itself to indicate the action to perform. So instead of including delete in your URL, it would be in the action. So instead of GET or POST, use DELETE /messages/inbox/1234. To set a flag for having been read, use SET /messages/inbox/1234?read=true.
I don't know how straightforward it is in Django to implement this latter recommendation, but in general, it's a good idea utilize the protocol (in this case HTTP), rather than work around it by encoding your actions into a URL or parameter.
| 0 | 0 | 0 | 0 |
2010-06-27T09:36:00.000
| 4 | 0.049958 | false | 3,126,969 | 0 | 0 | 1 | 4 |
I'm wondering if it's considered okay (particularly, in Django) to have a URL that's only intended for actions with side effects, that's only intended to be accessed by POST, and that is basically invisible to the user. Let's say, for the sake of making this concrete, I have a little messaging system on my site, and from their inbox, a user should be able to do a bunch of things like:
Delete a message
Mark a message as read
Report a message as spam
With all of those things causing a page refresh, but leading back to the same page. I'm wondering how to design my URLs and views around this. I see (at least) two options, and I have no idea which is more idiomatic.
Option 1)
Have a separate URL and view for each action. So, /inbox/delete-message/ maps to views.delete_message, and so on. At the end of each of those views, it redirects back to /inbox/.
I like the way things are clearly separated with this option. If a user somehow finds themselves sending a GET request to /inbox/delete-message/, that presents a sort of weird situation though (do I throw up an error page? silently redirect them?).
Option 2)
Use the same URL and view for each action, and have a POST parameter that identifies the action. So I would have one rather long inbox view, which would have a bunch of if statements testing whether request.POST['action'] == 'delete', or request.POST['delete'] == 'true' or whatever.
This option feels less clean to me, but I also feel like it's more common.
Which would be preferred by Djangonauts? Or is there another option that's better than either of the above?
|
URLs and side effects (Django)
| 3,127,284 | 0 | 4 | 334 | 0 |
python,django,url,post,django-views
|
I agree that #2 is a better approach.
But take care with overloading the submit <input /> with different methods -- if a user is using it with keyboard input and hits enter, it won't necessarily submit the <input /> you're expecting. Either disable auto-submit-on-enter, or code things up so that if there is more than one thing that submit can do, there's another field that sets what the action should be (eg a 'delete' checkbox, which is tested during a request.POST)
If you went with #1 I'd say that a GET to a POST-only view should be met with a 405 (method not supported) - or, failing that, a 404.
| 0 | 0 | 0 | 0 |
2010-06-27T09:36:00.000
| 4 | 0 | false | 3,126,969 | 0 | 0 | 1 | 4 |
I'm wondering if it's considered okay (particularly, in Django) to have a URL that's only intended for actions with side effects, that's only intended to be accessed by POST, and that is basically invisible to the user. Let's say, for the sake of making this concrete, I have a little messaging system on my site, and from their inbox, a user should be able to do a bunch of things like:
Delete a message
Mark a message as read
Report a message as spam
With all of those things causing a page refresh, but leading back to the same page. I'm wondering how to design my URLs and views around this. I see (at least) two options, and I have no idea which is more idiomatic.
Option 1)
Have a separate URL and view for each action. So, /inbox/delete-message/ maps to views.delete_message, and so on. At the end of each of those views, it redirects back to /inbox/.
I like the way things are clearly separated with this option. If a user somehow finds themselves sending a GET request to /inbox/delete-message/, that presents a sort of weird situation though (do I throw up an error page? silently redirect them?).
Option 2)
Use the same URL and view for each action, and have a POST parameter that identifies the action. So I would have one rather long inbox view, which would have a bunch of if statements testing whether request.POST['action'] == 'delete', or request.POST['delete'] == 'true' or whatever.
This option feels less clean to me, but I also feel like it's more common.
Which would be preferred by Djangonauts? Or is there another option that's better than either of the above?
|
URLs and side effects (Django)
| 3,127,022 | 1 | 4 | 334 | 0 |
python,django,url,post,django-views
|
I don't think there's anything wrong with either option, but #2 is potentially better from a performance standpoint. After the action is posted you can render the inbox without a redirect, so it cuts down on the HTTP traffic.
| 0 | 0 | 0 | 0 |
2010-06-27T09:36:00.000
| 4 | 0.049958 | false | 3,126,969 | 0 | 0 | 1 | 4 |
I'm wondering if it's considered okay (particularly, in Django) to have a URL that's only intended for actions with side effects, that's only intended to be accessed by POST, and that is basically invisible to the user. Let's say, for the sake of making this concrete, I have a little messaging system on my site, and from their inbox, a user should be able to do a bunch of things like:
Delete a message
Mark a message as read
Report a message as spam
With all of those things causing a page refresh, but leading back to the same page. I'm wondering how to design my URLs and views around this. I see (at least) two options, and I have no idea which is more idiomatic.
Option 1)
Have a separate URL and view for each action. So, /inbox/delete-message/ maps to views.delete_message, and so on. At the end of each of those views, it redirects back to /inbox/.
I like the way things are clearly separated with this option. If a user somehow finds themselves sending a GET request to /inbox/delete-message/, that presents a sort of weird situation though (do I throw up an error page? silently redirect them?).
Option 2)
Use the same URL and view for each action, and have a POST parameter that identifies the action. So I would have one rather long inbox view, which would have a bunch of if statements testing whether request.POST['action'] == 'delete', or request.POST['delete'] == 'true' or whatever.
This option feels less clean to me, but I also feel like it's more common.
Which would be preferred by Djangonauts? Or is there another option that's better than either of the above?
|
Is it possible to run two versions of Python side-by-side?
| 3,130,801 | 0 | 4 | 758 | 0 |
python,google-app-engine
|
OK, I figured out the answer to my own question, partly with the help of Nicholas Knight who pointed out that you just install different Python version to different Python directories. I was left scratching my head on how to get Google App Engine to use Python 2.5 (the required version) instead of Python 2.6. This is the answer:
1) Install Python 2.5.
2) Install Python 2.6 (or a more recent version), afterwards. This will be the system default.
3) Install the Google App Engine SDK.
4) Launch, "Google App Engine Launcher" from the Start Menu
5) Click Edit > Preferences, and enter the path to the pythonw.exe executable. Usually c:\Python25\pythonw.exe
| 0 | 1 | 0 | 0 |
2010-06-27T16:07:00.000
| 3 | 0 | false | 3,127,915 | 1 | 0 | 1 | 2 |
I've been learning Python for a couple of weeks, and although I've been successfully develop apps for Google App Engine with Python 2.6.5, it specifically requires Python 2.5.
Being mindful of compatibility issues when uploading apps (it's a situation I'd rather avoid while learning Python), I wonder if it's possible to have 2.5 and 2.6.5 installed on the same machine. Ideally I'd like to use 2.6.5 as the default, and configure GAE to somehow use 2.5.
|
Is it possible to run two versions of Python side-by-side?
| 3,127,950 | 5 | 4 | 758 | 0 |
python,google-app-engine
|
Absolutely.
If you're on *nix, you'd usually just use make altinstall instead of make install, that way the "python" binary won't get installed/overwritten, but instead you'd have e.g. python2.5 or python2.6 installed. Using a separate --prefix with the configure script is also an option, of course.
Some Linux distributions will have multiple versions available via their package managers. They'll similarly be installed as python2.5 etc. (With the distribution's blessed/native version also installed as the regular python binary.)
Windows users generally just install to different directories.
| 0 | 1 | 0 | 0 |
2010-06-27T16:07:00.000
| 3 | 0.321513 | false | 3,127,915 | 1 | 0 | 1 | 2 |
I've been learning Python for a couple of weeks, and although I've been successfully develop apps for Google App Engine with Python 2.6.5, it specifically requires Python 2.5.
Being mindful of compatibility issues when uploading apps (it's a situation I'd rather avoid while learning Python), I wonder if it's possible to have 2.5 and 2.6.5 installed on the same machine. Ideally I'd like to use 2.6.5 as the default, and configure GAE to somehow use 2.5.
|
When matching html or xml tags, should one worry about casing?
| 3,127,997 | 5 | 1 | 98 | 0 |
python,html,xml
|
XML (and XHTML) tags are case-sensitive ... so <this> and <tHis> would be different elements.
However a lot (rough estimate) of HTML (not XHTML) tags are random-case.
| 0 | 0 | 1 | 0 |
2010-06-27T16:30:00.000
| 3 | 0.321513 | false | 3,127,984 | 0 | 0 | 1 | 3 |
If you are parsing html or xml (with python), and looking for certain tags, it can hurt performance to lower or uppercase an entire document so that your comparisons are accurate. What percentage (estimated) of xml and html docs use any upper case characters in their tags?
|
When matching html or xml tags, should one worry about casing?
| 3,128,006 | 2 | 1 | 98 | 0 |
python,html,xml
|
Only if you're using XHTML as this is case sensitive, whereas HTML is not so you can ignore case differences. Test for the doctype before worrying about checking for case.
| 0 | 0 | 1 | 0 |
2010-06-27T16:30:00.000
| 3 | 0.132549 | false | 3,127,984 | 0 | 0 | 1 | 3 |
If you are parsing html or xml (with python), and looking for certain tags, it can hurt performance to lower or uppercase an entire document so that your comparisons are accurate. What percentage (estimated) of xml and html docs use any upper case characters in their tags?
|
When matching html or xml tags, should one worry about casing?
| 3,128,078 | 1 | 1 | 98 | 0 |
python,html,xml
|
I think you're overly concerned about performance. If you're talking about arbitrary web pages, 90% of them will be HTML, not XHTML, so you should do case-insensitive comparisons. Lowercasing a string is extremely fast, and should be less than 1% of the total time of your parser. If you're not sure, carefully time your parser on a document that's already all lowercase, with and without the lowercase conversions.
Even a pure-Python implementation of lower() would be negligible compared to the rest of the parsing, but it's better than that - CPython implements lower() in C code, so it really is as fast as possible.
Remember, premature optimization is the root of all evil. Make your program correct first, then make it fast.
| 0 | 0 | 1 | 0 |
2010-06-27T16:30:00.000
| 3 | 1.2 | true | 3,127,984 | 0 | 0 | 1 | 3 |
If you are parsing html or xml (with python), and looking for certain tags, it can hurt performance to lower or uppercase an entire document so that your comparisons are accurate. What percentage (estimated) of xml and html docs use any upper case characters in their tags?
|
Model-View-Presenter and Three-Tier?
| 3,136,965 | 0 | 2 | 1,009 | 0 |
python,model,mvp,three-tier
|
I think the main differences is that in MVP/MVC, the view gets to reach into the model to get data, while in n-tier, there's a stricter separation, where each tier is only allowed to interface with the tier directly above/below it.
| 0 | 0 | 0 | 0 |
2010-06-28T01:36:00.000
| 3 | 0 | false | 3,129,633 | 0 | 0 | 1 | 3 |
What is the difference between the two architectures: Model-View-Presenter and Three-Tier?
I understand the definitions of each when read individually, but I can't readily see how they're different. Is it desktop vs web? I am currently developing a simple desktop application in Python to visualize a complicated data model via a GUI.
Thanks!
|
Model-View-Presenter and Three-Tier?
| 3,137,005 | 4 | 2 | 1,009 | 0 |
python,model,mvp,three-tier
|
MVC is an UI pattern, three tier is an application architecture pattern. That is you can design your application with 3 tiers - UI, BL, data. And than use MVC in the UI tier.
| 0 | 0 | 0 | 0 |
2010-06-28T01:36:00.000
| 3 | 1.2 | true | 3,129,633 | 0 | 0 | 1 | 3 |
What is the difference between the two architectures: Model-View-Presenter and Three-Tier?
I understand the definitions of each when read individually, but I can't readily see how they're different. Is it desktop vs web? I am currently developing a simple desktop application in Python to visualize a complicated data model via a GUI.
Thanks!
|
Model-View-Presenter and Three-Tier?
| 8,291,398 | 1 | 2 | 1,009 | 0 |
python,model,mvp,three-tier
|
MVC is a UI implementation pattern that attempts to simplify three tier architecture. MVC is just one of the ways you can implement three-tier.
| 0 | 0 | 0 | 0 |
2010-06-28T01:36:00.000
| 3 | 0.066568 | false | 3,129,633 | 0 | 0 | 1 | 3 |
What is the difference between the two architectures: Model-View-Presenter and Three-Tier?
I understand the definitions of each when read individually, but I can't readily see how they're different. Is it desktop vs web? I am currently developing a simple desktop application in Python to visualize a complicated data model via a GUI.
Thanks!
|
How do I tell django to not escape % and _ in a query
| 3,135,033 | 1 | 1 | 1,005 | 0 |
python,django
|
headline__contains='%' would mean headline is anything, no? In which case why include it in the query?
| 0 | 0 | 0 | 0 |
2010-06-28T17:54:00.000
| 2 | 0.099668 | false | 3,134,850 | 0 | 0 | 1 | 1 |
I want to be able to use wildcards in my django queries used for searching. However as the documentation says:
Entry.objects.filter(headline__contains='%')
Will result in SQL that looks something like this:
SELECT ... WHERE headline LIKE '%\%%';
How do I tell django to not escape % and _ in a query. Or is there another way to implement wildcard search in django (apart from writing the sql directly)?
|
Is Python (Django) experience professionaly comparable to Ruby on Rails?
| 3,136,189 | 0 | 3 | 458 | 0 |
python,ruby-on-rails,django
|
I interviewed for a Rails job once. I had almost no experience in Rails, although I had a fair amount of experience with Python and Django. I told the interviewer this up front, and I still got through several rounds of interviews, since the technical guys figured I could pick up the Rails stuff easily enough. (Ultimately I didn't get the job. Ah, well.)
But it probably depends on who is interviewing you. Some people might see the experience as comparable, others might not.
| 0 | 0 | 0 | 0 |
2010-06-28T21:07:00.000
| 3 | 0 | false | 3,136,131 | 0 | 0 | 1 | 2 |
I ask this because there seems to be a few more jobs available (at least by telecommute) in RoR. If an employer sees significant Python/Django experience on a resume, would it be plausible to believe that the developer would be able quickly learn Rails?
|
Is Python (Django) experience professionaly comparable to Ruby on Rails?
| 3,136,175 | 0 | 3 | 458 | 0 |
python,ruby-on-rails,django
|
I can't speak for all organizations, but as a hiring manager where I work, yes. I am really interested in experience with MVC in general. The specific technology / framework doesn't concern me as much as the fact that you understand what a model/view/controller framework is good for, and when to use it.
That said, if I see RoR and Python/Django, I'm probably going to pigeon-hole you as a front-end developer and push you towards the web apps division as opposed to our infrastructure division.
| 0 | 0 | 0 | 0 |
2010-06-28T21:07:00.000
| 3 | 0 | false | 3,136,131 | 0 | 0 | 1 | 2 |
I ask this because there seems to be a few more jobs available (at least by telecommute) in RoR. If an employer sees significant Python/Django experience on a resume, would it be plausible to believe that the developer would be able quickly learn Rails?
|
Trying to install Django via Macports on Leopard
| 3,139,071 | 0 | 2 | 936 | 0 |
python,django
|
Just "throw" the django tarball within the site-packages (dist-packages in py2.6+) and you are done. What for do you need macports etc, with a pure python library?
| 0 | 0 | 0 | 0 |
2010-06-28T21:52:00.000
| 3 | 0 | false | 3,136,423 | 1 | 0 | 1 | 1 |
I have Python 2.6 & 3.1 installed on Leopard via mac ports with no problems. I want to install Django 1.2 via mac ports for Python 2.6, but a google search of how to do it seems to point me in the wrong direction. Can anyone point me in the right direction? Thanks again.....
|
Highlight selected Tab - Python webpage
| 3,137,299 | 1 | 0 | 149 | 0 |
python
|
I think the best way would be through CSS. You can handle it by adding the pseudoclass :active to the CSS.
Other way is serving the page with a new class added to the tab, which will change the background color, but I would not recommend that.
| 0 | 0 | 1 | 0 |
2010-06-29T00:56:00.000
| 1 | 0.197375 | false | 3,137,167 | 0 | 0 | 1 | 1 |
I am trying to develop my first python web project. It have multiple tabs (like apple.com have Store, iPhone, iPad etc tabs) and when user click on any tab, the page is served from server.
I want to make sure that the selected tab will have different background color when page is loaded.
Which is a best way to do it? JavaScript/CSS/Directly from server? and How?
Thanks.
|
Installing django with python 2.5 and not with the default version of python
| 3,139,638 | 1 | 2 | 400 | 0 |
python,django
|
Django is 100% compatible with Python 2.4. However if you really want to use 2.5 you would probably be best off using a virtualenv and installing Django and your project inside that.
Don't forget if you do try and install 2.5, you will also need to recompile mod_wsgi to use it, as the system packaged version will only use 2.4.
| 0 | 0 | 0 | 0 |
2010-06-29T09:23:00.000
| 2 | 0.099668 | false | 3,139,372 | 1 | 0 | 1 | 1 |
I have to install Django on my linux server where python 2.4 is available as the default installation. I have installed python 2.5 as a separate version. Now I have to install Django which I have to use with python 2.5. Is there any specific requirement, so that it is installed with the python 2.5 and not with the default 2.4 version available on the server ?
Please suggest.
Thanks in advance.
|
python import depth
| 3,143,143 | 1 | 2 | 1,549 | 0 |
python,import,depth
|
Not really. A module imports stuff from other modules because it needs to use them in that module, otherwise it'll break.
| 0 | 0 | 0 | 0 |
2010-06-29T17:17:00.000
| 3 | 0.066568 | false | 3,143,106 | 1 | 0 | 1 | 3 |
I've noticed that importing a module will import its functions and methods, and the functions and methods of those as well. Is there a set rule for how many levels down python will import when you import an upper-level module?
edit
sorry, I think I've been misunderstood by the answers so far responding about multiple imports of some dependencies. I'm thinking of nested folders e.g. in django, if you import django, you can access django.contrib.auth, but you can't access django.contrib.auth.views unless you import that specifically. I was just wondering if it's always two levels down in such a case
second edit
to clarify again.. in the django example, the layout is /django/contrib/auth/views.py, where each of the subfolders has a "init.py" making it a module, none of which define any "all" attributes. Is my example bad, since maybe you can't use the dot syntax to navigate to a file within a module designated folder?
|
python import depth
| 3,143,155 | 3 | 2 | 1,549 | 0 |
python,import,depth
|
No, python will import what it needs to import. However, each module is only imported once. For example, if one module does import sys and another module does import sys, it will not physically do it twice.
| 0 | 0 | 0 | 0 |
2010-06-29T17:17:00.000
| 3 | 0.197375 | false | 3,143,106 | 1 | 0 | 1 | 3 |
I've noticed that importing a module will import its functions and methods, and the functions and methods of those as well. Is there a set rule for how many levels down python will import when you import an upper-level module?
edit
sorry, I think I've been misunderstood by the answers so far responding about multiple imports of some dependencies. I'm thinking of nested folders e.g. in django, if you import django, you can access django.contrib.auth, but you can't access django.contrib.auth.views unless you import that specifically. I was just wondering if it's always two levels down in such a case
second edit
to clarify again.. in the django example, the layout is /django/contrib/auth/views.py, where each of the subfolders has a "init.py" making it a module, none of which define any "all" attributes. Is my example bad, since maybe you can't use the dot syntax to navigate to a file within a module designated folder?
|
python import depth
| 3,143,238 | 1 | 2 | 1,549 | 0 |
python,import,depth
|
There is no pre-defined import depth level. Import statements are executed, just like any other python statement.
But, you may wonder, how are cycles avoided? Modules are added to sys.modules (i.e., cached) when they get imported for the first time, and that is the first location examined when an import statement is executed. So each module is loaded just once, although it may appear in many import statements.
| 0 | 0 | 0 | 0 |
2010-06-29T17:17:00.000
| 3 | 0.066568 | false | 3,143,106 | 1 | 0 | 1 | 3 |
I've noticed that importing a module will import its functions and methods, and the functions and methods of those as well. Is there a set rule for how many levels down python will import when you import an upper-level module?
edit
sorry, I think I've been misunderstood by the answers so far responding about multiple imports of some dependencies. I'm thinking of nested folders e.g. in django, if you import django, you can access django.contrib.auth, but you can't access django.contrib.auth.views unless you import that specifically. I was just wondering if it's always two levels down in such a case
second edit
to clarify again.. in the django example, the layout is /django/contrib/auth/views.py, where each of the subfolders has a "init.py" making it a module, none of which define any "all" attributes. Is my example bad, since maybe you can't use the dot syntax to navigate to a file within a module designated folder?
|
Architecting from scratch in Python: what to use?
| 3,143,591 | 4 | 20 | 4,392 | 0 |
python,orm,rest,frameworks
|
I'm new to python myself, and plan to get more in depth with it this year. I've had a few false starts at this, but always professional needs bring me back to PHP. The few times I've done some development, I've had really good experiences with web2py as a python framework. It's quite well done, and complete in features, while still being extremely lightweight. The database layer seems to be very flexible and mature.
As for TDD/BDD and the rest of your questions, I don't have any experience with python options, but would be interested to hear what others say.
| 0 | 0 | 0 | 1 |
2010-06-29T17:18:00.000
| 4 | 0.197375 | false | 3,143,115 | 0 | 0 | 1 | 1 |
I'm lucky enough to have full control over the architecture of my company's app, and I've decided to scrap our prototype written in Ruby/Rails and start afresh in Python. This is for a few reasons: I want to learn Python, I prefer the syntax and I've basically said "F**k it, let's do it."
So, baring in mind this is going to be a pretty intensive app, I'd like to hear your opinions on the following:
Generic web frameworks
ORM/Database Layer (perhaps to work with MongoDB)
RESTful API w/ oAuth/xAuth authentication
Testing/BDD support
Message queue (I'd like to keep this in Python if possible)
The API is going to need to interface with a Clojure app to handle some internal data stuff, and interface with the message queue, so if it's not Python it'd be great to have some libraries to it.
TDD/BDD is very important to me, so the more tested, the better!
It'll be really interesting to read your thoughts on this. Much appreciated.
My best,
Jamie
|
How can I use google app engine?
| 3,143,745 | 0 | 0 | 171 | 0 |
python,google-app-engine,web-applications,webstore
|
It is hard to say if App Engine is suited to your particular needs without more details about what functionality you want your web store to present. It also depends a little bit on your background and experience.
However, the "app like feel" and crafting a "completely unique feel" for your site is something you can accomplish on any reasonable platform - I expect the presentation style will be relatively independent of the backend you choose.
| 0 | 1 | 0 | 0 |
2010-06-29T18:38:00.000
| 2 | 0 | false | 3,143,703 | 0 | 0 | 1 | 2 |
I've begun planning a kind of web store interface that I want to work on soon. I'm starting to import products from China and want to have a completely unique feel for my site. Now I'm kinda a google fanboy and have heard alot about google app engine. Mostly I like the hosting available with google more then anything though. But I wanted to know, would the App Engine be good for what I'm making?
Namely a web store with an app like feel. I've decided, to help if I ever need to move my host, to work in web2py hosted in the App Engine. Or would I be better with django or something on a normal host?
Is google best for webapps? Or is it pretty well suited for webstores as well?
Thanks
|
How can I use google app engine?
| 3,143,763 | 0 | 0 | 171 | 0 |
python,google-app-engine,web-applications,webstore
|
You can build almost anything on GAE. As Monk would say that is a blessing and a curse. GAE is relatively new and so e commerce ventures are relatively rare. This means you would be responsible for every piece of the site. Other dedicated e commerce technologies trade some of the control and look and feel for ease of use/setup.
So in short yes you could use GAE to create an e commerce site, but you would be spending a lot of time getting it up and running and then managing it. Time you may find better spent on sales and marketing.
| 0 | 1 | 0 | 0 |
2010-06-29T18:38:00.000
| 2 | 1.2 | true | 3,143,703 | 0 | 0 | 1 | 2 |
I've begun planning a kind of web store interface that I want to work on soon. I'm starting to import products from China and want to have a completely unique feel for my site. Now I'm kinda a google fanboy and have heard alot about google app engine. Mostly I like the hosting available with google more then anything though. But I wanted to know, would the App Engine be good for what I'm making?
Namely a web store with an app like feel. I've decided, to help if I ever need to move my host, to work in web2py hosted in the App Engine. Or would I be better with django or something on a normal host?
Is google best for webapps? Or is it pretty well suited for webstores as well?
Thanks
|
how to detect bounce mail in google app engine?
| 3,194,130 | 0 | 3 | 1,227 | 0 |
python,google-app-engine,email
|
easiest is to encode an email address via base64 or simiar encoding and prefixed it to from address.
all address from [email protected] are valid email address for from in gae.
simply create a mail receive handler. decode the from string and get the email address to whom you send the email originally.
sad thing is maximum 64 character length allowed for local part. in that case storing email address in datastore and using its key as a local part to email can be a option.
| 0 | 1 | 0 | 1 |
2010-06-30T07:38:00.000
| 4 | 1.2 | true | 3,147,267 | 0 | 0 | 1 | 1 |
sometime due to wrong input from user side, mail bounce and did not reach the recipient. ( sent from google app engine.)
How to detect such email ?
edit:
may be i was not clear in my question :
I want to know to which mail i have sent the mail which was return ( so that i may alert the user or delete the email id ). this is more related to how email bounce works. normally the bounce mail does not come exactly same as sent but with different information, is there any particular header or something there to know which email id was that ? ... i think i have figure out while writing these, i am keeping this question so it might help somebody.
i will simply mail from [email protected] and create a mail receive handler. :)
so one more question : what is the maximum length does app-engine ( or any mail server ) allows for email address ?
|
Global Exception Handling in Google App Engine
| 3,154,925 | 0 | 2 | 1,028 | 0 |
python,google-app-engine,exception-handling,global
|
You application probably has a main() function, put the try/except in that function, and it'll catch everything from your application.
| 0 | 1 | 0 | 0 |
2010-07-01T03:26:00.000
| 3 | 0 | false | 3,154,900 | 0 | 0 | 1 | 2 |
Instead of encapsulating my entire code in a try{} except{} block, is there someway of catching exceptions globally?
Basically I am looking for a way to have a global exception handler which will handle all unhandled exceptions in the my python application written for google app engine
|
Global Exception Handling in Google App Engine
| 3,154,924 | 0 | 2 | 1,028 | 0 |
python,google-app-engine,exception-handling,global
|
Well, at the most basic level you could wrap all of your handler scripts referenced by app.yaml in a giant try-except block.
If you are using the webapp framework, consider overriding handle_exception() for each of your request handlers. If you want all of your request handlers to have some basic exception handling that you specify, you could a request handler which implements this method and then derive all of your handlers from it.
| 0 | 1 | 0 | 0 |
2010-07-01T03:26:00.000
| 3 | 0 | false | 3,154,900 | 0 | 0 | 1 | 2 |
Instead of encapsulating my entire code in a try{} except{} block, is there someway of catching exceptions globally?
Basically I am looking for a way to have a global exception handler which will handle all unhandled exceptions in the my python application written for google app engine
|
Is Django admin difficult to customize?
| 33,733,949 | 1 | 25 | 21,336 | 0 |
python,django,django-admin,customization
|
Django Admin is easy to customize if your requirements match what is customizable in Django. If you need fancy features that are not out-of-the-box functionality you either need to find a plugin that does it, or implement it yourself by subclassing the appropriate classes. Which can be difficult, and requires good understanding of the internals of Django.
So in summary: it makes it easier to setup an admin, but if you need anything special that's not out of the box: you got a steep learning curve.
Depending on your requirements you can choose to use django or not. Anything that requires a lot of functional speccing is better of implemented manually.
| 0 | 0 | 0 | 0 |
2010-07-01T06:52:00.000
| 4 | 0.049958 | false | 3,155,624 | 0 | 0 | 1 | 2 |
I have been playing for a couple of days with Django Admin to explore it, but I am still clueless of how it can be customized in the way we need.
Every time I look for any help for the customization in the admin panel, what I find is, a bunch of articles on various communities and forums, explaining how to customize the template, the lists items, the the column views etc. But that should not be called Django Customization.
If I need to make even a small change in the User functionality or any modification to the auth module. It takes a lots of efforts even in figuring out how that can be done.
Is Django that difficult to customize or its just lack of the help available over internet for this or its me who is moving in the wrong direction ?
|
Is Django admin difficult to customize?
| 11,705,960 | 3 | 25 | 21,336 | 0 |
python,django,django-admin,customization
|
Personally, if you want a site to look like the admin, why not pull the templates and styles and use them, build your own views for what you need. Gobs of documentation and forum help is there for that. I like the idea of customizing the admin, but honestly, I have been doing it for awhile on a project and time and time again I think to myself, if this was built in the standard MVC (or MTV) manner with free templates online, copied admin ones, or some professionally made ones, and built with the plethora of addons and my code, it would be much easier!!! And, when you decide that request/response isn't cutting it, and you want to add lots of JavaScript, you'll be glad. I know. I have had to put all sorts of JavaScript on our Admin project. Mostly because it's impossible to make the admin do what we want, so we fix it with JavaScript once it is on screen. When you find yourself writing an Ajax based system, you'll wonder why you have the admin at all.
If I could start this project over, I might not even use Django, but I probably would. I most certainly won't used the Admin.
Now, if you are building an basic CRUD type site that doesn't have style-eyed users, then Django with grappelli, and some elbow grease will get the job done. Remember, Django is a collection of Python scripts. Just override everything you can, and you'll get there, if you aren't too ambitious.
| 0 | 0 | 0 | 0 |
2010-07-01T06:52:00.000
| 4 | 0.148885 | false | 3,155,624 | 0 | 0 | 1 | 2 |
I have been playing for a couple of days with Django Admin to explore it, but I am still clueless of how it can be customized in the way we need.
Every time I look for any help for the customization in the admin panel, what I find is, a bunch of articles on various communities and forums, explaining how to customize the template, the lists items, the the column views etc. But that should not be called Django Customization.
If I need to make even a small change in the User functionality or any modification to the auth module. It takes a lots of efforts even in figuring out how that can be done.
Is Django that difficult to customize or its just lack of the help available over internet for this or its me who is moving in the wrong direction ?
|
Logging activity on Django's admin - Django
| 3,157,915 | 17 | 32 | 30,210 | 0 |
python,django,logging,django-admin
|
Log is in django_admin_log table in database used by django.
| 0 | 0 | 0 | 0 |
2010-07-01T12:45:00.000
| 3 | 1 | false | 3,157,875 | 0 | 0 | 1 | 1 |
I need to track/log activity on the Django admin.
I know there are messages stored by admin somewhere, but I don't know how to access them in order to use them as a simple log.
I'm trying to track the following:
User performing the action
Action committed
Datetime of action
Thanks guys.
|
Django Admin Intermittently Returning 404 On Model Edit
| 7,615,435 | 4 | 4 | 1,528 | 0 |
python,django,django-admin,http-status-code-404
|
I had this same problem. The solution for me was to move my calls to admin.site.register() to admin.py. With DEBUG set to false, your models are lazily loaded, so the registration calls don't always get made. Apparently admin.py is always loaded at init time, however.
| 0 | 0 | 0 | 0 |
2010-07-01T14:12:00.000
| 3 | 1.2 | true | 3,158,589 | 0 | 0 | 1 | 1 |
We're using the Django Admin to maintain some data that's exported to a few of our sites. Sometimes when clicking through the standard changelist view to get a model edit form instead of being routed to the correct page we're getting the Django 404 page/template.
It was happening somewhat sporatically, and we could for a while reproduce it by reloading three times:
First F5: 404
Second F5: 404
Third F5: Object change form loads correctly
But lately it's been returning 404 more often than not. It seems to reduce the odds of returning 404 when we bounce apache (gracefully) and gets worse (again, seemingly) with more requests.
Running Django 1.2.1 on Fast-CGI/MySQL 5.1.x
FWIW, I can't reproduce the problem on my VM, but I'm running mod_wsgi there and have Debug=True set in the settings. Otherwise the code and database is identical.
|
Google application engine, maximum number of static files?
| 3,166,662 | 5 | 3 | 1,582 | 0 |
python,django,google-app-engine
|
Welcome to Stack Overflow!
One of the limitations in App Engine is that you cannot write directly to the filesystem from your app. Static files would be things like HTML, CSS, javascript and images that are global to your application, and get uploaded manually when you deploy. They are uploaded to and served from different servers than the ones that handle dynamic content.
Since you can't write to the filesystem from your app, files uploaded by users must be saved to the datastore as blobs. These are not considered static files. As others have mentioned, you can use S3 or the Blobstore API, however both of these require billing. With the free quotas, each entity can be up to 1MB, and each HTTP request and response can be up to 10MB. Using standard entities with a BlobProperty, you can easily store and serve dynamically uploaded files up to 1MB, or 10MB if you want to get fancy and store your blob in slices across multiple entities.
| 0 | 1 | 0 | 0 |
2010-07-02T12:46:00.000
| 3 | 1.2 | true | 3,165,753 | 0 | 0 | 1 | 1 |
I am developing an application in google application engine which would have a user profiles kind of feature. I was going through the Google App's online tutorial where I found that the maximum number of static files (app files and static files) should not exceed 3000. I am afraid whether the user's would be able to upload their images when the number of users increase. Is this limitation for the Free Quota only or its even after billing. In the document, its mentioned as the additional limit than the Free Quota.
Please suggest.
Thanks in advance.
|
Complex HTML parsing with Python
| 3,167,761 | 2 | 4 | 921 | 0 |
python,html-parsing
|
BeautifulSoup is a nice library and provides a good way to parse HTML with some handy ways to parse the data very easily.
What you are trying to do, can easily be done using some simple regular expressions. You can write regular expressions to search for a particular pattern of data and extract the data you need.
| 0 | 0 | 1 | 0 |
2010-07-02T17:00:00.000
| 3 | 0.132549 | false | 3,167,679 | 0 | 0 | 1 | 1 |
I am already aware of tag based HTML parsing in Python using BeautifulSoup, htmllib etc.
However, I want a powerful engine which can do complex tasks like read html tables, lists etc. and present these as simple to use objects within code. Does python have such powerful libraries?
|
What data type should my widgets accept/return?
| 3,169,254 | 2 | 2 | 80 | 0 |
python,design-patterns
|
While simply passing strings around seems like a useful idea, I think you're going to discover it doesn't work as well as you might hope.
Think about the date example—instead of passing around a date object, instead you pass around a str of the format "2010-01-01". In order to work with that data, every user of the class needs to know not only that it's a str which represents a date, but what the format of that string is. In other words, you haven't gained anything. Worse, you lose the ability to pass a datetime object into the widget (unless you take extra steps to deal with that case).
The validator or formatter issue isn't as big a deal as you might think; how often are you going to want to validate a string which doesn't represent a date as if it were a date?
| 1 | 0 | 0 | 0 |
2010-07-02T21:04:00.000
| 2 | 1.2 | true | 3,169,096 | 1 | 0 | 1 | 2 |
I'm building a form class in python for producing and validating HTML forms. Each field has an associated widget which defines how the field is rendered.
When the widget is created, it is passed in a (default) value so that it knows what to display the first time it is rendered. After the form is submitted, the widget is asked for a value. I delegate this to the widget rather than just nabbing it from the POST data because a widget may consist of several HTML inputs (think of a month/day/year selector). Only the widget knows how to mash these together into one value.
Problem is, I don't know if I should have the widget always accept a string, and always return a string for consistency, or accept and return a data type consistent with its purpose (i.e., a date selector should probably return a DateTime object).
The philosophy behind my form class is "mix and match". You choose what widget you want, and what validators/formatters/converters you want to run on it. Which I guess lends itself towards "use strings" and let the developer decide on the data type afterwords, but... I can't think of a good but. Do you anticipate any problems with this approach?
|
What data type should my widgets accept/return?
| 3,169,184 | 1 | 2 | 80 | 0 |
python,design-patterns
|
This approach is quite generic and serializing to and from strings should always work fine. You could also save the state of a widget to a file or send it over a network for recreating another widget from it.
Some potential issues or aspects to consider:
Localization: how to interpret the string regarding the culture, which format is the canonical format for comparisons.
Performance: some transformations might be time consuming, but I assume for human interaction that will be far fast enough.
| 1 | 0 | 0 | 0 |
2010-07-02T21:04:00.000
| 2 | 0.099668 | false | 3,169,096 | 1 | 0 | 1 | 2 |
I'm building a form class in python for producing and validating HTML forms. Each field has an associated widget which defines how the field is rendered.
When the widget is created, it is passed in a (default) value so that it knows what to display the first time it is rendered. After the form is submitted, the widget is asked for a value. I delegate this to the widget rather than just nabbing it from the POST data because a widget may consist of several HTML inputs (think of a month/day/year selector). Only the widget knows how to mash these together into one value.
Problem is, I don't know if I should have the widget always accept a string, and always return a string for consistency, or accept and return a data type consistent with its purpose (i.e., a date selector should probably return a DateTime object).
The philosophy behind my form class is "mix and match". You choose what widget you want, and what validators/formatters/converters you want to run on it. Which I guess lends itself towards "use strings" and let the developer decide on the data type afterwords, but... I can't think of a good but. Do you anticipate any problems with this approach?
|
Is there any way to store cookies in django which is independent to browser?
| 3,172,147 | 0 | 0 | 404 | 0 |
python,django,flash,cookies
|
There is no way to set cookie, so that it would be available in all browsers on computer. You can do it in Flash, because it is external library (one for all browsers).
| 0 | 0 | 0 | 0 |
2010-07-03T11:53:00.000
| 3 | 0 | false | 3,171,404 | 0 | 0 | 1 | 2 |
Is there any way in django to store cookies which is independent to browser ?
is there any technique just like what flash SharedObject does ..?
|
Is there any way to store cookies in django which is independent to browser?
| 3,171,859 | 1 | 0 | 404 | 0 |
python,django,flash,cookies
|
As it's explain in the link you give in your comment, Shared Objects are not stored as browser cookies, they are completely managed by the Flash Player. That's why they are independent of the browser.
So the answer is no, you can't store a cookie that is independent of the browser with Django (or any other web framework).
A possible solution is, if your visitor need to log to your site, you can store the info on the server, probably in a database. But if you don't required users to be log in, it will not work. Your other solution is to use Flash only to store the cookies.
| 0 | 0 | 0 | 0 |
2010-07-03T11:53:00.000
| 3 | 0.066568 | false | 3,171,404 | 0 | 0 | 1 | 2 |
Is there any way in django to store cookies which is independent to browser ?
is there any technique just like what flash SharedObject does ..?
|
Setting variable values in JavaScript files
| 3,171,774 | 1 | 1 | 2,283 | 0 |
javascript,python,scripting
|
It is not possible, as Javascript usually runs on the client side, while Python runs on the server side.
If it is code that needs to run on the client side, have it send an AJAX request to a python script with the results you need. If it does not need to run on the client side, I suggest you rewrite it in Python.
| 0 | 0 | 0 | 0 |
2010-07-03T14:21:00.000
| 4 | 0.049958 | false | 3,171,768 | 1 | 0 | 1 | 1 |
I have a Python script and a JS on my server. In the python script, I want to set the value of a variable to be the output of one of the functions in my .js file.
Is this possible, and if so how wold one go about doing this?
Thanks!
|
How to send SMS using Python/Django application?
| 3,172,331 | 3 | 5 | 4,227 | 0 |
python,django,sms
|
Typically you would use normal HTTP GET or POST requests against an SMS Gateway, such as Clickatell and many many others.
| 0 | 0 | 0 | 1 |
2010-07-03T17:47:00.000
| 6 | 0.099668 | false | 3,172,291 | 0 | 0 | 1 | 1 |
I have to develop an application where I need to send SMS to the users on a particular action by the users.
I have heard of kannel with PHP, is there some help for the same in Python as well or is there any other better open source sms gateway which I can use with my application?
Please suggest.
Thanks in advance.
|
Python: Google App Engine source uses tab depth 2
| 3,172,928 | -6 | 3 | 468 | 0 |
python,google-app-engine
|
It's miserably bad style. 2-space indentation is simply unreadable. Don't copy it. Never use less than 4 spaces to indent in any language.
(Don't assume that something is good simply because Google source is doing it. If you've ever spent some time looking through the Android source you'd know that there's as much incompetently-written code developed at Google as there is at any other company.)
| 0 | 1 | 0 | 0 |
2010-07-03T21:10:00.000
| 3 | -1 | false | 3,172,893 | 0 | 0 | 1 | 1 |
Looking through the Google App Engine source, I noticed that the tab depth is 2 spaces instead of the conventional 4. Is there some wisdom behind this, or is it just someone's preference?
(Maybe it's trivial, or maybe Google knows something that isn't immediately obvious.)
UPDATE I wasn't suggesting that it ran differently based on the tab depth. But perhaps there's a good reason for their style.
|
App Engine SDK: How do I view keys in a specific namespace using the Memcache Viewer?
| 3,322,690 | 0 | 2 | 435 | 0 |
python,google-app-engine,memcached
|
Not possible. In dev, check namespace'd memcache items programmatically, e.g. using a handler.
Credit: moraes on #appengine / freenode (validated by looking at source)
| 0 | 1 | 0 | 0 |
2010-07-04T16:59:00.000
| 1 | 1.2 | true | 3,175,462 | 0 | 0 | 1 | 1 |
I'm trying to use the Memcache Viewer in the App Engine Dev Console to view keys in a specific namespace. The obvious syntax of namespace.key is not working; I haven't been able to find documentation describing specific usage. Is this possible?
|
best python lib to make the textarea safe in the web page when user submit
| 3,176,415 | 0 | 2 | 124 | 0 |
python,textarea,tags
|
You can try Web2py , it is a webframework for python with support for Wiki Markup , MarkDown , and many things + Server side Validation , XSS Prevention. If you want to use only it's Lib you can use gluon of web2py (which is lib of web2py framework)
www.web2py.com
| 0 | 0 | 0 | 0 |
2010-07-04T19:21:00.000
| 2 | 0 | false | 3,175,925 | 0 | 0 | 1 | 1 |
i want to clean some tag like : <script> and other,
so what python lib you are using to do this .
thanks
|
How to add Google Analytics to reStructuredText?
| 3,176,894 | 1 | 3 | 616 | 0 |
python,restructuredtext,docutils
|
As a workaround to your problem, you could use a mass search/replace tool to add the Google Analytics code to the files after they have been through the translator. Just search for the </body> tag and replace it with <!--your tracking code--></body>.
I checked to see if you can include raw HTML in reStructuredText (and have it be untouched), but it doesn't seem possible...
| 0 | 0 | 0 | 0 |
2010-07-04T21:20:00.000
| 4 | 0.049958 | false | 3,176,258 | 0 | 0 | 1 | 1 |
I am using reStructured text to create some easy websites.
So I have got a lot of *.rst files in which I want to add the Google Analytics code.
But as far as I know it is not possible to add something like this?!
I am using rst2html to convert the files to html.
|
Is it possible, and/or advisable to develop Django web applications on OS X (10.6.4 and 10.5.8) using Python 2.6.5 64-bit? Why?
| 3,223,404 | 1 | 0 | 73 | 0 |
python,django,64-bit,x86-64,python-2.6
|
It certainly is possible: I do it every day.
Some tips:
use virtualenv to sandbox your python packages between projects.
use mod_passenger (via Passenger.prefpane) to make VirtualHosts easier to deal with.
You may need to fiddle a bit harder with things if you run stuff under mod_python, as I recall having to work hard to get a version compiled that worked with the version of apache that is installed by default, and the python I was using.
| 0 | 0 | 0 | 0 |
2010-07-05T00:30:00.000
| 2 | 0.099668 | false | 3,176,695 | 0 | 0 | 1 | 2 |
I'm trying to decide on which architecture to choose for developing Django 1.0.x through Django 1.2.1. I've managed to get MySQL, MySQLdb, PIL, and Python 2.65 installed on Snow Leopard using x86 64-bit builds, but I'm curious as to whether or not there is a definitive answer to this question at the moment, and if so, why?
Thank you!
Michaux
|
Is it possible, and/or advisable to develop Django web applications on OS X (10.6.4 and 10.5.8) using Python 2.6.5 64-bit? Why?
| 3,176,702 | 1 | 0 | 73 | 0 |
python,django,64-bit,x86-64,python-2.6
|
Of course it's possible. Advisable? You didn't mention httpd and mod_wsgi, or some other WSGI container. Get one installed and it should be fine.
| 0 | 0 | 0 | 0 |
2010-07-05T00:30:00.000
| 2 | 1.2 | true | 3,176,695 | 0 | 0 | 1 | 2 |
I'm trying to decide on which architecture to choose for developing Django 1.0.x through Django 1.2.1. I've managed to get MySQL, MySQLdb, PIL, and Python 2.65 installed on Snow Leopard using x86 64-bit builds, but I'm curious as to whether or not there is a definitive answer to this question at the moment, and if so, why?
Thank you!
Michaux
|
How do I print some python function output to console (for debugging purposes, while using manage.py runserver) from within a django template
| 3,178,961 | 0 | 0 | 303 | 0 |
python,django,django-templates
|
You could put pdb on the form field render surely?
If you really want to spit the field value out to some sort of log then I recommend using logging and putting the logger into the form field's unicode method (or str depending on what version of django).
| 0 | 0 | 0 | 0 |
2010-07-05T07:28:00.000
| 2 | 0 | false | 3,177,759 | 1 | 0 | 1 | 2 |
I am working on a custom Django form field and accompanying widget. While rendering the template, i would like to inspect the form.field as a python object.
How do I do that, because anything in a Django template outside of template tags and filters is rendered as text.
|
How do I print some python function output to console (for debugging purposes, while using manage.py runserver) from within a django template
| 3,177,791 | 1 | 0 | 303 | 0 |
python,django,django-templates
|
You'll need to write and install a custom tag (or filter... though that might considered be somewhat bizarre, it may help you fit in more places) that, as a side effect, performs the logging calls you desire (or print>>sys.stderr or whatever).
| 0 | 0 | 0 | 0 |
2010-07-05T07:28:00.000
| 2 | 1.2 | true | 3,177,759 | 1 | 0 | 1 | 2 |
I am working on a custom Django form field and accompanying widget. While rendering the template, i would like to inspect the form.field as a python object.
How do I do that, because anything in a Django template outside of template tags and filters is rendered as text.
|
Django apps equivalent to Drupal's CCK and Views modules?
| 3,177,922 | 1 | 5 | 1,026 | 0 |
python,django,drupal,drupal-views,django-apps
|
I don't think there is something similar and for a good reason. Django is a framework, while Drupal is a full scale CMS. One of the powerful things about Drupal, is how it handles content. Every piece of content is a node, and it lets developers make modules that can add to a node's functionality.
Django is a great tool to, but it's strength is more the ease of development, that lets you create applications very fast. That is what it was built for after all. It would be hard to make something CCK and Views like with Django, and I don't think it would make much sense either. I find that when developing with Django, you can very quickly create most CCK and views things, withe Django models and the orm. You can't do it in a GUI, but that was never the goal of Django. The admin interface also reflects that, as it is good mainly for one thing. Handling content, CRUD style operations. I guess that is why Satchmo created their own settings system for shops.
| 0 | 0 | 0 | 0 |
2010-07-05T07:31:00.000
| 4 | 0.049958 | false | 3,177,772 | 0 | 0 | 1 | 3 |
Are there any Django apps equivalent to Drupal's Views and CCK modules?
I find Django much more flexible and logically organized than Drupal. But I think Drupal's Views and CCK modules are killer apps. They let the webmaster very rapidly to build new data models and queries through GUI without touching the code. These modules are very useful for rapid application development. Do you know any similar apps in Django?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.