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
Python3:Save File to Specified Location
4,093,406
0
0
2,983
0
python
I'll admit I don't know Python 3, so I may be wrong, but in Python 2, you can just check the __file__ variable in your module to get the name of the file it was loaded from. Just create your file in that same directory (preferably using os.path.dirname and os.path.join to remain platform-independent).
0
0
0
0
2010-11-04T02:22:00.000
2
0
false
4,093,387
0
0
1
1
I have a rather simple program that writes HTML code ready for use. It works fine, except that if one were to run the program from the Python command line, as is the default, the HTML file that is created is created where python.exe is, not where the program I wrote is. And that's a problem. Do you know a way of getting the .write() function to write a file to a specific location on the disc (e.g. C:\Users\User\Desktop)? Extra cool-points if you know how to open a file browser window.
Django is returning RuntimeError instead of 404
4,096,820
0
0
425
0
python,django,http-status-code-404,runtime-error
try not loading all middleware modules, just comment them all in the settings and see if the problem is somewhere there.
0
0
0
0
2010-11-04T03:00:00.000
2
0
false
4,093,541
0
0
1
1
In my Django project I am having RUntimeError when I'm supposed to get a 404. The description says: Exception Value: maximum recursion depth exceeded The error only occurs when I try to access a non-existent page (the correct result would be a 404 page isn't it?). Is this a Django bug or is it my fault? I will provide more information if needed. EDIT: I have tried syncing the database (actually drop the database and sync it from scratch), restarting the server and even commenting out all the urlpatterns in all urls.py files. EDIT: This is what the traceback looks like: File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in get_response 83. request.path_info) File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py" in resolve 218. sub_match = pattern.resolve(new_path) File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py" in resolve 218. sub_match = pattern.resolve(new_path) File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py" in resolve 218. sub_match = pattern.resolve(new_path) And the last few lines are: File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py" in resolve 218. sub_match = pattern.resolve(new_path) File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py" in resolve 216. for pattern in self.url_patterns: File "/usr/lib/pymodules/python2.6/django/core/urlresolvers.py" in _get_url_patterns 245. patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
Pyjamas framework significance
4,094,232
3
8
1,188
0
python,pyjamas
GWT and Pyjamas were created to remove the drugery of coding Javascript and compensating for all of the different browser implementations and object models. Yes, you still need a designer. Yes, you can code in python and not have to learn Javascript (in theory). No, you won't have to recode to work around "features" of the Javascript implementations in new browsers or old browsers.
0
0
0
0
2010-11-04T04:49:00.000
1
1.2
true
4,093,982
0
0
1
1
I am learning Pyjamas framework of python to generate the frontend which is basically a javascript code generated by Pyjamas. Though, being a new concept and a GWT equivalent in python I am interested in learning it, but I can not really find out what is the actual significance of it? I mean we are coding in python, compiling the code and generating javascript, which allows us to put CSS classes with the code. So, basically it does not removes the need of a designer as well. Also, is it a good idea to use Pyjamas with Django? Please suggest. Thanks in advance
How to use Django to get the name for the host server?
4,094,037
6
66
62,436
0
python,django,url,host
Try os.environ.get('HOSTNAME')
0
0
0
0
2010-11-04T04:56:00.000
9
1
false
4,093,999
0
0
1
2
How to use Django to get the name for the host server? I need the name of the hosting server instead of the client name?
How to use Django to get the name for the host server?
54,194,805
4
66
62,436
0
python,django,url,host
Basically, You can take with request.get_host() in your view/viewset. It returns <ip:port>
0
0
0
0
2010-11-04T04:56:00.000
9
0.088656
false
4,093,999
0
0
1
2
How to use Django to get the name for the host server? I need the name of the hosting server instead of the client name?
Google App Engine gives spurious content at beginning of page after quiescent period
4,098,417
6
1
108
0
python,google-app-engine
Somewhere in your top level module code is something that uses Python print statements. Print outputs to standard out, which is what is returned as the response body; if it outputs a pair of newlines, the content before that is treated by the browser as the response header. The 'junk' you're seeing is the real response headers being produced by your webapp. It's only happening on startup requests, because that's the only time the code in question gets executed.
0
1
0
0
2010-11-04T15:15:00.000
1
1.2
true
4,098,119
0
0
1
1
I'm developing an app in Python for Google App Engine. When I run the deployed app from appspot, it works fine unless I'm accessing it for the first time in over, say, 5 minutes. The problem is that if I haven't accessed the app for a while, the page renders with the message Status: 200 OK Content-Type: text/html; charset=utf-8 Cache-Control: no-cache Expires: Fri, 01 Jan 1990 00:00:00 GMT Content-Length: 15493 prepended at the top. Usually that text is displayed for a second or two before the rest of the page is displayed. If I check the server Logs, I see the info message This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. The problem is easily corrected by refreshing the page. In this case, the page is delivered correctly, and works for subsequent refreshes. But if I wait 5 minutes, the problem comes back. Any explanations, or suggestions on how to troubleshoot this? I've got a vague notion that when GAE "wakes up" after being inactive, there is an incorrect initialization going on. Or perhaps a header from a previous bout of activity is lingering in a buffer somewhere. But self.response.out seems to be empty when the request handler is invoked.
Best Practice for dealing with app engine cold start problem
4,105,029
6
3
364
0
python,google-app-engine
Reduce the set of libraries you require in order to serve requests as much as you can. For expensive libraries that are only used in some places, put the import statement inside the function that uses them. This way, the library is only imported the first time it's needed. If your framework supports it, do just-in-time importing of handlers, so you don't have to import them all when your app starts up. Look forward to reserved instances / warmup requests, coming soon!
0
1
0
0
2010-11-05T09:36:00.000
1
1.2
true
4,104,751
0
0
1
1
After a period of inactivity the first request takes about 5 to 10 secs to come through. Is there any best practice solutions to overcome this problem? I'm using Python version of App Engine.
DOJO AJAX Request asking for OPTIONS
5,576,563
1
1
2,060
0
javascript,python,ajax,dojo
My guess would be you are serving these two apps locally via 2 different ports, which is making dojo try to execute a cross-domain XHR call. You need to be able to serve the JSON URL from the same URL (protocol, hostname, & port) to make a successful XHR call. I do this by using nginx locally, and configuring it to serve the database requests from my Dojo application by forwarding them to CouchDB.
0
0
1
0
2010-11-05T15:50:00.000
2
0.099668
false
4,107,576
0
0
1
1
I have exposed a simple RESTful JSON url via CherryPy (Python web framework). I have a second application (using Pylons) which needs to reach a URL exposed by CherryPy. Both are being served via localhost. Both URLs resolve just fine when using a browser directly. But, when a DOJO script running from the initial Pylons request invokes the JSON url from CherryPy, it fails. I open LiveHeaders in Firefox and find that DOJO is first sending an HTTP "OPTIONS" request. CherryPy refuses the OPTIONS request with a 405, Method Not Allowed and it all stops. If I drop this same page into the CherryPy application, all is well. What is the best way to resolve this on my localhost dev platform? .... and will this occur in Prod?
Django Question
4,107,663
0
0
101
0
python,django
Put the poll page in its own view, connect to the view via urls.py, and set up your frame or iframe to source from that URL.
0
0
0
0
2010-11-05T15:57:00.000
2
0
false
4,107,644
0
0
1
1
Can you take things like the poll app from the tutorial and display them in an iframe or frameset? The tutorial is great and the app is very nice, but, how often do you go to a site with a whole page dedicated to a poll? I was trying to think about how you do it using the urls.py file, but couldn't wrap my head around it. Just wondering if anyone has done this or knows of any tutorials that cover this issue? Thanks.
Django Nonrel - Can't log into Admin Panel on development server
6,106,025
1
1
1,404
0
python,django,django-admin,django-nonrel
UPDATE - turn off the server, run python2.5 manage.py syncdb, and add a fresh superuser. Must already have included django.contrib.admin to INSTALLED_APPS This is not at all the answer. Completely different symptoms. I will try to remember to post here when I figure it out.
0
0
0
0
2010-11-05T17:04:00.000
2
0.099668
false
4,108,214
0
0
1
1
Bit of a strange one. I've created a super user for django admin for my app, which is just a new django nonrel project with admin enabled. I try and access the /admin whilst running the development server, but when I type in the (correct) username and password it tells me they are not correct. Deploying the project to Google App Engine, the login works fine. Why would it work fine on Googles servers, but not on the development server?
Django's introspecting administrator: How does it work?
4,108,925
4
0
91
0
python,django
With Django it's a bit more than introspection actually. The models use a metaclass to register themselves, I will spare you the complexities of everything involved but the admin does not introspect the models as you browse through it. Instead, the registering process creates a _meta object on the model with all the data needed for the admin and ORM. You can see the ModelBase metaclass in django/db/models/base.py, as you can see in the __new__ function it walks through all the fields to add them to the _meta object. The _meta object itself is generated dynamically using the Meta class definition on the model. You can see the result with print SomeModel._meta or print SomeModel._meta.fields
0
0
0
0
2010-11-05T18:22:00.000
3
1.2
true
4,108,852
0
0
1
1
I don't really want to know Django I am actually more interested in the administrator. The thing that interests me is how they introspect the models to create the administrator back-end. I browsed through the Django source code and found a little info but since it's such a big project I was wondering if there are smaller examples of how they do it? This is just a personal project to get to understand Python better. I thought that learning about introspecting objects would be a good way to do this.
Where should I put configuration details? [Python]
4,109,559
1
1
189
0
python,django
It's for any type of settings, but it's better to put local settings in a separate file so that version upgrades don't clobber them. Have the global settings file detect the presence of the local settings file and then either import everything from it or just execfile() it.
0
0
0
0
2010-11-05T19:57:00.000
3
0.066568
false
4,109,532
0
0
1
1
I'm fairly new to Python and Django, and I'm working on a webapp now that will be run on multiple servers. Each server has it's own little configuration details (commands, file paths, etc.) that I would like to just be able to store in a settings file, and then have a different copy of the file on each system. I know that in Django, there's a settings file. However, is that only for Django-related things? Or am I supposed to put this type of stuff in there too?
Get a list of all installed applications in Django and their attributes
4,111,263
9
48
53,093
0
python,django,django-models
The list of installed applications is defined in settings.INSTALLED_APPS. It contains a tuple of strings, so you can iterate on it to access each application's name. However, I'm not sure what you mean by each application's attributes and fields.
0
0
0
0
2010-11-06T00:39:00.000
7
1
false
4,111,244
1
0
1
1
In my Django website, I'm creating a class that interact dynamically with other applications installed in the website. I have to do a manipulation on each field of each application. So I want to save the name of all installed applications in a list and get the attributes of each one. There is a way to do that using an iterator or something else ?
Better ways to handle AppEngine requests that time out?
4,112,279
1
1
264
0
python,google-app-engine
I have been handling something similar by building a custom automatic retry dispatcher on the client. Whenever an ajax call to the server fails, the client will retry it. This works very well if your page is ajaxy. If your app spits entire HTML pages then you can use a two pass process: first send an empty page containing only an ajax request. Then, when AppEngine receives that ajax request, it outputs the same HTML you had before. If the ajax call succeeds it fills the DOM with the result. If it fails, it retries once.
0
1
0
0
2010-11-06T06:46:00.000
2
0.099668
false
4,112,235
0
0
1
2
Sometimes, with requests that do a lot, Google AppEngine returns an error. I have been handling this by some trickery: memcaching intermediate processed data and just requesting the page again. This often works because the memcached data does not have to be recalculated and the request finishes in time. However... this hack requires seeing an error, going back, and clicking again. Obviously less than ideal. Any suggestions? inb4: "optimize your process better", "split your page into sub-processes", and "use taskqueue". Thanks for any thoughts. Edit - To clarify: Long wait for requests is ok because the function is administrative. I'm basically looking to run a data-mining function. I'm searching over my datastore and modifying a bunch of objects. I think the correct answer is that AppEngine may not be the right tool for this. I should be exporting the data to a computer where I can run functions like this on my own. It seems AppEngine is really intended for serving with lighter processing demands. Maybe the quota/pricing model should offer the option to increase processing timeouts and charge extra.
Better ways to handle AppEngine requests that time out?
4,117,235
1
1
264
0
python,google-app-engine
If interactive user requests are hitting the 30 second deadline, you have bigger problems: your user has almost certainly given up and left anyway. What you can do depends on what your code is doing. There's a lot to be optimized by batching datastore operations, or reducing them by changing how you model your data; you can offload work to the Task Queue; for URLFetches, you can execute them in parallel. Tell us more about what you're doing and we may be able to provide more concrete suggestions.
0
1
0
0
2010-11-06T06:46:00.000
2
1.2
true
4,112,235
0
0
1
2
Sometimes, with requests that do a lot, Google AppEngine returns an error. I have been handling this by some trickery: memcaching intermediate processed data and just requesting the page again. This often works because the memcached data does not have to be recalculated and the request finishes in time. However... this hack requires seeing an error, going back, and clicking again. Obviously less than ideal. Any suggestions? inb4: "optimize your process better", "split your page into sub-processes", and "use taskqueue". Thanks for any thoughts. Edit - To clarify: Long wait for requests is ok because the function is administrative. I'm basically looking to run a data-mining function. I'm searching over my datastore and modifying a bunch of objects. I think the correct answer is that AppEngine may not be the right tool for this. I should be exporting the data to a computer where I can run functions like this on my own. It seems AppEngine is really intended for serving with lighter processing demands. Maybe the quota/pricing model should offer the option to increase processing timeouts and charge extra.
Python html parsing that actually works
4,115,108
5
15
3,978
0
python,html,parsing
html5lib cannot parse half of what's "out there" That sounds extremely implausible. html5lib uses exactly the same algorithm that's also implemented in recent versions of Firefox, Safari and Chrome. If that algorithm broke half the web, I think we would have heard. If you have particular problems with it, do file bugs.
0
0
1
0
2010-11-06T19:17:00.000
5
0.197375
false
4,114,722
0
0
1
2
I'm trying to parse some html in Python. There were some methods that actually worked before... but nowadays there's nothing I can actually use without workarounds. beautifulsoup has problems after SGMLParser went away html5lib cannot parse half of what's "out there" lxml is trying to be "too correct" for typical html (attributes and tags cannot contain unknown namespaces, or an exception is thrown, which means almost no page with Facebook connect can be parsed) What other options are there these days? (if they support xpath, that would be great)
Python html parsing that actually works
4,114,746
1
15
3,978
0
python,html,parsing
I think the problem is that most HTML is ill-formed. XHTML tried to fix that, but it never really caught on enough - especially as most browsers do "intelligent workarounds" for ill-formed code. Even a few years ago I tried to parse HTML for a primitive spider-type app, and found the problems too difficult. I suspect writing your own might be on the cards, although we can't be the only people with this problem!
0
0
1
0
2010-11-06T19:17:00.000
5
0.039979
false
4,114,722
0
0
1
2
I'm trying to parse some html in Python. There were some methods that actually worked before... but nowadays there's nothing I can actually use without workarounds. beautifulsoup has problems after SGMLParser went away html5lib cannot parse half of what's "out there" lxml is trying to be "too correct" for typical html (attributes and tags cannot contain unknown namespaces, or an exception is thrown, which means almost no page with Facebook connect can be parsed) What other options are there these days? (if they support xpath, that would be great)
Recommendations for a Python library that can capture still images from a Flash/HTML5 video?
4,134,375
1
4
835
0
python,flash,html5-video,screen-capture,image-capture
What about capturing it inside Flash and sending it as BiteArray to the server?
0
0
0
0
2010-11-09T02:01:00.000
2
0.099668
false
4,129,858
0
0
1
1
Part of a web application I am developing requires the ability to capture still images from a Flash or HTML5 video playing with in a browser. Is there a Python library out there that could help me along with this task? UPDATE Actually, users of this web app will also have to have the ability to Draw a crop box on top of the Flash/HTML5 video player Be able to resize that box if necessary Capture the image with in the crop box frame Have that image be saves and sent to the server Also, this video image crop/capture tool will also have to be restricted to the perimeter of the video frame. I don't want users getting confused and potentially capturing an image outside of the video frame because all we are concerned about is the content of the video.
How should I do full-text searching on App Engine?
5,072,790
0
7
1,246
0
python,google-app-engine,search,full-text-search,full-text-indexing
GAE has announced plans to offer full-text searching natively in the Datastore soon.
0
1
0
1
2010-11-09T05:36:00.000
2
1.2
true
4,130,813
0
0
1
1
What should I do for fast, full-text searching on App Engine with as little work as possible (and as little Java — I’m doing Python.)?
Where are some good places to reach great Django developers?
4,131,110
3
1
179
0
python,django
I'm partial to the #django channel on Freenode's IRC server. A few big names in the Django community hang around there. ( irc://irc.freenode.net/#django since SO's Markdown processor doesn't like irc:// in URLs)
0
0
0
0
2010-11-09T06:38:00.000
3
0.197375
false
4,131,096
0
0
1
1
Are there communities where expert Django developers (ideally looking for jobs) like to hang out? Stackoverflow excluded :)
What are the best uses for the Django Admin app?
4,131,152
2
0
170
0
python,django,admin
Let's say you create a model called Entry. IE an extremely simple blog. You write a view to show all the entries on the front page. Now how do you put those entries on the webpage? How do you edit them? Enter the admin. You register your model with the admin, create a superuser and log in to your running webapp. It's there, with a fully functional interface for creating the entries.
0
0
0
0
2010-11-09T06:42:00.000
2
0.197375
false
4,131,120
0
0
1
2
On the website, it says this: One of the most powerful parts of Django is the automatic admin interface. It reads metadata in your model to provide a powerful and production-ready interface that content producers can immediately use to start adding content to the site. In this document, we discuss how to activate, use and customize Django’s admin interface.admin interface. So what? I still don't understand what the Admin interface is used for. Is it like a PHPMYADMIN? Why would I ever need this?
What are the best uses for the Django Admin app?
4,131,237
1
0
170
0
python,django,admin
Some of the uses I can think of - Editing data or Adding data. If you have any sort of data entry tasks, the admin app handles it like a breeze. Django’s admin especially shines when non-technical users need to be able to enter data. If you have understood above point, then this makes it possible for programmers to work along with designers and content producers! Permissions - An admin interface can be used to give permissions, create groups with similar permissions, make more than one administrators etc. (i.e. if you have a login kinda site). Inspecting data models - when I have defined a new model, I call it up in the admin and enter some dummy data. Managing acquired data - basically what a moderator does in case of auto-generated content sites. Block out buggy features - Also if you tweak it a little, you can create an interface wherein say some new feature you coded is buggy. You could disable it from admin interface. Think of the power this gives in a big organization where everyone need not know programming.
0
0
0
0
2010-11-09T06:42:00.000
2
0.099668
false
4,131,120
0
0
1
2
On the website, it says this: One of the most powerful parts of Django is the automatic admin interface. It reads metadata in your model to provide a powerful and production-ready interface that content producers can immediately use to start adding content to the site. In this document, we discuss how to activate, use and customize Django’s admin interface.admin interface. So what? I still don't understand what the Admin interface is used for. Is it like a PHPMYADMIN? Why would I ever need this?
Handling and securing server functions in an ajax request..python
4,131,349
2
1
280
0
python,ajax,dojo,flask
No any special secure actions required. Consider ajax request as any other client request.
0
0
1
0
2010-11-09T07:24:00.000
1
1.2
true
4,131,327
0
0
1
1
Hi I am trying to secure a server function being used for an Ajax request, so that the function is not accessed for any sort of malicious activity. I have done the following till now:- I am checking whether a valid session is present while the function is being called. I am using POST rather than GET I look for specific headers by using request.is_xhr else I induce a redirect. I have compressed the javascript using dojo shrinksafe(..i am using dojo..) What else can and should be done here. Need your expert advice on this. (NB-I am using Flask and Dojo)
Django Admin - Disable the 'Add' action for a specific model
20,106,343
10
182
61,849
0
python,django,django-admin
By default syncdb creates 3 security permissions for each model: Create (aka add) Change Delete If your logged in as Admin, you get EVERYTHING no matter what. But if you create a new user group called "General Access" (for example) then you can assign ONLY the CHANGE and DELETE permissions for all of your models. Then any logged in user that is a member of that group will not have "Create" permission, nothing related to it will show on the screen.
0
0
0
0
2010-11-10T11:18:00.000
5
1
false
4,143,886
0
0
1
1
I have a django site with lots of models and forms. I have many custom forms and formsets and inlineformsets and custom validation and custom querysets. Hence the add model action depends on forms that need other things, and the 'add model' in the django admin throughs a 500 from a custom queryset. Is there anyway to disable the 'Add $MODEL' functionality for a certain models? I want /admin/appname/modelname/add/ to give a 404 (or suitable 'go away' error message), I don't want the 'Add $MODELNAME' button to be on /admin/appname/modelname view. Django admin provides a way to disable admin actions (http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#disabling-actions) however the only action for this model is 'delete_selected'. i.e. the admin actions only act on existing models. Is there some django-esque way to do this?
Dynamic images resizing
4,149,206
4
2
375
0
php,javascript,jquery,python
Well, for resizing it would of course be better to use GD... But indexed, I think. So that you have an upload script that automatically generates the images' in other sizes, and saves them somewhere. However, it matters whether you have more disk space, or performance... Performance would get worse IF you have many people viewing these images. Disk space would get worse IF you have A LOT of these images.
0
0
0
0
2010-11-10T21:11:00.000
5
0.158649
false
4,149,112
0
0
1
1
I'm working on project where we are trying to adopt and resize template images to the various resolutions. For example if the website is viewed in 800px width (800x600) and 1024px width or larger the image size should be viewed in same quality. I've had in mind to use sprite with 3 types of images for each range of this template , but I'm looking for other ideas , php gd maybe ? Any python solution ?
How can I access any element in a web page with Python?
4,149,742
0
0
178
0
python,cgi,html-parsing
You can access only data, posted by form (or as GET parameters). So, you can extract data you need using JavaScript and post it through form
0
0
1
0
2010-11-10T22:07:00.000
4
0
false
4,149,598
0
0
1
1
I would like to access any element in a web page. I know how to do that when I have a form (form = cgi.FieldStorage()), but not when I have, for example, a table. How can I do that? Thanks
How can I capture all of the python log records generated during the execution of a series of Celery tasks?
4,440,220
0
5
1,306
0
python,logging,message-queue,task,celery
It sounds like some kind of 'watcher' would be ideal. If you can watch and consume the logs as a stream you could slurp the results as they come in. Since the watcher would be running seperately and therefore have no dependencies with respect to what it is watching I believe this would satisfy your requirements for a non-invasive solution.
0
1
0
0
2010-11-11T20:03:00.000
3
0
false
4,158,758
0
0
1
1
I want to convert my homegrown task queue system into a Celery-based task queue, but one feature I currently have is causing me some distress. Right now, my task queue operates very coarsely; I run the job (which generates data and uploads it to another server), collect the logging using a variant on Nose's log capture library, and then I store the logging for the task as a detailed result record in the application database. I would like to break this down as three tasks: collect data upload data report results (including all logging from the preceding two tasks) The real kicker here is the logging collection. Right now, using the log capture, I have a series of log records for each log call made during the data generation and upload process. These are required for diagnostic purposes. Given that the tasks are not even guaranteed to run in the same process, it's not clear how I would accomplish this in a Celery task queue. My ideal solution to this problem will be a trivial and ideally minimally invasive method of capturing all logging during the predecessor tasks (1, 2) and making it available to the reporter task (3) Am I best off remaining fairly coarse-grained with my task definition, and putting all of this work in one task? or is there a way to pass the existing captured logging around in order to collect it at the end?
AJAX and browser GET calls appear to have different cookies
4,164,056
2
0
90
0
javascript,python,ajax,google-app-engine,jquery
Stupid me... The ajax call was to localhost/broadcast and the browser address field was 127.0.0.1/broadcast ... the cookies for "different" domains ('127.0.0.1' != 'localhost') are not shared ofcourse... Then I haven't gone mad...
0
0
1
0
2010-11-12T10:37:00.000
1
1.2
true
4,163,748
0
0
1
1
I have 2 pages, a static html page and a python script - hosted on [local] google app engine. /html/hello.html define as login: required /broadcast which is a python script when I access hello.html for the first time I am redirected to login page, I sign in, and then redirected back to hello.html. inside hello.html - an AJAX call with jQuery is executed to load data from '/broadcast', this call errors saying 'you're not logged in'! BUT - the same call to '/broadcast' through the browser address field succeeds as if I AM signed in! as if the ajax and the browser callers have different cookies!?? HELP, am I going bananas?
How to efficiently manage frequent schema changes using sqlalchemy?
4,165,496
16
63
32,073
1
python,sqlalchemy,pylons,data-migration,migrate
What we do. Use "major version"."minor version" identification of your applications. Major version is the schema version number. The major number is no some random "enough new functionality" kind of thing. It's a formal declaration of compatibility with database schema. Release 2.3 and 2.4 both use schema version 2. Release 3.1 uses the version 3 schema. Make the schema version very, very visible. For SQLite, this means keep the schema version number in the database file name. For MySQL, use the database name. Write migration scripts. 2to3.py, 3to4.py. These scripts work in two phases. (1) Query the old data into the new structure creating simple CSV or JSON files. (2) Load the new structure from the simple CSV or JSON files with no further processing. These extract files -- because they're in the proper structure, are fast to load and can easily be used as unit test fixtures. Also, you never have two databases open at the same time. This makes the scripts slightly simpler. Finally, the load files can be used to move the data to another database server. It's very, very hard to "automate" schema migration. It's easy (and common) to have database surgery so profound that an automated script can't easily map data from old schema to new schema.
0
0
0
0
2010-11-12T14:08:00.000
4
1
false
4,165,452
0
0
1
1
I'm programming a web application using sqlalchemy. Everything was smooth during the first phase of development when the site was not in production. I could easily change the database schema by simply deleting the old sqlite database and creating a new one from scratch. Now the site is in production and I need to preserve the data, but I still want to keep my original development speed by easily converting the database to the new schema. So let's say that I have model.py at revision 50 and model.py a revision 75, describing the schema of the database. Between those two schema most changes are trivial, for example a new column is declared with a default value and I just want to add this default value to old records. Eventually a few changes may not be trivial and require some pre-computation. How do (or would) you handle fast changing web applications with, say, one or two new version of the production code per day ? By the way, the site is written in Pylons if this makes any difference.
Can Java and Python coexist in the same app?
4,166,178
9
4
1,007
0
java,python,google-app-engine,integration,google-cloud-datastore
Different versions of an app share a datastore, and AFAIK you can still have a Java version of your app, and Python version, at the same time. It used to be a necessary hack to use features that were implemented in Python but not (yet) in Java, and quite possibly still is. Of course only one of those versions can be the default, but other versions are accessible.
0
0
0
0
2010-11-12T14:53:00.000
2
1
false
4,165,824
0
0
1
1
I need to have a Java instance fetching data directly from the Python's instance datastore. I don't know if that's possible at all. Is the datastore transparent/unique, or each instance (if they can indeed coexist) has its separate datastore? Suming it up: how can a Java app fetch data from the datastore of a Python app, and vice-versa?
Install Apache with mod_wsgi to use Python for RESTful web services and Apache for web pages
4,168,054
0
0
2,568
1
python,apache,rest,mod-wsgi,mod-python
Check if mod_wsgi is loaded as a module into the httpd.conf Add apache host that points to a python/wsgi module which contains the 'def application' definition for your web-service. Resolve any path issues that maybe arise from your import handling. If this doesn't work, drop some error-dump here and we'll check.
0
0
0
0
2010-11-12T18:07:00.000
2
0
false
4,167,684
0
0
1
1
Can anyone help me install Apache with mod_wsgi to run Python for implementation of RESTful Web services. We're trying to get rid of our existing Java REST services with Apache Tomcat. The installation platform is SUSE Linux Enterprise. Please provide a step by step installation procedure with required modules, as I tried it and everytime was missinhg one module or other either in Python installation or Apache installation. I followed the standard Installation steps for all 3, Apache, Python and mod_wsgi, but didn't work out for me. Would this work at all? Do you have any other suggestions?
best algorithm to combine multiple RSS feeds using Python
4,168,693
1
1
1,116
0
python
Depending on how often the feeds are updated and how often you check, you could simply fix broken dates (if it's in the future, reset it to today), before adding them to the database. Other than that, you'd have to use some sort of ID—I think RSS has an ID field on each item. If your feeds are kept in order, you can get the most recent cached ID, find that in the feed items list, and then add everything newer. If they're out of order, you'd have to check each one against your cache, and add it if it's missing.
0
0
1
0
2010-11-12T18:29:00.000
1
1.2
true
4,167,863
0
0
1
1
I am writing a python script to combine about 20+ RSS feeds. I would like to use a custom solution instead of feedjack or planetfeed. I use feedparser to parse the feeds and mysql to cache them. The problem I am running into is determining which feeds have already been cached and which haven't. Some pseudo code for what I have tried: create a list of all feed items get the date of last item cached from db check which items in my list have a date greater than my item from the db and return this filtered list sort the returned filtered list by date the item was created add new items to the db I feel like this would work, but my problem is that not all of the dates on the RSS feeds I am using are correct. Sometimes a publisher, for whatever reason, will have feed items with dates in the future. If this future date gets added to the db, then it will always be greater than the date of the items in my list. So, the comparison stops working and no new items get added to the db. I would like to come up with another solution and not rely on the publishers dates. How would some of you pros do this? Assuming you have to combine multiple rss feeds, save them to a mysql db and then return them in ordered by date. I'm just looking for pseudo code to give me an idea of the best way to do this. Thanks for your help.
Is there a way to display any media, regardless of type? (especially in Django?)
4,171,467
0
0
85
0
javascript,python,django,image,video
You need specify the "Content-Type" in the http response header.
0
0
0
0
2010-11-13T06:12:00.000
3
0
false
4,171,255
0
0
1
2
If I have a .mp4 file, it will automatically display a video (flash?) If it's a jpg, it'll just display the image... Edit: I want this embedded inside a webpage.
Is there a way to display any media, regardless of type? (especially in Django?)
4,171,542
0
0
85
0
javascript,python,django,image,video
no, you must have file view generator, thats mean you have list of pic and video and then for each file generate correct player and tag its easy
0
0
0
0
2010-11-13T06:12:00.000
3
1.2
true
4,171,255
0
0
1
2
If I have a .mp4 file, it will automatically display a video (flash?) If it's a jpg, it'll just display the image... Edit: I want this embedded inside a webpage.
python/pylons - multiple controllers for template
4,178,834
0
2
296
0
python,model-view-controller,pylons
This is probably where you start moving chunks of code to library functions, to the /lib part of your Pylons project. "Generated by a separate controller" is probably going too far - you merely need to not repeat yourself. Try using library functions to make sure that the correct data is available, then use Mako's inheritance and namespace features.
0
0
0
0
2010-11-13T09:27:00.000
2
0
false
4,171,842
0
0
1
1
I have a main page in Python/Pylons project, which have multiple different blocks (e.g. news/demo/(registration|private zone)/...). My thought is that each block should be generated in a separate controller. How can I call another controller method in a main page controller?
Mixing Python and PHP?
4,175,473
10
4
4,155
0
php,python,apache
For http requests, you need to set your web server to hand over certain request to PHP and others to Python. From within PHP's scripts, if you need to call some Python executable scripts, use one of PHP's shell functions. e.g. exec() Yes it is possible. The djangobook is a nice tutorial that covers this in one of the earlier chapters. It shows you how to run python as a cgi or with apache. On a personal note, if you have time to dig deeper into Python, I'd strongly encourage you to do the whole thing in it, rather than mix things with PHP. My experience tells me that there are probably more cases where a PHP app needs some Python support rather than the reverse. If the supporting language can do everything that the main language does, what's the point of using the main language?
0
0
0
1
2010-11-14T00:04:00.000
1
1.2
true
4,175,419
0
0
1
1
I have some Python scripts that I run on my desktop now for cutting up files. I want to put them on the web and write a simple front-end in PHP where a user uploads a file and it is passed as an argument to a python script on the web server and it is written out in chunks and the user can re-download the chunks. I know a decent amount of PHP, but I do not see: How to mix PHP and Python programmatically Is it possible to have a webpage in python that can just call the python script? Can one have a GUI page that is like zzz.com/text.py as example
Which opensource web framework should a C# ASP.NET Guy Learn?
4,175,695
0
0
893
0
python,ruby-on-rails,ruby,django
For a .Net developer try to start with www.pradosoft.com/ prado framework, it's PHP framework which looks exactly like ASP.NET .. try it
0
0
0
0
2010-11-14T01:07:00.000
5
0
false
4,175,611
0
0
1
2
I am a web developer working mainly with C# on ASP.NET (Webforms and MVC).. I have worked previously with PHP and Other Frameworks and languages of the sort.. I am currently looking and focusing all my development on 2 platforms.. One Proprietary and Industry Class Framework (ASP.NET MVC) and One Opensource and Free Framework (Insert framework of choice here) I have no experience with python or ruby but would like to learn one and use either django or rails.. While i understand both are very different from ASP.NET please advise me which one would be the smoothest transition.. (or the one most worth the migration pain is better!) Thanks Daniel
Which opensource web framework should a C# ASP.NET Guy Learn?
4,178,708
1
0
893
0
python,ruby-on-rails,ruby,django
I am a .NET guy and also worked on PHP for a couple of months. At present I am learning Ruby and after completing basics, I am going to move on Rails. I would suggest you to go with Ruby and than Rails. Career-wise also, Ruby guys are in demand these days, at least in my country.
0
0
0
0
2010-11-14T01:07:00.000
5
0.039979
false
4,175,611
0
0
1
2
I am a web developer working mainly with C# on ASP.NET (Webforms and MVC).. I have worked previously with PHP and Other Frameworks and languages of the sort.. I am currently looking and focusing all my development on 2 platforms.. One Proprietary and Industry Class Framework (ASP.NET MVC) and One Opensource and Free Framework (Insert framework of choice here) I have no experience with python or ruby but would like to learn one and use either django or rails.. While i understand both are very different from ASP.NET please advise me which one would be the smoothest transition.. (or the one most worth the migration pain is better!) Thanks Daniel
SSRS Get from page 2 to end page
4,195,530
0
0
148
0
pdf,reporting-services,render,python-2to3
I was able to resolve using device info with startpage as 2 and endpage as int.maxvalue
0
0
0
0
2010-11-14T04:59:00.000
1
1.2
true
4,176,256
0
0
1
1
I m rendering SSRS Report in pdf format. I want pages from 2 to Last page. Using deviceinfo is it possible?
Can I use Django's mail API in Google App Engine?
4,180,124
3
2
670
0
python,django,google-app-engine,django-nonrel
Yes, djangoappengine has a mail backend for GAE and it's enabled by default in your settings.py via "from djangoappengine.settings_base import *". You can take a look at the settings_base module to see all backends and default settings.
0
1
0
0
2010-11-14T14:27:00.000
1
1.2
true
4,177,907
0
0
1
1
I'm using Django-nonrel for Google App Engine and I was wondering if it's possible to use Django's built-in mail API instead of GAE's mail API for sending mail. If it is, how do I do it? Sorry if this seems like a noob question. I just started learning Django and GAE recently and I can't work out this problem that I have by myself.
is it possible to use PyMongo in Google App Engine?
4,179,091
1
4
1,355
1
python,google-app-engine,mongodb,pymongo
It's not possible because you don't have access to networks sockets in App Engine. As long as you cannot access the database via HTTP, it's impossible.
0
1
0
0
2010-11-14T17:42:00.000
3
0.066568
false
4,178,742
0
0
1
1
I'm trying to use a MongoDB Database from a Google App Engine service is that possible? How do I install the PyMongo driver on Google App Engine? Thanks
Django reverse lookup by ForeignKey
4,180,322
5
6
7,718
0
python,django,model,django-queryset
If the ForeignKey is, as you describe in ModelB and you do mb = ModelB.objects.get(pk=prim_id) then the look up for the modela attribute is not a reverse lookup. you simply access the related object via mb.modela!
0
0
0
0
2010-11-14T22:41:00.000
1
1.2
true
4,180,120
0
0
1
1
I have a django project which has two apps, one is AppA and AppB. Now AppA has a model ModelA which is referenced by the model ModelB in AppB, using modelA = models.ForeignKey(ModelA, related_name='tricky') Now in my view for AppA, when it shows ModelA, I do a get_object_or_404(ModelA, pk=prim_id). Then I want to get all the ModelBs which have a Foreign Key pointing to ModelA. Documentation says I should do a mb = ModelB.objects.get(pk=prim_id) then mb.modela_set.all() But, it failed on the mb.modela_set, and it says "ModelB object has no attribute 'suchsuch'". Notice I added the related_name field to ForeignKey, so I tried with that as well, including mb.tricky.all() and mb.tricky_set.all() to no avail. Oh, and I have specified a different manager for AppA where I do objects = MyManager() which returns the normal query but with a filter applied. What could be the problem? What is the prefered way to get the ModelBs referencing ModelA?
How to post a comment on e-mail reply?
4,183,238
0
2
422
0
python,django,email
You can for example write script for importing comments from mailbox(for example 1-3 minutes for cron). You should connect to special mailbox which collects replies from users(comments). Every mail have own header and title. You really can find out which post user try to comment(by header or title), and then import django enviroment and insert new recods.
0
0
1
0
2010-11-15T09:51:00.000
4
0
false
4,183,158
0
0
1
2
I have Django app that presents a list of items that you can add comments to. What i basically want to do is something like the Facebook did: when someone post a comment on your item, you will receive an e-mail. What I want to do, is when you reply to that e-mail, the reply to be posted as a comment reply on the website. What should I use to achieve this using python as much as possible ? Maybe even Django ?
How to post a comment on e-mail reply?
18,135,014
-1
2
422
0
python,django,email
I think a good way is how Google+ handles it using a + on email address it can be reply+id-or [email protected] then u must write a worker that check the POP server and
0
0
1
0
2010-11-15T09:51:00.000
4
-0.049958
false
4,183,158
0
0
1
2
I have Django app that presents a list of items that you can add comments to. What i basically want to do is something like the Facebook did: when someone post a comment on your item, you will receive an e-mail. What I want to do, is when you reply to that e-mail, the reply to be posted as a comment reply on the website. What should I use to achieve this using python as much as possible ? Maybe even Django ?
Python: RE vs. Query
4,190,033
2
4
184
0
python,mysql,django
A seperate DB table is definitely the "right" way to do it, because mysql has to send all the data from your TEXT fields every time you query. As you add more rows and the TEXT fields get bigger, you'll start to notice performance issues and eventually crash the server. Also, you'll be able to use VARCHAR and add a unique index to the paths, making lookups lightning fast.
0
0
0
0
2010-11-15T10:43:00.000
2
0.197375
false
4,183,554
0
0
1
1
I am building a website using Django, and this website uses blocks which are enabled for a certain page. Right now I use a textfield containing paths were a block is enabled. When a page is requested, Django retrieves all blocks from database and does re.search on the TextField. However, I was wondering if it is not a better idea to use a separate DB table for block/paths, were each row contains a single path and reference to a block, in terms of overhead.
Django running wrong version
4,186,941
2
0
790
0
python,django,mediatemple
mod_python is built for 2.4, but Django is installed for 2.7. Either build mod_python for 2.7, install Django under 2.4, or put a local copy of Django with your project so that the version of Python doesn't matter.
0
0
0
0
2010-11-15T15:51:00.000
1
1.2
true
4,186,099
0
0
1
1
Although running "python" from the shell runs Python v2.7, Django is loading files for python2.4, as shown in the error when I load a django site: Mod_python error: "PythonHandler django.core.handlers.modpython" Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 287, in HandlerDispatch log=debug) File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 461, in import_module f, p, d = imp.find_module(parts[i], path) ImportError: No module named django I think Django is installed for version 2.7 and that's why the bottom says "No module named django" This is my first django install (it's on a mediatemple DV server) so I wouldn't be surprised if I'm doing something stupid. Thanks!
How to display database query results of 100,000 rows or more with HTML?
4,186,505
1
7
3,442
1
python,html,oracle,coldfusion
Most people, in this case, would use a framework. The best documented and most popular framework in Python is Django. It has good database support (including Oracle), and you'll have the easiest time getting help using it since there's such an active Django community. You can try some other frameworks, but if you're tied to Python I'd recommend Django. Of course, Jython (if it's an option), would make your job very easy. You could take the existing Java framework you have and just use Jython to build a frontend (and continue to use your Java applet and Java classes and Java server). The memory problem is an interesting one; I'd be curious to see what you come up with.
0
0
0
0
2010-11-15T16:18:00.000
6
0.033321
false
4,186,384
0
0
1
1
We're rewriting a website used by one of our clients. The user traffic on it is very low, less than 100 unique visitors a week. It's basically just a nice interface to their data in our databases. It allows them to query and filter on different sets of data of theirs. We're rewriting the site in Python, re-using the same Oracle database that the data is currently on. The current version is written in an old, old version of Coldfusion. One of the things that Coldfusion does well though is displays tons of database records on a single page. It's capable of displaying hundreds of thousands of rows at once without crashing the browser. It uses a Java applet, and it looks like the contents of the rows are perhaps compressed and passed in through the HTML or something. There is a large block of data in the HTML but it's not displayed - it's just rendered by the Java applet. I've tried several JavaScript solutions but they all hinge on the fact that the data will be present in an HTML table or something along those lines. This causes browsers to freeze and run out of memory. Does anyone know of any solutions to this situation? Our client loves the ability to scroll through all of this data without clicking a "next page" link.
Python app to django web app
4,192,566
1
3
242
0
python,django,web-applications,django-models
That is Django's ORM: it maps classes to tables. What else did you expect? There needs to be some way of specifying what the fields are, though, before you can use them, and that's managed through the models.Model class and the various models.Field subclasses. You can certainly use your classes as mixins in order to use the existing business logic on top of the field definitions.
0
0
0
0
2010-11-16T08:40:00.000
3
0.066568
false
4,192,339
0
0
1
2
I've written some python code to accomplish a task. Currently, there are 4-5 classes that I'm storing in separate files. I'd now like to change this whole thing into a database-backed web app. I've been reading tutorials on Django, and so far I get the impression that I'll need to manually specify the fields and their types for every "model" that I use. This is a little surprising to me, since I was expecting some kind of ORM capability that would just take the existing classes I've already defined, and map them onto a database somehow, in a manner abstracted away from me. Is this not the case? Am I missing something? It looks like I need to specify all the fields and types in the file 'models.py'. Okay, now beyond those specifics, does anyone have any general tips on the best way to migrate an object-oriented desktop application to a web application? Thanks!
Python app to django web app
4,192,813
0
3
242
0
python,django,web-applications,django-models
If you are thinking about a database backend based web app, you have to specify what fields of the data you want to store and what type of the value you want stored. There is an abstraction that introspects the db to convert it into the django models.py format. But I know not of any that introspects a python class and stores arbitrary data into db. How would that even work? Are the objects, now, stored as a pickle?
0
0
0
0
2010-11-16T08:40:00.000
3
0
false
4,192,339
0
0
1
2
I've written some python code to accomplish a task. Currently, there are 4-5 classes that I'm storing in separate files. I'd now like to change this whole thing into a database-backed web app. I've been reading tutorials on Django, and so far I get the impression that I'll need to manually specify the fields and their types for every "model" that I use. This is a little surprising to me, since I was expecting some kind of ORM capability that would just take the existing classes I've already defined, and map them onto a database somehow, in a manner abstracted away from me. Is this not the case? Am I missing something? It looks like I need to specify all the fields and types in the file 'models.py'. Okay, now beyond those specifics, does anyone have any general tips on the best way to migrate an object-oriented desktop application to a web application? Thanks!
how to filled the data in django templates
4,192,721
1
0
182
0
python,django
Of course you need to render the template - and you do that via the context. How is it not working?
0
0
0
0
2010-11-16T09:28:00.000
3
0.066568
false
4,192,675
0
0
1
1
I want to email a template in django. The template has one variable say name. I want to filled this value. How to do that. context is not working because i don't need to render the page.
Is it possible to access the internal elements of an embedded Flash object via a scripting language?
4,198,087
0
0
110
0
javascript,python,flash
No, not really. Not like you can examine the DOM of a webpage. You can download and decompile the swf, but you may or may not be able to get all the info you want out.
0
0
0
1
2010-11-16T19:20:00.000
2
0
false
4,198,069
0
0
1
2
I would like to be able to access all the components of say a Flash image gallery on someone else's site. I want to be able to find the images, image coordinates, action script code, audio files, video, etc. I do not want to manipulate these elements, I just want to view them and their related information. Is this possible via scripting languages like Ruby, Python or Javascript?
Is it possible to access the internal elements of an embedded Flash object via a scripting language?
4,198,271
0
0
110
0
javascript,python,flash
You can if (and only if) your application domain is the same.
0
0
0
1
2010-11-16T19:20:00.000
2
1.2
true
4,198,069
0
0
1
2
I would like to be able to access all the components of say a Flash image gallery on someone else's site. I want to be able to find the images, image coordinates, action script code, audio files, video, etc. I do not want to manipulate these elements, I just want to view them and their related information. Is this possible via scripting languages like Ruby, Python or Javascript?
Why does domain driven design seem only popular with static languages like C# & Java?
4,205,497
1
45
14,335
0
python,domain-driven-design
If Domain Driven Design is an effectively defined design pattern, why does it matter what language you're using? Advice for design philosophies and the like should be largely language agnostic. They're higher level than the language, so to speak.
0
0
0
1
2010-11-17T05:47:00.000
6
0.033321
false
4,201,846
1
0
1
4
Domain driven design has become my architecture of choice. I've been able to find a abundance of books & tutorials for applying DDD principles within the ASP.net framework. It mostly seems inspired from what Java developers have been doing for a good while now. For my personal projects, I'm starting to lean more towards Python even though I'm finding it difficult to abandon static typing. I was hoping to find lots of help with applying DDD using a dynamic language. There doesn't seem to be anything out there about Python & DDD. Why is that? Obviously DDD can apply quite well to Python. Do people not take on as large of projects in Python? Or is applying DDD simply easier in Python given the dynamic typing therefore reducing the amount of required learning? Perhaps my questionning is due to my lack of experience with Python. Any advice you might have for me will be appreciated.
Why does domain driven design seem only popular with static languages like C# & Java?
4,224,643
2
45
14,335
0
python,domain-driven-design
Most books on design/coding techniques such as TDD and design patterns are written in Java or C#, since that is currently the lowest common denominator language and have the widest user base, or at least the largest base of people who can read and understand the language. This is done largely for marketing reasons so that they appeals to the largest demographic. That does not mean the the techniques are not applicable to or used in other languages. From what I know of DDD most of the principles are language independent and AFAICR the original DDD book had almost no code samples in it (but it is a couple of years since I read it, so I may be mistaken).
0
0
0
1
2010-11-17T05:47:00.000
6
0.066568
false
4,201,846
1
0
1
4
Domain driven design has become my architecture of choice. I've been able to find a abundance of books & tutorials for applying DDD principles within the ASP.net framework. It mostly seems inspired from what Java developers have been doing for a good while now. For my personal projects, I'm starting to lean more towards Python even though I'm finding it difficult to abandon static typing. I was hoping to find lots of help with applying DDD using a dynamic language. There doesn't seem to be anything out there about Python & DDD. Why is that? Obviously DDD can apply quite well to Python. Do people not take on as large of projects in Python? Or is applying DDD simply easier in Python given the dynamic typing therefore reducing the amount of required learning? Perhaps my questionning is due to my lack of experience with Python. Any advice you might have for me will be appreciated.
Why does domain driven design seem only popular with static languages like C# & Java?
12,297,993
5
45
14,335
0
python,domain-driven-design
Python seems to be not too popular in enterprises till now compared to Java (but I believe the wind is in that direction. An example is Django, which was created by a newspaper company). Most programmers working with python are likely either into scientific computing or into web applications. Both of these fields relates to (computer) sciences, not domain-specific businesses, whereas DDD is most applicable within domain-specific businesses. So I would argue that it is mostly a matter of legacy. C# and Java were targeted towards enterprise applications from the start.
0
0
0
1
2010-11-17T05:47:00.000
6
0.16514
false
4,201,846
1
0
1
4
Domain driven design has become my architecture of choice. I've been able to find a abundance of books & tutorials for applying DDD principles within the ASP.net framework. It mostly seems inspired from what Java developers have been doing for a good while now. For my personal projects, I'm starting to lean more towards Python even though I'm finding it difficult to abandon static typing. I was hoping to find lots of help with applying DDD using a dynamic language. There doesn't seem to be anything out there about Python & DDD. Why is that? Obviously DDD can apply quite well to Python. Do people not take on as large of projects in Python? Or is applying DDD simply easier in Python given the dynamic typing therefore reducing the amount of required learning? Perhaps my questionning is due to my lack of experience with Python. Any advice you might have for me will be appreciated.
Why does domain driven design seem only popular with static languages like C# & Java?
4,208,311
20
45
14,335
0
python,domain-driven-design
I think it is definitely popular elsewhere, especially functional languages. However, certain patterns associated with the Big Blue Book are not as applicable in dynamic languages and frameworks like Rails tend to lead people away from ideas of bounded context However, the true thrust of DDD being ubiquitous language is certainly prevalent in dynamic languages. Rubyists especially takes a great deal of joy in constructing domain specific languages - think of how cucumber features end up looking, that's as DDD as it gets! Keep in mind, DDD is not a new idea at all, it was just repackaged in a way that got good uptake from C# and Java guys. Those same ideas are around elsewhere under different banners.
0
0
0
1
2010-11-17T05:47:00.000
6
1.2
true
4,201,846
1
0
1
4
Domain driven design has become my architecture of choice. I've been able to find a abundance of books & tutorials for applying DDD principles within the ASP.net framework. It mostly seems inspired from what Java developers have been doing for a good while now. For my personal projects, I'm starting to lean more towards Python even though I'm finding it difficult to abandon static typing. I was hoping to find lots of help with applying DDD using a dynamic language. There doesn't seem to be anything out there about Python & DDD. Why is that? Obviously DDD can apply quite well to Python. Do people not take on as large of projects in Python? Or is applying DDD simply easier in Python given the dynamic typing therefore reducing the amount of required learning? Perhaps my questionning is due to my lack of experience with Python. Any advice you might have for me will be appreciated.
Reusing django re-usable apps
4,202,031
0
1
268
0
python,django,model-view-controller,web-applications
There's certainly the {% include %} tag, which allows you to include templates directly inside of another template. It also gets everything that the enclosed template gets, so if you are using the RequestContext that means it has access to everything in the request variable. However, it seems you're saying that you want to somehow actually call the register view and login views and embed the result into your page. This could in theory be possible by writing a custom tag that calls the URL using an http GET and then outputting the resulting HTML from the request. I wouldn't recommend this. Instead, for the front page, go ahead and create two forms that point to the appropriate URLs in the django-registration application.
0
0
0
0
2010-11-17T06:12:00.000
2
0
false
4,201,948
0
0
1
1
I was wondering if this would be possible to implement (as an app/middleware): I install the django-registration app. I then create my site-base app for making some generic page views. I want to put a login form and a registration form on a the front page. So I go in and I modify the /register/login.html and the register/register.html templates to fit my front page design (html stuff). I then go to my main page index.html file and I go to the spot in my html where I want those blocks (login & register) to go, and I add {% load "register/login.html" %} and a {% load "register/register.html" %}. Now, when the urlconf calls my index's view, the template will reach the LOAD trigger and will call the LOGIN view so that all of its form.elements are passed to it, and the REGISTER view is called for its elements too. Then, those completed (rendered) views are passed to my index.html and plugged into the spot where I put the LOAD statements. Can the above be done currently? My goal is to take the various apps available and plug them into my project without touching any of their code (I want to ensure that I can upgrade the individual apps later and not break anything in my project because I added custom stuff...). If the above is possible currently, could someone please provide some documentation/tutorials/howtos for best practices in re-using other peoples apps?
Django: How do I redirect to page where form originated
5,241,559
0
4
2,498
0
python,django
Another option might be to create separate URL conf that resolve to the same view, and passing in the source view as a kwargs to the view.
0
0
0
0
2010-11-17T10:21:00.000
3
0
false
4,203,417
0
0
1
2
In my Django app I have multiple pages displaying a link that loads a new page displaying a form. When the form is submitted, what is the cleanest way to redirect to the originating page from which this form was accessed? originating page -> form page -> originating page Using a next variable seems unellegant since I have to set it as a GET variable on the originating page link, and then set it as a hidden POST variable in my form? Any other ideas would be appreciated.
Django: How do I redirect to page where form originated
4,203,496
6
4
2,498
0
python,django
There are a couple of options, all with the cons and benefits ofcourse. passing the originating page withi POST/GET storing the originating page in the session (won't work with multiple tabs obviously) storing the originating page in a cookie (won't work with multiple tabs either) if it's a single page, redirect to the referrer. Doesn't seem possible in your case Personally I think using a next parameter is your best option, but do remember to secure it (only relative urls, no javascript stuff, csrf framework) so you won't have any security problems with it.
0
0
0
0
2010-11-17T10:21:00.000
3
1.2
true
4,203,417
0
0
1
2
In my Django app I have multiple pages displaying a link that loads a new page displaying a form. When the form is submitted, what is the cleanest way to redirect to the originating page from which this form was accessed? originating page -> form page -> originating page Using a next variable seems unellegant since I have to set it as a GET variable on the originating page link, and then set it as a hidden POST variable in my form? Any other ideas would be appreciated.
Django + apache & mod_wsgi: having to restart apache after changes
4,206,134
22
30
23,853
0
python,django,apache,mod-wsgi,django-wsgi
My suggestion is that you run the application in daemon mode. This way you won't be required to restart apache, just touch my_handler.wsgi and the daemon will know to restart the app. The apache httpd will not be only yours (in production) so it is fair not to restart it on every update.
0
0
0
0
2010-11-17T15:30:00.000
3
1.2
true
4,206,000
0
0
1
2
I configured my development server this way: Ubuntu, Apache, mod_wsgi, Python 2.6 I work on the server from another computer connected to it. Most of the times the changes don't affect the application unless I restart Apache. In some cases the changes take effect without restarting the webserver, but after let's say 3 or 4 page loads the application might behave like it used to behave previous to the changes. Until now I just reloaded everytime apache as I have the development server here with me, but HELL after a while got so annoying. How can I avoid this? I can't work with the development server as I need an environment that is as close as possible as the production one. Thanks
Django + apache & mod_wsgi: having to restart apache after changes
4,206,153
-1
30
23,853
0
python,django,apache,mod-wsgi,django-wsgi
Apache loads Django environment when starting and keep running it even when source is changed. I suggest you to use Django 'runserver' (which automatically restarts on changes) in heavy development sessions, unless you need some Apache-specific features (such as multi-thread). Note also that changes in templates do not require the restart of the web server.
0
0
0
0
2010-11-17T15:30:00.000
3
-0.066568
false
4,206,000
0
0
1
2
I configured my development server this way: Ubuntu, Apache, mod_wsgi, Python 2.6 I work on the server from another computer connected to it. Most of the times the changes don't affect the application unless I restart Apache. In some cases the changes take effect without restarting the webserver, but after let's say 3 or 4 page loads the application might behave like it used to behave previous to the changes. Until now I just reloaded everytime apache as I have the development server here with me, but HELL after a while got so annoying. How can I avoid this? I can't work with the development server as I need an environment that is as close as possible as the production one. Thanks
When and how to use Tornado? When is it useless?
4,213,777
50
87
29,364
0
python,asynchronous,nonblocking,tornado
There is a server and a webframework. When should we use framework and when can we replace it with other one? This distinction is a bit blurry. If you are only serving static pages, you would use one of the fast servers like lighthttpd. Otherwise, most servers provide a varying complexity of framework to develop web applications. Tornado is a good web framework. Twisted is even more capable and is considered a good networking framework. It has support for lot of protocols. Tornado and Twisted are frameworks that provide support non-blocking, asynchronous web / networking application development. When should Tornado be used? When is it useless? When using it, what should be taken into account? By its very nature, Async / Non-Blocking I/O works great when it is I/O intensive and not computation intensive. Most web / networking applications suits well for this model. If your application demands certain computational intensive task to be done then it has to be delegated to some other service that can handle it better. While Tornado / Twisted can do the job of web server, responding to web requests. How can we make inefficient site using Tornado? Do any thing computational intensive task Introduce blocking operations But I guess it's not a silver bullet and if we just blindly run Django-based or any other site with Tornado it won't give any performance boost. Performance is usually a characteristic of complete web application architecture. You can bring down the performance with most web frameworks, if the application is not designed properly. Think about caching, load balancing etc. Tornado and Twisted provide reasonable performance and they are good for building performant web applications. You can check out the testimonials for both twisted and tornado to see what they are capable of.
0
1
0
0
2010-11-18T08:29:00.000
2
1.2
true
4,212,877
0
0
1
1
Ok, Tornado is non-blocking and quite fast and it can handle a lot of standing requests easily. But I guess it's not a silver bullet and if we just blindly run Django-based or any other site with Tornado it won't give any performance boost. I couldn't find comprehensive explanation of this, so I'm asking it here: When should Tornado be used? When is it useless? When using it, what should be taken into account? How can we make inefficient site using Tornado? There is a server and a webframework. When should we use framework and when can we replace it with other one?
Any benefits of turning libraries for Django into an App?
4,214,852
1
3
116
0
python,django,django-apps
In my opinion, there is no benefits for middleware and decorators. My rule of thumb: If it has a model and/or views, I'll make it an app.. Even for custom template tags I chose to make it an egg and import it into the apps that will be using it. Good question.
0
0
0
0
2010-11-18T09:09:00.000
3
0.066568
false
4,213,138
0
0
1
3
When developing some functionality for use with django. In this case a middleware and some other utils like a decorator. Is there any upside of making it into a Django App. The library has no models, so there is no point in a models.py (which you need to make django see it as an app), or putting into INSTALLED_APPS. But I see people doing it anyway, what are the benefits?
Any benefits of turning libraries for Django into an App?
4,215,661
0
3
116
0
python,django,django-apps
IMO it's handy to instantly see the list of used apps/libraries- if you miss anything, you can just pip install or easy_install it in the blink of an eye.
0
0
0
0
2010-11-18T09:09:00.000
3
0
false
4,213,138
0
0
1
3
When developing some functionality for use with django. In this case a middleware and some other utils like a decorator. Is there any upside of making it into a Django App. The library has no models, so there is no point in a models.py (which you need to make django see it as an app), or putting into INSTALLED_APPS. But I see people doing it anyway, what are the benefits?
Any benefits of turning libraries for Django into an App?
4,213,863
2
3
116
0
python,django,django-apps
You'll have to make it an app if you want to provide templates, template tags or filters with your library. Otherwise, Django won't pick them up.
0
0
0
0
2010-11-18T09:09:00.000
3
1.2
true
4,213,138
0
0
1
3
When developing some functionality for use with django. In this case a middleware and some other utils like a decorator. Is there any upside of making it into a Django App. The library has no models, so there is no point in a models.py (which you need to make django see it as an app), or putting into INSTALLED_APPS. But I see people doing it anyway, what are the benefits?
Python development under Mac
4,215,219
0
3
836
0
python,macos
Python development on a Mac will be similar to Python development on other *NIX-based operating systems which, in some ways, can be easier than on Windows. As long as none of the modules you are using are Windows-only then you should have no problem!
0
0
0
0
2010-11-18T13:19:00.000
5
0
false
4,215,164
1
0
1
2
I've been developing python web apps using django and appengine. I'm planning on buying a macbook to develop iPhone apps. I wonder if I will be able to develop my python apps without too much changes on a mac , or if keeping them on a PC will be better? Thanks
Python development under Mac
4,215,195
1
3
836
0
python,macos
Developing python for app-engine on a mac works like a charm.
0
0
0
0
2010-11-18T13:19:00.000
5
0.039979
false
4,215,164
1
0
1
2
I've been developing python web apps using django and appengine. I'm planning on buying a macbook to develop iPhone apps. I wonder if I will be able to develop my python apps without too much changes on a mac , or if keeping them on a PC will be better? Thanks
Page auto-update like in Twitter
4,217,142
1
2
753
0
jquery,python,twitter,twisted
use an ajax call with a setInterval, add new content - if any - on the success function of JQuery's AJAX to the according div.
0
0
0
0
2010-11-18T14:31:00.000
2
0.099668
false
4,215,816
0
0
1
1
I wanna add page auto-update on my web site. It's written in Python and jquery, so I wanna try Twisted (or another COMET thing). The problem is about I don't know what exactly I need and what docs I have to read.
Python CMS to create a video site like youtube?
4,216,611
1
5
12,137
0
python,open-source,video,content-management
You might want to tak ea look at zencoder for video encoding too.....
0
0
0
0
2010-11-18T15:25:00.000
6
0.033321
false
4,216,430
0
0
1
1
Is anyone aware of a open source CMS written in python using which I can make a site like YouTube?
Defacto Project Template for Python Tornado
4,220,282
0
13
3,298
0
python,tornado
Tornado comes with a good number of examples and the source is well documented with a few code snipits as well.
0
0
0
1
2010-11-18T22:24:00.000
6
0
false
4,220,244
0
0
1
1
Can someone recommend a project skeleton for python tornado? I suppose it's easy enough to roll my own but I'm curious what else is out there since (obviously) others have been down this road before.
Form validations in a template if using a readymade module for registration
4,365,743
0
0
140
0
python,django
I worked out and got my answer that if we want to put any extra validations, then they should be inserted before the save method of the form. Its the correct place to perform the task. Hope this would help a beginner like me.
0
0
0
0
2010-11-19T11:50:00.000
1
1.2
true
4,224,661
0
0
1
1
I just wanted to know that I am using the predefined registration module and it I am not able to validate the registration form. my registration_form.html look like this {% extends "registration_base.html" %} 2 {% block title %} Registration Form {% endblock %} 3 {% block external %} 4 5 .error{ 6 color: red; 7 font-size: 14px; 8 } 9 1 {% extends "registration_base.html" %} 2 {% block title %} Registration Form {% endblock %} 3 {% block external %} 4 5 .error{ 6 color: red; 7 font-size: 14px; 8 } 9 10 {% endblock %} 11 {% block heading1 %} Sign up for an account {% endblock %} 12 {% block content %} 13 Use the form below to register for your new account; all fields are required. 14 {% csrf_token %} 15 {% if form.non_field_errors %} 16 {{ form.non_field_errors|join:"," }} 17 {% endif%} 18 {% if form.username.errors %} 19 {{ form.username.errors|join:"," }} 20 {% endif %} 21 22 Username: {{ form.username }} 23 24 {% if form.email.errors %} 25 {{ form.emails.errors|join:"," }} 26 {% endif %} 27 28 Your e-mail address: 29 {{ form.email }} 30 31 {% if form.password1.errors %} 32 {{ form.password1.errors|join:"," }} 33 {% endif %} 34 35 Password: 36 {{ form.password1 }} 37 38 {% if form.password2.errors %} 39 {{ form.password2.errors|join:"," }} 40 {% endif %} 41 42 ReType Password: 43 {{ form.password2 }} 44 45 46 47 {% endblock %} Plese help me to figure out the problem. Thanks in advance.............
Python (with Django) and PHP
4,229,417
4
0
1,897
0
php,python,django
PHP is a popular language for web development with tons of libraries and examples online. Python is a modern, well-design programming language where everything is an object. It works well in many environments, including web programming, although it wasn't originally designed for that environment. If you want a general purpose scripting language that can also be used for web development then learning Python would be a good idea. If you only plan to do web development and your main concern is to get a job, experience in PHP will make you attractive to a large number of potential employers who are already using this technology.
0
0
0
1
2010-11-19T21:10:00.000
1
1.2
true
4,229,394
0
0
1
1
Just wondering, as I think about learning either PHP or Django (I have previous Python knowledge), what advantages do Python and Django have over PHP, what disadvantages etc. I don't want to know which one is better, surely neither is better, both have their good sides as well as bad sides and I will probably learn both at some point. I don't want to start a flame war or anything, but please tell me some advantages and disadvantages for both to help me choose which one to learn first. Thanks in advance!
Rails or Pylons -- Any good framework for Python?
4,241,121
0
2
3,321
0
python,ruby-on-rails,pylons
I wrote a few websites in Pylons over the years and I like it a lot. The great things about Pylons is that it consists mostly of third party libraries. That means that you're learning many useful libraries that can be used in you other projects, for example SQLAlchemy, WebOb, FormEncode, Beaker, Mako and so on ... Especially SQLAlchemy and Beaker are extremely useful in pretty much any context.
0
0
0
0
2010-11-21T22:09:00.000
8
0
false
4,240,673
0
0
1
3
I have no background in web applications, but have a fairly experience background in C++, and a quick learner. I have spent some time learning Python and reading through SQLAlchemy. I kind of like the idea of coding in pure Python OO, and then use a nice SQLAlchemy mapper to persist everything. I like this decoupled approach (using pure Python classes along a mapper function to talk to DB) better than the ActiveRecord idea of Rails. I think eventually I would have more control over connecting the DB to the app. (I need to work with a DB that is updated by a background process. Something like a web crawler that fills the DB.) At the same time, some stuff makes me think again about Rails. Like streamlined Email and Ajax handling in Rails. Am I thinking the right way, that Rails is less flexible for Form Validation Manipulations, and working with DB? And is it harder in Pylons to handle Email (notifications), RSS, Ajax? What would you suggest? Thanks
Rails or Pylons -- Any good framework for Python?
4,240,821
1
2
3,321
0
python,ruby-on-rails,pylons
Rails is written in Ruby, not Python. If you have your heart set on Python, then go with Django. But please give Rails a fair shake; ActiveRecord is not the only ORM available either. I use DataMapper for some apps too. I may be biased, but I'm inclined to think the Rails ecosystem is bigger than that of Django too.
0
0
0
0
2010-11-21T22:09:00.000
8
0.024995
false
4,240,673
0
0
1
3
I have no background in web applications, but have a fairly experience background in C++, and a quick learner. I have spent some time learning Python and reading through SQLAlchemy. I kind of like the idea of coding in pure Python OO, and then use a nice SQLAlchemy mapper to persist everything. I like this decoupled approach (using pure Python classes along a mapper function to talk to DB) better than the ActiveRecord idea of Rails. I think eventually I would have more control over connecting the DB to the app. (I need to work with a DB that is updated by a background process. Something like a web crawler that fills the DB.) At the same time, some stuff makes me think again about Rails. Like streamlined Email and Ajax handling in Rails. Am I thinking the right way, that Rails is less flexible for Form Validation Manipulations, and working with DB? And is it harder in Pylons to handle Email (notifications), RSS, Ajax? What would you suggest? Thanks
Rails or Pylons -- Any good framework for Python?
18,227,975
0
2
3,321
0
python,ruby-on-rails,pylons
I used Web2Py for many small projects, including many goodies such as the "Workers" & Scheduler concepts, some event-driven updates in web page through the short tornado example in websocket_messaging.py. If you're looking for a small but powerful development framework that includes a small DB and display tables, it's just amazing. You even do not need to write a single HTML line. I do not see any competitor in this area. In my opinion it's far easier and faster than django, but django might provide much freedom in complex apps.
0
0
0
0
2010-11-21T22:09:00.000
8
0
false
4,240,673
0
0
1
3
I have no background in web applications, but have a fairly experience background in C++, and a quick learner. I have spent some time learning Python and reading through SQLAlchemy. I kind of like the idea of coding in pure Python OO, and then use a nice SQLAlchemy mapper to persist everything. I like this decoupled approach (using pure Python classes along a mapper function to talk to DB) better than the ActiveRecord idea of Rails. I think eventually I would have more control over connecting the DB to the app. (I need to work with a DB that is updated by a background process. Something like a web crawler that fills the DB.) At the same time, some stuff makes me think again about Rails. Like streamlined Email and Ajax handling in Rails. Am I thinking the right way, that Rails is less flexible for Form Validation Manipulations, and working with DB? And is it harder in Pylons to handle Email (notifications), RSS, Ajax? What would you suggest? Thanks
Preferable platform for video-editing and viewing - Executable program / Web-based?
4,241,072
1
0
2,041
0
javascript,python,video,html,html5-video
I wouldn't use any of those: Browsers can't handle the weight of an application like that, python would take ages to render. If you want to make the frontends in python and/or HTML/JS feel free but you will need a compiled (Preferably C/C++) application to handle the heavy lifting in the background (For HTML, especially if you plan on making it actually have a working preview) You'd have more luck with flash than with HTML for this...
0
0
0
0
2010-11-21T23:23:00.000
4
0.049958
false
4,241,033
0
0
1
2
I need to make a light-weight application for video editing and viewing. I was thinking of either writing an executable program written in Python, or a light-weight web app using JavaScript and HTML5. Flash, as a third option, is pretty much out of the question, since it's too fat and has many security flaws. EDIT: The video serving itself (read: the "heavy-weight stuff") will be done by a dedicated fast library or service. Thus, the Python/Web-app questions is pretty much related only to the GUI and some very basic video manipulation, like jumping to a specific frame and such. What is the preferable platform, considering speed and ease of use (for the user)? Should I just use Python, or maybe just build a small web-app for my task? Thanks in advace, Ory
Preferable platform for video-editing and viewing - Executable program / Web-based?
4,943,803
1
0
2,041
0
javascript,python,video,html,html5-video
I eventually developed a web-app - HTML5 & CSS. Developing a GUI in HTML is a breeze. And the Chromium (Open-source Google Chrome) handles HTML5 pretty well. Unlike what people have said here, it is not heavy.
0
0
0
0
2010-11-21T23:23:00.000
4
1.2
true
4,241,033
0
0
1
2
I need to make a light-weight application for video editing and viewing. I was thinking of either writing an executable program written in Python, or a light-weight web app using JavaScript and HTML5. Flash, as a third option, is pretty much out of the question, since it's too fat and has many security flaws. EDIT: The video serving itself (read: the "heavy-weight stuff") will be done by a dedicated fast library or service. Thus, the Python/Web-app questions is pretty much related only to the GUI and some very basic video manipulation, like jumping to a specific frame and such. What is the preferable platform, considering speed and ease of use (for the user)? Should I just use Python, or maybe just build a small web-app for my task? Thanks in advace, Ory
How do you maintain user data when updating a Django site?
4,242,733
0
0
104
0
python,mysql,django-south,django-database
+1 to South, but... We need more information! Are you doing radical changes to your Models, or just adding or removing fields here or there? South can handle some pretty radical migrations, but you'll have to write some custom migration code. Personally, I use South if I'm adding a new field, but not for this kind of more radical stuff. If it's a big Schema change, completely re-organizing your site, then I'd just write your own script to read the old objects, and create the new ones. Make a copy of your production database (via pg_dump, mysqldump, etc.) and load it on to your local machine, where you can test and debug the custom conversion script. Make sure your "old models" and "new models" have different names, and keep everything in your settings.py so that you can always read & write everything. Write & test the migration script, and after that works, you can create another changelist to delete all the old objects, and then remove their corresponding source code if you want.
0
0
0
0
2010-11-22T00:13:00.000
2
0
false
4,241,227
0
0
1
1
I have a live Django site that already has registered users. I am trying to update the site with a new version that is different from the original site -similar idea but different models. How can I keep the current users on the new site? I have heard South may be a good solution, but the old site doesn't have it installed. Is it possible to use South in this case? Thanks for the help!
Python/Django: How to remove extra white spaces & tabs from a string?
4,241,776
1
25
28,671
0
python,django,string
"electric guitar".split() will give you ['electric', 'guitar']. So will "electric \tguitar".
0
0
0
0
2010-11-22T02:30:00.000
6
0.033321
false
4,241,757
0
0
1
1
I'm building a website with Python/Django. Users submit tags. Each tag can contain multiple words. Each tag has an ID number. I want to make sure tags that are formatted slightly differently are still being recognized as the same tag. For example, if one user submitted the tag "electric guitar" and the other submitted "electric   guitar" (2 white spaces between the 2 words) I want to be able to recognize they are the same tag. How to I remove all the extra white spaces and tabs in this case? Thanks.
How should I use Celery when task results are large?
18,987,208
1
7
1,893
0
python,architecture,task,celery,task-queue
I handle this by structuring my app to write the multi-megabyte results into files, which I them memmap into memory so they are shared among all processes that use that data... This totally finesses the question of how to get the results to another machine, but if the results are that large, it sounds like the these tasks are internal tasks coordinate between server processes.
0
1
0
0
2010-11-22T04:09:00.000
2
0.099668
false
4,242,205
0
0
1
1
What's the best way to handle tasks executed in Celery where the result is large? I'm thinking of things like table dumps and the like, where I might be returning data in the hundreds of megabytes. I'm thinking that the naive approach of cramming the message into the result database is not going to serve me here, much less if I use AMQP for my result backend. However, I have some of these where latency is an issue; depending on the particular instance of the export, sometimes I have to block until it returns and directly emit the export data from the task client (an HTTP request came in for the export content, it doesn't exist, but must be provided in the response to that request ... no matter how long that takes) So, what's the best way to write tasks for this?
URLError: urlopen error timed out
4,244,324
0
2
14,600
0
python,django,ubuntu,apache2
Run simple network analysis first, tracert ping wireshark (for network analysis) Check your firewall and proxy settings on the server and make sure the correct ports, routes and permissions are fine.
0
1
0
0
2010-11-22T08:23:00.000
2
0
false
4,243,550
0
0
1
1
Whenever i try to make a HTTP request to some url through my django application which is running on top of apache mod_python (Machine: Ubuntu 10.04 server edition, 64-bits), it gives a timeout error. The strange thing is that it works fine on Ubuntu 10.04 server edition, 32-bits. I feel there could be some proxy connection issue. But i am not sure how to resolve it, if that is the case. What could be the issue? Can anyone please throw some light on this. Thanks in Advance.
App Engine: CPU Over Quota on urlfetch()
4,262,449
2
2
454
0
python,google-app-engine
You should change the design of your application. Instead of making requests to Twitter from App Engine for every user request: Do the request in the user's browser with JavaScript if possible. After a urlfetch, store Twitter's response in the datastore, since a call to the datastore is faster on the next request. If you can cache something in memcache, even better. Update the stored data regularly with the help of cron jobs and task queue.
0
1
0
0
2010-11-23T14:05:00.000
2
0.197375
false
4,256,767
0
0
1
1
Hey. I'm quite new to App Engine. I created a web-based Twitter app which is now running on App Engine and I'm constantly hitting my CPU Over Quota limits. I did a little profiling and I found out that every request consists of two urlfetch queries, each one of which takes up to 2 CPU seconds. That time is probably spent waiting, all the rest of the code is done in under 200 ms (including work with the Datastore). The Quota is for 6.5 hours per day and every request of mine takes approx. 4 CPU seconds. I ran out of the free quota this morning in only a few hours. What is the way around this? I can't make Twitter respond to my API calls quicker, and I cannot cache the results, since every request is for a different Twitter profile. Any help is appreciated, Thanks!
python reporting tool, similar to birtviewer
4,258,672
0
1
280
0
python,reporting
Sure. Write it. Make it open source and give us a git repo to have a little look... Honestly if the problem exists solve it.
0
0
0
1
2010-11-23T16:56:00.000
1
0
false
4,258,624
0
0
1
1
Can you guys please tell if building my own birtviewer like reporting tool but using python is a crazy idea. The company I'm working now, we are using birtviewer to generate reports for the clients, but I'm already getting frustrated tweaking the code to suit our client needs and it's written on massive java code which I don't have any experience at all. And they don't want to mavenize birtviewer, so every new releases I have to manually update my local copy and mavenize it. And the fact that it is really owned by a private company worries me about the future of birtviewer. What do you guys think?
How to design a website on Django platform?
4,259,726
1
2
1,428
0
python,django
Even with an IDE you will just be editing text. Once you get comfortable with the framework, as long as you have debug turned on in your settings, you can do it from any old text editor. I develop websites using the Eclipse IDE with the Pydev plug-in. The html/css plugin i have installed always seems to break when theres too many Django template tags in the template, so i just use the built in text editor.
0
0
0
0
2010-11-23T18:14:00.000
3
0.066568
false
4,259,352
0
0
1
3
Apologies if my question is misleading. Here's what I mean. In Visual Studio 2010 for example, you could visually design a website or a web application as well as add C# code here and there. How would I design my website without an IDE, just by using Python IDLE and Django platform. Would I need to use something like Dreamweaver to design the front-end part and then link it with Django? And if that is so, how difficult is the linking process of front-end with back-end?
How to design a website on Django platform?
4,259,392
8
2
1,428
0
python,django
Django source code is usually edited in a non-GUI application. So, unless you use the code tab, Dreamweaver will be useless. That is, unless you create a static HTML file first then populate it with dynamic code and separate it into bits.
0
0
0
0
2010-11-23T18:14:00.000
3
1.2
true
4,259,352
0
0
1
3
Apologies if my question is misleading. Here's what I mean. In Visual Studio 2010 for example, you could visually design a website or a web application as well as add C# code here and there. How would I design my website without an IDE, just by using Python IDLE and Django platform. Would I need to use something like Dreamweaver to design the front-end part and then link it with Django? And if that is so, how difficult is the linking process of front-end with back-end?
How to design a website on Django platform?
4,259,555
2
2
1,428
0
python,django
just by using Python IDLE and Django platform. Start the webserver Make a model, a controller, and a view. Add data to the db (maybe with the admin model) Load up the page in your browser. Repeat as necessary But I would recommend a more powerful text editor than idle if you are really going to do develop a whole site.
0
0
0
0
2010-11-23T18:14:00.000
3
0.132549
false
4,259,352
0
0
1
3
Apologies if my question is misleading. Here's what I mean. In Visual Studio 2010 for example, you could visually design a website or a web application as well as add C# code here and there. How would I design my website without an IDE, just by using Python IDLE and Django platform. Would I need to use something like Dreamweaver to design the front-end part and then link it with Django? And if that is so, how difficult is the linking process of front-end with back-end?
Django with IronPython and VS2010?
4,259,631
1
3
1,115
0
python,django,visual-studio-2010,ironpython,pycharm
Since MS is no longer officially working on IronPython, you may consider PyCharm. I come from Asp.net and recently moved to Django and happen to use PyCharm and overall am happy with it. Especially because I can work on the same code from my PC or Mac with it. There were some gotches that got me for a bit with it, like it didn't come with Django it's a separate install (it's documented) just surprised me coming from VS.
0
0
0
0
2010-11-23T18:44:00.000
2
1.2
true
4,259,553
1
0
1
1
I have just checked JetBrains products page and noticed they have a new product - PyCharm that supports Django out of the box for Python development. Is there a plug-in or a native support for Django in Visual Studio 2010 with IronPython?
I need a good web development framework for Python
4,261,259
2
3
1,308
0
python
I'm using Flask (a very minimal web framework) and SQLAlchemy as my ORM. I'm exceedingly happy with it. Disclaimer: I'm only using this for personal projects at the moment, though I do plan to launch a web app in the next 6 months using this setup.
0
0
0
0
2010-11-23T20:01:00.000
6
0.066568
false
4,260,324
0
0
1
1
I'm a C/C++ developer and I also have experience developing web apps with C#, ASP.NET MVC and fluent nhibernate. I'm looking for non-MS alternatives for web development and I'm really interested in python so I went out after Django but I've been told that Django makes it difficult for me to personalize my HTML (not sure if this is accurate). What I'm looking for is a Python web development framework that is integrated with an ORM, is able to generate the interfaces BUT provides an easy way for me to customize the interface to create an AJAX intensive app
How to see generated source from an URL page with python script and not anly source?
4,264,223
0
2
212
0
javascript,python,parsing,url,dynamically-generated
I you want generated source you'll need a browser, I don't think you can with only python.
0
0
1
0
2010-11-24T06:35:00.000
2
0
false
4,264,076
0
0
1
2
I have some url to parse, and they used some javascript to create it dynamicly. So if i want to parse the result generated page with python... how can i do that ? Firefox do that well with web developer... so i think it possible ... but i don't know where to start... Thx for help lo
How to see generated source from an URL page with python script and not anly source?
4,264,239
2
2
212
0
javascript,python,parsing,url,dynamically-generated
I've done this by doing a POST of document.body.innerHTML, after the page is loaded, to a CGI script in Python. For the parsing, BeautifulSoup is a good choice.
0
0
1
0
2010-11-24T06:35:00.000
2
1.2
true
4,264,076
0
0
1
2
I have some url to parse, and they used some javascript to create it dynamicly. So if i want to parse the result generated page with python... how can i do that ? Firefox do that well with web developer... so i think it possible ... but i don't know where to start... Thx for help lo
Should I wait for Django to start supporting Python 3?
4,270,236
3
8
884
0
python,django,python-3.x
Python 2 will still live for a very long time. Actually, there's no really good reason to use Python 3 right now unless you need Python3 features which are not available as future imports and know that you won't ever need to use 3rd party modules which might not be Python3-compatible. So the best solution is doing your app now using Python 2 instead of waiting; especially if the app will be useful for you now.
0
0
0
0
2010-11-24T18:20:00.000
3
0.197375
false
4,270,192
0
0
1
3
I have a website idea that I'm very excited about, and I love Python. So, I'm interested in using Django. However, I started learning Python in version 3.1, and Django currently only supports various 2.x versions. I've searched for information about when Django will start supporting Python 3.x, and gotten mostly articles from a year or two ago that say it will take a year or two. Meanwhile, the Django FAQ says that there are no immediate plans. I'm reluctant to build in an old version of Python and then either be stuck with it or go through a huge ordeal trying to migrate later. My original solution to this was to start learning PHP instead and then choose a framework, but as it turns out I don't really like PHP. Django it is, then. If I decide to wait for a 3.x-compatible version, I can teach myself more front-end web development (and more Python) in the meantime. I've only been at this for a few months so I have a lot to learn. But I don't want to wait forever, and I realize that even after a 3.x-compatible version comes out it will take a while for third-party APIs to catch up. What do you all recommend?
Should I wait for Django to start supporting Python 3?
4,270,237
2
8
884
0
python,django,python-3.x
I recommend you learn the frameworks on the old version now, and let 2to3 figure it out when the time comes.
0
0
0
0
2010-11-24T18:20:00.000
3
0.132549
false
4,270,192
0
0
1
3
I have a website idea that I'm very excited about, and I love Python. So, I'm interested in using Django. However, I started learning Python in version 3.1, and Django currently only supports various 2.x versions. I've searched for information about when Django will start supporting Python 3.x, and gotten mostly articles from a year or two ago that say it will take a year or two. Meanwhile, the Django FAQ says that there are no immediate plans. I'm reluctant to build in an old version of Python and then either be stuck with it or go through a huge ordeal trying to migrate later. My original solution to this was to start learning PHP instead and then choose a framework, but as it turns out I don't really like PHP. Django it is, then. If I decide to wait for a 3.x-compatible version, I can teach myself more front-end web development (and more Python) in the meantime. I've only been at this for a few months so I have a lot to learn. But I don't want to wait forever, and I realize that even after a 3.x-compatible version comes out it will take a while for third-party APIs to catch up. What do you all recommend?
Should I wait for Django to start supporting Python 3?
4,270,238
14
8
884
0
python,django,python-3.x
No. Don't wait. Why? Pretty much all django libraries are written for Python 2.x, and if you ever plan on using any of them with Python 3 with the next major release of Django then you'll be waiting not 1 but 3-4 years when everyone starts converting their code. In this time, you could have already mastered django and could have worked and launched many sites, could've got a Django gig, etc. Start immediately and don't postpone!
0
0
0
0
2010-11-24T18:20:00.000
3
1.2
true
4,270,192
0
0
1
3
I have a website idea that I'm very excited about, and I love Python. So, I'm interested in using Django. However, I started learning Python in version 3.1, and Django currently only supports various 2.x versions. I've searched for information about when Django will start supporting Python 3.x, and gotten mostly articles from a year or two ago that say it will take a year or two. Meanwhile, the Django FAQ says that there are no immediate plans. I'm reluctant to build in an old version of Python and then either be stuck with it or go through a huge ordeal trying to migrate later. My original solution to this was to start learning PHP instead and then choose a framework, but as it turns out I don't really like PHP. Django it is, then. If I decide to wait for a 3.x-compatible version, I can teach myself more front-end web development (and more Python) in the meantime. I've only been at this for a few months so I have a lot to learn. But I don't want to wait forever, and I realize that even after a 3.x-compatible version comes out it will take a while for third-party APIs to catch up. What do you all recommend?
Scrapy Django Limit links crawled
4,274,071
2
6
1,211
0
python,django,scrapy
for #1: Don't use rules attribute to extract links and follow, write your rule in parse function and yield or return Requests object. for #2: Try scrapyd
0
0
0
0
2010-11-24T19:15:00.000
2
0.197375
false
4,270,612
0
0
1
1
I just got scrapy setup and running and it works great, but I have two (noob) questions. I should say first that I am totally new to scrapy and spidering sites. Can you limit the number of links crawled? I have a site that doesn't use pagination and just lists a lot of links (which I crawl) on their home page. I feel bad crawling all of those links when I really just need to crawl the first 10 or so. How do you run multiple spiders at once? Right now I am using the command scrapy crawl example.com, but I also have spiders for example2.com and example3.com. I would like to run all of my spiders using one command. Is this possible?
Cannot import markdown because of COMMAND_LINE_LOGGING_LEVEL
4,832,196
2
3
1,564
0
python,django,markdown
I fixed this error by removing the .py extension from markdown.py in whatever/bin. This apparently prevented it from importing itself instead of the markdown module in site-packages.
0
0
0
0
2010-11-24T19:48:00.000
2
0.197375
false
4,270,893
0
0
1
1
I've got a weird error where I can import markdown in Python, and I can import markdown in python inside the Django runserver, but I get the following when trying to import markdown inside of gunicorn's app server. * ImportError: cannot import name COMMAND_LINE_LOGGING_LEVEL This is even more confusing because I found the only place where COMMAND_LINE_LOGGING_LEVEL is referenced in markdown (or any of the code I'm using) -- one line, defining it, in the markdown init.py, and I commented it out. I still get this error. Any ideas?
Django AdminSite - Difficult or Easy Implementation?
4,271,834
0
0
633
0
python,django,django-admin
the django admin is more of a one size fits all kind of ui which may not be intuitive for use in some cases .. customizing its look is easy but extending it is some how hard. you are better off designing your own views in that case.
0
0
0
0
2010-11-24T20:12:00.000
3
0
false
4,271,089
0
0
1
2
Has anyone implemented their own AdminSite? How easy/hard was the basic implementation? I'm in the midst of building a "cms" that's going to be quite large and decently complex in some areas and I'm wondering if using something like AdminSite would save some time. I'd rather not have to make my own implementation for admin actions and inlines and the like (I know I can just use inline forms but that's not as simple as inlines = [Foo]). When using a custom AdminSite, is further customization equivalent to customizing the standard Django admin?
Django AdminSite - Difficult or Easy Implementation?
4,271,476
0
0
633
0
python,django,django-admin
Both If you are OK with it not doing exactly what you want its pretty much done for you automatically. If you need fine grain control over certain things it can be hard to customize without knowing the internals of the admin code.
0
0
0
0
2010-11-24T20:12:00.000
3
0
false
4,271,089
0
0
1
2
Has anyone implemented their own AdminSite? How easy/hard was the basic implementation? I'm in the midst of building a "cms" that's going to be quite large and decently complex in some areas and I'm wondering if using something like AdminSite would save some time. I'd rather not have to make my own implementation for admin actions and inlines and the like (I know I can just use inline forms but that's not as simple as inlines = [Foo]). When using a custom AdminSite, is further customization equivalent to customizing the standard Django admin?
Rails vs Django Deployment
4,279,176
0
1
1,629
0
python,ruby-on-rails,ruby,django,deployment
At the moment Rails has better tools for deployment. Of course you can use Capistrano and other tools mentioned in this thread with Python/Django as well, it just mean you have to learn some bits of Ruby notation. Fabric is great and feels more natural if you are Python person however has much less out-of-the-box functionality.
0
0
0
0
2010-11-25T15:11:00.000
6
0
false
4,278,476
0
0
1
2
I'm looking for at either Rails or Django for some opensource development.. I recently tried to install Gitorious (awesome rails app) on a server.. Gave up after about 4 days of crying at 3AM, Which is generally the easiest to deploy? Thanks Daniel
Rails vs Django Deployment
4,278,840
1
1
1,629
0
python,ruby-on-rails,ruby,django,deployment
HELLO, You can use passenger to deploy your rails application without pain :) Capistrano and webistrano are alternatives too
0
0
0
0
2010-11-25T15:11:00.000
6
0.033321
false
4,278,476
0
0
1
2
I'm looking for at either Rails or Django for some opensource development.. I recently tried to install Gitorious (awesome rails app) on a server.. Gave up after about 4 days of crying at 3AM, Which is generally the easiest to deploy? Thanks Daniel
Test out small snippets of Django code
4,285,854
0
0
330
0
python,django,django-models,django-views,django-testing
I also had this problem before, may be you could install ipython,which has a magic function called like this: %save. This will save what you input into a file . and ipython is a very charming tool ,which can take the palce of standard python prompt perfectly.. It also have other wonderful things ! And in django , if you have install ipython, when you input python manage.py shell, it will invoke ipython directly.
0
0
0
0
2010-11-25T18:20:00.000
6
0
false
4,279,885
0
0
1
1
I am still in the development phase of a Django App. Before even writing my views.py, I test them out to see if my models are correctly defined. This I do it in the terminal by invoking python manage.py shell But oh so often I make some syntax error prompting me to abort the shell ctrl-D & retype everything. This process is taking forever. It would be better if I could write all this in some file just for my trials & if all's well copy it to views.py. What's the process for this? Is it as simple as creating a trial.py in my app directory. Won't I have to import the Django env? What's the best way to do this?