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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Writing a Faster Python Spider
| 1,853,689 | 3 | 6 | 7,091 | 0 |
python,web-crawler
|
Spidering somebody's site with millions of requests isn't very polite. Can you instead ask the webmaster for an archive of the site? Once you have that, it's a simple matter of text searching.
| 0 | 0 | 1 | 0 |
2009-12-05T22:28:00.000
| 6 | 0.099668 | false | 1,853,673 | 0 | 0 | 1 | 3 |
I'm writing a spider in Python to crawl a site. Trouble is, I need to examine about 2.5 million pages, so I could really use some help making it optimized for speed.
What I need to do is examine the pages for a certain number, and if it is found to record the link to the page. The spider is very simple, it just needs to sort through a lot of pages.
I'm completely new to Python, but have used Java and C++ before. I have yet to start coding it, so any recommendations on libraries or frameworks to include would be great. Any optimization tips are also greatly appreciated.
|
Google App Engine Application Extremely slow
| 2,908,765 | 3 | 17 | 8,372 | 0 |
python,django,google-app-engine
|
I used pingdom for obvious reasons - no cold starts is a bonus. Of course the customers will soon come flocking and it will be a non-issue
| 0 | 1 | 0 | 0 |
2009-12-06T08:58:00.000
| 8 | 0.07486 | false | 1,854,821 | 0 | 0 | 1 | 5 |
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch.
Even though it is just a very simple web page, it takes long time and often it times out.
Any suggestions to solve this?
Note: It is responding fast after the first call.
|
Google App Engine Application Extremely slow
| 1,856,432 | 3 | 17 | 8,372 | 0 |
python,django,google-app-engine
|
I encounteres the same with pylons based app. I have the initial page server as static, and have a dummy ajax call in it to bring the app up, before the user types in credentials. It is usually enough to avoid a lengthy response... Just an idea that you might use before you actually have a million users ;).
| 0 | 1 | 0 | 0 |
2009-12-06T08:58:00.000
| 8 | 0.07486 | false | 1,854,821 | 0 | 0 | 1 | 5 |
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch.
Even though it is just a very simple web page, it takes long time and often it times out.
Any suggestions to solve this?
Note: It is responding fast after the first call.
|
Google App Engine Application Extremely slow
| 1,854,829 | 4 | 17 | 8,372 | 0 |
python,django,google-app-engine
|
If it's responding quickly after the first request, it's probably just a case of getting the relevant process up and running. Admittedly it's slightly surprising that it takes so long that it times out. Is this after you've updated the application and verified that the AppEngine dashboard shows it as being ready?
"First hit slowness" is quite common in many web frameworks. It's a bit of a pain during development, but not a problem for production.
| 0 | 1 | 0 | 0 |
2009-12-06T08:58:00.000
| 8 | 0.099668 | false | 1,854,821 | 0 | 0 | 1 | 5 |
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch.
Even though it is just a very simple web page, it takes long time and often it times out.
Any suggestions to solve this?
Note: It is responding fast after the first call.
|
Google App Engine Application Extremely slow
| 1,854,875 | 14 | 17 | 8,372 | 0 |
python,django,google-app-engine
|
This is a horrible suggestion but I'll make it anyway:
Build a little client application or just use wget with cron to periodically access your app, maybe once every 5 minutes or so. That should keep Google from putting it into a dormant state.
I say this is a horrible suggestion because it's a waste of resources and an abuse of Google's free service. I'd expect you to do this only during a short testing/startup phase.
| 0 | 1 | 0 | 0 |
2009-12-06T08:58:00.000
| 8 | 1.2 | true | 1,854,821 | 0 | 0 | 1 | 5 |
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch.
Even though it is just a very simple web page, it takes long time and often it times out.
Any suggestions to solve this?
Note: It is responding fast after the first call.
|
Google App Engine Application Extremely slow
| 1,856,888 | 4 | 17 | 8,372 | 0 |
python,django,google-app-engine
|
One more tip which might increase the response time.
Enabling billing does increase the quotas, and, to my personal experience, increase the overall response of an application as well. Probably because of the higher priority for billing-enabled applications google has. For instance, an app with billing disabled, can send up to 5-10 emails/request, an app with billing enabled easily copes with 200 emails/request.
Just be sure to set low billing levels - you never know when Slashdot, Digg or HackerNews notices your site :)
| 0 | 1 | 0 | 0 |
2009-12-06T08:58:00.000
| 8 | 0.099668 | false | 1,854,821 | 0 | 0 | 1 | 5 |
I created a Hello World website in Google App Engine. It is using Django 1.1 without any patch.
Even though it is just a very simple web page, it takes long time and often it times out.
Any suggestions to solve this?
Note: It is responding fast after the first call.
|
How can a total, complete beginner read source code?
| 2,628,550 | 0 | 2 | 1,248 | 0 |
python,coding-style,code-readability
|
Maybe you have a project in mind that you want to code up? It's very hard to read what other people write, the best way to learn is to try something. Other people will have gone through the problems you will come across, and so why code is written the way it is may start to make sense. This is an excellent site to post questions, no matter how stupid you consider them.
| 0 | 0 | 1 | 0 |
2009-12-06T09:04:00.000
| 9 | 0 | false | 1,854,827 | 0 | 0 | 1 | 5 |
I am a complete, total beginner in programming, although I do have knowledge of CSS and HTML.
I would like to learn Python. I downloaded lots of source code but the amount of files and the complexity really confuses me. I don't know where to begin. Is there a particular order I should look for?
Thanks.
EDIT: Sorry guys, I forgot to mention that I already have both the online tutorial and a couple of books handy. I basically I don't quite understand how to "dismantle" and understand complex source code, in order to grasp programming techniques and concepts.
EDIT2: Thanks for the extremely quick comments, guys. I really appreciate it. This website is awesome.
|
How can a total, complete beginner read source code?
| 1,854,832 | 6 | 2 | 1,248 | 0 |
python,coding-style,code-readability
|
I would recommend you understand the basics. What are methods, classes, variables and so on. It would be important to understand the constructs you are seeing. If you don't understand those then it's just going to be a bunch of characters.
| 0 | 0 | 1 | 0 |
2009-12-06T09:04:00.000
| 9 | 1 | false | 1,854,827 | 0 | 0 | 1 | 5 |
I am a complete, total beginner in programming, although I do have knowledge of CSS and HTML.
I would like to learn Python. I downloaded lots of source code but the amount of files and the complexity really confuses me. I don't know where to begin. Is there a particular order I should look for?
Thanks.
EDIT: Sorry guys, I forgot to mention that I already have both the online tutorial and a couple of books handy. I basically I don't quite understand how to "dismantle" and understand complex source code, in order to grasp programming techniques and concepts.
EDIT2: Thanks for the extremely quick comments, guys. I really appreciate it. This website is awesome.
|
How can a total, complete beginner read source code?
| 1,973,070 | 3 | 2 | 1,248 | 0 |
python,coding-style,code-readability
|
Donald Knuth suggests:
"It [is] basically the way you solve some kind of unknown puzzle -- make tables and charts and get a little more information here and make a hypothesis."
(From "Coders at Work", Chapter 15)
In my opinion, the easiest way to understand a program is to study the data structures first. Write them down, memorize them. Only then, think about how they move through program-time.
As an aside, it is sort of a shame how few books there are on code reading. "Coders at Work" is probably the best so far. Ironically, "Reading Code" is one of the worst so far.
| 0 | 0 | 1 | 0 |
2009-12-06T09:04:00.000
| 9 | 0.066568 | false | 1,854,827 | 0 | 0 | 1 | 5 |
I am a complete, total beginner in programming, although I do have knowledge of CSS and HTML.
I would like to learn Python. I downloaded lots of source code but the amount of files and the complexity really confuses me. I don't know where to begin. Is there a particular order I should look for?
Thanks.
EDIT: Sorry guys, I forgot to mention that I already have both the online tutorial and a couple of books handy. I basically I don't quite understand how to "dismantle" and understand complex source code, in order to grasp programming techniques and concepts.
EDIT2: Thanks for the extremely quick comments, guys. I really appreciate it. This website is awesome.
|
How can a total, complete beginner read source code?
| 1,854,841 | 3 | 2 | 1,248 | 0 |
python,coding-style,code-readability
|
There is no magic way to learn anything without reading and writing code yourself. If you get stuck there are always folks in SO who will help you.
| 0 | 0 | 1 | 0 |
2009-12-06T09:04:00.000
| 9 | 0.066568 | false | 1,854,827 | 0 | 0 | 1 | 5 |
I am a complete, total beginner in programming, although I do have knowledge of CSS and HTML.
I would like to learn Python. I downloaded lots of source code but the amount of files and the complexity really confuses me. I don't know where to begin. Is there a particular order I should look for?
Thanks.
EDIT: Sorry guys, I forgot to mention that I already have both the online tutorial and a couple of books handy. I basically I don't quite understand how to "dismantle" and understand complex source code, in order to grasp programming techniques and concepts.
EDIT2: Thanks for the extremely quick comments, guys. I really appreciate it. This website is awesome.
|
How can a total, complete beginner read source code?
| 1,854,836 | 3 | 2 | 1,248 | 0 |
python,coding-style,code-readability
|
To understand source code in any language, you first need to learn the language. It's as simple as that!
Usually, reading source code (as a sole activity) will hurt your head without giving much benefit in terms of learning the underlying language. You need a structured tour through carefully chosen small source code examples, such as a book or tutorial will give you.
Check Amazon out for books and Google for tutorials, try a few. The links offered by some of the other answers would also be a great starting point.
| 0 | 0 | 1 | 0 |
2009-12-06T09:04:00.000
| 9 | 0.066568 | false | 1,854,827 | 0 | 0 | 1 | 5 |
I am a complete, total beginner in programming, although I do have knowledge of CSS and HTML.
I would like to learn Python. I downloaded lots of source code but the amount of files and the complexity really confuses me. I don't know where to begin. Is there a particular order I should look for?
Thanks.
EDIT: Sorry guys, I forgot to mention that I already have both the online tutorial and a couple of books handy. I basically I don't quite understand how to "dismantle" and understand complex source code, in order to grasp programming techniques and concepts.
EDIT2: Thanks for the extremely quick comments, guys. I really appreciate it. This website is awesome.
|
Dynamically Refreshed Pages produced by Python
| 1,855,787 | 0 | 2 | 1,212 | 0 |
javascript,python,ajax
|
Update img.src attribute in onsubmit() handler.
img.src url points to your Python script that should generate an image in response.
onsubmit() for your form could be registered and written using JQuery.
| 0 | 0 | 0 | 1 |
2009-12-06T15:59:00.000
| 4 | 0 | false | 1,855,748 | 0 | 0 | 1 | 1 |
I've been researching this on and off for a number of months now, but I am incapable of finding clear direction.
My goal is to have a page which has a form on it and a graph on it. The form can be filled out and then sent to the CGI Python script (yeah, I'll move to WSGI or fast_cgi later, I'm starting simple!) I'd like the form to be able to send multiple times, so the user can update the graph, but I don't want the page to reload every time it doe that. I have a form and a graph now, but they're on separate pages and work as a conventional script.
I'd like to avoid ALL frameworks except JQuery (as I love it, don't like dealing with the quirks of different browsers, etc).
A nudge in the right direction(s) is all I'm asking for here, or be as specific as you care to.
(I've found similar guides to doing this in PHP, I believe, but for some reason, they didn't serve my purpose.)
EDIT: The graph is generated using Flot (a JQuery plugin) using points generated from the form input and processed in the Python script. The Python script prints the Javascript which produces the graph in the end. It could all be done in Javascript, but I want the heavier stuff to be handled server-side, hence the Python.
Thanks!
|
Using AppEngine XMPP for Client Notifications
| 1,859,664 | 0 | 1 | 1,077 | 0 |
python,web-services,google-app-engine,xmpp
|
In that situation, I would perform ajax calls every 5 minutes in example to check it.
It's easy to implement and the data exchanged can be reduced to the max (taking advantage of "fast query/response" bonifications of google-app).
Regards.
| 0 | 1 | 0 | 0 |
2009-12-07T12:12:00.000
| 3 | 0 | false | 1,859,634 | 0 | 0 | 1 | 2 |
I've been looking for a way to tell clients about expired objects and AppEngine's XMPP implementation seems really interesting because it's scalable, should be reliable and can contain up to 100kb of data.
But as I understand it, before a client can listen to messages, he should have a gmail account. That's very impractical.
Is there maybe a way to make temporary readonly XMPP accounts to use with this?
|
Using AppEngine XMPP for Client Notifications
| 1,859,647 | 1 | 1 | 1,077 | 0 |
python,web-services,google-app-engine,xmpp
|
No this isn't true: you can have the AppEngine robot as contact over any Jabber/XMPP based networks.
Unless you are talking about the need for a GMAIL account to create an AppEngine robot... in which case YES you need to have a Google account.
| 0 | 1 | 0 | 0 |
2009-12-07T12:12:00.000
| 3 | 1.2 | true | 1,859,634 | 0 | 0 | 1 | 2 |
I've been looking for a way to tell clients about expired objects and AppEngine's XMPP implementation seems really interesting because it's scalable, should be reliable and can contain up to 100kb of data.
But as I understand it, before a client can listen to messages, he should have a gmail account. That's very impractical.
Is there maybe a way to make temporary readonly XMPP accounts to use with this?
|
Writing my own django-cms plugin. Any recommendations?
| 1,872,391 | 1 | 1 | 1,710 | 0 |
python,django,django-cms
|
This all depends on your model. Plugins use standard django admin features.
This also depends on the source data for the table.
If you have a CSV or Exel sheet as source i only would make a file field and render the file in the render function with some optional caching.
If you want to enter data by hand:
A Table model.
An Row model with a foreign key to table.
The row model can then be used as a django-admin Inline. So you can add new rows as needed.
Be aware that CMSPluginBase extends ModelAdmin so you can define inlines like you would do in normal admin.
| 0 | 0 | 0 | 0 |
2009-12-07T16:52:00.000
| 1 | 1.2 | true | 1,861,267 | 0 | 0 | 1 | 1 |
I don't see any possibility for creating a table in django-cms. I need this functionnality so I am evaluating the possibility to write my own plugin.
I am getting started with this product. I've read the documentation carefully and I see more or less how to do that.
However, I would be happy to hear some tips and tricks before starting this task. Does anybody have experience with django-cms plugin?
Thanks in advance
|
Render in infinity loop
| 1,870,164 | 0 | 1 | 283 | 0 |
python,google-app-engine,cron
|
Can you use cron to schedule the job to run at certain intervals? It's usually considered better than infinite loops, and was designed to help solve this sort of problem.
| 0 | 0 | 0 | 0 |
2009-12-08T21:59:00.000
| 4 | 0 | false | 1,870,140 | 1 | 0 | 1 | 1 |
Question for Python 2.6
I would like to create an simple web application which in specified time interval will run a script that modifies the data (in database). My problem is code for infinity loop or some other method to achieve this goal. The script should be run only once by the user. Next iterations should run automatically, even when the user leaves the application. If someone have idea for method detecting apps breaks it would be great to show it too. I think that threads can be the best way to achive that. Unfortunately, I just started my adventure with Python and don't know yet how to use them.
The application will have also views showing database and for control of loop script.
Any ideas?
|
How to allow users to change their own passwords in Django?
| 40,871,533 | 1 | 93 | 92,604 | 0 |
python,django
|
Once the url pattern is added as shown in Ciro Santilli's answer, a quick way to allow users to change passwords is to give them "staff access" for the admin functions. If you don't add them to any groups or give them special permissions, they can still change their password by going to the example.com/admin page. The staff access lets them go to the page even if it is blank; in the upper right corner they can click "change password" and use the admin funtionality.
| 0 | 0 | 0 | 0 |
2009-12-09T13:15:00.000
| 10 | 0.019997 | false | 1,873,806 | 0 | 0 | 1 | 2 |
Can any one point me to code where users can change their own passwords in Django?
|
How to allow users to change their own passwords in Django?
| 1,873,933 | 26 | 93 | 92,604 | 0 |
python,django
|
You can also just use the django.contrib.auth.views.password_change view in your URLconf. It uses a default form and template; supplying your own is optional.
| 0 | 0 | 0 | 0 |
2009-12-09T13:15:00.000
| 10 | 1 | false | 1,873,806 | 0 | 0 | 1 | 2 |
Can any one point me to code where users can change their own passwords in Django?
|
Loading a wave from waveid
| 1,932,852 | 0 | 1 | 95 | 0 |
python,google-wave
|
At the moment the answer is that i can't be done. Hopefully in a future version of the Api.
| 0 | 0 | 1 | 0 |
2009-12-09T21:11:00.000
| 2 | 0 | false | 1,876,908 | 0 | 0 | 1 | 1 |
I'm working on a small wave thingy where i need to load a wave based on an outside event. So i don't have a context to work with.
I've been looking at the python api for a while but i can't figure out the correct way to get a wave object (that i can then call CreateBlip() on) when i just have the waveid.
Is there something i've just overlooked? or do I have to make a 'raw' json request instead of using the api ?
|
A business Case for Enterprise Python
| 1,879,157 | 4 | 9 | 2,483 | 0 |
python,enterprise
|
The larger your investment in an existing technology is, the more expensive it is to move away from it. COBOL is perhaps the best example here.
That investment isn't just in porting existing solutions, but also in retraining or hiring new staff so that you have the skill sets to build and support the new technologies even while still maintaining your legacy solutions.
Add to that the fact that for most large Multinational Corporations, software isn't their core business. As long as it functions effectively and fulfills the business need, they don't tend to care so much about the 'details'.
You need to be able to offer some pretty compelling benefits to overcome this kind of inertia.
Sad but true.
| 0 | 1 | 0 | 0 |
2009-12-10T06:52:00.000
| 5 | 0.158649 | false | 1,879,113 | 0 | 0 | 1 | 3 |
This will not be a "programming" question but more technology / platform related question. I'm trying to figure out whether Python can be a suitable Java alternative for enterprise / web applications.
Which are the ideal cases where you would prefer to use Python instead of Java? How would a typical Python web application (databases/sessions/concurrency) perform as compared to a typical Java application? How do specific Python frameworks square up against Java based frameworks (Spring, SEAM, Grails etc.)?
For businesses, switching from the Java infrastructure to a Python infrastructure .. is it too hard/expensive/resource intensive/not viable? Also shed some light on the business case for providing a Python + Google AppEngine based solution to the end customer. Will it be cost effective in an typical scenario?
Sorry if I am asking too wide a question, I would have liked to keep it specific, but I need your help to evaluate Python as a whole from the perspectives of the programmers, service providing company and end business customer.
For an SME, a Python/GoogleAppEngine based technology stack is a clear scalable and affordable platform. But what about a large MNC that already has a lot invested in Java.
Thank you so much. I am researching this myself and will gladly share my conclusions here!
Thank you,
Srirangan
|
A business Case for Enterprise Python
| 1,880,411 | 0 | 9 | 2,483 | 0 |
python,enterprise
|
There is -- almost -- no usable "Business Case" for any technology choice.
"what about a large MNC that already has a lot invested in Java" Ask around. See if there's a business case for Java.
I doubt you'll find anything. Most companies drift into technology choices slowly.
There was no business case for COBOL -- it was the only game in town in the olden days.
There is rarely a business case for Java. What usually happens is that some visionary individual started building the first web site (probably in Perl). The "web thing" gained traction, and some vision individual started building web sites in Java. Eventually, the success of those small teams indicated to others that Java had advantages over COBOL.
Managers say the words "make a business case", but watch what they actually do. They listen to (1) their peers, (2) successful people.
To make the "business case" for Python, you have to be that visionary individual.
1) Use Python.
2) Be successful.
3) Share your successes.
4) Be prepared to explain that your success is due to your tools, not your personal level of genius and charisma.
| 0 | 1 | 0 | 0 |
2009-12-10T06:52:00.000
| 5 | 0 | false | 1,879,113 | 0 | 0 | 1 | 3 |
This will not be a "programming" question but more technology / platform related question. I'm trying to figure out whether Python can be a suitable Java alternative for enterprise / web applications.
Which are the ideal cases where you would prefer to use Python instead of Java? How would a typical Python web application (databases/sessions/concurrency) perform as compared to a typical Java application? How do specific Python frameworks square up against Java based frameworks (Spring, SEAM, Grails etc.)?
For businesses, switching from the Java infrastructure to a Python infrastructure .. is it too hard/expensive/resource intensive/not viable? Also shed some light on the business case for providing a Python + Google AppEngine based solution to the end customer. Will it be cost effective in an typical scenario?
Sorry if I am asking too wide a question, I would have liked to keep it specific, but I need your help to evaluate Python as a whole from the perspectives of the programmers, service providing company and end business customer.
For an SME, a Python/GoogleAppEngine based technology stack is a clear scalable and affordable platform. But what about a large MNC that already has a lot invested in Java.
Thank you so much. I am researching this myself and will gladly share my conclusions here!
Thank you,
Srirangan
|
A business Case for Enterprise Python
| 2,506,203 | 1 | 9 | 2,483 | 0 |
python,enterprise
|
The answer to your question is yes. Python can be well suited for Enterprise because python is a language which has raw power, flexible and can be glued with other programming languages. What enterprise really requires is a language which does everything and i feel python is already enterprise ready. If you want examples then i believe there can be no bigger example than google. Google is running python internally and externally for its business critical applications. The only problem with python is that it is not very well recognized by top MNC company and we as a python programmer find hard time convincing the management team. I guess you will face the same issue. But i guarantee you once you get your feet wet in python, you will understand its true power
| 0 | 1 | 0 | 0 |
2009-12-10T06:52:00.000
| 5 | 0.039979 | false | 1,879,113 | 0 | 0 | 1 | 3 |
This will not be a "programming" question but more technology / platform related question. I'm trying to figure out whether Python can be a suitable Java alternative for enterprise / web applications.
Which are the ideal cases where you would prefer to use Python instead of Java? How would a typical Python web application (databases/sessions/concurrency) perform as compared to a typical Java application? How do specific Python frameworks square up against Java based frameworks (Spring, SEAM, Grails etc.)?
For businesses, switching from the Java infrastructure to a Python infrastructure .. is it too hard/expensive/resource intensive/not viable? Also shed some light on the business case for providing a Python + Google AppEngine based solution to the end customer. Will it be cost effective in an typical scenario?
Sorry if I am asking too wide a question, I would have liked to keep it specific, but I need your help to evaluate Python as a whole from the perspectives of the programmers, service providing company and end business customer.
For an SME, a Python/GoogleAppEngine based technology stack is a clear scalable and affordable platform. But what about a large MNC that already has a lot invested in Java.
Thank you so much. I am researching this myself and will gladly share my conclusions here!
Thank you,
Srirangan
|
DJANGO : Update div with AJAX
| 1,879,991 | 2 | 8 | 5,349 | 0 |
jquery,python,ajax,django,django-templates
|
Since you're already using an AJAX post, why don't you return the data from that and insert it into the div? The view that accepts the post can return a rendered template or JSON, and your javascript can insert it in the callback.
| 0 | 0 | 0 | 0 |
2009-12-10T09:42:00.000
| 3 | 0.132549 | false | 1,879,872 | 0 | 0 | 1 | 1 |
I am building a chat application. So far I am adding chat messages with jquery $.post() and this works fine.
Now I need to retrieve the latest chat message from the table and append the list on the chat page.
I am new to Django, so please go slow.
So how do I get data from the chat table back to the chat page?
Thanks in advance!
|
Importing Excel sheets, including formulae, into Django
| 1,937,261 | 0 | 2 | 1,592 | 1 |
python,django,excel
|
You need to use Excel to calculate the results? I mean, maybe you could run the Excel sheet from OpenOffice and use a pyUNO macro, which is somehow "native" python.
A different approach will be to create a macro to generate some more friendly code to python, if you want Excel to perform the calculation is easy you end up with a very slow process.
| 0 | 0 | 0 | 0 |
2009-12-10T18:39:00.000
| 4 | 0 | false | 1,883,098 | 0 | 0 | 1 | 1 |
I have an Excel spreadsheet with calculations I would like to use in a Django web application. I do not need to present the spreadsheet as it appears in Excel. I only want to use the formulae embedded in it. What is the best way to do this?
|
Where should django manager code live?
| 1,883,526 | 9 | 25 | 4,377 | 0 |
python,django,design-patterns,django-models,django-managers
|
I always place mine in managers.py. If you have a circular import issue remember that a) You can reference the model class for a manager at self.model, and b) You can do imports inside of functions.
| 0 | 0 | 0 | 0 |
2009-12-10T19:21:00.000
| 4 | 1 | false | 1,883,322 | 0 | 0 | 1 | 3 |
This is a pretty simple django patterns question. My manager code usually lives in models.py, but what happens when models.py is really huge? Is there any other alternative pattern to letting your manager code live in models.py for maintainability and to avoid circular imports?
A question may be asked as to why models.py is so huge, but let's just assume it's size and breadth of utility is justified.
|
Where should django manager code live?
| 1,883,460 | 32 | 25 | 4,377 | 0 |
python,django,design-patterns,django-models,django-managers
|
I prefer to keep my models in models.py and managers in managers.py (forms in forms.py) all within the same app. For more generic managers, I prefer to keep them in core.managers if they can be re-used for other apps. In some of our larger apps with models/modelname.py that will contains a manager and the model code which doesn't seem bad.
| 0 | 0 | 0 | 0 |
2009-12-10T19:21:00.000
| 4 | 1.2 | true | 1,883,322 | 0 | 0 | 1 | 3 |
This is a pretty simple django patterns question. My manager code usually lives in models.py, but what happens when models.py is really huge? Is there any other alternative pattern to letting your manager code live in models.py for maintainability and to avoid circular imports?
A question may be asked as to why models.py is so huge, but let's just assume it's size and breadth of utility is justified.
|
Where should django manager code live?
| 1,883,342 | 4 | 25 | 4,377 | 0 |
python,django,design-patterns,django-models,django-managers
|
What I did when building Django apps was to create a [modelname].py file with just the specific model code, manager code and sometimes form code and used an __init__.py file to import then all in the models directory. This helped me atleast in keeping it managable.
| 0 | 0 | 0 | 0 |
2009-12-10T19:21:00.000
| 4 | 0.197375 | false | 1,883,322 | 0 | 0 | 1 | 3 |
This is a pretty simple django patterns question. My manager code usually lives in models.py, but what happens when models.py is really huge? Is there any other alternative pattern to letting your manager code live in models.py for maintainability and to avoid circular imports?
A question may be asked as to why models.py is so huge, but let's just assume it's size and breadth of utility is justified.
|
Django: vps or shared hosting?
| 1,885,629 | 6 | 12 | 5,421 | 0 |
python,django,hosting,shared,vps
|
Django runs on GoogleAppEngine but php doesn't.
Your Django code will have to use Google's datastore models instead of Django's usual ORM, so there is some tie in to GAE - if you decide you want to host your own app later on it could be quite a lot of work.
If you go with a VPS obviously you can run Django and php together, but you'll need to choose a webserve, maybe a firewall, maybe load balancing later on.
Clicks per day isn't really useful, you need to know how many clicks per second you get at peak time.
Cheap hosting providers will provide less help than expensive ones.
Is one VPS going to be enough? What is the impact if it goes down? It's harder to do major upgrades if you only have one server.
With a VPS you need to back your data up somewhere. The hosting may do offsite backups for you, but it's a good idea to have some yourself too.
I don't know how easy it is to backup your data from GAE, but it's probably a good idea if the data is valuable.
| 0 | 0 | 0 | 0 |
2009-12-11T03:19:00.000
| 6 | 1 | false | 1,885,594 | 0 | 0 | 1 | 3 |
I am new to web development and everything involved with it. Im finishing my website in django and i will soon have to find a hosting and deploy it. I heard there are vps or shared hosting types. So here are the questions:
1. How many visits/clicks per day make it worth choosing vps? shared?
2. How hard is it to tune and maintain a vps on your own if you're new to everything!
3. If i ask hosting providers to help me deploy my site - will they help? (shared, vps)
4. Is vps with 256mb memory much faster than shared hosting?
5. If i want to host many sites on one hosting - is vps more suitable for that?
6. Can i host php, django and other stuff on one hosting simultaniously?
7. Should i know something else to make a decision?
|
Django: vps or shared hosting?
| 1,885,597 | 3 | 12 | 5,421 | 0 |
python,django,hosting,shared,vps
|
Should i know something else to make a decision?
Django (albeit a subset) runs on Google AppEngine:
free for starters and pay as you grow.
auto-scale
resilient (backups are "automatic" i.e. datastore)
The drawback of course is you only have Python and Java as options...
| 0 | 0 | 0 | 0 |
2009-12-11T03:19:00.000
| 6 | 0.099668 | false | 1,885,594 | 0 | 0 | 1 | 3 |
I am new to web development and everything involved with it. Im finishing my website in django and i will soon have to find a hosting and deploy it. I heard there are vps or shared hosting types. So here are the questions:
1. How many visits/clicks per day make it worth choosing vps? shared?
2. How hard is it to tune and maintain a vps on your own if you're new to everything!
3. If i ask hosting providers to help me deploy my site - will they help? (shared, vps)
4. Is vps with 256mb memory much faster than shared hosting?
5. If i want to host many sites on one hosting - is vps more suitable for that?
6. Can i host php, django and other stuff on one hosting simultaniously?
7. Should i know something else to make a decision?
|
Django: vps or shared hosting?
| 1,886,390 | 7 | 12 | 5,421 | 0 |
python,django,hosting,shared,vps
|
I've been using Webfaction for shared hosting of Django. The price is pretty decent, they have good forums, and have a nice web-based interface to help get you setup. Despite the web interface, it doesn't impede you from having full control over your site form the command line. You can host all sorts of things, from Django to Rails, to PHP, and mysql. For smaller sites, it works nicely. I'm not sure how the performance works under high load, but you can always start small and upgrade to a vps. I've never had direct contact with the support personel there, but the documentation seems good. I don't mean for this to sound like a plug, but it's been pretty good for shared hosting. If you have any questions about it, I'll be glad to answer.
| 0 | 0 | 0 | 0 |
2009-12-11T03:19:00.000
| 6 | 1.2 | true | 1,885,594 | 0 | 0 | 1 | 3 |
I am new to web development and everything involved with it. Im finishing my website in django and i will soon have to find a hosting and deploy it. I heard there are vps or shared hosting types. So here are the questions:
1. How many visits/clicks per day make it worth choosing vps? shared?
2. How hard is it to tune and maintain a vps on your own if you're new to everything!
3. If i ask hosting providers to help me deploy my site - will they help? (shared, vps)
4. Is vps with 256mb memory much faster than shared hosting?
5. If i want to host many sites on one hosting - is vps more suitable for that?
6. Can i host php, django and other stuff on one hosting simultaniously?
7. Should i know something else to make a decision?
|
Is Google App Engine right for me?
| 1,903,297 | 3 | 9 | 1,390 | 0 |
python,google-app-engine,web2py
|
The AppEngine uses BigTable as it's datastore backend. Don't try to write a traditional relational-database driven application. BigTable is much more well suited for use as a highly-scalable key-value store. Avoid joins if at all possible.
| 0 | 1 | 0 | 0 |
2009-12-14T19:51:00.000
| 7 | 0.085505 | false | 1,903,065 | 0 | 0 | 1 | 6 |
I am thinking about using Google App Engine.It is going to be a huge website. In that case, what is your piece of advice using Google App Engine. I heard GAE has restrictions like we cannot store images or files more than 1MB limit(they are going to change this from what I read in the GAE roadmap),query is limited to 1000 results, and I am also going to se web2py with GAE. So I would like to know your comments.
Thanks
|
Is Google App Engine right for me?
| 1,904,574 | 2 | 9 | 1,390 | 0 |
python,google-app-engine,web2py
|
I wouldn't worry about any of this. After having played with Google App Engine for a while now, I've found that it scales quite well for large data sets. If your data elements are large (i.e. photos), then you'll need to integrate with another service to handle them, but that's probably going to be true no matter what with data of that size. Also, I've found BigTable relatively easy to work with having come from a background entirely in relational databases. Finally, Django is a somewhat hidden, but awesome, "feature" of Google App Engine. If you've never used it, it's a really nice, elegant web framework that makes a lot of common tasks trivial (forms come to mind here).
| 0 | 1 | 0 | 0 |
2009-12-14T19:51:00.000
| 7 | 0.057081 | false | 1,903,065 | 0 | 0 | 1 | 6 |
I am thinking about using Google App Engine.It is going to be a huge website. In that case, what is your piece of advice using Google App Engine. I heard GAE has restrictions like we cannot store images or files more than 1MB limit(they are going to change this from what I read in the GAE roadmap),query is limited to 1000 results, and I am also going to se web2py with GAE. So I would like to know your comments.
Thanks
|
Is Google App Engine right for me?
| 1,905,263 | 5 | 9 | 1,390 | 0 |
python,google-app-engine,web2py
|
using web2py on Google App Engine is a great strategy. It lets you get up and running fast, and if you do outgrow the restrictions of GAE then you can move your web2py application elsewhere.
However, keeping this portability means you should stay away from the advanced parts of GAE (Task Queues, Transactions, ListProperty, etc).
| 0 | 1 | 0 | 0 |
2009-12-14T19:51:00.000
| 7 | 0.141893 | false | 1,903,065 | 0 | 0 | 1 | 6 |
I am thinking about using Google App Engine.It is going to be a huge website. In that case, what is your piece of advice using Google App Engine. I heard GAE has restrictions like we cannot store images or files more than 1MB limit(they are going to change this from what I read in the GAE roadmap),query is limited to 1000 results, and I am also going to se web2py with GAE. So I would like to know your comments.
Thanks
|
Is Google App Engine right for me?
| 1,994,758 | 0 | 9 | 1,390 | 0 |
python,google-app-engine,web2py
|
What about Google Wave? It's being built on appengine, and once live, real-time translatable chat reaches the corporate sector... I could see it hitting top 1000th... But then again, that's an internal project that gets to do special stuff other appengine apps can't.... Like hanging threads; I think... And whatever else Wave has under the hood...
| 0 | 1 | 0 | 0 |
2009-12-14T19:51:00.000
| 7 | 0 | false | 1,903,065 | 0 | 0 | 1 | 6 |
I am thinking about using Google App Engine.It is going to be a huge website. In that case, what is your piece of advice using Google App Engine. I heard GAE has restrictions like we cannot store images or files more than 1MB limit(they are going to change this from what I read in the GAE roadmap),query is limited to 1000 results, and I am also going to se web2py with GAE. So I would like to know your comments.
Thanks
|
Is Google App Engine right for me?
| 1,904,610 | 8 | 9 | 1,390 | 0 |
python,google-app-engine,web2py
|
Having developed a smallish site with GAE, I have some thoughts
If you mean "huge" like "the next YouTube", then GAE might be a great fit, because of the previously mentioned scaling.
If you mean "huge" like "massively complex, with a whole slew of screens, models, and features", then GAE might not be a good fit. Things like unit testing are hard on GAE, and there's not a built-in structure for your app that you'd get with something like (famously) (Ruby on) Rails, or (Python powered) Turbogears.
ie: there is no staging environment: just your development copy of the system and production. This may or may not be a bad thing, depending on your situation.
Additionally, it depends on the other Python modules you intend to pull in: some Python modules just don't run on GAE (because you can't talk to hardware, or because there are just too many files in the package).
Hope this helps
| 0 | 1 | 0 | 0 |
2009-12-14T19:51:00.000
| 7 | 1 | false | 1,903,065 | 0 | 0 | 1 | 6 |
I am thinking about using Google App Engine.It is going to be a huge website. In that case, what is your piece of advice using Google App Engine. I heard GAE has restrictions like we cannot store images or files more than 1MB limit(they are going to change this from what I read in the GAE roadmap),query is limited to 1000 results, and I am also going to se web2py with GAE. So I would like to know your comments.
Thanks
|
Is Google App Engine right for me?
| 1,903,114 | -11 | 9 | 1,390 | 0 |
python,google-app-engine,web2py
|
If you are planning on a 'huge' website, then don't use App Engine. Simple as that. The App Engine is not built to deliver the next top 1000th website.
Allow me to also ask what do you mean by 'huge', how many simultaneous users? Queries per second? DB load?
| 0 | 1 | 0 | 0 |
2009-12-14T19:51:00.000
| 7 | -1 | false | 1,903,065 | 0 | 0 | 1 | 6 |
I am thinking about using Google App Engine.It is going to be a huge website. In that case, what is your piece of advice using Google App Engine. I heard GAE has restrictions like we cannot store images or files more than 1MB limit(they are going to change this from what I read in the GAE roadmap),query is limited to 1000 results, and I am also going to se web2py with GAE. So I would like to know your comments.
Thanks
|
Integrate Python app into PHP site
| 1,909,272 | 0 | 4 | 2,293 | 0 |
php,python,integration,trac
|
Your Python code will have access to your users' cookies. A template would be best, but if you don't have one available (or the header/footer are trivially small, or whatever), you can simply port the PHP header and footer code to Python, using the cookies that are already there to query the database or whatever you need to do.
If you want to retain your links for logging in, registering, and whatever else might be in the PHP version, simply link to the PHP side, then redirect back to Trac once PHP's done its job.
| 0 | 0 | 0 | 1 |
2009-12-15T14:21:00.000
| 3 | 0 | false | 1,907,782 | 0 | 0 | 1 | 2 |
This might sound really crazy, but still...
For our revamped project site, we want to integrate Trac (as code browser, developer wiki and issue tracker) into the site design. That is, of course, difficult, since Trac is written in Python and our site in PHP. Does anybody here know a way how to integrate a header and footer (PHP) into the Trac template (preferrably without invoking a - or rather two for header and footer - PHP process from the command line)?
|
Integrate Python app into PHP site
| 1,907,850 | 1 | 4 | 2,293 | 0 |
php,python,integration,trac
|
The best option probably is to (re)write the header and footer using python.
If the header and footer are relatively static you can also generate them once using php (or once every x minutes) and include them from the filesystem. (You probably already thought about this and dismissed the idea because your sites are too dynamic to use this option?)
While I would not really recommend it you could also use some form of AJAX to load parts of the page, and nothing prevents you from loading this content from a php based system. That could keep all parts dynamic. Your pages will probably look ugly while loading, and you now generate more hits on the server than needed, but if it is nog a big site this might be a big.
Warning: If you have user logins on both systems you will probably run into problems with people only being logged in to half of your site.
| 0 | 0 | 0 | 1 |
2009-12-15T14:21:00.000
| 3 | 0.066568 | false | 1,907,782 | 0 | 0 | 1 | 2 |
This might sound really crazy, but still...
For our revamped project site, we want to integrate Trac (as code browser, developer wiki and issue tracker) into the site design. That is, of course, difficult, since Trac is written in Python and our site in PHP. Does anybody here know a way how to integrate a header and footer (PHP) into the Trac template (preferrably without invoking a - or rather two for header and footer - PHP process from the command line)?
|
How to combine multiple images fast for page views counter
| 1,908,428 | 0 | 0 | 743 | 0 |
python,python-imaging-library,counter
|
If you really need to handle thousands "renders" per second I would not suggest to generate the images on the fly. How about precomputing n images where n is the expected (you might want to be generous here) count you have to handle?
I know you state that you don't want to use javascript and you only want one img tag, but I would recommend to reconsider pushing visualization to the client side as you would burn unnecessary resources if you really get the load you are expecting (thousands hits / second, every hit incrementing the counter and generating an image using PIL).
| 0 | 0 | 0 | 0 |
2009-12-15T15:49:00.000
| 3 | 0 | false | 1,908,334 | 0 | 0 | 1 | 2 |
How can I combine multiple images, such as base image with logo and number of digits images to display graphical counter with pageviews count, updated dynamically?
It should be very fast, with thousands of renders per second. User should see counter image without Javascript and with single img tag.
I prefer to implement that counter with Python using PIL library, but other solutions welcome as well.
|
How to combine multiple images fast for page views counter
| 1,908,385 | 2 | 0 | 743 | 0 |
python,python-imaging-library,counter
|
Precompute for the given background the image of a single digit (for each digit 0 ... 10) at each digit position.
Then to create arbitrary number you only have to paste the correct images next to eachother, but you won't have to do any alpha blending. Therefore this must be more efficient.
Also, if certain page counts are more common (e.g. page counts < 10000) you might want to precompute these (10000) complete counter images to serve those directly.
EDIT:
You can do this with python PIL, or any other method. If you have a specific difficulty with PIL then please ask a more direct question about the problems you have encounterd.
| 0 | 0 | 0 | 0 |
2009-12-15T15:49:00.000
| 3 | 1.2 | true | 1,908,334 | 0 | 0 | 1 | 2 |
How can I combine multiple images, such as base image with logo and number of digits images to display graphical counter with pageviews count, updated dynamically?
It should be very fast, with thousands of renders per second. User should see counter image without Javascript and with single img tag.
I prefer to implement that counter with Python using PIL library, but other solutions welcome as well.
|
facebook app in python showing file list
| 1,910,419 | 3 | 0 | 108 | 0 |
python,django,facebook
|
Based on your comments, I think I see what's going on. 192.168.2.2 is not a valid URL. That is a local network IP, and cannot be accessed from outside your network.
You need to set your Canvas Callback URL to the external IP address of your modem.
| 0 | 0 | 0 | 0 |
2009-12-15T20:22:00.000
| 1 | 0.53705 | false | 1,910,131 | 0 | 0 | 1 | 1 |
i am making a facebook app in python with django. now i have successfully resolved the callback url to my localhost account. but the app is not displaying on facebook.
when i navigate to apps.facebook.com/'myappname', it authenticates and then displays the file list on project folder?
|
Django: Where to put helper functions?
| 1,914,081 | 18 | 80 | 40,688 | 0 |
python,django
|
create a reusable app that include your generic functions so you can share between projects.
use for example a git repo to store this app and manage deployments and evolution (submodule)
use a public git repo so you can share with the community :)
| 0 | 0 | 0 | 0 |
2009-12-16T04:44:00.000
| 4 | 1 | false | 1,912,351 | 0 | 0 | 1 | 3 |
I have a couple of functions that I wrote that I need to use in my django app. Where would I put the file with them and how would I make them callable within my views?
|
Django: Where to put helper functions?
| 1,912,371 | 13 | 80 | 40,688 | 0 |
python,django
|
If they are related to a specific app, I usually just put them in the related app folder and name the file, 'functions.py'.
If they're not specific to an app, I make a commons app for components (tests, models, functions, etc) that are shared across apps.
| 0 | 0 | 0 | 0 |
2009-12-16T04:44:00.000
| 4 | 1 | false | 1,912,351 | 0 | 0 | 1 | 3 |
I have a couple of functions that I wrote that I need to use in my django app. Where would I put the file with them and how would I make them callable within my views?
|
Django: Where to put helper functions?
| 13,270,468 | 2 | 80 | 40,688 | 0 |
python,django
|
I am using new python file service.py in app folder. The file contains mostly helper queries for specific app. Also I used to create a folder inside Django application that contains global helper functions and constants.
| 0 | 0 | 0 | 0 |
2009-12-16T04:44:00.000
| 4 | 0.099668 | false | 1,912,351 | 0 | 0 | 1 | 3 |
I have a couple of functions that I wrote that I need to use in my django app. Where would I put the file with them and how would I make them callable within my views?
|
App engine app design questions
| 1,916,805 | 0 | 1 | 127 | 0 |
python,google-app-engine
|
If you want some handler on your GAE app (including one for a scheduled task, reception of messages, web page visits, etc) to store some new information in such a way that some handler in the future can recover that information, then GAE's storage is the only good general way (memcache could expire from under you, for example). Not sure what you mean by "tables" (?!), but guessing that you actually mean GAE's storage the answer is "yes". (Under very specific circumstances you might want to put that data to some different place on the network, such as your visitor's browser e.g. via cookies, or an Amazon storage instance, etc, but it does not appear to me that those specific circumstances are appliable to your use case).
| 0 | 0 | 0 | 0 |
2009-12-16T16:49:00.000
| 3 | 0 | false | 1,916,009 | 0 | 0 | 1 | 2 |
I want to load info from another site (this part is done), but i am doing this every time the page is loaded and that wont do. So i was thinking of having a variable in a table of settings like 'last checked bbc site' and when the page loads it would check if its been long enough since last check to check again. Is there anything silly about doing it that way?
Also do i absolutely have to use tables to store 1 off variables like this setting?
|
App engine app design questions
| 1,917,064 | 2 | 1 | 127 | 0 |
python,google-app-engine
|
I think there are 2 options that would work for you, besides creating a entity in the datastore to keep track of "last visited time".
One way is to just check the external page periodically, using the cron api as described by jldupont.
The second way is to store the last visited time in memcache. Although memcache is not permanent, it doesn't have to be if you are only storing last refresh times. If your entry in memcache were to disappear for some reason, the worst that would happen would be that you would fetch the page again, and update memcache with the current date/time.
The first way would be best if you want to check the external page at regular intervals. The second way might be better if you want to check the external page only when a user clicks on your page, and you haven't fetched that page yourself in the recent past. With this method, you aren't wasting resources fetching the external page unless someone is actually looking for data related to it.
| 0 | 0 | 0 | 0 |
2009-12-16T16:49:00.000
| 3 | 1.2 | true | 1,916,009 | 0 | 0 | 1 | 2 |
I want to load info from another site (this part is done), but i am doing this every time the page is loaded and that wont do. So i was thinking of having a variable in a table of settings like 'last checked bbc site' and when the page loads it would check if its been long enough since last check to check again. Is there anything silly about doing it that way?
Also do i absolutely have to use tables to store 1 off variables like this setting?
|
In Python, how can I test if I'm in Google App Engine SDK?
| 64,592,250 | 0 | 41 | 8,997 | 0 |
python,google-app-engine
|
Update on October 2020:
I tried using os.environ["SERVER_SOFTWARE"] and os.environ["APPENGINE_RUNTIME"] but both didn't work so I just logged all keys from the results from os.environ.
In these keys, there was GAE_RUNTIME which I used to check if I was in the local environment or cloud environment.
The exact key might change or you could add your own in app.yaml but the point is, log os.environ, perhaps by adding to a list in a test webpage, and use its results to check your environment.
| 0 | 1 | 0 | 0 |
2009-12-16T18:14:00.000
| 7 | 0 | false | 1,916,579 | 0 | 0 | 1 | 1 |
Whilst developing I want to handle some things slight differently than I will when I eventually upload to the Google servers.
Is there a quick test that I can do to find out if I'm in the SDK or live?
|
The best solution for distribution website?
| 1,922,486 | 2 | 0 | 138 | 0 |
python,django,postgresql
|
"What i need to know is whether the porposed solution is suitable for such a small project and could not be easily replaced by less complicated languages/frameworks/dmbses like PHP with MySQL etc.
"
Yes. It's suitable.
No. Nothing is "less complicated" than Django. PHP language may appear less complicated than Python, but you'll do more work to create the site.
With Django, you define the model, define the non-administrative views and you're done. For simple sites this can take as little as 20 minutes. The built-in admin is more valuable than you can imagine.
MySQL is not "less complicated" that PostgresSQL -- they're the same thing
| 0 | 0 | 0 | 0 |
2009-12-17T12:49:00.000
| 3 | 1.2 | true | 1,921,559 | 0 | 0 | 1 | 2 |
Ok, I have a question from a "client" perspective. Let's say we are talking about website designed for distribution: products + their logistics info.
Definitely less than a 2k rows, rarely changed but often accessed. Typical row with several columns will have to consist of a picture so it might make it a bit "heavy". I was proposed a websited in Django Framework coded in Python with Postgresql database.
Is it efficient? Cost-efficient, for such a small purpose is it really needed? and is there a cheaper and also reliable solution?
From what I know the porposed solution is efficient for a programmer - loads of features, flexibility, distinction between layers of code-content-graphics. It gives a chance to build rly complicated websites and databases - thus the cost of service is bigger.
What i need to know is whether the porposed solution is suitable for such a small project and could not be easily replaced by less complicated languages/frameworks/dmbses like PHP with MySQL etc.
Please help :]
and sry for not editing the q in the first place
|
The best solution for distribution website?
| 1,921,584 | 0 | 0 | 138 | 0 |
python,django,postgresql
|
I would not comment about Django & Python. But a more simpler way to store images would be to store just the "path" (location in the directory) in the tables, and load the path in your application/framework.
| 0 | 0 | 0 | 0 |
2009-12-17T12:49:00.000
| 3 | 0 | false | 1,921,559 | 0 | 0 | 1 | 2 |
Ok, I have a question from a "client" perspective. Let's say we are talking about website designed for distribution: products + their logistics info.
Definitely less than a 2k rows, rarely changed but often accessed. Typical row with several columns will have to consist of a picture so it might make it a bit "heavy". I was proposed a websited in Django Framework coded in Python with Postgresql database.
Is it efficient? Cost-efficient, for such a small purpose is it really needed? and is there a cheaper and also reliable solution?
From what I know the porposed solution is efficient for a programmer - loads of features, flexibility, distinction between layers of code-content-graphics. It gives a chance to build rly complicated websites and databases - thus the cost of service is bigger.
What i need to know is whether the porposed solution is suitable for such a small project and could not be easily replaced by less complicated languages/frameworks/dmbses like PHP with MySQL etc.
Please help :]
and sry for not editing the q in the first place
|
Split views.py in several files
| 1,921,921 | 1 | 172 | 42,864 | 0 |
python,django
|
Since Django just expects a view to be a callable object, you can put then wherever you like in your PYTHONPATH. So you could for instance just make a new package myapp.views and put views into multiple modules there. You will naturally have to update your urls.py and other modules that reference these view callables.
| 0 | 0 | 0 | 0 |
2009-12-17T13:26:00.000
| 10 | 0.019997 | false | 1,921,771 | 1 | 0 | 1 | 4 |
My views.py has become too big and it's hard to find the right view.
How do I split it in several files and then import it? Does it involve any speed loss?
Can I do the same with models.py?
|
Split views.py in several files
| 1,921,892 | 10 | 172 | 42,864 | 0 |
python,django
|
Basically, you can put your code, whereever you wish. Just make sure, you change the import statements accordingly, e.g. for the views in the urls.py.
Not knowing your actual code its hard to suggest something meaningful. Maybe you can use some kind of filename prefix, e.g. views_helper.py, views_fancy.py, views_that_are_not_so_often_used.py or so ...
Another option would be to create a views directory with an __init__.py, where you import all subviews. If you have a need for a large number of files, you can create more nested subviews as your views grow ...
| 0 | 0 | 0 | 0 |
2009-12-17T13:26:00.000
| 10 | 1 | false | 1,921,771 | 1 | 0 | 1 | 4 |
My views.py has become too big and it's hard to find the right view.
How do I split it in several files and then import it? Does it involve any speed loss?
Can I do the same with models.py?
|
Split views.py in several files
| 1,923,475 | 1 | 172 | 42,864 | 0 |
python,django
|
I split almost all views in my apps into a views folder (with an init.py of course). I do not, however, import all of the subviews in the init.py like some of the answers have suggested. It seems to work just fine.
| 0 | 0 | 0 | 0 |
2009-12-17T13:26:00.000
| 10 | 0.019997 | false | 1,921,771 | 1 | 0 | 1 | 4 |
My views.py has become too big and it's hard to find the right view.
How do I split it in several files and then import it? Does it involve any speed loss?
Can I do the same with models.py?
|
Split views.py in several files
| 32,090,920 | 1 | 172 | 42,864 | 0 |
python,django
|
Suppose if you have a file named: password_generator.py then inside views.py add: from password_generator import *
Then you can call that module's function from views.py.
| 0 | 0 | 0 | 0 |
2009-12-17T13:26:00.000
| 10 | 0.019997 | false | 1,921,771 | 1 | 0 | 1 | 4 |
My views.py has become too big and it's hard to find the right view.
How do I split it in several files and then import it? Does it involve any speed loss?
Can I do the same with models.py?
|
django + mysql + UTF-8 - Chars are not displayed
| 1,931,067 | 0 | 0 | 312 | 1 |
python,django,unicode
|
As Dominic has said, the generated HTML source code is correct (these are your Japanese characters translated into HTML entities), but we're not sure, if you see the same code rendered in the page (in this case, you have probably set content-type to "text/plain" instead of "text/html" - do you use render_to_response() or HttpResponse() in the corresponding view.py method?), or your Japanese is rendered correctly but you just don't like the entities in the source code.
Since we don't know your Django settings and how do you render and return the page, it's difficult to provide you the solution.
| 0 | 0 | 0 | 0 |
2009-12-18T13:04:00.000
| 3 | 0 | false | 1,928,087 | 0 | 0 | 1 | 1 |
I have both, django and mysql set to work with UTF-8.
My base.html set utf-8 in head.
row on my db :
+----+--------+------------------------------------------------------------------+-----------------------------+-----------------------------+---------------------+
| id | psn_id | name | publisher | developer | release_date |
+----+--------+------------------------------------------------------------------+-----------------------------+-----------------------------+---------------------+
| 1 | 10945- | まいにちいっしょ | Sony Computer Entertainment | Sony Computer Entertainment | 2006-11-11 00:00:00 |
+----+--------+------------------------------------------------------------------+-----------------------------+-----------------------------+---------------------+
the source code generated looks like :
まいにちいっしょ
and this is wat is displayed :/
why they are not showing the chars the way in this database?
|
Is there a better way to serve the results of an expensive, blocking python process over HTTP?
| 1,929,711 | 1 | 5 | 495 | 0 |
python,http,mod-wsgi,tornado
|
You might consider a queuing system with AJAX notification methods.
Whenever there is a request for your expensive resource, and that resource needs to be generated, add that request to the queue (if it's not already there). That queuing operation should return an ID of an object that you can query to get its status.
Next you have to write a background service that spins up worker threads. These workers simply dequeue the request, generate the data, then saves the data's location in the request object.
The webpage can make AJAX calls to your server to find out the progress of the generation and to give a link to the file once it's available.
This is how LARGE media sites work - those that have to deal with video in particular. It might be overkill for your MP3 work however.
Alternatively, look into running a couple machines to distribute the load. Your threads on Apache will still block, but atleast you won't consume resources on the web server.
| 0 | 1 | 0 | 1 |
2009-12-18T17:39:00.000
| 5 | 0.039979 | false | 1,929,681 | 0 | 0 | 1 | 3 |
We have a web service which serves small, arbitrary segments of a fixed inventory of larger MP3 files. The MP3 files are generated on-the-fly by a python application. The model is, make a GET request to a URL specifying which segments you want, get an audio/mpeg stream in response. This is an expensive process.
We're using Nginx as the front-end request handler. Nginx takes care of caching responses for common requests.
We initially tried using Tornado on the back-end to handle requests from Nginx. As you would expect, the blocking MP3 operation kept Tornado from doing its thing (asynchronous I/O). So, we went multithreaded, which solved the blocking problem, and performed quite well. However, it introduced a subtle race condition (under real world load) that we haven't been able to diagnose or reproduce yet. The race condition corrupts our MP3 output.
So we decided to set our application up as a simple WSGI handler behind Apache/mod_wsgi (still w/ Nginx up front). This eliminates the blocking issue and the race condition, but creates a cascading load (i.e. Apache creates too many processses) on the server under real world conditions. We're working on tuning Apache/mod_wsgi right now, but still at a trial-and-error phase. (Update: we've switched back to Tornado. See below.)
Finally, the question: are we missing anything? Is there a better way to serve CPU-expensive resources over HTTP?
Update: Thanks to Graham's informed article, I'm pretty sure this is an Apache tuning problem. In the mean-time, we've gone back to using Tornado and are trying to resolve the data-corruption issue.
For those who were so quick to throw more iron at the problem, Tornado and a bit of multi-threading (despite the data integrity problem introduced by threading) handles the load acceptably on a small (single core) Amazon EC2 instance.
|
Is there a better way to serve the results of an expensive, blocking python process over HTTP?
| 1,929,738 | 0 | 5 | 495 | 0 |
python,http,mod-wsgi,tornado
|
It looks like you are doing things right -- just lacking CPU power: can you determine what is the CPU loading in the process of generating these MP3?
I think the next thing you have to do there is to add more hardware to render the MP3's on other machines. Or that or find a way to deliver pre-rendered MP3 (maybe you can cahce some of your media?)
BTW, scaling for the web was the theme of a Keynote lecture by Jacob Kaplan-Moss on PyCon Brasil this year, and it is far from being a closed problem. The stack of technologies one needs to handle is quite impressible - (I could not find an online copy o f the presentation, though - -sorry for that)
| 0 | 1 | 0 | 1 |
2009-12-18T17:39:00.000
| 5 | 0 | false | 1,929,681 | 0 | 0 | 1 | 3 |
We have a web service which serves small, arbitrary segments of a fixed inventory of larger MP3 files. The MP3 files are generated on-the-fly by a python application. The model is, make a GET request to a URL specifying which segments you want, get an audio/mpeg stream in response. This is an expensive process.
We're using Nginx as the front-end request handler. Nginx takes care of caching responses for common requests.
We initially tried using Tornado on the back-end to handle requests from Nginx. As you would expect, the blocking MP3 operation kept Tornado from doing its thing (asynchronous I/O). So, we went multithreaded, which solved the blocking problem, and performed quite well. However, it introduced a subtle race condition (under real world load) that we haven't been able to diagnose or reproduce yet. The race condition corrupts our MP3 output.
So we decided to set our application up as a simple WSGI handler behind Apache/mod_wsgi (still w/ Nginx up front). This eliminates the blocking issue and the race condition, but creates a cascading load (i.e. Apache creates too many processses) on the server under real world conditions. We're working on tuning Apache/mod_wsgi right now, but still at a trial-and-error phase. (Update: we've switched back to Tornado. See below.)
Finally, the question: are we missing anything? Is there a better way to serve CPU-expensive resources over HTTP?
Update: Thanks to Graham's informed article, I'm pretty sure this is an Apache tuning problem. In the mean-time, we've gone back to using Tornado and are trying to resolve the data-corruption issue.
For those who were so quick to throw more iron at the problem, Tornado and a bit of multi-threading (despite the data integrity problem introduced by threading) handles the load acceptably on a small (single core) Amazon EC2 instance.
|
Is there a better way to serve the results of an expensive, blocking python process over HTTP?
| 1,937,378 | 1 | 5 | 495 | 0 |
python,http,mod-wsgi,tornado
|
Please define "cascading load", as it has no common meaning.
Your most likely problem is going to be if you're running too many Apache processes.
For a load like this, make sure you're using the prefork mpm, and make sure you're limiting yourself to an appropriate number of processes (no less than one per CPU, no more than two).
| 0 | 1 | 0 | 1 |
2009-12-18T17:39:00.000
| 5 | 0.039979 | false | 1,929,681 | 0 | 0 | 1 | 3 |
We have a web service which serves small, arbitrary segments of a fixed inventory of larger MP3 files. The MP3 files are generated on-the-fly by a python application. The model is, make a GET request to a URL specifying which segments you want, get an audio/mpeg stream in response. This is an expensive process.
We're using Nginx as the front-end request handler. Nginx takes care of caching responses for common requests.
We initially tried using Tornado on the back-end to handle requests from Nginx. As you would expect, the blocking MP3 operation kept Tornado from doing its thing (asynchronous I/O). So, we went multithreaded, which solved the blocking problem, and performed quite well. However, it introduced a subtle race condition (under real world load) that we haven't been able to diagnose or reproduce yet. The race condition corrupts our MP3 output.
So we decided to set our application up as a simple WSGI handler behind Apache/mod_wsgi (still w/ Nginx up front). This eliminates the blocking issue and the race condition, but creates a cascading load (i.e. Apache creates too many processses) on the server under real world conditions. We're working on tuning Apache/mod_wsgi right now, but still at a trial-and-error phase. (Update: we've switched back to Tornado. See below.)
Finally, the question: are we missing anything? Is there a better way to serve CPU-expensive resources over HTTP?
Update: Thanks to Graham's informed article, I'm pretty sure this is an Apache tuning problem. In the mean-time, we've gone back to using Tornado and are trying to resolve the data-corruption issue.
For those who were so quick to throw more iron at the problem, Tornado and a bit of multi-threading (despite the data integrity problem introduced by threading) handles the load acceptably on a small (single core) Amazon EC2 instance.
|
Weblogic domain and cluster creation with WLST
| 2,258,690 | 5 | 3 | 3,100 | 0 |
python,weblogic,jython,wlst
|
I eventually found the answer. I am posting here for reference.
Out of the 5 mentioned tasks, all can be performed with an offline wlst script. All of them have to be performed on the node where AdminServer is supposed to live.
Now, for updating the domain information on the second node, there is an nmEnroll command in wlst which hast to be performed online
So, to summarize,
Execute an offline wlst script to perform all the 5 tasks mentioned in the question. This has to be done on the node (physical computer) where we want our AdminServer to run.
Start nodemanager on all the nodes to be used in the cluster,
Start the AdminServer on the node where we executed the domain creation script.
On all the other nodes execute the script which looks like following.
connect('user','password','t3://adminhost:adminport')
nmEnroll('path_to_the_domain_dir')
| 0 | 1 | 0 | 0 |
2009-12-19T14:10:00.000
| 2 | 1.2 | true | 1,933,000 | 0 | 0 | 1 | 2 |
I want to create a cluster with 2 managed servers on 2 different physical machines.
I have following tasks to be performed (please correct me if I miss something)
Domain creation.
Set admin server properties and create AdminServer under SSL
Create logical machines for the physical ones
Create managed servers
create cluster with the managed servers
I have following questions.
Which of the above mentioned tasks can be done offline if any ?
Which of the above mentioned tasks must also be performed on the 2nd physical machine ?
|
Weblogic domain and cluster creation with WLST
| 32,569,619 | 0 | 3 | 3,100 | 0 |
python,weblogic,jython,wlst
|
There are two steps missed after the step 1, you need to copy the configuration from the machine where the AdminServer is running run to the other machine in the cluster using the command pack content in Weblogic installation:
1.1 On the machine where the AdminServer is running run ./pack.shdomain=/home/oracle/config/domains/my_domain
-template=/home/oracle/my_domain.jar -template_name=remote_managed -managed=true
1.2 Go on the other machines and copy the jar file produced in the previous step and run ./unpack.sh -domain=/home/oracle/config/domains/my_domain -template=/home/oracle/my_domain.jar SAML_IDP_FromScript
Now you have copied all the file you need to start the NodeManager and the ManagedServers on the other machines.
| 0 | 1 | 0 | 0 |
2009-12-19T14:10:00.000
| 2 | 0 | false | 1,933,000 | 0 | 0 | 1 | 2 |
I want to create a cluster with 2 managed servers on 2 different physical machines.
I have following tasks to be performed (please correct me if I miss something)
Domain creation.
Set admin server properties and create AdminServer under SSL
Create logical machines for the physical ones
Create managed servers
create cluster with the managed servers
I have following questions.
Which of the above mentioned tasks can be done offline if any ?
Which of the above mentioned tasks must also be performed on the 2nd physical machine ?
|
Why use Django on Google App Engine?
| 2,988,728 | 0 | 89 | 25,088 | 0 |
python,django,google-app-engine
|
I am still very new to Google App engine development, but the interfaces Django provides do appear much nicer than the default. The benefits will depend on what you are using to run Django on the app engine. The Google App Engine Helper for Django allows you to use the full power of the Google App Engine with some Django functionality on the side.
Django non-rel attempts to provide as much of Django's power as possible, but running on the app-engine for possible extra scalability. In particular, it includes Django models (one of Django's core features), but this is a leaky abstraction due to the differences between relational databases and bigtable. There will most likely be tradeoffs in functionality and efficiency, as well as an increased number of bugs and quirks. Of course, this might be worth it in circumstances like those described in the question, but otherwise would strongly recommend using the helper at the start as then you have the option of moving towards either pure app-engine or Django non-rel later. Also, if you do switch to Django non-rel, your increased knowledge of how app engine works will be useful if the Django abstraction ever breaks - certainly much more useful than knowledge of the quirks/workarounds for Django non-rel if you swap the other way.
| 0 | 1 | 0 | 0 |
2009-12-20T05:03:00.000
| 8 | 0 | false | 1,934,914 | 0 | 0 | 1 | 5 |
When researching Google App Engine (GAE), it's clear that using Django is wildly popular for developing in Python on GAE. I've been scouring the web to find information on the costs and benefits of using Django, to find out why it's so popular. While I've been able to find a wide variety of sources on how to run Django on GAE and the various methods of doing so, I haven't found any comparative analysis on why Django is preferable to using the webapp framework provided by Google.
To be clear, it's immediately apparent why using Django on GAE is useful for developers with an existing skillset in Django (a majority of Python web developers, no doubt) or existing code in Django (where using GAE is more of a porting exercise). My team, however, is evaluating GAE for use on an all-new project and our existing experience is with TurboGears, not Django.
It's been quite difficult to determine why Django is beneficial to a development team when the BigTable libraries have replaced Django's ORM, sessions and authentication are necessarily changed, and Django's templating (if desirable) is available without using the entire Django stack.
Finally, it's clear that using Django does have the advantage of providing an "exit strategy" if we later wanted to move away from GAE and need a platform to target for the exodus.
I'd be extremely appreciative for help in pointing out why using Django is better than using webapp on GAE. I'm also completely inexperienced with Django, so elaboration on smaller features and/or conveniences that work on GAE are also valuable to me.
|
Why use Django on Google App Engine?
| 1,934,918 | 3 | 89 | 25,088 | 0 |
python,django,google-app-engine
|
I have experience using Django and not GAE. From my experiences with Django it was a very simplistic setup and the deployment process was incredibly easy in terms of web projects. Granted I had to learn Python to really get a good hold on things, but at the end of the day I would use it again on a project. This was almost 2 years ago before it reached 1.0 so I my knowledge is a bit outdated.
If you are worried about changing platforms, then this would be a better choice I suppose.
| 0 | 1 | 0 | 0 |
2009-12-20T05:03:00.000
| 8 | 0.07486 | false | 1,934,914 | 0 | 0 | 1 | 5 |
When researching Google App Engine (GAE), it's clear that using Django is wildly popular for developing in Python on GAE. I've been scouring the web to find information on the costs and benefits of using Django, to find out why it's so popular. While I've been able to find a wide variety of sources on how to run Django on GAE and the various methods of doing so, I haven't found any comparative analysis on why Django is preferable to using the webapp framework provided by Google.
To be clear, it's immediately apparent why using Django on GAE is useful for developers with an existing skillset in Django (a majority of Python web developers, no doubt) or existing code in Django (where using GAE is more of a porting exercise). My team, however, is evaluating GAE for use on an all-new project and our existing experience is with TurboGears, not Django.
It's been quite difficult to determine why Django is beneficial to a development team when the BigTable libraries have replaced Django's ORM, sessions and authentication are necessarily changed, and Django's templating (if desirable) is available without using the entire Django stack.
Finally, it's clear that using Django does have the advantage of providing an "exit strategy" if we later wanted to move away from GAE and need a platform to target for the exodus.
I'd be extremely appreciative for help in pointing out why using Django is better than using webapp on GAE. I'm also completely inexperienced with Django, so elaboration on smaller features and/or conveniences that work on GAE are also valuable to me.
|
Why use Django on Google App Engine?
| 1,942,826 | 0 | 89 | 25,088 | 0 |
python,django,google-app-engine
|
If you decide to run you app outside of GAE, you can still use Django. You won't really have that much luck with the GAE webapp
| 0 | 1 | 0 | 0 |
2009-12-20T05:03:00.000
| 8 | 0 | false | 1,934,914 | 0 | 0 | 1 | 5 |
When researching Google App Engine (GAE), it's clear that using Django is wildly popular for developing in Python on GAE. I've been scouring the web to find information on the costs and benefits of using Django, to find out why it's so popular. While I've been able to find a wide variety of sources on how to run Django on GAE and the various methods of doing so, I haven't found any comparative analysis on why Django is preferable to using the webapp framework provided by Google.
To be clear, it's immediately apparent why using Django on GAE is useful for developers with an existing skillset in Django (a majority of Python web developers, no doubt) or existing code in Django (where using GAE is more of a porting exercise). My team, however, is evaluating GAE for use on an all-new project and our existing experience is with TurboGears, not Django.
It's been quite difficult to determine why Django is beneficial to a development team when the BigTable libraries have replaced Django's ORM, sessions and authentication are necessarily changed, and Django's templating (if desirable) is available without using the entire Django stack.
Finally, it's clear that using Django does have the advantage of providing an "exit strategy" if we later wanted to move away from GAE and need a platform to target for the exodus.
I'd be extremely appreciative for help in pointing out why using Django is better than using webapp on GAE. I'm also completely inexperienced with Django, so elaboration on smaller features and/or conveniences that work on GAE are also valuable to me.
|
Why use Django on Google App Engine?
| 1,934,925 | 51 | 89 | 25,088 | 0 |
python,django,google-app-engine
|
Django probably isn't the right choice for you, if you're sure that GAE is right for you. The strengths of the two technologies don't align very well - you completely lose a lot of Django's wonderful orm on GAE, and if you do use it, you write code that isn't really directly suitable to bigtable and the way GAE works.
The thing about GAE is that it gets the great scalability by forcing you to write code that scales easily from the ground up. You just can't do a number of things that scale poorly (of course, you can still write poorly scaling code, but you avoid some pitfalls). The tradeoff is that you really end up coding around the framework, if you use something like Django which is designed for a different environment.
If you see yourself ever leaving GAE for any reason, becoming invested in the infrastructure there is a problem for you. Coding for bigtable means that it will be harder to move to a different architecture (though the apache project is working to solve this for you with the HBase component of the Hadoop project). It would still be a lot of work to transition off of GAE.
What's the driving motivator behind using GAE, besides being a Google product, and a cool buzzword? Is there a reason that scaling using something like mediatemple's offering is unlikely to work well for you? Are you sure that the ways that GAE scales are right for your application? How does the cost compare to dedicated servers, if you're expecting to get to that performance realm? Can you solve your problem well using the tools GAE provides, as compared to a more traditional load-balanced server setup?
All this said, unless you absolutely positively need the borderline-ridiculous scaling that GAE offers, I'd personally suggest not letting that particular service structure your choice of framework. I like Django, so I'd say you should use it, but not on GAE.
Edit (June 2010):
As an update to this comment sometime later:
Google has announced sql-like capabilitys for GAE that aren't free, but will let you easily do things like run SQL-style commands to generate reports on your data.
Additionally, there are upcoming changes to the GAE query language which will allow complex queries in a far easier fashion. Look at the videos from Google I/O 2010.
Furthermore, there is work being done during the Summer of Code 2010 project which should bring no-sql support to django core, and by extension, make working with GAE significantly easier.
GAE is becoming more attractive as a hosting platform.
Edit (August 2011):
And Google just raised the cost to most users of the platform significantly by changing the pricing structure. The lockin problem has gotten better (if your application is big enough you can deploy the apache alternatives), but for most applications, running servers or VPS deployments is cheaper.
Very few people really have bigdata problems. "Oh my startup might scale someday" isn't a bigdata problem. Build stuff now and get it out the door using the standard tools.
| 0 | 1 | 0 | 0 |
2009-12-20T05:03:00.000
| 8 | 1 | false | 1,934,914 | 0 | 0 | 1 | 5 |
When researching Google App Engine (GAE), it's clear that using Django is wildly popular for developing in Python on GAE. I've been scouring the web to find information on the costs and benefits of using Django, to find out why it's so popular. While I've been able to find a wide variety of sources on how to run Django on GAE and the various methods of doing so, I haven't found any comparative analysis on why Django is preferable to using the webapp framework provided by Google.
To be clear, it's immediately apparent why using Django on GAE is useful for developers with an existing skillset in Django (a majority of Python web developers, no doubt) or existing code in Django (where using GAE is more of a porting exercise). My team, however, is evaluating GAE for use on an all-new project and our existing experience is with TurboGears, not Django.
It's been quite difficult to determine why Django is beneficial to a development team when the BigTable libraries have replaced Django's ORM, sessions and authentication are necessarily changed, and Django's templating (if desirable) is available without using the entire Django stack.
Finally, it's clear that using Django does have the advantage of providing an "exit strategy" if we later wanted to move away from GAE and need a platform to target for the exodus.
I'd be extremely appreciative for help in pointing out why using Django is better than using webapp on GAE. I'm also completely inexperienced with Django, so elaboration on smaller features and/or conveniences that work on GAE are also valuable to me.
|
Why use Django on Google App Engine?
| 1,935,061 | 0 | 89 | 25,088 | 0 |
python,django,google-app-engine
|
I cannot answer the question but you may want to look into web2py. It is similar to Django in many respects but its database abstraction layer works on GAE and supports most of the GAE functionality (not all but we try to catch up). In this way if GAE works for you great, if it does not, you can move your code to a different db (SQLite, MySQL, PostgreSQL, Oracle, MSSQL, FireBird, DB2, Informix, Ingres, and - soon - Sybase and MongoDB).
| 0 | 1 | 0 | 0 |
2009-12-20T05:03:00.000
| 8 | 0 | false | 1,934,914 | 0 | 0 | 1 | 5 |
When researching Google App Engine (GAE), it's clear that using Django is wildly popular for developing in Python on GAE. I've been scouring the web to find information on the costs and benefits of using Django, to find out why it's so popular. While I've been able to find a wide variety of sources on how to run Django on GAE and the various methods of doing so, I haven't found any comparative analysis on why Django is preferable to using the webapp framework provided by Google.
To be clear, it's immediately apparent why using Django on GAE is useful for developers with an existing skillset in Django (a majority of Python web developers, no doubt) or existing code in Django (where using GAE is more of a porting exercise). My team, however, is evaluating GAE for use on an all-new project and our existing experience is with TurboGears, not Django.
It's been quite difficult to determine why Django is beneficial to a development team when the BigTable libraries have replaced Django's ORM, sessions and authentication are necessarily changed, and Django's templating (if desirable) is available without using the entire Django stack.
Finally, it's clear that using Django does have the advantage of providing an "exit strategy" if we later wanted to move away from GAE and need a platform to target for the exodus.
I'd be extremely appreciative for help in pointing out why using Django is better than using webapp on GAE. I'm also completely inexperienced with Django, so elaboration on smaller features and/or conveniences that work on GAE are also valuable to me.
|
pyfacebook and javascript query
| 1,935,664 | 1 | 0 | 66 | 0 |
javascript,python
|
You can't pass a variable directly, as JavaScript is running on the client (browser), and Python is running on the server.
You could make a XHR (AJAX) request from JavaScript to the server which would then return your values back to JS (JSON could be used here).
Or you could put a hidden field to your markup that would have the value in it's "value" attribute. You could then read that with JavaScript.
ps: your question really isn't related to pyfacebook but Python (or any other server side technology) in general and that has been covered here many many times.
| 0 | 0 | 0 | 0 |
2009-12-20T12:04:00.000
| 1 | 1.2 | true | 1,935,636 | 0 | 0 | 1 | 1 |
I'm using pyfacebook on the backend and javascript on the client side. Now if I want to pass a variable to the javascript from pyfacebook. how would I go about doing that, any ideas?
|
Can I do Django & Python web development using Xcode 3.2?
| 1,936,102 | 2 | 3 | 6,512 | 0 |
python,django
|
I think Eclipse+Pydev Plugin is a good choice!!
| 0 | 0 | 0 | 0 |
2009-12-20T15:06:00.000
| 4 | 0.099668 | false | 1,936,080 | 0 | 0 | 1 | 1 |
I'm not sure but I believe that Python is -next to Objective-C- somewhat natural to Mac OSX and the Xcode IDE. I might be wrong. So is it a good idea to use Xcode for Django / Python web development when I'm already a bit familiar with Xcode? Actually I only do iPhone dev with it, but now I need a website and I stumbled over Django / Python. I don't want to "fall back" to PHP again, because just everyone and his dog does that already. Want to give Django / Python a try ;)
|
Does anyone had success getting Django to send emails when hosting on Dreamhost?
| 1,939,248 | 0 | 7 | 4,627 | 0 |
python,django,dreamhost
|
Do you have an SMTP server set up anywhere? As people have suggested here, you can easily use gmail, but you are by no means limited to using only Gmails SMTP server. You can create your own on your own hardware if you like, or you can use a number of free SMTP servers out there. I'd say the most fun would be to set up your own box and make your own SMTP server ;)
| 0 | 0 | 0 | 0 |
2009-12-21T06:57:00.000
| 5 | 0 | false | 1,938,609 | 0 | 0 | 1 | 2 |
Greetings,
Does anyone know what are the required fields to have Django send emails when a "500 Internal Server Error" happend? I am hosting my project on Dreamhost and for the life of me I can't get Django to send emails. What are the required fields when hosting on Dreamhost?
|
Does anyone had success getting Django to send emails when hosting on Dreamhost?
| 3,738,431 | 0 | 7 | 4,627 | 0 |
python,django,dreamhost
|
One issue we seem to have found with this gmail work around, is that if you try testing by sending from a gmail account to a dreamhost email that forwards back to the same gmail, the message is dropped. This may be some weird security 'feature' that dreamhost has going.
| 0 | 0 | 0 | 0 |
2009-12-21T06:57:00.000
| 5 | 0 | false | 1,938,609 | 0 | 0 | 1 | 2 |
Greetings,
Does anyone know what are the required fields to have Django send emails when a "500 Internal Server Error" happend? I am hosting my project on Dreamhost and for the life of me I can't get Django to send emails. What are the required fields when hosting on Dreamhost?
|
Django index page best/most common practice
| 1,940,751 | 3 | 21 | 12,324 | 0 |
python,django,indexing
|
I tend to create a views.py in the root of the project where I keep the index view.
| 0 | 0 | 0 | 0 |
2009-12-21T14:51:00.000
| 2 | 0.291313 | false | 1,940,528 | 0 | 0 | 1 | 1 |
I am working on a site currently (first one solo) and went to go make an index page. I have been attempting to follow django best practices as I go, so naturally I go search for this but couldn't a real standard in regards to this.
I have seen folks creating apps to serve this purpose named various things (main, home, misc) and have seen a views.py in the root of the project. I am really just looking for what the majority out there do for this.
The index page is not static, since I want to detect if the user is logged in and such.
Thanks.
|
fastcgi, cherrypy, and python
| 1,947,457 | 0 | 5 | 2,035 | 0 |
python,fastcgi,lighttpd,cherrypy
|
From a system-software-writer's pointer of view: This all depends on how the meta-data about the server process is organized within your daemon (lighttpd or fcgi). Some programs are designed for one time only initialization -- MOSTLY this allows a much simpler and better performing internal programming model.
Often it is very hard to program a server process reload config data in a easy way. You might have to introduce locks and external event objects (signals in UNIX). When you can synchronize the data structures by design -- i.e., only initializing once .... why complicate things by making the data model modifiable multiple times ?
| 0 | 0 | 0 | 1 |
2009-12-22T16:09:00.000
| 2 | 0 | false | 1,947,344 | 0 | 0 | 1 | 1 |
So I'm trying to do more web development in python, and I've picked cherrypy, hosted by lighttpd w/ fastcgi. But my question is a very basic one: why do I need to restart lighttpd (or apache) every time I change my application code, or the code for an underlying library?
I realize this question extends from a basic mis(i.e. poor)understanding of the fastcgi model, so I'm open to any schooling here, but I'm used to just changing a PHP file and it showing up, versus having to bounce the web server.
Any elucidation/useful mockery appreciated.
|
Why do all twisted/wokkel xmpp examples ignore the proper usage of JID in the xmpp protocol?
| 2,590,641 | 5 | 1 | 1,213 | 0 |
python,xmpp,twisted,google-talk
|
In this particular case, the better answer to the non-question is that you should not set the from address at all. Every server will happily fill in the blank for you, saving you from figuring out what JID your client has.
| 0 | 0 | 0 | 0 |
2009-12-24T07:43:00.000
| 2 | 0.462117 | false | 1,957,255 | 0 | 0 | 1 | 1 |
Okay, this isn't a question. All the examples of wokkel and twisted I have seen do not properly observe generated resources in the JID.
Google talk clients built using wokkel/twisted generally break because they do not set the full JID on responses, resulting in (very hidden, low level) errors like:
<message to="[email protected]" from="[email protected]/Example2C2F32A1" type="error"><body>echo: None</body><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">If set, the 'from' attribute must be set to the user's full JID.</text></error></message>
The full, server issued jid can be obtained in the protocol handler from self.parent.authenticator.jid.full()
So, when sending messages, ensure you use the full jid in your from field, or some servers will not like you and you will pull all your hair out, and cry.
|
python source code conversion to uml diagram with Sparx Systems Enterprise Architect
| 1,964,328 | 4 | 2 | 4,824 | 0 |
python
|
File / New Project / enter your project name.
In the Project Browser, create a package named "source"
Right-click the source package, "Code Engineering", "Import Source Directory".
Pick the directory containing your module(s) as the "Root Directory"
Set "Source Type" to Python
Enable "Recursively Process Subdirectories"
Select "Package Per File"
Click "OK".
| 0 | 0 | 0 | 0 |
2009-12-26T02:05:00.000
| 4 | 0.197375 | false | 1,962,447 | 0 | 0 | 1 | 2 |
Please let me know how to create a uml diagram along with its equivalent documentation for the source code(.py format) using enterprise architecture 7.5
Please help me find the solution, I have read the solution for the question on this website related to my topic but in vain
|
python source code conversion to uml diagram with Sparx Systems Enterprise Architect
| 45,345,997 | 1 | 2 | 4,824 | 0 |
python
|
Go to project browser
Create a model
Right-click model > Add > Add View > Class
Right-click class > Code Engineering > Import Source Directory...
Check "one package per folder"
The last one ensures you'll have an interesting diagram full of classes.
| 0 | 0 | 0 | 0 |
2009-12-26T02:05:00.000
| 4 | 0.049958 | false | 1,962,447 | 0 | 0 | 1 | 2 |
Please let me know how to create a uml diagram along with its equivalent documentation for the source code(.py format) using enterprise architecture 7.5
Please help me find the solution, I have read the solution for the question on this website related to my topic but in vain
|
How can I tell if a field has changed value in an AT object in plone?
| 1,977,227 | 1 | 2 | 231 | 0 |
python,plone,zope,archetypes
|
Yes, IObjectEditedEvent (a direct subclass of IObjectModifiedEvent) is emitted when an Archetypes content object is being changed.
However, the event itself will not tell you if a new file was uploaded. It should be possible however, to obtain the request (context.REQUEST should give you the current request through acquisition, for example) and see if there is a file object there matching the field. If so, the user uploaded a new file for that field and the FileField will have been updated.
| 0 | 0 | 0 | 0 |
2009-12-28T07:16:00.000
| 2 | 1.2 | true | 1,968,343 | 0 | 0 | 1 | 1 |
I have an AT content type in Plone. It has a number of fields, including a file field. When the user edits an object of this type, how can I tell if a new file was uploaded?
For that matter, how can I tell if any of the fields have been changed?
I am currently using subscribers to hook into the IObjectEditedEvent to do some after the object changes - can I do these things here?
|
Piecing together Django views
| 1,976,174 | 0 | 1 | 141 | 0 |
python,django
|
Your question is little too generic.
The general way of doing it involves:
Extend templates of the reusable apps
Pass the new template name to the view (Reusable apps should accepts that argument)
Also pass extra_context to the reusable-generic-view
Use your own view to create an extra_context and return the reuse-able view, from your view.
| 0 | 0 | 0 | 0 |
2009-12-29T17:19:00.000
| 3 | 0 | false | 1,975,769 | 0 | 0 | 1 | 1 |
Is it good practice to treat individual app views as a blocks of HTML that can be pieced together to form a larger site? If not, what is the best way to reuse app views from project to project, assuming each one uses a different set of templates?
|
Play Subset of audio file using Pyglet
| 1,980,577 | 1 | 1 | 1,156 | 0 |
python,audio,pyglet
|
It doesn't appear that pyglet has support for setting a stop time. Your options are:
Poll the current time and stop playback when you've reached your desired endpoint. This may not be precise enough for you.
Or, use a sound file library to extract the portion you want into a temporary sound file, then use pyglet to play that sound file in its entirety. Python has built-in support for .wav files (the "wave" module), or you could shell out to a command-line tool like "sox".
| 0 | 0 | 0 | 0 |
2009-12-29T23:15:00.000
| 2 | 1.2 | true | 1,977,521 | 0 | 0 | 1 | 1 |
How can I use the pyglet API for sound to play subsets of a sound file e.g. from 1 second in to 3.5seconds of a 6 second sound clip?
I can load a sound file and play it, and can seek to the start of the interval desired, but am wondering how to stop playback at the point indicated?
|
Web2Py Working Directory
| 1,987,564 | 5 | 3 | 1,740 | 0 |
python,directory,web2py
|
In any multi-threaded Python program (and not only Python) you should not use os.chdir and you should not change sys.path when you have more than one thread running. It is not safe because it affects other threads. Moreover you should not sys.path.append() in a loop because it may explode.
All web frameworks are multi-threaded and requests are executed in a loop. Some web frameworks do not allow you to install/un-install applications without restarting the web server and therefore IF os.chdir/sys.path.append are only executed at startup then there is no problem.
In web2py we want to be able to install/uninstall applications without restarting the web server. We want apps to be very dynamical (for example define models based on information provided with the http request). We want each app to have its own models folder and we want complete separation between apps so that if two apps need to different versions of the same module, they do not conflict with each other, so we provide APIs to do so (request.folder, local_import).
You can still use the normal os.chdir and sys.path.append but you should do it outside threads (and this is not a web2py specific issue). You can use import anywhere you like as you would in any other Python program.
I strongly suggest moving this discussion to the web2py mailing list.
| 0 | 0 | 0 | 0 |
2009-12-30T03:01:00.000
| 3 | 0.321513 | false | 1,978,188 | 0 | 0 | 1 | 1 |
Well I want to use WEb2Py because it's pretty nice..
I just need to change the working directory to the directory where all my modules/libraries/apps are so i can use them. I want to be able to import my real program when I use the web2py interface/applications. I need to do this instead of putting all my apps and stuff inside the Web2Py folder... I'm trying to give my program a web frontend without putting the program in the Web2Py folder.. Sorry if this is hard to understand .
|
Web2py Import Once per Session
| 1,980,510 | 6 | 4 | 953 | 0 |
python,web2py
|
In web2py your models and controllers are executed, not imported. They are executed every time a request arrives. If you press the button [compile] in admin, they will be bytecode compiled and some other optimizations are performs.
If your app (in models and controllers) does "import somemodule", then the import statement is executed at every request but "somemodule" is actually imported only the first time it is executed, as you asked.
| 0 | 0 | 1 | 0 |
2009-12-30T04:27:00.000
| 1 | 1 | false | 1,978,426 | 0 | 0 | 1 | 1 |
I'm using Web2Py and i want to import my program simply once per session... not everytime the page is loaded. is this possible ? such as "import Client" being used on the page but only import it once per session..
|
Spam Filtering Forms Without Akismet
| 1,983,179 | 1 | 4 | 394 | 0 |
python,django,spam-prevention
|
I can't think of any critically sensitive data that could be submitted by anonymous users. If the data is really sensitive (like you mentioned patient records), it is probably submitted by known and registered user so you should do manual approval of new users and protect the registration part from spammers.
| 0 | 0 | 0 | 0 |
2009-12-30T20:24:00.000
| 2 | 0.099668 | false | 1,982,277 | 0 | 0 | 1 | 1 |
I'm curious if anyone out there knows of something perhaps like Akismet, but where content doesn't have to go off to a 3rd party server. In a situation with critically sensitive data (patient records for instance) I wouldn't necessarily want that information sent off to another server I don't have control over. I really like Akismet, it works great for the most part. However, I need something more like a local instance of Akismet that's private, and able to be updated semi-regularly. Even better if it works with Python since I need this to interface with Django applications. Should I just go the route of SpamBayes?
|
Please discuss what are and why use portlets
| 1,985,241 | 1 | 2 | 4,765 | 0 |
java,.net,python,portlet
|
Why would I want to use java portlets above tomcat and gwt?
These technologies are not directly comparable. Coming from regular web page development, Portlets seem like a very restrictive technology. But then the value of Portal servers is largely the control they give to administrators and users - the fact that this makes your life more difficult is irrelevant.
Would portlets make it less- or un- necessary for me to use jsp and jsf?
You can write directly to the output, just like you would in a Servlet. You probably still want a view technology (that will have to support portlets).
| 0 | 0 | 0 | 0 |
2009-12-31T00:21:00.000
| 3 | 0.066568 | false | 1,983,282 | 0 | 0 | 1 | 1 |
Why would I want to use java portlets above tomcat and gwt?
Would portlets make it less- or un- necessary for me to use jsp and jsf?
Has Jboss been part of the portlet evolution culture? Does Jboss satisfy the portlet jsrs?
What portlet implementation/brand would run on gae java and gae python?
Are portlet specs due to peer pressure from php cms culture?
What are the equivalent of portlet and portlet jsr in .net?
|
Interaction between Java App and Python App
| 1,984,457 | 0 | 3 | 6,004 | 0 |
java,python,interface,interaction
|
Expose one of the two as a service of some kind, web service maybe. Another option is to port the python code to Jython
| 0 | 1 | 0 | 0 |
2009-12-31T07:52:00.000
| 6 | 0 | false | 1,984,445 | 0 | 0 | 1 | 2 |
I have a python application which I cant edit its a black box from my point of view. The python application knows how to process text and return processed text.
I have another application written in Java which knows how to collect non processed texts.
Current state, the python app works in batch mode every x minutes.
I want to make the python
processing part of the process: Java app collects text and request the python app to process and return processed text as part of a flow.
What do you think is the simplest solution for this?
Thanks,
Rod
|
Interaction between Java App and Python App
| 1,984,650 | 0 | 3 | 6,004 | 0 |
java,python,interface,interaction
|
An option is making the python application work as a server, listens for request via sockets (TCP).
| 0 | 1 | 0 | 0 |
2009-12-31T07:52:00.000
| 6 | 0 | false | 1,984,445 | 0 | 0 | 1 | 2 |
I have a python application which I cant edit its a black box from my point of view. The python application knows how to process text and return processed text.
I have another application written in Java which knows how to collect non processed texts.
Current state, the python app works in batch mode every x minutes.
I want to make the python
processing part of the process: Java app collects text and request the python app to process and return processed text as part of a flow.
What do you think is the simplest solution for this?
Thanks,
Rod
|
update django database to reflect changes in existing models
| 1,985,415 | 2 | 70 | 85,597 | 0 |
python,django,django-models
|
You need to drop your tables before you can recreate them with syncdb.
If you want to preserve your existing data, then you need to unload your database,
drop your tables, run syncdb to build a new database, then reload your old data into your new tables.
There are tools that help with this. However, in many cases, it's just as easy to do it manually.
| 0 | 0 | 0 | 0 |
2009-12-31T13:23:00.000
| 8 | 0.049958 | false | 1,985,383 | 0 | 0 | 1 | 1 |
I've already defined a model and created its associated database via manager.py syncdb. Now that I've added some fields to the model, I tried syncdb again, but no output appears. Upon trying to access these new fields from my templates, I get a "No Such Column" exception, leading me to believe that syncdb didn't actually update the database. What's the right command here?
|
Where should I place the one-time operation operation in the Django framework?
| 1,986,323 | 0 | 3 | 781 | 0 |
python,django
|
__init__.py will be called every time the app is imported. So if you're using mod_wsgi with Apache for instance with the prefork method, then every new process created is effectively 'starting' the project thus importing __init__.py. It sounds like your best method would be to create a new management command, and then cron that up to run every so often if that's an option. Either that, or run that management command before starting the server. You could write up a quick script that runs that management command and then starts the server for instance.
| 0 | 0 | 0 | 0 |
2009-12-31T16:38:00.000
| 4 | 0 | false | 1,986,060 | 0 | 0 | 1 | 2 |
I want to perform some one-time operations such as to start a background thread and populate a cache every 30 minutes as initialize action when the Django server is started, so it will not block user from visiting the website. Where should I place all this code in Django?
Put them into the setting.py file does not work. It seems it will cause a circular dependency.
Put them into the __init__.py file does not work. Django server call it many times (What is the reason?)
|
Where should I place the one-time operation operation in the Django framework?
| 1,986,926 | 4 | 3 | 781 | 0 |
python,django
|
We put one-time startup scripts in the top-level urls.py. This is often where your admin bindings go -- they're one-time startup, also.
Some folks like to put these things in settings.py but that seems to conflate settings (which don't do much) with the rest of the site's code (which does stuff).
| 0 | 0 | 0 | 0 |
2009-12-31T16:38:00.000
| 4 | 0.197375 | false | 1,986,060 | 0 | 0 | 1 | 2 |
I want to perform some one-time operations such as to start a background thread and populate a cache every 30 minutes as initialize action when the Django server is started, so it will not block user from visiting the website. Where should I place all this code in Django?
Put them into the setting.py file does not work. It seems it will cause a circular dependency.
Put them into the __init__.py file does not work. Django server call it many times (What is the reason?)
|
Django: signal when user logs in?
| 1,991,497 | 0 | 84 | 38,642 | 0 |
python,django,login,signals
|
Rough idea - you could use middleware for this. This middleware could process requests and fire signal when relevant URL is requested. It could also process responses and fire signal when given action actually succeded.
| 0 | 0 | 0 | 0 |
2010-01-02T03:19:00.000
| 7 | 0 | false | 1,990,502 | 0 | 0 | 1 | 2 |
In my Django app, I need to start running a few periodic background jobs when a user logs in and stop running them when the user logs out, so I am looking for an elegant way to
get notified of a user login/logout
query user login status
From my perspective, the ideal solution would be
a signal sent by each django.contrib.auth.views.login and ... views.logout
a method django.contrib.auth.models.User.is_logged_in(), analogous to ... User.is_active() or ... User.is_authenticated()
Django 1.1.1 does not have that and I am reluctant to patch the source and add it (not sure how to do that, anyway).
As a temporary solution, I have added an is_logged_in boolean field to the UserProfile model which is cleared by default, is set the first time the user hits the landing page (defined by LOGIN_REDIRECT_URL = '/') and is queried in subsequent requests. I added it to UserProfile, so I don't have to derive from and customize the builtin User model for that purpose only.
I don't like this solution. If the user explicitely clicks the logout button, I can clear the flag, but most of the time, users just leave the page or close the browser; clearing the flag in these cases does not seem straight forward to me. Besides (that's rather data model clarity nitpicking, though), is_logged_in does not belong in the UserProfile, but in the User model.
Can anyone think of alternate approaches ?
|
Django: signal when user logs in?
| 1,991,512 | 1 | 84 | 38,642 | 0 |
python,django,login,signals
|
The only reliable way (that also detects when the user has closed the browser) is to update some last_request field every time the user loads a page.
You could also have a periodic AJAX request that pings the server every x minutes if the user has a page open.
Then have a single background job that gets a list of recent users, create jobs for them, and clear the jobs for users not present in that list.
| 0 | 0 | 0 | 0 |
2010-01-02T03:19:00.000
| 7 | 0.028564 | false | 1,990,502 | 0 | 0 | 1 | 2 |
In my Django app, I need to start running a few periodic background jobs when a user logs in and stop running them when the user logs out, so I am looking for an elegant way to
get notified of a user login/logout
query user login status
From my perspective, the ideal solution would be
a signal sent by each django.contrib.auth.views.login and ... views.logout
a method django.contrib.auth.models.User.is_logged_in(), analogous to ... User.is_active() or ... User.is_authenticated()
Django 1.1.1 does not have that and I am reluctant to patch the source and add it (not sure how to do that, anyway).
As a temporary solution, I have added an is_logged_in boolean field to the UserProfile model which is cleared by default, is set the first time the user hits the landing page (defined by LOGIN_REDIRECT_URL = '/') and is queried in subsequent requests. I added it to UserProfile, so I don't have to derive from and customize the builtin User model for that purpose only.
I don't like this solution. If the user explicitely clicks the logout button, I can clear the flag, but most of the time, users just leave the page or close the browser; clearing the flag in these cases does not seem straight forward to me. Besides (that's rather data model clarity nitpicking, though), is_logged_in does not belong in the UserProfile, but in the User model.
Can anyone think of alternate approaches ?
|
Role of C,C++,python,perl in Web development
| 1,991,076 | 10 | 0 | 719 | 0 |
c++,python,c,perl
|
All languages can all do basically any task any other one of them can do, as they are all Turing complete.
PHP works as a server-side scripting language, but you can also use Perl, Python, Ruby, Haskell, Lisp, Java, C, C++, assembly, or pretty much any other language that can access standard input and standard output for CGI communication with web content.
PHP is widely used because a) it's easy to learn a little and go, and b) the rather tedious CGI protocols are skipped, as the language handles them for you, so you can just plug your PHP script into an HTML page and not have to know how your program reads the information at all. This makes web programming easier for PHP, but the PHP interpreter is written in C, which does all the heavy lifting, so logically if PHP can do server-side scripting, so can C. Since most other languages are written in C, they too can do server-side scripting. (And since C compiles down to assembly, assembly can do it too, and so can any language that compiles down to assembly. Which is all of them not already covered.)
| 0 | 0 | 0 | 1 |
2010-01-02T09:14:00.000
| 4 | 1.2 | true | 1,991,065 | 0 | 0 | 1 | 1 |
Please bear with me experts i'm a newbie in web dev.
With html,css can take care of webpages..
javascript,ajax for some dynamic content..
php for server side scripting,accessing databases,sending emails,doing all other stuf...
What role do these programming languages play?
Can they do any other important task which cannot be done by PHP?
|
How does Django + mod_wsgi affect the python path?
| 1,991,778 | 2 | 1 | 927 | 0 |
python,django,apache,mod-wsgi
|
I think the problem is related with the permissions of that file. Check that the user running wsgi (apache user, usually) is capable of reading and writing the everything in the libs folder and specially capable of reading the file pywapi.py.
| 0 | 0 | 0 | 1 |
2010-01-02T14:29:00.000
| 1 | 1.2 | true | 1,991,743 | 0 | 0 | 1 | 1 |
I have a simple setup with my python libraries in /domains/somedomain.com/libs/ and all my tests run fine. I start WSGI with DJANGO_SETTINGS_MODULE to "somedomain.settings" where somedomain is a package in libs/
Suddenly, when adding pywapi.py into libs/ I can't import it when hitting the site. But, if I add 'import pywapi' to my wsgi script, it fails when hit by Apache, but succeeds if I just write it. the WSGI itself is actually adding libs/ to the path, so I know it should be there when running. The path is absolute, too, so any change in CWD shouldn't be causing this.
I can't think of anything else and I've been tinkering with it half of my otherwise productive morning.
|
how to start a thread when django runserver?
| 1,994,563 | 7 | 0 | 2,758 | 0 |
python,django,multithreading
|
Why would you want to do that? runserver is for development only, it should never be used in production. And if you're running via Apache, it should manage threads/processes for you anyway.
| 0 | 0 | 0 | 0 |
2010-01-03T10:14:00.000
| 2 | 1 | false | 1,994,507 | 0 | 0 | 1 | 2 |
I want to start a thread when django project runserver successfully.
where can I put the create-thread-and-start code? Is there any hook for the django runserver?
|
how to start a thread when django runserver?
| 1,997,921 | 0 | 0 | 2,758 | 0 |
python,django,multithreading
|
Agree with the above answer, you probably don't want to do this. Runserver should be used for development only. Once you deploy, you'll want to move to Apache/WSGI. On my dev machine (where I do use runserver), I usually throw it in a screen session, so it doesn't get in the way, but I can pull it back up if I need to see a traceback.
| 0 | 0 | 0 | 0 |
2010-01-03T10:14:00.000
| 2 | 0 | false | 1,994,507 | 0 | 0 | 1 | 2 |
I want to start a thread when django project runserver successfully.
where can I put the create-thread-and-start code? Is there any hook for the django runserver?
|
Which programming languages can I use on Android Dalvik?
| 56,733,101 | 0 | 65 | 20,672 | 0 |
java,python,android,scala,dalvik
|
1) Angular + nativeScript
2) Reactnative
| 0 | 0 | 0 | 0 |
2010-01-03T11:35:00.000
| 8 | 0 | false | 1,994,703 | 0 | 0 | 1 | 2 |
In theory, Dalvik executes any virtual machine byte code, created for example with the compilers of
AspectJ
ColdFusion
Clojure
Groovy
JavaFX Script
JRuby
Jython
Rhino
Scala
Are there already working versions of bytecode compilers for Dalvik available for other languages than Java?
|
Which programming languages can I use on Android Dalvik?
| 1,994,959 | 0 | 65 | 20,672 | 0 |
java,python,android,scala,dalvik
|
The dynamically typed languages wont be possible until Dalvik supports JIT (Just In Time) compiling. I believe there is JIT support in one of the experimental Eclair branches, but it is not yet officially available/supported in Android.
| 0 | 0 | 0 | 0 |
2010-01-03T11:35:00.000
| 8 | 0 | false | 1,994,703 | 0 | 0 | 1 | 2 |
In theory, Dalvik executes any virtual machine byte code, created for example with the compilers of
AspectJ
ColdFusion
Clojure
Groovy
JavaFX Script
JRuby
Jython
Rhino
Scala
Are there already working versions of bytecode compilers for Dalvik available for other languages than Java?
|
sharing objects between module in GAE
| 1,997,676 | 0 | 1 | 130 | 0 |
python,google-app-engine
|
Later requests that happen to be served on the same process (you can't control that) would access just the same mod1.my_data object (unless you take pains to reassign it as a fresh object at the start of each request, of course).
| 0 | 1 | 0 | 0 |
2010-01-04T05:37:00.000
| 1 | 1.2 | true | 1,997,663 | 0 | 0 | 1 | 1 |
To share a state(e.g. user) between a module in django people sometime use thread local storage, but as google app engine follows CGI standard and keeps state of a request in os.environ , can I share objects between two modules just by setting it e.g.
mod1.my_data = {} and now any other module can get handle to my_data?
without worrying about other threads/requests sharing/overwriting it?
|
Problem allocating heap space over 4 GB when calling java "from Python"
| 2,000,424 | 2 | 1 | 1,663 | 0 |
java,python,ram
|
It's hard to be sure without knowing more detail - like which OS you're on - but my guess is that you're using a 32-bit version of Python which means that when you launch Java, you're also getting the 32-bit version which has a heap size limit of 4GB.
To test if this is the case, compare the output of java -version when run from the command line and when run from your Python script.
| 0 | 1 | 0 | 0 |
2010-01-04T15:52:00.000
| 3 | 1.2 | true | 2,000,331 | 0 | 0 | 1 | 2 |
I am using using os.system call from python to run jar file.
The jar file requires large heap space and thus i am allocating 4 Gb heap space using Xmx.
When i execute the command
"java -Xms4096m -Xmx4096m -jar camXnet.jar net.txt"
from command line it executes properly, however when i call it from a python program via os.system, it works only if memory allocated is less than 4Gb, otherwise it fails to execute.
Any solutions?
By fails to execute i mean that A command window appears indicating that os.system has been called and then it disappears, i will check for the error code if any being returned. however no problems are encountered if xmx,xms are set to lower value.
Ok i checked both version and there is a difference The one being called via python is Java HotSpot Client VM mixed mode,sharing while one being called via normal command line is Java HotSpot 64 bit server
How do make os.system in python call the correct one that is the 64 bit server.
UPDATE: I tried using subprocess module as yet the version of java return is same as that from os.system
|
Problem allocating heap space over 4 GB when calling java "from Python"
| 2,122,159 | 1 | 1 | 1,663 | 0 |
java,python,ram
|
I was having the same problem launching 64bit Java from 32bit python. I solved the problem using Dave Webb's suggestiong of putting the full path to 64bit Java.exe in the python script. This worked fine so it is not necessary to use 64 bit Python
| 0 | 1 | 0 | 0 |
2010-01-04T15:52:00.000
| 3 | 0.066568 | false | 2,000,331 | 0 | 0 | 1 | 2 |
I am using using os.system call from python to run jar file.
The jar file requires large heap space and thus i am allocating 4 Gb heap space using Xmx.
When i execute the command
"java -Xms4096m -Xmx4096m -jar camXnet.jar net.txt"
from command line it executes properly, however when i call it from a python program via os.system, it works only if memory allocated is less than 4Gb, otherwise it fails to execute.
Any solutions?
By fails to execute i mean that A command window appears indicating that os.system has been called and then it disappears, i will check for the error code if any being returned. however no problems are encountered if xmx,xms are set to lower value.
Ok i checked both version and there is a difference The one being called via python is Java HotSpot Client VM mixed mode,sharing while one being called via normal command line is Java HotSpot 64 bit server
How do make os.system in python call the correct one that is the 64 bit server.
UPDATE: I tried using subprocess module as yet the version of java return is same as that from os.system
|
Does Django need an IDE?
| 2,001,956 | 8 | 8 | 3,510 | 0 |
python,django
|
I would pay a reasonable amount for a Django-tailored IDE or plug-in. I don't know what I mean by reasonable, but maye it helps to know that I would not pay more than $75, and I would only pay the $75 if the tool was really awesome.
Now, Django specific features:
Seamless integration with Google Apps
(get me the urchin, the license for
Google Maps, and put it in my
templates)
Full support for the templating engine (details in the other answers you have received)
Lorem ipsum generation (Django has it, just make it simpler)
Prepackaged modules for common tasks (e.g. give me a full login page with template an all)
Link within the code for Django documentation and examples (e.g. Django snippets)
One-click for multi-browser comparison
Full CSS support
An object explorer (along the lines of the Django-admin, but off-line)
A color palette with cool combinations (say, blue-based, orange-based)
Wizard for uploading the local project to Webfaction or similar hosting solution
If I can think of anything else I will edit the answer.
Good luck in designing your product!
| 0 | 0 | 0 | 0 |
2010-01-04T16:39:00.000
| 9 | 1 | false | 2,000,631 | 0 | 0 | 1 | 6 |
My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing currently in your development tools?
|
Does Django need an IDE?
| 2,012,679 | 0 | 8 | 3,510 | 0 |
python,django
|
I would definitely pay or donate for a pure Django IDE, even tho there are already some existing plugins, I feel something is always "floating".
| 0 | 0 | 0 | 0 |
2010-01-04T16:39:00.000
| 9 | 0 | false | 2,000,631 | 0 | 0 | 1 | 6 |
My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing currently in your development tools?
|
Does Django need an IDE?
| 2,001,415 | 1 | 8 | 3,510 | 0 |
python,django
|
It's great that your company wants to contribute to the community, but I have to say that I don't see what a 'Django IDE' would achieve. There are already plugins for all the main editors and IDEs to support Django - from Vim to TextMate to NetBeans - and these provide syntax highlighting, indentation, shortcuts and snippets for both Python source and Django templates. These can always do with more work, of course, so perhaps your efforts would be best focused on improving one of these.
| 0 | 0 | 0 | 0 |
2010-01-04T16:39:00.000
| 9 | 1.2 | true | 2,000,631 | 0 | 0 | 1 | 6 |
My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing currently in your development tools?
|
Does Django need an IDE?
| 2,000,657 | 2 | 8 | 3,510 | 0 |
python,django
|
I use NotePad++, and have yet to need a fully-fledged IDE specifically for Django (though I do wish NotePad++ would stop periodically crashing).
I wouldn't, unless it was really really good (and I have no idea what features it'd need to make me enthusiastic enough to pay for it).
Maybe a neater way to tie together code for a specific app within a project (models, views and template code). NotePad++'s File->Open dialog is the Windows one, which picks up the directory from the currently open file. It'd be nice if it allowed me to switch quickly between related files.
| 0 | 0 | 0 | 0 |
2010-01-04T16:39:00.000
| 9 | 0.044415 | false | 2,000,631 | 0 | 0 | 1 | 6 |
My company is evaluating the possibility of developing a specialized IDE for Django.
So we would like to ask Django users:
Do you feel the need for a specialized IDE for Django?
Would you be willing to pay for it, or would you only consider free a open-source product?
What Django-specific features are you missing currently in your development tools?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.