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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GAE: scheduled import of big gzipped file from a third party site | 5,211,520 | 0 | 0 | 87 | 0 | python,google-app-engine | My initial gut reaction (without knowing what's inside the gzipped file) is to do the processing somewhere else (AWS?) and then pushed the processed data to your GAE application in small bits. | 0 | 1 | 0 | 0 | 2011-03-06T14:45:00.000 | 2 | 0 | false | 5,211,129 | 0 | 0 | 1 | 2 | I'm working on a Python web app that needs to import big (in terms of GAE limits) gzipped files from a third party site on regular basis. Think of rdf exports DMOZ project is producing on regular intervals.
This means daily fetching of a 500+ MB gzip file, gunzipping, parsing, processing and storing the results in GAE'... |
GAE: scheduled import of big gzipped file from a third party site | 5,226,725 | 1 | 0 | 87 | 0 | python,google-app-engine | The limit on downloaded file size in App Engine is currently 64MB. As a result, you've got two options:
Use HTTP Range headers to download and process the file in chunks.
Use an external service to do the download, split it into pieces, and send the pieces to your App Engine app. | 0 | 1 | 0 | 0 | 2011-03-06T14:45:00.000 | 2 | 1.2 | true | 5,211,129 | 0 | 0 | 1 | 2 | I'm working on a Python web app that needs to import big (in terms of GAE limits) gzipped files from a third party site on regular basis. Think of rdf exports DMOZ project is producing on regular intervals.
This means daily fetching of a 500+ MB gzip file, gunzipping, parsing, processing and storing the results in GAE'... |
Django 1.2.3 compatible with python 2.5.2 ? Weird django behaviour | 5,216,170 | 0 | 0 | 180 | 0 | python,django,rendering | By default mod_python decides when to reload, so you'll get what you get when you get it.
Maybe I am mistaken, but I thought there was a directive you could send that would explicitly force the python reload now. That should (in theory) help with achieving consistent but perhaps not ideal, behavior.
Off topic, this so... | 0 | 0 | 0 | 0 | 2011-03-06T15:26:00.000 | 3 | 0 | false | 5,211,338 | 0 | 0 | 1 | 1 | Well main question of the day will django work correctly under python 2.5.2 ?
So why i am asking this question?
First of all i have some test class written , nothing special which renders a page. The problem is that everytime i access this page i get random 3 different responses :
1)exceptions must be classes, instanc... |
Django manage.py syncdb doing nothing when used with sqlite3 | 5,211,417 | 3 | 4 | 5,639 | 1 | python,django,sqlite | As always, syncdb does not migrate the existing schema. | 0 | 0 | 0 | 0 | 2011-03-06T15:26:00.000 | 3 | 0.197375 | false | 5,211,340 | 0 | 0 | 1 | 1 | I'm not sure if this is an issue specific to sqlite databases but after adding some properties I executed syncdb successfully but still the the columns were not added to the database and when I try the access the model in admin I get no such column error.
Why is this happening and how do I overcome this issue?
Details:... |
Could Python be compiled to run on the V8 Engine? | 5,214,600 | 3 | 7 | 2,419 | 0 | python,v8 | There are already three projects that provide a Python to Javascript compiler. The resulting Javascript can then be run on any engine including V8. Look for Pyjamas, Skulpt and Py2JS.
This is not the same as compiling Python to V8 bytecodes, but the end result is much the same. | 0 | 0 | 0 | 0 | 2011-03-06T23:26:00.000 | 7 | 0.085505 | false | 5,214,230 | 1 | 0 | 1 | 3 | Presumably Javascript is compiled to some kind of byte-code to run on the V8 Engine? Is Python a similar enough language that we can imagine Python being compiled to the same byte-code and run on the V8?
Any projects trying to do this? |
Could Python be compiled to run on the V8 Engine? | 5,611,008 | 3 | 7 | 2,419 | 0 | python,v8 | V8 doesn't actually have a general purpose bytecode. There's a regexp byte code, but support is not usually compiled in. There's a deserialization byte code and a relocation information byte code, but both are implemtation details and you can't use them for anything.
So what you are looking for is something that comp... | 0 | 0 | 0 | 0 | 2011-03-06T23:26:00.000 | 7 | 1.2 | true | 5,214,230 | 1 | 0 | 1 | 3 | Presumably Javascript is compiled to some kind of byte-code to run on the V8 Engine? Is Python a similar enough language that we can imagine Python being compiled to the same byte-code and run on the V8?
Any projects trying to do this? |
Could Python be compiled to run on the V8 Engine? | 5,214,247 | -5 | 7 | 2,419 | 0 | python,v8 | Python is already compiled to bytecode and executed. This is what the .pyc files are in CPython. Jython likewise compiles to Java bytecode (dynamically), and so does IronPython for .NET | 0 | 0 | 0 | 0 | 2011-03-06T23:26:00.000 | 7 | -1 | false | 5,214,230 | 1 | 0 | 1 | 3 | Presumably Javascript is compiled to some kind of byte-code to run on the V8 Engine? Is Python a similar enough language that we can imagine Python being compiled to the same byte-code and run on the V8?
Any projects trying to do this? |
Django: what is the difference (rel & field) | 5,223,598 | -18 | 57 | 11,436 | 0 | python,django,entity-relationship | If you discovered ManyToManyRel by digging into the source code, you can read the docstrings for the class. It's not documented anywhere - on purpose, because it's not for external use. It is certainly not meant for defining actual field relationships between models. | 0 | 0 | 0 | 0 | 2011-03-07T07:17:00.000 | 2 | 1.2 | true | 5,216,891 | 0 | 0 | 1 | 1 | What is the difference between Django's models.ManyToManyField and models.ManyToManyRel? I'm confused about this stuff. |
App Engine Bulkloader | 5,220,288 | 2 | 1 | 1,639 | 0 | python,google-app-engine,bulkloader | If you're using App Engine Launcher, simply click the Deploy button; it runs appcfg.py update. appcfg is installed as part of the SDK. | 0 | 1 | 0 | 0 | 2011-03-07T12:55:00.000 | 4 | 0.099668 | false | 5,219,977 | 0 | 0 | 1 | 1 | I am trying to use Bulkloader of google app engine but unfortunately could not understand what to do from documentation. It says add this part to app.yaml
builtins:
- remote_api: on
ok i have added. Then says that i have to execute this command
appcfg.py update
but i don't have any appcfg.py file. And also what is the... |
Limit amount of writes to database using memcache | 5,222,081 | 6 | 2 | 1,124 | 1 | python,google-app-engine,caching,memcached,google-cloud-datastore | This is a recipe for lost data. I have a hard time believing that a guest book is causing enough write activity to be an issue. Also, the bookkeeping involved in this would be tricky, since memcache isn't searchable. | 0 | 1 | 0 | 0 | 2011-03-07T16:12:00.000 | 3 | 1.2 | true | 5,221,977 | 0 | 0 | 1 | 1 | I am trying to modify the guestbook example webapp to reduce the amount of database writes.
What I am trying to achieve is to load all the guestbook entries into memcache which I have done.
However I want to be able to directly update the memcache with new guestbook entries and then write all changes to the database a... |
Cross Platform App with Localization | 5,225,427 | 0 | 0 | 176 | 0 | python,ruby,eclipse,netbeans,monodevelop | Tcl/tk has excellent unicode support, and a very workable message catalog library. It's also highly portable to all major platforms (and several not-so-major platforms). In addition, you have the option of packaging your whole app up as a platform-dependent runtime (tclkit) and platform-independent application file (st... | 0 | 0 | 0 | 0 | 2011-03-07T20:56:00.000 | 1 | 1.2 | true | 5,225,155 | 0 | 0 | 1 | 1 | I am interested in developing a simple language learning (French, German, etc) desktop application to assist users in learning vocabulary by seeing and listening (via MP3 files) to words simultaneously.
I done some programming when I was younger and see this as a long term project to get back into programming by develo... |
Implementing Django with ODK Aggregate | 7,540,809 | 1 | 0 | 469 | 0 | python,django,google-app-engine | ODK Aggregate is written on Java stack. If you want to use python/Django to make it more user friendly and good looking, it is better to rewrite it completely instead of mixing technologies.
Several ODK Build alternatives are available, neither one of those was built on top of others, so it is not mandatory what you a... | 0 | 1 | 0 | 0 | 2011-03-08T00:59:00.000 | 1 | 0.197375 | false | 5,227,167 | 0 | 0 | 1 | 1 | I'm working on a project where our team is trying to implement Django into the ODK Aggregate platform, we don't quite enjoy their choice of functionality/looks, so we want to create a better template and make it more user-friendly.
We've yet to understand how to upload Django onto the Appengine/Appspot, Aggregate was p... |
Securely storing account balances in a database? | 5,236,907 | 1 | 3 | 453 | 1 | python,database,django,web-applications | My language agnostic recommendation would be to make sure that the database that communicates with the web app is read only; at least for the table(s) that deal with these account balances. So, you process payments, and manage the reduction of account balances in a database that is not accessible to anyone other than y... | 0 | 0 | 0 | 0 | 2011-03-08T18:45:00.000 | 2 | 0.099668 | false | 5,236,855 | 0 | 0 | 1 | 2 | So I have a Django web application and I need to add a payment module to it.
Basically a user will prepay for a certain amount of service and this will slowly reduce over as the user uses the service. I'm wondering what is the best practice to facilitate this? I can process payments using Satchmo, but then just storing... |
Securely storing account balances in a database? | 5,236,901 | 6 | 3 | 453 | 1 | python,database,django,web-applications | I don't know about a "well-tested solution" as you put it, but I would strongly caution against just storing a dollar value in the database and increasing or decreasing that dollar value. Instead, I would advise storing transactions that can be audited if anything goes wrong. Calculate the amount available from the c... | 0 | 0 | 0 | 0 | 2011-03-08T18:45:00.000 | 2 | 1.2 | true | 5,236,855 | 0 | 0 | 1 | 2 | So I have a Django web application and I need to add a payment module to it.
Basically a user will prepay for a certain amount of service and this will slowly reduce over as the user uses the service. I'm wondering what is the best practice to facilitate this? I can process payments using Satchmo, but then just storing... |
Can web2py work with svn? | 5,240,964 | 5 | 1 | 742 | 0 | python,web2py | Yes, it works fine with svn, hg, whatever source control you need to use.
Sometimes people think that you have to code with web2py's admin interface, but that really is not the case, once you realize it can be edited with any of your regular tools, you will see that you don't have to treat it any differently when it c... | 0 | 0 | 1 | 0 | 2011-03-09T02:27:00.000 | 1 | 1.2 | true | 5,240,646 | 0 | 0 | 1 | 1 | I just start to learn python and web2py. Because of web2py's web interface development, I am wondering how can web2py work with svn? If a team wants to build a website,how do they work together? How to control the iteration of source code? |
Detect if a model has changed before calling save in Django | 5,246,846 | 34 | 21 | 16,703 | 0 | python,django,django-models | If you save your instance through a form, you can check form.has_changed(). | 0 | 0 | 0 | 0 | 2011-03-09T02:31:00.000 | 5 | 1 | false | 5,240,670 | 0 | 0 | 1 | 2 | I have a database model that is being updated based on changes in remote data (via an HTML scraper).
I want to maintain a field called changed - a timestamp denoting when the last time that model's values changed from what they were previously (note that this is different from auto_now as these fields are updated every... |
Detect if a model has changed before calling save in Django | 5,242,167 | 3 | 21 | 16,703 | 0 | python,django,django-models | You might try computing a checksum of the record values when you save them. Then when you read it later, recompute the checksum and see if it has changed. Perhaps the crc32 function in the Python zlib standard module. (I'm not sure what kind of performance this would have. So you may want to investigate that.) | 0 | 0 | 0 | 0 | 2011-03-09T02:31:00.000 | 5 | 0.119427 | false | 5,240,670 | 0 | 0 | 1 | 2 | I have a database model that is being updated based on changes in remote data (via an HTML scraper).
I want to maintain a field called changed - a timestamp denoting when the last time that model's values changed from what they were previously (note that this is different from auto_now as these fields are updated every... |
django - how to get model objects from another process instead of database | 5,245,050 | 0 | 0 | 246 | 0 | python,django,web-applications,django-models | i think better to use `memcached (http://memcached.org/) in mem cached server and each server see this server
also you can serialize your data and send it like udp and other method | 0 | 0 | 0 | 0 | 2011-03-09T06:37:00.000 | 2 | 0 | false | 5,242,230 | 0 | 0 | 1 | 2 | I have a TCP server, a Python app, that gets the information from the connected devices. This information I am trying to show using Django web app. So, basically my model objects reside within the TCP server process.
I can modify the TCP server to put the information into SQLite database and have my Django web app take... |
django - how to get model objects from another process instead of database | 5,244,998 | 1 | 0 | 246 | 0 | python,django,web-applications,django-models | You may be able to serialise your model and pass the serialised data. | 0 | 0 | 0 | 0 | 2011-03-09T06:37:00.000 | 2 | 1.2 | true | 5,242,230 | 0 | 0 | 1 | 2 | I have a TCP server, a Python app, that gets the information from the connected devices. This information I am trying to show using Django web app. So, basically my model objects reside within the TCP server process.
I can modify the TCP server to put the information into SQLite database and have my Django web app take... |
AppEngine Analytics Model with Lists of Times | 5,251,064 | 0 | 1 | 175 | 0 | python,google-app-engine,model,transactions,google-cloud-datastore | There's no reason to shard a model. There's no limit on the number of entities you can have with a given kind name - they're all stored in the same Bigtable anyway!
It's not clear what you're trying to do that requires filtering on a list. Can you clarify? What sort of query do you want to perform? | 0 | 1 | 0 | 0 | 2011-03-09T18:11:00.000 | 2 | 0 | false | 5,250,236 | 0 | 0 | 1 | 2 | I want to log analytics data (when someone loads page X, loads a js plugin, cancels a transaction) for my AppEngine app.
I'm going to set it up as follows:
1. Event X occurs.
2. Add to taskqueue to put this event in the datastore.
3. Filter over datastore to graph and analyze usage data.
So here's the issue: I'd like... |
AppEngine Analytics Model with Lists of Times | 5,360,121 | 0 | 1 | 175 | 0 | python,google-app-engine,model,transactions,google-cloud-datastore | Instead of logging this data inside your app, have you considered imbedding a proper analytics software, such as Google Analytics in your app?
Your app is not really all that different from a normal website, even if you require logins. Google Analytics will provide you a much better reporting suit than just putting dat... | 0 | 1 | 0 | 0 | 2011-03-09T18:11:00.000 | 2 | 0 | false | 5,250,236 | 0 | 0 | 1 | 2 | I want to log analytics data (when someone loads page X, loads a js plugin, cancels a transaction) for my AppEngine app.
I'm going to set it up as follows:
1. Event X occurs.
2. Add to taskqueue to put this event in the datastore.
3. Filter over datastore to graph and analyze usage data.
So here's the issue: I'd like... |
Economically deleting data from app engine | 5,252,580 | 0 | 8 | 524 | 0 | python,google-app-engine | You mean you used GQL in the datastore admin? Like, delete from x...? And that was too expensive? Hmmm...
Well, you might save some money if you integrate deleting into your runtime code. ie, if a user is logged in, you're already accessing the db, presumably with the same indicies, so why not delete it then? You would... | 0 | 1 | 0 | 0 | 2011-03-09T21:37:00.000 | 6 | 0 | false | 5,252,477 | 0 | 0 | 1 | 4 | I have a popular social game, for which I was storing every user action as an Event entity in the data store and then once per day exporting these events from GAE for processing. Now I'd like to delete all of these entities from the data store, all 300 million of them.
I started using the "datastore admin" for this. In... |
Economically deleting data from app engine | 5,257,085 | 0 | 8 | 524 | 0 | python,google-app-engine | Questions.
- Are your Event entities grouped in entity groups?
- How many indexes do you have? Any composite ones?
- How many properties that are not indexed=False?
Just trying to determine the cost of a delete.
You may be able have some of your indexes vacuumed before you start deleting the entities. | 0 | 1 | 0 | 0 | 2011-03-09T21:37:00.000 | 6 | 0 | false | 5,252,477 | 0 | 0 | 1 | 4 | I have a popular social game, for which I was storing every user action as an Event entity in the data store and then once per day exporting these events from GAE for processing. Now I'd like to delete all of these entities from the data store, all 300 million of them.
I started using the "datastore admin" for this. In... |
Economically deleting data from app engine | 5,260,096 | 3 | 8 | 524 | 0 | python,google-app-engine | Presuming your goal is to delete for the cheapest cost, rather than face migration, I would launch a self-scheduling task, that would clean up several hundred/thousand keys in each run, then re-schedules itself. I would purposefully throttle this task on a separate queue so that the task ran only often enough to avoid ... | 0 | 1 | 0 | 0 | 2011-03-09T21:37:00.000 | 6 | 0.099668 | false | 5,252,477 | 0 | 0 | 1 | 4 | I have a popular social game, for which I was storing every user action as an Event entity in the data store and then once per day exporting these events from GAE for processing. Now I'd like to delete all of these entities from the data store, all 300 million of them.
I started using the "datastore admin" for this. In... |
Economically deleting data from app engine | 5,263,768 | 3 | 8 | 524 | 0 | python,google-app-engine | Removing indexes first will substantially reduce the cost of deleting records. You could also limit your deletion rate to keep under the 6.5 CPU hours per day you're allocated for free, to avoid paying.
Regarding doing the deletion yourself, it's unlikely you can do it more efficiently than the datastore admin tool, wh... | 0 | 1 | 0 | 0 | 2011-03-09T21:37:00.000 | 6 | 1.2 | true | 5,252,477 | 0 | 0 | 1 | 4 | I have a popular social game, for which I was storing every user action as an Event entity in the data store and then once per day exporting these events from GAE for processing. Now I'd like to delete all of these entities from the data store, all 300 million of them.
I started using the "datastore admin" for this. In... |
Looking for a good book for Google App Engine Python | 7,766,177 | 2 | 6 | 3,027 | 0 | python,google-app-engine | I come back to this question after sereval searches.
I rode Programming Google App Engine by Dan Sanderson and Using Google App Engine by Charles Severance (both edited O'Reilly and Google Press) and they are pretty good.
I recommend it for basic usage. | 0 | 1 | 0 | 0 | 2011-03-10T09:06:00.000 | 4 | 0.099668 | false | 5,257,456 | 0 | 0 | 1 | 1 | Can you recommend me book to Google App Engine in Python?
English/French books are both accepted. |
How to manage cookies - with JavaScript or with HTTP Set-Cookie? | 5,260,708 | 3 | 2 | 618 | 0 | javascript,python,cookies | You should set your cookies wherever it's most convenient.
That probably means that some cookies will come from the server and some from the client.
Note, however, that, for security reasons, high-risk cookies (such as a login token) should be HTTP-Only so that they cannot be accessed from Javascript.
(It goes without ... | 0 | 0 | 0 | 0 | 2011-03-10T14:01:00.000 | 3 | 1.2 | true | 5,260,657 | 0 | 0 | 1 | 3 | I am creating a web application within GAE environment. It heavily uses AJAX/JSON to send/receive data and all about that. I don't worry much about browsers with JS disabled and obsolete browsers as it's my personal project and I am trying to make it simple and not bloated in code. So, I use JavaScript heavily in the p... |
How to manage cookies - with JavaScript or with HTTP Set-Cookie? | 5,260,766 | 1 | 2 | 618 | 0 | javascript,python,cookies | Cookies are always bundled with the HTTP header, so there is no 'improvement' in reading via JavaScript and sending them via AJAX to the server.
For example, display-related settings such as font-size or website language are usually only relevant for the client-side, so I'd simply use JavaScript to set and retrieve su... | 0 | 0 | 0 | 0 | 2011-03-10T14:01:00.000 | 3 | 0.066568 | false | 5,260,657 | 0 | 0 | 1 | 3 | I am creating a web application within GAE environment. It heavily uses AJAX/JSON to send/receive data and all about that. I don't worry much about browsers with JS disabled and obsolete browsers as it's my personal project and I am trying to make it simple and not bloated in code. So, I use JavaScript heavily in the p... |
How to manage cookies - with JavaScript or with HTTP Set-Cookie? | 5,261,401 | 0 | 2 | 618 | 0 | javascript,python,cookies | When you set cookies using headers you have the option of setting the HTTP only (i.e. no javascript access) and SSL - only.
Enabling these options avoids a lot of security vulnerabilities in your application (note that setting the http only flag just prevents javascript from reading the cookie - it will still be prese... | 0 | 0 | 0 | 0 | 2011-03-10T14:01:00.000 | 3 | 0 | false | 5,260,657 | 0 | 0 | 1 | 3 | I am creating a web application within GAE environment. It heavily uses AJAX/JSON to send/receive data and all about that. I don't worry much about browsers with JS disabled and obsolete browsers as it's my personal project and I am trying to make it simple and not bloated in code. So, I use JavaScript heavily in the p... |
A list of everything I need for running my app on a web server | 5,260,848 | 1 | 4 | 159 | 0 | python,django,web-application-project | You need Python, Django, a WSGI container (e.g. mod_wsgi, uWSGI, Paste Deploy), and a database server. You make the Django project available as a WSGI app, bound to the appropriate interface on the machine. | 0 | 1 | 0 | 0 | 2011-03-10T14:11:00.000 | 2 | 0.099668 | false | 5,260,801 | 0 | 0 | 1 | 1 | What I want to know are actually 2 things.
Part 1:
I have a developed source code for an application in python that uses Django framework.
What I want is to be able to run the code on a developer machine and see the result. What do I need for it?
(my guesses):
Python development enironment (Eclipse/PyDev/Aptana Studio... |
Python ORM for MS-Access | 5,262,564 | 1 | 1 | 1,062 | 1 | python,ms-access,orm | Web2py recently updated their DAL making it much easier to add support for new db engines. I don't believe there is currently native Jet (MS Access) support, but the existing SQL Server support could probably be modified without much effort to provide MS Access support. The latest version of the web2py DAL is a singl... | 0 | 0 | 0 | 0 | 2011-03-10T16:08:00.000 | 2 | 1.2 | true | 5,262,387 | 0 | 0 | 1 | 1 | I need to use a Python ORM with a MS-Access database (in Windows).
My first searches are not really succesfull :
SQLAlchemy : no MS Access support in the two last versions.
DAL from Web2Py : no Access (??)
Storm : no MS Access
sqlobject: no MS Access
dejavu : seems OK for MS Access but
is the project alive ?
Any ide... |
buildbot from start | 5,692,993 | 0 | 0 | 1,638 | 0 | python,buildbot | Some additional information about configuring abd running buildslave after it's creation.
After installing buildbot package int.d script /etc/init.d/buildbot is added to enable running buildbot as a service (starting automatically after system restart and so on).
For this script to run successfully you need to edit con... | 0 | 0 | 0 | 1 | 2011-03-10T16:49:00.000 | 4 | 0 | false | 5,262,977 | 0 | 0 | 1 | 1 | should be dumb as everybody seems to installed it without trouble.
I spent hours within a fresh squeeze and tried different configurations (easy_install, aptitude and from source 0.81p.tar.gz) the best I got is a page from the localhost:9989
without any slave started.
Knowing that I made the 2 accounts : buildmaster a... |
How to call django template in order to use it through Jquery? | 5,266,823 | 2 | 1 | 830 | 0 | jquery,python,django,forms | Create a Django view which renders just the HTML for the form using your preferred template. Then use $.ajax() with dataType: "html" to get the code for the form for use in your overlay. | 0 | 0 | 0 | 0 | 2011-03-10T21:59:00.000 | 3 | 1.2 | true | 5,266,425 | 0 | 0 | 1 | 1 | I've installed the django-newsletter application, and customized the subscribing form. But, right now, I'd like to print it through a Jquery Overlay, instead of a flatpage containing that form.
Problem is I don't know how to include this flatpages elements into every page where the link calling the overlay will be pre... |
What is a good Django workflow? | 5,471,733 | 0 | 17 | 3,676 | 0 | python,django | here is something I do in general,
configure basic settings
configure root url.py
configure settings, url.py for static (media) files
create model
sync db
write views (use simple template, if needed)
once you are done with back end implementation
think about UI
prepare styles, scripts
start working on template imple... | 0 | 0 | 0 | 0 | 2011-03-11T03:16:00.000 | 6 | 0 | false | 5,268,588 | 0 | 0 | 1 | 4 | I'm a beginner to Python and Django.
When starting a new project what do you do first before diving into the code?
For example, one could take the following steps:
Configure the settings.py file first
Configure models.py to lay out data structure
Create template files
Define the views/pages
Syncdb
etc
So my questio... |
What is a good Django workflow? | 5,461,948 | 0 | 17 | 3,676 | 0 | python,django | I find that my process varies depending on a lot of variables, mainly whether I know something will work or if I'm experimenting and also whether I'm developing on my production server or in a development environment.
For example, I often do my development directly on the deployment server (most of my work is for intra... | 0 | 0 | 0 | 0 | 2011-03-11T03:16:00.000 | 6 | 0 | false | 5,268,588 | 0 | 0 | 1 | 4 | I'm a beginner to Python and Django.
When starting a new project what do you do first before diving into the code?
For example, one could take the following steps:
Configure the settings.py file first
Configure models.py to lay out data structure
Create template files
Define the views/pages
Syncdb
etc
So my questio... |
What is a good Django workflow? | 5,273,465 | 2 | 17 | 3,676 | 0 | python,django | I personally can't make a template without writing the views (unless it's a photoshop draft) but in general that's the way I go after I have a plan.
What's extremely important for me is that I don't dive head-first into the code, and that I spend time mocking up the model structure based on the "screens" or "pages" tha... | 0 | 0 | 0 | 0 | 2011-03-11T03:16:00.000 | 6 | 0.066568 | false | 5,268,588 | 0 | 0 | 1 | 4 | I'm a beginner to Python and Django.
When starting a new project what do you do first before diving into the code?
For example, one could take the following steps:
Configure the settings.py file first
Configure models.py to lay out data structure
Create template files
Define the views/pages
Syncdb
etc
So my questio... |
What is a good Django workflow? | 5,272,219 | 8 | 17 | 3,676 | 0 | python,django | the required steps for a Django application?
There are two required steps.
Write the settings. Write the urls.py
The rest of the steps are optional.
This also serves as a checklist of things to do.
Bad policy. You don't need a checklist of Django features. You need a collection of use cases or user stories whic... | 0 | 0 | 0 | 0 | 2011-03-11T03:16:00.000 | 6 | 1 | false | 5,268,588 | 0 | 0 | 1 | 4 | I'm a beginner to Python and Django.
When starting a new project what do you do first before diving into the code?
For example, one could take the following steps:
Configure the settings.py file first
Configure models.py to lay out data structure
Create template files
Define the views/pages
Syncdb
etc
So my questio... |
Django or web.py, which is better to build a large website with Python? | 5,285,462 | 7 | 14 | 15,107 | 0 | python,django,web.py | Django is actually quite fast. Using caches and multiple DB backends is a doodle - you actually can utilize Django's predefined caching framework for one-line view caching or even template fragment caching. And of course - low-level cache API. And - it's fun!
In my experience - deployed under nginx and uWSGI, watched o... | 0 | 0 | 0 | 0 | 2011-03-11T16:03:00.000 | 4 | 1 | false | 5,275,296 | 0 | 0 | 1 | 2 | I'd like to use Python to build a website with more than 100,000 PV each day. Now what I concern is to choose which web framework. I know lots of people use Django, and some people use web.py. Django seems powerful, and I also like the simplicity of web.py. Which framework should I use? (Please introduce the performanc... |
Django or web.py, which is better to build a large website with Python? | 5,275,388 | 8 | 14 | 15,107 | 0 | python,django,web.py | Django makes building complicated sites really simple. Before Django, I was messing around with PHP, and I was doing a really terrible job putting it together. Django leads you in the right direction with some good practices which makes your site really easy to maintain and update. I really like the ORM and how you ... | 0 | 0 | 0 | 0 | 2011-03-11T16:03:00.000 | 4 | 1.2 | true | 5,275,296 | 0 | 0 | 1 | 2 | I'd like to use Python to build a website with more than 100,000 PV each day. Now what I concern is to choose which web framework. I know lots of people use Django, and some people use web.py. Django seems powerful, and I also like the simplicity of web.py. Which framework should I use? (Please introduce the performanc... |
Share Session between Play framework and Django | 5,289,431 | 1 | 4 | 1,182 | 0 | java,python,django,single-sign-on,playframework | If you use a standard SSO mechanism, it should be managed by the mechanism itself...
The webserver (Django or Play) should redirect the user to the authentication page of the SSO server. The SSO server generates a token and sent it back to the client (in a cookie for example) and redirects the client to the webserver (... | 0 | 0 | 0 | 0 | 2011-03-12T13:28:00.000 | 3 | 0.066568 | false | 5,282,764 | 0 | 0 | 1 | 2 | How can I create a single sign on application that will let me move from one section of my site to another. One section of my site uses play framework and the other is on django. My SSO know-how is very limited so be nice to me :) |
Share Session between Play framework and Django | 5,282,901 | 1 | 4 | 1,182 | 0 | java,python,django,single-sign-on,playframework | A very simple solution would be to use a cookie on your domain that can be read by both Play! and Django. The cookie could hold a temporary token that both apps can check at e.g. a shared DB in case the user is not already logged-in for that app. | 0 | 0 | 0 | 0 | 2011-03-12T13:28:00.000 | 3 | 0.066568 | false | 5,282,764 | 0 | 0 | 1 | 2 | How can I create a single sign on application that will let me move from one section of my site to another. One section of my site uses play framework and the other is on django. My SSO know-how is very limited so be nice to me :) |
how to set the admin user with GAE dev app server? | 5,283,536 | 0 | 3 | 924 | 0 | python,google-app-engine | When you log in (the blue box where you enter the email) there is a checkbox to apply the administrator flag to your session. | 0 | 1 | 0 | 0 | 2011-03-12T15:44:00.000 | 3 | 0 | false | 5,283,506 | 0 | 0 | 1 | 1 | I want to create an Admin-only page for my GAE application. But I found there's no way to set a Admin user, so I cannot log on the page I created and test the function. I tried the local Admin console, but no luck. How can I do this? |
Does anyone have experience using Backbone.js and Pylons/Pyramid ? any sample to look at? | 6,868,297 | 0 | 7 | 1,358 | 0 | javascript,python,backbone.js,pylons,pyramid | Could you elaborate on your question a little bit? What are you looking to do?
I have worked with backbone and pylons/pyramid, but they interface with each other and are not integrated. Backbone talks to the API which was built using pyramid. | 0 | 0 | 0 | 0 | 2011-03-13T01:07:00.000 | 3 | 0 | false | 5,286,738 | 0 | 0 | 1 | 1 | Does anyone have experience using Backbone.js and Pylons/Pyramid ? any sample to look at ? |
Get the GET query in a Python CGI script (Apache, mod_cgi) | 5,287,233 | 1 | 0 | 669 | 0 | python,apache,cgi | I think I figured it out. I need to use the environ variable passed to the application function by mod_wsgi.
Thanks! | 0 | 0 | 0 | 1 | 2011-03-13T03:02:00.000 | 1 | 0.197375 | false | 5,287,113 | 0 | 0 | 1 | 1 | I am trying to get the query string in a CGI python script because for some reason the .FieldStorage and .getvalue functions are returning "None". The query is being generated correctly. I checked it in Wireshark and it is correctly produced.
Any ideas on how I can just get the string itself correctly?
I was trying to ... |
Role of semi-colon in sql injection and xss attacks | 5,294,235 | 1 | 0 | 1,373 | 0 | python,escaping,sql-injection,xss | Semicolons are sometimes an issue when putting values into SQL, but are not an issue when putting values into HTML.
cgi.escape() is designed for escaping things that are being put into HTML, and thus only escapes things that are an issue in HTML. | 0 | 0 | 0 | 0 | 2011-03-14T02:39:00.000 | 2 | 0.099668 | false | 5,294,185 | 0 | 0 | 1 | 2 | I've been told to use (python's) cgi.escape() function to avoid sql injections and xss attacks, although I'm sure that django automatically escapes variables. Reading about such attacks, it seems to me that the role of the semi-colon is crucial to both injecting sql and javascript. Yet, cgi.escape doesn't seem to enc... |
Role of semi-colon in sql injection and xss attacks | 5,294,230 | 3 | 0 | 1,373 | 0 | python,escaping,sql-injection,xss | cgi.escape is used to convert text that might contain &, <, and > characters, which generally aren't visible in HTML documents, into HTML entities that will be displayed. It has nothing whatsoever to do with preventing SQL injection, although it might help prevent XSS attacks by displaying HTML codes as text rather th... | 0 | 0 | 0 | 0 | 2011-03-14T02:39:00.000 | 2 | 0.291313 | false | 5,294,185 | 0 | 0 | 1 | 2 | I've been told to use (python's) cgi.escape() function to avoid sql injections and xss attacks, although I'm sure that django automatically escapes variables. Reading about such attacks, it seems to me that the role of the semi-colon is crucial to both injecting sql and javascript. Yet, cgi.escape doesn't seem to enc... |
Python - Importing a global/site-packages module rather than the file of the same name in the local directory | 46,303,381 | 1 | 2 | 3,449 | 0 | python,django,import,python-module | I was able to force python to import the global one with
from __future__ import absolute_import
at the beginning of the file (this is the default in python 3.0) | 0 | 0 | 0 | 1 | 2011-03-14T13:28:00.000 | 6 | 0.033321 | false | 5,299,199 | 1 | 0 | 1 | 2 | I'm using python and virtualenv/pip. I have a module installed via pip called test_utils (it's django-test-utils). Inside one of my django apps, I want to import that module. However I also have another file test_utils.py in the same directory. If I go import test_utils, then it will import this local file.
Is it possi... |
Python - Importing a global/site-packages module rather than the file of the same name in the local directory | 5,351,006 | 0 | 2 | 3,449 | 0 | python,django,import,python-module | Since my test_utils was in a django project, I was able to go from ..test_utils import ... to import the global one. | 0 | 0 | 0 | 1 | 2011-03-14T13:28:00.000 | 6 | 1.2 | true | 5,299,199 | 1 | 0 | 1 | 2 | I'm using python and virtualenv/pip. I have a module installed via pip called test_utils (it's django-test-utils). Inside one of my django apps, I want to import that module. However I also have another file test_utils.py in the same directory. If I go import test_utils, then it will import this local file.
Is it possi... |
amqp queue_delete catch errors in async way | 5,787,202 | 0 | 1 | 307 | 0 | python,rabbitmq,amqp,tornado | Try to avoid the error. If you declare a connection to the queue, and it doesn't exist, it will be created. Then immediately delete it.
Or, if you will use that queue again in the next week or so, i.e. it is not single-use, then just leave it around and handle deletion as a system admin activity that cleans up long ter... | 0 | 1 | 0 | 0 | 2011-03-14T18:23:00.000 | 2 | 0 | false | 5,302,695 | 0 | 0 | 1 | 1 | I've just got started using pika(v 0.9.4) with Tornado (through the use of pika.adapters.tornado_connection.TornadoConnection) and I was wondering what's the appropriate way of catching errors when using, say: queue_delete for when the queue you're trying to delete doesn't exist. RabbitMQ raises AMQPError, but I am not... |
WSGI with .pyc files | 5,306,151 | 0 | 1 | 806 | 0 | python,wsgi | You might need to put all the python files on that machine, then convert them to .pyc or .pyo then delete the .py's
I'm suspecting maybe the .pys were generated on a different version of python maybe.
Also paste the import errors .. that might help in diagnoses. | 0 | 0 | 0 | 0 | 2011-03-14T22:02:00.000 | 1 | 0 | false | 5,305,119 | 0 | 0 | 1 | 1 | I'm trying to migrate to wsgi but I'm getting ImportError exceptions all the time.
I have my modules installed only with .pyc files, I don't have the .py files in the server (I can't change that, sorry). When I add some .py files the ImportError moves away to some other import line.
Is there a way to make WSGI use the ... |
Kickstarter clone in Drupal? | 5,307,082 | 1 | 0 | 1,290 | 0 | python,ruby-on-rails,ruby,django,drupal | Drupal would likely handle the basic concept of listings rather adeptly, but you'd need to write plenty of glue code to make it match the exact functionality you want. It would, in fact, be easier to write it from scratch than to force a tool to do a different job.
Go for a full-fledged web app framework. | 0 | 0 | 0 | 0 | 2011-03-15T02:59:00.000 | 1 | 1.2 | true | 5,307,039 | 0 | 0 | 1 | 1 | I would like to create a Kickstarter type clone in terms of functionality.
Can Drupal produce a crude prototype?
Or suck it up, hit the books and learn python/django or ruby/rails.
I appreciate any and all input. |
Is there any python implement of edonkey/emule | 5,313,852 | 1 | 1 | 2,485 | 0 | python,p2p | After 20 minutes of googling all combinations of python and edonkey/emule/ed2k and visiting all sites of all clients listed under the "eDonkey network" Wikipedia page I can say with near certainty that the answer is "No." | 0 | 1 | 0 | 0 | 2011-03-15T14:51:00.000 | 2 | 0.099668 | false | 5,313,513 | 0 | 0 | 1 | 1 | I want deploy a project in google appengine to search edonkey/emule, Is there any python implement of edonkey/emule or ed2k protocol library ? |
Datetime string with timezone in Python? | 5,314,445 | 0 | 2 | 883 | 0 | python,timezone | using strftime is encouraged, but make sure that your localtime is correct. This should be a setting in your app/site assuming you're using django, or you may have to do this manually | 0 | 0 | 0 | 0 | 2011-03-15T15:47:00.000 | 2 | 0 | false | 5,314,267 | 1 | 0 | 1 | 1 | I'm working on Google app engine with Python.
I have stored a datetime object in database and fetched it and applied timezone, and I saved it using template. The result is "2011-03-15 16:54:24.398503+09:00", but what I want is: "2011-03-16 01:54:24" (timezone applied string without millisecond - note that day is change... |
Naming variable, best convention | 5,315,446 | 1 | 14 | 19,912 | 0 | python,django,naming-conventions | I use lower_case_with_underscore for variables, methods and functions. I think it really improves readability of the code.
For classes, I tend to use upper case the first letter: class NewsForm (forms.Form): | 0 | 0 | 0 | 0 | 2011-03-15T15:58:00.000 | 6 | 0.033321 | false | 5,314,421 | 1 | 0 | 1 | 3 | What is the most used convention for naming variables in Python / Django?
ex: pub_date or pubdate
What about for classes and methods? |
Naming variable, best convention | 5,314,880 | 1 | 14 | 19,912 | 0 | python,django,naming-conventions | The important thing is being consistent with your naming style. Choose one with your project mates and use it. Don't mix them. I personally use camelCase:
Sample class name: MyClass (capital letter at the beginning)
Sample method name: myMethod
Sample variable name: myVariable
Sample constant/enum name: MY_CONST
Class ... | 0 | 0 | 0 | 0 | 2011-03-15T15:58:00.000 | 6 | 0.033321 | false | 5,314,421 | 1 | 0 | 1 | 3 | What is the most used convention for naming variables in Python / Django?
ex: pub_date or pubdate
What about for classes and methods? |
Naming variable, best convention | 5,314,547 | 2 | 14 | 19,912 | 0 | python,django,naming-conventions | Code Complete (http://www.cc2e.com/) has some great chapters about function/variable naming, not for Python explicitly, but perhaps still interesting... | 0 | 0 | 0 | 0 | 2011-03-15T15:58:00.000 | 6 | 0.066568 | false | 5,314,421 | 1 | 0 | 1 | 3 | What is the most used convention for naming variables in Python / Django?
ex: pub_date or pubdate
What about for classes and methods? |
python webservice execution problem | 5,319,171 | 0 | 1 | 93 | 0 | python,web-services | This is from my experience of using Django with Apache, but have you tried restarting your web server? Sometimes the web server will hold a copy of the code in memory to speed up execution, but restarting your web server will make it reload all *.py files.
Providing more information about the technology stack you are ... | 0 | 1 | 0 | 0 | 2011-03-15T22:59:00.000 | 2 | 0 | false | 5,319,088 | 0 | 0 | 1 | 2 | I have a python web service. My problem is when I changed my web service classes. I can't see the changes on the browser and I see last version of web service on the browser all the time.
I used Bottle framework and cgi. |
python webservice execution problem | 7,275,232 | 0 | 1 | 93 | 0 | python,web-services | You need to restart the Bottle app after each change. Doing this manually during development is a pain in the neck. Fortunately Bottle provides a way to automate via a "reloader" option to the Run method:
run(reloader=True)
When you edit & save a module file, the reloader will restart the server process for you... | 0 | 1 | 0 | 0 | 2011-03-15T22:59:00.000 | 2 | 0 | false | 5,319,088 | 0 | 0 | 1 | 2 | I have a python web service. My problem is when I changed my web service classes. I can't see the changes on the browser and I see last version of web service on the browser all the time.
I used Bottle framework and cgi. |
Choosing between Django-Apache and Java-Tomcat for a web application | 5,781,961 | 8 | 7 | 16,444 | 0 | java,python,django,tomcat | Here are my experiences:
Django-Apache fits in 16MBs of memory, whereas Java-Tomcat requires much more than that.
Coding in Python is much faster, that is true. In Java, on the other hand, you have compile-time checks, profilers and debuggers that help you increase the stability of your application.
If you are plannin... | 0 | 0 | 0 | 0 | 2011-03-16T02:40:00.000 | 3 | 1 | false | 5,320,457 | 0 | 0 | 1 | 1 | In order to develop a web application that can easily scale, provide production stability, is easily deploy-able, and allows for fast development cycles, what points would you recommend I look at before choosing one or the other framework - using Java and Tomcat, or Django and Apache/Mod_WSGI?
Some pros and cons I coul... |
Can I use google app engine to run the python program in the background for chrome extension? | 5,322,597 | 3 | 0 | 136 | 0 | python,google-app-engine,google-chrome | What kind of program is to be executed? You could very well send a request from Chrome extension to your appengine server, process and return the response. | 0 | 1 | 0 | 0 | 2011-03-16T04:33:00.000 | 1 | 1.2 | true | 5,321,079 | 0 | 0 | 1 | 1 | I have a python program which has to execute when i click on the chrome extension.Can I use the Google app engine to do the same?? |
Speed comparisons between Chameleon and Jinja2 | 5,324,691 | 19 | 12 | 6,518 | 0 | python,performance,jinja2,pyramid,chameleon | Template engines are rarely the cause of performance problems, even if chameleon is slightly faster than Jinja2 I doubt the effort of learning a new template language etc. is worth it.
Optimization of database queries and caching will probably result in more performance than you could gain by switching the template en... | 0 | 0 | 0 | 1 | 2011-03-16T06:28:00.000 | 3 | 1 | false | 5,321,789 | 0 | 0 | 1 | 1 | Has anyone here done any benchmarking of Chameleon versus Jinja2, in respect to performance? I'm more used to the Jinja syntax, since I come from Django, but as Pyramid suggests to use Chameleon, I'm thinking if it would be nice to give it a try - despite having an awkward syntax, IMO. |
How can I execute a Python script from Javascript? | 25,336,537 | 2 | 4 | 17,271 | 0 | javascript,python,google-chrome | Probably a late reply but a possible solution is to make your python script act as a server and let the browser plugin interact with it. | 0 | 0 | 1 | 0 | 2011-03-16T15:21:00.000 | 3 | 0.132549 | false | 5,327,485 | 1 | 0 | 1 | 2 | I have written a module in python which performs some function.
I then created a Google Chrome extension which makes use of JSON and javascript.
Now when I click on the extension I want it to execute the python program which is stored on my hard disk and display the output on the browser again.
Is there a way in which... |
How can I execute a Python script from Javascript? | 5,328,172 | 1 | 4 | 17,271 | 0 | javascript,python,google-chrome | forgive me if i'm incorrect on infinite proportions.
I believe that JavaScript is executed in a sandboxed/ isolated environment. Therefore you cannot invoke a python interpreter* or any other executable residing on the system.
*unless the interpreter itself were written in javascript. | 0 | 0 | 1 | 0 | 2011-03-16T15:21:00.000 | 3 | 0.066568 | false | 5,327,485 | 1 | 0 | 1 | 2 | I have written a module in python which performs some function.
I then created a Google Chrome extension which makes use of JSON and javascript.
Now when I click on the extension I want it to execute the python program which is stored on my hard disk and display the output on the browser again.
Is there a way in which... |
Need Pattern for lookup tables in Google App Engine | 5,331,814 | 2 | 2 | 319 | 1 | python,google-app-engine,google-cloud-datastore | If it's really created once and never changes within the lifetime of a deployment, and it's relatively small (a few megs or less), store it with your app as data files. Have the app load the data into memory initially, and cache it there. | 0 | 0 | 0 | 0 | 2011-03-16T16:05:00.000 | 2 | 1.2 | true | 5,328,112 | 0 | 0 | 1 | 1 | I'm using the Python version of Google App Engine and Datastore. What is a good way to load a table that will contain lookup data?
By look up data I mean that after the initial load no rows will need to be inserted, deleted, or updated
Blowing away all rows and reloading the table is not acceptable if it destroys refe... |
Is there a good way to do version control when developing pylons applications with dependencies? | 5,329,651 | 0 | 0 | 96 | 0 | python,controls,version | The only reasonable way to do what you want is to have application B work against formal releases of application A, even if those releases are labled beta or release candidate. IOW, do not treat application A as source code, but as an imported module installed with setup.py or other means.
Doing it this way will let yo... | 0 | 0 | 0 | 0 | 2011-03-16T16:47:00.000 | 1 | 1.2 | true | 5,328,691 | 0 | 0 | 1 | 1 | I'm developing two pylons applications at the same time. Application B uses a lot of the controllers, etc. in application A. Both applications are under active development, but for administrative reasons, they have to be kept separate.
Is there a convenient way to do version control so that changes to A are easy to pul... |
What is the best, efficient approach to do a quick forms based web project? | 5,328,917 | 3 | 0 | 142 | 0 | python,django,model-view-controller,cakephp,symfony1 | Use django to two years, and I had an experience of a project using cakephp and hated it. Django was able to show better in all aspects, much of it takes the python and transparent way how the framework works. I strongly recommend Django. | 0 | 0 | 0 | 0 | 2011-03-16T16:55:00.000 | 4 | 1.2 | true | 5,328,789 | 0 | 0 | 1 | 2 | I am a database guy and its been few years since I did anything with PHP (no MVC experience). I now have to work on a Data Entry project - a form that a user will fill and submit data to the database. I figured this is much more efficient than a spreadsheet approach.
All I need is :
1) Authentication
2) Validation of ... |
What is the best, efficient approach to do a quick forms based web project? | 5,329,526 | 2 | 0 | 142 | 0 | python,django,model-view-controller,cakephp,symfony1 | If you're just doing some one off data gathering, you could save yourself the work and use Google Spreadsheets ( Create New -> Form). I know you mentioned spreadsheets, but once you've got the data you can export it and do what you want with it.
It's a simple solution and might not fit, but if it does it'll cut your t... | 0 | 0 | 0 | 0 | 2011-03-16T16:55:00.000 | 4 | 0.099668 | false | 5,328,789 | 0 | 0 | 1 | 2 | I am a database guy and its been few years since I did anything with PHP (no MVC experience). I now have to work on a Data Entry project - a form that a user will fill and submit data to the database. I figured this is much more efficient than a spreadsheet approach.
All I need is :
1) Authentication
2) Validation of ... |
How to parse unicode strings with minidom? | 5,333,621 | 3 | 12 | 16,977 | 0 | python,unicode,minidom | Minidom doesn't directly support parsing Unicode strings; it's something that has historically had poor support and standardisation. Many XML tools recognise only byte streams as something an XML parser can consume.
If you have plain files, you should either read them in as byte strings (not Unicode!) and pass that to ... | 0 | 0 | 1 | 0 | 2011-03-16T18:02:00.000 | 5 | 0.119427 | false | 5,329,668 | 0 | 0 | 1 | 1 | I'm trying to parse a bunch of xml files with the library xml.dom.minidom, to extract some data and put it in a text file. Most of the XMLs go well, but for some of them I get the following error when calling minidom.parsestring():
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 5189: or... |
Is it possible to send a URL from javascript running on the browser to the python program running on the client machine? | 5,330,014 | 0 | 0 | 73 | 0 | javascript,python | You can if you're running a server with Python.
Create a simple server with python and return json. The only requirement is that the python server must be started in order to except requests. | 0 | 0 | 1 | 0 | 2011-03-16T18:25:00.000 | 2 | 0 | false | 5,329,942 | 0 | 0 | 1 | 1 | Can I send the url of the page from the javascript to the python program running on the client machine ??
Also can I redirect the output of the python program to the javascript to be displayed on the browser? |
Python - Easiest way to scrape text from list of URLs using BeautifulSoup | 5,331,407 | 1 | 6 | 6,124 | 0 | python,screen-scraping,beautifulsoup,web-scraping | It is perfectly possible. Easiest way is to iterate through list of URLs, load the content, find the URLs, add them to main list. Stop iteration when enough pages are found.
Just some tips:
urllib2.urlopen for fetching content
BeautifulSoup: findAll('a') for finding URLs | 0 | 0 | 1 | 0 | 2011-03-16T20:20:00.000 | 3 | 0.066568 | false | 5,331,266 | 0 | 0 | 1 | 1 | What's the easiest way to scrape just the text from a handful of webpages (using a list of URLs) using BeautifulSoup? Is it even possible?
Best,
Georgina |
django autoconverting datetime property | 5,336,126 | 0 | 0 | 699 | 0 | python,mysql,django | I have a feeling your database schema knows this is a date, right? In that case it's not being stored in the format you describe, but as some representation such as seconds since the era.
This means that when you retreave it your code has to do something with it to make it look right. If you don't tell it how to look ... | 0 | 0 | 0 | 0 | 2011-03-17T06:57:00.000 | 2 | 0 | false | 5,335,845 | 0 | 0 | 1 | 1 | my datetime property is saving in mysql in this format 2011-03-17 00:00:00 but after fetchind the data with filter function it is giving March 17,2011 midnight but i have not say to do any this type of task. My question is how can i insist django to stic to show same value what is saved in MYSQL. |
Use Django User-Model or create a own Model? | 5,337,521 | 0 | 4 | 2,331 | 0 | python,django,design-decisions,django-users | Currently, you have some requirements, but over time they may change. Django's user system is quite straightforward, and using it allows to adapt more easily to some of the most common use cases.
Another aspect to think about, is that there are several applications already available that you can use, and that may requi... | 0 | 0 | 0 | 0 | 2011-03-17T09:45:00.000 | 4 | 0 | false | 5,337,351 | 0 | 0 | 1 | 2 | I'm currently designing a Django based site. For simplicity lets assume that it is a simple community site where users can log in and write messages to other users.
My current choice is wether to use the buildin User-Model or to build something my own. I don't need much from the buildin User: there will be no username ... |
Use Django User-Model or create a own Model? | 5,593,711 | 2 | 4 | 2,331 | 0 | python,django,design-decisions,django-users | As the author of django-primate I would like to add some comments. Django-primate which easily lets ju modify the built in User model is meant for just that. You might need just something a little extra, then use django-primate.
But there are problems, although I do not think modifying the django User model per se is a... | 0 | 0 | 0 | 0 | 2011-03-17T09:45:00.000 | 4 | 0.099668 | false | 5,337,351 | 0 | 0 | 1 | 2 | I'm currently designing a Django based site. For simplicity lets assume that it is a simple community site where users can log in and write messages to other users.
My current choice is wether to use the buildin User-Model or to build something my own. I don't need much from the buildin User: there will be no username ... |
Scraping a web page with java script in Python | 5,352,888 | 1 | 0 | 8,915 | 0 | javascript,python,python-3.x,web-scraping | Use Firebug to see exactly what is being called to get the data to display (a POST or GET url?). I suspect there's an AJAX call that's retrieving the data from the server either as XML or JSON. Just call the same AJAX call, and parse the data yourself.
Optionally, you can download Selenium for Firefox, start a Seleniu... | 0 | 0 | 1 | 0 | 2011-03-17T12:26:00.000 | 3 | 0.066568 | false | 5,338,979 | 0 | 0 | 1 | 2 | i'm working in python 3.2 (newb) on windows machine (though i have ubuntu 10.04 on virtual box if needed, but i prefer to work on the windows machine).
Basically i'm able to work with the http module and urlib module to scrape web pages, but only those that don't have java script document.write("<div....") and the like... |
Scraping a web page with java script in Python | 5,340,415 | 0 | 0 | 8,915 | 0 | javascript,python,python-3.x,web-scraping | document.write is usually used because you are generating the content on the fly, often by fetching data from a server. What you get are web apps that are more about javascript than HTML. "Scraping" is rather more a question of downloading HTML and processing it, but here there isn't any HTML to download. You are essen... | 0 | 0 | 1 | 0 | 2011-03-17T12:26:00.000 | 3 | 0 | false | 5,338,979 | 0 | 0 | 1 | 2 | i'm working in python 3.2 (newb) on windows machine (though i have ubuntu 10.04 on virtual box if needed, but i prefer to work on the windows machine).
Basically i'm able to work with the http module and urlib module to scrape web pages, but only those that don't have java script document.write("<div....") and the like... |
How to add a default time (but not date) to a DateTimeField in DJango? | 5,345,806 | 0 | 2 | 194 | 0 | python,django,forms,datetime,default | I tend to do these types of defaults in the models save() method or when the pre_save signal is called. | 0 | 0 | 0 | 0 | 2011-03-17T15:43:00.000 | 2 | 0 | false | 5,341,448 | 0 | 0 | 1 | 2 | I have a DateTimeField on a model. In the forms for that model, I use the SplitDateTimeWidget. I want to enable users to enter just a date, and have my code define a default time (like 2 p.m.) if one is not entered.
Is there a simple way to do this? Since this is needed for multiple forms, I would like to have a way th... |
How to add a default time (but not date) to a DateTimeField in DJango? | 5,341,535 | 1 | 2 | 194 | 0 | python,django,forms,datetime,default | You may be able to do this by subclassing DateTimeField and over-riding the clean() method. | 0 | 0 | 0 | 0 | 2011-03-17T15:43:00.000 | 2 | 0.099668 | false | 5,341,448 | 0 | 0 | 1 | 2 | I have a DateTimeField on a model. In the forms for that model, I use the SplitDateTimeWidget. I want to enable users to enter just a date, and have my code define a default time (like 2 p.m.) if one is not entered.
Is there a simple way to do this? Since this is needed for multiple forms, I would like to have a way th... |
Python Pyramid & Chameleon templating language escapes html | 10,369,248 | 16 | 4 | 3,750 | 0 | python,pyramid,chameleon,template-tal | Chameleon also allows ${structure: markup}. | 0 | 0 | 0 | 0 | 2011-03-17T22:55:00.000 | 2 | 1 | false | 5,346,295 | 0 | 0 | 1 | 1 | I can't make sense of chameleon's tags. I'm a django user, but decided to introduce my CompSci course mates and myself to Pyramid, since I though more lightweight = easier to learn.
At the moment the ${} tag is escaping any html tags I'm trying to output through it. In django there was some way to specify that a variab... |
How to call view from view.py in /admin url in django | 5,349,122 | 0 | 0 | 231 | 0 | python,django | By using a sql query. This is really basic stuff, like the other questions you have asked. Buy a book or use google, there's plenty of info out there on this stuff. | 0 | 0 | 0 | 0 | 2011-03-18T06:57:00.000 | 1 | 0 | false | 5,348,981 | 0 | 0 | 1 | 1 | How we can provide all objects of class which are stored in mysql data when application start with /admin url. |
Storing/Retrieving/Editing project specific data with Django | 5,350,427 | 1 | 1 | 96 | 0 | python,django,django-models,django-admin | If you look into caching solutions, they will probably do what you need.
The general queryset caching solution I use in johnny-cache, but for what you need, you can probably just load it up from the db and store it in the cache. | 0 | 0 | 0 | 0 | 2011-03-18T09:25:00.000 | 2 | 0.099668 | false | 5,350,089 | 0 | 0 | 1 | 2 | I'm new to Django and I'm working on the public website for a small company.
I'm facing an issue that I guess has already been encountered by lots a django noobs,
but I can't manage to find a good solution.
My problem is that there some informations (contact address, office phone number, company description...) that I... |
Storing/Retrieving/Editing project specific data with Django | 5,350,914 | 0 | 1 | 96 | 0 | python,django,django-models,django-admin | What you want to do is use select_related('contact_profile','office_data') etc when you query the items in your view, and in the admin, instead of registering all the data separately just use the InlineAdmin class for the Admin site and you will be able to edit all the information as if it was a single entity.
Check ou... | 0 | 0 | 0 | 0 | 2011-03-18T09:25:00.000 | 2 | 0 | false | 5,350,089 | 0 | 0 | 1 | 2 | I'm new to Django and I'm working on the public website for a small company.
I'm facing an issue that I guess has already been encountered by lots a django noobs,
but I can't manage to find a good solution.
My problem is that there some informations (contact address, office phone number, company description...) that I... |
fix soaplib to support chunked requests | 5,389,161 | 0 | 0 | 279 | 0 | python,web-services,soap,soaplib | a bit ugly, but looks like it works:
if '' != length:
body = input.read(int(length))
elif req_env.get("HTTP_TRANSFER_ENCODING").lower() == 'chunked':
chunk_size = int(input.readline(), 16)
while chunk_size > 0:
chunk_read_size... | 0 | 0 | 1 | 0 | 2011-03-18T11:23:00.000 | 1 | 1.2 | true | 5,351,250 | 0 | 0 | 1 | 1 | I have soap webservice built with soaplib,
but if client sent chunked request it fails on
length = req_env.get("CONTENT_LENGTH")
body = input.read(int(length))
because length is '' (empty string), any ideas how to fix soaplib? |
Is it safe to access ._meta directly in your django app? | 5,354,095 | 2 | 5 | 1,686 | 0 | python,django | I use _meta in several projects where I want to have generic access to information that's otherwise not provided by the api. I think you're probably okay most of the time as Django is pretty stable. It's probably a good idea to be covering your usage of _meta in your unit tests. | 0 | 0 | 0 | 0 | 2011-03-18T15:14:00.000 | 2 | 0.197375 | false | 5,353,984 | 0 | 0 | 1 | 1 | Django uses Meta class for lots of additional object information. However, they store this information in an object '_meta' which by naming convention is private.
All over the django admin (and other places) I see stuff like opts = model._meta and then they use the various options like app_label and verbose_name.
Can I... |
How to debug django, it spawns a new process to which I'm not attached? | 5,367,975 | 3 | 3 | 708 | 0 | python,django | If you are debugging - it is a good idea to have "--noreload" option for the dev-server.
AFAIK PyCharm has a checkbox "No reload" in the run options for the project. | 0 | 0 | 0 | 0 | 2011-03-20T09:34:00.000 | 1 | 1.2 | true | 5,367,695 | 0 | 0 | 1 | 1 | I'm trying to debug django using PyCharm, and notice that it spawns a new process to which PyCharm is not attached. My breakpoints aren't hit in this new process.
How do I debug it then? (See autoreload.restart_with_reloader()) |
How can I know if a email is sent correctly with Django/Python? | 5,375,529 | 9 | 3 | 7,759 | 0 | python,django | There is no way to check that a mail has actually been received. This is not because of a failing in Django, but a consequence of the way email works.
If you need some form of definite delivery confirmation, you need to use something other than email. | 0 | 0 | 0 | 1 | 2011-03-21T07:18:00.000 | 4 | 1 | false | 5,374,818 | 0 | 0 | 1 | 1 | I need know that if a email is sent correctly for to do several operations but the function always return True.
Any idea?
Thanks you. |
Flask/Bottle project organization | 5,381,900 | 2 | 11 | 7,590 | 0 | python,flask | I can't see how there could be any way of stopping this from working. Flask and Bottle, like Django, are just Python underneath, and Python allows you to break up files into modules. As long as you importing the relevant functions into the main script, they will just work exactly as if they were defined there. | 0 | 0 | 0 | 0 | 2011-03-21T17:17:00.000 | 5 | 0.07983 | false | 5,381,208 | 0 | 0 | 1 | 2 | I've been looking into microframeworks for Python, and have come across two interesting options, Flask and Bottle. each have some similar features. One thing I noticed is that all the example sites show all the application code located inside a single Python file. Obviously, for even moderately sized sites, this would ... |
Flask/Bottle project organization | 26,026,153 | 0 | 11 | 7,590 | 0 | python,flask | It really depends what you are trying to achieve, for micro service/applications/websites bottle is very straight forward and light weight. If you plan your application to grow by the time then Flask might be good option for you coz it has lot of extensions. We have about 40 to 50 micro services written in bottle and n... | 0 | 0 | 0 | 0 | 2011-03-21T17:17:00.000 | 5 | 0 | false | 5,381,208 | 0 | 0 | 1 | 2 | I've been looking into microframeworks for Python, and have come across two interesting options, Flask and Bottle. each have some similar features. One thing I noticed is that all the example sites show all the application code located inside a single Python file. Obviously, for even moderately sized sites, this would ... |
Is there a way to programmatically stop web.py? | 5,402,971 | 5 | 3 | 1,314 | 0 | python,web.py | I solved the question I originally raised by looking into web.py source code, and exposed the WSGIServer in web/httpserver.py to web/application.py, so that i can call WSGIServer.stop() in application.stop(), which is added by myself.
It's a quick hack and not that neat, but it removed the blocker quickly. | 0 | 0 | 0 | 0 | 2011-03-22T09:28:00.000 | 1 | 0.761594 | false | 5,389,111 | 0 | 0 | 1 | 1 | I'm trying to run web.application in a Windows Service and I cannot find a way to programmatically stop it after application.run().
I tried sys.exit and it didn't work well with Windows Service. |
Security measures for controlling access to web-services/API | 5,395,647 | 2 | 2 | 334 | 0 | python,objective-c,security,api,rsa | The easiest solution would be IP whitelisting if you expect the API consumer to be requesting from the same IP all the time.
If you want to support the ability to 'authenticate' from anywhere, then you're on the right track; it would be a lot easier to share an encryption method and then requesting users send a reques... | 0 | 0 | 0 | 1 | 2011-03-22T17:44:00.000 | 3 | 0.132549 | false | 5,395,588 | 0 | 0 | 1 | 1 | I have a webapp with some functionality that I'd like to be made accessible via an API or webservice. My problem is that I want to control where my API can be accessed from, that is, I only want the apps that I create or approve to have access to my API. The API would be a web-based REST service. My users do not log... |
Python/Google app engine data storage performance | 5,400,785 | 1 | 1 | 496 | 0 | python,performance,json,google-app-engine,google-cloud-datastore | For superior app performance, as Chris and others pointed out, python dict is the best.
But if you are ok with the minimal performance hit caused by datastore queries, I think that is the way to go purely from a design and maintenance perspective. Simplicity takes precedence over performance if you are not approaching... | 0 | 1 | 0 | 0 | 2011-03-22T18:03:00.000 | 3 | 0.066568 | false | 5,395,782 | 0 | 0 | 1 | 2 | In a python/google app engine app, I've got a choice between storing some static data (couple KB in size) in a local json/xml file or putting it into the datastore and querying it from there. The data is created by me, so there's no issues with badly formed data. In specific terms such as saving quota, less resource ... |
Python/Google app engine data storage performance | 5,395,833 | 5 | 1 | 496 | 0 | python,performance,json,google-app-engine,google-cloud-datastore | If your data is small, static and infrequently changed, you'll get the best performance by just writing your data as a dict in it's own module and just import it where you need it. This would take advantage of the fact that Python will cache your modules on import. | 0 | 1 | 0 | 0 | 2011-03-22T18:03:00.000 | 3 | 1.2 | true | 5,395,782 | 0 | 0 | 1 | 2 | In a python/google app engine app, I've got a choice between storing some static data (couple KB in size) in a local json/xml file or putting it into the datastore and querying it from there. The data is created by me, so there's no issues with badly formed data. In specific terms such as saving quota, less resource ... |
How to use Mercurial to deploy Django applications? | 5,397,870 | 0 | 0 | 627 | 1 | python,django,mercurial,apache2,mod-python | I thought about this, good idea for development.
Use mercurial in common way. And of course you need deploy mercurial server before.
If you update your django project, it will be compiled on the fly.
My workflow:
Set up mercurial server or use bitbucket
Init repo locally
Push repo to central repo
On server pull repo... | 0 | 0 | 0 | 0 | 2011-03-22T20:37:00.000 | 1 | 1.2 | true | 5,397,528 | 0 | 0 | 1 | 1 | I'm creating a server with Apache2 + mod_python + Django for development and would like to know how to use Mercurial to manage application development.
My idea is to make the folder where the Mercurial stores the project be the same folder to deploy Django.
Thank you for your attention! |
Django directory plugin | 5,423,598 | 1 | 0 | 930 | 0 | python,django,plugins,web,directory | You will not find something like that, because using django means you can do that with just a few lines of code by yourself. Django is not a CMS, but a framework, which means you are one level deeper. A lot of the things where you would use a plugin in a CMS are common tasks for django programmers, so there really is n... | 0 | 0 | 0 | 0 | 2011-03-23T01:22:00.000 | 1 | 0.197375 | false | 5,399,853 | 0 | 0 | 1 | 1 | Is there any Django plugin or reusable app available that we can use to add online directory feature to our Django based website? |
Overcoming 1mb file restriction in GAE Datastore | 5,413,209 | 0 | 2 | 349 | 0 | python,google-app-engine,google-cloud-datastore | You could work around this by splitting the blob into multiple pieces and storing them in separate entities. What you should do, though, is use the Blobstore as @Thilo suggests. | 0 | 1 | 0 | 0 | 2011-03-23T05:03:00.000 | 2 | 0 | false | 5,401,070 | 0 | 0 | 1 | 1 | As if for now, we are using datastore blob to store profile images of our site. And there is restriction in Datastore for storing more than 1mb file as a blob in datastore. Is there any work around for this. |
Where to put generic Database Tables on Django? | 5,403,151 | 0 | 0 | 208 | 0 | python,django | Django doesn't really offer you place where things that are commonly used all over the project can live. I think the most common approach to solve this is to create a 'project'-app, which holds such project-relevant things like models, templatetags or widgets for example... | 0 | 0 | 0 | 0 | 2011-03-23T09:02:00.000 | 2 | 1.2 | true | 5,402,847 | 0 | 0 | 1 | 2 | I'm trying to start with Django.
I'm developing an App. This App is called "Directory" and will store
info about websites.
I must to create a database table called "Genders", but this is a
generic database table and could be used in other App.
My question... how to deal with this kind of situation in Django? And
in wic... |
Where to put generic Database Tables on Django? | 5,403,490 | 1 | 0 | 208 | 0 | python,django | In django, you don't (generally) create database tables. You create models, and let the django ORM create tables for you.
To prevent having two tables in your database called gender, django will prefix the model name with the name of the app. Thus, if your app was called foo, your model class was Gender, you would have... | 0 | 0 | 0 | 0 | 2011-03-23T09:02:00.000 | 2 | 0.099668 | false | 5,402,847 | 0 | 0 | 1 | 2 | I'm trying to start with Django.
I'm developing an App. This App is called "Directory" and will store
info about websites.
I must to create a database table called "Genders", but this is a
generic database table and could be used in other App.
My question... how to deal with this kind of situation in Django? And
in wic... |
Asynchronous URLfetch when we don't care about the result? [Python] | 5,412,695 | 7 | 6 | 3,248 | 0 | python,google-app-engine,asynchronous,urlfetch | A task queue task is your best option here. The message you're seeing in the log indicates that the request is waiting for your URLFetch to complete before returning, so this doesn't help. You say a task is 'overkill', but really, they're very lightweight, and definitely the best way to do this. Deferred will even allo... | 0 | 1 | 0 | 0 | 2011-03-23T20:34:00.000 | 2 | 1.2 | true | 5,411,291 | 0 | 0 | 1 | 1 | In some code I'm writing for GAE I need to periodically perform a GET on a URL on another system, in essence 'pinging' it and I'm not terribly concerned if the request fails, times out or succeeds.
As I basically want to 'fire and forget' and not slow down my own code by waiting for the request, I'm using an asynchrono... |
Optimizing join query performance in google app engine | 5,415,555 | 0 | 1 | 372 | 1 | python,google-app-engine | The standard solution to this problem is denormalization. Try storing a copy of price and profit in Entity1 and then you can answer your question with a single, simple query on Entity1. | 0 | 1 | 0 | 0 | 2011-03-24T05:58:00.000 | 2 | 0 | false | 5,415,342 | 0 | 0 | 1 | 1 | Scenario
Entity1 (id,itmname)
Entity2 (id,itmname,price)
Entity3 (id,itmname,profit)
profit and price are both IntegerProperty
I want to count all the item with price more then 500 and profit more then 10.
I know its join operation and is not supported by google. I tried my best to find out the way other then executi... |
how to open url in new tab from django? | 29,631,137 | 7 | 13 | 28,137 | 0 | python,django | Most the time, loading the page in a new tab can be a real pain in the ar** for the user. Nevertheless it can still be necessary sometimes. If you really need to render your POST results in a new tab, use the target="_blank" as an attribute of your <form>. | 0 | 0 | 0 | 0 | 2011-03-24T06:37:00.000 | 3 | 1 | false | 5,415,600 | 0 | 0 | 1 | 1 | i have to open the result page using render_to_response on a new tab |
Feedback on different backends for GWT | 5,421,810 | 1 | 4 | 1,559 | 1 | java,python,gwt,architecture,web-frameworks | We had the same dilemma in the past.
I was involved in designing and building a system that had a GWT frontend and Java (Spring, Hibernate) backend. Some of our other (related) systems were built in Python and Ruby, so the expertise was there, and a question just like yours came up.
We decided on Java mainly so we cou... | 0 | 1 | 0 | 0 | 2011-03-24T09:56:00.000 | 1 | 1.2 | true | 5,417,372 | 0 | 0 | 1 | 1 | I have to re-design an existing application which uses Pylons (Python) on the backend and GWT on the frontend.
In the course of this re-design I can also change the backend system.
I tried to read up on the advantages and disadvantages of various backend systems (Java, Python, etc) but I would be thankful for some feed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.