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
Access standalone GUI application through Web
8,474,771
1
1
343
0
python,django,user-interface,web
The only way to make something like that possible would be to load the application into memory, interact with it and render the presentation. Consider something like having a application that can parse a HTML document, instantiate and provides access to the DOM elements in memory so that you can modify their properties and then render it's current display. That's too much to ask. Consider the fact that you'll have several users concurrently requesting the application to render several different sates, where you'll potentially have to manage several instances of the application so that you don't block requests. I would look at potential alternatives, reimplementing the application for the canvas element, or perhaps Flash or Silverlight.
0
0
0
0
2011-12-12T09:33:00.000
1
1.2
true
8,472,282
0
0
1
1
Is it possible to access a standalone GUI-based application over the Web? The concerned application is an event animator, which displays the animation based on custom textual inputs. I don't wish to access that software through any remote desktop connection (or web meeting) like option. I actually intend to integrate the software with my existing web-application. So that, based on user inputs in the web page, the software should be able to display animations of relevant things. Please note that it won't be possible to achieve the functionality using JavaScript or something else -- in that case I've to recreate the application again. Also, the software runs in an interactive mode. It doesn't provide to generate any GIF or video file using any command line argument. I'm using Python-Django for development on Linux.
Defining both post and get method under same request handler
8,474,190
2
1
546
0
python,google-app-engine,webapp2
Your approach is appropriate. According to the newest documentation you can even define post and get as functions outside request handler and just as other functions in your module and that's a way I would choose since it eliminates problems that can happen when instanciating request handlers. If starting a new app from scratch I probably would try to put my get and post function outside of request handler with the new python 2.7 runtime that according to docs supports that.
0
0
1
0
2011-12-12T11:38:00.000
1
1.2
true
8,473,712
0
0
1
1
I'm using python to develop a web app. I defined both "get" and "post" method in the same request handler to serve different purpose. That is, I use "get" method to present a form to user, and "post" method to handle the submitted form. It works fine, but is this approach appropriate? Or should I better define get and post separately in different request handler? Thanks!
Why does this Django form rendering taking forever?
8,477,897
1
0
105
0
python,django,forms,html-rendering
if you have foreign keys to tables with a large number of rows, it's worth remembering that the default widget for each is a dropdown (<select>) with each row ('s unicode) as a choice. these often get enormous and it's worth looking at options (like the admin's raw_id_field)
0
0
0
0
2011-12-12T16:56:00.000
2
0.099668
false
8,477,860
0
0
1
1
I have a ModelForm based on a gigantic 300 fields model. Actually one model with 150 fields inheriting from another one with 150 other. I was expecting the model to cause some issues at syncdb or save(), but it works fine. However, calling the form based on this model as_p() method just take forever. I can wait 10 minutes without seen any output. Same for any HTML rendering method for this form. No error, just python hanging there wherever I'm in the shell or in the dev server. Is there any known limitation or bug for hug forms in Django? Is there a workaround? I'm suspecting some issue with string concatenation. I'm going to dig in the Django source code in the meantime, but if anybody got some clue that would save my day.
How to evenly distribute tasks among nodes with Celery?
8,479,823
2
0
1,269
0
python,django,celery,django-celery
it's actually easy: you start one celery-instance per ec2-instance. set concurrency to the number of cores per ec2-instance. now the tasks don't interfere and distribute nicely among you instances. (the above assumes that your tasks are cpu bound)
0
1
0
0
2011-12-12T18:51:00.000
1
0.379949
false
8,479,320
0
0
1
1
I am using Celery with Django to manage a task que and using one (or more) small(single core) EC2 instances to process the task. I have some considerations. My task eats 100% CPU on a single core. - uses whatever CPU available but only in one core If 2 tasks are in progress on the same core, each task will be slowed down by half. I would like to start each task ASAP and not let it be que. Now say I have 4 EC2 instances, i start celery with "-c 5" . i.e. 5 concurrent tasks per instance. In this setup, if I have 4 new tasks, id like to ensure, each of them goes to different instance, rather than 4 going to same instance and each task fighting for CPU. Similarly, if I have 8 tasks, id like each instance to get 2 tasks at a time, rather than 2 instances processing 4 tasks each. Does celery already behave the way I described? If not then how can i make it behave as such?
Is there a way to lookup all reviews of a customer in Amazon's new Product Advertising API?
8,494,166
-1
1
179
0
python,amazon-web-services
Have you looked at using web page scraping to fetch/get the customer reviews / ratings? If you know the customer id you should be able to extract all the information you need directly from the Amazon web pages.
0
0
1
0
2011-12-13T01:24:00.000
1
-0.197375
false
8,483,263
0
0
1
1
Using ecs.py, I used to be able to get the reviews of a customer with a query like ecs.CustomerContentLookup(customerId, ResponseGroup='CustomerReviews'). This is now deprecated. Is there an alternative? Thanks.
Python in a webapp (client side)
8,484,821
1
2
451
0
python,apache-flex,html
Pyjamas: Python->Javascript, set of widgets for use in a browser or a desktop Skulpt: Python written in Javascript Emscripten: C/C++ -> LLVM -> Javascript Empythoned: Based on emscripten and cpython, working on a stdlib? There are bugs to file
0
0
0
1
2011-12-13T04:16:00.000
1
0.197375
false
8,484,253
0
0
1
1
This is part of some preliminary research and I am having a difficult time figuring out what options might be available or if this is even a situation where a solution even exists. Essentially we have an existing python based simulation that we would like to make available to people via the web. It can be pretty processor intensive, so while we could just run the sim server side and write a client that connects to it, this would not be ideal. Writing a UI in Flash/Flex or HTML5, not a problem. However, is there any way to keep the core simulation logic in python without having it live server side? Is there any existing way to embed python modules in either of these technologies? Thanks all.
Notify browser/page after long task has ended
8,487,273
1
0
65
0
python,browser
Poll the server to get the latest generated files (or the complete list of generated files) every n seconds, and stop the polling once the list is complete, or once the first ajax query (the one which starts the generation process) has completed. The thread which generates the file should make the list of generated files available in a shared, thread-safe, data-structure.
0
0
0
0
2011-12-13T09:12:00.000
1
1.2
true
8,486,691
1
0
1
1
I am using a Python WebServer (CherryPy), but I guess the question is more open and is fairly general. At the moment, I have some Ajax call trough JQuery load on a button click, that triggers some computation, ending in files generation. At the moment, as soon as the processing starts in a background thread, my load returns on the page the links to the future files generated on the server. There are several files to be generated, and the whole process can take minutes. How would one manage to display links to files only when they get available, progressively, file by file ? ... At the moment, the links are dead until there are files behind, and I have no way of telling the user when the links get alive. UPDATE : Thanks JB Nizet. Now could anyone advise about Python Thread safe data structures writing ? Don't know much about the subject, and don't know where to get started.
Which gives better performance-passing parsed URL as args alongwith request or parsing URL in view-Django
8,491,990
1
0
155
0
python,django,parsing,url,args
Option two is inherently slower as your view would need to do this parsing each time, whereas Django's standard URL parser works off of compiled regular expressions. (The urlpatterns in urls.py is compiled once on first run.) However, the speed difference in either approach is pretty negligible. This will never be the bottleneck of your application; focus on things like your database and queries thereof and any I/O operations in your app (anything that writes or reads extensively from the hard drive). Those are where apps get slowed down. Otherwise, you're talking in terms of saving a millisecond here or there, which is fruitlessly pointless.
0
0
0
0
2011-12-13T13:34:00.000
1
1.2
true
8,490,117
0
0
1
1
I have an Django application where the URL's to be handled shall have a specific pattern like /servername/alpha/beta/2/delta/10/pie/1 Now i will be be needing these parameters contained in the URL and will persist them to the database when a URL beginning from /servername/ is being called.So i have 2 ways of doing it Pass parameters along with request to the relevant view.In this case my regex would ensure that i have param1 through param7 having values alpha,beta,2,delta,10,pie and 1 respectively. Pass only the request without passing the parameters.I will either parse using regex the request.path_info or split request.path_info on a "/" and obtain relevant entries Which of these two methods shall be preferred in order to have better performance in terms of CPU and memory or maybe other factors i am not aware of. I believe that one can compare the two using time functions but i believe it won't present an accurate picture.Theoretically which approach shall be preferred and why?
Getting "code" instead of "access_token" in desktop application
8,498,829
0
0
92
0
python,facebook,access-token
The flow is to get the access token, you need that code....But sorry I don't know how to implement this using Python 2.7...
0
0
0
0
2011-12-14T00:55:00.000
1
1.2
true
8,498,332
0
0
1
1
In spite of setting Auth Token Parameter of my application to URI Fragment (#access_token=...), I keep being redirected to the address with code in the text. I'm using Python 2.7 and cookielib for login. Is there anything else I need to do to get access_token instead of code?
Django XMPP Connection pooling
8,504,436
2
0
415
0
python,django,xmpp,connection-pooling
As xmpppy has its own main loop I suggest to use it in a separate thread or even start separately. Actually you do have two separate applications: website and xmpp-client and it is normal to run them separately. In this case you may use different ways to communicate between your applications: pipes between threads and/or processes, tcp or unix socket, file queue, different amqp silutions, any persistent storage, even d-bus, etc. But that is a subject for another question I think.
0
0
1
0
2011-12-14T06:44:00.000
1
1.2
true
8,500,455
0
0
1
1
How can i pool a connection to XMPP server in django so that it is available across multiple requests. I don't want to connect and authenticate on every request which makes it a bit slow. Is this possible? EDIT: I am using xmpppy python xmpp library
Tornadoweb webapp cannot be managed via upstart
8,516,641
0
1
417
0
python,daemon,tornado,upstart
There are two often used solutions The first one is to let your application honestly report its pid. If you could force your application to write the actual pid into the pidfile then you could get its pid from there. The second one is a little more complicated. You may add specific environment variable for the script invocation. This environment variable will stay with all the forks if forks don't clear environment and than you can find all of your processes by parsing /proc/*/environ files. There should be easier solution for finding processes by their environment but I'm not sure.
0
1
0
0
2011-12-14T14:22:00.000
2
0
false
8,506,002
0
0
1
2
Few days ago I found out that my webapp wrote ontop of the tornadoweb framework doesn't stop or restart via upstart. Upstart just hangs and doesn't do anything. I investigated the issue and found that upstart recieves wrong PID, so it can only run once my webapp daemon and can't do anything else. Strace shows that my daemon makes 4 (!) clone() calls instead of 2. Week ago anything was good and webapp was fully and correctly managed by the upstart. OS is Ubuntu 10.04.03 LTS (as it was weeks ago). Do you have any ideas how to fix it? PS: I know about "expect fork|daemon" directive, it changes nothing ;)
Tornadoweb webapp cannot be managed via upstart
10,837,488
1
1
417
0
python,daemon,tornado,upstart
Sorry my silence, please. Investigation of the issue ended with the knowledge about uuid python library which adds 2 forks to my daemon. I get rid of this lib and tornado daemon works now properly. Alternative answer was supervisord which can run any console tools as a daemon which can't daemonize by itself.
0
1
0
0
2011-12-14T14:22:00.000
2
1.2
true
8,506,002
0
0
1
2
Few days ago I found out that my webapp wrote ontop of the tornadoweb framework doesn't stop or restart via upstart. Upstart just hangs and doesn't do anything. I investigated the issue and found that upstart recieves wrong PID, so it can only run once my webapp daemon and can't do anything else. Strace shows that my daemon makes 4 (!) clone() calls instead of 2. Week ago anything was good and webapp was fully and correctly managed by the upstart. OS is Ubuntu 10.04.03 LTS (as it was weeks ago). Do you have any ideas how to fix it? PS: I know about "expect fork|daemon" directive, it changes nothing ;)
Best approach to filter a large dataset depending on the datastore
8,513,090
2
2
183
0
python,google-app-engine
I assume it's so slow because you're doing a query for each user you're looking up. You can avoid the need to do this with good use of key names. For each user in your database, insert entities with their key name set to the unique identifier for the social network. These can be the same entities you're already using, or new 'index' entities created just for this purpose. When sent a list of identifiers, simply do a bulk get operation for all the key names of that entity to identify if they exist - eg, by doing MyKind.get_by_key_name(key_names).
0
1
0
0
2011-12-14T16:51:00.000
1
1.2
true
8,508,346
0
0
1
1
I'm currently implementing a web service providing the social features of a game. One of this game feature is the ability to manage a friends list. The friends the user can add depends on the contacts he's having on an external social network of his choice (currently Facebook or Twitter). The current behavior of the system is the following: The client application uses the social network (Facebook or Twitter) API to retrieve the contact list of the player. Each of this contact is provided with a unique identifier (namely, the social network he's originating from, and its identifier on this social network, for example "Tw12345"). The client sends the list of all those identifiers to the game web service hosted on GAE. The web service checks for each identifier if it has a user that matches in his own database. It returns a list of identifiers, filtered to contains only those who also have a match in the game database. It obviously doesn't work well, because most users contacts list are huge. The server is spending a tremendous amount of time checking the database to filter which contact have a matching game account. Now, I'm having a hard time figuring out how I can proceed more efficiently. As the identifiers aren't following any given order, I can't use integer operations to select users on the database. Also, I can't rely on Twitter or Facebook to do the filtering on their side, because that's not supported by their API. I thought of a system using some kind of memcached data tree to store a list of "known" identifiers (as the query only needs to know that there's a matching user, not which user exactly is matching), but I'm afraid of the time the cache will take to build up anytime it gets cleared. If any of you have an experience on this kind of set-related trouble, I'll be very happy to hear it! Thanks!
Panda3d Robotics
48,337,393
0
2
867
0
c++,python,ruby,robotics,panda3d
I would suggest you to go for ROS(gazebo) and write your nodes in C++ or python. You can follow Lentin Joseph's book on Learning Robotics Using Python. It helps you in building autonomous bots with ROS and OpenCV.
0
0
0
1
2011-12-15T01:24:00.000
2
0
false
8,513,998
0
0
1
2
The title makes it obvious, is this a good idea? I've been looking for a robotics simulator in languages i know (i know ruby best, then c++, then python -- want to strengthen here--, forget about javascript, but i know it). i found something called pyro, but it probably doesn't fit my needs (listed below). In my last university term i learned c++, then they took me to RobotC (which was only about 2 months of the term). Pyro seems similar but now i want something different. I need something that allows to import graphics, allows 3d environments, allows to easily modify actions robot can perform. Also provides other things necessary for robot programming, like a sensor.
Panda3d Robotics
10,025,027
0
2
867
0
c++,python,ruby,robotics,panda3d
Panda 3D is a good language to write your own robot system in. It's written by CMU people, so it's very clean and makes a lot of sense. It allows you to import very complex models from Maya or Blender. It supports 3D environments. Although it has its own scripting language for running actions (animations) imported from your modeling package, I prefer to write my own robot driver. It supports three different physics engines, including its own basic version, Open Dynamics Engine (ODE), and most recently Bullet. Although it supports collision detection, which allows triggering, it is an animation and graphic rendering system, not a robotics system per se, and so you'll have to craft your own sensor simulations beside or on top of it. All in all, though, it is quite satisfactory. Good luck.
0
0
0
1
2011-12-15T01:24:00.000
2
0
false
8,513,998
0
0
1
2
The title makes it obvious, is this a good idea? I've been looking for a robotics simulator in languages i know (i know ruby best, then c++, then python -- want to strengthen here--, forget about javascript, but i know it). i found something called pyro, but it probably doesn't fit my needs (listed below). In my last university term i learned c++, then they took me to RobotC (which was only about 2 months of the term). Pyro seems similar but now i want something different. I need something that allows to import graphics, allows 3d environments, allows to easily modify actions robot can perform. Also provides other things necessary for robot programming, like a sensor.
Why the Common Language Runtime Cannot Support Java
8,530,523
2
11
5,362
0
c#,java,.net,ironpython
CLR does support J#. In an utopian world CLR should have supported C# and Java, but Java is a competitor to Microsoft's C# and hence it won't support Java.
0
0
0
0
2011-12-16T06:16:00.000
5
0.07983
false
8,530,498
1
0
1
2
Today the Common Language Run Time Supports Many Languages including Iron Python and Iron Ruby. We can similarly can use J Ruby and J Python in Java Run Time environments . If so why the .net frame work common language run time cannot support for Java? Um just curious to know though u may see this as a dumb question .
Why the Common Language Runtime Cannot Support Java
8,530,557
1
11
5,362
0
c#,java,.net,ironpython
The respective Virtual Machines act on Intermediate Code in a different language (CIL for .net), and IL for .net and JVM are incompatible with each other. The IL and Runtime features sometimes disallow a few things, for example Generics in C# are closely tied to how Generics in the .net Runtime work, while Java has a completely different implementation. Still, there shouldn't be much technically preventing Java from running on .net, just no one did it yet. It's a massive effort, for what? Is there really enough money to make? If there is a business, someone will do it. But if you're in the business of Java, then most likely you are also tied closely to it's tools and environments, e.g. Eclipse and Tomcat, possibly Ant and Maven.
0
0
0
0
2011-12-16T06:16:00.000
5
0.039979
false
8,530,498
1
0
1
2
Today the Common Language Run Time Supports Many Languages including Iron Python and Iron Ruby. We can similarly can use J Ruby and J Python in Java Run Time environments . If so why the .net frame work common language run time cannot support for Java? Um just curious to know though u may see this as a dumb question .
django-admin: Add extra row with totals
8,549,564
0
38
21,372
0
python,django,django-admin,django-views,django-1.2
if you create a custom view overiding the admin view you should be able to take the queryset along with the current page information and slice the data to create a total appropriate to the current page. if you want a true total than I still see a custom overridden admin view as the option you are looking for.
0
0
0
0
2011-12-17T01:34:00.000
9
0
false
8,541,956
0
0
1
1
I'm using the standard django admin module to display a list of rows. One of the columns is a numerical field. I'd like to display an extra 'totals' row that has most of the columns as blank, except for the numerical column, which should be the total for all of the objects. Is there a simple way to do this within the admin module, or am I better off making a custom view for it? I'm using Django 1.2.
just curious to know the difference between spring mvc vs django
8,547,784
32
25
27,043
0
java,python,django,model-view-controller,spring-mvc
From the perspective of developing Web applications, there's only the big difference in the approach towards the architecture of your applications. Django tends to impose a lot of constraints and depends heavily on a fixed set of solutions that are provided internally. What you get from that are conventions and a streamlined approach to how you're developing your applications. Most of the framework solutions work for everybody and when they don't, you have plenty of opportunities to either extend or reuse certain components differently. This works out so well that, really, once you've seen one good Django project you've seen all of them. Spring, on the other hand, tends to impose as little constraints as possible. Aside from satisfying Java EE platform requirements, you're at the liberty to pretty much wire your application in any way you'd see fit. The components that you write to provide actual behavior are intended to be as loosely tied to the framework itself and you'd just end up using certain components provided by Spring to manage how they're discovered, wired, managed and consumed. The problem is that you're at the liberty to customize even the most minute aspect of the application, which means that you'd be making a lot of decisions and every Spring Web application will be uniquely designed.
0
0
0
0
2011-12-17T19:07:00.000
2
1.2
true
8,547,226
0
0
1
2
I would like to ask the masters out there as what are the main differences between java spring mvc and django? and also..which one is preferred most?
just curious to know the difference between spring mvc vs django
8,547,598
11
25
27,043
0
java,python,django,model-view-controller,spring-mvc
Spring has its own web MVC framework, but it's much more: A dependency injection/inversion of control factory Aspect oriented programming. Modules for persistence, remoting, and other features. Django is a Python web MVC framework for creating browser UI CRUD applications. I would say that Grails, a Ruby on Rails-like web CRUD framework for Java that's based on Spring, Hibernate, and Groovy, would be a better analogy for Django. Both use "convention over coding" to speed development along.
0
0
0
0
2011-12-17T19:07:00.000
2
1
false
8,547,226
0
0
1
2
I would like to ask the masters out there as what are the main differences between java spring mvc and django? and also..which one is preferred most?
Programming a GSM phone/modem to make phone calls
8,605,549
0
2
4,955
0
java,python,mobile,gsm,modem
Almost all modems and (phones which support tethering to your PC) can do this. All modems are equally good at it.There are no starter's modems. Just go through the AT commands specific to your applications and thats it.
0
0
0
1
2011-12-18T01:41:00.000
2
0
false
8,549,259
0
0
1
1
I want to use a program written in a high level language like Java or Python to talk to a GSM Modem. I want to be able to tell the modem what number to call and when to call it. I also want to be able to read and send text messages. I do NOT need to handle voice transmission in either direction of the call. I'd appreciate recommendations of any applicable libraries and specific modems that are good to start with? I like Java but am willing to try something else. Thanks
Realtime art project --- input: sound --- output: image (better title?)
8,595,071
1
0
334
0
python,audio,real-time,microcontroller,processing
The above answer is a good one, PD is very flexible, but if you want something more code oriented and better suited to mixing with MCUs, processing might be better. Another good way to do it would be to use Csound with the Csound Python API. Csound has a steep learning curve, but tons tons of audio analysis functionality and it's very good for running with low latency. You could definitely analyse an input signal in real time and then send control values out to a graphic environment, scripting both with Python.
0
0
0
0
2011-12-18T19:22:00.000
2
0.099668
false
8,554,168
0
0
1
1
I am not quite sure if I should ask this question here. I want to make an art project. I want to use voice as an input, and an image as output. The image changes accordingly to the sound. How can I realise this? Because I need realtime or a delay under 50 ms. At first I thougt it would be better to use a micro controller. But I want to calculate huge images, maybe I microcontroller can't do this. For example I want to calculate 10.000 moving objects. Could I realise this with windows/linux/mircocontroller? It would be very good if I could use Python. Or do you thing processing is a better choice? Do you need more details?
Personalizing Online Assignments for a Statistics Class
8,554,862
9
13
656
0
python,ruby-on-rails,ruby,r,r-exams
The way you have worded your question it's not really clear why you have to mark the students' work online. Especially since you say that you generate assignments using sweave. If you use R to generate the (randomised) questions, then you really have to use R to mark them (or output the data set). For my courses, I use a couple of strategies. For the end of year exam (~500 students), each student gets a unique data set. The students log on to a simple web-site (we use blackboard since the University already has it set up). All students answer the same questions, but use their own unique data set. For example, "What is the mean". The answers are marked offline using an R script. In my introductory R course, students upload their R functions and I run and mark them off line. I use sweave to generate a unique pdf for each student. Their pdf shows where they lost marks. For example, they didn't use the correct named arguments. Coupling a simple web-form with marking offline gives you a lot of flexibility and is fairly straightforward.
0
0
0
0
2011-12-18T20:27:00.000
4
1
false
8,554,562
0
0
1
2
I teach undergraduate statistics, and am interested in administering personalized online assignments. I have already solved one portion of the puzzle, the generation of multiple version of a question using latex/markdown + knitr/sweave, using seeds. I am now interested in developing a web-based system, that would use the various versions generated, and administer a different one for each student, online. I have looked into several sites related to forms (google docs, wufoo, formsite etc.), but none of them allow programmatic creation of questionnaires. I am tagging this with R since that is the language I am most familiar with, and is key to solving the first part of the problem. I know that there are several web-based frameworks for R, and was wondering whether any of them are suitable for this job. I am not averse to solutions in other languages like Ruby, Python etc. But the key consideration is the ability to programatically deliver online assignments. I am aware of tools like WebWork, but they require the use of Perl and the interfaces are usually quite clunky. Feel free to add tags to the post, if you think I have missed a framework that would be more suitable. EDIT. Let me make it clear by giving an example. Currently, if I want to administer an assignment online, I could simply create a Google Form, send the link to my students, and collect all responses in a spreadsheet, and automatically grade it. This works, if I just have one version of the assignment. My questions is, if I want to administer a different version of the assignment for each student, and collect their responses, how can I do that?
Personalizing Online Assignments for a Statistics Class
8,564,007
2
13
656
0
python,ruby-on-rails,ruby,r,r-exams
I found one possible solution that might work using the RGoogleDocs package. I am posting this as an answer only because it is long. I am still interested in better approaches, and hence will keep the question open. Here is the gist of the idea, which is still untested. Create multiple versions of each assignment using knitr/Sweave. Upload them to GoogleDocs using uploadDoc. Share one document per student using setAccess which modifies access controls. Create a common Google Form to capture final answers for each student. The advantage I see is two-fold. One, since all final answers get captured on a spreadsheet, I can access them with R and grade them automatically. Two, since I have access to all the completed assignments on Google Docs, I can skim through them and provide individual comments as required (or let some of my TAs do it). I will provide an update, if I manage to get this working, and maybe even create an R package if it would be useful for others.
0
0
0
0
2011-12-18T20:27:00.000
4
0.099668
false
8,554,562
0
0
1
2
I teach undergraduate statistics, and am interested in administering personalized online assignments. I have already solved one portion of the puzzle, the generation of multiple version of a question using latex/markdown + knitr/sweave, using seeds. I am now interested in developing a web-based system, that would use the various versions generated, and administer a different one for each student, online. I have looked into several sites related to forms (google docs, wufoo, formsite etc.), but none of them allow programmatic creation of questionnaires. I am tagging this with R since that is the language I am most familiar with, and is key to solving the first part of the problem. I know that there are several web-based frameworks for R, and was wondering whether any of them are suitable for this job. I am not averse to solutions in other languages like Ruby, Python etc. But the key consideration is the ability to programatically deliver online assignments. I am aware of tools like WebWork, but they require the use of Perl and the interfaces are usually quite clunky. Feel free to add tags to the post, if you think I have missed a framework that would be more suitable. EDIT. Let me make it clear by giving an example. Currently, if I want to administer an assignment online, I could simply create a Google Form, send the link to my students, and collect all responses in a spreadsheet, and automatically grade it. This works, if I just have one version of the assignment. My questions is, if I want to administer a different version of the assignment for each student, and collect their responses, how can I do that?
B2B App authentication on GAE - Google Accounts or custom user base (Django or Web2Py)?
8,566,440
1
1
388
0
python,django,google-app-engine,web2py
Why both Create Django user from Google users. you will be able to adapt your system user with other system next
0
1
0
0
2011-12-19T19:28:00.000
4
0.049958
false
8,566,399
0
0
1
1
Which of these would you pick for a B2B app (targeting small/med-small businesses) built on GAE with python: Google Accounts Custom Users with Django Custom Users with Web2Py I'm very tempted to go the Google Accounts route as it's very well integrated into GAE and takes care of everything from user creation to session authentication, and even takes care of forgotten passwords. However, I'm sure there are significant drawbacks to this, including usability, but if you are starting from scratch, which approach would you pick and why?
Django models definition ordering
8,567,426
1
7
2,130
0
python,django,models
Do you really need that method that returns all instances of model1 that have that foreign key? You can use the related field manager from model2 to achieve that. Model2.field_in_model1_set.all() ?
0
0
0
0
2011-12-19T19:41:00.000
3
0.066568
false
8,566,559
0
0
1
1
For example, I have 2 models: Model1 and Model2. Model1 has field ForeignKey(Model2). Model2 has method, that returns all instances of Model1 which has this instance of Model2 as ForeignKey. But it doesn't work, because Model2 is defined after Model1 and it knows nothing about Model2. How to solve this problem?
How do I remove a query from a url?
8,620,843
13
16
13,148
0
python,url,scrapy,web-crawler
There is a function url_query_cleaner in w3lib.url module (used by scrapy itself) to clean urls keeping only a list of allowed arguments.
0
0
1
0
2011-12-19T20:31:00.000
6
1
false
8,567,171
0
0
1
1
I am using scrapy to crawl a site which seems to be appending random values to the query string at the end of each URL. This is turning the crawl into a sort of an infinite loop. How do i make scrapy to neglect the query string part of the URL's?
Is there an equivalent of a SQL View in Google App Engine Python?
8,570,245
5
2
106
1
python,sql,google-app-engine
Read-only views (the most common type) are basically queries against one or more tables to present the illusion of new tables. If you took a college-level database course, you probably learned about relational databases, and I'm guessing you're looking for something like relational views. The short answer is No. The GAE datastore is non-relational. It doesn't have tables. It's essentially a very large distributed hash table that uses composite keys to present the (very useful) illusion of Entities, which are easy at first glance to mistake for rows in a relational database. The longer answer depends on what you'd do if you had a view.
0
1
0
0
2011-12-20T02:21:00.000
2
1.2
true
8,570,066
0
0
1
1
I've been learning python by building a webapp on google app engine over the past five or six months. I also just finished taking a databases class this semester where I learned about views, and their benefits. Is there an equivalent with the GAE datastore using python?
Python:Django: Signal handler and main thread
34,890,531
3
9
10,539
0
python,django,multithreading,signal-handling
I use Python 3.5 and Django 1.8.5 with my project, and I met a similar problem recently. I can easily run my xxx.py code with SIGNAL directly, but it can't be executed on Django as a package just because of the error "signal only works in main thread". Firstly, runserver with --noreload --nothreading is usable but it runs my multi-thread code too slow for me. Secondly, I found that code in __init__.py of my package ran in the main thread. But, of course, only the main thread can catch this signal, my code in package can't catch it at all. It can't solve my problem, although, it may be a solution for you. Finally, I found that there is a built-in module named subprocess in Python. It means you can run a sub real complete process with it, that is to say, this process has its own main thread, so you can run your code with SIGNAL easily here. Though I don't know the performance with using it, it works well for me. PS, you can find all details about subprocess in Python Documentation. Thank you~
0
0
0
0
2011-12-20T08:51:00.000
4
0.148885
false
8,572,830
0
0
1
1
I am building a django application which depends on a python module where a SIGINT signal handler has been implemented. Assuming I cannot change the module I am dependent from, how can I workaround the "signal only works in main thread" error I get integrating it in Django ? Can I run it on the Django main thread? Is there a way to inhibit the handler to allow the module to run on non-main threads ? Thanks!
Django - Upload a valid image
8,575,511
2
4
2,152
0
python,django,python-imaging-library,django-models
And don't forget about jpeg-lib! Without it PIL willn't understand with what format it can works.
0
0
0
0
2011-12-20T12:01:00.000
4
1.2
true
8,575,120
0
0
1
2
I'm using Ubuntu, Django 1.3, Python 2.7. When I try to upload certain types of image, I get this message: Upload a valid image. The file you uploaded was either not an image or a corrupted image. It's happening with PNG and JPG (the formats that I need). tiff and gif (that I don't and will never care about) are working. What can I do ?
Django - Upload a valid image
32,456,956
0
4
2,152
0
python,django,python-imaging-library,django-models
I found that this error can be caused by IntegrityError while saving to db
0
0
0
0
2011-12-20T12:01:00.000
4
0
false
8,575,120
0
0
1
2
I'm using Ubuntu, Django 1.3, Python 2.7. When I try to upload certain types of image, I get this message: Upload a valid image. The file you uploaded was either not an image or a corrupted image. It's happening with PNG and JPG (the formats that I need). tiff and gif (that I don't and will never care about) are working. What can I do ?
django: Fat models and skinny controllers?
8,591,009
4
19
9,951
0
python,django,model-view-controller
It depends of what your application is about, but the beauty of Django is that it does not enforce you to put your logical code in your views or in your models, this is your call. If you think that some logic is strongly related to your model then you can make a method of it. The rule (for me) is that your model should be agnostic about the environment (web-app, Crontab running a manage command, etc). My policy is to try to put the bare minimum in my models. By the way, you don't plan to handle request and sessions in your models don't you ? that is a bad idea.
0
0
0
0
2011-12-21T13:21:00.000
3
0.26052
false
8,590,468
0
0
1
1
This is a general architecture question. I read in many places that in an MVC framework, (1) models ought to be fat, and controllers ought to be skinny. But I also read that (2) the details depend on the framework you're developing in. So, what if you're developing in django? My experience with django is that a lot of the logic ends up getting put into views and forms. Not the "business logic," but the details of handling requests, sessions, etc. In terms of lines of code, these details often outweigh the business logic of manipulating model objects. Am I doing something wrong, or is this how django works?
deploying a python web application
8,592,171
0
0
215
0
python,web
You can get a virtual server instance on amazon or rackspace or many others for a very small fee per month, $20 - $60. This will give you a clean install of the OS of your choice. No need to invest in hardware. From there you can follow any of the many many tutorials on deploying a django app.
0
0
0
1
2011-12-21T14:43:00.000
1
1.2
true
8,591,602
0
0
1
1
hi every one I was wondering how to go about deploying a small time python database web application. Is buying some cheap hardware and installing a server good on it a good route to go?
Using a single database file in django is feasible?
8,591,934
0
0
89
0
python,django
Database file (sqlite3) is meant for development purposes. For any application with reasonable traffic you should choose mysql or postgres
0
0
0
0
2011-12-21T15:04:00.000
3
0
false
8,591,910
0
0
1
1
I would like to start a project in django.My doubt is that ,since django is using a single database file. Is that feasible? Actually planned to create a 'wiki' like application that stores articles in a database. Using a single database file ??? Will it be?
How to load Firefox with javascript disable when running Selenium Webdriver (Python) tests?
8,613,669
0
1
1,288
0
javascript,python,selenium,automated-tests
You can use the -firefoxProfileTemplate command line option when starting the Selenium server. But it seems rather counterproductive to disable javascript when testing how browsers behave on your site (unless your site doesn't have any scripts of its own) - you should rather use adblock, or disable the IP used by Google ads in the hosts file of the Selenium server, or set a custom useragent for Selenium tests and don't load ads based on that.
0
0
1
0
2011-12-23T07:40:00.000
1
0
false
8,613,440
0
0
1
1
I heard one can load a custom Firefox profile when starting webdriver, but I've yet to find a way to do that. The Python binding documentation doesn't state it very clearly. I need to start up Firefox without JS because the site I'm testing has a lot of ads injected by Google and some are very slow to load, making the tests slow as well because it waits for all the page objects to finish loading.
How to keep global variables persistent over multiple google appengine instances?
8,617,102
0
2
2,158
0
python,google-app-engine,variables,global
Interesting question. Some bad news first, I don't think there's a better way of storing data; no, you won't be able to stop new instances from spawning and no, you cannot make seperate instances always have the same data. What you could do is have the instances perioidically sync themselves with a master record in the datastore, by choosing the frequency of this intelligently and downloading/uploading the information in one lump you could limit the number of read/writes to a level that works for you. This is firmly in the kludge territory though. Despite finding the quota for just about everything else, I can't find the limits for free read/write so it is possible that they're ludicrously small but the fact that you're hitting them with a mere 10 smartphones raises a red flag to me. Are you certain that the smartphones are being polled (or calling in) at a sensible frequency? It sounds like you might be hammering them unnecessarily.
0
1
0
0
2011-12-23T13:10:00.000
4
0
false
8,616,487
0
0
1
3
Our situation is as follows: We are working on a schoolproject where the intention is that multiple teams walk around in a city with smarthphones and play a city game while walking. As such, we can have 10 active smarthpones walking around in the city, all posting their location, and requesting data from the google appengine. Someone is behind a webbrowser,watching all these teams walk around, and sending them messages etc. We are using the datastore the google appengine provides to store all the data these teams send and request, to store the messages and retrieve them etc. However we soon found out we where at our max limit of reads and writes, so we searched for a solution to be able to retrieve periodic updates(which cost the most reads and writes) without using any of the limited resources google provides. And obviously, because it's a schoolproject we don't want to pay for more reads and writes. Storing this information in global variables seemed an easy and quick solution, which it was... but when we started to truly test we noticed some of our data was missing and then reappearing. Which turned out to be because there where so many requests being done to the cloud that a new instance was made, and instances don't keep these global variables persistent. So our question is: Can we somehow make sure these global variables are always the same on every running instance of google appengine. OR Can we limit the amount of instances ever running, no matter how many requests are done to '1'. OR Is there perhaps another way to store this data in a better way, without using the datastore and without using globals.
How to keep global variables persistent over multiple google appengine instances?
8,617,199
0
2
2,158
0
python,google-app-engine,variables,global
Consider jabber protocol for communication between peers. Free limits are on quite high level for it.
0
1
0
0
2011-12-23T13:10:00.000
4
0
false
8,616,487
0
0
1
3
Our situation is as follows: We are working on a schoolproject where the intention is that multiple teams walk around in a city with smarthphones and play a city game while walking. As such, we can have 10 active smarthpones walking around in the city, all posting their location, and requesting data from the google appengine. Someone is behind a webbrowser,watching all these teams walk around, and sending them messages etc. We are using the datastore the google appengine provides to store all the data these teams send and request, to store the messages and retrieve them etc. However we soon found out we where at our max limit of reads and writes, so we searched for a solution to be able to retrieve periodic updates(which cost the most reads and writes) without using any of the limited resources google provides. And obviously, because it's a schoolproject we don't want to pay for more reads and writes. Storing this information in global variables seemed an easy and quick solution, which it was... but when we started to truly test we noticed some of our data was missing and then reappearing. Which turned out to be because there where so many requests being done to the cloud that a new instance was made, and instances don't keep these global variables persistent. So our question is: Can we somehow make sure these global variables are always the same on every running instance of google appengine. OR Can we limit the amount of instances ever running, no matter how many requests are done to '1'. OR Is there perhaps another way to store this data in a better way, without using the datastore and without using globals.
How to keep global variables persistent over multiple google appengine instances?
8,624,587
3
2
2,158
0
python,google-app-engine,variables,global
You should be using memcache. If you use the ndb (new database) library, you can automatically cache the results of queries. Obviously this won't improve your writes much, but it should significantly improve the numbers of reads you can do. You need to back it with the datastore as data can be ejected from memcache at any time. If you're willing to take the (small) chance of losing updates you could just use memcache. You could do something like store just a message ID in the datastore and have the controller periodically verify that every message ID has a corresponding entry in memcache. If one is missing the controller would need to reenter it.
0
1
0
0
2011-12-23T13:10:00.000
4
1.2
true
8,616,487
0
0
1
3
Our situation is as follows: We are working on a schoolproject where the intention is that multiple teams walk around in a city with smarthphones and play a city game while walking. As such, we can have 10 active smarthpones walking around in the city, all posting their location, and requesting data from the google appengine. Someone is behind a webbrowser,watching all these teams walk around, and sending them messages etc. We are using the datastore the google appengine provides to store all the data these teams send and request, to store the messages and retrieve them etc. However we soon found out we where at our max limit of reads and writes, so we searched for a solution to be able to retrieve periodic updates(which cost the most reads and writes) without using any of the limited resources google provides. And obviously, because it's a schoolproject we don't want to pay for more reads and writes. Storing this information in global variables seemed an easy and quick solution, which it was... but when we started to truly test we noticed some of our data was missing and then reappearing. Which turned out to be because there where so many requests being done to the cloud that a new instance was made, and instances don't keep these global variables persistent. So our question is: Can we somehow make sure these global variables are always the same on every running instance of google appengine. OR Can we limit the amount of instances ever running, no matter how many requests are done to '1'. OR Is there perhaps another way to store this data in a better way, without using the datastore and without using globals.
Python 2.7.2 and Google App Engine SDK 1.6.1 on Win 7 Home Premium not working
13,126,746
2
9
2,601
0
python,windows,google-app-engine
I was facing the same issue, browse button was disabled. I ran dev_appserver.py helloworld command at command prompt and then opened localhost:8080 in my browser the hello world program ran successfully.
0
1
0
0
2011-12-23T23:25:00.000
8
0.049958
false
8,621,527
0
0
1
6
I have installed Python 2.7.2 (Win7 32-bit) and Google App Engine SDK 1.6.1 for Win7 on a 64-bit system running Win7 Home Premium. Default folder locations for both Python and GAE. When I try to run the helloworld project as described in the Google Python Getting Started doc, the Launcher's "browse" button never becomes active. The GAE SDK is supposed to do fine with Python 2.7. Is there a complete listing anywhere of environment variables needed for this setup to work? So far, all posts I have seen are from users who have gotten well past this absolutely basic step.
Python 2.7.2 and Google App Engine SDK 1.6.1 on Win 7 Home Premium not working
8,622,105
0
9
2,601
0
python,windows,google-app-engine
Do you see anything in the GAE SDK logs? Which browser are you using? What is your default browser? The default security settings in IE require you to enable intranet access. I recently had to rebuild my Win7 dev box. Chrome was my default browser. When I installed GAE SDK v1.6.1 I had a similar problem to what you describe. I checked logs and fiddled with the browser configuration to resolve it. My recollection was that once I made IE 9 my default browser again, i saw the intranet security error. After enabling access to intranet sites like localhost:8080, things started working OK, but start-up was sometimes slow. Then I made Chrome my default browser again and the start-up became a bit faster and more reliable.
0
1
0
0
2011-12-23T23:25:00.000
8
0
false
8,621,527
0
0
1
6
I have installed Python 2.7.2 (Win7 32-bit) and Google App Engine SDK 1.6.1 for Win7 on a 64-bit system running Win7 Home Premium. Default folder locations for both Python and GAE. When I try to run the helloworld project as described in the Google Python Getting Started doc, the Launcher's "browse" button never becomes active. The GAE SDK is supposed to do fine with Python 2.7. Is there a complete listing anywhere of environment variables needed for this setup to work? So far, all posts I have seen are from users who have gotten well past this absolutely basic step.
Python 2.7.2 and Google App Engine SDK 1.6.1 on Win 7 Home Premium not working
11,284,009
0
9
2,601
0
python,windows,google-app-engine
I am quite sure that is because you had changed the encode from ANSI to another type (such as UTF-8) on app.yaml, change it back to ANSI, then you can run the project on google app engine launcher. BTW, the helloworld tutorial on google has no problem.
0
1
0
0
2011-12-23T23:25:00.000
8
0
false
8,621,527
0
0
1
6
I have installed Python 2.7.2 (Win7 32-bit) and Google App Engine SDK 1.6.1 for Win7 on a 64-bit system running Win7 Home Premium. Default folder locations for both Python and GAE. When I try to run the helloworld project as described in the Google Python Getting Started doc, the Launcher's "browse" button never becomes active. The GAE SDK is supposed to do fine with Python 2.7. Is there a complete listing anywhere of environment variables needed for this setup to work? So far, all posts I have seen are from users who have gotten well past this absolutely basic step.
Python 2.7.2 and Google App Engine SDK 1.6.1 on Win 7 Home Premium not working
17,632,351
0
9
2,601
0
python,windows,google-app-engine
I had a similar issue; it turned out my problem was not due to environment variables. Debugging GAE: First off let me say that if you are having problems with GAE, I would strongly recommend launching using the CLI, google_appengine/dev_appserver.py. There is a large stack trace of the reason GAE is failing (instead of simply a red link in the GAE Launcher GUI) that will point you in the right direction. Hidden bad characters: When copying the text from google's "hello world" tutorial, there was an invisible hidden character at the start of my YAML file (I found it using kdiff, a diff tool). After deleting this character, my app launched (and showed up as not red in the GAE Launcher GUI). Environment Variables: As to your original question, the only relevant environment variable I have set is my PATH variable, where I have appended the folder of my python executable (in my case C:\Python27) so that I can run python files without specifying the full path to Python. Let me repeat, however, that I do not believe this is the cause of your problem, but you can more directly confirm this using the CLI.
0
1
0
0
2011-12-23T23:25:00.000
8
0
false
8,621,527
0
0
1
6
I have installed Python 2.7.2 (Win7 32-bit) and Google App Engine SDK 1.6.1 for Win7 on a 64-bit system running Win7 Home Premium. Default folder locations for both Python and GAE. When I try to run the helloworld project as described in the Google Python Getting Started doc, the Launcher's "browse" button never becomes active. The GAE SDK is supposed to do fine with Python 2.7. Is there a complete listing anywhere of environment variables needed for this setup to work? So far, all posts I have seen are from users who have gotten well past this absolutely basic step.
Python 2.7.2 and Google App Engine SDK 1.6.1 on Win 7 Home Premium not working
31,930,984
2
9
2,601
0
python,windows,google-app-engine
I compared the helloworld example to the guestbook demo and found that the application element was key. I added the line at the top of the app.yaml file "application: helloworld" and the helloworld example started working in the Google App Engine (GAE). Note that the 'application' element is supposed to be optional as defined in the app.yaml reference. It looks like it is optional if you use the command line, and it is not optional if you use GAE.
0
1
0
0
2011-12-23T23:25:00.000
8
0.049958
false
8,621,527
0
0
1
6
I have installed Python 2.7.2 (Win7 32-bit) and Google App Engine SDK 1.6.1 for Win7 on a 64-bit system running Win7 Home Premium. Default folder locations for both Python and GAE. When I try to run the helloworld project as described in the Google Python Getting Started doc, the Launcher's "browse" button never becomes active. The GAE SDK is supposed to do fine with Python 2.7. Is there a complete listing anywhere of environment variables needed for this setup to work? So far, all posts I have seen are from users who have gotten well past this absolutely basic step.
Python 2.7.2 and Google App Engine SDK 1.6.1 on Win 7 Home Premium not working
31,988,393
0
9
2,601
0
python,windows,google-app-engine
I did two changes together - 1. added the line at the top of app.yaml file "application:helloworld" 2. changed the last line in app.yaml "script: helloworld.app" to "script: helloworld.py" my GAE started working. However to islolate the issue I 'undid' both changes, it turns out that the the 2nd change - changing helloworld.app to helloworld.py did the magic
0
1
0
0
2011-12-23T23:25:00.000
8
0
false
8,621,527
0
0
1
6
I have installed Python 2.7.2 (Win7 32-bit) and Google App Engine SDK 1.6.1 for Win7 on a 64-bit system running Win7 Home Premium. Default folder locations for both Python and GAE. When I try to run the helloworld project as described in the Google Python Getting Started doc, the Launcher's "browse" button never becomes active. The GAE SDK is supposed to do fine with Python 2.7. Is there a complete listing anywhere of environment variables needed for this setup to work? So far, all posts I have seen are from users who have gotten well past this absolutely basic step.
rvmsudo analog for python/virtualenv
8,662,790
1
0
191
0
python,rvm,virtualenv
One work around is to use "sudo -E". This will preserve the calling user's environment across the sudo. Note that if the adversary controls your environment this is an immediate root exploit (via LD_LIBRARY_PATH and similar).
0
1
0
0
2011-12-25T15:49:00.000
1
0.197375
false
8,630,305
1
0
1
1
As anyone who knows what virtualenv does for python there is an analog for ruby. What's interesting about the ruby installation is that there is a "rvmsudo" that projects the current rvm environment on the root/sudo user before executing the requested command. virtualenv does not offer an obvious implementation of the same command. Is there something I'm missing?
Click the javascript popup through webdriver
8,631,520
0
20
38,288
0
python,selenium,webdriver,web-scraping,alert
that depends on the javascript function that handles the form submission if there's no such function try to submit the form using post
0
0
1
0
2011-12-25T20:50:00.000
6
0
false
8,631,500
0
0
1
1
I am scraping a webpage using Selenium webdriver in Python The webpage I am working on, has a form. I am able to fill the form and then I click on the Submit button. It generates an popup window( Javascript Alert). I am not sure, how to click the popup through webdriver. Any idea how to do it ? Thanks
Flask virtualenv
9,362,915
4
3
2,147
0
python,virtualenv,ubuntu-10.04,flask
type 'python' in shell and then type 'import flask', if there is no error, you can use it.
0
0
0
0
2011-12-27T13:18:00.000
3
0.26052
false
8,645,093
1
0
1
1
I am trying to set up Flask on Ubuntu 10.04 LTS. I have install virtualenv 1.7 I am using python 2.6 I set my virtualenv and easy_install Flask But when I check in my python import Flask fails The Flask.egg is present in my virtualenv site-pakages. Any suggestions ?
How do I set Django to use Python 2.7 instead of the default Python 2.4?
8,650,131
1
4
7,887
0
python,django
Just run this command into your command shell: python2.7 /path/to/manage.py runserver Then Django will run under python 2.7
0
0
0
0
2011-12-27T22:31:00.000
3
0.066568
false
8,649,965
0
0
1
1
I am using CentOS. The default python installed is 2.4 and I also installed 2.7 in order to use Django. How can I configure Django to use /usr/local/bin/python2.7 instead of just the default python command? I have to leave the default Python as 2.4 because other services such as yum don't run with 2.7. Or is there other solution?
OpenERP - Report Creation
9,046,631
1
1
6,171
0
python,report,openoffice.org,openerp,openoffice-writer
First you save .odt file then connect with server and select open new report and then send it ti server with proper report name and then keep on editing your report by selecting the option modify existing report.
0
0
0
0
2011-12-28T03:54:00.000
4
0.049958
false
8,651,668
0
0
1
1
I am trying to create a new report with report plugin and openoffice but I don't know how to assign it in the OpenERP system. Is there someone who can give me exact steps for creation of new report and integration with openerp? Thanks in advance!
Can python's importlib work in concurrent environment?
9,348,456
0
2
139
0
python,django,concurrency
If by concurrent environment, you mean separate processes, then it should be perfectly fine. If you are sharing imported modules among threads of same application, it should still be fine, as long as they are python threads and the modules imported are pure-python. For what it's worth, I hope you are not using sub-interpreters for concurrency. I am not sure of behavior for imported modules among sub-interpreters.
0
0
0
0
2011-12-28T06:20:00.000
1
0
false
8,652,585
1
0
1
1
I have a question. I'm using importlib in Django to dynamic load a specific module at runtime, and then using the imported module to work around. Using this way can reduce much code in my project. But I'm not sure whether it is suitable for concurrent environment. Can anyone enlighten me?
wxPython GUI on a web page?
8,654,270
0
1
669
0
python,html,wxpython
You can use Javascript to create your own GUI to show. Maybe Google's NaCl is far enough advanced but it won't give you the cross browser compatibility you'll probably like. If you look at broadway (which is linked in one of the other answers), you'll need to run an X session for each user.
1
0
0
0
2011-12-28T09:37:00.000
2
0
false
8,654,165
0
0
1
1
Is it possible to embed a wxPython based GUI in an HTML page? If not, is there any other option other than Java applets to make GUIs that can be embedded onto an HTML page?
Error: No module named staticfiles in django 1.3.1 + python 2.6? what's wrong
64,820,990
0
1
1,835
0
python,django,aptana
use {% load static %} instead of {% load staticfiles %} in the new version of Django, the syntax of loading static files changed
0
0
0
0
2011-12-28T12:29:00.000
2
0
false
8,655,938
0
0
1
1
I didn't worked on the django project for somedays and now I return and I can't work on it. When I debug or run in eclipse aptana I get the "Error: No module named staticfiles" error. I have even updated aptana to today's updates and no luck. I have uninstalled the django, delete all files and reinstall. If I import django with python in cmd (on windows) it is in the place I expect to be But if I delete the "'django.contrib.staticfiles'," string in the "INSTALLED_APPS" from settings.py everything works fine but I have no access to the static files, as expected.. In those days I have installed Google app engine + python 2.5; can this be the problem and how to solve? thank you very much*
setup.py that pulls in non-Python github repos and puts them in the correct directory?
8,658,725
2
7
2,129
0
python,django,git,github,setup.py
An alternative to this would be to provide a requirements.txt file for use with pip. You can specify git and mercurial repos as well as packages from PyPI, so that the user would just have to do pip install -r requirements.txt to get the whole project.
0
0
0
0
2011-12-28T15:45:00.000
2
0.197375
false
8,657,959
1
0
1
1
Is it possible to create a setup.py file that: Pulls in a github repository places the files from that repository into a specified folder I'm setting up a django package/app that uses third-party JavaScript frameworks available on github. I'd like to be able to have setup.py pull the latest version from github and then places those files into the appropriate static/js folder. So this is different from normal dependencies that are Python packages with their own setup.py files.
Django: Remove "view on site" button in the admin User change form
50,468,736
0
12
7,467
0
python,django,django-admin,django-authentication
use admin.site.site_url = "your url here" in url.py of ur main app to modify the "visit site" on django page and for "view_on_site" removal use view_on_site = False in ur class with display_list for
0
0
0
0
2011-12-28T23:15:00.000
9
0
false
8,662,359
0
0
1
1
get_absolute_url() method is cool, but in some cases is not needed. django.contrib.auth.models.User has it set by default, this cause my projects to have a broken link in the admin. How can I prevent that from happening? In one of my old projects I set a custom template in which I removed the html of the button, it doesn't sound like a good solution that would scale though. Anything better?
How to maintain server-initiated FTP connection between client requests in Python/Django?
8,664,646
0
0
631
0
python,django,html,ftp
You'll need to use a persistent connection framework as what you're trying to achieve really isn't what HTTP was meant for (in the sense that HTTP commands are stateless and independent), and thus not what Django is built for. There are a number of options, but since it seems you are in a restricted environment you'll need to do some research to determine what's best.
0
0
1
0
2011-12-29T02:24:00.000
2
1.2
true
8,663,391
0
0
1
2
I'm going to use ftplib to open up an FTP connection to an FTP server provided by the user. The client will be sending FTP commands to my django server via Ajax, which will then be forwarded to the FTP server the user provided. However, I'd like to not have to create a new FTP server connection every time the client sends an FTP command. In other words, I want to keep the FTP connection alive between requests by the client. How would I do this? Would some sort of comet implementation be best? I was initially planning to use WebSockets until I discovered my host won't allow it. =\
How to maintain server-initiated FTP connection between client requests in Python/Django?
8,665,512
0
0
631
0
python,django,html,ftp
Switch hosts. Webfaction allows websockets with dedicated IP at around $20 per month.
0
0
1
0
2011-12-29T02:24:00.000
2
0
false
8,663,391
0
0
1
2
I'm going to use ftplib to open up an FTP connection to an FTP server provided by the user. The client will be sending FTP commands to my django server via Ajax, which will then be forwarded to the FTP server the user provided. However, I'd like to not have to create a new FTP server connection every time the client sends an FTP command. In other words, I want to keep the FTP connection alive between requests by the client. How would I do this? Would some sort of comet implementation be best? I was initially planning to use WebSockets until I discovered my host won't allow it. =\
Website Links to Downloadable Files Don't Seem to Update
8,674,108
0
0
45
0
python,html,web
I don't know anything about Python, but in PHP, in some fopen modes, if a file is trying to be made with the same name as an existing file, it will cancel the operation.
0
0
1
1
2011-12-29T22:08:00.000
1
0
false
8,674,077
0
0
1
1
I have a problem with links on my website. Please forgive me if this is asked somewhere else, but I have no idea how to search for this. A little background on the current situation: I've created a python program that randomly generates planets for a sci-fi game. Each created planet is placed in a text file to be viewed at a later time. The program asks the user how many planets he/she wants to create and makes that many text files. Then, after all the planets are created, the program zips all the files into a file 'worlds.zip'. A link is then provided to the user to download the zip file. The problem: The first time I run this everything works perfectly fine. When run a second time, however, and I click the link to download the zip file it gives me the exact same zip file as I got the first time. When I ftp in and download the zip file directly I get the correct zip file, despite the link still being bad. Things I've tried: When I refresh the page the link is still bad. When I delete all my browser history the link is still bad. I've tried a different browser and that didn't work. I've attempted to delete the file from the web server and that didn't solve the problem. Changing the html file providing the link worked once, but didn't work a second time. Simplified Question: How can I get a link on my web page to update to the correct file? I've spent all day trying to fix this. I don't mind looking up information or reading articles and links, but I don't know how to search for this, so even if you guys just give me links to other sites I'll be happy (although directly answering my question will always be appreciated :)).
How to specify schema name while running "syncdb" in django?
42,578,440
0
7
4,285
1
python,database,django
I have used following info and work for me 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'dab_name', 'USER': 'username', 'PASSWORD': 'password', 'HOST': 'localhost', 'PORT': '5432', 'OPTIONS': { 'options': '-c search_path=tours' #schema name } } Tested on postgresql 9 and django 1.10.2 Thanks @romke
0
0
0
0
2011-12-30T14:52:00.000
2
0
false
8,680,673
0
0
1
1
Assuming I have a schema with the name "my_schema", how can I create tables with "django syncdb" for that particular schema? Or is there any other alternatives for quickly creating tables from my django models? I think, by default django creates tables for the "public" schema.
Robocode + Python
18,469,631
1
3
1,489
0
python,jython,robocode
As long as your java-class extends robocode.Robot everything is recognized as robot. It doesn't matter where you put the class.
0
0
0
1
2011-12-30T20:00:00.000
1
0.197375
false
8,683,501
0
0
1
1
The question is, how do you make a robot for Robocode using Python? There seem to be two options: Robocode + Jython Robocode for .NET + Iron Python There's some info for the first, but it doesn't look very robust, and none for the latter. Step by step, anyone?
tornado.web : Is there a method which is called after the actual handler method?
9,072,583
3
1
922
0
python,tornado
Starting Tornado 2.2 now you can override RequestHandler.on_finish for post-request processing.
0
1
0
0
2011-12-31T06:28:00.000
2
1.2
true
8,686,745
0
0
1
1
Tornado web framework seems to expose a method RequestHandler.prepare() which is called before the actual handler method. I was wondering if there's a similar method which is called after the handler ?
how to decompile user password in django
8,688,811
5
0
263
0
python,django,sha1
You are asking the impossible. The passwords are salted and hashed. The way they're validated is by performing the same process on the re-supplied password. There's no way to 'decrypt' it.
0
0
0
0
2011-12-31T14:51:00.000
1
1.2
true
8,688,762
0
0
1
1
I have a SECRET_KEY, how do i decompile a user password using python? I assume that the encryption method is sha1. thanks.
Exposing passwords in django
8,696,496
2
1
104
0
python,django
That assumes your database is only accessible from one specific host, and even then, why would you want to give a potential attacker another piece of information? Suppose you deploy this to a shared host and I have an account on there, I could connect to your database just by logging into my account on that box. Also, depending on who you are writing this for and what kind of auditing they need to go through (PCI, state audits, etc), this might just not be allowed. I would try to find a way around checking in the password.
0
0
0
1
2012-01-02T00:09:00.000
2
0.197375
false
8,696,469
0
0
1
1
For a git repository that is shared with others, is it a vulnerability to expose your database password in the settings.py file? (My initial thought was no, since you still need the ssh password.)
How can I mail decrypted 'current password' of a django user created
8,697,977
1
0
1,188
0
python,django
Sending raw password is a bad idea, it's not secure. If user forgets his password, reset password form should be used instead of finding raw password in mail inbox. To answer your question I could suggest using form for getting raw password. If you'll have own form, you'll get access to all user-entered text, including password. Then you'll use that password to create new user and send email.
0
0
0
0
2012-01-02T05:25:00.000
1
0.197375
false
8,697,664
0
0
1
1
How can I mail a decrypted 'current password' to a django user just created. eg I create a customer by inheriting the User model. Hence the user name and password get saved. Once the customer details are entered and saved. While overriding the save function for the customer form I trigger the send_mail function to send the mail to the admin_email specified on the form, and send the user name and password I entered on the form. It is observed that the password sent is hashed, of course for security. Is there a way in which I could decrypt it before sending it to the customer just created? I want to send it that way only. Please guide
How to maintain when Django switches to Python 3?
8,698,193
2
6
270
0
python,django,python-3.x
Django (due to the immense amount of code running on it), will not, atleast in the near future, drop support for 2.x. It just doesn't make any sense. Any Python 3 is having trouble getting adoption right now; PyPy is picking up much, much faster. And, there's py2to3 which converts some parts to python 2 code to python 3, and then you have to do the rest by hand.
0
0
0
0
2012-01-02T06:44:00.000
3
0.132549
false
8,698,140
0
0
1
1
I am in the process of learning Python and had a question about the future. I know it's not the most pressing thing to think about currently, but I'm curious. Currently, Django only supports up to Python 2.7. However, in the near future, it will be supporting Python 3. In terms of writing code in Python 2.7 and using the related Django framework, what happens when the transition to Python 3 actually comes along. Presumably, I'd learn and code in the newer version. However, what about maintaining the old code? Does it stay as is? Does it need to be rewritten? I'm just curious as to how these transition work. Also, does it make a difference that Python 3 isn't backwards-compatible? What is the consequence of that? For instance, I read that Ruby versions 1.8 to 1.9 (and even the future 2.x) were backwards-compatible and less of a leap (than Python 2.x to 3.x). I wonder if that split between Python versions creates any fragmentation problems or code maintenance problems? So, if someone could try explaining to me what goes on with these updates and the issues at hand when dealing with them, I'd really appreciate it. Thanks!
How would I create "Omegle"-like random chat with gevent?
8,712,328
1
1
2,300
0
python,gevent
If I've understood you right, you just need to link the second person with someone connected before. Think it's simple. The greenlet working with a person who comes first ('the first greenlet') just register somewhere it's inbound and outbound queues. The greenlet working with the second person gets this queues, unregister them and use for chat messages exchange. The next person's greenlet finds out that there is no registered in/out queues, registers its own and waits for the fourth. An so on. Is it what you need?
0
0
0
1
2012-01-02T14:39:00.000
1
1.2
true
8,702,080
0
0
1
1
I have searched tutorials and documentation for gevent, but seems that there isn't lots of it. I have coded Python for several years, also I can code PHP + JavaScript + jQuery. So, how would I create Omeglish chat, where one random person connects and then waits for another one to connect? I have understood that Omegle uses gevent, but my site would have to hold 200 - 1000 people simultaneously. Besides the server side, there should be fully functional client side too and I think it should be created with jQuery/JavaScript. I would need little help with the coding part. I can code Python well, but I have no idea how I would make that kind of chat system nor what would be the best Python library for it. The library doesn't have to be gevent but I have heard that it's very good for stuff like this. Thanks.
Generating IDs how to make IDs same length using zeroes?
8,709,167
1
0
171
0
python,google-cloud-datastore
"always(?)" indeed. Sweden = 46 looks like you mean the telephone not-necessarily-a-country code which is VARIABLE LENGTH ... for example CHINA = 86, HONG KONG (not a country) = 852, CANADA = USA = 1. Is your ID allowed to be variable length or not? If it is allowed to be variable, you would need do str(countrycode) + str(n).zfill(10) ... this allows n to be up to 10 digits. Otherwise, for a fixed total length of 12 digits, you would need str(countrycode) + str(n).zfill(12 - len(str(countrycode)))
0
0
0
0
2012-01-03T00:53:00.000
3
0.066568
false
8,706,850
0
0
1
1
Update: The requirement is "fixed length 9 digits" so 460 000 000 138 should be 460 000 138 I want to generate IDs on a special form such as 460 000 000 138 where 46 is the country code and the rest is the ID and this number always(?) has the same number of digits ie four pairs of threes. My input is this ID that can be expected to be lower than some largest number. When starting the project from scratch the ID could be 1 and then just autoincrement as long as IDs don't collide (I probably would want a sequential count but that is tricky in distributed environment where actions can happen at the same time. So input could be for example 138. I now want to fill with zeros and the country number, in this case Sweden (46) so the output should be 460 000 000 138 Similarly, if input is 1138 the output should be on the same form an fill with less zeroes ie 460 000 001 138 So I don't know how many zeroes I need. Can you help me? The solution should be in python. I will probably use the entity ID, fill with zeroes and add the country code and can you help me find an algorithm in python for that? Any help is greatly appreciated
What packaging option are available for python/django
8,717,036
0
0
182
0
python,django
Do you think you have to share your source code if you host your application on a 'shared hosting' provider? That's not the case. Your source code should still be private to you but the administrators of your hosting provider can get it too. Other normal Joe Users of the service shouldn't have access to your source code, or your database too. If they do, then get another shared hosting provider!
0
0
0
0
2012-01-03T16:33:00.000
3
0
false
8,715,370
1
0
1
2
I am starting on developing a django application on a shared webhosting server(alwaysdata.com). I would like to understand what are the packaing options available to package a django application (preferably in compiled form) I would like to setup the source code repository on my system and build using the python packaging and deploy the package on alwaysdata.com. I would like the option of not having to share the source code on alwaysdata.com. Looking at pip , I am not able to find this option. EDIT A few more clarification: I would need the ability to not share the sourcecode since it contains the "API secret key" which I would not want to compromise. The more I look into it , the more i believe that there is no way for me to distribute binary only distribution.
What packaging option are available for python/django
8,733,563
1
0
182
0
python,django
How is this API key used? Is it a google maps api? Is it provided in scripts that go to the browser? If so, it's already out in the open, anyone using your site will see it, so you're trying to provide a $100 lock for a $0.01 piece of information. If it's a google maps api, it's not secured by keeping it hidden, but rather it's tied to a domain/directory (IIRC). Can you share a little more what the API key is and is for, then maybe we can help you find a better solution to keep it secure.
0
0
0
0
2012-01-03T16:33:00.000
3
0.066568
false
8,715,370
1
0
1
2
I am starting on developing a django application on a shared webhosting server(alwaysdata.com). I would like to understand what are the packaing options available to package a django application (preferably in compiled form) I would like to setup the source code repository on my system and build using the python packaging and deploy the package on alwaysdata.com. I would like the option of not having to share the source code on alwaysdata.com. Looking at pip , I am not able to find this option. EDIT A few more clarification: I would need the ability to not share the sourcecode since it contains the "API secret key" which I would not want to compromise. The more I look into it , the more i believe that there is no way for me to distribute binary only distribution.
Controlling http streams with python threads
8,718,262
1
0
114
0
python,multithreading,http,pycurl,python-multithreading
I would suggest to have one controling thread which spawns http streaming threads, and such a streaming thread implements the proper handling for a connection loss or timeout (e.g. either terminating itself or telling to controling thread that a new streaming thread should be spawned for a reconnect). Depending on your http serving peer you could also try to continue an interrupted stream by using the http Content-Range feature.
0
0
0
0
2012-01-03T20:19:00.000
1
0.197375
false
8,718,081
1
0
1
1
I am implementing an app consuming a few http streams at the same time. All threads (a pycurl object each) are spawned in the same loop. The trick is how to build a proper architecture for handling reconnects. Is it a good practice to create a separate controller thread that somehow checks which connections are not alive or need forced reconnect? Or may be such task should be done inside separate processes?
Is there a Python equivalent to PHP-FPM?
8,718,932
1
2
1,732
0
python,nginx,php
How about supervisor with uwsgi?
0
0
0
1
2012-01-03T21:28:00.000
1
1.2
true
8,718,870
0
0
1
1
I'm starting a web project in Python and I'm looking for a process manager that offers reloading in the same manner as PHP-FPM. I've built stuff with Python before and Paste seems similar to what I want, but not quite. The need for the ability to reload the process rather than restart is to allow long-running tasks to complete uninterrupted where necessary.
Django and Rails - what should I expect in a Windows environment?
8,722,898
1
1
306
0
python,ruby-on-rails,windows,django,windows-7
I am using Django on Windows Vista and it works very well. I am using sqlite, mysql and postgres. mysql install is a bit tricky: I recommend to download the right binaries from the web. I am using popular django apps and python modules without any problem. However, I've made a quick test with GeoDjango and noticed that it doesn't work out-of-the-box, mainly because of Postgis. It's juste a little feedback. I hope it helps
0
0
0
0
2012-01-03T23:11:00.000
1
1.2
true
8,719,976
0
0
1
1
I work in an environment that is totally .NET. However, over the past few months I've been learning Ruby and Rails on the side and enjoying it very much. I have been using Windows 7 to develop - along with Aptana - and so far things have gone better than I expected. I have run into a few issues with gems on windows - various gems with event-machine dependencies often blow up on me while installing. Also, deploying to Heroku can sometimes be an issue because of x86 references being put into Gemfile.lock. The biggest issue though, is that there have been a couple of projects at work that could have been tackled quite well with Rails - except for the fact that all of our apps must run in-house on IIS. I've recently been thinking of similar frameworks and languages such as Python and Django, and wondering (mainly just to satisfy curiosity): Would I have less - or more - issues developing with Python + Django on a Windows platform? (Especially running on Windows servers) It would be great to get some input from those who have tried both, but if you could point out some benefits vs pitfalls to one or the other, that would be much appreciated.
What does an image look like as a Blob?
8,722,451
2
1
2,977
0
python,image,google-app-engine,blob
"Blob" stands for "Binary Large OBject". It's bytes. Just instantiate a db.Blob, passing the bytes.
0
1
0
0
2012-01-04T05:29:00.000
2
0.197375
false
8,722,427
0
0
1
1
I am working on an AppEngine application, to store images, they have to be stored in a BlobProperty. Is there a Mac/Linux way to convert images to their Blob representation or is there any tool (especially online) that can do this?
Python urlretrieve image
8,735,741
1
0
664
0
python,image
I know it sounds dumb but, speaking of experience, check that the device on which the script is saving the files is not full (or have permission problems or whatever). Modify your script to print out the URL instead of downloading the file. See if the URL is well printed and if there's no strange character that may be misinterpreted (including space). If you are still in trouble, please post the script so we can have a look.
0
0
1
0
2012-01-04T19:58:00.000
1
1.2
true
8,733,163
0
0
1
1
I'm downloading around 200 images from url's using urlretrieve. They all download correctly except for one. I have opened the url in my browser and the image loads correctly. urlretrieve downloads something for that image but it doesn't open. It gives me an error "The file xxx.jpg could not be opened." and it shows it's 1kb and no dimensions. When I manually save the image is shows as 289 kb and 1280x986. Does anyone have any ideas what the problem might be?
AppEngine Datastore query with inequality and sort (different attribute). Workaround?
8,735,561
2
0
177
0
python,google-app-engine
No, there's no way around this. This limitation exists due to how indexes are constructed. You'll simply have to do either the sorting or the filtering in memory, just as other databases would.
0
1
0
0
2012-01-04T20:16:00.000
1
1.2
true
8,733,403
0
0
1
1
Hey guys I know this is an old issue but I am wondering if there any news about it: I have a simple query where I want to do: filter('created >=', somedatetime).order('-counter') I tried: filter('created >=', somedatetime).order('-created').order('-counter') but because created is a datetime the results are pretty bad. A user can go through a list with infinite scrolling and we can choose a time window of 7,30,90 days but it seems I cannot this very simple query. I was thinking of break created to two attributes (dayofyear, year) so that I could use the IN operator but this could be hard as I have about 2M entries. Any ideas?
open an ssh tunnel from heroku python app on the cedar stack?
8,735,515
1
1
476
0
python,ssh,heroku,paramiko,cedar
Can you please post the STDERR of ssh -v -L .....? May be you need to disable the tty allocation and run ssh in batch mode.
0
0
1
1
2012-01-04T23:16:00.000
2
0.099668
false
8,735,487
0
0
1
1
Is it possible to open a non-blocking ssh tunnel from a python app on the heroku cedar stack? I've tried to do this via paramiko and also asyncproc with no success. On my development box, the tunnel looks like this: ssh -L local_port:remote_server:remote_port another_remote_server
Can I somehow tell to SAX parser to stop at some element and get its child nodes as a string?
8,744,989
1
3
1,889
0
python,xml,sax,saxparser
I don't believe it's possible with the xml.sax. BeautifulSoup has SoupStrainer which does exactly that. If you're open to using the library, it's quite easy to work with.
0
0
1
0
2012-01-05T15:00:00.000
4
0.049958
false
8,744,604
0
0
1
1
I have pretty big XML documents, so I don't want to use DOM, but while parsing a document with SAX parser I want to stop at some point (let's say when I reached element with a certain name) and get everything inside that element as a string. "Everything" inside is not necessary a text node, it may contain tags, but I don't want them to me parsed, I just want to get them as text. I'm writing in Python. Is it possible to solve? Thanks!
I have two django sites. How can I tell if a user is already authenticated on one of them?
8,754,198
1
2
120
0
python,django,authentication,single-sign-on
Use a session backend that uses a common store (a database, or redis), which is accessible to both; or openid as suggested by alf.
0
0
0
0
2012-01-05T23:05:00.000
1
0.197375
false
8,751,208
0
0
1
1
I have two sites that are very closely linked and both are built with django. They have the same set of users. How would I tell on one site if the user is authenticated on the other?
Is it possible to return a reference property in an App Engine computed property?
8,752,433
2
0
86
0
python,google-app-engine,model,reference
To do this you'd have to write your own custom Property subclass. You should be able to do so by examining the code behind ComputedProperty and ReferenceProperty; in effect you'd be combining the two.
0
1
0
0
2012-01-06T01:06:00.000
1
1.2
true
8,752,168
0
0
1
1
I have a model with an attribute that is a reference to another model. The model it references depends on some logic. Is there a way to have a computed property that gives me the same ReferenceProperty niceties (reverse references, dereferencing)? So far I the computed property stores a db.Key, but this is not optimal. Can I have a Computed Reference Property?
Grabbing a .jsp generated PNG in Python
8,758,625
1
0
214
0
python,jsp,png,screen-scraping,mechanize
If you use urllib correctly (for example, making sure your User-Agent resembles a browser etc), the "gibberish" you get back is the actual file, so you just need to write it out to disk (open the file with "wb" for writing in binary mode) and re-read it with some image-manipulation library if you need to play with it. Or you can use urlretrieve to save it directly on the filesystem. If that's a jsp, chances are that it takes parameters, which might be appended by the browser via javascript before the request is done; you should look at the real request your browser makes, before trying to reproduce it. You can do that with the Chrome Developer Tools, Firefox LiveHTTPHeaders, etc etc. I do hope you're not trying to break a captcha.
0
0
1
0
2012-01-06T12:56:00.000
1
1.2
true
8,758,131
0
0
1
1
I am trying to grab a PNG image which is being dynamically generated with JSP in a web service. I have tried visiting the web page it is contained in and grabbing the image src attribute; but the link leads to a .jsp file. Reading the response with urllib2 just shows a lot of gibberish. I also need to do this while logged into the web service in question, using mechanize. This seems to exclude the option of grabbing a screenshot with webkit2png or similar. Thanks for any suggestions.
Archetypes vs. Dexterity for new content types and new field types
8,760,668
5
2
641
0
python,plone
As the initial developer of Dexterity, I'm quite biased, but: Dexterity is cleaner and more 'modern' Dexterity is more consistent with the rest of modern Zope and Plone Dexterity has less boilerplate and Dexterity types generally use less code Dexterity lets you evolve from through-the-web schemata to filesystem development without throwing away your work and starting from scratch Dexterity arguably has more/better documentation than Archetypes (see plone.org/products/dexterity as well as my book Professional Plone 4 Development) Dexterity is stable and seems to be the preferred choice for many 'new' projects These points are basically the reason Dexterity was started, so they're not accidental. Archetypes will certainly not go away any time soon, and will probably exist as part of Plone core and (possibly, eventually) and add-on for a long, long time. At the end of the day, you can see them both as different ways to create CMF types, which is all it is underneath. I think the main decision point right now, apart from any legacy concerns, is multilingual support. There is no good story to replace LinguaPlone, although there are some efforts underway to try to rectify that. Martin
0
0
0
0
2012-01-06T13:39:00.000
2
1.2
true
8,758,666
0
0
1
1
I've been out of the Plone world for a few years (since about Plone 2.5) and I'm trying to get my bearings as to where to invest my time creating new content types, specifically, with new custom fields (including custom view & edit widgets). Can someone help me understand the decision points between Archetypes versus Dexterity? I've written AT-based products before, so I've got some familiarity with the infrastructure there. I'm also slowly dusting off my Zope 3 memories. Some specifics: What does the future look like for Dexterity versus AT? Is AT going to be replaced by Dexterity? If I write an AT-based product, will it need to be ported to Dexterity eventually? What provides an easier developer experience for custom field types, custom widgets, and custom views? How does deploying a custom workflow with Dexterity work? What about migrating existing content from an older version of my product to a newer one? Thanks!
How to give delay between each requests in scrapy?
33,116,540
7
51
47,919
0
python,web-scraping,scrapy
Delays Can we set in 2 says:- We can specify the delay while running the crawler. Eg. scrapy crawl sample --set DOWNLOAD_DELAY=3 ( which means 3 seconds delay between two requests) Or else we can specify Globaly in the settings.py DOWNLOAD_DELAY = 3 by default scrapy takes 0.25 seconds delay between 2 requests.
0
0
1
0
2012-01-07T08:44:00.000
6
1
false
8,768,439
0
0
1
1
I don't want to crawl simultaneously and get blocked. I would like to send one request per second.
Display user group of logged in user in django admin change_form.html?
8,769,513
2
1
1,211
0
python,django
Not sure if you can do it directly in the template though you can try iterating over user.groups.all()
0
0
0
0
2012-01-07T11:50:00.000
1
1.2
true
8,769,455
0
0
1
1
How to display user group of logged in user in django admin change_form.html ? I want to display the group name of the logged in user in the change_form of a model. Eg I am able to display the user name by using {{ user }} tag. How to display {{ user.groups__name }}
Learning Django - Good starter project
8,772,447
2
8
1,466
0
python,django,project
If you want to use payment processing you should probably make a store of some sort . I for one have a kikstarter/rockethub clone project queued in my want-to-do projects list . But you should try thinking at something that you would use and isn't out there at the moment , something that would solve some needs of yours , that way you kill 2 birds with one stone . Or try making the old book store webapp but use Facebook/Twitter/Google etc ... API's and add html5 functionality to the site ... the possibilities are endless .
0
0
0
0
2012-01-07T19:24:00.000
2
1.2
true
8,772,368
0
0
1
2
I am presently embarking to learn Python and Django together and I have gained a fair bit of theoretical knowledge to help me out. However, I'm after a good project that I can dig into which will offer me experience in Python, Django, MySQL, HTML5, CSS3, and various initiatives such as OpenID and maybe even payment processng such as PayPal. I'm at a loss as to where to begin. I really want to code something functional, not just "hello world" or "list of book/author/publisher" examples. Did anybody have a similar situation when learning to code? I would love to hear ideas and past experiences. I suppose this would apply to any language, not just Python/Django. Thanks!
Learning Django - Good starter project
9,969,956
1
8
1,466
0
python,django,project
Some suggestions: A personal blog. A social network, think about something... a Social network for Cat Lovers ? for Hunters ? Do free stuff for you'r friends/family or even advertise yourself. Improve an already existing website. You don't like Google ? Build a better Search Engine !
0
0
0
0
2012-01-07T19:24:00.000
2
0.099668
false
8,772,368
0
0
1
2
I am presently embarking to learn Python and Django together and I have gained a fair bit of theoretical knowledge to help me out. However, I'm after a good project that I can dig into which will offer me experience in Python, Django, MySQL, HTML5, CSS3, and various initiatives such as OpenID and maybe even payment processng such as PayPal. I'm at a loss as to where to begin. I really want to code something functional, not just "hello world" or "list of book/author/publisher" examples. Did anybody have a similar situation when learning to code? I would love to hear ideas and past experiences. I suppose this would apply to any language, not just Python/Django. Thanks!
Advanced screen-scraping using curl
8,773,176
1
0
686
0
python,curl,screen-scraping
You could observe what requests are made when you click the button (using Firebug in Firefox or Developer Tools in Chrome). You may then be able to request the PDF directly. It's difficult to help without seeing the page in question.
0
0
1
0
2012-01-07T20:37:00.000
4
0.049958
false
8,772,935
0
0
1
2
I need to create a script that will log into an authenticated page and download a pdf. However, the pdf that I need to download is not at a URL, but it is generated upon clicking on a specific input button on the page. When I check the HTML source, it only gives me the url of the button graphic and some obscure name of the button input, and action=".". In addition, both the url where the button is and the form name is obscured, for example: url = /WebObjects/MyStore.woa/wo/5.2.0.5.7.3 input name = 0.0.5.7.1.1.11.19.1.13.13.1.1 How would I log into the page, 'click' that button, and download the pdf file within a script?
Advanced screen-scraping using curl
8,773,567
2
0
686
0
python,curl,screen-scraping
Try mechanize or twill. HttpFox or firebug can help you to build your queries. Remember you can also pickle cookies from browser and use it later with py libs. If the code is generated by javascript it could be possible to 'reverse engineer' it. If nof you can run some javascript interpret or use selenium or windmill to script a real browser.
0
0
1
0
2012-01-07T20:37:00.000
4
1.2
true
8,772,935
0
0
1
2
I need to create a script that will log into an authenticated page and download a pdf. However, the pdf that I need to download is not at a URL, but it is generated upon clicking on a specific input button on the page. When I check the HTML source, it only gives me the url of the button graphic and some obscure name of the button input, and action=".". In addition, both the url where the button is and the form name is obscured, for example: url = /WebObjects/MyStore.woa/wo/5.2.0.5.7.3 input name = 0.0.5.7.1.1.11.19.1.13.13.1.1 How would I log into the page, 'click' that button, and download the pdf file within a script?
How to make a pretty Python web app?
20,160,269
0
2
7,102
0
python,ajax,web,web-frameworks
I found interesting web2py framework, easy to install, and it has o lot of features as "from the box"
0
0
0
0
2012-01-07T20:52:00.000
5
0
false
8,773,029
0
0
1
1
I'm looking for a python web framework that is easy to use and allows me to generate some nice looking user interfaces on the fly. I have not much experience with web development and don't want to spent much time to learn internals. So far I use cherrypy and mako templating to serve the app. My problem is, it just looks awful. I'd like to have some nice (maybe AJAX?) features available to make the app a little bit more fancy. My app is a simple search site without any database connection. So I have a main page where the user enters the search string and a result page. In the end it should look like the Goole search, with some hover effects for the results, nice keyboard controls, maybe even something similar like the page preview from Google. So to achieve this, should I use a different framework or do I need to write the CSS and javascript by hand? What options do I have? Thanks!
Changing privacy of old Facebook posts using the Graph API
8,781,271
1
4
740
0
php,python,facebook,api,facebook-graph-api
1) Nope. 2) Yes, you can use the Graph API and HTTP Get me/feed?until={date}
0
0
1
0
2012-01-08T16:29:00.000
1
1.2
true
8,779,159
0
0
1
1
So I was flicking through my Facebook Timeline, and started to look at some old posts I made in 2009~2010. And they're a bit stupid and I'd like to remove them or change the privacy settings on them. There are too many to do it individually, so I've been looking at the Graph API. However, I have been unable to find anything about changing the privacy settings of posts, or even searching for posts made in a specific date range. So here is the information that I want: Is it possible to change privacy settings for OLD posts via the Graph API? Is it possible to search the Graph API for posts in a particular date range? Preferably before 31st December 2010. If it is possible, how do you do it!?
Python alternative to Java applet?
8,787,013
6
9
11,614
0
java,python,physics,simulation
In this day and age, you might look to the HTML 5 canvas & JS.
0
0
0
0
2012-01-09T10:16:00.000
6
1
false
8,786,842
0
0
1
1
Is there an alternative to making educational Java applets for physics simulations like projectile motion, gravity, etc?
Get n'th element with given class name with WebDriver
8,788,422
2
2
2,275
0
python,webdriver
There is a find_elements_by_class_name, notice the elements (plural) method which returns an iterator. To find the n'th element simply replace num: find_elements_by_class_name('className')[num] This should return all DOM elements with the same class name.
0
0
1
0
2012-01-09T12:16:00.000
1
1.2
true
8,788,299
0
0
1
1
I'm using .find_element_by_class_name() to get an element with a given class name. It seems that the returned element is the first with the class name. How can I get the n'th element with that class name? Also, is it possible to get all the DOM elements with a given class name?
Test how my website appears to a program
8,795,433
3
0
101
0
python,html,google-app-engine,browser,search-engine
Some search engines cannot index dynamic pages. Not true. Clients cannot know and do not care if the server got the content by executing a script or just reading a static file. Most search engines won't execute client side JavaScript. Most search engines will not submit forms. If your content is accessible by following links (that are in the HTML), then search engines can get the pages.
0
0
0
0
2012-01-09T21:20:00.000
2
0.291313
false
8,795,361
0
0
1
1
A website may be accessed not only by a user on a browser, but also programs, bots and crawlers. I have a website running on Google App Engine with python which has non-static HTML pages that are generated by a python program by combining, merging and looping strings. However, they are also not dynamic pages in the sense that no user input is required to generate these pages. The content generation by python is solely for convenience, brevity and ease of maintenance, and is set completely by the url. Some search engines cannot index dynamic pages. I would like to know if these pages qualify as 'dynamic', i.e. whether they can be crawled or indexed for the usual metadata and content by such bots, and in general would like a way to check how any url appears to a bot or crawler like the ones used by search engines, so that I can see when a certain url is uncrawlable. If anyone knows of any resources or techniques available, it'd be really helpful.
Handling GAE BlobStore Exception via webapp2 handler
8,797,080
3
1
194
0
python,google-app-engine,requesthandler
The 413 is generated by the App Engine infrastructure; the request neve reaches your app, so it's impossible to handle this condition yourself.
0
1
0
0
2012-01-09T22:12:00.000
1
0.53705
false
8,795,879
0
0
1
1
I have been banging my head around on this issue for a bit and have not come up with a solution. I am attempting to trap the exception UploadEntityTooLargeEntity. This exception is raised by GAE when 2 things happen. Set the max_bytes_total param in the create_upload_url: self.template_values['AVATAR_SAVE_URL'] = blobstore.create_upload_url('/saveavatar, max_bytes_total= 524288) Attempt to post an item that exceeds the max_bytes_total. I expect that, since my class is derived from RequestHandler that my error() method would be called. Instead I am getting a 413 screen telling me the upload is too large. My request handler is derived from webapp2.RequestHandler. Is it expected that GAE will work with the error method derived from webapp2.RequestHandler? I'm not seeing this in GAE's code but I can't imagine there would be such an omission.
Securing communication [Authenticity, Privacy & Integrity] with mobile app?
8,799,339
-1
34
6,963
0
android,iphone,python,django,security
Use client authentication with SSL or just layer your own client authentication (username/password, token, etc) on top of server-authentication SSL. (Edit: Moving the comment here, since it won't fit as a comment) To elaborate a bit, any authentication info needs to be stored or entered in the app. If you have people enter the password each time, you don't need to save it, but that's clearly inconvenient. You can encrypt it with a device-specific key, so it's not visible on rooted devices. With a private key, you need to either protect it with a user entered password (see above) or have it protected by the system. That is only available since Android 4.0 (ICS) with the public API to the system keystore, the KeyChain class. In this case, the user needs to unlock (using pattern/password or PIN) the phone to access the keystore.
0
0
0
0
2012-01-10T04:51:00.000
3
-0.066568
false
8,798,707
0
0
1
1
An Android/Iphone app will be accessing application data from the server. [Django-Python] How can I secure the communication with the mobile app ? Expectation : Secure enough for sensitive information like passwords, there shall be no direct way of decryption except brute-forcing. My requirements : Authentication [Only the app is authorized] Integrity [Messages should not be modified in between] Privacy [Communication should not be readable if sniffed] My effort: SSL authenticates only the Server, not the client. I can-not use a symmetric encryption [Provides only Privacy] Digital signature is not possible [Lacks Privacy] PGP full-fills all 3 requirements. Problem : PGP requires to store keys on client app. There seems to be no assuring way of securing keys on client app. If the key is out, then PGP or Symmetric encryption are equally vulnerable. Reverse-Engineering PGP keys or symmetic keys is equally hard. In that case PGP is a non-sense burden on the mobile processor. OAuth is again useless, since it also have a client key. So, how can/should I move forward on this ? How does the industry deals with this ? Should I implement casual approach : Use simple SSL and cross my fingers ?, since authentication is not possible if the keys are stolen? (Only server authentication is possible with this) Update: Conclusion was to use AES, since if I can keep the key secure then I am as good as SSL. Plus I can keep changing the key over-time for better security. Contribute if you think there is a better way, do read the entire post before posting.
URLFetch behind a Proxy Server on App Engine Production
8,807,655
3
6
2,065
0
python,google-app-engine,proxy,urlfetch
You can always roll your own: In case of fixed destination: just setup a fixed port forwarding on a proxy server. Then send requests from GAE to proxy. If you have multiple destinations, then set forwarding on separate ports, one for each destination. In case of dynamic destination (too much to handle via fixed port forwarding), your GAE app adds a custom http header (X-Something) containing final destination and then connects to custom proxy. Custom proxy inspects this field and forwards the request to the destination.
0
1
0
0
2012-01-10T07:27:00.000
2
1.2
true
8,799,886
0
0
1
1
Is there a way to specify a proxy server when using urlfetch on Google App Engine? Specifically, every time I make a call using urlfetch, I want GAE to go through a proxy server. I want to do this on production, not just dev. I want to use a proxy because there are problems with using google's outbound IP addresses (rate limiting, no static outbound IP, sometimes blacklisted, etc.). Setting a proxy is normally easy if you can edit the http message itself, but GAE's API does not appear to let you do this.
Django-cms and Editorial workflows
8,821,441
1
4
1,990
0
python,django,workflow,django-cms
When you turn on CMS_MODERATION in Django-CMS, you will get three icons next to each page in the page list view. From left to right, these control whether changes to this page will require moderator approval whether changes to this page's children will require moderator approval whether changes to this page's descendents will require moderator approval When you create or change a page, you will be able to save it, and preview the page or new version of the page on your site, but it will require moderator approval before the page or new version of the page is visible to end users.
0
0
0
0
2012-01-10T16:28:00.000
2
1.2
true
8,806,705
0
0
1
1
I need to implement workflows in my Django-CMS application at work. But form the Django-CMS feature list, we can read: Editorial workflow Workflows for publishing and approval. I tried to search for it and didn't find anything. I've search the Django-CMS documentation (http://docs.django-cms.org/en/latest/index.html) and couldn't find something there either. Does anyone has a clue about Workflows in Django-CMS (especially for the pages system) ?
Parsing and splitting multiple HTML pages without having a clue
8,854,322
1
0
218
0
python,regex,html-parsing,data-mining
If you need to do classification given the content of pages, I would suggest you to take a look at NLTK (http://www.nltk.org/), a natural language toolkit of open source python modules. Don't just try to look at occurrences of e.g. "report" in the the pages. A report may or may not have "report" as a title or in the content. You can use NLTK to find terms related to your keywords (e.g. success rates vs. approval rates), or from the same family (e.g. description vs. described). Take a look at the pages' contents and try to define what sets them apart from the others. For instance, a page with comments will probably have expressions such as "I think that", "in my opinion" and subjective terms, usually adjectives and adverbs, like "good", "quickly", "horrible", etc. A report is unlikely to have such words in it. Apart from the content, the structure of the page may vary from category to category. If you intend to analyse that, maybe using Beautiful Soup (http://www.crummy.com/software/BeautifulSoup/) for parsing is a good idea.
0
0
1
0
2012-01-11T09:56:00.000
2
0.099668
false
8,817,296
0
0
1
1
I have the some 50 raw HTML page contents which are relevant to my project. I am not sure these contents are having unique pattern. I need to parse the contents from all pages and has to be classified based on the keywords. Keywords all like that 'REVIEWS',"REPORTS","FEEDBACK","DESCRIPTION","COMMENTS","SUCCESS RATES","FAILURE RATES" The crawled HTML content has to be classified and mapped to the relevant keywords. Also need to be split the contents and it's headers from the page for comparison I am using Python. Would you please suggest the way to do this? Which will be suitable to choose? How the idea has to be organised?
what's the popular and recommendatory lightweight java(or python?) web application framework?
8,831,216
0
2
3,214
0
java,python,frameworks,web
Spring MVC 3 is in my experience the most flexible extensible and speedy web framework around Spring's main purpose was to introduce Dependency Injection for objects. Another Java lightweight MVC frameworks is Wicket. Stripes framework Lightweight Action based Convention over configuration approach No XML Smart and fun to use Much positive feedback (search on SO)
0
0
0
0
2012-01-12T06:23:00.000
5
0
false
8,830,977
0
0
1
2
I need to develop a lightweight web application, it will: have a simple webgui for administrator to operate; have interface to invoke background existing modules for functionality implement, let's assume it has shell invoke interface firstly, it is not clear yet. so my question is do we have any popular and recommendatory lightweight java web application framework? one of my candidate is jboss, do we have the recommendatory jboss version? we ever done a similar work which use python/flask, i just want to see if any other appropriate java framework. thanks, Emre
what's the popular and recommendatory lightweight java(or python?) web application framework?
8,831,308
0
2
3,214
0
java,python,frameworks,web
Wonder why Struts has not found place in above list ? Is it too heavy ?
0
0
0
0
2012-01-12T06:23:00.000
5
0
false
8,830,977
0
0
1
2
I need to develop a lightweight web application, it will: have a simple webgui for administrator to operate; have interface to invoke background existing modules for functionality implement, let's assume it has shell invoke interface firstly, it is not clear yet. so my question is do we have any popular and recommendatory lightweight java web application framework? one of my candidate is jboss, do we have the recommendatory jboss version? we ever done a similar work which use python/flask, i just want to see if any other appropriate java framework. thanks, Emre
How could I do this kind of scheduled task in AppEngine Python?
8,838,811
2
0
170
0
python,google-app-engine
You've said that you're storing the target time in the Alarm table. So, your cron just has to run every minute (or every 5 or 10, depending on the resolution of your alarms) and check if there's an alarm matching the current time, and if so then do the action.
0
1
0
0
2012-01-12T15:46:00.000
2
1.2
true
8,837,899
0
0
1
1
I have a form with a text field for entering a number without decimal places representing an amount of minutes that will have to be added to the current time and will be inserted into a table named Alarm. When the resulting time comes, my web app must make an insert operation over another table. For example, if the user enters 20 minutes, and the current time is 22:10, the result time will have to be 22:30 and will be inserted into Alarm table. So, when the 22:30 arrives, a new insert will have to be made over the another table. How can I do this on AppEngine using Python?
Custom logs in AppEngine
8,848,350
3
2
228
0
python,google-app-engine,logging
I had a similar logging in my app, and what I did is to set up a simple servlet in a self-hosted server that receives the log string and level and store them in our local database. Each time I need this kind of log, I use asynchronous URLFetch to send the data from our app to our logging server. I could store the log data in the datastore, but then I would lose the option to do full text search of my log strings, which in my experience is invaluable when you're sifting through log files. I could also store the log in an external file and grep only the lines that I need.
0
1
0
0
2012-01-12T16:08:00.000
2
1.2
true
8,838,243
0
0
1
2
I have an application for which I would like to record some statistics for later analysis but which are not at all needed within the application itself. i.e. The data will never need to be read by the application. Whatever system is used for storing these statistics, I just need to be able to take periodic dumps of the data. I could use the logging built into AppEngine, but then it will display in the application logs. I would like to keep the application logs for debugging the application without having to see other custom information every time I check them. How would you do this? Edit: More details on the stats. Each time a user completed a particular task (1-3 times a day) we need to store details about that task. Such as time and order of events. These would be stored in a single string per session - 1-2kB.