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
Persistence for a python (cherrypy) web application?
9,832,722
0
2
456
1
python,web-applications,persistence,cherrypy
I have developed a transparent persistent storage system for python this is currently in an alpha-stage. Once you create a persistent object, you can access and modify its attributes using standard python syntax (obj.x=3;) and the persistence is done behind the scenes (by overloading the setattr methods, etc.). Contact me if you are interested in learning more. -Stefan
0
0
0
0
2012-03-13T05:49:00.000
3
0
false
9,678,989
0
0
1
2
I am trying rewrite a simple Rails application I made a while ago with cherrypy and Python3. So far I have been unable to find a Python replacement for ActiveRecord (the persistence part of the application). Most of the recommendations I've found on StackOverflow have been for SQL Alchemy. I looked into this and it seems much too complicated to get up and running. After reading its online docs and a book from Amazon, It's still not clear how to even proceed; not a good sign. So my question is, what are developers using to persist data in their python3 web applications? Also, I looked into Django but python3 is a requirement so that's out. Thanks
Persistence for a python (cherrypy) web application?
9,679,132
1
2
456
1
python,web-applications,persistence,cherrypy
SQL Alchemy is a industrial standard is no choice. But it's not as difficult as it seems at first sight
0
0
0
0
2012-03-13T05:49:00.000
3
0.066568
false
9,678,989
0
0
1
2
I am trying rewrite a simple Rails application I made a while ago with cherrypy and Python3. So far I have been unable to find a Python replacement for ActiveRecord (the persistence part of the application). Most of the recommendations I've found on StackOverflow have been for SQL Alchemy. I looked into this and it seems much too complicated to get up and running. After reading its online docs and a book from Amazon, It's still not clear how to even proceed; not a good sign. So my question is, what are developers using to persist data in their python3 web applications? Also, I looked into Django but python3 is a requirement so that's out. Thanks
How to prevent FCGI request timeout in Django
9,686,346
4
3
4,285
0
python,django,fastcgi
Timeout is in webserver, not in Django. You make a request to webserver and get a response from it, so you can't get anything outside of that response. In your case you should create a background task on server, usually getting started by cron or celery (it hink you can't run celery on hostgator so use cron) with a queue of tasks. On the cliend side you periodically make requests to server using AJAX, so you can check status of a task and display notification if it is completed.
0
0
0
0
2012-03-13T08:52:00.000
2
0.379949
false
9,680,836
0
0
1
1
I have a webhook which takes a little time to complete (around 5 minutes). However, the request gets timeout after around 30 seconds. I am on a shared hosting with HostGator and using FCGI for deployment. I think the request gets timed-out as there is not HTTPResponse until the request is processed. If I can generate some HTTPResponse from view while the request is processed, the script might be able to run longer. [P.S.: Earlier I tried Google App Engine, where using print 'hi' would print 'hi' in browser instead of logging it. Is the same possible with Django. Doing so might send response even while the request completes.] (I was told on Django IRC that even I was able to get print to send message as response, it will only throw out when Httpresponse is returned.) Thus it was suggested to use Httpresponse with an iterable.
Asynchronous versions of Google APIs?
9,948,934
0
6
2,692
0
python,google-app-engine,google-docs-api
Currently the Documents List API library for Python (The GData Library) is rigidly synchronous. One solution would be to serialize the requests as tasks for a task queue and run them later, but the library itself won't help, I'm afraid.
0
1
0
0
2012-03-13T14:54:00.000
2
1.2
true
9,686,505
0
0
1
1
Is there any way to queue up document list API requests and handle them asynchronously (similar to the google app engine async urlfetch requests)? I could conceivably copy/rewrite a lot of the client request modification logic in DocsClient around a urlfetch request, but I'd rather avoid that if there's some other method already available. The target environment is google app engine, and I'm aware of the async datastore APIs. EDIT I've now implemented basic functionality on DocsClient.request to accept a callback kwarg, so any higher-level client request will use async urlfetch and call the callback function with the result of the call.
Does app engine automatically cache frequent queries?
9,689,883
1
3
1,313
1
python,google-app-engine,memcached,bigtable
I think that app engine does not cache anything for you. While it could be that, internally, it caches some things for a split second, I don't think you should rely on that. I think you will be charged the normal number of read operations for every entity you read from every query.
0
1
0
0
2012-03-13T18:06:00.000
3
0.066568
false
9,689,588
0
0
1
2
I seem to remember reading somewhere that google app engine automatically caches the results of very frequent queries into memory so that they are retrieved faster. Is this correct? If so, is there still a charge for datastore reads on these queries?
Does app engine automatically cache frequent queries?
9,690,080
1
3
1,313
1
python,google-app-engine,memcached,bigtable
No, it doesn't. However depending on what framework you use for access to the datastore, memcache will be used. Are you developing in java or python? On the java side, Objectify will cache GETs automatically but not Queries. Keep in mind that there is a big difference in terms of performance and cachability between gets and queries in both python and java. You are not charged for datastore reads for memcache hits.
0
1
0
0
2012-03-13T18:06:00.000
3
0.066568
false
9,689,588
0
0
1
2
I seem to remember reading somewhere that google app engine automatically caches the results of very frequent queries into memory so that they are retrieved faster. Is this correct? If so, is there still a charge for datastore reads on these queries?
Beginner advice on how to use FTP or SSH? (django)
9,698,149
0
0
676
0
python,django,ftp,web-hosting
There are different tools for FTP and SSH file transfer. Which one is best for you depends on your environment (e.g. operating system) and your needs (do you want a graphical or command line interface?). But basically it's always a program you run on your machine that connects to a server to upload files. You don't do anything through a web site (except finding out which server to connect to and maybe setting up an account / password).
0
0
0
0
2012-03-14T05:13:00.000
3
0
false
9,696,294
0
0
1
1
I'm in the midst of trying to get my first website up and running all of the sudden I get to the point where I need to get my file online and I have zero idea on how to do that. I thought it would be as easy as selecting your files and clicking upload but so far it has not been that easy. Currently I'm using djangoeurope.com. So if anyone has experience with that site that would help extra.
Avoid folders in Resources folder from being build or compile
9,706,293
0
1
332
0
python,build,titanium,titanium-mobile,appcelerator-mobile
Ajeet, I believe you can create a directory for android and iphone inside the resources folder that you can keep your platform-specific code/assets in. I think the compiler recognizes this.
1
0
0
0
2012-03-14T11:00:00.000
1
0
false
9,700,623
0
0
1
1
I am building a Titanium mobile project. I have some folders with some .JS files in the Resources folder. The problem I ran into is that I need to exclude some of the folder while building for iphone but those folder are needed in my android build. I looked into the python files in the SDK folder and found out that there are separate file i.e. builder.py for iphone and android. While building for android or ios all of my JS files gets build, which i dont want as it increases my app size. As for now i have successfully edited the builder.py file so that it copies the selected folder into my iphone resources folder. It runs fine on simulator but when i tried running on the device i got error saying .js file missing. I know that my copied .Js files were not archived Can anyone help me in configuring that builder.py so that we can exclude some folders from getting build.
can i use plone workflow to manage autocad related drawings?
9,704,631
4
1
150
0
python,plone
You can change the workflow used for File objects, or indeed copy the File type in portal_types to a a new Drawing type and change the workflow for that new type if you want to treat them differently to standard files in your CMS.
0
0
0
0
2012-03-14T11:21:00.000
1
0.664037
false
9,700,942
0
0
1
1
How can I use Plone 4.1.4 to manage autocad drawings with different roles like architect, sr.architect, Project Manager, accounts manager(who manages the user accounts). I would first of all like to know whether Plone can be used to crease a workflow for uploaded autocad drawing files or for uploaded files as such? Doubt arises due to certain plone documentation which say that plone By default, content types Image and File have no workflow. I wish to track the comments and changes made by the different user roles to the drawing files as well provide a lock i.e iterate through the working copy of the drawing files that have been uploaded. Can anyone suggest the best approach to this project using Plone?
Django: Extracting a `Q` object from a `QuerySet`
9,703,606
5
8
1,110
0
python,django,django-orm,django-q
No, but you could create the Q object first, and use that; alternatively, create your query as a dict, and pass that to your filter method and the Q object.
0
0
0
0
2012-03-14T14:06:00.000
3
1.2
true
9,703,511
0
0
1
1
I have a Django QuerySet, and I want to get a Q object out of it. (i.e. that holds the exact same query as that queryset.) Is that possible? And if so, how?
Server side or Javascript calculations?
9,705,930
2
4
1,820
0
javascript,python,django,django-templates
This depends a lot on what you are trying to do. If the chart is dynamic and animated, doing it client side with js may be the only choice. It also depends on how much data you have. I would not recommend doing it in js if you have over 10mb of raw data.
0
0
0
0
2012-03-14T16:21:00.000
3
0.132549
false
9,705,852
0
0
1
2
In general is it better for performance to do lots of data calculations on the server side or on the javascript side? I have a bunch of data that i'm displaying on a page - and I'm wondering if I should format/ parse/ make calculations on that data on the server side (in python) and return a template or if I should return the data as is and do all my calculating/ formatting on the javascript side? Are there any general rules of thumb when making these decisions? Examples of things i'm calculating - converting timestamps to dates.
Server side or Javascript calculations?
9,708,096
1
4
1,820
0
javascript,python,django,django-templates
In addition to the facts stated by thedk, you should also keep in mind that calculations you do on client side are more likely to fail because the client may not fulfill certain preconditions. Think of disabled JavaScript or an unreliable internet connection. You generally have no control over your data as soon as it has left the server. So, it would be highly advisable to move only unimportant calculations to the client side. Something like datetime formation might be okay, but don't try to parse your whole website with JavaScript. Your website should work (and look acceptable) even if JavaScript is disabled on the client.
0
0
0
0
2012-03-14T16:21:00.000
3
0.066568
false
9,705,852
0
0
1
2
In general is it better for performance to do lots of data calculations on the server side or on the javascript side? I have a bunch of data that i'm displaying on a page - and I'm wondering if I should format/ parse/ make calculations on that data on the server side (in python) and return a template or if I should return the data as is and do all my calculating/ formatting on the javascript side? Are there any general rules of thumb when making these decisions? Examples of things i'm calculating - converting timestamps to dates.
Do files with filesystem caching in Django delete after timeout?
9,707,962
1
0
970
0
python,django
The filesystem cache in Django works like any of the other caches, when the timeout value expires, the cache is "invalidated". In the case of files, that means it will be deleted/overwritten. If you want long-term storage, you need to use a a long-term storage solution (Django's cache framework is specifically not a long-term storage solution). Just save the tweets to your DB or manually to a file. You can still implement caching in addition to this, but you need to handle the long-term storage end.
0
0
0
1
2012-03-14T18:22:00.000
1
1.2
true
9,707,816
0
0
1
1
I'm using Django to power a site where I pull in tweets from twitter timelines for use (for about 50 different people). I want to keep a large dictionary of all the tweets in a cache so I don't have to poll twitter every page-refresh. Right now I have it so when it retrieves tweets (30) from twitter, it saves it in the default cache with the key being that user's ID. However, I want it to save these in the long-term so the list of tweets for a user grows over time. My question is, if I save them using the file-system cache instead, will the files themselves (pickled dictionaries) get deleted after the timeout value, or will it just re-read them into the cache from the file? That way, I could still add to the file over time. Thanks!
Either json or Soap to exchange data in my project?
9,716,132
5
1
181
0
php,python,json,zend-framework,serialization
Use JSON for data serialization. It's clean, simple, compact, widely supported, and understands data types. Use SOAP only if you like pain. It is a bloated sack of cruft built upon another bloated sack of cruft.
0
0
1
0
2012-03-15T06:21:00.000
3
1.2
true
9,714,877
0
0
1
3
I am doing a car rental software, in which a front end back end are there, where the back end will do the accounting part. I have to send some data like customer name, amount, currency etc. to account engine to prepare the ledgers. I am confused whether to use json or soap for information exchange between front and back ends. ur suggestions are precious. thank u..
Either json or Soap to exchange data in my project?
9,720,556
3
1
181
0
php,python,json,zend-framework,serialization
Use JSON. My argument is that JSON maps directly to and from native data types in common scripting languages. If you use Python, then None <-> null, True <-> true, False <-> false, int/float <-> Number, str/unicode <-> String, list <-> Array and dict <-> Object. You feel right at home with JSON. If you use PHP, there should be similar mappings. XML is always a foreign language for any programming language except Scala.
0
0
1
0
2012-03-15T06:21:00.000
3
0.197375
false
9,714,877
0
0
1
3
I am doing a car rental software, in which a front end back end are there, where the back end will do the accounting part. I have to send some data like customer name, amount, currency etc. to account engine to prepare the ledgers. I am confused whether to use json or soap for information exchange between front and back ends. ur suggestions are precious. thank u..
Either json or Soap to exchange data in my project?
9,720,841
0
1
181
0
php,python,json,zend-framework,serialization
Depending on your needs, you could use both. For example, using XML bindings you get the (de)serialization of the data going across the wire for free. That is, if you're going to be POSTing lots of data to your web-service, and want to avoid calling the equivalent of "request.getParameter" for each parameter and building your own objects and creating/registering different servlets for each endpoing, the bindings can save in development time. And for the response, you can have the payload be defined as a String and return JSON text, which gives you the benefits of that compact, javascript-friendly of that notation.
0
0
1
0
2012-03-15T06:21:00.000
3
0
false
9,714,877
0
0
1
3
I am doing a car rental software, in which a front end back end are there, where the back end will do the accounting part. I have to send some data like customer name, amount, currency etc. to account engine to prepare the ledgers. I am confused whether to use json or soap for information exchange between front and back ends. ur suggestions are precious. thank u..
Large scale machine learning - Python or Java?
9,722,329
11
34
12,549
0
java,python,machine-learning,nltk,mahout
I think one big thing Java has going for it is Hadoop. If you really mean large scale, you'll want to be able to use something like that. Generally speaking Java has the performance advantage, and more libraries available. So: Java.
0
0
0
0
2012-03-15T13:41:00.000
3
1
false
9,720,894
0
0
1
3
I am currently embarking on a project that will involve crawling and processing huge amounts of data (hundreds of gigs), and also mining them for extracting structured data, named entity recognition, deduplication, classification etc. I'm familiar with ML tools from both Java and the Python world: Lingpipe, Mahout, NLTK, etc. However, when it comes down to picking a platform for such a large scale problem - I lack sufficient experience to decide between Java or Python. I know this sounds like a vague question, and but I am looking for general advice on picking either Java or Python. The JVM offers better performance(?) over Python, but are libraries like Lingpipe etc. match up with the Python ecosystem? If I went this Python, how easy would it be scaling it and managing it across multiple machines etc. Which one should I go with and why?
Large scale machine learning - Python or Java?
9,735,214
5
34
12,549
0
java,python,machine-learning,nltk,mahout
If you are looking at NoSQL databases fit for ML task, then Neo4J is one of the more production ready (relatively) and capable of handling BigData, it is native to JAVA but comes along with a beautiful REST API out of the box and hence can be integrated with the platform of your choice. JAVA will give you an performance edge here.
0
0
0
0
2012-03-15T13:41:00.000
3
0.321513
false
9,720,894
0
0
1
3
I am currently embarking on a project that will involve crawling and processing huge amounts of data (hundreds of gigs), and also mining them for extracting structured data, named entity recognition, deduplication, classification etc. I'm familiar with ML tools from both Java and the Python world: Lingpipe, Mahout, NLTK, etc. However, when it comes down to picking a platform for such a large scale problem - I lack sufficient experience to decide between Java or Python. I know this sounds like a vague question, and but I am looking for general advice on picking either Java or Python. The JVM offers better performance(?) over Python, but are libraries like Lingpipe etc. match up with the Python ecosystem? If I went this Python, how easy would it be scaling it and managing it across multiple machines etc. Which one should I go with and why?
Large scale machine learning - Python or Java?
9,723,569
18
34
12,549
0
java,python,machine-learning,nltk,mahout
As Apache is going strong producing excellent stuff like Lucene/Solr/Nutch for Search, Mahout for Big Data Machine Learning, Hadoop for Map Reduce, OpenNLP for NLP, lot of NoSQL stuff. The best part is the big "I" which stands for integration and these products can be integrated with each other well as of course in most situations they (these products) complement each other. Python is great too however if you consider above from ASF then I will go with Java like Sean Owen. Python will always be available for the above but mostly like Add on's and not the actual stuff. For example you can do Hadoop using Python by using Streaming etc. I partially switched from C++ to Java in order to utilize some of the very popular Apache products like Lucene, Solr & OpenNLP and also other popular open source NoSQL Java products like Neo4j & OrientDB.
0
0
0
0
2012-03-15T13:41:00.000
3
1.2
true
9,720,894
0
0
1
3
I am currently embarking on a project that will involve crawling and processing huge amounts of data (hundreds of gigs), and also mining them for extracting structured data, named entity recognition, deduplication, classification etc. I'm familiar with ML tools from both Java and the Python world: Lingpipe, Mahout, NLTK, etc. However, when it comes down to picking a platform for such a large scale problem - I lack sufficient experience to decide between Java or Python. I know this sounds like a vague question, and but I am looking for general advice on picking either Java or Python. The JVM offers better performance(?) over Python, but are libraries like Lingpipe etc. match up with the Python ecosystem? If I went this Python, how easy would it be scaling it and managing it across multiple machines etc. Which one should I go with and why?
Can you share an example of using class based view with MonthMixin?
10,783,975
0
0
362
0
python,django
Think of CBV, more specifically "Generic Class Based Views" as a large tree of Python classes. Starting with the simplest class. Each one subclasses and over rides methods from one another. For example, the ArchiveIndexView is typically the view you will sub-class for the index of your site. It adds an extra context variable called latest. You must supply it with a date_field, num_latest, and a couple optionals in the view class. You can also pass these arguements in through the URLConf. However, it is more tidy and clean to have the logic in the views.py . It is quite convenient once you get the hang of it. You can create mixins of your own that essentially are as powerful as your brain. Beyond, a mixin though for something you want available on every page then perhaps a template tag or a custom context processor at worst.
0
0
0
0
2012-03-15T16:59:00.000
2
0
false
9,724,539
0
0
1
1
I have a news on my site done with "James Bennett - Practical Django Projects, 2nd Edition (2009)". So I am using a date-based views, which will be deprecated in django-1.4. How can I just convert my views and urls to class-based views ? May be you have seen this, please just post a link, I can't find any working example, at least for MonthMixin.
bottle framework: getting requests and routing to work
10,681,349
0
1
693
0
python,bottle
I actually resolved the issue. The Bottle framework tutorial encourages first-time users to set up the server on a high port (to avoid conflict with apache, etc) for development. I was missing two parts of the process: 1. import the python script so that it can be called from the main bottle file 2. in the main bottle file, add a route to the api link (for the javascript to work) I'm not sure if I would have had to add the route if I was running the server on port 80
0
1
0
0
2012-03-15T20:25:00.000
1
1.2
true
9,727,608
0
0
1
1
I have written a webapp using traditional cgi. I'm now trying to rewrite it with bottle The page is simple...the user fills out a form, hits submit and the data object is sent to a python script that used to live in my cgi-bin The python script generates an image, and prints the url for that image out to standard out On callback, I use javascript to display the newly generated image on the page formatted with html. The issue that I'm having with bottle is getting the image-generating script to execute when it receives the post request. I'm used to handling the post request and callback with javascript (or jquery). should I be using a bottle method instead?
Binding a wx.html2.WebView.New Widget?
9,742,560
0
2
419
0
python,wxpython,wxwidgets
I don't think you are missing anything, this hasn't yet been implemented. Mouse and keyboard events are high on my todo list though, I will update this question when they have been added.
1
0
0
0
2012-03-16T01:49:00.000
1
0
false
9,730,769
0
0
1
1
I would like to bind the wx.html2.WebView.New widget with wx.EVT_LEFT_UP however it doesnt work (it doesnt get noticed, nothing happens). Is there anything i am missing?
Google App Engine library imports
9,748,040
0
0
2,099
0
python,google-app-engine,google-api,google-api-client,google-api-python-client
The packages needs to be locally available, where did you put the packages, in the Python folder or in your project folder?
0
1
1
0
2012-03-17T04:30:00.000
2
0
false
9,747,258
0
0
1
1
I've been experimenting with the Google App Engine, and I'm trying to import certain libraries in order to execute API commands. I've been having trouble importing, however. When I tried to execute "from apiclient.discovery import build", my website doesn't load anymore. When I test locally in IDLE, this command works.
Download a URL only if it is a HTML Webpage
9,750,658
2
0
103
0
python,download,html-parsing,beautifulsoup,printing-web-page
Use http.client to send a HEAD request to the URL. This will return only the headers for the resource then you can look at the content-type header and see if it text/html. If it is then send a GET request to the URL to get the body.
0
0
1
0
2012-03-17T13:50:00.000
1
1.2
true
9,750,481
0
0
1
1
I want to write a python script which downloads the web-page only if the web-page contains HTML. I know that content-type in header will be used. Please suggest someway to do it as i am unable to get a way to get header before the file download.
How to handle dynamic URLs while crawling online stores?
9,753,135
0
0
205
0
python,url,dynamic
If you parsing some product pages, usually these URLs have some kind of product id. Find the pattern to extract product id from URLs, and use it to filter already visited URLs.
0
0
1
0
2012-03-17T19:08:00.000
1
1.2
true
9,752,891
0
0
1
1
I am crawling online stores for price comparison. Mot of the stores are using dynamic URLs heavily. This is causing my crawler to spend lot of time on every online stores. Even though most of them have only 5-6k unique products, they have unique URLs >= 300k. Any idea how to get around this. Thanks in advance!
change directory (python) doesnt work in localhost
9,757,219
6
0
213
0
python,google-app-engine,python-2.7
AppEngine restricts you from doing things that don't make sense. Your AppEngine application can't go wandering all over the filesystem once it is running on Google's servers, and Google's servers certainly don't have a C: drive. Whatever you are trying to accomplish by changing directories, it's something that you need to accomplish in a different way in an AppEngine application.
0
1
0
0
2012-03-18T09:15:00.000
1
1
false
9,757,203
0
0
1
1
import os os.chdir("c:\Users") works in the command prompt but not on localhost (google app engine.) can anyone help.
Include variables in template context on every page with Bottle.py
26,185,476
0
7
1,518
0
python,templates,flask,bottle
Note: this same solution can be used with the other template engines. The technique is exactly the same, but you use BaseTemplate (it works for all template classes) or the class for the engine you want to use.
0
0
0
0
2012-03-18T15:33:00.000
3
0
false
9,759,558
0
0
1
1
Is there a bottle.py equivalent of context processors that you get in Flask?
How to use Coffeescript on Google App Engine
9,764,949
2
2
1,031
0
python,google-app-engine,coffeescript,go
Coffeescript compiles to Javascript, which can be run in a web browser. In that case, App Engine can serve up the resulting javascript. I don't know of any way to compile coffeescript to python, java or go though, so you can't use it as a server side language.
0
1
0
0
2012-03-19T04:03:00.000
2
1.2
true
9,764,895
0
0
1
1
Does anyone know if it is possible to use Coffeescript on Google App Engine? If so how can this be done with the app engine Python or Go platforms?
Insert static files literally into Jinja templates without parsing them
9,767,951
6
19
18,579
0
python,jinja2
Try putting the syntax in the other files in {% raw %} {% endraw %} You can use jQuery if you dont want to edit the external files: Make a dive to contain the content <div id="contentoffile"></div> and use jquery to load the file : $("#contentoffile").load("url to file") << the url can be relative
0
0
0
0
2012-03-19T09:20:00.000
5
1
false
9,767,585
0
0
1
1
I'm trying to insert file into a page using Jinja 2.6 using the include tag. This worked fine until I started using characters in the file that are reminiscent of the Jinja syntax, at which point it realized it couldn't parse them and bombed. Short of going though the file and escaping all characters, what can I do to tell Jinja to just include the file as is?
openerp schedule server action
10,222,065
0
4
1,470
0
python,openerp
i dont know but i think you can also use the sheduled actions in administration->shedular->sheduled actions or else ir.cron is the best option for sheduling outgoing emails
0
0
0
1
2012-03-17T17:03:00.000
3
0
false
9,771,171
0
0
1
3
In OpenERP 6.0.1, I've created a server action to send a confirmation email after an invoice is confirmed, and linked it to appropriately to the invoice workflow. now normally when an invoice is confirmed, an email is automatically sent. is there a way to set a date for when the email should be sent instead of being sent immediately? like "send email after one week of confirmation" ?
openerp schedule server action
9,784,730
9
4
1,470
0
python,openerp
There is a one object ir.cron which will run on specific time period. There you can specify the time when you want to sent the mail. This object will call the function which you given in Method attribute. In this function you have to search for those invoices which are in created state. Then check the date when it created and if its >=7 days then send mail. Or You can create ir.cron on specific workflow action of the invoice which will have Next Execution Date as after the 7 or 8 days.
0
0
0
1
2012-03-17T17:03:00.000
3
1.2
true
9,771,171
0
0
1
3
In OpenERP 6.0.1, I've created a server action to send a confirmation email after an invoice is confirmed, and linked it to appropriately to the invoice workflow. now normally when an invoice is confirmed, an email is automatically sent. is there a way to set a date for when the email should be sent instead of being sent immediately? like "send email after one week of confirmation" ?
openerp schedule server action
10,615,931
0
4
1,470
0
python,openerp
With OpenERO 6.1 New Email Engine has Email Queue so what you just need to do it queue your Email on that email queue and we already have one Scheduled Action which processes this email queue at defined interval, so what you can do it you can change the trigger time of the same action. and you can see the email Engine api for how to queue your emails in email queue. Regards
0
0
0
1
2012-03-17T17:03:00.000
3
0
false
9,771,171
0
0
1
3
In OpenERP 6.0.1, I've created a server action to send a confirmation email after an invoice is confirmed, and linked it to appropriately to the invoice workflow. now normally when an invoice is confirmed, an email is automatically sent. is there a way to set a date for when the email should be sent instead of being sent immediately? like "send email after one week of confirmation" ?
Practical server side includes with Python on Google App Engine
9,782,676
0
0
1,024
0
python,google-app-engine,server-side-includes,static-files
Or use a framework like django, which will help in inheritance of templates.
0
1
0
0
2012-03-19T15:43:00.000
2
0
false
9,773,232
0
0
1
1
Is there a decent way to "simulate" server side includes using Python on Google App Engine? I would really like to split my static html files up into smaller pieces for two reasons: They will be easier to manage from a development perspective HTML that is redundant across multiple pages can be more easily re-used and updates to the HTML will show on all pages instead of having to copy and paste updates
Dynamic number of Steps using Django Wizard
9,778,474
2
3
1,832
0
python,django,wizard,django-formwizard
What do you want to do ? If you want to create a wizard where step x is repeated n times then answer is yes, you can do that and it is not that hard. You just need to create a wizard class factory that creates the class given specific parameters and you're done. In case you mean, can I change the steps of a wizard on-the-fly. answer is still yes but then things will get a bit more complicated than that since you will have to change the internal state of the wizard after its initialization. This is not fun at all, if you really need the second option I really suggest to think about it, try to find an alternative design and choose the dynamic wizard approach as last resort.
0
0
0
0
2012-03-19T21:01:00.000
3
0.132549
false
9,777,879
0
0
1
1
Is possible that the steps of the wizard are dynamic? For example, the second step occur repeatedly n times?
How to detect parent class fields
9,784,966
2
1
139
0
python,django
First of all, avoid any design where you need to do this. Perhaps you should be getting separate parent objects? However, you can do this by examining the ._meta.fields property of any django model instance.
0
0
0
0
2012-03-20T10:02:00.000
2
0.197375
false
9,784,627
0
0
1
1
I have a parent class and a child class which inherits parent. In a child class object, I need to differentiate between parent class fields and child class fields. Is this information available? If so, where. Need solution in Python, specifically Django.
django code which runs event independent
9,787,902
0
0
91
0
python,django,web-applications,backend
Write a management command and daemonize it with supervisord. By the way, technically django itself is running continuously and not only when view is called. What are you trying to acheive?
0
0
0
0
2012-03-20T13:23:00.000
4
0
false
9,787,621
0
0
1
2
I am creating a web application in django and I want to create a backend app which runs continuously instead of running only when the "view" is called. How do I do this ? Any help would be appreciated. Thank you.
django code which runs event independent
9,787,680
0
0
91
0
python,django,web-applications,backend
Django is not especially for this; that said, you can use django's facilities, and just write a programme that executes continuously.
0
0
0
0
2012-03-20T13:23:00.000
4
0
false
9,787,621
0
0
1
2
I am creating a web application in django and I want to create a backend app which runs continuously instead of running only when the "view" is called. How do I do this ? Any help would be appreciated. Thank you.
Google App Engine Development and Production Environment Setup
9,793,302
0
1
398
0
django,google-app-engine,github,development-environment,python-2.7
I'm on a pretty similar setup, though I'm still runing on py2.5, django-nonrel. 1) I usually use 'git status' or 'git gui' to see if I forgot to check in files. 2) I personally don't check in my datastore. Are you familiar with .gitignore? It's a text file in which you list files for git to ignore when you run 'git status' and other functions. I put in .gaedata as well as .pyc and backup files. To manage the database I use "python manage.py dumpdata > file" which dumps the database to a json encoded file. Then I can reload it using "python manage.py loaddata". 3) I don't know of any deploy from git. You can probably write a little python script to check whether git is up to date before you deploy. Personally though, I deploy stuff to test to make sure it's working, before I check it in.
0
1
0
0
2012-03-20T13:58:00.000
1
1.2
true
9,788,264
0
0
1
1
Here is my current setup: GitHub repository, a branch for dev. myappdev.appspot.com (not real url) myapp.appspot.com (not real url) App written on GAE Python 2.7, using django-nonrel Development is performed on a local dev server. When I'm ready to release to dev, I increment the version, commit, and run "manage.py upload" to the myappdev.appspot.com Once testing is satisfactory, I merge the changes from dev to main repo. I then run "manage.py upload" to upload the main repo code to the myapp.appspot.com domain. Is this setup good? Here are a few issues I've run into. 1) I'm new to git, so sometimes I forget to add files, and the commit doesn't notify me. So I deploy code to dev that works, but does not match what is in the dev branch. (This is bad practice). 2) The datastore file in the git repo causes issues. Merging binary files? Is it ok to migrate this file between local machines, or will it get messed up? 3) Should I be using "manage.py upload" for each release to the dev or prod environment, or is there a better way to do this? Heroku looks like it can pull right from GitHub. The way I'm doing it now seems like there is too much room for human error. Any overall suggestions on how to improve my setup? Thanks!
Google AppEngine and Threaded Workers
9,790,858
5
0
152
0
python,multithreading,google-app-engine,queue
You can use "backends" or "task queues" to run processes in the background. Tasks have a 10-minute run time limit, and backends have no run time limit. There's also a cronjob mechanism which can trigger requests at regular intervals. You can fetch the data from external servers with the "URLFetch" service.
0
1
0
0
2012-03-20T14:21:00.000
2
0.462117
false
9,788,635
0
0
1
2
I am currently trying to develop something using Google AppEngine, I am using Python as my runtime and require some advise on setting up the following. I am running a webserver that provides JSON data to clients, The data comes from an external service in which I have to pull the data from. What I need to be able to do is run a background system that will check the memcache to see if there are any required ID's, if there is an ID I need to fetch some data for that ID from the external source and place the data in the memecache. If there are multiple id's, > 30 I need to be able to pull all 30 request as quickly and efficiently as possible. I am new to Python Development and AppEngine so any advise you guys could give would be great. Thanks.
Google AppEngine and Threaded Workers
9,809,659
1
0
152
0
python,multithreading,google-app-engine,queue
Note that using memcache as the communication mechanism between front-end and back-end is unreliable -- the contents of memcache may be partially or fully erased at any time (and it does happen from time to time). Also note that you can't query memcache of you don't know the exact keys ahead of time. It's probably better to use the task queue to queue up requests instead of using memcache, or using the datastore as a storage mechanism.
0
1
0
0
2012-03-20T14:21:00.000
2
0.099668
false
9,788,635
0
0
1
2
I am currently trying to develop something using Google AppEngine, I am using Python as my runtime and require some advise on setting up the following. I am running a webserver that provides JSON data to clients, The data comes from an external service in which I have to pull the data from. What I need to be able to do is run a background system that will check the memcache to see if there are any required ID's, if there is an ID I need to fetch some data for that ID from the external source and place the data in the memecache. If there are multiple id's, > 30 I need to be able to pull all 30 request as quickly and efficiently as possible. I am new to Python Development and AppEngine so any advise you guys could give would be great. Thanks.
Django ajax error response best practice
9,799,831
18
12
10,297
0
jquery,python,ajax,django
If you return a response with a status code of 4xx or 5xx this is a an error and will trigger jQueries error handler. While it is certainly possible to simple return status 200 every time and use a "error" field in the JSON response (like suggested by dm03514) this is bad for two reasons: It violates good HTTP practice. There is a reason why there are plenty of error-codes defined You can't use the fact that jQuery already has a error-Handler that lets you separate normal behavior from error handling. Most of the time the error response will be much different from the non-error response So it simply makes no sense to put the handling of this messages in one piece of JS code. So, to sum things up, use a JSON response with status 200 for your normal responses and return a (appropriate!) 4xx/5xx response for errors. These can carry JSON payload, too, so your server side can add additional details about the error.
0
0
0
0
2012-03-21T01:02:00.000
5
1.2
true
9,797,253
0
0
1
1
I'm using ajax to improve user experience in my Django project. My concern here is how to respond error to browser properly. As far as I know, I can either: validate request data piece by piece and guard exception one by one. If something bad happens, raise Http404 or other exception to explicitly announce an error has occurred. Or just write code without exception handling and suppose it will work. If something bad happens, the uncaught exception would cause an internal server error, which is still an error for the browser For me, the fisrt method seems more orthodox , as in Python the philosophy of "Explicit is better than Implicit" really counts. But since all sorts of exception checking are removed from the second one, it is cleaner, less fragmented and more readable. I'm using jQuery to handle ajax request/response and both methods seem working. My questions are: Are both methods acceptable? Will the second method fail for other Javascript libraries? What is the best practice for this? PS. I do do essential data validation. Please do not stray the topic for that. :)
Installing easy_install, NOT SO EASY
19,903,084
0
1
4,633
0
python,path,beautifulsoup,easy-install
I'd Try to download the source .py files, find the setup.py files and run in command line: <path_to_source_archive>\setup.py install this usually works when easy_install stutters.
0
0
0
0
2012-03-21T01:53:00.000
3
0
false
9,797,613
0
0
1
1
I am trying to install easy_install in order to use BeautifulSoup... However I have no clue what my PATH directory is... when I run easy_install BeautifulSoup.. I get error: Not a recognized archive type: C:\docume~1\tom\locals~1\temp\weasy_install-w6haxs\BeautifulSoup-3.2.1.tar.gz I am guessing this has something to do with the PATH that is not set up right in Environment Varibales..... But I have no clue what my Path should be... Any help would be appreciated... I am very new to all of this so speaking english rather than programming would be appreciated lol..
Unit-testing client-server interaction in Twisted
9,799,162
0
3
963
0
python,unit-testing,twisted
I don't know much about Twisted or how you set up your system under test, but could you start two servers on a single thread? One of them would be the one you are testing and another would be just a dummy that can accept any request. In addition to that, the dummy would store info that it has received the call. After initiating the operation on the first server that causes it to call the second one, you could then assert that the second one has received a request.
0
0
1
0
2012-03-21T05:07:00.000
2
0
false
9,798,910
0
0
1
1
In my latest Python project, utilizing Twisted, I've tried to be good at using the unittest module. At a high level, I'm building two RESTful APIs designed specifically to talk to each other. For most requests, I can just use DummyRequest and test the rendered values against an expected constant and that's been working fine. However, I've got a few cases where the design requires a request on one server that (among other things) then sends a request to the other server, but doesn't really care about the response. What matters is that the request happens. Like I said, I can test that functionality on the other side perfectly fine, but I'm getting stumped on how to test to ensure that the data was sent over. My ideas so far are either Set up a dummy test server that just checks to see if the request was made and validates the input - Seems flaky and too much effort Set up a decorator to wrap certain tests and modify urllib.urlopen to report when it was called, what we tried to retrieve, and allow me to simply return a known result there. I'm leaning towards the second option as it seems more pythonic, but also a bit hacky. Thoughts?
Sending image to server: http POST vs custom tcp protocol
9,805,325
0
0
739
0
python,sockets,wsgi
In my opinion HTTP is an ideal protocol for sending files or large data, and its very common use, easy to suit any situation. If you use a self-created protocol, you may find it hard to transform when you get other client needs, like a web API. Maybe the discussions about HTTP's lack of instantaneity and agility make you hesitate about choosing HTTP, but that mostly something about instant messaging and server push, there are better protocols. But when it comes to stability and flexiblity, HTTP is always a good choice.
0
0
1
0
2012-03-21T12:32:00.000
2
0
false
9,804,674
0
0
1
1
I am working out how to build a python app to do image processing. A client (not a web browser) sends an image and some text data to the server and the server's response is based on the received image. One method is to use a web server + WSGI module and have clients make a HTTP POST request (using multipart/form-data). The http server then 'works out' the uploaded image and other data that the program can use. Another method is to create a protocol that only sends the needed data and is handled within the application. The application would be doing everything (listening on the port, etc). Is one of these a stand-out 'best' way (if yes, which one?), or is it more up to preference (or is there another way which is better)?
Untangle Django (How should I start going at a lot of legacy code of several years with django that started in 0.97)
9,808,401
0
0
166
0
python,django
This is probably a place where lots and lots of tests will help you. It's not my project, but here's what I'd probably do: Start a completely new project in Django 1.4 Write front-end tests for the current application Write a script to migrate the database from 0.93 to 1.4 (it sounds like you have lots of special cases, with your patches, so I hold no hope for anything automated) Write lots of unit tests for the 1.4 application. Take it module by module, and eventually you'll have everything updated. I know it sounds like a lot of work, but it will save you time in the long run. Also, the expertise on 0.93 is slowly dying as we move further and further away from it, so you're better off staying current. That way, you can take advantage of all the new techniques for performance and such that are coming out today.
0
0
0
0
2012-03-21T15:39:00.000
2
0
false
9,807,920
0
0
1
1
So herein lies my question. Django project that was originally developed several years ago when django was still 0.97 version. The code was continuously built on to the point where I think band aids upon bandaids on top of bandaids is not going to cut it. How can I start with untangling this django project? Currently the project is in 1.2.7 Python being used is 2.6 The main thing I want to find out is what have been the most common traps that people fell into when developing a django project. *The unit tests are most definitely one place to catch problems, but I was thinking of something more general. For example several pages take a very long time to load, if anyone had similar problems what were their solutions?
GAE wait response from other source
9,808,831
1
0
68
0
android,python,http,google-app-engine
You don't seem to have understood how web applications work. They don't wait for signals - or, rather, that's all they do. Every page served by a Web service is in response to a signal, ie a request. Your web service just needs to respond to normal requests in the normal way.
0
1
0
0
2012-03-21T15:56:00.000
1
0.197375
false
9,808,250
0
0
1
1
I don't know how to present the title more clearly. I want build a site on Google app engine (GAE), and one app on android. The site on GAE should wait the signal which is from the app on android and handle the signal to do something. I don't know how to search the "keyword" on Google of waiting signal on GAE, or what method should I use. Is here have anyone who have some related experiment on it ? Thank you very much.
using celery with pyramid and mod_wsgi
9,813,506
1
0
530
0
python,celery,pyramid,celeryd
There are technically ways you could use Apache/mod_wsgi to manage a process distinct from that handling web requests, but the pain point is that Celery will want to fork off further worker processes. Forking further processes from a process managed by Apache can cause problems at times and so is not recommended. You are thus better of starting up Celery process separately. One option is to use supervisord to start it up and manage it.
0
0
0
1
2012-03-21T16:17:00.000
1
1.2
true
9,808,628
0
0
1
1
I've been able to deploy a test application by using pyramid with pserve and running pceleryd (I just send an email without blocking while it is sent). But there's one point that I don't understand: I want to run my application with mod_wsgi, and I don't understand if I can can do it without having to run pceleryd from a shell, but if I can do something in the virtualhost configuration. Is it possible? How?
Reverse Engineer a program working as a webservice, the future?
9,811,793
0
1
276
0
python,web-services,open-source,reverse
Yes, All they could do is treat your web service as a black box, query the WSDL for all the parameters it accepts and the data that it returns. They could then submit different variables and see what different results are. The "code" could not be seen or stolen (with proper security) but the inputs and outputs could be duplicated. If you want to secure your "very secret code" a web service is a great way to protect the actual code. -sb
0
0
0
1
2012-03-21T19:38:00.000
3
0
false
9,811,655
0
0
1
3
First I want to clearify that I mean by reverse engineering something like "decompiling" and getting back the original source code or something similiar. Yesterday I read a question about someone who wanted to protect his python code from "getting stolen" in other words: he didn't like that someone can read his python code. The interesting thing I read was that someone said that the only reliable way to "protect" his code from getting reverse engineered is by using a Webservice. So I could actually only write some GUIs in Python, PHP, whatever and do the "very secret code" I want to protect via a Webservice. (Basically sending variables to the host and getting results back). Is it really impossible to reverse engineer a Webservice (via code and without hacking into the Server)? Will this be the future of modern commercial applications? The cloud-hype is already here. So I wouldn't wonder. I'm very sorry if this topic was already discussed, but I couldn't find any resources about this. EDIT: The whole idea reminds me of AJAX. The code is executed on the server and the content is sent to the client and "prettified". The client himself doesnt see what php-code or other technology is behind.
Reverse Engineer a program working as a webservice, the future?
9,812,028
1
1
276
0
python,web-services,open-source,reverse
Wow, this is awesome! I've never thought it this way, but you could create a program that crawls an api, and returns as an output a django/tastypie software that mimics everything the api does. By calling the service, and reading what it says, you can parse it, and begin to see the relationships between objects inside the api. Having this, you can create the models, and tastypie takes it from this point. The awesome thing about this, is that normal people (or at least not backend developers) could create an api just by describing what they want to be as an output. I've seen many android/iphone developers creating a bunch of static xml or json, so they can call their service, and start the frontend development. Well what if that was enough? Take some xml/json files as input, get a backend as an output.
0
0
0
1
2012-03-21T19:38:00.000
3
1.2
true
9,811,655
0
0
1
3
First I want to clearify that I mean by reverse engineering something like "decompiling" and getting back the original source code or something similiar. Yesterday I read a question about someone who wanted to protect his python code from "getting stolen" in other words: he didn't like that someone can read his python code. The interesting thing I read was that someone said that the only reliable way to "protect" his code from getting reverse engineered is by using a Webservice. So I could actually only write some GUIs in Python, PHP, whatever and do the "very secret code" I want to protect via a Webservice. (Basically sending variables to the host and getting results back). Is it really impossible to reverse engineer a Webservice (via code and without hacking into the Server)? Will this be the future of modern commercial applications? The cloud-hype is already here. So I wouldn't wonder. I'm very sorry if this topic was already discussed, but I couldn't find any resources about this. EDIT: The whole idea reminds me of AJAX. The code is executed on the server and the content is sent to the client and "prettified". The client himself doesnt see what php-code or other technology is behind.
Reverse Engineer a program working as a webservice, the future?
9,812,274
0
1
276
0
python,web-services,open-source,reverse
It depends on what you mean by reverse engineering: by repeatedly sending input and analyzing the output the behaviour of your code can still be seen. I wouldn't have your code but I can still see what the system does. This means I could build a similar system that does the same thing, given the same input. It would be hard to catch exceptional cases (such as output that is different on one day of the year only) but the common behaviour can certainly be copied. It is similar to analyzing the protocol of an instant messaging client: you may not have the original code but you can still build a copy.
0
0
0
1
2012-03-21T19:38:00.000
3
0
false
9,811,655
0
0
1
3
First I want to clearify that I mean by reverse engineering something like "decompiling" and getting back the original source code or something similiar. Yesterday I read a question about someone who wanted to protect his python code from "getting stolen" in other words: he didn't like that someone can read his python code. The interesting thing I read was that someone said that the only reliable way to "protect" his code from getting reverse engineered is by using a Webservice. So I could actually only write some GUIs in Python, PHP, whatever and do the "very secret code" I want to protect via a Webservice. (Basically sending variables to the host and getting results back). Is it really impossible to reverse engineer a Webservice (via code and without hacking into the Server)? Will this be the future of modern commercial applications? The cloud-hype is already here. So I wouldn't wonder. I'm very sorry if this topic was already discussed, but I couldn't find any resources about this. EDIT: The whole idea reminds me of AJAX. The code is executed on the server and the content is sent to the client and "prettified". The client himself doesnt see what php-code or other technology is behind.
Model to create threaded comments on Google Appengine with Python
9,819,945
0
1
380
0
python,google-app-engine
It depends on how nested threads you expect to get and if you want to optimize reading or writing. If we guess that the threads normally are quite shallow and that you want to optimize reading all subcomments on all levels of a comment, I think you should store each comment in a separate entry and then put a reference to it in a list on the parent and the parent's parent and so forth. That way getting all subcomments are always just one call, but writing a new comment is a bit slower, since you have to modify all parents.
0
1
0
0
2012-03-22T09:15:00.000
2
0
false
9,819,260
0
0
1
1
I am trying to write a comments model which can be threaded (no limits to the number of child threads). How do I do this in Appengine? and what is the fastest way to read all comments? I am trying to do this in a scalable way so that app engine's new pricing does not kill my startup :)
maintain cookie for browser even when user session is expired in django
9,821,596
1
0
535
0
python,django,cookies
setcookie("user", $username, time()+604800); /* Expires in a week */ "604800" represents the time the coockie will "live" for example One Minute: 60 Ten Minutes: 600 Half-an-Hour: 1800 One Hour: 3600 One Day: 86400 One Week: 604800 Two Weeks: 1209600 One Month (30 days): 2592000 One Year (365 days): 31536000
0
0
0
0
2012-03-22T11:37:00.000
2
0.099668
false
9,821,512
0
0
1
1
I have a requirement where I want to set a cookie in the browser. This cookie is not 100% related to the user session, am trying to capture the desktop preferred setting. I want to store this setting into a cookie that will not expire when the user logs out. Am using django in my implementation, Please advise if there is something we can do?
Multiple Python projects organization for deployment and/or distribution
9,826,658
1
0
180
0
python,django,deployment,distutils,project-organization
There's different philosophies on how apps should be packaged, but most Python developers adhere to a very minimalistic approach. In other words, you package up the smallest units of logic you can. So, your goal here shouldn't be to cram everything together, but to package each discrete application separately. By application, here, I don't mean necessarily each Django app, although breaking out some of the apps into their own packages may be worthwhile as well. This is really all about reusability. Any piece that could serve a purpose in some other scenario should get its own package. Then, you can set them up to have dependencies on whatever other packages they require.
0
0
0
1
2012-03-22T16:16:00.000
1
1.2
true
9,826,322
0
0
1
1
We have multiple Python projects that have dependencies on each other. Hierarchically, these are organized like this: P1 P2 ... Pn Each of these is an PyDev project within Eclipse and they co-exist just fine within that environment. We are in the process of structuring out build process to enable us to deploy these and distribute these in a more systematic fashion. Currently, we just zip up these projects and copy them over for deployment. I need some advice on how to go about this task using distutils. Our objective is to have a script to build a zip file (or tar file) using distutils that contains all the necessary code and necessary data/properties from the projects P1 through Pn. We should then be able to deploy this with setup.py and having our DJango-based web layer access it. My first attempt is to create a project whose sole purpose is to build the deployment artifacts. This will sit parallel to the projects P1 through Pn, called PBuild. Does this seem reasonable? I'm having some issues with this approach. Does anybody have any other ideas of how to do this?
Django ModelChoiceField - use something other than id?
9,827,518
1
12
5,882
0
python,django,validation,django-forms,django-validation
ModelChoiceFields are meant to be used to select between a choice of existing model instances. This is almost always best represented by some form of Select field. That said do you really have a FK from address to postal_code as you're implying. What are you storing on a PostalCode table to justify the extra table that will need to be joined in for every address related query? For most cases postal_code should simply be a CharField and in that case if you want to validate that the value is valid you can use the choices attribute with a list of valid postal codes. Keep in mind that maintaining a list of valid postal codes by hand is a huge hassle. If you really have a PostalCode table and think it's a good idea (which in some cases it could be) you may want to consider actually using the postal_code as the primary key rather than the default autoincrement since it's necessarily unique, makes your data more exportable, and solves your issue with validation.
0
0
0
0
2012-03-22T17:06:00.000
3
0.066568
false
9,827,057
0
0
1
1
Say I have an address table and it has a postal_code field -- ModelChoiceField does not allow me to use something other than PKs to validate existence correct? What would be the way to go? Normal input and use clean_*()?
Given Products, each with multiple Versions, what is the preferred/best way to support custom attributes at the Product/Version level in my Django app
10,146,928
0
0
68
0
python,django
Decide to go with sub-classes with each Product as each has a limited set of specific attributes that won't change much or at all over time. Thanks for all the great feedback. Learned a lot :-)
0
0
0
0
2012-03-23T12:49:00.000
4
1.2
true
9,839,515
0
0
1
1
I'm building my first Django app to manage multiple SaaS products. This entails storing custom attributes for each Version of each Product. For example, a new version of a Product is released that includes new configuration options that the earlier versions of the Product do not support. I need to be able to keep track of those new values for each instance of the new Version. I'm thinking I want the Admins to be able to add "custom fields" at the Product level by Version. Looking for suggestions as to the best approach. Thanks.
How to implement normal site registration/login together with social authentication(mainly facebook) in Django?
11,165,359
2
2
1,363
0
python,django,authentication
Integrating separate packages can be a real pain. If you use django-allauth this work has already been done for you....
0
0
0
0
2012-03-25T09:14:00.000
3
0.132549
false
9,859,046
0
0
1
1
I'm a newbie in Django and I'm trying to port my vanilla php application to Python/Django. In my project, I want to let users authenticate using regular registration/login form or through social authentications like facebook, google and twitter. I searched on google and stackoverflow for similar questions and came to know about django-social-auth, django-allauth, django-socialregistration etc. I tried django-allauth but failed to implement it properly resulting in lots of template syntax errors. My questions are : 1) Which one should I choose for my requirements - regular + social authentication? Any live website where I can test it? 2) Which one is most used in live production sites?
Hybrid Web/Desktop app - Ruby on Rails or Django on Python?
9,863,652
2
0
736
0
python,ruby-on-rails,ruby,django,linux
I would do neither. Use an event subsystem such as Twisted, glib, Qt, etc. and have it act as both a GUI mainloop and a web server.
0
0
0
0
2012-03-25T20:08:00.000
1
1.2
true
9,863,578
0
0
1
1
I am going to write a hybrid Web/Desktop app. The main purpose of the app is to be something like a daemon, running on a Linux machine. But it should also provide a rich interface via web for doing configuration, reporting and management. I have two things in mind for doing this: Ruby on Rails Django with Python I have a fair knowledge of Python, but I know nothing of Ruby, but I have plenty of time, so I can learn Ruby if needed. For the frameworks, I know some Django, but again no Rails. Which one do you think I should go with, considering that I have plenty of time to learn and also, the benefits of the framework itself, for later projects. Thanks.
Extract company contact details from google
9,866,851
4
0
1,967
0
python,ruby,regex,email
I would look to a more non-technical solution. You could split out the 3500 names and post them to Amazon Mechanical Turk as a HIT, paying 1 cent for each. Then instead writing code to scrape Google, you write code to create the hits and let real people do the "scraping" of the company websites. Don't know if that will work for you but that's probably what I'd do. Hope that helps! Brandon
0
0
0
1
2012-03-26T03:02:00.000
2
0.379949
false
9,866,104
0
0
1
1
My boss has given me a list of around 3500 companies and wants the generic contact email for each of them by tomorrow. I know this sounds retarded, and it is, but our client is demanding it. The approach I'd like to take is this: Carry out a google search for company name Identify company website and redirect to it Step through website links to find a contact us / about us page Locate and return the first email address on the page I've done a bit of python here and there, but nothing web based or with regex... though I get the basic ideas I don't know if I would be able to execute this in the next 12 hours. If anyone has any help on how I could script this with python or ruby I would be very appreciative......
Variable value display without page reload
12,723,197
0
0
98
0
python,ajax,pyramid
I use long polling now and it seems like the best thing to use for me
0
0
0
0
2012-03-26T11:16:00.000
2
1.2
true
9,871,108
0
0
1
1
I am trying to write a simple website. Here is the requirement. The site needs to be made with Pyramid web framework There needs to be a thread that contains 3 variables and the values of the variables will keep on changing. The site needs to pick these values up and display them without reloading the page. I know I need to use some form of AJAX. Please suggest me some ways to do this. Even links to some tutorials will be appreciated. Thanks
how to show an object's type in google app engine
9,885,834
1
0
89
0
python,google-app-engine,types
When browser renders html it thinks that <type 'str'> is a (unknown) tag, so it renders it as <type 'str'></type>, hence it becomes part of your page markup... You can see this with Firebug or any similar tool.
0
1
0
0
2012-03-26T12:22:00.000
1
1.2
true
9,872,029
0
0
1
1
For debug use I want to show the type of a variable in Google App Engine. In traditional environment, I will use "print type( x )" to do it. But in GAE I just don't know why I can't use self.response.out.write( str( type( x ) ) ) to echo it in the browser. I got confused because I did transform the <type 'type'> to < type 'str' >. Since that doesn't work I have to use self.response.out.write( str( type( x) == type( "123" ) ) ) instead of directly echoing the type. So what did I miss in thinking? I am also using logging module to echo the type which works well. But I still want to know why self.response.out.write( ) doesn't work. Thanks all for help!!
How to send emails from django App in Google App Engine
9,875,058
2
3
1,520
0
python,django,google-app-engine
Google only allows you to send emails from a domain name that they control in the google app engine. So you will either have to send it from the test domain they give you, a gmail account, or you need to use their name servers for your domain name.
0
1
0
0
2012-03-26T15:26:00.000
4
0.099668
false
9,874,959
0
0
1
1
I have created one Django Application,also hosted it on the google app engine. I can send emails from django application, but after hosting it to app engine I cant do that.I really stuck with this problem, so please tell me if there is any solution for using django email functions in Google app engine. I have tried appengine_django but it not working. Django version 1.3.1 python version 2.6.5
SL4A Android x86 installation
9,892,477
3
0
1,441
0
android,python,sl4a
Try the official Android emulator. If the APKs include native libraries, chances are those are compiled for ARM only. Google's emulator emulates the ARM instruction set. To make sure, rename the APK to ZIP and look inside. The structure of the lib folder, if any, will give you an idea.
1
0
0
0
2012-03-27T15:12:00.000
3
0.197375
false
9,892,351
0
0
1
1
I am currently developing a Android Application. I couldn't install the Android Python APKs like the sl4a.apk and the PythonInterpreter.apk on my Android x86 emulator. I read that it is possible to recompile the APKs with NDK but I have not found a closer decription, yet. Has anybody experience with this and could provide a small tutorial? Best Regards
cloud scripting through browser and evaluate python on server
9,899,346
1
0
92
0
python,python-3.x,cloud
I haven't tried myself. You may want to check out ipython notebook.
0
0
1
0
2012-03-27T23:32:00.000
3
0.066568
false
9,899,180
1
0
1
1
Is there any way in a browser, to type python code into an input field, it will then be sent to a local server and executed and the result pushed back to the browser. Basically a browser hosted python notebook, where the code gets evaluated on a different machine. Is there any python package to do this. something like what ideone.com or picloud do, but opensource and that can install on your own server. Or any suggestions on how to do it, I have looked around already but have struggled to find something meaningful.
Loggly performance
12,219,717
1
1
398
0
python,logging
Just for future reference for people... I tried loggly out and was generally very pleased with them. While I never did any formal benchmarking tests (with our without them). Any performance issues were not noticeable to me.
0
0
0
0
2012-03-28T19:13:00.000
1
1.2
true
9,914,165
0
0
1
1
I'm getting ready to deploy an app to Heroku and I'm considering adding Loggly as a plugin. I love the idea of being able to aggregate and search my logs more easily, but I'm a bit concerned about what kind of performance hit I might take because of it. Any experiences (good or bad) out there with Loggly? Just as a note: I'm using Python with Django 1.3
Questions about django thread safety
9,916,735
1
1
194
0
python,django,multithreading,mod-wsgi
You shouldn't be worrying about this kind of stuff. These slots are stored in a database right? The database should handle all the locking mechanisms for you, just make sure you run everything under a transaction and you will be fine.
0
0
0
0
2012-03-28T22:28:00.000
2
0.099668
false
9,916,571
0
0
1
1
I have a django app which is used for managing registrations to a survey. There are fixed number of slots and I want to "reserve" slots for users when they sign up. In one of my views, I get the next available slot and reserve it (or redirect the user if there are no slots available.) I want to protect against the case where two user's signing up at the same time get registered for the same slot because the the method "get_next_available_slot" returned the same slot for both users. For this I am trying to understand the use of processes and threads with Django's views. 1) Is each request handled in a separate thread and will using python threading module's LOCK() take care of exclusive access? 2) I am running apache on RHEL with modwsgi. How do I configure Apache/modwsgi to ensure a more easy and simple solution to handle the above situation? I am not expecting a huge load on the web application at all. So I would like a simpler solution instead of a high performance one.
Django - Choices vs Models (FKs)
9,917,983
4
2
742
0
python,database,django,django-models
models enforces constraint via the database. choices enforces constraint via the code. Which you choose depends on who you want to select the choices.
0
0
0
0
2012-03-29T01:25:00.000
2
0.379949
false
9,917,971
0
0
1
2
Lets say I'd like to give an user options to pick from and ensure that the submitted values are available options. I've been reading the documentation and it seems to me that: if your values won't change then use choices -- if your data is dynamic then use models. I'm a bit unsure though, shouldn't models be chosen over choices since they enforce some kind of constraint in the DB?
Django - Choices vs Models (FKs)
9,920,914
7
2
742
0
python,database,django,django-models
Use models when you definitely need one of these: ability easily edit (add, delete) choice with no need to reload the code; ability to store additional info for any choice; easy many-to-many relation (and filtering by it) ability to work with dynamic subset of choices in different cases. Use choices otherwise.
0
0
0
0
2012-03-29T01:25:00.000
2
1
false
9,917,971
0
0
1
2
Lets say I'd like to give an user options to pick from and ensure that the submitted values are available options. I've been reading the documentation and it seems to me that: if your values won't change then use choices -- if your data is dynamic then use models. I'm a bit unsure though, shouldn't models be chosen over choices since they enforce some kind of constraint in the DB?
Does the App Engine Conversion API for HTML to PDF support canvas or SVG?
11,282,356
0
1
254
0
python,google-app-engine,file-conversion
You could export the canvas to an image (toDataURL) after the user creates or modifies the chart, and swap the two when calling the Conversion API.
0
0
0
0
2012-03-29T04:00:00.000
1
0
false
9,918,903
0
0
1
1
I am trying to figure out the best way of allowing my users to create a family tree chart, view it on screen and then to be able to create a PDF of it. I am considering using ReportLab for the PDF generation, however then I have to have separate display and PDF code. So I was wondering if the Conversion API would be able to handle HTML with canvas (and therefore Javascript), I am guessing probably not, but I thought I would ask. I am a little more hopeful about it being able to generate HTML with SVG since it can be rendered without javascript.
How can I check a duplicate file or image being uploaded into a Plone site
9,922,771
2
2
176
0
python,plone
You can store hash ( eg md5 ) of your image content into a database, at upload time. When a new image is uploaded, you just have to match the current image's hash against those present in the database. The hash will be collision free mostly, however to be more sure, you can also store other attributes like filesize, image dimensions in the same database and compare them as a double check.
0
0
0
0
2012-03-29T09:35:00.000
1
0.379949
false
9,922,710
0
0
1
1
How can I check a duplicate file or image being uploaded into a Plone site. I am using Plone 4.1? Is there some feature or configuration changes that need to be done to achieve the same.I want this feature to check the entire site before uploading any file /image into the site. I am working on Linux OS. I am using the Zope server which gets installed with Plone 4.1.4.
How to create SaaS application with Python and Django
9,925,190
9
31
23,996
0
python,django,saas
A very basic, elementary example of how you would go about it. Suppose you have a simple app designed to solve a particular business case. For example, you created an app to handle room reservations at your office. To "convert" this app into a service you have to configure it such that most of the user-specific parts of the application are parametric (they can be "templatized" - for lack of better word). This is how the front end would be converted. You might create variables to hold the logo, headline, teaser, color scheme for the app; allowing each user to customize their instance. So far, your app is able to customize itself on the front end. It is still using the same database that was designed in phase one. Now comes the matter of showing only those fields that are relevant to a particular user. This would be parameterizing the database. So you might add a column that identifies each row as belonging to a particular user; then create views or stored procedures that filter records based on the logged in user. Now the application is able to be "rented" out; since you are able to customize the instance based on the user. It then just gets bigger from here - depending on the scale, type and intended customization of your application. You might decide that your application performs better when each user has their own dedicated database instead of the stored procedure + view combo. You may decide that for some user types (or "packages"), you need a dedicated instance of your application running. So for "premium" or "ultra" users you want to have their own dedicated system running. If your application requires lots of storage - you might decide to charge separately for storage. The bottom line is it has nothing to do with the language used. Its more an architecture and design problem.
0
0
0
0
2012-03-29T11:09:00.000
4
1
false
9,924,169
0
0
1
2
Can you advice me with some articles/applications that allows you create SaaS(Software as a Service) application with Python and Django. For the moment the general topics I do not understand are: Do you have one working application for all clients or one app per client How do you manage database access, permissions or different DB for each client Are there any tools that allows you to convert one app to SaaS
How to create SaaS application with Python and Django
9,924,280
8
31
23,996
0
python,django,saas
Software as a Service is just a marketing word, it's technically no different from a server that is accessible over the internet. So question 3 makes no sense. That leaves us with question 1 and 2: What do you mean with 'app' in this context? Your web application (built with Python and Django) can have multiple Django apps (components that make up the web application) but I think that's not what you mean. You can build your website in Python/Django and have various customization options depending on which user (client) is logged in. For example, a premium client can have several advanced options enabled but it's still part of the same codebase. It's just that some options (buttons/controls, etc) are not shown for certain clients Django has plenty of tools for user management, permissions and groups. You can give each user (each client) different permissions and these permissions determine what they can do. Database access should be managed by your web application. For example, the code determines what information needs to be displayed on the webpage (depending on which client is logged in) and that code retrieves the information from the database. Depending on the scale that you're aiming for, you can also specify which database should be used to retrieve the information from.
0
0
0
0
2012-03-29T11:09:00.000
4
1
false
9,924,169
0
0
1
2
Can you advice me with some articles/applications that allows you create SaaS(Software as a Service) application with Python and Django. For the moment the general topics I do not understand are: Do you have one working application for all clients or one app per client How do you manage database access, permissions or different DB for each client Are there any tools that allows you to convert one app to SaaS
How can I protect my AWS access id and secret key in my python application
9,928,772
0
11
6,307
0
python,amazon-web-services
Don't put it in applications you plan to distribute. It'll be visible and they can launch instances that are directly billable to you or worst..they can take down instances if you use it in production. I would look at your programs design and seriously question why I need to include that information in the app. If you post more details on the design I'm sure we can help you figure out a way in which you don't need to bundle this information.
0
0
1
0
2012-03-29T13:54:00.000
4
0
false
9,926,825
0
0
1
1
I'm making an application in Python and using Amazon Web Services in some modules. I'm now hard coding my AWS access id and secret key in *.py file. Or might move them out to an configuration file in future. But there's a problem, how can I protect AWS information form other people? As I know python is a language that easy to de-compile. Is there a way to do this? Well what I'm making is an app to help user upload/download stuff from cloud. I'm using Amazon S3 as cloud storage. As I know Dropbox also using S3 so I'm wondering how they protects the key. After a day's research I found something. I'm now using boto (an AWS library for python). I can use a function of 'generate_url(X)' to get a url for the app to accessing the object in S3. The url will be expired in X seconds. So I can build a web service for my apps to provide them the urls. The AWS keys will not be set into the app but into the web service. It sounds great, but so far I only can download objects with this function, upload doesn't work. Any body knows how to use it for uploading? Does anyone here know how to use key.generate_url() of boto to get a temporary url for uploading stuff to S3?
How to store all user activites in a website..?
9,942,327
0
0
2,693
1
java,python,django,postgresql,user-activity
In your log table you can have various columns, including: user_id (the user that did the action) activity_type (the type of activity, such as view or commented_on) object_id (the actual object that it concerns, such as the Article or Media) object_type (the type of object; this can be used later, in combination with object_id to lookup the object in the database) This way, you can keep track of all actions the users do. You'd need to update this table whenever something happens that you wish to track.
0
0
0
0
2012-03-30T11:39:00.000
5
0
false
9,942,206
0
0
1
2
I have a web application build in Django + Python that interact with web services (written in JAVA). Now all the database management part is done by web-services i.e. all CRUD operations to actual database is done by web-services. Now i have to track all User Activities done on my website in some log table. Like If User posted a new article, then a new row is created into Articles table by web-services and side by side, i need to add a new row into log table , something like "User : Raman has posted a new article (with ID, title etc)" I have to do this for all Objects in my database like "Article", "Media", "Comments" etc Note : I am using PostgreSQL So what is the best way to achieve this..?? (Should I do it in PostgreSQL OR JAVA ..??..And How..??)
How to store all user activites in a website..?
9,942,819
1
0
2,693
1
java,python,django,postgresql,user-activity
So, you have UI <-> Web Services <-> DB Since the web services talk to the DB, and the web services contain the business logic (i.e. I guess you validate stuff there, create your queries and execute them), then the best place to 'log' activities is in the services themselves. IMO, logging PostgreSQL transactions is a different thing. It's not the same as logging 'user activities' anymore. EDIT: This still means you create DB schema for 'logs' and write them to DB. Second EDIT: Catching log worthy events in the UI and then logging them from there might not be the best idea either. You will have to rewrite logging if you ever decide to replace the UI, or for example, write an alternate UI for, say mobile devices, or something else.
0
0
0
0
2012-03-30T11:39:00.000
5
1.2
true
9,942,206
0
0
1
2
I have a web application build in Django + Python that interact with web services (written in JAVA). Now all the database management part is done by web-services i.e. all CRUD operations to actual database is done by web-services. Now i have to track all User Activities done on my website in some log table. Like If User posted a new article, then a new row is created into Articles table by web-services and side by side, i need to add a new row into log table , something like "User : Raman has posted a new article (with ID, title etc)" I have to do this for all Objects in my database like "Article", "Media", "Comments" etc Note : I am using PostgreSQL So what is the best way to achieve this..?? (Should I do it in PostgreSQL OR JAVA ..??..And How..??)
Can web automation be done in Python?
9,945,337
1
4
10,966
0
python,automation,notifications
If I understand well, the idea of your program is to do an automated browsing session. So yes, it's possible. It's not important in what the website is programmed (cgi, php etc). All you need is to send data through post/get (like a real browser) and process the return (regexp and so on). Good luck
0
0
1
1
2012-03-30T14:45:00.000
7
0.028564
false
9,945,206
0
0
1
2
I am a newborn programmer still programming from the book on my Alt+Tab. One of the first programs I want to create is to help my mom in her work. I need to know if I can use Python to create it. It needs to: Go on-line and log-in with account / pass. Do a search with specific criteria (use the site's search engine) View all the results and pick only the newest ones. Sort them out. Notify me so that the newest adds are noticed the moment they are posted on the website. From what I see the site says : .cgi in the end. I know python can connect, download the text from a page and sort the wanted info, but can it log in, use the search engine and pick the options I need? I don't want to skip my learning process, but I am so serious about this project I am ready to put Python on hold and start learning some language that can do it! I will very much appreciate your guidance! Thank you for your time! AJ
Can web automation be done in Python?
9,945,530
1
4
10,966
0
python,automation,notifications
I would point out that depending upon what site you are on, there may be a more efficient way (perhaps an exposed web service) than scraping data from the page and working with mechanize/selenium to do what you want. If you are on the web, browser driver tools are the hammers, and they will get the screws in the wood, but sometimes another tool will work better.
0
0
1
1
2012-03-30T14:45:00.000
7
0.028564
false
9,945,206
0
0
1
2
I am a newborn programmer still programming from the book on my Alt+Tab. One of the first programs I want to create is to help my mom in her work. I need to know if I can use Python to create it. It needs to: Go on-line and log-in with account / pass. Do a search with specific criteria (use the site's search engine) View all the results and pick only the newest ones. Sort them out. Notify me so that the newest adds are noticed the moment they are posted on the website. From what I see the site says : .cgi in the end. I know python can connect, download the text from a page and sort the wanted info, but can it log in, use the search engine and pick the options I need? I don't want to skip my learning process, but I am so serious about this project I am ready to put Python on hold and start learning some language that can do it! I will very much appreciate your guidance! Thank you for your time! AJ
Python frameworks: Website/CMS vs application?
9,947,834
1
1
443
0
python,django,web-applications,frameworks,pyramid
I believe that at this point you might want to think more about the overall architecture of your application rather than frameworks. For Example Single Tier - Just a simple webapp, using simple file or object storage Two Tier - Webapp + Relational Database. The webapp contains the presentation logic + business logic using MVC principles Three Tier - Webapp + Middle Tier + Relation Database. In this setting, the Middle Tier will basically contain all the business & processing logic. The Webapp is then just a presentation layer Once you decide the architecture, you can then start thinking about which framework to use for each of the component of the architecture. I believe progressing this way will be less confusing and will give clarity of thought.
0
0
0
0
2012-03-30T17:28:00.000
2
0.099668
false
9,947,703
0
0
1
2
I'm slightly confused on what is meant by a "web application". I.e. Django positions itself as "a web framework" for the development of "web apps", quite similar to the description of Pyramid. What I'm looking for is a framework for an application that has a browser interface but is very database driven. In short: It's a system that should handle transaction and subscriptions. These transactions are registered through a web interface. The backend consists of XML/JSON feeds of these subscriptions/transactions and an administrative interface to generate statistics and reports. Quite similar to a ticketing/box office system. Now: Is it a good decision to start out with something like Django/Pyramid even though they seem more focussed on the creation of "websites" rather than (scalable) input/output "applications". Is there any python framework that I'm better of using or are they perfectly suited for the kind of software that I'm describing? Any help would be greatly appreciated!
Python frameworks: Website/CMS vs application?
9,947,817
3
1
443
0
python,django,web-applications,frameworks,pyramid
I don't know Pyramid at the time of writing so I'll answer the Django part, though I can imagine the answer to apply to Pyramid as well as the distinction between websites and web application is quite vague. Django is suitable for both websites and web applications: you can create an informative website for your local library as well as an all-in web application with lots of interactive features. Django simply facilitates the creation of the backend of a web system. Both websites and web applications use databases, have caching and can have interactive parts with forms. It's just that websites are usually just for informing the user (most sites out there) or interacting with others (such as forums). A web application is best described with some examples, such as webmail, administrative interfaces, Google Docs, etc; it serves as a replacement of a desktop application. From a technical perspective, there's no clear cut thing that separates the world of websites from web applications, it's just a matter of what you create with your web framework. To answer your question, Django is quite suitable for creating a database-driven web application as it supports multiple databases, caching, autmatic creation and handling of forms, etc. I can imagine Pyramid to be suitable as well but I can't answer that. It's good to explore your options.
0
0
0
0
2012-03-30T17:28:00.000
2
1.2
true
9,947,703
0
0
1
2
I'm slightly confused on what is meant by a "web application". I.e. Django positions itself as "a web framework" for the development of "web apps", quite similar to the description of Pyramid. What I'm looking for is a framework for an application that has a browser interface but is very database driven. In short: It's a system that should handle transaction and subscriptions. These transactions are registered through a web interface. The backend consists of XML/JSON feeds of these subscriptions/transactions and an administrative interface to generate statistics and reports. Quite similar to a ticketing/box office system. Now: Is it a good decision to start out with something like Django/Pyramid even though they seem more focussed on the creation of "websites" rather than (scalable) input/output "applications". Is there any python framework that I'm better of using or are they perfectly suited for the kind of software that I'm describing? Any help would be greatly appreciated!
Posting data to another Site with Django
9,951,986
2
1
471
0
python,django,post
urllib2 is the appropriate way to post data if you're looking for python standard library. Django doesn't provide a specific method to do this (as well as it shouldn't). Django goes out of it's way to not simply reinvent tools that already exist in the the standard library (except email...), so you should never really fear using something out of the python standard library. requests is also great, but not standard library. Nothing wrong with that though.
0
0
1
0
2012-03-30T22:35:00.000
1
1.2
true
9,951,216
0
0
1
1
I would appreciate some help here. Google checkout has many ways to send it checkout data. I am using the XML server-to-server. I have everything ready and now I want to throw some xml at google. I have been doing some reading and I know of a couple of ways to do this, one with urllib, another with pyCurl, but I am using django over here and I searched the Django api for some way to POST data to another site and I havent fallen upon anything. I really would like to use the django way, if there is one because I feel it would be more fluid and right, but if you all don't know of any way I will probably use urllib.
How do I generate code under Eclipse+PyDev?
9,998,578
1
0
339
0
eclipse,python-3.x,pydev,generated-code
It should be possible to do what you want using an external builder inside Eclipse... Right click project > properties > builders > new > program, then configure the program as python having as a parameter the module to run and receiving as arguments also the ${build_files} variable (if it's a python script, you have to put your Python.exe as the executable, your main file as an argument and then the ${build_files} variable).
0
1
0
1
2012-03-31T01:49:00.000
2
1.2
true
9,952,327
0
0
1
1
I'm developing a system, and I have build a code generator that emits a bunch of classes based on a configuration file. I would like to configure PyDev to invoke the generator for me whenever the configuration file (or the generator source) changes. I know that this is possible "in theory" because e.g., the ANTLR plugin for Eclipse does this in Java. Is there any kind of support in PyDev for doing this? If not, is there some other Eclipse hackery that I can use to get this working?
How to simulate Google login using gaeunit
9,953,084
0
0
401
0
python,google-app-engine,google-apps,google-signin,gaeunit
Two situations: Local Dev server: login is mocked via a simple web form. You can do a http POST to log in. Production server: login goes through the Google auth infrastructure. No way to mock this. To make this work you'd need to code around it.
0
1
0
1
2012-03-31T03:50:00.000
2
0
false
9,952,873
0
0
1
1
I am currently using gaeunit to perform automated test on my google app engine application. I am wondering whether it's possible to simulate the user login action using his/her google account using gaeunit? Thank you very much.
How do I use web2py on Heroku?
14,190,998
1
4
1,549
0
python,heroku,web2py
It may be a problem with the DB setup. By default web2py only supports sqlite or Google App Engine (GAE). It's probably trying to initialize sqlite databases on Heroku's read-only filesystem. Either disable the DB code temporarily to see if this is indeed the case, or configure a connection to a supported database (MySQL, S3, etc).
0
0
0
0
2012-03-31T09:33:00.000
3
0.066568
false
9,954,745
0
0
1
1
I'm having a lot of trouble with getting web2py to work on Heroku. I can't even get a basic app to work. Whenever I go to my herokuapp page, it says Application Error An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details."
Django, exclude a context processor in a view
9,960,664
2
0
2,637
0
python,django,django-views
You could subclass RequestContext in django.template.context and redefine its __init__ method. You can then use this modified RequestContext in those particular views. The __init__ of RequestContext currently looks like this: def __init__(self, request, dict=None, processors=None, current_app=None, use_l10n=None): Context.__init__(self, dict, current_app=current_app, use_l10n=use_l10n) if processors is None: processors = () else: processors = tuple(processors) for processor in get_standard_processors() + processors: self.update(processor(request)) In here, get_standard_processors() returns the context processors defined in your settings. Before calling a context processor (last line of the above code), you could add a check that determines which processors need to be used and which ones need to be skipped.
0
0
0
0
2012-03-31T23:12:00.000
4
0.099668
false
9,960,524
0
0
1
1
I have a website with a menu. To generate the menu, I need some queries in the database. So I created a context processor to do it in all my views. Some of the views I have are actually forms. I get them using ajax and display them with jquery ui dialog, when my users click on some buttons. I can't remove all context processors for those pretty complex forms, I need the auth, static and il8n context processors in particular. But I don't want to make the menu based queries in the database to display those forms. Is there a way to exclude a context processor in a view ? I tried to put a variable in "request.session" in the view, then remove it and return an empty dictionary in my context processor. But it's pretty bad and there is possible concurrency issues. I can also parse the url in "request" in my context processor and return an empty dictionary, but it sounds like an hack again. Any idea or advice ? Thanks,
Building a tree in a web app using Python
9,965,972
1
0
1,635
0
python,treeview,web
This isn't really a python or django issue: presentation on the web is done using (X)HTML, other types of XML (such as SVG), and javascript to automate the client side. Go ahead and use django for your project, but understand that to do this, you will need to also get the hang of (at least) a javascript library for this task.
0
0
0
0
2012-04-01T14:18:00.000
2
1.2
true
9,965,062
0
0
1
2
I'm new to Python and web development (although I have development experience with Client/Server apps .. a little rusty), and I need to build a Python web application that populates an interactive tree from a database (for my PG degree). I've tried PyQT4 which contains a QTreeView/QTreeWidget but couldn't run this form as a web application. I've used QT Designer to build such form but couldn't make it run as a web app. From Google search (over two weeks) I know that Django is the best framework to build a web app for Python, but it doesn't have an interactive tree viewer (am I right?). I'm very confused at the moment and don't actually know where to go from here. I'd appreciate your help in answering the following critical questions: Can Django help in building such application? i.e. Does it support web tree view? Can I use QTreeView from PyQt with Django? or even can I build a web application directly using PyQT and QT Designer? If neither are suitable; Your suggestions are very much appreciated.
Building a tree in a web app using Python
9,965,636
0
0
1,635
0
python,treeview,web
google django treeview for a few implementations. Alternativly use JavaScript. Django and Javascript play nicely and there are loads of JavaScript Treeview implementations.
0
0
0
0
2012-04-01T14:18:00.000
2
0
false
9,965,062
0
0
1
2
I'm new to Python and web development (although I have development experience with Client/Server apps .. a little rusty), and I need to build a Python web application that populates an interactive tree from a database (for my PG degree). I've tried PyQT4 which contains a QTreeView/QTreeWidget but couldn't run this form as a web application. I've used QT Designer to build such form but couldn't make it run as a web app. From Google search (over two weeks) I know that Django is the best framework to build a web app for Python, but it doesn't have an interactive tree viewer (am I right?). I'm very confused at the moment and don't actually know where to go from here. I'd appreciate your help in answering the following critical questions: Can Django help in building such application? i.e. Does it support web tree view? Can I use QTreeView from PyQt with Django? or even can I build a web application directly using PyQT and QT Designer? If neither are suitable; Your suggestions are very much appreciated.
Convert video(any type) to audio -mp3 format- using python
9,968,088
4
3
3,509
0
python,google-app-engine,video,mp3
You don't want todo this in Python, video convert requires working native modules which the App Engine doesn't support. You can try to work 3rd party web service that do the convert for you, or send the convert task to an external server.
0
0
0
0
2012-04-01T20:29:00.000
3
1.2
true
9,968,040
0
0
1
2
I'm working on a project, using Python running on Google App Engine. The project must allow users to upload video file then convert these files into mp3 audio file. Is there a way to convert this video to mp3/wav audio? Could anyone offer a solution to this? Thanks in advance.
Convert video(any type) to audio -mp3 format- using python
9,968,089
2
3
3,509
0
python,google-app-engine,video,mp3
You're going to have trouble doing this on GAE, as libraries with native components aren't necessarily available there; it may well not be possible at all. If targeting a more typical Python app server environment, rather than GAE, I would do this using the GStreamer Python bindings; GStreamer lets you set up a media pipeline (decoders/demuxers/encoders, etc), and is otherwise perfect for this application (other than platform availability).
0
0
0
0
2012-04-01T20:29:00.000
3
0.132549
false
9,968,040
0
0
1
2
I'm working on a project, using Python running on Google App Engine. The project must allow users to upload video file then convert these files into mp3 audio file. Is there a way to convert this video to mp3/wav audio? Could anyone offer a solution to this? Thanks in advance.
mod_wsgi showing old code
9,971,145
0
1
559
0
python,django,apache2,mod-wsgi
Delete any .pyc files from your code base directory, and restart the server.
0
0
0
0
2012-04-02T03:35:00.000
4
0
false
9,970,598
0
0
1
3
I'm running mod_wsgi on apache2. It's running Django and for some reason, after I change my code, old versions are sometimes shown along with new code. For example, after creating a view that simply returns an Http Response with "Hi", I get either the Django start page or "Hi". Any ideas what would cause this? Thanks.
mod_wsgi showing old code
9,970,706
2
1
559
0
python,django,apache2,mod-wsgi
apache2/mod_wsgi keeps parts of the application loaded between requests. You have to restart the server after code updates.
0
0
0
0
2012-04-02T03:35:00.000
4
1.2
true
9,970,598
0
0
1
3
I'm running mod_wsgi on apache2. It's running Django and for some reason, after I change my code, old versions are sometimes shown along with new code. For example, after creating a view that simply returns an Http Response with "Hi", I get either the Django start page or "Hi". Any ideas what would cause this? Thanks.
mod_wsgi showing old code
9,970,690
0
1
559
0
python,django,apache2,mod-wsgi
This could possibly be your browser caching responses from the server. Try disabling caching to see if that has any affect. Even if it doesn't now, doing so can potentially save you a lot of grief and confusion in the future.
0
0
0
0
2012-04-02T03:35:00.000
4
0
false
9,970,598
0
0
1
3
I'm running mod_wsgi on apache2. It's running Django and for some reason, after I change my code, old versions are sometimes shown along with new code. For example, after creating a view that simply returns an Http Response with "Hi", I get either the Django start page or "Hi". Any ideas what would cause this? Thanks.
Running WSGI application with a different version of Django to what's installed in python site-packages?
9,974,529
2
0
181
0
python,django,wsgi,django-wsgi
Run the app inside a virtualenv.
0
0
0
0
2012-04-02T10:09:00.000
2
1.2
true
9,974,465
0
0
1
1
I have an application that uses Django 1.3 installed in python's site-packages. I want to create another copy of it (WSGI under Apache) but make it use a newer version of Django I've unpacked alongside to see if any input is required before I'm able to migrate to 1.4. Is there a way to somehow specify where WSGI should import Django from?
Alternative to a server side scripting language for scraping
9,979,094
0
0
682
0
javascript,python,ironpython,client-side
Given the server limitation, I would run those scripts locally to generate HTML, and push that static output onto your server.
0
0
1
0
2012-04-02T15:08:00.000
3
0
false
9,978,862
0
0
1
1
I have a small website hosted by my university. The policy is that no server side scripting language (e.g. PHP, etc.) is enabled, hence websites are either static or can use client side scripting (e.g. javascript, etc.). I also can't touch the server/configure it/install things. Anyway, I wanted to add some data from other websites (namely, google scholar citations) that I manage to scrape with Python+lxml, dynamically. Is there any way I can have these data dynamically queried - on the client side of course? I tried using IronPython to embed my Python code in my webpage, but it was complaining about failing to find the lxml imported library. But a similar solution would be great. Or a library in pure javascript which allows for opening and parsing external webpages...? Thanks!
Python: How to create simple web pages without a huge framework?
9,979,501
0
8
18,361
0
python,frameworks,web-frameworks
Python works well using CGI. that's the simplest thing you can do: it only needs apache and a working python environment, and is the closest to a standard php setup. remember that, when using CGI, your python script is responsible for outputting the necessary HTTP headers (sys.stdout.write('Content-Type: text/html\n\n')), but there is a CGI module which is part of the python standard library which greatly helps dealing with the raw stuffs (post/get arguments parsing, header retrieval, header generation).
0
0
0
0
2012-04-02T15:38:00.000
8
0
false
9,979,326
0
0
1
3
I would like to know if there is a way to create web pages without a huge framework in python. I think of something like PHP/Apache, which comes just as a language and not with to much overhead (but I don't like PHP...). In PHP there is no ORM, no template engine, etc. But it is very very easy to just print a Hello World to the browser. I know about Django and really like it, but it is a bit too big for simple web portals (5-10 pages). I really like something simple, without installing too much.
Python: How to create simple web pages without a huge framework?
9,979,395
1
8
18,361
0
python,frameworks,web-frameworks
I'm not sure what's wrong with django flatpages for your purposes. Another alternative would be to replace the django template system with something more powerful, like jinja, so you can write your tag soup and do processing there, with minimal logic in the view. In practice (given that you already know django), that is likely to be easier than using a microframework (which requires more of the programmer, in exchange for being completely unopinionated about anything).
0
0
0
0
2012-04-02T15:38:00.000
8
0.024995
false
9,979,326
0
0
1
3
I would like to know if there is a way to create web pages without a huge framework in python. I think of something like PHP/Apache, which comes just as a language and not with to much overhead (but I don't like PHP...). In PHP there is no ORM, no template engine, etc. But it is very very easy to just print a Hello World to the browser. I know about Django and really like it, but it is a bit too big for simple web portals (5-10 pages). I really like something simple, without installing too much.
Python: How to create simple web pages without a huge framework?
9,979,487
4
8
18,361
0
python,frameworks,web-frameworks
I've used Flask (and bottle.py) in the past, but these days I actually prefer Pyramid, from the Pylons folks. Pyramid is capable of being a large, full-fledged framework, is designed for flexibility, and has no shortage of plugins and extensions available adding additional functionality -- but it also is capable of small, single-file projects; see this tutorial for an example. Going with Pyramid will give you room to grow if your needs expand over time, while still retaining the ability to start small.
0
0
0
0
2012-04-02T15:38:00.000
8
0.099668
false
9,979,326
0
0
1
3
I would like to know if there is a way to create web pages without a huge framework in python. I think of something like PHP/Apache, which comes just as a language and not with to much overhead (but I don't like PHP...). In PHP there is no ORM, no template engine, etc. But it is very very easy to just print a Hello World to the browser. I know about Django and really like it, but it is a bit too big for simple web portals (5-10 pages). I really like something simple, without installing too much.
How to convert a stringbyte(raw html string) to sqlite3 TEXT supporting unicode in Python
9,991,929
0
0
241
1
python,unicode,utf-8,sqlite
You should .decode with the correct encoding. In this case Latin 1 or CP1252. »ö« is obviously not 0xf6 in UTF-8 so why should it work?
0
0
0
0
2012-04-03T10:57:00.000
1
0
false
9,991,854
0
0
1
1
I am requesting a web page and want to cache the page data as a raw html string. (First I escaped the data string) I use sqlite3 to save my data on. When I tried give the byte_string in dictionary, or tuple, using placeholders in request, it raise "Programming Error" saying to convert the application to use unicode strings. I save it as SQLITE3 TEXT datatype. I tried data.encode("utf-8") and encode("utf-8") both raises the same error UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 11777: invalid start byte I know it contains a strange character, this character is 'ö'. How can i solve this problem. Do i need use BLOB datatype of sqlite3
How to structure complex Django project?
9,995,337
1
4
1,093
0
python,django
I certainly use class methods, and I have found that where there are similar operations to be performed on classes, it is possible (and easy) to factor the classmethods into base classes (use the self parameter of your class method to write generic code). Probably the best way to manage broken-up views, etc is to replace each file you want to break up with its own package, and put whatever you need to (if anything) into that package's __init__.py module.
0
0
0
0
2012-04-03T14:10:00.000
3
0.066568
false
9,995,041
0
0
1
2
I have a Django project which is getting more and more complex. I started off with the traditional files: models, views, and forms.py. The issue I have right now is that those files are getting bigger and bigger and I'd like to break them into manageable parts. What are the best practices around that? In addition, I am wondering if it is best practice to add class method to a model in Django? For instance, I have a Vote class on which I would like to add methods to get the number of votes for a specific user, content, etc?
How to structure complex Django project?
9,997,876
2
4
1,093
0
python,django
I find refactoring can really help. Are there a lot of similar views that just have different templates or querysets? Make a more generic view that accepts multiple template names, records, etc. Anything that requires extensive calculations gets moved to a utils.py in the same directory. Class methods are for actions that affect a single record; managers are for dealing with filtering records or creating a record. If you're already taking the step of making separate models, views, etc. folders and breaking views and models into separate files, that suggests to me that you could separate them out into separate apps. I like that as an option much better.
0
0
0
0
2012-04-03T14:10:00.000
3
1.2
true
9,995,041
0
0
1
2
I have a Django project which is getting more and more complex. I started off with the traditional files: models, views, and forms.py. The issue I have right now is that those files are getting bigger and bigger and I'd like to break them into manageable parts. What are the best practices around that? In addition, I am wondering if it is best practice to add class method to a model in Django? For instance, I have a Vote class on which I would like to add methods to get the number of votes for a specific user, content, etc?
Creating an in memory constant when django starts
9,999,509
2
0
92
0
python,django
There's no such thing as a "global variable" in Python that is available from everywhere. You need to import all names before you can use them. Even if you did this, though, it wouldn't actually work on production. Not only is there no command that you run to start up the production server (it's done automatically by Apache or whatever server software you're using), the server usually runs in multiple processes, so the variable would have to be set in each of them. You should use a setting, as dcrosta suggests.
0
0
0
0
2012-04-03T18:16:00.000
2
0.197375
false
9,999,005
0
0
1
1
I have this kind of setup : Overridden BaseRunserverCommand that adds another option (--token) that would get a string token. Store it in the app called "vault" as a global variable Then continue executing the BaseRunserverCommand Now later when I try to get the value of this global variable after the server started, I am unable to see the value. Is this going out of scope? How to store this one time token that is entered before the django starts?
Project structure for python projects with maven
9,999,984
10
16
15,040
0
python,maven
It is the good news: you do not need any tool. You can organise your source code in any way you want. Let recap why we need tools in the java world: In java you want to generate directories upfront because the namespace system dictates that each class must live in one file in a directory structure that reflects that package hierarchy. As a consequence you have a deep folder structure. Maven enforces an additional set of convention for file location. You want to have tools to automate this. Secondly, different artefacts require use of different goals and even additional maven projects (e.g. a ear project requires a few jars and war artefacts). There are so many files to create you want to have tools to automate this. The complexity makes tools like mvn archetype:generate not just helpful. It is almost indispensable. In python land, we just do not have these complexity in the language. If my project is small, I can put all my classes and functions in a single file (if it makes sense) If my project is of a bigger size (LOC or team size), it makes sense to group .py files into modules in whatever way makes sense to you and your peers. At the end of the days, it is about striking a balance between ease of maintenance and readability.
0
0
0
1
2012-04-03T18:59:00.000
4
1.2
true
9,999,618
0
0
1
1
Are there any tools which generate a project layout for python specific projects, much similar to what maven accomplishes with mvn archetype:generate for java projects.