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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Internal Server Error on Django Deploy
| 3,322,601 | 3 | 1 | 2,142 | 0 |
python,django,apache,django-admin,deployment
|
Set DEBUG = True so that you can see the Django traceback
| 0 | 0 | 0 | 0 |
2010-07-23T20:19:00.000
| 2 | 0.291313 | false | 3,322,052 | 0 | 0 | 1 | 2 |
Im getting 500 internal server error everytime I try access my admin or login page. There's nothing in my error.log
Any ideas ?
|
Internal Server Error on Django Deploy
| 3,391,645 | 3 | 1 | 2,142 | 0 |
python,django,apache,django-admin,deployment
|
My DEBUG was set True. I found the error on my apache_log. The problem was that my sqlite3 database was a read only file.
| 0 | 0 | 0 | 0 |
2010-07-23T20:19:00.000
| 2 | 1.2 | true | 3,322,052 | 0 | 0 | 1 | 2 |
Im getting 500 internal server error everytime I try access my admin or login page. There's nothing in my error.log
Any ideas ?
|
Am I supposed to directly modify User models in auth modules in frameworks?
| 3,323,179 | 1 | 0 | 56 | 0 |
python,django,frameworks,turbogears
|
The latter: build a model with a one to one relationship to the User. Don't modify the django one directly or you'll likely run into trouble sooner or later. The django team won't be taking your changes into account after all and you could be adversely impacted if any internal changes are made. (Though you needn't worry about compatibility with the external interface to your own application.)
| 0 | 0 | 0 | 0 |
2010-07-23T23:43:00.000
| 1 | 1.2 | true | 3,323,139 | 0 | 0 | 1 | 1 |
I am new to using Frameworks for web development and I have noticed that frameworks like django, turbogears etc come with auth packages which contains user models. Am I supposed to directly modify these and use them as my User models or am I supposed to associate my own user models to these and use them just for authentication?
|
Maven equivalent for python
| 4,560,558 | 6 | 162 | 113,883 | 0 |
python,deployment,dependency-management
|
It's good to use virtualenv to create standalone project environment and use pip/easy_install to management dependencies.
| 0 | 1 | 0 | 0 |
2010-07-24T06:41:00.000
| 5 | 1 | false | 3,324,108 | 0 | 0 | 1 | 1 |
I'm a java developer/python beginner, and I'm missing my maven features, particularly dependency management and build automation (I mean you don't build, but how to create a package for deployment?)
Is there a python equivalent to achieve these features?
Note: I use python 2.x
Thanks.
|
Which technology should I use to develop a high performance web application
| 3,324,710 | 1 | 0 | 3,428 | 0 |
c#,java,python
|
I kinda think this is almost more like a religious problem, than a real technical issue. For almost every programming language you can find a big website that's using it.
.NET -> Microsoft
Ruby -> Twitter (yes, they have a few issues, but still)
PHP -> Facebook
Java -> Lots of finance companies
Don't know about Phyton, but I'm sure there is.
More important is a good scalable architecture. That is where Twitter kinda screwed it up it seems.
Personally I use ASP.NET. Works fine, is somewhat easy and has a nice IDE. And the market is not so fragmented. Before I used Java with Websphere. Was running on a Sergenti Sun Box, so could definitely handle a lot.
I would more see into what you can get yourself into the quickest. If you know C++ C# or Java are easy to learn.
| 0 | 0 | 0 | 1 |
2010-07-24T10:16:00.000
| 5 | 0.039979 | false | 3,324,683 | 0 | 0 | 1 | 2 |
I have couple of ideas in my brain which I would like to bring out before it's too late. Basically I want to develop a web application which I could sell it to clients. So which technology shall I use to accomplish this? I have been a C and C++ software developer but it's been a very long time since I have developed one. So the things I would like to know is:
Scalability and Performance?
Easy way to develop web application in a faster manner?
Any Framework?
Application server?
and which programming language?
|
Which technology should I use to develop a high performance web application
| 3,324,720 | 6 | 0 | 3,428 | 0 |
c#,java,python
|
Usually the programming language doesn't really matter. All have their own strengths and weaknesses. All come up with their own best-practices and frameworks.
It's really up to you what's your preference. If you are coming from Microsoft C/C++ I'd use .NET, if you are from Linux world I'd use Java.
Back in the 90s Java was well known as a slow framework, however there was much of myth and the framework architecture is dramatically changed since that. Today, there is no generally slow or fast framework.
You can find thousands of sites in the web that tell you that the one or the other is faster. However, at the end of the day it depends on how you implemented your solution and how you utilized the best features of the framework.
Greets
Flo
| 0 | 0 | 0 | 1 |
2010-07-24T10:16:00.000
| 5 | 1 | false | 3,324,683 | 0 | 0 | 1 | 2 |
I have couple of ideas in my brain which I would like to bring out before it's too late. Basically I want to develop a web application which I could sell it to clients. So which technology shall I use to accomplish this? I have been a C and C++ software developer but it's been a very long time since I have developed one. So the things I would like to know is:
Scalability and Performance?
Easy way to develop web application in a faster manner?
Any Framework?
Application server?
and which programming language?
|
Python: Detecting the actual text paragraphs in a string
| 3,325,874 | 2 | 2 | 2,958 | 0 |
python,html,text,screen-scraping
|
A general solution to this problem is a non-trivial problem to solve.
To put this in context, a large part of Google's success with search has come from their ability to automatically discern some semantic meaning from arbitrary Web pages, namely figuring out where the "content" is.
One idea that springs to mind is if you can crawl many pages from the same site then you will be able to identify patterns. Menu markup will be largely the same between all pages. If you zero this out somehow (and it will need to fairly "fuzzy") what's left is the content.
The next step would be to identify the text and what constitutes a boundary. Ideally that would be some HTML paragraphs but you won't get that lucky most of the time.
A better approach might be to find the RSS feeds for the site and get the content that way because that will be stripped down as is. Ignore any AdSense (or similar) content and you should be able to get the text.
Oh and absolutely throw out your regex code for this. This requires an HTML parser absolutely without question.
| 0 | 0 | 1 | 0 |
2010-07-24T16:15:00.000
| 4 | 0.099668 | false | 3,325,817 | 0 | 0 | 1 | 1 |
The big mission: I am trying to get a few lines of summary of a webpage. i.e. I want to have a function that takes a URL and returns the most informative paragraph from that page. (Which would usually be the first paragraph of actual content text, in contrast to "junk text", like the navigation bar.)
So I managed to reduce an HTML page to a bunch of text by cutting out the tags, throwing out the <HEAD> and all the scripts. But some of the text is still "junk text". I want to know where the actual paragraphs of text begin. (Ideally it should be human-language-agnostic, but if you have a solution only for English, that might help too.)
How can I figure out which of the text is "junk text" and which is actual content?
UPDATE: I see some people have pointed me to use an HTML parsing library. I am using Beautiful Soup. My problem isn't parsing HTML; I already got rid of all the HTML tags, I just have a bunch of text and I want to separate the context text from the junk text.
|
GAE - Sharing Authentication Across Apps
| 3,325,984 | 1 | 0 | 263 | 0 |
python,google-app-engine,authentication,openid
|
Not using the built in authentication support - users have to authenticate separately with each application.
| 0 | 1 | 0 | 0 |
2010-07-24T16:36:00.000
| 2 | 0.099668 | false | 3,325,906 | 0 | 0 | 1 | 1 |
Let's say I had a root app and multiple sub-apps. Would it be possible to share authenticated sessions across them?
I'm using Google App Engine (Python).
|
Facebook wall writing application
| 3,327,259 | 4 | 3 | 1,795 | 0 |
php,python,facebook
|
Check out the Facebook API. It will more than likely show that the wall post came from your application. As far as the language you implement in, I think you could use Python.
| 0 | 0 | 0 | 1 |
2010-07-24T22:55:00.000
| 6 | 0.132549 | false | 3,327,244 | 0 | 0 | 1 | 2 |
I was wondering if i could possible write an app, that could be a list of all my friends and just simply posting a message to their walls on the friends i select. Not a message, a wall post. So it appears that i went to their wall and wrote a message, they have no idea that an app is pushing the message to them.
also could it be written in python :) its what i know. php is so icky, but doable if it is the only option.
Please and thank you.
|
Facebook wall writing application
| 3,327,248 | 3 | 3 | 1,795 | 0 |
php,python,facebook
|
There are a couple of Facebook APIs that could tie in to. I'm at work and any website that makes mention of facebook is blocked so I can't provide links, but Google 'Facebook API'.
| 0 | 0 | 0 | 1 |
2010-07-24T22:55:00.000
| 6 | 0.099668 | false | 3,327,244 | 0 | 0 | 1 | 2 |
I was wondering if i could possible write an app, that could be a list of all my friends and just simply posting a message to their walls on the friends i select. Not a message, a wall post. So it appears that i went to their wall and wrote a message, they have no idea that an app is pushing the message to them.
also could it be written in python :) its what i know. php is so icky, but doable if it is the only option.
Please and thank you.
|
Control access to parts of a system, but also to certain pieces of information
| 3,327,313 | 2 | 2 | 214 | 1 |
python,access-control
|
This problem is not really new; it's basically the general problem of authorization and access rights/control.
In order to avoid having to model and maintain a complete graph of exactly what objects each user can access in each possible way, you have to make decisions (based on what your application does) about how to start reigning in the multiplicative scale factors. So first: where do users get their rights? If each user is individually assigned rights, you're going to pose a significant ongoig management challenge to whoever needs to add users, modify users, etc.
Perhaps users can get their rights from the groups they're members of. Now you have a scale factor that simplifies management and makes the system easier to understand. Changing a group changes the effective rights for all users who are members.
Now, what do these rights look like? It's still probably not wise to assign rights on a target object by object basis. Thus maybe rights should be thought of as a set of abstract "access cards". Objects in the system can be marked as requiring "blue" access for read, "red" access for update, and "black" access for delete. Those abstract rights might be arranged in some sort of topology, such that having "black" access means you implicitly also have "red" and "blue", or maybe they're all disjoint; it's up to you and how your application has to work. (Note also that you may want to consider that object types — tables, if you like — may need their own access rules, at least for "create".
By introducing collection points in the graph pictures you draw relating actors in the system to objects they act upon, you can handle scale issues and keep the complexity of authorization under control. It's never easy, however, and often it's the case that voiced customer desires result in something that will never work out and never in fact achieve what the customer (thinks she) wants.
The implementation language doesn't have a lot to do with the architectural decisions you need to make.
| 0 | 0 | 0 | 0 |
2010-07-24T23:11:00.000
| 4 | 0.099668 | false | 3,327,279 | 0 | 0 | 1 | 3 |
This is a tricky question, we've been talking about this for a while (days) and haven't found a convincingly good solution. This is the situation:
We have users and groups. A user can belong to many groups (many to many relation)
There are certain parts of the site that need access control, but:
There are certain ROWS of certain tables that need access control, ie. a certain user (or certain group) should not be able to delete a certain row, but other rows of the same table could have a different permission setting for that user (or group)
Is there an easy way to acomplish this? Are we missing something?
We need to implement this in python (if that's any help).
|
Control access to parts of a system, but also to certain pieces of information
| 3,327,325 | 0 | 2 | 214 | 1 |
python,access-control
|
It's hard to be specific without knowing more about your setup and about why exactly you need different users to have different permissions on different rows. But generally, I would say that whenever you access any data in the database in your code, you should precede it by an authorization check, which examines the current user and group and the row being inserted/updated/deleted/etc. and decides whether the operation should be allowed or not. Consider designing your system in an encapsulated manner - for example you could put all the functions that directly access the database in one module, and make sure that each of them contains the proper authorization check. (Having them all in one file makes it less likely that you'll miss one)
It might be helpful to add a permission_class column to the table, and have another table specifying which users or groups have which permission classes. Then your authorization check simply has to take the value of the permission class for the current row, and see if the permissions table contains an association between that permission class and either the current user or any of his/her groups.
| 0 | 0 | 0 | 0 |
2010-07-24T23:11:00.000
| 4 | 0 | false | 3,327,279 | 0 | 0 | 1 | 3 |
This is a tricky question, we've been talking about this for a while (days) and haven't found a convincingly good solution. This is the situation:
We have users and groups. A user can belong to many groups (many to many relation)
There are certain parts of the site that need access control, but:
There are certain ROWS of certain tables that need access control, ie. a certain user (or certain group) should not be able to delete a certain row, but other rows of the same table could have a different permission setting for that user (or group)
Is there an easy way to acomplish this? Are we missing something?
We need to implement this in python (if that's any help).
|
Control access to parts of a system, but also to certain pieces of information
| 3,327,726 | 0 | 2 | 214 | 1 |
python,access-control
|
Add additional column "category" or "type" to the table(s), that will categorize the rows (or if you will, group/cluster them) - and then create a pivot table that defines the access control between (rowCategory, userGroup). So for each row, by its category you can pull which userGroups have access (and what kind of access).
| 0 | 0 | 0 | 0 |
2010-07-24T23:11:00.000
| 4 | 0 | false | 3,327,279 | 0 | 0 | 1 | 3 |
This is a tricky question, we've been talking about this for a while (days) and haven't found a convincingly good solution. This is the situation:
We have users and groups. A user can belong to many groups (many to many relation)
There are certain parts of the site that need access control, but:
There are certain ROWS of certain tables that need access control, ie. a certain user (or certain group) should not be able to delete a certain row, but other rows of the same table could have a different permission setting for that user (or group)
Is there an easy way to acomplish this? Are we missing something?
We need to implement this in python (if that's any help).
|
How to modify django cms multilingual middleware
| 3,356,666 | 2 | 2 | 444 | 0 |
python,django,django-cms
|
Sounds like you need to modify your urls.py, not your settings or middleware.
| 0 | 0 | 0 | 0 |
2010-07-25T01:12:00.000
| 1 | 0.379949 | false | 3,327,590 | 0 | 0 | 1 | 1 |
hey guys, im trying to internationalize my site, so i have the django cms multilingual middleware class in my settings.py , when viewed from brasil, the url changes to
www.ashtangayogavideo.com/pt/ash/homepage/ resulting in a 404, because my site is in www.ashtangayogavideo.com/ash/en/homepage, how can i configure the middleware, or settings.py, so that the language code is added after the /ash/ ? .
|
What's the best way to get a description of the website, in Python?
| 3,332,528 | 1 | 6 | 519 | 0 |
python,html,string,templates,parsing
|
It's very hard to come up with a rule that works 100% of the time, obviously, but my suggestion as a starting point would be to look for the first <h1> tag (or <h2>, <h3>, etc - the highest one you can find) then the bit of text after that can be used as the description. As long as the site is semantically marked-up, that should give you a good description (I guess you could also take the contents of the <h1> itself, but that's more like the "title").
It's interesting to note that Google (for example) uses a keyword-specific extract of the page contents to display as the description, rather than a static description. Not sure if that'll work for your situation, though.
| 0 | 0 | 1 | 0 |
2010-07-26T05:59:00.000
| 3 | 0.066568 | false | 3,332,494 | 0 | 0 | 1 | 1 |
Suppose I downloaded the HTML code, and I can parse it.
How do I get the "best" description of that website, if that website does not have meta-description tag?
|
Google app engine parsing xml more then 1 mb
| 3,334,425 | 2 | 1 | 485 | 0 |
python,google-app-engine,parsing
|
The 1MB limit doesn't apply to parsing; however, you can't fetch more than 1MB from URLfetch; you'll only get the first 1MB from the API.
It's probably not going to be possible to get the XML into your application using the URLfetch API. If the data is smaller than 10MB, you can arrange for an external process to POST it to your application and then process it. If it's between 10MB and 2GB, you'd need to use the Blobstore API to upload it, read it in to your application in 1MB chunks, and process the concatenation of those chunks.
| 0 | 1 | 1 | 0 |
2010-07-26T07:14:00.000
| 1 | 0.379949 | false | 3,332,897 | 0 | 0 | 1 | 1 |
Hi i need to parse xml file which is more then 1 mb in size, i know GAE can handle request and response up to 10 MB but as we need to use SAX parser API and API GAE has limit of 1 MB so is there way we can parse file more then 1 mb any ways.
|
Python/Web: What's the best way to run Python on a web server?
| 3,339,594 | 4 | 2 | 5,769 | 0 |
python,webserver,mod-wsgi
|
Don't get carried away with trying to work out what is the fastest web server. All you will do in doing that is waste your time. This is because the web server is nearly never the bottleneck if you set them up properly. The real bottleneck is your web application, database access etc.
As such, choose whatever web hosting system you think meets your general requirements and which you find easy to setup and manage. Using something you understand and which doesn't require lots of time devoted to it, means you can then focus your valuable time on making your application perform better, thus reducing the real bottleneck.
| 0 | 0 | 0 | 1 |
2010-07-26T16:21:00.000
| 6 | 0.132549 | false | 3,336,787 | 0 | 0 | 1 | 2 |
I am leasing a dedicated web server.
I have a Python web-application.
Which configuration option (CGI, FCGI, mod_python, Passenger, etc) would result in Python being served the fastest on my web server and how do I set it up that way?
UPDATE:
Note, I'm not using a Python framework such as Django or Pylons.
|
Python/Web: What's the best way to run Python on a web server?
| 3,336,816 | -1 | 2 | 5,769 | 0 |
python,webserver,mod-wsgi
|
You don't usually just serve Python, you serve a specific web server or framework based on Python. eg. Zope, TurboGears, Django, Pylons, etc. Although they tend to be able to operate on different web server back-ends (and some provide an internal web server themselves), the best solution will depend on which one you use.
| 0 | 0 | 0 | 1 |
2010-07-26T16:21:00.000
| 6 | -0.033321 | false | 3,336,787 | 0 | 0 | 1 | 2 |
I am leasing a dedicated web server.
I have a Python web-application.
Which configuration option (CGI, FCGI, mod_python, Passenger, etc) would result in Python being served the fastest on my web server and how do I set it up that way?
UPDATE:
Note, I'm not using a Python framework such as Django or Pylons.
|
Big picture questions regarding Django, Java, Python, HTML and web-site development in general
| 3,346,150 | 10 | 6 | 1,807 | 0 |
java,python,html,django,mobile
|
Django wasn't trying to innovate in how web sites are displayed in the browser. Their goal was to simplify the process of building a web site. They could have taken on new ways of creating widgets in the browser as part of that goal, but they didn't. There was plenty of pain to relieve in the classic construction of websites.
If you are building web sites, you will be dealing with HTML. Your analogy to assembler is interesting, but in that analogy, no popular higher-level languages have emerged. This is likely because every higher-level language would of necessity impose some constraints on what could be expressed, and the web is not at the point of wanting conformity like that.
Python is an easier-to-use language than C++, and you really can develop faster in it. You should try it. Automatic memory management is one reason, but others are easy-to-use data structures, not having to ask permission from the compiler to do what you want, extensive third-party libraries to build on, and a clutter-free language in which to express yourself. About the speed: web sites are not compute-bound, they are I/O-bound, so the speed of the language rarely makes a difference.
About the ad-hoc nature of web development. You're coming from a Windows development background, where one vendor defined the entire environment, and did a good job of it. Web development is ad-hoc because the web itself is ad-hoc. No one group defined it, it's grown organically with contributions from many.
| 0 | 0 | 0 | 0 |
2010-07-27T16:49:00.000
| 8 | 1 | false | 3,345,916 | 0 | 0 | 1 | 5 |
I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focussed in on Django, after online research of it and Ruby (on Rails). From what I read, ROR tries to do everything for you behind the scenes and so therefore is slow and unscalable (and overhyped and not ready for prime time). So I have gotten into Django - downloaded Python and Django, the source from a complete Django site, got it running, and so forth.
And the first thing that surprises me about Django, is that there does not seem to be any innovation to speak of regarding actual presentation. All the innovation would concern database issues, business logic, reusability of code, etc - but not actually anything new regarding innovative visual controls or graphics for a web-site. When you build a Django view or template, it will still be making extensive reference to html from what I can see (And presumably also Javascript - but I haven't actually even seen any Javascript in Django templates yet.)
And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastered and written continually by every web developer, whether they're using Django or anything else. Is that a true statement?
There is one site in particular that would to me as an end user represent the state of the art for web sites and I would be curious as to what the foundations of such a site might be. That site is chess.com, and there are all sorts of facilities for playing chess online with other users, user customization of their account with various graphical effects and so on. Is it most likely Java applets they're using for a site like that? How relevant would Django be for a such a site. Would Django be used in conjunction with something like Flash or even Java applets? Also when a site like chess.com is ported to a mobile device, what is used to write it - the same development tools as for the desktop or something completely different (Yes, I have a lot of catching up to do.)
Are there in fact complete websites written solely in Java, perhaps using very high level Java API's? Why would someone say (as I read somewhere) that they despised Java so that is why they had gotten into Ruby on Rails and Django.
And regarding Python (and also PHP) what is the justification for their existence? First of all, Python is much, much slower than say C++, being interpreted. Why are websites written in Python or PHP - is platform independence the sole issue here. I am incredulous that application development is much faster in Python than C++ (aside from the garbage collection issue - is that what the primary reason for Python is - garbage collection.)
So anyway, a bunch of newbie questions - will probably end up answering most of them myself if they're not answered here. Maybe they're relevant to someone else though.
|
Big picture questions regarding Django, Java, Python, HTML and web-site development in general
| 3,346,994 | 7 | 6 | 1,807 | 0 |
java,python,html,django,mobile
|
All the innovation would concern database issues, business logic, reusability of code, etc - but not actually anything new regarding innovative visual controls or graphics for a web-site
Correct. Good assessment. Is that a problem?
html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it
False. Indeed, not even close. All browsers uses HTML. That cannot be changed easily.
chess.com... Is it most likely Java applets they're using for a site like that?
Use view source in your browser to answer this question for yourself. In general, you should do this for every web site you visit. You'll learn a great deal about the web and web development.
Would Django be used in conjunction with something like Flash or even Java applets
Yes. We use FLEX and Django.
Also when a site like chess.com is ported to a mobile device, what is used to write it - the same development tools as for the desktop or something completely different (Yes, I have a lot of catching up to do.)
Yes.
Are there in fact complete websites written solely in Java, perhaps using very high level Java API's?
Yes.
Why would someone say (as I read somewhere) that they despised Java so that is why they had gotten into Ruby on Rails and Django.
Some people like to despise Java. There's little technical merit to their argument.
After you've used Java and Python, you'll find that Python's less wordy. You get more done with less typing.
what is the justification for their [Python PHP] existence?
They're better than the alternatives. For specific things people need to do, Python (or PHP) are better than the alternatives. For "everything" or even a broad class of things, it may not be perfectly clear.
We do a lot of ad-hoc data crunching. Python's flexibility is absolutely superior to the alternatives.
First of all, Python is much, much slower than say C++, being interpreted.
That's hardly relevant, it turns out. Web sites are not governed by raw speed of one element of the architecture.
Why are websites written in Python or PHP
It's easier than the alternatives.
is platform independence the sole issue here.
No.
I am incredulous that application development is much faster in Python than C++
Have you done much with Python? You should give it a try for a year or so. It makes C++ quite tedious and error-prone by comparison.
is that what the primary reason for Python is - garbage collection.
No.
| 0 | 0 | 0 | 0 |
2010-07-27T16:49:00.000
| 8 | 1 | false | 3,345,916 | 0 | 0 | 1 | 5 |
I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focussed in on Django, after online research of it and Ruby (on Rails). From what I read, ROR tries to do everything for you behind the scenes and so therefore is slow and unscalable (and overhyped and not ready for prime time). So I have gotten into Django - downloaded Python and Django, the source from a complete Django site, got it running, and so forth.
And the first thing that surprises me about Django, is that there does not seem to be any innovation to speak of regarding actual presentation. All the innovation would concern database issues, business logic, reusability of code, etc - but not actually anything new regarding innovative visual controls or graphics for a web-site. When you build a Django view or template, it will still be making extensive reference to html from what I can see (And presumably also Javascript - but I haven't actually even seen any Javascript in Django templates yet.)
And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastered and written continually by every web developer, whether they're using Django or anything else. Is that a true statement?
There is one site in particular that would to me as an end user represent the state of the art for web sites and I would be curious as to what the foundations of such a site might be. That site is chess.com, and there are all sorts of facilities for playing chess online with other users, user customization of their account with various graphical effects and so on. Is it most likely Java applets they're using for a site like that? How relevant would Django be for a such a site. Would Django be used in conjunction with something like Flash or even Java applets? Also when a site like chess.com is ported to a mobile device, what is used to write it - the same development tools as for the desktop or something completely different (Yes, I have a lot of catching up to do.)
Are there in fact complete websites written solely in Java, perhaps using very high level Java API's? Why would someone say (as I read somewhere) that they despised Java so that is why they had gotten into Ruby on Rails and Django.
And regarding Python (and also PHP) what is the justification for their existence? First of all, Python is much, much slower than say C++, being interpreted. Why are websites written in Python or PHP - is platform independence the sole issue here. I am incredulous that application development is much faster in Python than C++ (aside from the garbage collection issue - is that what the primary reason for Python is - garbage collection.)
So anyway, a bunch of newbie questions - will probably end up answering most of them myself if they're not answered here. Maybe they're relevant to someone else though.
|
Big picture questions regarding Django, Java, Python, HTML and web-site development in general
| 3,452,710 | 1 | 6 | 1,807 | 0 |
java,python,html,django,mobile
|
And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastered and written continually by every web developer, whether they're using Django or anything else. Is that a true statement?
That's why I use Seaside. You still have to understand html and css and javascript, but at least there is a programming language abstraction over html. I'll never go back to a template based system.
| 0 | 0 | 0 | 0 |
2010-07-27T16:49:00.000
| 8 | 0.024995 | false | 3,345,916 | 0 | 0 | 1 | 5 |
I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focussed in on Django, after online research of it and Ruby (on Rails). From what I read, ROR tries to do everything for you behind the scenes and so therefore is slow and unscalable (and overhyped and not ready for prime time). So I have gotten into Django - downloaded Python and Django, the source from a complete Django site, got it running, and so forth.
And the first thing that surprises me about Django, is that there does not seem to be any innovation to speak of regarding actual presentation. All the innovation would concern database issues, business logic, reusability of code, etc - but not actually anything new regarding innovative visual controls or graphics for a web-site. When you build a Django view or template, it will still be making extensive reference to html from what I can see (And presumably also Javascript - but I haven't actually even seen any Javascript in Django templates yet.)
And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastered and written continually by every web developer, whether they're using Django or anything else. Is that a true statement?
There is one site in particular that would to me as an end user represent the state of the art for web sites and I would be curious as to what the foundations of such a site might be. That site is chess.com, and there are all sorts of facilities for playing chess online with other users, user customization of their account with various graphical effects and so on. Is it most likely Java applets they're using for a site like that? How relevant would Django be for a such a site. Would Django be used in conjunction with something like Flash or even Java applets? Also when a site like chess.com is ported to a mobile device, what is used to write it - the same development tools as for the desktop or something completely different (Yes, I have a lot of catching up to do.)
Are there in fact complete websites written solely in Java, perhaps using very high level Java API's? Why would someone say (as I read somewhere) that they despised Java so that is why they had gotten into Ruby on Rails and Django.
And regarding Python (and also PHP) what is the justification for their existence? First of all, Python is much, much slower than say C++, being interpreted. Why are websites written in Python or PHP - is platform independence the sole issue here. I am incredulous that application development is much faster in Python than C++ (aside from the garbage collection issue - is that what the primary reason for Python is - garbage collection.)
So anyway, a bunch of newbie questions - will probably end up answering most of them myself if they're not answered here. Maybe they're relevant to someone else though.
|
Big picture questions regarding Django, Java, Python, HTML and web-site development in general
| 3,347,792 | 1 | 6 | 1,807 | 0 |
java,python,html,django,mobile
|
From what I read, ROR tries to do everything for you behind the scenes and so therefore is slow and unscalable (and overhyped and not ready for prime time).
Well, first of all, you shouldn't believe everything you read on the Internet:
I wouldn't say RoR isn't ready for primetime. RoR, like any tool, has its uses. If you're building a site like Twitter, maybe Rails isn't the best tool (as Twitter found out). While everyone thinks they're building a high-performance site, most developers aren't, and Rails will probably be suitable. Furthermore, Rails can scale, and a lot of work has been done to improve that situation even more.
The reason Rails sometimes has performance issues is not because it tries to do everything for you -- it's more because of the nature of the Ruby interpreter itself, which (until Ruby 1.9) was rather slow, and still isn't even as fast as other interpreted languages.
And the first thing that surprises me about Django, is that there does not seem to be any innovation to speak of regarding actual presentation. All the innovation would concern database issues, business logic, reusability of code, etc - but not actually anything new regarding innovative visual controls or graphics for a web-site.
Yes, but that is the innovation. Prior to frameworks like Django and Rails, a lot of that backend work was done by hand. Django frees up a developer's time to work on more application-level features.
And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastered and written continually by every web developer, whether they're using Django or anything else. Is that a true statement?
Yeah, pretty much. Nothing better than HTML, CSS, and JS has presented itself. While I agree that in some ways, HTML seems "low-level" in the same sense that assembly language is low-level, I think most would agree that, relative to problem domain, HTML is much nicer to work with.
Would Django be used in conjunction with something like Flash or even Java applets?
You can. Flash and Java are just embedded in HTML pages, and Django spits out HTML, so that's certainly possible.
Are there in fact complete websites written solely in Java, perhaps using very high level Java API's? Why would someone say (as I read somewhere) that they despised Java so that is why they had gotten into Ruby on Rails and Django.
In addition to applets, you can write a backend in Java (Java Server Pages, for example). I think most web developers who have worked with both would agree than Ruby and Python are much nicer to use than Java. Java web frameworks are kind of a pain, Java lacks a REPL, Java has a separate compilation step... Java is also statically typed; you can argue all day about the merits of dynamic typing vs. static typing, but Rails and Django both take advantage of Ruby's and Python's typing and introspection capabilities to make a lot of code less verbose than that of Java. (Whether that makes Ruby and Python better than Java is subjective.)
And regarding Python (and also PHP) what is the justification for their existence? First of all, Python is much, much slower than say C++, being interpreted. Why are websites written in Python or PHP - is platform independence the sole issue here. I am incredulous that application development is much faster in Python than C++ (aside from the garbage collection issue - is that what the primary reason for Python is - garbage collection.)
Performance isn't everything. Almost everyone wants to think their code is performance critical, but that's often not the case. As noted in a few other answers, most web apps are I/O bound anyway -- they're either waiting for database access, or waiting on the network, and both of those types of operations are orders of magnitude slower than CPU-intensive tasks, even with slow(er) interpreted languages. Furthermore, a lot of processing in web apps takes place on strings, and string processing is much nicer in Python or Ruby than it is in, e.g., C or C++. Python and Ruby are also more concise languages, and both offer a REPL which can shorten development time. Plus it's easy to write C extension modules in both Python and Ruby, so if you really, really find a code path that calls out for optimization, you can always drop down into C if you want.
Garbage collection is a plus, though.
| 0 | 0 | 0 | 0 |
2010-07-27T16:49:00.000
| 8 | 0.024995 | false | 3,345,916 | 0 | 0 | 1 | 5 |
I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focussed in on Django, after online research of it and Ruby (on Rails). From what I read, ROR tries to do everything for you behind the scenes and so therefore is slow and unscalable (and overhyped and not ready for prime time). So I have gotten into Django - downloaded Python and Django, the source from a complete Django site, got it running, and so forth.
And the first thing that surprises me about Django, is that there does not seem to be any innovation to speak of regarding actual presentation. All the innovation would concern database issues, business logic, reusability of code, etc - but not actually anything new regarding innovative visual controls or graphics for a web-site. When you build a Django view or template, it will still be making extensive reference to html from what I can see (And presumably also Javascript - but I haven't actually even seen any Javascript in Django templates yet.)
And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastered and written continually by every web developer, whether they're using Django or anything else. Is that a true statement?
There is one site in particular that would to me as an end user represent the state of the art for web sites and I would be curious as to what the foundations of such a site might be. That site is chess.com, and there are all sorts of facilities for playing chess online with other users, user customization of their account with various graphical effects and so on. Is it most likely Java applets they're using for a site like that? How relevant would Django be for a such a site. Would Django be used in conjunction with something like Flash or even Java applets? Also when a site like chess.com is ported to a mobile device, what is used to write it - the same development tools as for the desktop or something completely different (Yes, I have a lot of catching up to do.)
Are there in fact complete websites written solely in Java, perhaps using very high level Java API's? Why would someone say (as I read somewhere) that they despised Java so that is why they had gotten into Ruby on Rails and Django.
And regarding Python (and also PHP) what is the justification for their existence? First of all, Python is much, much slower than say C++, being interpreted. Why are websites written in Python or PHP - is platform independence the sole issue here. I am incredulous that application development is much faster in Python than C++ (aside from the garbage collection issue - is that what the primary reason for Python is - garbage collection.)
So anyway, a bunch of newbie questions - will probably end up answering most of them myself if they're not answered here. Maybe they're relevant to someone else though.
|
Big picture questions regarding Django, Java, Python, HTML and web-site development in general
| 3,347,103 | 2 | 6 | 1,807 | 0 |
java,python,html,django,mobile
|
And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastered and written continually by every web developer, whether they're using Django or anything else. Is that a true statement?
Yup — if you want a website, someone’s going to have to write some HTML.
HTML is unlike assembler in that you can’t write parsers for new languages in HTML. HTML is just a declarative language for adding meaning to text. As such, the main thing is that everyone in the world agrees how how to render it, and what the tags mean. Something new might replace it eventually, but HTML has proven pretty serviceable and resilient so far. It’s also pretty easy to learn, and free.
Is it most likely Java applets they're using for a site like that? How relevant would Django be for a such a site. Would Django be used in conjunction with something like Flash or even Java applets?
Django really just concerns itself with the server side of websites. It leaves the client side of things (i.e. whatever runs in the browser) up to you. (Aside from the built-in admin site.)
Are there in fact complete websites written solely in Java, perhaps using very high level Java API's?
I don’t think it’s common. Java applets are hardly used any more, and some people (cough Steve Jobs cough sorry about the cough there, I said “Steve Jobs”) think Flash will go the same way.
| 0 | 0 | 0 | 0 |
2010-07-27T16:49:00.000
| 8 | 0.049958 | false | 3,345,916 | 0 | 0 | 1 | 5 |
I am trying to get a handle on the state of the art regarding web site development and have several questions. Maybe I'll end up finding most of the answers on my own. I come from a background of C++ and Windows development, and generally I am befuddled by what seems to be the ad-hoc nature of web development.
I focussed in on Django, after online research of it and Ruby (on Rails). From what I read, ROR tries to do everything for you behind the scenes and so therefore is slow and unscalable (and overhyped and not ready for prime time). So I have gotten into Django - downloaded Python and Django, the source from a complete Django site, got it running, and so forth.
And the first thing that surprises me about Django, is that there does not seem to be any innovation to speak of regarding actual presentation. All the innovation would concern database issues, business logic, reusability of code, etc - but not actually anything new regarding innovative visual controls or graphics for a web-site. When you build a Django view or template, it will still be making extensive reference to html from what I can see (And presumably also Javascript - but I haven't actually even seen any Javascript in Django templates yet.)
And I would have thought previously that html might be analagous to assembler, so a conventional application developer from years past might know and occasionally even use a little assembler, but generally would hardly ever use it, whereas from what I can see, html (and also CSS and javascript) still have to be mastered and written continually by every web developer, whether they're using Django or anything else. Is that a true statement?
There is one site in particular that would to me as an end user represent the state of the art for web sites and I would be curious as to what the foundations of such a site might be. That site is chess.com, and there are all sorts of facilities for playing chess online with other users, user customization of their account with various graphical effects and so on. Is it most likely Java applets they're using for a site like that? How relevant would Django be for a such a site. Would Django be used in conjunction with something like Flash or even Java applets? Also when a site like chess.com is ported to a mobile device, what is used to write it - the same development tools as for the desktop or something completely different (Yes, I have a lot of catching up to do.)
Are there in fact complete websites written solely in Java, perhaps using very high level Java API's? Why would someone say (as I read somewhere) that they despised Java so that is why they had gotten into Ruby on Rails and Django.
And regarding Python (and also PHP) what is the justification for their existence? First of all, Python is much, much slower than say C++, being interpreted. Why are websites written in Python or PHP - is platform independence the sole issue here. I am incredulous that application development is much faster in Python than C++ (aside from the garbage collection issue - is that what the primary reason for Python is - garbage collection.)
So anyway, a bunch of newbie questions - will probably end up answering most of them myself if they're not answered here. Maybe they're relevant to someone else though.
|
Starting with Android: Java or Python (SL4A)
| 3,347,032 | 2 | 12 | 11,760 | 0 |
java,python,android,sl4a
|
More likely will depend what type of applications you will develop.
I would start with Java to become familiar with Android SDK. Anyway first you need to look into some examples, tutorials. Most of them are done in Java, and only a few, probably on the dev site of SL4A for that.
Also there is native development Android NDK, that can be programmed with C++.
But anyway Java rules for general applications.
| 0 | 0 | 0 | 0 |
2010-07-27T19:04:00.000
| 5 | 0.07983 | false | 3,346,970 | 0 | 0 | 1 | 1 |
I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).
I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a "second class" language on Android. On the SL4A website it is also stated to be alpha quality software, which is not exactly encouraging.
I'm also not quite sure what the limitations of the scripting environment are and if they would be problematic.
|
Sending data to django site
| 33,887,695 | 0 | 0 | 2,883 | 0 |
python,django,web-applications
|
Try Django Rest Framework with angular.
You can have the Django/Django Rest as backend.
For frontend you can have angular or react.js with nodejs or python simplehttp server or grunt or gulp running.
So front end will communicate to django server to get data. For logging in, you could use auth-token and angular cookies.
This will also decrease the load on backend server, since backend does not have to serve html/templates
| 0 | 0 | 0 | 0 |
2010-07-27T23:59:00.000
| 3 | 0 | false | 3,348,912 | 0 | 0 | 1 | 1 |
I am trying to build a django service to which numerous clients will send data. Each client will represent an authenticated user, who might be connected to the internet or not, so the client will aggregate the data and send them when a connection is available. The data should also be persisted locally so that they are accessed quickly without hitting the server.
The nature of the data is simple. It has to do with game achievements, so each user will have a collection of achievements they have achieved. As a consequence, there are no consistency issues, as each user will be sending their own achievement stats, and no user will edit someone else's data.
I am trying to find the most suitable medium for this. My first thought was POST HTTP requests, which the django server will handle. A python client will login and 'send' data by performing these requests. Can anyone suggest better alternatives, or give me reasons why this setup is suitable or not?
I'd also like to know what you would suggest for a format/way to obtain the data from the client side. I was thinking json or yaml
EDIT 2: This question has been revamped after S.Lott's recommendation.
|
Duplicate key-value pairs returned by memcached
| 3,349,680 | 0 | 0 | 757 | 0 |
python,concurrency,memcached
|
Which is a bigger problem: having redundant data, or getting more than one result back for a query?
If the former is the problem, then you've got a nasty concurrency issue to solve on your hands.
If the latter is the problem, however, why not just give each host that's storing values in memcache a unique identifier, and prepend that to any key?
| 0 | 0 | 0 | 0 |
2010-07-28T03:07:00.000
| 2 | 0 | false | 3,349,614 | 0 | 0 | 1 | 1 |
We are using a cluster of memcached servers for caching purpose, in a Django(Python) production, having tried both cmemcache and python-memcache as the API. The problem is under high concurrency, we started to have duplicate key-value pairs, that is to say we are having multi values for a single key. Is there anyone having had the same similar situation and what is the kill?
Since the memcached servers themselves are not communicating with each to maintain the singularity of the key-value pair, this task is left to the client library, so we are trying to understand further how cmemcache and python-memcache works.
|
On the google app engine, why do updates not reflect in a transaction?
| 3,350,082 | 0 | 2 | 215 | 1 |
python,google-app-engine
|
Looks like you are not doing a commit on the transaction before querying
start a db transaction
update entityX by setting entityX.flag = True
save entityX
COMMIT TRANSACTION
query for entity where flag == True. BUT, here is the problem. This query does NOT return any results. It should have returned entityX, but it did not.
In a transaction, entities will not be persisted until the transaction is commited
| 0 | 1 | 0 | 0 |
2010-07-28T05:06:00.000
| 2 | 0 | false | 3,350,068 | 0 | 0 | 1 | 1 |
I store groups of entities in the google app engine Data Store with the same ancestor/parent/entityGroup. This is so that the entities can be updated in one atomic datastore transaction.
The problem is as follows:
I start a db transaction
I update entityX by setting entityX.flag = True
I save entityX
I query for entity where flag == True. BUT, here is the problem. This query does NOT return any results. It should have returned entityX, but it did not.
When I remove the transaction, my code works perfectly, so it must be the transaction that is causing this strange behavior.
Should updates to entities in the entity group not be visible elsewhere in the same transaction?
PS: I am using Python. And GAE tells me I can't use nested transactions :(
|
Getting started with Pylons and MVC - Need some guidance on design
| 3,410,261 | 0 | 0 | 155 | 0 |
python,model-view-controller,design-patterns,pylons
|
Model is for your db-related code. All queries go there, including adding new records/updating existing ones.
Controllers are somewhat ambigous, different projects use different approaches to it. Reddit for example does fair bit of what should be View in controllers.
I, for one, prefer to limit my controllers to request processing and generation of some result object collections, which are then delivered to XHTML/XML/JSON views, depending on the type of request (so each controller should be used for both static page generation and AJAX handling).
I really want to start using Pylons but I think in a few months time I'll come back to my code and think "...what the F was I thinking :/"
Well, thats inevitable, you should try different approaches to find the one which suits you best.
| 0 | 0 | 0 | 0 |
2010-07-28T08:06:00.000
| 2 | 0 | false | 3,350,972 | 0 | 0 | 1 | 1 |
I've been getting more and more interested in using Pylons as my Python web framework and I like the idea of MVC but, coming from a background of never using 'frameworks/design patterns/ what ever it\'s called', I don't really know how to approach it.
From what I've read in the Pylons Book, so far, it seems I do the following:
Create my routes in ./config/routes.py
This is where I map URLs to controllers.
Create a controller for the URL
This is where the main body of the code lies. It does all the work and prepares it for viewing
Create my template
I create a template and assign the data from the controller to it
Models... I have no idea what they're for :/
So my question is, can you recommend any reading materials for someone who clearly has no idea what they're doing?
I really want to start using Pylons but I think in a few months time I'll come back to my code and think "...what the F was I thinking :/"
EDIT: A better, summarized, question came to mind:
What code should be placed in the Controller?
What code should I put in the Model?
The view is just the templating, right?
And, in terms of Pylons, the 'lib' folder will contain code shared among Controllers or misc code that doesn't fit anywhere else - Right?
|
Getting BeautifulSoup to catch tags in a non-case-sensitive way
| 3,352,681 | 2 | 4 | 3,331 | 0 |
python,html,parsing,beautifulsoup,case-insensitive
|
BeautifulSoup standardises the parse tree on input. It converts tags to lower-case. You don't have anything to worry about IMO.
| 0 | 0 | 0 | 0 |
2010-07-28T11:58:00.000
| 2 | 0.197375 | false | 3,352,563 | 0 | 0 | 1 | 1 |
I want to catch some tags with BeautifulSoup: Some <p> tags, the <title> tag, some <meta> tags. But I want to catch them regardless of their case; I know that some sites do meta like this: <META> and I want to be able to catch that.
I noticed that BeautifulSoup is case-sensitive by default. How do I catch these tags in a non-case-sensitive way?
|
IPC (inter process communication) between python and java
| 35,616,834 | 0 | 17 | 16,516 | 0 |
java,python,ipc,multiprocessing,multiple-processes
|
I had a similar situation where I had to communicate between a Java process and a Linux process. I used named pipes.
Try mkfifo() implementation in python.
| 0 | 0 | 0 | 0 |
2010-07-28T19:16:00.000
| 6 | 0 | false | 3,356,554 | 0 | 0 | 1 | 1 |
First, a little explanation of why I'm asking this question in the first place:
I'm writing a python program (with a wxPython gui) that needs to call a Java AWT program from python and extract data from it. I have an in-process working solution on Windows. I also have an in-process solution on OSX so long as I run the Java app headless. Unfortunately there is no reasonable solution that I have found for running both GUIs within the same process on OSX because both AWT and WX both want the first thread and cannot share the wx message loop.
What I would like to do is to launch a Java program in a separate process from my Python program and establish a pipe or queue or something for passing data (specifically byte arrays) back and forth.
I'd greatly appreciate any suggestions, or even a nudge in the right direction as I have very little experience with IPC.
|
How can I get the current language in Django?
| 3,359,880 | 101 | 110 | 85,439 | 0 |
python,django,internationalization
|
Or you can also get this in your views
request.LANGUAGE_CODE
| 0 | 0 | 0 | 0 |
2010-07-28T20:01:00.000
| 6 | 1 | false | 3,356,964 | 0 | 0 | 1 | 2 |
How can I get the current language in the current thread in a model or in the admin?
|
How can I get the current language in Django?
| 19,680,511 | 9 | 110 | 85,439 | 0 |
python,django,internationalization
|
Just to add that if you do use django.utils.translation.get_language() then you should bear in mind that if that section of code will be called asynchronously (e.g. as a celery task) then this approach won't work due to it running in a different thread.
| 0 | 0 | 0 | 0 |
2010-07-28T20:01:00.000
| 6 | 1 | false | 3,356,964 | 0 | 0 | 1 | 2 |
How can I get the current language in the current thread in a model or in the admin?
|
How do I choose a task_id using celery?
| 3,379,809 | 4 | 4 | 604 | 0 |
python,django,celery
|
You can certainly use "natural ids", but then to be really useful they would have to
be reverseable, which doesn't work if you add that timestamp. Also the ids are unique, so two tasks can't have the same id (the behavior then is undefined)
If you have a task to refresh the timeline of a twitter user, then you know that you
only want one task running for each user id at any time, so you could use a natural id like:
"update-twitter-timeline-%s" % (user_id)
then always be able to get the result for that task, or revoke the task using that id, no need to manually store it somewhere and look it up.
| 0 | 1 | 0 | 0 |
2010-07-28T21:06:00.000
| 1 | 1.2 | true | 3,357,489 | 0 | 0 | 1 | 1 |
For now I get a task_id from the async_result and have to save it the get it back later.
Would be better if I knew what the task_id what made of so I can calculate it back instead of pulling from the DB. E.G: set a task with task_id=("%s-%s" % (user_id, datetime)).
|
Django Admin "Helper" Functionality Not Working on Server
| 3,357,805 | 0 | 0 | 78 | 0 |
python,django,django-admin
|
You are probably not serving javascript files properly. To have this functionality, proper javascript must loaded.
| 0 | 0 | 0 | 0 |
2010-07-28T21:46:00.000
| 1 | 1.2 | true | 3,357,779 | 0 | 0 | 1 | 1 |
In my localhost Django administrator I am able to fill-in Date and Time fields by clicking on the little "Date" and "Time" helper icons next to my pub_date field. However, the same administrator on my Server does NOT show these icons. The server-side admin also doesn't pop open a pop-up window for the little "+" plus sign for fields in related tables. Is there a server setting or something that I've missed?
BTW, my admin media directory is working correctly otherwise.
Thank you in advance!
L.
|
Dynamically Created Top Articles List in Django?
| 3,359,618 | 0 | 2 | 117 | 0 |
python,mysql,django
|
An index wouldn't help as them main problem I believe is not so much getting the sorted list as having a DB write with every page view of an article. Another index actually makes that problem worse, albeit only a little.
So I'd go with the cache. I think django's cache shim is a problem here because it requires timeouts on all keys. I'm not sure if that's imposed by memcached, if not then go with redis. Actually just go with redis anyway, the python library is great, I've used it from django projects before, and it has atomic increments and powerful sorting - everything you need.
| 0 | 0 | 0 | 0 |
2010-07-29T03:04:00.000
| 4 | 0 | false | 3,359,214 | 0 | 0 | 1 | 3 |
I'm creating a Django-powered site for my newspaper-ish site. The least obvious and common-sense task that I have come across in getting the site together is how best to generate a "top articles" list for the sidebar of the page.
The first thing that came to mind was some sort of database column that is updated (based on what?) with every view. That seems (to my instincts) ridiculously database intensive and impractical and thus I think I'd like to find another solution.
Thanks all.
|
Dynamically Created Top Articles List in Django?
| 3,359,569 | 0 | 2 | 117 | 0 |
python,mysql,django
|
If you do something like sort by top views, it would be fast if you index the view column in the DB. Another option is to only collect the top x articles every hour or so, and toss that value into Django's cache framework.
The nice thing about caching the list is that the algorithm you use to determine top articles can be as complex as you like without hitting the DB hard with every page view. Django's cache framework can use memory, db, or file system. I prefer DB, but many others prefer memory. I believe it uses pickle, so you can also store Python objects directly. It's easy to use, recommended.
| 0 | 0 | 0 | 0 |
2010-07-29T03:04:00.000
| 4 | 0 | false | 3,359,214 | 0 | 0 | 1 | 3 |
I'm creating a Django-powered site for my newspaper-ish site. The least obvious and common-sense task that I have come across in getting the site together is how best to generate a "top articles" list for the sidebar of the page.
The first thing that came to mind was some sort of database column that is updated (based on what?) with every view. That seems (to my instincts) ridiculously database intensive and impractical and thus I think I'd like to find another solution.
Thanks all.
|
Dynamically Created Top Articles List in Django?
| 3,361,120 | 1 | 2 | 117 | 0 |
python,mysql,django
|
Premature optimization, first try the db way and then see if it really is too database sensitive. Any decent database has so good caches it probably won't matter very much. And even if it is a problem, take a look at the other db/cache suggestions here.
It is most likely by the way is that you will have many more intensive db queries with each view than a simple view update.
| 0 | 0 | 0 | 0 |
2010-07-29T03:04:00.000
| 4 | 0.049958 | false | 3,359,214 | 0 | 0 | 1 | 3 |
I'm creating a Django-powered site for my newspaper-ish site. The least obvious and common-sense task that I have come across in getting the site together is how best to generate a "top articles" list for the sidebar of the page.
The first thing that came to mind was some sort of database column that is updated (based on what?) with every view. That seems (to my instincts) ridiculously database intensive and impractical and thus I think I'd like to find another solution.
Thanks all.
|
Scraping websites with Javascript enabled?
| 3,364,608 | 6 | 17 | 23,351 | 0 |
javascript,python,screen-scraping
|
I would actually suggest using Selenium. Its mainly designed for testing Web-Applications from a "user perspective however it is basically a "FireFox" driver. I've actually used it for this purpose ... although I was scraping an dynamic AJAX webpage. As long as the Javascript form has a recognizable "Anchor Text" that Selenium can "click" everything should sort itself out.
Hope that helps
| 0 | 0 | 1 | 0 |
2010-07-29T13:18:00.000
| 6 | 1 | false | 3,362,859 | 0 | 0 | 1 | 1 |
I'm trying to scrape and submit information to websites that heavily rely on Javascript to do most of its actions. The website won't even work when i disable Javascript in my browser.
I've searched for some solutions on Google and SO and there was someone who suggested i should reverse engineer the Javascript, but i have no idea how to do that.
So far i've been using Mechanize and it works on websites that don't require Javascript.
Is there any way to access websites that use Javascript by using urllib2 or something similar?
I'm also willing to learn Javascript, if that's what it takes.
|
E-mail traceback on errors in Bottle framework
| 3,393,377 | 3 | 2 | 894 | 0 |
python,error-handling,bottle
|
in the error500 function written after the @error decorator to serve my customized error page, wrote error.exception and error.traceback, these two give the exception and complete traceback of the error message.
| 0 | 0 | 0 | 1 |
2010-07-29T13:47:00.000
| 2 | 0.291313 | false | 3,363,167 | 0 | 0 | 1 | 1 |
I am using the Bottle framework. I have set the @error decorator so I am able to display my customized error page, and i can also send email if any 500 error occurs, but I need the complete traceback to be sent in the email. Does anyone know how to have the framework include that in the e-mail?
|
pyqt, webkit and facebook authentication?
| 5,099,848 | 0 | 4 | 640 | 0 |
python,facebook,webkit,pyqt
|
I don't believe you can open an "authentication page" in a separate window under Facebook's terms (I used to work for Zynga, and we couldn't then, so I don't know how you'd achieve this now legally).
Second, you're looking into the QWebkit backwards I believe. From a UI perspective this is supposed to provide access to websites, and interact with them. If you want a good looking page, with all the bells and whistle, it pains me to say it ~ but use Actionscript 3, or Ajax and it's bundle.
This post would probably be answered better if tagged in the javascript, php, and as3 sections. As the php guys will know the correct hacks to get your intended result, if possible
| 1 | 0 | 0 | 0 |
2010-07-30T12:51:00.000
| 1 | 1.2 | true | 3,371,549 | 0 | 0 | 1 | 1 |
Are there any examples how to authenticate your desktop Facebook application using PyQT and embedded webkit?
This is to provide better user experience than opening Facebook authentication page in a separate browser window.
|
When to thread?
| 3,372,837 | 2 | 5 | 189 | 0 |
python,multithreading
|
Usual approach for handling HTTP requests synchronously is to spawn (or re-use one in the pool) new thread for each request as soon as it comes.
However, python threads are not very good for HTTP, due to GIL and some i/o and other calls blocking whole app, including other threads.
You should look into multiprocessing module for this usage. Spawn some worker processes, and then pass requests to them to process.
| 0 | 0 | 0 | 0 |
2010-07-30T15:07:00.000
| 2 | 1.2 | true | 3,372,774 | 1 | 0 | 1 | 1 |
I have never written any code that uses threads.
I have a web application that accepts a POST request, and creates an image based on the data in the body of the request.
Would I want to spin off a thread for the image creation, as to prevent the server from hanging until the image is created? Is this an appropriate use, or merely a solution looking for a problem ?
Please correct any misunderstandings I may have.
|
Django object extension / one to one relationship issues
| 3,376,487 | 0 | 2 | 709 | 0 |
python,django,inheritance,inline,admin
|
All fields in the superclass also exist on the subclass, so having an explicit relation is unnecessary.
Model inheritance in Django is terrible. Don't use it. Python doesn't need it anyway.
| 0 | 0 | 0 | 0 |
2010-07-31T02:08:00.000
| 2 | 0 | false | 3,376,479 | 0 | 0 | 1 | 2 |
Howdy. I'm working on migrating an internal system to Django and have run into a few wrinkles.
Intro
Our current system (a billing system) tracks double-entry bookkeeping while allowing users to enter data as invoices, expenses, etc.
Base Objects
So I have two base objects/models:
JournalEntry
JournalEntryItems
defined as follows:
class JournalEntry(models.Model):
gjID = models.AutoField(primary_key=True)
date = models.DateTimeField('entry date');
memo = models.CharField(max_length=100);
class JournalEntryItem(models.Model):
journalEntryID = models.AutoField(primary_key=True)
gjID = models.ForeignKey(JournalEntry, db_column='gjID')
amount = models.DecimalField(max_digits=10,decimal_places=2)
So far, so good. It works quite smoothly on the admin side (inlines work, etc.)
On to the next section.
We then have two more models
InvoiceEntry
InvoiceEntryItem
An InvoiceEntry is a superset of / it inherits from JournalEntry, so I've been using a OneToOneField (which is what we're using in the background on our current site). That works quite smoothly too.
class InvoiceEntry(JournalEntry):
invoiceID = models.AutoField(primary_key=True, db_column='invoiceID', verbose_name='')
journalEntry = models.OneToOneField(JournalEntry, parent_link=True, db_column='gjID')
client = models.ForeignKey(Client, db_column='clientID')
datePaid = models.DateTimeField(null=True, db_column='datePaid', blank=True, verbose_name='date paid')
Where I run into problems is when trying to add an InvoiceEntryItem (which inherits from JournalEntryItem) to an inline related to InvoiceEntry. I'm getting the error:
<class 'billing.models.InvoiceEntryItem'> has more than 1 ForeignKey to <class 'billing.models.InvoiceEntry'>
The way I see it, InvoiceEntryItem has a ForeignKey directly to InvoiceEntry. And it also has an indirect ForeignKey to InvoiceEntry through the JournalEntry 1->M JournalEntryItems relationship.
Here's the code I'm using at the moment.
class InvoiceEntryItem(JournalEntryItem):
invoiceEntryID = models.AutoField(primary_key=True, db_column='invoiceEntryID', verbose_name='')
invoiceEntry = models.ForeignKey(InvoiceEntry, related_name='invoiceEntries', db_column='invoiceID')
journalEntryItem = models.OneToOneField(JournalEntryItem, db_column='journalEntryID')
I've tried removing the journalEntryItem OneToOneField. Doing that then removes my ability to retrieve the dollar amount for this particular InvoiceEntryItem (which is only stored in journalEntryItem).
I've also tried removing the invoiceEntry ForeignKey relationship. Doing that removes the relationship that allows me to see the InvoiceEntry 1->M InvoiceEntryItems in the admin inline. All I see are blank fields (instead of the actual data that is currently stored in the DB).
It seems like option 2 is closer to what I want to do. But my inexperience with Django seems to be limiting me. I might be able to filter the larger pool of journal entries to see just invoice entries. But it would be really handy to think of these solely as invoices (instead of a subset of journal entries).
Any thoughts on how to do what I'm after?
|
Django object extension / one to one relationship issues
| 3,396,991 | 1 | 2 | 709 | 0 |
python,django,inheritance,inline,admin
|
First, inheriting from a model creates an automatic OneToOneField in the inherited model towards the parents so you don't need to add them. Remove them if you really want to use this form of model inheritance.
If you only want to share the member of the model, you can use Meta inheritance which will create the inherited columns in the table of your inherited model. This way would separate your JournalEntry in 2 tables though but it would be easy to retrieve only the invoices.
| 0 | 0 | 0 | 0 |
2010-07-31T02:08:00.000
| 2 | 1.2 | true | 3,376,479 | 0 | 0 | 1 | 2 |
Howdy. I'm working on migrating an internal system to Django and have run into a few wrinkles.
Intro
Our current system (a billing system) tracks double-entry bookkeeping while allowing users to enter data as invoices, expenses, etc.
Base Objects
So I have two base objects/models:
JournalEntry
JournalEntryItems
defined as follows:
class JournalEntry(models.Model):
gjID = models.AutoField(primary_key=True)
date = models.DateTimeField('entry date');
memo = models.CharField(max_length=100);
class JournalEntryItem(models.Model):
journalEntryID = models.AutoField(primary_key=True)
gjID = models.ForeignKey(JournalEntry, db_column='gjID')
amount = models.DecimalField(max_digits=10,decimal_places=2)
So far, so good. It works quite smoothly on the admin side (inlines work, etc.)
On to the next section.
We then have two more models
InvoiceEntry
InvoiceEntryItem
An InvoiceEntry is a superset of / it inherits from JournalEntry, so I've been using a OneToOneField (which is what we're using in the background on our current site). That works quite smoothly too.
class InvoiceEntry(JournalEntry):
invoiceID = models.AutoField(primary_key=True, db_column='invoiceID', verbose_name='')
journalEntry = models.OneToOneField(JournalEntry, parent_link=True, db_column='gjID')
client = models.ForeignKey(Client, db_column='clientID')
datePaid = models.DateTimeField(null=True, db_column='datePaid', blank=True, verbose_name='date paid')
Where I run into problems is when trying to add an InvoiceEntryItem (which inherits from JournalEntryItem) to an inline related to InvoiceEntry. I'm getting the error:
<class 'billing.models.InvoiceEntryItem'> has more than 1 ForeignKey to <class 'billing.models.InvoiceEntry'>
The way I see it, InvoiceEntryItem has a ForeignKey directly to InvoiceEntry. And it also has an indirect ForeignKey to InvoiceEntry through the JournalEntry 1->M JournalEntryItems relationship.
Here's the code I'm using at the moment.
class InvoiceEntryItem(JournalEntryItem):
invoiceEntryID = models.AutoField(primary_key=True, db_column='invoiceEntryID', verbose_name='')
invoiceEntry = models.ForeignKey(InvoiceEntry, related_name='invoiceEntries', db_column='invoiceID')
journalEntryItem = models.OneToOneField(JournalEntryItem, db_column='journalEntryID')
I've tried removing the journalEntryItem OneToOneField. Doing that then removes my ability to retrieve the dollar amount for this particular InvoiceEntryItem (which is only stored in journalEntryItem).
I've also tried removing the invoiceEntry ForeignKey relationship. Doing that removes the relationship that allows me to see the InvoiceEntry 1->M InvoiceEntryItems in the admin inline. All I see are blank fields (instead of the actual data that is currently stored in the DB).
It seems like option 2 is closer to what I want to do. But my inexperience with Django seems to be limiting me. I might be able to filter the larger pool of journal entries to see just invoice entries. But it would be really handy to think of these solely as invoices (instead of a subset of journal entries).
Any thoughts on how to do what I'm after?
|
Django MySql setup
| 3,377,350 | 1 | 0 | 5,039 | 1 |
python,mysql,django
|
syncdb will not create a database for you -- it only creates tables that don't already exist in your schema. You need to:
Create a user to 'own' the database (root is a bad choice).
Create the database with that user.
Update the Django database settings with the correct database name, user, and password.
| 0 | 0 | 0 | 0 |
2010-07-31T03:34:00.000
| 2 | 0.099668 | false | 3,376,673 | 0 | 0 | 1 | 1 |
I set up Mysql5, mysql5-server and py26-mysql using Macports. I then started the mysql server and was able to start the prompt with mysql5
In my settings.py i changed database_engine to "mysql" and put "dev.db" in database_name.
I left the username and password blank as the database doesnt exist yet.
When I ran python manage.py syncdb, django raised an error
'django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dynamic module does not define init function (init_mysql)`
How do I fix this? Do I have to create the database first? is it something else?
|
A scalable solution for server side push?
| 3,378,244 | 2 | 3 | 651 | 0 |
php,python,linux,server-push,publish-subscribe
|
If you know in advance you'll have a lot of subscribers (people/applications) that want notifications on a certain subject while on other hand you'll have few different subjects consider a pull technology anyway.
RSS, Atom are quite successful even though they use pull. The reason: no need to have an administration on the server of people who are subscribed, to detect who is no longer interested (client offline for a long time) or having a mechanism to get all the data out to the subscribers.
Using push, you need to do very little on the server, while the clients will only pull a small amount of data everytime.
Pull costs slightly more bandwidth that's cheap anyway while it saves you a lot on CPU and software maintanance which is quite expensive.
| 0 | 1 | 0 | 0 |
2010-07-31T11:50:00.000
| 3 | 0.132549 | false | 3,377,951 | 0 | 0 | 1 | 1 |
I would like to implement a mechanism which will provide a RESTful API that allows a client to register interest in a subject with a sever, and receive asynchronous notifications from the server after the interest is registered. In enterprise (messaging) architecture, this is known as publish/subscribe 'pattern'.
With desktop applications, this is readily acheivable - however with web applications, it is proving to be more difficult.
is there a (preferably open source) framework or library out there that allows the publish/subscribe pattern to be applied to web applications?.
Server side technology may be in any of the following languages: C, C++, PHP, Python, Ruby.
I am running on Linux Ubuntu 10.0.4
|
Can Python be good alternative for web app that would otherwise be done in Java EE?
| 3,379,488 | 3 | 8 | 1,841 | 0 |
java,python,jakarta-ee
|
Any language/framework is a good choice, if it is used properly by competent developers. Sometimes the best choice is the one with which your team is most familiar.
Given your client space though, if you want to move to a "higher productivity" framework, I suggest Grails. Its implemented in Groovy, which Java developers can pick up naturally, and has various tools for generating wars, which can be deployed in your favorite servlet container. It takes a lot of the pain out of tradition J2EE development, as long as you follow the conventions. It has a ton of robust plugins for things like authentication/authorization. It will save you a ton of time.
| 0 | 0 | 0 | 0 |
2010-07-31T19:01:00.000
| 4 | 0.148885 | false | 3,379,440 | 0 | 0 | 1 | 1 |
Can Python be a good alternative to a web app that would otherwise be developed with Java EE? If so, which Python web app framework(s) may be a good choice? Please see details about the app below. I've asked a few people individually about this, who have worked for a good amount of time on either or both of Java EE and Python web apps, and got a few answers that indicated Python might not such a good choice, mainly due to ease of scaling, which is one of the needs. The other reason given was relative lack of Python developers in the part of the world where the app is being developed. We might be able to overcome the second one, but not sure about the first.
The app in question is a financial domain B2B one, with a few different types of users (as in: "actors" having different real-life roles - e.g. buyers, sellers), some admin users, will use an RDBMS, will have CRUD (Create/Read/Update/Delete) plus search functionality for master tables, some types of transactions involving both master and transaction tables, (with fairly straightforward, not very complex logic), and some reports to PDF for most / all of the search screens (queries). Around 80 or so features, where the features mostly map to screens in the app; not all, though. It will have a few types of batch jobs too, for which the plan is to run them at times when the users are not permitted to use the app. Will have JavaScript and AJAX on the front end. Will have the feature of sending emails to users, not just for signup or resetting passwords, but for transaction-related info as well. No programmatic reading of incoming emails though.
The aim is for it to eventually to get a medium level of scale in terms of numbers of (paying) users and transactions, not very high, but not too small a number - say in the range of 10,000 users, of which 2000 may be concurrently accessing the app in a time frame of 15 to 20 minutes. It will be a SaaS (Software as a Service) app.
I know the question is very general and open ended and I expect some answers on the lines of "It depends" :) but still want to get some views from people who have worked on such things.
Feel free to ask more questions if needed to answer. I'll answer them except for anything that is confidential.
Thanks.
Edit 1:
Really appreciate all the answers. I will take a little time to think about them, and then get back with further questions (original, or in response to answers) or comments, if any.
|
Combining static HTML, a Django backend and a PHP forum on one server?
| 3,382,449 | 2 | 1 | 1,097 | 0 |
php,python,html,django
|
I see no problem with such setup, using lightweight frontend is recommended for django (or any other wsgi app) anyway. Although you should serve static html with nginx itself, not django.
| 0 | 0 | 0 | 0 |
2010-08-01T14:36:00.000
| 2 | 1.2 | true | 3,382,390 | 0 | 0 | 1 | 1 |
I have a project coming up for client who is basically happy with how he manages his website. It's lots of HTML files (around 300 of them) that he insists on keeping flat HTML files so can easily edit and manage them using Dreamweaver. His site has a lot of traffic and so I'm looking into options of keeping things simple for him. He does insist on this method for the time being, I hope to win him around eventually. I'm slowly moving him off his expensive shared hosting package (he maxes it out constantly due to traffic) and getting him on a VPS so I have more control over what I can install and the resources are more flexible etc.
My issue is, there is some parts of the site that are in PHP. The small admin area he uses to do his newsletters for example sits separately away and he still requires this function. I'm thinking that since I'd have him on a server I can install what I like on, I want to start incorporating Django into the site. I'd much more prefer to do Django development for any admin type situation then trying to hack or make something with PHP. I know about the PHP frameworks out there, but they just don't appeal in this particular situation.
Due to this massive set of HTML files, is it possible to basically allow Django to carry on serving these up as they are... He can edit and upload them with Dreamweaver as he always has... But Django is 'there' for the admin side of it which he can do his newsletter? Eventually he is wanting translations for the pages and login for visitors (again which I'd like to do with Django) but for the time being I'm in this transitional period and wanting to do things step by step.
Aside note, he has a forum that is in PHP, which he also wants to keep... So I'm thinking a carefully setup combination of Nginx, FastCGI and Gunicorn so static, PHP and Django respectively can co-exist on the same server. Is this just foolish, or totally possible?
Any thoughts, guidance, tips or experience would be greatly appreciated so I take the best step forward.
|
Django with huge mysql database
| 3,389,840 | 0 | 4 | 2,045 | 0 |
python,django,csv
|
Depending upon the data format (you said CSV) and the database, you'll probably be better off loading the data directly into the database (either directly into the Django-managed tables, or into temp tables). As an example, Oracle and SQL Server provide custom tools for loading large amounts of data. In the case of MySQL, there are a lot of tricks that you can do. As an example, you can write a perl/python script to read the CSV file and create a SQL script with insert statements, and then feed the SQL script directly to MySQL.
As others have said, always drop your indexes and triggers before loading large amounts of data, and then add them back afterwards -- rebuilding indexes after every insert is a major processing hit.
If you're using transactions, either turn them off or batch your inserts to keep the transactions from being too large (the definition of too large varies, but if you're doing 1 million rows of data, breaking that into 1 thousand transactions is probably about right).
And most importantly, BACKUP UP YOUR DATABASE FIRST! The only thing worse than having to restore your database from a backup because of an import screwup is not having a current backup to restore from.
| 0 | 0 | 0 | 0 |
2010-08-02T06:08:00.000
| 5 | 0 | false | 3,385,400 | 0 | 0 | 1 | 3 |
What would be the best way to import multi-million record csv files into django.
Currently using python csv module, it takes 2-4 days for it process 1 million record file. It does some checking if the record already exists, and few others.
Can this process be achieved to execute in few hours.
Can memcache be used somehow.
Update: There are django ManyToManyField fields that get processed as well. How will these used with direct load.
|
Django with huge mysql database
| 3,385,550 | 3 | 4 | 2,045 | 0 |
python,django,csv
|
I'm not sure about your case, but we had similar scenario with Django where ~30 million records took more than one day to import.
Since our customer was totally unsatisfied (with the danger of losing the project), after several failed optimization attempts with Python, we took a radical strategy change and did the import(only) with Java and JDBC (+ some mysql tuning), and got the import time down to ~45 minutes (with Java it was very easy to optimize because of the very good IDE and profiler support).
| 0 | 0 | 0 | 0 |
2010-08-02T06:08:00.000
| 5 | 0.119427 | false | 3,385,400 | 0 | 0 | 1 | 3 |
What would be the best way to import multi-million record csv files into django.
Currently using python csv module, it takes 2-4 days for it process 1 million record file. It does some checking if the record already exists, and few others.
Can this process be achieved to execute in few hours.
Can memcache be used somehow.
Update: There are django ManyToManyField fields that get processed as well. How will these used with direct load.
|
Django with huge mysql database
| 4,772,823 | 0 | 4 | 2,045 | 0 |
python,django,csv
|
Like Craig said, you'd better fill the db directly first.
It implies creating django models that just fits the CSV cells (you can then create better models and scripts to move the data)
Then, db feedding : a tool of choice for doing this is Navicat, you can grab a functional 30 days demo on their site. It allows you to import CSV in MySQL, save the importation profile in XML...
Then I would launch the data control scripts from within Django, and when you're done, migrating your model with South to get what you want or , like I said earlier, create another set of models within your project and use scripts to convert/copy the data.
| 0 | 0 | 0 | 0 |
2010-08-02T06:08:00.000
| 5 | 0 | false | 3,385,400 | 0 | 0 | 1 | 3 |
What would be the best way to import multi-million record csv files into django.
Currently using python csv module, it takes 2-4 days for it process 1 million record file. It does some checking if the record already exists, and few others.
Can this process be achieved to execute in few hours.
Can memcache be used somehow.
Update: There are django ManyToManyField fields that get processed as well. How will these used with direct load.
|
logout from command prompt to uploading application on google app
| 3,388,313 | 3 | 1 | 556 | 0 |
python,google-app-engine,command-prompt
|
You can run appcfg.py with --no_cookies to tell it not to store authentication cookies, or -e EMAIL to specify an email address that differs from the one in the current cookie.
| 0 | 1 | 0 | 0 |
2010-08-02T12:15:00.000
| 1 | 0.53705 | false | 3,387,605 | 0 | 0 | 1 | 1 |
I am uploading google app engine application with the help of appcfg.py command from command prompt in windows.
But after one login I want to upload another application from the same command prompt but i cannot because this second application has no rights with the current login so i want to logout from this session on command prompt so for that what to do? It is a python application
Is there any command to logout from command prompt?
|
What purpose does a python backend serve?
| 3,388,948 | 2 | 1 | 4,068 | 0 |
php,python,backend
|
A "Python backend" is simply server-side software written in Python, no different in general terms than server-side software written in PHP. It does all the same things, just with a different programming language.
| 0 | 0 | 0 | 0 |
2010-08-02T14:43:00.000
| 2 | 0.197375 | false | 3,388,829 | 0 | 0 | 1 | 2 |
I am primarily a PHP developer, and I have been browsing the source code of a few open-source applications recently(Mozilla Bespin in particular), to find that some of them use a Python "back-end." I was just wondering what the purpose of this back-end is. I am assuming it is the same thing as the model in an MVC framework and is used to interface with the database, but I'm unsure. If I'm right and the back-end is used to simply interface with the database, is the sqlite/mysql server included in the backend, because I didn't see any database config information in the install directions?
|
What purpose does a python backend serve?
| 3,388,977 | 1 | 1 | 4,068 | 0 |
php,python,backend
|
It looks like Bespin uses Python in the same way it would use PHP, if the autors chose PHP and not Python.
If you are a PHP developer, you already are a "back-end" programmer and you already know what it does, the only difference is the programming language that was used to do that.
Some web sites, mostly the huge ones like Facebook or Twitter, consist of more layers than the usual MVC ones. If you look at Facebook, you can see PHP scripts that generate HTML and AJAX responses as the "front-end" and high-performance databases, storage, computation cluster, application servers etc. as the "back-end" (where PHP is rarely used). So what is considered "front-end" and what "back-end" may also depend on how you look at it.
| 0 | 0 | 0 | 0 |
2010-08-02T14:43:00.000
| 2 | 0.099668 | false | 3,388,829 | 0 | 0 | 1 | 2 |
I am primarily a PHP developer, and I have been browsing the source code of a few open-source applications recently(Mozilla Bespin in particular), to find that some of them use a Python "back-end." I was just wondering what the purpose of this back-end is. I am assuming it is the same thing as the model in an MVC framework and is used to interface with the database, but I'm unsure. If I'm right and the back-end is used to simply interface with the database, is the sqlite/mysql server included in the backend, because I didn't see any database config information in the install directions?
|
Flash video record on website tutorial
| 3,393,137 | 1 | 1 | 549 | 0 |
python,flash,video-capture,html5-video
|
There are many video solutions. Here are two:
Take a look at Flash Media Server (FMS). You will need to some server-side code to place the video into a folder as it streams up.
Also, if you're looking into free open-source take a look at Red5.
| 0 | 0 | 0 | 1 |
2010-08-02T19:49:00.000
| 1 | 1.2 | true | 3,391,222 | 0 | 0 | 1 | 1 |
I wanted to make a website that would let users record a small video message through their broswer and save it to my website.
As I have never used flash, i wanted to know what softwares would be required and what programming languages would I need? I mean, what should I go about learning to implement such a site. I would prefer open-source solutions wherever possible.
Can something like this be implemented using python and html5?
|
Python Path import problems
| 3,391,404 | 0 | 0 | 252 | 0 |
python
|
Fixed it. Sorry Santa for not including the console print out. Windows was dumb and added an extra .py to the file when I created it. So everything was actually "pythonfile.py.py". Awesome.
| 0 | 0 | 0 | 0 |
2010-08-02T20:11:00.000
| 1 | 1.2 | true | 3,391,368 | 0 | 0 | 1 | 1 |
I added a folder to my PYTHONPATH where I can put all of my Django Apps. I print sys.path, and everything looks good, the folder I want is there. However, when I go to import a module, it tells me that there's no module by that name. All the site-packages modules work fine. In all of my Django apps, there's an "_____init_____.py" like there's supposed to be. I heard that if those are created on windows there can be problems, but I couldn't dig up much more than that.
|
In Django, how to get django-storages, boto and easy_thumbnail to work nicely?
| 5,262,932 | 17 | 5 | 1,958 | 0 |
python,django,amazon-s3,thumbnails
|
easy_thumbnails will do S3-based image thumbnailing for you - you just need to set settings.THUMBNAIL_DEFAULT_STORAGE, so that easy_thumbnails knows which storage to use (in your case, you probably want to set it to the same storage you're using for your ImageFields).
| 0 | 0 | 0 | 0 |
2010-08-03T14:38:00.000
| 2 | 1 | false | 3,397,599 | 0 | 0 | 1 | 1 |
I'm making a website where files are uploaded through the admin and this will then store them on Amazon S3. I'm using django-storages and boto for this, and it seems to be working just fine.
Thing is, I'm used to use my easy_thumbnails (the new sorl.thumbnail) on the template side to create thumbnails on the fly. I prefer this approach, rather than the model side, as it allows for easier maintenance if ever I decide to change the thumbnail size at a later date etc.
But I'm realising that easy_thumbnails doesn't seem to like reading the image now it's stored on Amazon S3. Also, I realised, where exactly would it be putting the thumbnails once made anyhow? Obviously, I'd prefer these to be on Amazon S3 as well. But how do I get these two technologies to play nice?
How would I get easy_thumbnails to store the thumb it creates back on Amazon S3? Or am I just looking at this all wrong?!
Thanks!
|
how can i verify all links on a page as a black-box tester
| 3,397,887 | 0 | 2 | 412 | 0 |
python,testing,black-box
|
What exactly is "Testing links"?
If it means they lead to non-4xx URIs, I'm afraid You must visit them.
As for existence of given links (like "Contact"), You may look for them using xpath.
| 0 | 0 | 1 | 0 |
2010-08-03T15:05:00.000
| 4 | 0 | false | 3,397,850 | 0 | 0 | 1 | 2 |
I'm tryng to verify if all my page links are valid, and also something similar to me if all the pages have a specified link like contact. i use python unit testing and selenium IDE to record actions that need to be tested.
So my question is can i verify the links in a loop or i need to try every link on my own?
i tried to do this with __iter__ but it didn't get any close ,there may be a reason that i'm poor at oop, but i still think that there must me another way of testing links than clicking them and recording one by one.
|
how can i verify all links on a page as a black-box tester
| 3,399,490 | 0 | 2 | 412 | 0 |
python,testing,black-box
|
You could (as yet another alternative), use BeautifulSoup to parse the links on your page and try to retrieve them via urllib2.
| 0 | 0 | 1 | 0 |
2010-08-03T15:05:00.000
| 4 | 0 | false | 3,397,850 | 0 | 0 | 1 | 2 |
I'm tryng to verify if all my page links are valid, and also something similar to me if all the pages have a specified link like contact. i use python unit testing and selenium IDE to record actions that need to be tested.
So my question is can i verify the links in a loop or i need to try every link on my own?
i tried to do this with __iter__ but it didn't get any close ,there may be a reason that i'm poor at oop, but i still think that there must me another way of testing links than clicking them and recording one by one.
|
having to run multiple instances of a web service for ruby/python seems like a hack to me
| 3,399,696 | 1 | 1 | 584 | 0 |
python,ruby-on-rails
|
Even if Ruby/Python interpreters were perfect, and could utilize all avail CPU with single process, you would still reach maximal capability of single server sooner or later and have to scale across several machines, going back to running several instances of your app.
| 0 | 0 | 0 | 1 |
2010-08-03T18:06:00.000
| 6 | 0.033321 | false | 3,399,367 | 1 | 0 | 1 | 5 |
Is it just me or is having to run multiple instances of a web server to scale a hack?
Am I wrong in this?
Clarification
I am referring to how I read people run multiple instances of a web service on a single server. I am not talking about a cluster of servers.
|
having to run multiple instances of a web service for ruby/python seems like a hack to me
| 3,399,437 | 1 | 1 | 584 | 0 |
python,ruby-on-rails
|
With no details, it is very difficult to see what you are getting at. That being said, it is quite possible that you are simply not using the right approach for your problem.
Sometimes multiple separate instances are better. Sometimes, your Python services are actually better deployed behind a single Apache instance (using mod_wsgi) which may elect to use more than a single process. I don't know about Ruby to opinionate there.
In short, if you want to make your service scalable then the way to do so depends heavily on additional details. Is it scaling up or scaling out? What is the operating system and available or possibly installable server software? Is the service itself easily parallelized and how much is it database dependent? How is the database deployed?
| 0 | 0 | 0 | 1 |
2010-08-03T18:06:00.000
| 6 | 0.033321 | false | 3,399,367 | 1 | 0 | 1 | 5 |
Is it just me or is having to run multiple instances of a web server to scale a hack?
Am I wrong in this?
Clarification
I am referring to how I read people run multiple instances of a web service on a single server. I am not talking about a cluster of servers.
|
having to run multiple instances of a web service for ruby/python seems like a hack to me
| 3,402,337 | 0 | 1 | 584 | 0 |
python,ruby-on-rails
|
Your assumption that Tomcat's and IIS's single process per server is superior is flawed. The choice of a multi-threaded server and a multi-process server depends on a lot of variables.
One main thing is the underlying operating system. Unix systems have always had great support for multi-processing because of the copy-on-write nature of the fork system call. This makes multi-processes a really attractive option because web-serving is usually very shared-nothing and you don't have to worry about locking. Windows on the other hand had much heavier processes and lighter threads so programs like IIS would gravitate to a multi-threading model.
As for the question to wether it's a hack to run multiple servers really depends on your perspective. If you look at Apache, it comes with a variety of pluggable engines to choose from. The MPM-prefork one is the default because it allows the programmer to easily use non-thread-safe C/Perl/database libraries without having to throw locks and semaphores all over the place. To some that might be a hack to work around poorly implemented libraries. To me it's a brilliant way of leaving it to the OS to handle the problems and letting me get back to work.
Also a multi-process model comes with a few features that would be very difficult to implement in a multi-threaded server. Because they are just processes, zero-downtime rolling-updates are trivial. You can do it with a bash script.
It also has it's short-comings. In a single-server model setting up a singleton that holds some global state is trivial, while on a multi-process model you have to serialize that state to a database or Redis server. (Of course if your single-process server outgrows a single server you'll have to do that anyway.)
Is it a hack? Yes and no. Both original implementations (MRI, and CPython) have Global Interpreter Locks that will prevent a multi-core server from operating at it's 100% potential. On the other hand multi-process has it's advantages (especially on the Unix-side of the fence).
There's also nothing inherent in the languages themselves that makes them require a GIL, so you can run your application with Jython, JRuby, IronPython or IronRuby if you really want to share state inside a single process.
| 0 | 0 | 0 | 1 |
2010-08-03T18:06:00.000
| 6 | 0 | false | 3,399,367 | 1 | 0 | 1 | 5 |
Is it just me or is having to run multiple instances of a web server to scale a hack?
Am I wrong in this?
Clarification
I am referring to how I read people run multiple instances of a web service on a single server. I am not talking about a cluster of servers.
|
having to run multiple instances of a web service for ruby/python seems like a hack to me
| 3,399,409 | 4 | 1 | 584 | 0 |
python,ruby-on-rails
|
Not really, people were running multiple frontends across a cluster of servers before multicore cpus became widespread
So there has been all the infrastructure for supporting sessions properly across multiple frontends for quite some time before it became really advantageous to run a bunch of threads on one machine.
Infact using asynchronous style frontends gives better performance on the same hardware than a multithreaded approach, so I would say that not running multiple instances in favour of a multithreaded monster is a hack
| 0 | 0 | 0 | 1 |
2010-08-03T18:06:00.000
| 6 | 1.2 | true | 3,399,367 | 1 | 0 | 1 | 5 |
Is it just me or is having to run multiple instances of a web server to scale a hack?
Am I wrong in this?
Clarification
I am referring to how I read people run multiple instances of a web service on a single server. I am not talking about a cluster of servers.
|
having to run multiple instances of a web service for ruby/python seems like a hack to me
| 3,399,416 | 4 | 1 | 584 | 0 |
python,ruby-on-rails
|
Since we are now moving towards more cores, rather than faster processors - in order to scale more and more, you will need to be running more instances.
So yes, I reckon you are wrong.
This does not by any means condone brain-dead programming with the excuse that you can just scale it horizontally, that just seems retarded.
| 0 | 0 | 0 | 1 |
2010-08-03T18:06:00.000
| 6 | 0.132549 | false | 3,399,367 | 1 | 0 | 1 | 5 |
Is it just me or is having to run multiple instances of a web server to scale a hack?
Am I wrong in this?
Clarification
I am referring to how I read people run multiple instances of a web service on a single server. I am not talking about a cluster of servers.
|
need to selectively escape html entities (&)
| 3,405,525 | 0 | 1 | 576 | 0 |
python,escaping,html-entities
|
You shouldn't use an XML parser to parse data that isn't XML. Find an HTML parser instead, you'll be happier in the long run. The standard library has a few (HTMLParser and htmllib), and BeautifulSoup is a well-loved third-party package.
| 0 | 0 | 1 | 0 |
2010-08-04T06:40:00.000
| 4 | 0 | false | 3,403,168 | 0 | 0 | 1 | 1 |
I'm scraping a html page, then using xml.dom.minidom.parseString() to create a dom object.
however, the html page has a '&'. I can use cgi.escape to convert this into & but it also converts all my html <> tags into <> which makes parseString() unhappy.
how do i go about this? i would rather not just hack it and straight replace the "&"s
thanks
|
djangoproject access fields of object dynamically
| 3,404,200 | 0 | 0 | 53 | 0 |
python,django
|
setattr(obj, fieldname, fieldvalue)
(see also getattr to retrieve at runtime)
| 0 | 0 | 0 | 0 |
2010-08-04T09:05:00.000
| 2 | 0 | false | 3,404,055 | 0 | 0 | 1 | 1 |
Can anyone help me?
I have list of fields called 'allowed_fields' and I have object called 'individual'.
allowed_fields is sub set of individual. Now I want to run loop like this
for field in allowed_fields:
obj.field = individual.field
obj have same fields like individual. Do you have solution of my problem? I will thankful to you.
|
Finding the user who uses my django web application
| 3,404,772 | 1 | 0 | 206 | 0 |
python,django
|
You can look in the admin to see how many usernames are there, assuming everyone who likes it creates one. Or you can look at your server logs and count the unique IPs.
| 0 | 0 | 0 | 0 |
2010-08-04T10:48:00.000
| 3 | 0.066568 | false | 3,404,759 | 0 | 0 | 1 | 2 |
I have developed a small django web application. It still runs in the django development web server.
It has been decided that if more than 'n' number of users like the application, it will be approved.
I want to find out all the users who view my application.
How can find the user who views my application?
Since I was the user who ran the application, all python ways of getting the username returns my name only.
Please help.
|
Finding the user who uses my django web application
| 3,405,077 | 1 | 0 | 206 | 0 |
python,django
|
Step 1. Add a model -- connected users. Include an FK to username and a datetime stamp.
Step 2. Write a function to log each user's activity.
Step 3. Write your own version of login that will call the Django built-in login and also call your function to log each user's activity.
Step 4. Write a small application -- outside Django -- that uses the ORM to query the connected users table and write summaries and counts and what-not.
You have a database. Use it.
| 0 | 0 | 0 | 0 |
2010-08-04T10:48:00.000
| 3 | 0.066568 | false | 3,404,759 | 0 | 0 | 1 | 2 |
I have developed a small django web application. It still runs in the django development web server.
It has been decided that if more than 'n' number of users like the application, it will be approved.
I want to find out all the users who view my application.
How can find the user who views my application?
Since I was the user who ran the application, all python ways of getting the username returns my name only.
Please help.
|
How to make a Django passthrough view?
| 3,407,020 | 1 | 2 | 523 | 0 |
python,ajax,django
|
None.
You'll have to code your own wrapper utility, using one of httplib / urllib / urllib2 libs to connect to the other server.
Most likely you will have to extract all the relevant info from the HttpRequest object and use that to manually construct your own request in said util function.
Regarding receiving the response from that other server, it will depend a little bit on wether you need that response only asynchronously or quasi-synchronously.
| 0 | 0 | 0 | 0 |
2010-08-04T14:58:00.000
| 1 | 0.197375 | false | 3,406,800 | 0 | 0 | 1 | 1 |
I want to make a Django view that does the following:
Receive an HttpRequest on api/some/url/or/other
Passes this through to another server at some/url/or/other (rewrite the URL, basically)
Adding a cookie based on session data in Django
Using the same method, data, params, et al, that were in the original request
Returns verbatim the response to the API call
Must store the cookies that came back from the call in the session
Must include the Django session cookie in the returned HttpResponse
What tools already exist in Django to do this?
|
Appengine Blobstore - Video Streaming
| 3,409,743 | 5 | 6 | 1,334 | 0 |
python,google-app-engine
|
I would say the blobstore is suitable for this. While datastore entities are limited to 1MB and standard HTTP responses are limited to 10MB, with the blobstore you can upload, store, and serve files up to 2GB. The 30 second limit refers to how long your handler can execute; time spent downloading (or uploading) doesn't count towards this limit.
The blobstore also supports byte ranges, so if your flash component supports it, you can seek to random positions in the video without downloading everything first.
| 0 | 1 | 0 | 0 |
2010-08-04T20:27:00.000
| 1 | 0.761594 | false | 3,409,549 | 0 | 0 | 1 | 1 |
I'm trying to setup a video streaming app via the Google Appengine Blobstore. Just wanted to know if this was possible, as there isn't too much regarding this in the Appengine Documentation. Basically I want to serve these videos through a flash player.
Thanks
|
Where does django dev server (manage.py runserver) get its path from?
| 3,411,300 | 1 | 0 | 2,351 | 0 |
python,django,path,django-manage.py,devserver
|
manage.py imports settings.py from the current directory and pass settings as parameter to execute_manager. You probably defined project root in settings.py.
| 0 | 0 | 0 | 0 |
2010-08-05T01:30:00.000
| 2 | 1.2 | true | 3,411,131 | 0 | 0 | 1 | 1 |
I recently moved a django app from c:\Users\user\django-projects\foo\foobar to c:\Python25\Lib\site-packages\foo\foobar (which is on the python path). I started a new app in the django-projects directory, and added foo.foobar to the INSTALLED_APPS setting. When I try to run the dev server (manage.py runserver) for my new app, I get the error ImportError: No module named foobar.
Looking through the traceback, it's looking in the c:\Users\user\django-projects\foo\..\foo\foobar for the foobar app. I checked my PATH and PYTHONPATH environment variables, and neither point to c:\Users\user\django-projects\foo and It doesn't show up in sys.path when I run the python interpreter.
I'm guessing I somehow added c:\Users\user\django-projects\foo to django's path sometime along the development of foo but I don't remember how I did it.
So, with all that lead up, my question is "how do I make manage.py look in c:\Python25\Lib\site-packages instead of c:\Users\user\django-projects\foo?"
Thanks,
Lexo
|
Python vs C#/.NET -- what are the key differences to consider for using one to develop a large web application?
| 22,076,548 | 6 | 58 | 86,003 | 0 |
.net,python,sql-server,django,asp.net-mvc-2
|
I would also suggest we must compare runtimes and not limit to language features before making such moves. Python runs via interpreter CPython where C# runs on CLR in their default implementations.
Multitasking is very important in any large scale project; .NET can easily handle this via threads... and also it can take benefits of worker processes in IIS (ASP.NET). CPython doesn't offer true threading capabilities because of GIL...a lock that every thread has to acquire before executing any code, for true multitasking you have to use multiple processes.
When we host ASP.NET application on IIS on single worker process, ASP.NET can still take advantage of threading to serve multiple web requests simultaneously on different cores where CPython depends on multiple work processes to achieve parallel computing on different cores.
All of this leads to a big question, how we are going to host Python/Django app on windows. We all know forking process on windows is much more costly than Linux. So ideally to host Python/Django app; best environment would be Linux rather than windows.
If you choose Python, the right environment to developed and host Python would be Linux...and if you are like me coming from windows, choosing Python would introduce new learning curve of Linux as well...although is not very hard these days...
| 0 | 0 | 0 | 0 |
2010-08-06T02:18:00.000
| 4 | 1 | false | 3,420,594 | 0 | 0 | 1 | 1 |
My organization currently delivers a web application primarily based on a SQL Server 2005/2008 back end, a framework of Java models/controllers, and ColdFusion-based views. We have decided to transition to a newer framework and after internal explorations and mini projects have narrowed the choice down to between Python and C#/.NET.
Let me start off by saying that I realize either technology will work great, and am looking for the key differentiators (and associated pros and cons) These languages have a lot in common, and a lot not--I'm looking for your take on their key differences.
Example tradeoff/differentiator I am looking for:
While it seems you can accomplish more with less code and be more creative with Python, since .NET is more structured it may be easier to take over understanding and modifying code somebody else wrote.
Some extra information that may be useful:
Our engineering team is about 20 large and we work in small teams of 5-7 of which we rotate people in and out frequently. We work on code that somebody else wrote as much as we write new code.
With python we would go the Django route, and with .NET we would go with MVC2. Our servers are windows servers running IIS.
Some things we like about ColdFusion include that its very easy to work with queries and that we can "hot-deploy" fixes to our webservers without having to reboot them or interrupt anybody on them.
I've read some of the other X vs Y threads involving these two languages and found them very helpful, but would like to put Python head-to-head against .Net directly. Thanks in advance for letting me tap your experiences for this difficult question!
|
Simple protocols (like twisted.pb) vs messaging (AMQP/JMS) vs web services (REST/SOAP)
| 3,426,017 | 12 | 4 | 2,230 | 0 |
python,web-services,twisted,network-protocols,amqp
|
As always, "it depends". First, let's clear up the terminology.
Twisted's Perspective Broker basically is a system you can use when you have control over both ends of a distributed action (both client and server ends). It provides a way to copy objects from one end to the other and to call methods on remote objects. Copying involves serialising the object to a format suitable for network transfer, and then transferring it using Twisted's own transfer protocol. This is useful when both ends can use Twisted, and you don't need to interface with non-Twisted systems.
Generally speaking, Web Services are client-server applications that rely on HTTP for communication. The client uses HTTP to make a request to the server, which returns a result. Parameters can be encoded in eg. GET or POST requests or use a data section in a POST request to send, for example, an XML-formatted document that describes the action to be taken.
REST is the architectural idea that all resources and operations on resources that a system exposes should be directly addressable. To put it somewhat simply, it means that the URI used to access or manipulate the resource includes the resource name and the operation to carry out on it. REST can be and commonly is implemented as a Web Service using HTTP.
SOAP is a protocol for message exchange. It consists of two parts: a choice of several transport methods, and a single XML-based message format. The transport method can be, for example, HTTP, which makes SOAP a candidate for implementing Wed Services. The message format specifies all details about the requested action and the result of the action.
JMS is an API standard for Java-based messaging systems. It defines some semantics for messages (such as one-to-one or one-to-many) and includes methods for addressing, creating messages, populating them with parameters and data, sending them, and receiving and decoding them. The API makes sure that you can, in theory, change the underlying messaging system implementation without having to rewrite all of your code. However, the message system implementation doesn't need to be protocol-compatible with another JMS-enabled messaging system. So having one JMS system doesn't automatically mean that you can exchange messages with another JMS system. You probably need to build some kind of bridge service for that to work, which is going to be a major challenge especially when it comes to addressing.
AMQP attempts to improve the situation by defining a wire protocol that messaging systems must obey. This means that messaging systems from different vendors can exchange messages.
Finally, SOA is an architecture concept where applications are broken down into reusable services. These services are then combined ("orchestrated") to implement the application. Each time a new application is made, there is a chance of reusing the existing services. SOA is also something that requires non-technical support activities so that the reuse really happens and services are designed to be general enough. Also, SOA is one way of starting to package functionality in legacy systems into a meaningful whole that can then be extended and developed further using more modern techniques. SOA can be implemented using a variety of technologies, such as Web Services, messaging systems, or an Enterprise Service Bus.
You pondered the tradeoff between one connection per request and keeping the connection open for multiple requests. This depends on available resources, the messaging pattern, and the size of your data. If the incoming message stream is constantly the same, then it could be fine to let connections stay open since their amount won't change very much. On the other hand, if there are bursts of messages from several systems, then it could be useful to release resources and not let connections linger for too long. Also, if lots of data is transferred per connection, then the overhead of opening and closing the connection is small compared to the total transaction length. On the other hand, if you transfer lots of very small messages, then keeping the connection open could prove beneficial. Benchmarking with your particular parameters is the only way to be sure.
AMQP could indeed replace the Twisted-specific protocol. This would allow interacting with a non-Twisted system.
I hope this proves useful to you. If you're still wondering about something (and I think you are, since this is such a large area) then I would suggest splitting things into smaller questions and posting them individually. The answers can then be more precise.
| 0 | 0 | 0 | 0 |
2010-08-06T05:27:00.000
| 1 | 1.2 | true | 3,421,200 | 0 | 0 | 1 | 1 |
I'm currently using twisted's perspective broker on python and I have considered in the past switching to something like RabbitMQ but I'm not sure it could just replace pb - I feel like I might be comparing apples to oranges here.
I've been reading a lot about REST lately and the inevitable debate with SOAP, which led me to read about "enterprisey" web service stuff like SOA.
I have a project coming up in which I'll need to implement some erp-like functionality over web and desktop so I'm considering which approach/technology to use to communicate between servers and clients. But I'm also trying to learn as much as I can about all of this, so I don't want just to solve this particular problem.
What do you use for communication between your servers and clients?
I understand a python-specific protocol like perspective broker can limit my interoperability, but am I right to assume some AMQP protocol could replace it?
If I'm not mistaken, both twisted.pb and amqp use an always-on connection and a very low overhead protocol. But in one hand, keeping a large number of clients connected all the time could be a problem, and on the other hand, even with http keep-alive and whatever tricks they use the serialization part would still be a problem with web services.
If I'm wrong in any of my assumptions I would appreciate if someone could point me in the right direction to learn more.
|
Is there a way to automate restarting the python process after every change I make to Django models?
| 3,428,960 | 2 | 1 | 205 | 0 |
python,django,passenger,wsgi
|
My advice would be to test locally using Django's builtin server.
It does precisely auto-reload, so that any change to your code will be available.
I'm not familiar with Dreamhost, but if modwsgi is on embedded mode this is not possible.
In Daemon mode, you could write some code to detect file changes and restart the processes.
| 0 | 0 | 0 | 0 |
2010-08-06T19:56:00.000
| 1 | 1.2 | true | 3,427,287 | 0 | 0 | 1 | 1 |
I am using Django with Passenger on Dreamhost.
Every time I make a change to models, settings or views I need to pkill python from a terminal session. Does anyone know of a way to automate this? Is this something that Passenger can do?
|
django shell triggering Postgres idle transaction problems
| 3,428,147 | 1 | 2 | 437 | 0 |
python,django,postgresql,ipython
|
You may always run a cron job, that will call pg_cancel_backend() within the database, for the backends that are idle for longer than e.g. 1 day (of course that depends on the nagios settings).
| 0 | 0 | 0 | 0 |
2010-08-06T20:24:00.000
| 1 | 0.197375 | false | 3,427,505 | 0 | 0 | 1 | 1 |
It's not the fault of the django (iPython) shell, actually. The problem is developers who open the django shell ./manage.py shell run through some queries (it often only generates selects), and then either leave the shell running or somehow kill their (ssh) session (actually, I'm not sure if the latter case leaves the transaction open - I haven't tested it)
In any case, nagios regularly alerts over these idle transactions. We could, of course call developer.stop_doing_that_dammit() but it's unreliable.
I'm looking for thoughts on resolving this in a way that allows developers to use the django shell, but closes transactions should they forget to close their session out.
|
What language (Java or Python) + framework for mid sized web project?
| 3,428,411 | 2 | 2 | 492 | 0 |
java,python,google-app-engine,web-applications,stripes
|
As many things in life, this depends on what your goals are. If you intend to learn a web framework that is used in corporate environments, then choose a Java solution. If not, don't. Python is certainly more elegant and generally more fun in pretty much every way.
As to which framework to use, django has the most mindshare, as evidenced by the number of questions asked about it here. My understanding is that it's also pretty good. It's best suited for CMS-like web sites, though - at least that's what it's coming from and what it's optimized for. You might also have a look at one of the simpler, nimbler ones, such as the relatively new flask. All of these are enjoyable, though they may not all have all features on AppEngine.
| 0 | 1 | 0 | 0 |
2010-08-06T21:31:00.000
| 9 | 0.044415 | false | 3,427,946 | 0 | 0 | 1 | 5 |
I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standard SQL solution? + I need fulltext search + I need to filter objects by several parameters).
What about Java with Stripes? Should I use another framework in addition to Stripes (e.g. for database).
UPDATE:
Thanks for the advice, I finally decided to use Django with Eclipse/PyDev as an IDE.
Python/Django is simple and elegant, it's widely used and there is a great documentation. A small disadvantage is that perhaps I'll have to buy a VPS, but it shouldn't be very hard to port the project to App Engine, which is free to some extent.
|
What language (Java or Python) + framework for mid sized web project?
| 3,428,479 | 0 | 2 | 492 | 0 |
java,python,google-app-engine,web-applications,stripes
|
It depends on your personality. There's no right answer to this question any more than there's a right answer to "what kind of car should I drive?"
If you're artistic and believe code should be beautiful, use Rails.
If you're a real hacker type, I think you'll find a full-stack framework such as Rails or Django to be unsatisfying. These frameworks are "opinionated" software, which means you have to really embrace the author's vision to be most productive.
The wonderful thing about web development in the Python world is there's several great minimal frameworks. I've used several, including web.py, GAE's webapp, and cherrypy. These frameworks are like "here's a request, give me a string to serve up." It's raw. Don't think you'll be stuck in Python concatenating strings though, God no. There's also several excellent templating libraries for Python. I can personally recommend Cheetah but Mako also looks good.
| 0 | 1 | 0 | 0 |
2010-08-06T21:31:00.000
| 9 | 0 | false | 3,427,946 | 0 | 0 | 1 | 5 |
I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standard SQL solution? + I need fulltext search + I need to filter objects by several parameters).
What about Java with Stripes? Should I use another framework in addition to Stripes (e.g. for database).
UPDATE:
Thanks for the advice, I finally decided to use Django with Eclipse/PyDev as an IDE.
Python/Django is simple and elegant, it's widely used and there is a great documentation. A small disadvantage is that perhaps I'll have to buy a VPS, but it shouldn't be very hard to port the project to App Engine, which is free to some extent.
|
What language (Java or Python) + framework for mid sized web project?
| 3,428,497 | 0 | 2 | 492 | 0 |
java,python,google-app-engine,web-applications,stripes
|
Google App Engine + GWT and you have a pretty powerful combination for developing web applications. The datastore is quite fast, and it has so far done the job quite nicely for me.
In my project I had to do a lot of redesigning of my database model, because it was made for a traditional relational database, and some things were not (directly) possible with the datastore.
GWT has a fairly moderate learning curve, but it gets the job done very well. The gui code is really easy to get started with, but it's the asynchronous way of thinking that's the hardest part.
As for search I don't think it's supported in the framework. Filtering is possible on parameters.
There are some limitations to GAE, and you should consider them before putting all your eggs in that basket. The fact that GAE uses J2EE distribution standards makes the application very easy to move to a dedicated server, should the limitations of GAE become a problem. In fact I only think you would have to refactor the part of your code that makes the queries and stores the data (which shouldn't be much more than 100 lines).
| 0 | 1 | 0 | 0 |
2010-08-06T21:31:00.000
| 9 | 0 | false | 3,427,946 | 0 | 0 | 1 | 5 |
I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standard SQL solution? + I need fulltext search + I need to filter objects by several parameters).
What about Java with Stripes? Should I use another framework in addition to Stripes (e.g. for database).
UPDATE:
Thanks for the advice, I finally decided to use Django with Eclipse/PyDev as an IDE.
Python/Django is simple and elegant, it's widely used and there is a great documentation. A small disadvantage is that perhaps I'll have to buy a VPS, but it shouldn't be very hard to port the project to App Engine, which is free to some extent.
|
What language (Java or Python) + framework for mid sized web project?
| 3,428,141 | 0 | 2 | 492 | 0 |
java,python,google-app-engine,web-applications,stripes
|
I don't think the datastore is a problem. Many people will reject it out of hand because they want a standard relational database; if you are willing to consider a datastore in general then I doubt you will have any problems with the GAE datastore. Personally, I quite like it.
The thing that might trip you up is the operational limitations. For example, did you know that an HTTP request must complete within 10 seconds?
What if you get 50% of the way through a project and then find that a web service you are using sometimes take 15 seconds to respond? Now you are toast. You can't pay extra to get the limit raised or anything like that.
So, my point is that you must approach GAE with great care. Learn about the limitations and make sure that they will not be a problem before you start using it.
| 0 | 1 | 0 | 0 |
2010-08-06T21:31:00.000
| 9 | 0 | false | 3,427,946 | 0 | 0 | 1 | 5 |
I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standard SQL solution? + I need fulltext search + I need to filter objects by several parameters).
What about Java with Stripes? Should I use another framework in addition to Stripes (e.g. for database).
UPDATE:
Thanks for the advice, I finally decided to use Django with Eclipse/PyDev as an IDE.
Python/Django is simple and elegant, it's widely used and there is a great documentation. A small disadvantage is that perhaps I'll have to buy a VPS, but it shouldn't be very hard to port the project to App Engine, which is free to some extent.
|
What language (Java or Python) + framework for mid sized web project?
| 3,430,891 | 0 | 2 | 492 | 0 |
java,python,google-app-engine,web-applications,stripes
|
I've built several apps on GAE (with Python) over the last year. It's hard to beat the ease with which you can get an app up and running quickly. Don't discount the value in that alone.
While you may not understand the datastore yet, it is extremely well documented and there are great resources - including this one - to help you get past any problem you might have.
| 0 | 1 | 0 | 0 |
2010-08-06T21:31:00.000
| 9 | 0 | false | 3,427,946 | 0 | 0 | 1 | 5 |
I plan to start a mid sized web project, what language + framework would you recommend?
I know Java and Python. I am looking for something simple.
Is App Engine a good option? I like the overall simplicity and free hosting, but I am worried about the datastore (how difficult is it to make it similarly fast as a standard SQL solution? + I need fulltext search + I need to filter objects by several parameters).
What about Java with Stripes? Should I use another framework in addition to Stripes (e.g. for database).
UPDATE:
Thanks for the advice, I finally decided to use Django with Eclipse/PyDev as an IDE.
Python/Django is simple and elegant, it's widely used and there is a great documentation. A small disadvantage is that perhaps I'll have to buy a VPS, but it shouldn't be very hard to port the project to App Engine, which is free to some extent.
|
How to organize Eclipse - Workspace VS Programming languages
| 3,430,003 | 3 | 4 | 741 | 0 |
python,android,eclipse,workspace,eclipse-pdt
|
The plug-ins are stored in the Eclipse installation, not in the workspace folder. So one solution would be to different Eclipse installations for every task, in this case only the required plug-ins would load (and the others not available), on the other hand, you have to maintain at least three parallel Eclipse installations.
Another solution is to disable plug-in activation on startup: in Preferences/General/Startup and Shutdown you can disable single plug-ins not loading. The problem with this approach is, that this only helps to not load plug-ins, but its menu and toolbar contributions will be loaded.
| 0 | 0 | 0 | 1 |
2010-08-07T09:23:00.000
| 2 | 1.2 | true | 3,429,887 | 0 | 0 | 1 | 1 |
I use Eclipse for programming in PHP (PDT), Python and sometimes Android. Each of this programming languages requires to run many things after Eclipse start.
Of course I do not use all of them at one moment, I have different workspace for each of those. Is there any way, or recommendation, how to make Eclipse to run only neccessary tools when opening defined workspace?
e.g.:
I choose /workspace/www/, so then only PDT tools will run
I choose /workspace/android/, so then only Android tools and buttons in toolbars will appears
Do I have to manually remove all unneccessary things from each of the workspace? Or it is either possible to remove all?
|
Django - how to extend 3rd party models without modifying
| 3,433,146 | 10 | 10 | 3,026 | 0 |
python,django,django-models,model
|
You can use ModelName.add_to_class (or .contribute_to_class), but if you have already run syncdb, then there is no way to automatically have it add the columns you need.
For maintainable code, you will probably want to extend by sub-classing the desired model in your own app, and use something like south to handle the database migrations, or just use a OneToOneField, and have a related model (like UserProfile is to auth.User).
| 0 | 0 | 0 | 0 |
2010-08-08T04:58:00.000
| 2 | 1.2 | true | 3,433,131 | 0 | 0 | 1 | 1 |
I want to add a column to a database table but I don't want to modify the 3rd party module in case I need/decide to upgrade the module in the future. Is there a way I can add this field within my code so that with new builds I don't have to add the field manually?
|
The "next" parameter, redirect, django.contrib.auth.login
| 3,441,476 | 0 | 29 | 42,969 | 0 |
python,django,django-forms
|
create your own view for logging in, with it's own url, don't use the admin's one.
you can store the next page in the session, or pass it as a GET parameter to the login view
(i.e. /login?next=gallery) just don't forget to sanitize and validate that value before redirecting to it.
| 0 | 0 | 0 | 0 |
2010-08-09T15:12:00.000
| 6 | 0 | false | 3,441,436 | 0 | 0 | 1 | 3 |
I'm trying to redirect users to custom url "/gallery/(username)/" after successfully logging in. It currently redirects to the default "/account/profile/" url While I know what I can override the redirect url in my settings.py, my url is dynamic thus it will not work.
Documentation states that I need to use the "next" parameter and context processors. I have the {{next}} in my template, but I'm confused on how to actually pass the "/gallery/(username)". Any help would be greatly appreciated.
p.s: I'm trying to steer away from writing my own login view.
|
The "next" parameter, redirect, django.contrib.auth.login
| 5,787,355 | 43 | 29 | 42,969 | 0 |
python,django,django-forms
|
Django's login view django.contrib.auth.views.login accepts a dictionary named extra_context. The values in the dictionary are directly passed to the template. So you can use that to set the next parameter. Once that is done, you can set a hidden field with name next and value {{ next }} so that it gets rendered in the template.
| 0 | 0 | 0 | 0 |
2010-08-09T15:12:00.000
| 6 | 1 | false | 3,441,436 | 0 | 0 | 1 | 3 |
I'm trying to redirect users to custom url "/gallery/(username)/" after successfully logging in. It currently redirects to the default "/account/profile/" url While I know what I can override the redirect url in my settings.py, my url is dynamic thus it will not work.
Documentation states that I need to use the "next" parameter and context processors. I have the {{next}} in my template, but I'm confused on how to actually pass the "/gallery/(username)". Any help would be greatly appreciated.
p.s: I'm trying to steer away from writing my own login view.
|
The "next" parameter, redirect, django.contrib.auth.login
| 3,442,128 | 2 | 29 | 42,969 | 0 |
python,django,django-forms
|
You can use a static redirect to /loggedin/ and then associate the url to a view that makes the correct redirect.
Login takes an extra step but if you want to use django's view it does the job.
| 0 | 0 | 0 | 0 |
2010-08-09T15:12:00.000
| 6 | 0.066568 | false | 3,441,436 | 0 | 0 | 1 | 3 |
I'm trying to redirect users to custom url "/gallery/(username)/" after successfully logging in. It currently redirects to the default "/account/profile/" url While I know what I can override the redirect url in my settings.py, my url is dynamic thus it will not work.
Documentation states that I need to use the "next" parameter and context processors. I have the {{next}} in my template, but I'm confused on how to actually pass the "/gallery/(username)". Any help would be greatly appreciated.
p.s: I'm trying to steer away from writing my own login view.
|
Image management on Django
| 3,444,601 | 5 | 1 | 462 | 0 |
django,python-imaging-library,imagekit,django-imagekit,photologue
|
Photologue is a Django application to manage photos. It uses PIL for the image processing.
ImageKit is a Django Application for image processing. It is meant for adding images to existing models.
PIL is the underlying library for both of these (and actually, most if not all image processing scripts in Python).
| 0 | 0 | 0 | 0 |
2010-08-09T21:53:00.000
| 1 | 1.2 | true | 3,444,504 | 1 | 0 | 1 | 1 |
I'm trying to figure out which image management library to use on django. What is the difference between photologue, image-kit, and pil(python imaging library)?
|
How to build a computationally intensive webservice?
| 3,444,821 | 1 | 9 | 1,140 | 0 |
python
|
I think you can build it however you like, as long as you can make it an asynchronous service so that the users don't have to wait.
Unless, of course, the users don't mind waiting in this context.
| 0 | 0 | 0 | 0 |
2010-08-09T22:56:00.000
| 4 | 0.049958 | false | 3,444,804 | 0 | 0 | 1 | 1 |
I need to build a webservice that is very computationally intensive, and I'm trying to get my bearings on how best to proceed.
I expect users to connect to my service, at which point some computation is done for some amount of time, typically less than 60s. The user knows that they need to wait, so this is not really a problem. My question is, what's the best way to structure a service like this and leave me with the least amount of headache? Can I use Node.js, web.py, CherryPy, etc.? Do I need a load balancer sitting in front of these pieces if used? I don't expect huge numbers of users, perhaps hundreds or into the thousands. I'll need a number of machines to host this number of users, of course, but this is uncharted territory for me, and if someone can give me a few pointers or things to read, that would be great.
Thanks.
|
Can Cherokee serve a fallback/default page when a reverse proxy is unavailable?
| 3,452,793 | 0 | 0 | 218 | 0 |
python,web-services,reverse-proxy,cherokee
|
You could set a custom 504 error page.
| 0 | 1 | 0 | 0 |
2010-08-10T13:54:00.000
| 1 | 1.2 | true | 3,449,673 | 0 | 0 | 1 | 1 |
I have a Cherokee installation that I'm using to serve a few web applications - one blog/calendar/etc. and two CPU-intensive web applications (1 stable version and 1 development version). All of them are Django or Pylons webservices served with CherryPy. I'm using the reverse-proxy handler in Cherokee to handle the mappings.
Occasionally I have to take the development version down to make changes. Is there a way to set up Cherokee so that it will automatically serve (or redirect to) another page (e.g. indicating an under-construction status) when the reverse-proxy target is unfindable or unresponsive?
I'd prefer an automated solution in Cherokee but if someone knows a simple point-and-click method I'll take that too.
|
Get_by_key_name doesn't work with unicode key names of several characters
| 3,467,698 | 0 | 0 | 351 | 0 |
python,google-app-engine
|
Actually, I made some stupid encoding error when testing yesterday, which made me think the error came from the function.
The problem doesnt come from the keys. It is just an error in my algorithm that won't check for keys of 2 characters if there is no object which the 1st character as keyname.
| 0 | 0 | 0 | 0 |
2010-08-10T18:03:00.000
| 1 | 1.2 | true | 3,451,983 | 0 | 0 | 1 | 1 |
I'm using unicode strings for non latin characters as key names for my models.
I can create objects without problems, and the appengine admin shows key name correctly (I'm using chinese characters, and the right characters)
However, MyModel.get_by_key_name() returns None if the key_name is made of several characters.
For 1 character key name, everything works fine.
Does anyone know about that?
Thanks!
|
What's the difference of ContentType and MimeType
| 3,452,438 | 0 | 115 | 40,506 | 0 |
python,django,content-type,mime-types
|
Why we use 2 different naming for (almost the same) thing?
Backwards compatibility, based on your quote from the documentation.
| 0 | 0 | 0 | 0 |
2010-08-10T18:54:00.000
| 4 | 0 | false | 3,452,381 | 0 | 0 | 1 | 2 |
As far as I know, they are absolute equal. However, browsing some django docs, I've
found this piece of code:
HttpResponse.__init__(content='', mimetype=None, status=200, content_type='text/html')
which surprise me the two getting along each other. The official docs was able to solve the issue in a pratical manner:
content_type is an alias for mimetype.
Historically, this parameter was only
called mimetype, but since this is
actually the value included in the
HTTP Content-Type header, it can also
include the character set encoding,
which makes it more than just a MIME
type specification. If mimetype is
specified (not None), that value is
used. Otherwise, content_type is used.
If neither is given, the
DEFAULT_CONTENT_TYPE setting is used.
However, I don't find it elucidating enough. Why we use 2 different naming for (almost the same) thing? Is "Content-Type" just a name used in browser requests, and with very little use outside it?
What's the main difference between the each one, and when is right to call something mimetype as opposed to content-type ? Am I being pitty and grammar nazi?
|
What's the difference of ContentType and MimeType
| 17,949,292 | 63 | 115 | 40,506 | 0 |
python,django,content-type,mime-types
|
I've always viewed contentType to be a superset of mimeType. The only difference being the optional character set encoding. If the contentType does not include an optional character set encoding then it is identical to a mimeType. Otherwise, the mimeType is the data prior to the character set encoding sequence.
E.G. text/html; charset=UTF-8
text/html is the mimeType
; is the additional parameters indicator
charset=UTF-8 is the character set encoding parameter
E.G. application/msword
application/msword is the mimeType
It cannot have a character set encoding as it describes a well formed octet-stream not comprising characters directly.
| 0 | 0 | 0 | 0 |
2010-08-10T18:54:00.000
| 4 | 1 | false | 3,452,381 | 0 | 0 | 1 | 2 |
As far as I know, they are absolute equal. However, browsing some django docs, I've
found this piece of code:
HttpResponse.__init__(content='', mimetype=None, status=200, content_type='text/html')
which surprise me the two getting along each other. The official docs was able to solve the issue in a pratical manner:
content_type is an alias for mimetype.
Historically, this parameter was only
called mimetype, but since this is
actually the value included in the
HTTP Content-Type header, it can also
include the character set encoding,
which makes it more than just a MIME
type specification. If mimetype is
specified (not None), that value is
used. Otherwise, content_type is used.
If neither is given, the
DEFAULT_CONTENT_TYPE setting is used.
However, I don't find it elucidating enough. Why we use 2 different naming for (almost the same) thing? Is "Content-Type" just a name used in browser requests, and with very little use outside it?
What's the main difference between the each one, and when is right to call something mimetype as opposed to content-type ? Am I being pitty and grammar nazi?
|
What are the use cases of Node.js vs Twisted?
| 3,461,640 | 79 | 65 | 20,135 | 0 |
javascript,python,twisted,node.js
|
Twisted is more mature -- it's been around for a long, long time, and has so many bells and whistles as to make your head spin (implementations of the fanciest protocols, integration of the reactor with a large variety of other event loops, and so forth).
Node.js is said to be faster (I have not measured it myself) and might perhaps be simpler to use (if you need none of the extra bells and whistles) exactly because those extras aren't there (kind of like Tornado in the Python world -- again, I have never measured relative performance).
So, I'd absolutely use Twisted if I needed any of its extra features or wanted to feel on a more solid ground by using a more mature package. If these considerations don't apply, but top performance is a key goal of the project, then I'd write a simple benchmark (but still representative of at least one or two key performance-need situations for my actual project) in Twisted, Node.js, and Tornado, and do a lot of careful measurement before I decide which way to go overall. "Extra features" (third party extensions and standard library) for Python vs server-side Javascript are also much more abundant, and that might be a key factor if any such extras are needed for the project.
Finally, if none of these issues matter to a specific application scenario, have the development team vote on relative simplicity of the three candidates (Twisted, Node.js, Tornado) in terms of simplicity and familiarity -- any of them will probably be just fine, might as well pick whatever most of the team is most comfortable with!
| 0 | 0 | 0 | 0 |
2010-08-11T18:21:00.000
| 2 | 1.2 | true | 3,461,549 | 1 | 0 | 1 | 1 |
Assuming a team of developers are equally comfortable with writing Javascript on the server side as they are with Python & Twisted, when is Node.js going to be more appropriate than Twisted (and vice versa)?
|
In Python, how do I check that a file is a text file?
| 3,463,019 | 0 | 0 | 114 | 0 |
python,django
|
Not all sequences of bytes are valid for ex. UTF-8, maybe you should check this?
| 0 | 0 | 0 | 0 |
2010-08-11T21:21:00.000
| 2 | 0 | false | 3,462,951 | 0 | 0 | 1 | 1 |
The file is uploaded through a Django form. The contents of the file need to be saved into a models.TextField(), for editors to review it before publication.
I am already checking UploadedFile.content_type. I have considered using a regular input field, but as the text is going to be quite long, it would be unwieldy for users to cut and paste.
|
Is there any language which is just "perfect" for web scraping?
| 3,469,962 | 1 | 7 | 2,443 | 0 |
php,python,ruby,web-scraping
|
Short answer is no.
The problem is that HTML is a large family of formats - and only the more recent variants are consistent (and XML based). If you're going to use PHP then I would recommend using the DOM parser as this can handle a lot of html which does not qualify as well-formed XML.
Reading between the lines of your post - you seem to be:
1) capturing content from the web with a requirement for complex interaction management
2) parsing the data into a consistent machine readable format
3) writing the data to a spreadsheet
Which is certainly 3 seperate problems - if no one language meets all 3 requirements then why not use the best tool for the job and just worry about an suitable interim format/medium for the data?
C.
| 0 | 0 | 1 | 0 |
2010-08-12T13:18:00.000
| 4 | 0.049958 | false | 3,468,028 | 0 | 0 | 1 | 1 |
I have used 3 languages for Web Scraping - Ruby, PHP and Python and honestly none of them seems to perfect for the task.
Ruby has an excellent mechanize and XML parsing library but the spreadsheet support is very poor.
PHP has excellent spreadsheet and HTML parsing library but it does not have an equivalent of WWW:Mechanize.
Python has a very poor Mechanize library. I had many problems with it and still unable to solve them. Its spreadsheet library also is more or less decent since it unable to create XLSX files.
Is there anything which is just perfect for webscraping.
PS: I am working on windows platform.
|
How can I benchmark different languages / frameworks?
| 3,468,630 | 2 | 1 | 463 | 0 |
php,asp.net,python,frameworks,benchmarking
|
What I have done is to write many unit tests so you can test the layers.
For example, write a SOAP web service in PHP, Python and C#.
Write a REST web service in the same languages (same web services, just two ways to get to them). This one should be able to return JSON and XML as a minimum.
Write unit tests in C# and Python to serve as clients, and test the REST with the various result types (XML/JSON). This is important as later you may need to test to see which is best end-to-end, and JSON may be faster to parse than XML, for you (it should be).
So, the REST/SOAP services should go to the same controller, to simplify your life.
This controller needs tests, as you may need to later remove it's impact on your tests, but, you can also write tests to see how fast it goes to the database.
I would use one database for this, unless you want to evaluate various databases, but for a web test, just do that for phase 2. :)
So, what you end up with is lots of tests, each test needs to be able to determine how long it took for it to actually run.
You then have lots of numbers, and you can start to analyze to see what works best for you.
For example, I had learned (a couple of years ago when I did this) that JSON was faster than XML, REST was faster than SOAP.
You may find that some things are much harder to do in some languages and so drop them from contention as you go through this process.
Writing the tests is the easy part, getting meaningful answers from the numbers will be the harder part, as your biases may color your analysis, so be careful of that.
I would do this with some real application so that the work isn't wasted, just duplicated.
| 0 | 0 | 0 | 1 |
2010-08-12T13:37:00.000
| 4 | 1.2 | true | 3,468,227 | 0 | 0 | 1 | 2 |
I'd like to compare the performance of different languages and/or different frameworks within the same language. This is aimed at server-side languages used for web development. I know an apples to apples comparison is not possible, but I'd like it to be as unbiased as possible. Here are some ideas :
Simple "Hello World" page
Object initialization
Function/method calls
Method bodies will range from empty to large
File access (read and write)
Database access
They can either be measured by Requests per second or I can use a for loop and loop many times. Some of these benchmarks should measure the overhead the language has (ie: empty function call) rather than how fast they perform a certain task. I'll take some precautions:
They'll run on the same machine, on fresh installations with as few processes on the background as possible.
I'll try and set up the server as officially recommended; I will not attempt any optimizations.
How can I improve on this?
|
How can I benchmark different languages / frameworks?
| 3,468,464 | 0 | 1 | 463 | 0 |
php,asp.net,python,frameworks,benchmarking
|
You will spend a lot of time and come to realization that it was all wasted.
After you complete your tests you will learn that loops of 1000000 empty iterations are far from the real life and come to apache benchmark.
Then you come no know of opcode cachers which will ruin all your previous results.
Then you will learn that single DB query will take 1000 times longer time than API call, so, your comparisons of database access methods are really waste.
Then you will learn of memcache which will allow you just jump over some terrible bottlenecks you've discovered already, etc etc etc
| 0 | 0 | 0 | 1 |
2010-08-12T13:37:00.000
| 4 | 0 | false | 3,468,227 | 0 | 0 | 1 | 2 |
I'd like to compare the performance of different languages and/or different frameworks within the same language. This is aimed at server-side languages used for web development. I know an apples to apples comparison is not possible, but I'd like it to be as unbiased as possible. Here are some ideas :
Simple "Hello World" page
Object initialization
Function/method calls
Method bodies will range from empty to large
File access (read and write)
Database access
They can either be measured by Requests per second or I can use a for loop and loop many times. Some of these benchmarks should measure the overhead the language has (ie: empty function call) rather than how fast they perform a certain task. I'll take some precautions:
They'll run on the same machine, on fresh installations with as few processes on the background as possible.
I'll try and set up the server as officially recommended; I will not attempt any optimizations.
How can I improve on this?
|
Python doesn't have opcode cacher?
| 3,468,276 | 9 | 2 | 2,395 | 0 |
python,opcode,opcode-cache
|
It's automatic in Python -- a compiled .pyc file will appear magically.
| 0 | 0 | 0 | 1 |
2010-08-12T13:40:00.000
| 3 | 1 | false | 3,468,243 | 0 | 0 | 1 | 2 |
I'm currently using PHP. I plan to start using Django for some of my next project.
But I don't have any experience with Python. After some searching, I still can't find a Python opcode cacher.
(There are lots of opcode cacher for PHP: APC, eAccelerator, Xcache, ...)
|
Python doesn't have opcode cacher?
| 3,468,296 | 2 | 2 | 2,395 | 0 |
python,opcode,opcode-cache
|
Python doesn't need one the same way PHP needs it. Python doesn't throw the bytecode away after execution, it keeps it around (as .pyc files).
| 0 | 0 | 0 | 1 |
2010-08-12T13:40:00.000
| 3 | 0.132549 | false | 3,468,243 | 0 | 0 | 1 | 2 |
I'm currently using PHP. I plan to start using Django for some of my next project.
But I don't have any experience with Python. After some searching, I still can't find a Python opcode cacher.
(There are lots of opcode cacher for PHP: APC, eAccelerator, Xcache, ...)
|
virtualenv, sys.path and site-packages
| 3,470,317 | 1 | 4 | 1,443 | 0 |
python,django,virtualenv,pip
|
it seems that the pip process quit prematurely due to a package in requirements that could not be found. this left things in limbo, stuck in the temp-like "build" folder before having a chance to complete the process which gets them into the proper "site-packages" location.
| 0 | 0 | 0 | 0 |
2010-08-12T15:52:00.000
| 1 | 1.2 | true | 3,469,551 | 1 | 0 | 1 | 1 |
i am setting up a virtualenv for django deployment. i want an isolated env without access to the global site-packages. i used the option --no-site-packages, then installed a local pip instance for that env.
after using pip and a requirements.txt file i noticed that most packages were installed in a "build" folder that is not in sys.path so i am getting an error such as
"no module named django.conf"
i also installed virtualenvwrapper after the base virtualenv package.
as far i as i can recall i have not seen a "build" folder before, and am curious why these packages weren't simply installed in my local env's site-packages folder. how should i go about pointing to that build folder and why does it exist?
thanks
|
What's the easiest/cleanest way to get the MessageID of a sent email?
| 3,471,052 | 12 | 7 | 2,548 | 0 |
python,django,email-headers
|
Ok, I see I was browsing tragically old code. I should be able to call django.core.mail.message.make_msgid() and populate the header myself before calling send.
| 0 | 0 | 0 | 1 |
2010-08-12T18:54:00.000
| 2 | 1.2 | true | 3,470,989 | 0 | 0 | 1 | 1 |
I want to save the MessageID of a sent email, so I can later use it in a References: header to facilitate threading.
I see in root/django/trunk/django/core/mail.py (line ~55) where the MessageID is created.
I'm trying to think of the best way to collect this value, other than just copy/pasting into a new backend module and returning it. Maybe that is the best way?
|
About pyjamas maturity vs GWT maturity (with short dead lines) for a web application
| 4,886,045 | 4 | 6 | 1,811 | 0 |
java,python,gwt,pyjamas
|
I've managed to deploy a couple of medium sized webapps using pyjamas and believe me, it was very smooth sailing. It's a slimmed-down version of GWT too so it is easier to learn. Most of the UI widgets are 100 lines ish! Also the pythonic use of OO is pretty exemplary.
| 0 | 0 | 0 | 0 |
2010-08-12T22:23:00.000
| 2 | 0.379949 | false | 3,472,493 | 0 | 0 | 1 | 2 |
I love both, python and Java and I have this first 'serious' web application project that I would like to carry out.
I find it hard to choose between pyjamas + django and GWT + Hibernate.
In fact, from my beginner point of view, it seems like the python world is more suitable for a quickly-developed and fun web application.
And, on the other hand, the java world is useful for performance-oriented, scalable solutions and for 'serious' projects with big money involved...
My requirements are quite simple: this application has to replace a desktop application. So, the performance factor is there. But my deadlines are pretty short.
Is pyjamas mature enough to replace GWT on a performance and functionality point of view?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.