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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Django without shell access | 886,561 | 1 | 0 | 702 | 0 | python,django,shell | It is possible.
Usually you will develop your application locally (where shell access is nice to have) and publish your work to your server. All you need for this is FTP access and some way to import a database dump from your development database (often hosters provide an installation of phpMyAdmin for this).
python (... | 0 | 1 | 0 | 0 | 2009-05-20T07:07:00.000 | 2 | 0.099668 | false | 886,526 | 0 | 0 | 1 | 1 | Is it possible to run django without shell access? My hoster supports the following for 5€/month:
python (I assume via mod_python)
mysql
There is no shell nor cronjob support, which costs additional 10€/month, so I'm trying to avoid it.
I know that Google Apps also work without shell access, but I assume that is pos... |
Satchmo donations | 901,050 | 3 | 2 | 253 | 0 | python,django,e-commerce,satchmo | It looks like the satchmo_cart_details_query signal is the way to go about doing this. It allows you to add a price change value (in my case, donation amount) to a cart item
I'll post the full solution if anyone is interested | 0 | 0 | 0 | 1 | 2009-05-21T08:46:00.000 | 1 | 1.2 | true | 891,934 | 0 | 0 | 1 | 1 | Can anyone share some pointers on building a Donations module for Satchmo? I'm comfortable customizing Satchmo's product models etc but unable to find anything related to Donations
I realize it's possible to create a Donations virtual product but as far as I can tell this still requires setting the amount beforehand ($... |
Send emails from Google App Engine | 892,427 | 2 | 0 | 1,502 | 0 | python,django,google-app-engine,mail-server | The example code for the remote APi gives you an interactive console from which you can access any of the modules in your application. I see no requirement that they be only datastore operations. | 0 | 1 | 0 | 0 | 2009-05-21T10:31:00.000 | 2 | 0.197375 | false | 892,266 | 0 | 0 | 1 | 1 | I have a web server with Django, hosted with Apache server. I would like to configure Google App Engine for the email server. My web server should be able to use Google App Engine, when it makes any email send using EmailMessage or sendmail infrastructure of Google Mail API.
I learnt that by using Remote API, I can ac... |
Using python to develop web application | 895,439 | 0 | 17 | 23,044 | 0 | python | Lookup Django. | 0 | 0 | 0 | 0 | 2009-05-21T21:58:00.000 | 9 | 0 | false | 895,420 | 0 | 0 | 1 | 1 | I have been doing some work in python, but that was all for stand alone applications. I'm curious to know whether any offshoot of python supports web development?
Would some one also suggest a good tutorial or a website from where I can pick up some of the basics of web development using python? |
Django App Dependency Cycle | 895,984 | 2 | 26 | 7,969 | 0 | python,django,dependencies | Normally I advocate for splitting functionality into smaller apps, but a circular dependence between models reflects such a tight integration that you're probably not gaining much from the split and might just consider merging the apps. If that results in an app that feels too large, there may be a way to make the spl... | 0 | 0 | 0 | 0 | 2009-05-21T22:05:00.000 | 4 | 0.099668 | false | 895,454 | 0 | 0 | 1 | 2 | I am in the middle of developing a Django application, which has quite complicated models (it models a university - courses, modules, lectures, students etc.)
I have separated the project into apps, to make the whole thing more organised (apps are courses, schools, people, modules and timeperiods). I am having a proble... |
Django App Dependency Cycle | 896,090 | 3 | 26 | 7,969 | 0 | python,django,dependencies | If you're seeing circular model dependency I'm guessing that one of three things is happening:
You've defined an inverse relationship to one that's already defined (for instance both course has many lectures and lecture has one course) which is redundant in django
You have a model method in the wrong app
You're provid... | 0 | 0 | 0 | 0 | 2009-05-21T22:05:00.000 | 4 | 0.148885 | false | 895,454 | 0 | 0 | 1 | 2 | I am in the middle of developing a Django application, which has quite complicated models (it models a university - courses, modules, lectures, students etc.)
I have separated the project into apps, to make the whole thing more organised (apps are courses, schools, people, modules and timeperiods). I am having a proble... |
How to change default django User model to fit my needs? | 3,902,915 | 0 | 14 | 12,241 | 0 | python,django,django-models | There are anumber of ways to do this, but here's what I'd do: I'd allow a user to enter an email, username (which must contain at least one letter and no @ symbols) or mobile number. Then, when I validate it:
Check for the presence of @. If so, set it as the user's email, hash it appropriately and set it as their user... | 0 | 0 | 0 | 0 | 2009-05-22T05:01:00.000 | 5 | 0 | false | 896,421 | 0 | 0 | 1 | 3 | The default Django's User model has some fields, and validation rules, that I don't really need. I want to make registration as simple as possible, i.e. require either email or username, or phone number - all those being unique, hence good as user identifiers.
I also don't like default character set for user name that... |
How to change default django User model to fit my needs? | 898,052 | 0 | 14 | 12,241 | 0 | python,django,django-models | You face a bit of a dilemma which really has two solutions if you're committed to avoiding the profile-based customization already pointed out.
Change the User model itself, per Daniel's suggestions
Write a CustomUser class, subclassing User or copying its functionality.
The latter suggestion means that you would hav... | 0 | 0 | 0 | 0 | 2009-05-22T05:01:00.000 | 5 | 0 | false | 896,421 | 0 | 0 | 1 | 3 | The default Django's User model has some fields, and validation rules, that I don't really need. I want to make registration as simple as possible, i.e. require either email or username, or phone number - all those being unique, hence good as user identifiers.
I also don't like default character set for user name that... |
How to change default django User model to fit my needs? | 898,313 | 10 | 14 | 12,241 | 0 | python,django,django-models | Rather than modify the User class directly or do subclassing, you can also just repurpose the existing fields.
For one site I used the "first_name" field as the "publicly displayed name" of a user and stuff a slugified version of that into the "username" field (for use in URLs). I wrote a custom auth backend to allo... | 0 | 0 | 0 | 0 | 2009-05-22T05:01:00.000 | 5 | 1.2 | true | 896,421 | 0 | 0 | 1 | 3 | The default Django's User model has some fields, and validation rules, that I don't really need. I want to make registration as simple as possible, i.e. require either email or username, or phone number - all those being unique, hence good as user identifiers.
I also don't like default character set for user name that... |
Django shopping cart/basket solution (or should I DIM)? | 899,393 | 3 | 1 | 3,617 | 0 | python,django,e-commerce,shopping-cart | Since you asked: if your needs are that limited, it does sound like a DIY situation to me. I don't see what's so fiddly about it; what complexity there is is all in the pricing formula, and you're planning to supply that either way. Add in Django's built-in session support and you're most of the way there. | 0 | 0 | 0 | 0 | 2009-05-22T15:19:00.000 | 2 | 1.2 | true | 898,426 | 0 | 0 | 1 | 1 | I'm about to build a site that has about half a dozen fairly similar products. They're all DVDs so they fit into a very "fixed" database very well. I was going to make a DVD model. Tag them up. All very simple. All very easy.
But we need to be able to sell them. The current site outsources the whole purchasing system b... |
How to embed a Poll in a Web Page | 903,112 | 1 | 1 | 552 | 0 | javascript,python,cross-domain | Make your app into a Google Gadget, Open Social gadget, or other kind of gadgets -- these are all designed to be embeddable into third-party pages with as little fuss as possible. | 0 | 0 | 1 | 0 | 2009-05-24T04:53:00.000 | 2 | 0.099668 | false | 903,104 | 0 | 0 | 1 | 1 | I want to create a simple online poll application. I have created a backend in python that handles vote tracking, poll display, results display and admin setup. However, if I wanted a third party to be able to embed the poll in their website, what would be the recommended way of doing so? I would love to be able to ... |
Is there any library to find out urls of embedded flvs in a webpage? | 905,451 | 0 | 1 | 382 | 0 | python,download,flv | if the embed player makes use of some variable where the flv path is set then you can download it, if not.. I doubt you find something to do it "automaticly" since every site make it's own player and identify the file by id not by path, which makes hard to know where the flv file is. | 0 | 0 | 1 | 0 | 2009-05-25T05:07:00.000 | 2 | 0 | false | 905,403 | 0 | 0 | 1 | 1 | I'm trying to write a script which can automatically download gameplay videos. The webpages look like dota.sgamer.com/Video/Detail/402 and www.wfbrood.com/movie/spl2009/movie_38214.html, they have flv player embedded in the flash plugin.
Is there any library to help me find out the exact flv urls? or any other ideas to... |
Syntax Highlight for Mako in Eclipse or TextMate? | 923,030 | 2 | 12 | 5,178 | 0 | python,templates,mako | What I ended up doing was naming my Mako Templates with .html suffix and thus getting the usual HTML syntax highlighting etc. that I am used to. Alternatively I could have associated .mako suffix with the HTML handler. While this does not address Mako specifically, it was enough for me, since I find most of the templat... | 0 | 0 | 0 | 1 | 2009-05-28T19:34:00.000 | 7 | 0.057081 | false | 922,771 | 0 | 0 | 1 | 3 | Does anyone know of a syntax highlight for Mako templates for Eclipse or for TextMate?
I know that there is a .mako syntax highlighter for the default text editor in Ubuntu. |
Syntax Highlight for Mako in Eclipse or TextMate? | 30,838,894 | 0 | 12 | 5,178 | 0 | python,templates,mako | Windows (menu) > Preference > General > Editor > File Associations
Add *.mako in File Types (upper box) and add Html editor in Associated editor (lower box)
Windows (menu) > Preference > General > Editor > Content Types
Under Text find HTML and add *.mako in File associations. | 0 | 0 | 0 | 1 | 2009-05-28T19:34:00.000 | 7 | 0 | false | 922,771 | 0 | 0 | 1 | 3 | Does anyone know of a syntax highlight for Mako templates for Eclipse or for TextMate?
I know that there is a .mako syntax highlighter for the default text editor in Ubuntu. |
Syntax Highlight for Mako in Eclipse or TextMate? | 8,544,623 | 1 | 12 | 5,178 | 0 | python,templates,mako | You can go to:
Preferences->General->Editors->File Associations.
Click to add a new file type and type *.mak and click OK.
In File types click on *.mak and under Associated editors add HTML editor(default), Text Editor, Text Editor(studio) and Web Browser.
This colors the text, works OK for me :)
P.S. Be sure to have... | 0 | 0 | 0 | 1 | 2009-05-28T19:34:00.000 | 7 | 0.028564 | false | 922,771 | 0 | 0 | 1 | 3 | Does anyone know of a syntax highlight for Mako templates for Eclipse or for TextMate?
I know that there is a .mako syntax highlighter for the default text editor in Ubuntu. |
Stackless installation and configuration with DJango | 925,645 | 0 | 1 | 1,142 | 0 | django,stackless,python-stackless | I think the solution would be to point eclipse at your 2.5 stackless installation unless you have a very good reason to use 2.6 over 2.5?
...or recompile for 2.6 and add it to your 2.6 installation. | 0 | 0 | 0 | 0 | 2009-05-29T11:42:00.000 | 2 | 0 | false | 925,616 | 0 | 0 | 1 | 2 | I am trying to run a DJango Command Extension which uses stackless.
I have installed Stackless Python (compiled with python 2.5) so whenever I type python2.5 at the console it fires up indicating that the version is
Python 2.5.2 Stackless 3.1b3 060516 (python-2.52:72942, May 26 2009, 23:07:34)
[GCC 4.3.3] on linux2
B... |
Stackless installation and configuration with DJango | 4,507,213 | 0 | 1 | 1,142 | 0 | django,stackless,python-stackless | Choose Window->preferencess in eclipse menu
pydev->interpeter-Python
choose tab forsed biltins
press new, type "stackless" | 0 | 0 | 0 | 0 | 2009-05-29T11:42:00.000 | 2 | 0 | false | 925,616 | 0 | 0 | 1 | 2 | I am trying to run a DJango Command Extension which uses stackless.
I have installed Stackless Python (compiled with python 2.5) so whenever I type python2.5 at the console it fires up indicating that the version is
Python 2.5.2 Stackless 3.1b3 060516 (python-2.52:72942, May 26 2009, 23:07:34)
[GCC 4.3.3] on linux2
B... |
Configure Apache to recover from mod_python errors | 928,519 | 1 | 0 | 281 | 0 | python,django,apache,mod-python | As a workaround, and assuming you are free to install new Apache modules on the server, you might try one of
mod_scgi
mod_fastcgi
mod_wsgi
instead. I use SCGI to connect an nginx frontend webserver to my Django apps, which highlights a major benefit (decoupling from the webserver). All of these packages are availabl... | 0 | 0 | 0 | 0 | 2009-05-29T15:23:00.000 | 1 | 0.197375 | false | 926,579 | 0 | 0 | 1 | 1 | I am hosting a Django app on Apache using mod_python. Occasionally, I get some cryptic mod_python errors, usually of the ImportError variety, although not usually referring to the same module. The thing is, these seem to come up for a single forked subprocess, while the others operate fine, even when I force behavior... |
How do I access the child classes of an object in django without knowing the name of the child class? | 929,073 | 0 | 84 | 34,203 | 0 | python,django,many-to-many | You can achieve this looking for all the fields in the parent that are an instance of django.db.models.fields.related.RelatedManager. From your example it seems that the child classes you are talking about are not subclasses. Right? | 0 | 0 | 0 | 0 | 2009-05-30T04:52:00.000 | 8 | 0 | false | 929,029 | 0 | 0 | 1 | 2 | In Django, when you have a parent class and multiple child classes that inherit from it you would normally access a child through parentclass.childclass1_set or parentclass.childclass2_set, but what if I don't know the name of the specific child class I want?
Is there a way to get the related objects in the parent->chi... |
How do I access the child classes of an object in django without knowing the name of the child class? | 929,128 | 24 | 84 | 34,203 | 0 | python,django,many-to-many | In Python, given a ("new-style") class X, you can get its (direct) subclasses with X.__subclasses__(), which returns a list of class objects. (If you want "further descendants", you'll also have to call __subclasses__ on each of the direct subclasses, etc etc -- if you need help on how to do that effectively in Python,... | 0 | 0 | 0 | 0 | 2009-05-30T04:52:00.000 | 8 | 1 | false | 929,029 | 0 | 0 | 1 | 2 | In Django, when you have a parent class and multiple child classes that inherit from it you would normally access a child through parentclass.childclass1_set or parentclass.childclass2_set, but what if I don't know the name of the specific child class I want?
Is there a way to get the related objects in the parent->chi... |
Ironpython console disappears instantly | 951,508 | 1 | 0 | 218 | 0 | .net,.net-2.0,ironpython | i have found the way....
.NET 2.0 and .Net 3.0 do not have SP1.
So either version of .Net with SP1 will make Ironpython work...yippee | 0 | 0 | 0 | 0 | 2009-05-30T06:13:00.000 | 3 | 1.2 | true | 929,141 | 1 | 0 | 1 | 3 | I installed ironpython 2.0 in the windows xp professional box and it requires .Net framework 2.0 service pack 2 or later. The windows box has it. But still the console disappears. There is issue in either of them.
Need help? |
Ironpython console disappears instantly | 930,888 | 1 | 0 | 218 | 0 | .net,.net-2.0,ironpython | The same result
Iropython requires .NET 2.0 sp1 or later
There is no error infact...
I suppose Ironpython is not finding the .Net libraries where it is supposed to be.
If the control panel\Add remove programs shows the .Net framework, does this mean they are installed. I am asking this question coz in forums no body h... | 0 | 0 | 0 | 0 | 2009-05-30T06:13:00.000 | 3 | 0.066568 | false | 929,141 | 1 | 0 | 1 | 3 | I installed ironpython 2.0 in the windows xp professional box and it requires .Net framework 2.0 service pack 2 or later. The windows box has it. But still the console disappears. There is issue in either of them.
Need help? |
Ironpython console disappears instantly | 929,197 | 0 | 0 | 218 | 0 | .net,.net-2.0,ironpython | What happens if you open a command prompt and run ipy from there?
Run (From the command prompt) ipy -X:ExceptionDetail
This will hopefully give more info.
Also have a look in the Windows Event Log (Application) for any errors related to IPY.
Update If you have no error recorded, try running another .Net program to see... | 0 | 0 | 0 | 0 | 2009-05-30T06:13:00.000 | 3 | 0 | false | 929,141 | 1 | 0 | 1 | 3 | I installed ironpython 2.0 in the windows xp professional box and it requires .Net framework 2.0 service pack 2 or later. The windows box has it. But still the console disappears. There is issue in either of them.
Need help? |
Equivalent for Python's lambda functions in Java? | 41,144,957 | 1 | 23 | 12,221 | 0 | java,python,function,lambda | With the release of Java 8, lambda-expression is now available.
And the lambda function in java is actually "more powerful" than the python ones.
In Python, lambda-expression may only have a single expression for its body, and no return statement is permitted. In Java, you can do something like this: (int a, int b) ->... | 0 | 0 | 0 | 1 | 2009-05-30T15:49:00.000 | 7 | 0.028564 | false | 929,988 | 0 | 0 | 1 | 1 | Can someone please tell me if there is an equivalent for Python's lambda functions in Java? |
Is there a Python equivalent to the PHP function htmlspecialchars()? | 931,442 | -1 | 20 | 12,591 | 0 | php,python,html-entities,htmlspecialchars | If you are using django 1.0 then your template variables will already be encoded and ready for display. You also use the safe operator {{ var|safe }} if you don't want it globally turned on. | 0 | 0 | 0 | 1 | 2009-05-31T05:58:00.000 | 8 | -0.024995 | false | 931,423 | 1 | 0 | 1 | 1 | Is there a similar or equivalent function in Python to the PHP function htmlspecialchars()? The closest thing I've found so far is htmlentitydefs.entitydefs(). |
Different styles for Windows forms in Ironpython | 931,629 | 0 | 0 | 706 | 0 | winforms,ironpython | As an interface designer, it's important to use an many standard windows controls as possible. The more your app looks like the microsoft ones users are used to, they will become more comfortable with it quicker.
A good example is how out of place iTunes and Safari look in windows. My tip is to just keep it with the w... | 1 | 0 | 0 | 0 | 2009-05-31T07:44:00.000 | 2 | 0 | false | 931,580 | 0 | 0 | 1 | 1 | I want to change the look of my Ironpython windows forms, Is it possible to change the style of the form and for example make it more like a Mac?
thank you |
Packaging script source files in IronPython and IronRuby | 933,988 | 0 | 3 | 520 | 0 | c#,python,ruby,ironpython,ironruby | IronPython 2.0 has a sample compiler called PYC on Codeplex.com/ironpython which can create DLL's (and applications if you need them too).
IronPython 2.6 has a newer version of PYC under Tools\script.
Cheers,
Davy | 0 | 0 | 0 | 1 | 2009-06-01T07:14:00.000 | 3 | 0 | false | 933,822 | 0 | 0 | 1 | 2 | Does anyone know how to add python and ruby libs as a resource in a dll for deployment? I want to host a script engine in my app, but dont want to have to deploy the entire standard libraries of the respective languages in source files. Is there a simple way to do this so that a require or import statement will find ... |
Packaging script source files in IronPython and IronRuby | 934,609 | 1 | 3 | 520 | 0 | c#,python,ruby,ironpython,ironruby | You could add custom import hook that looks for embedded resources when an import is executed. This is slightly complex and probably not worth the trouble.
A better technique would be to fetch all of the embedded modules at startup time, execute them with the ScriptEngine and put the modules you have created into the s... | 0 | 0 | 0 | 1 | 2009-06-01T07:14:00.000 | 3 | 0.066568 | false | 933,822 | 0 | 0 | 1 | 2 | Does anyone know how to add python and ruby libs as a resource in a dll for deployment? I want to host a script engine in my app, but dont want to have to deploy the entire standard libraries of the respective languages in source files. Is there a simple way to do this so that a require or import statement will find ... |
How does Spring for Python compare with Spring for Java | 10,500,205 | 0 | 18 | 16,197 | 0 | java,python,spring | Good stuff. I have used Spring Java, Spring Dot Net and now starting with Spring Python. Python has always been pretty easy to use for programmers; I think, especially since it's easy to write. I found Spring Dot Net to be a bit confusing, but both Spring Java and Python seem to be similar. I'm sure they have their... | 0 | 0 | 0 | 0 | 2009-06-02T16:39:00.000 | 3 | 0 | false | 940,564 | 0 | 0 | 1 | 1 | I am an avid fan of the Spring framework for Java (by Rod Johnson).
I am learning Python and was excited to find about Spring for Python.
I would be interested in hearing the community's views on the comparison of
these two flavours of Spring. How well does it fit Python's paradigms etc. |
How to construct a web file browser? | 943,612 | 0 | 2 | 552 | 0 | javascript,python,html,web-applications | set "Indexes" option to the directory in the apache config.
To learn how to build webapps in python, learn django. | 0 | 0 | 1 | 0 | 2009-06-02T20:11:00.000 | 4 | 0 | false | 941,638 | 0 | 0 | 1 | 2 | Goal: simple browser app, for navigating files on a web server, in a tree view.
Background: Building a web site as a learning experience, w/ Apache, mod_python, Python code. (No mod_wsgi yet.)
What tools should I learn to write the browser tree? I see JavaScript, Ajax, neither of which I know. Learn them? Grab a ... |
How to construct a web file browser? | 941,664 | 1 | 2 | 552 | 0 | javascript,python,html,web-applications | If you want to make interactive browser, you have to learn JS and ajax.
If you want to build only browser based on links, python would be enough. | 0 | 0 | 1 | 0 | 2009-06-02T20:11:00.000 | 4 | 0.049958 | false | 941,638 | 0 | 0 | 1 | 2 | Goal: simple browser app, for navigating files on a web server, in a tree view.
Background: Building a web site as a learning experience, w/ Apache, mod_python, Python code. (No mod_wsgi yet.)
What tools should I learn to write the browser tree? I see JavaScript, Ajax, neither of which I know. Learn them? Grab a ... |
Publish feeds using Django | 1,095,528 | 0 | 0 | 619 | 0 | python,django,rss | I've been banging my head against this one for a while. It seems that the django rss system need a "datetime" object instead of just the date (since it wants a time zone, and the date object doesn't have a time, let alone a time zone...)
I might be wrong though, but it's something that I've found via the error logs. | 0 | 0 | 0 | 0 | 2009-06-03T14:12:00.000 | 3 | 1.2 | true | 945,001 | 0 | 0 | 1 | 1 | I'm publishing a feed from a Django application.
I subclassed django.contrib.syndication.feeds.Feed, everything works fine, except the date that doesn't get published on the feed.
Here's the method I've created on my Feed class
def item_pubdate(self, item):
return item.date
this method never gets called.... |
How to I reload global vars on every page refresh in DJango | 947,486 | 6 | 0 | 371 | 0 | python,django | Simple: Don't use global objects.
If you want an object inside the view, instantiate it inside the view, not as global. That way it will be collected after the view ends. | 0 | 0 | 0 | 0 | 2009-06-03T21:43:00.000 | 1 | 1 | false | 947,436 | 0 | 0 | 1 | 1 | Here is my problem. DJango continues to store all the global objects after the first run of a script. For instance, an object you instantiate in views.py globally will be there until you restart the app server. This is fine unless your object is tied to some outside resource that may time out. Now the way I was thi... |
method for creating a unique validation key/number | 948,500 | 0 | 2 | 1,123 | 0 | python,django,validation | Well, you can always use a GUID. As you said it would be stored as a valid key. | 0 | 0 | 0 | 0 | 2009-06-04T03:42:00.000 | 3 | 0 | false | 948,493 | 0 | 0 | 1 | 1 | I'm using django for a web-magazine with subscriber-content. when a user purchases a subscription, the site will create a validation key, and send it to the user email address.
The validation key would be added to a list of "valid keys" until it is used.
What is the best method for creating a simple yet unique key? C... |
Use Django Framework with Website and Stand-alone App | 950,874 | 4 | 1 | 1,344 | 0 | python,django | Yes, you can use the same database.
Some people use Django on top of a PHP application for its admin functionality, or to build newer features with Django and its ORM.
What I'm trying to say is that if you're putting data from your crawl into the same place that you will let Django store its data, you can access them a... | 0 | 0 | 0 | 0 | 2009-06-04T14:03:00.000 | 2 | 0.379949 | false | 950,790 | 0 | 0 | 1 | 1 | I'm planning on writing a web crawler and a web-based front end for it (or, at least, the information it finds). I was wondering if it's possible to use the Django framework to let the web crawler use the same MySQL backend as the website (without making the web crawler a "website" in it's self). |
mounting an s3 bucket in ec2 and using transparently as a mnt point | 6,308,720 | 0 | 4 | 8,589 | 1 | python,django,amazon-s3,amazon-ec2 | I'd suggest using a separately-mounted EBS volume. I tried doing the same thing for some movie files. Access to S3 was slow, and S3 has some limitations like not being able to rename files, no real directory structure, etc.
You can set up EBS volumes in a RAID5 configuration and add space as you need it. | 0 | 1 | 0 | 0 | 2009-06-05T16:39:00.000 | 5 | 0 | false | 956,904 | 0 | 0 | 1 | 1 | I have a webapp (call it myapp.com) that allows users to upload files. The webapp will be deployed on Amazon EC2 instance. I would like to serve these files back out to the webapp consumers via an s3 bucket based domain (i.e. uploads.myapp.com).
When the user uploads the files, I can easily drop them in into a fold... |
How can I create a variable that is scoped to a single request in app engine? | 972,243 | 2 | 0 | 211 | 0 | python,google-app-engine | If you're using the 'webapp' framework included with App Engine (or, actually, most other WSGI-baesd frameworks), a new RequestHandler is instantiated for each request. Thus, you can use class variables on your handler class to store per-request data. | 0 | 1 | 0 | 0 | 2009-06-08T00:08:00.000 | 4 | 0.099668 | false | 963,080 | 0 | 0 | 1 | 3 | I'm creating a python app for google app engine and I've got a performance problem with some expensive operations that are repetitive within a single request. To help deal with this I'd like to create a sort of mini-cache that's scoped to a single request. This is as opposed to a session-wide or application-wide cach... |
How can I create a variable that is scoped to a single request in app engine? | 963,706 | 0 | 0 | 211 | 0 | python,google-app-engine | use local list to store data and do a model.put at end of your request processing. save multiple db trips | 0 | 1 | 0 | 0 | 2009-06-08T00:08:00.000 | 4 | 0 | false | 963,080 | 0 | 0 | 1 | 3 | I'm creating a python app for google app engine and I've got a performance problem with some expensive operations that are repetitive within a single request. To help deal with this I'd like to create a sort of mini-cache that's scoped to a single request. This is as opposed to a session-wide or application-wide cach... |
How can I create a variable that is scoped to a single request in app engine? | 963,107 | 1 | 0 | 211 | 0 | python,google-app-engine | Module variables may (or may not) persist between requests (the same app instance may or may not stay alive between requests), but you can explicitly clear them (del, or set to None, say) at the start of your handling a request, or when you know you're done with one. At worst (if your code is peculiarly organized) you ... | 0 | 1 | 0 | 0 | 2009-06-08T00:08:00.000 | 4 | 0.049958 | false | 963,080 | 0 | 0 | 1 | 3 | I'm creating a python app for google app engine and I've got a performance problem with some expensive operations that are repetitive within a single request. To help deal with this I'd like to create a sort of mini-cache that's scoped to a single request. This is as opposed to a session-wide or application-wide cach... |
Can't seem to get list() working | 965,860 | 0 | 0 | 275 | 0 | python,django,google-app-engine,list | There is no specific change "inherent" in appengine with respect to common aspects like lists. It is as just the same, plain python. | 0 | 0 | 0 | 0 | 2009-06-08T08:47:00.000 | 3 | 0 | false | 963,932 | 1 | 0 | 1 | 1 | I am trying to convert a set object to list...for example "p=list('abc')" is not working.
any ideas or is it inherent in appengine |
What's the official way of storing settings for Python programs? | 966,074 | 12 | 65 | 43,088 | 0 | python,settings | Just one more option, PyQt. Qt has a platform independent way of storing settings with the QSettings class. Underneath the hood, on windows it uses the registry and in linux it stores the settings in a hidden conf file. QSettings works very well and is pretty seemless. | 0 | 0 | 0 | 0 | 2009-06-08T16:13:00.000 | 13 | 1 | false | 965,694 | 1 | 0 | 1 | 6 | Django uses real Python files for settings, Trac uses a .ini file, and some other pieces of software uses XML files to hold this information.
Are one of these approaches blessed by Guido and/or the Python community more than another? |
What's the official way of storing settings for Python programs? | 965,795 | 35 | 65 | 43,088 | 0 | python,settings | Depends on the predominant intended audience.
If it is programmers who change the file anyway, just use python files like settings.py
If it is end users then, think about ini files. | 0 | 0 | 0 | 0 | 2009-06-08T16:13:00.000 | 13 | 1.2 | true | 965,694 | 1 | 0 | 1 | 6 | Django uses real Python files for settings, Trac uses a .ini file, and some other pieces of software uses XML files to hold this information.
Are one of these approaches blessed by Guido and/or the Python community more than another? |
What's the official way of storing settings for Python programs? | 965,733 | -1 | 65 | 43,088 | 0 | python,settings | why would Guido blessed something that is out of his scope? No there is nothing particular blessed. | 0 | 0 | 0 | 0 | 2009-06-08T16:13:00.000 | 13 | -0.015383 | false | 965,694 | 1 | 0 | 1 | 6 | Django uses real Python files for settings, Trac uses a .ini file, and some other pieces of software uses XML files to hold this information.
Are one of these approaches blessed by Guido and/or the Python community more than another? |
What's the official way of storing settings for Python programs? | 965,742 | 0 | 65 | 43,088 | 0 | python,settings | It is more of convenience. There is no official way per say. But using XML files would make sense as they can be manipulated by various other applications/libraries. | 0 | 0 | 0 | 0 | 2009-06-08T16:13:00.000 | 13 | 0 | false | 965,694 | 1 | 0 | 1 | 6 | Django uses real Python files for settings, Trac uses a .ini file, and some other pieces of software uses XML files to hold this information.
Are one of these approaches blessed by Guido and/or the Python community more than another? |
What's the official way of storing settings for Python programs? | 965,913 | 4 | 65 | 43,088 | 0 | python,settings | It depends largely on how complicated your configuration is. If you're doing a simple key-value mapping and you want the capability to edit the settings with a text editor, I think ConfigParser is the way to go.
If your settings are complicated and include lists and nested data structures, I'd use XML or JSON and crea... | 0 | 0 | 0 | 0 | 2009-06-08T16:13:00.000 | 13 | 0.061461 | false | 965,694 | 1 | 0 | 1 | 6 | Django uses real Python files for settings, Trac uses a .ini file, and some other pieces of software uses XML files to hold this information.
Are one of these approaches blessed by Guido and/or the Python community more than another? |
What's the official way of storing settings for Python programs? | 965,730 | 6 | 65 | 43,088 | 0 | python,settings | I am not sure that there is an 'official' way (it is not mentioned in the Zen of Python :) )- I tend to use the Config Parser module myself and I think that you will find that pretty common. I prefer that over the python file approach because you can write back to it and dynamically reload if you want. | 0 | 0 | 0 | 0 | 2009-06-08T16:13:00.000 | 13 | 1 | false | 965,694 | 1 | 0 | 1 | 6 | Django uses real Python files for settings, Trac uses a .ini file, and some other pieces of software uses XML files to hold this information.
Are one of these approaches blessed by Guido and/or the Python community more than another? |
Eclipse + local CVS + PyDev | 969,236 | 1 | 4 | 2,673 | 0 | python,eclipse,cvs,pydev | I tried Eclipse+Subclipse and Eclipse+Bazaar plugin. Both work very well, but I have found that Tortoise versions of those version source control tools are so good that I resigned from Eclipse plugins. On Windows Tortoise XXX are my choice. They integrate with shell (Explorer or TotalCommander), changes icon overlay if... | 0 | 1 | 0 | 0 | 2009-06-09T09:43:00.000 | 8 | 0.024995 | false | 969,121 | 1 | 0 | 1 | 4 | I tried several Python IDEs (on Windows platform) but finally I found only Eclipse + PyDev meeting my needs. This set of tools is really comfortable and easy to use. I'm currently working on a quite bigger project. I'd like to have a possibility to use CVS or any other version control system which would be installed on... |
Eclipse + local CVS + PyDev | 969,642 | 4 | 4 | 2,673 | 0 | python,eclipse,cvs,pydev | Last time I tried this, Eclipse did not support direct access to local repositories in the same way that command line cvs does because command line cvs has both client and server functionality whereas Eclipse only has client functionality and needs to go through (e.g.) pserver, so you would probably need to have a cvs ... | 0 | 1 | 0 | 0 | 2009-06-09T09:43:00.000 | 8 | 1.2 | true | 969,121 | 1 | 0 | 1 | 4 | I tried several Python IDEs (on Windows platform) but finally I found only Eclipse + PyDev meeting my needs. This set of tools is really comfortable and easy to use. I'm currently working on a quite bigger project. I'd like to have a possibility to use CVS or any other version control system which would be installed on... |
Eclipse + local CVS + PyDev | 976,961 | 0 | 4 | 2,673 | 0 | python,eclipse,cvs,pydev | I recently moved my house and don't have yet an access to internet.
CVS and SVN are the Centralized Version control systems. Rather than having to install them on your local system just for single version control, you could use DVCS like Mercurial or Git.
When you clone a Mercurial Repository, you have literally all v... | 0 | 1 | 0 | 0 | 2009-06-09T09:43:00.000 | 8 | 0 | false | 969,121 | 1 | 0 | 1 | 4 | I tried several Python IDEs (on Windows platform) but finally I found only Eclipse + PyDev meeting my needs. This set of tools is really comfortable and easy to use. I'm currently working on a quite bigger project. I'd like to have a possibility to use CVS or any other version control system which would be installed on... |
Eclipse + local CVS + PyDev | 969,134 | 1 | 4 | 2,673 | 0 | python,eclipse,cvs,pydev | If you don't mind a switch to Subversion, Eclipse has its SubClipse plugin. | 0 | 1 | 0 | 0 | 2009-06-09T09:43:00.000 | 8 | 0.024995 | false | 969,121 | 1 | 0 | 1 | 4 | I tried several Python IDEs (on Windows platform) but finally I found only Eclipse + PyDev meeting my needs. This set of tools is really comfortable and easy to use. I'm currently working on a quite bigger project. I'd like to have a possibility to use CVS or any other version control system which would be installed on... |
users module errors in Google App Engine | 14,879,943 | 1 | 1 | 444 | 0 | python,google-app-engine | Actually not my answer, but from the OP, that didn't act on S. Lott's comment:
It works now! but I didnt change anything actually, seems like Google need time to update its database for app engine. like 20 mins. | 0 | 1 | 0 | 0 | 2009-06-09T12:48:00.000 | 1 | 0.197375 | false | 969,877 | 0 | 0 | 1 | 1 | I want to use user service of my domain in google App, but...
Is it possible to solve this problem by my side?
Traceback (most recent call last):
File "/base/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 501, in __call__
handler.get(*groups)
File "/base/data/home/apps/myapp2009/1.3340817... |
Threads in Java and Python | 971,025 | 0 | 6 | 2,528 | 0 | java,python,multithreading | Just a sidestep about point 1 here, because Java Thread priorities might not work as one would expect.
From the SCJP guide:
Because thread-scheduling priority behaviour is not guaranteed, use thread priorities as a way to improve the efficiency of your program, but just be sure your program doesn't depend on that beha... | 0 | 0 | 0 | 0 | 2009-06-09T15:49:00.000 | 6 | 0 | false | 970,909 | 1 | 0 | 1 | 1 | i have few questions about threads in Python and Java...
Is it possible to give priorities to Python threads, as it is in Java?
How can I kill, stop, suspend and interrupt thread in Python?
Thread groups - what are they really for? Does Python support them too?
Synchronization - in Java we use simply keyword synchorin... |
Django - Website Home Page | 972,004 | 11 | 20 | 11,919 | 0 | python,django | There's no real rule for this, But one thing I like to do is actually arrange for the index access to redirect to another spot. If you prefer, though, you can just give the index page a plain view.
That said, It's probably a good idea to keep all your code in an actual app, so that you can refactor it more easily, a... | 0 | 0 | 0 | 0 | 2009-06-09T19:18:00.000 | 3 | 1.2 | true | 971,983 | 0 | 0 | 1 | 1 | I've been having a look at Django and, from what I've seen, it's pretty darn fantastic. I'm a little confused, however, how I go about implementing a "home page" for my website? Would it be a separate app, or just a view within the project, or what? |
wget Vs urlretrieve of python | 975,759 | 0 | 9 | 37,225 | 0 | python,urllib2,wget | There shouldn't be a difference really. All urlretrieve does is make a simple HTTP GET request. Have you taken out your data processing code and done a straight throughput comparison of wget vs. pure python? | 0 | 0 | 1 | 0 | 2009-06-10T10:18:00.000 | 10 | 0 | false | 974,741 | 0 | 0 | 1 | 5 | I have a task to download Gbs of data from a website. The data is in form of .gz files, each file being 45mb in size.
The easy way to get the files is use "wget -r -np -A files url". This will donwload data in a recursive format and mirrors the website. The donwload rate is very high 4mb/sec.
But, just to play around I... |
wget Vs urlretrieve of python | 976,135 | 0 | 9 | 37,225 | 0 | python,urllib2,wget | Please show us some code. I'm pretty sure that it has to be with the code and not on urlretrieve.
I've worked with it in the past and never had any speed related issues. | 0 | 0 | 1 | 0 | 2009-06-10T10:18:00.000 | 10 | 0 | false | 974,741 | 0 | 0 | 1 | 5 | I have a task to download Gbs of data from a website. The data is in form of .gz files, each file being 45mb in size.
The easy way to get the files is use "wget -r -np -A files url". This will donwload data in a recursive format and mirrors the website. The donwload rate is very high 4mb/sec.
But, just to play around I... |
wget Vs urlretrieve of python | 2,350,655 | 0 | 9 | 37,225 | 0 | python,urllib2,wget | You can use wget -k to engage relative links in all urls. | 0 | 0 | 1 | 0 | 2009-06-10T10:18:00.000 | 10 | 0 | false | 974,741 | 0 | 0 | 1 | 5 | I have a task to download Gbs of data from a website. The data is in form of .gz files, each file being 45mb in size.
The easy way to get the files is use "wget -r -np -A files url". This will donwload data in a recursive format and mirrors the website. The donwload rate is very high 4mb/sec.
But, just to play around I... |
wget Vs urlretrieve of python | 7,782,898 | 1 | 9 | 37,225 | 0 | python,urllib2,wget | Since python suggests using urllib2 instead of urllib, I take a test between urllib2.urlopen and wget.
The result is, it takes nearly the same time for both of them to download the same file.Sometimes, urllib2 performs even better.
The advantage of wget lies in a dynamic progress bar to show the percent finished and t... | 0 | 0 | 1 | 0 | 2009-06-10T10:18:00.000 | 10 | 0.019997 | false | 974,741 | 0 | 0 | 1 | 5 | I have a task to download Gbs of data from a website. The data is in form of .gz files, each file being 45mb in size.
The easy way to get the files is use "wget -r -np -A files url". This will donwload data in a recursive format and mirrors the website. The donwload rate is very high 4mb/sec.
But, just to play around I... |
wget Vs urlretrieve of python | 974,809 | 1 | 9 | 37,225 | 0 | python,urllib2,wget | Maybe you can wget and then inspect the data in Python? | 0 | 0 | 1 | 0 | 2009-06-10T10:18:00.000 | 10 | 0.019997 | false | 974,741 | 0 | 0 | 1 | 5 | I have a task to download Gbs of data from a website. The data is in form of .gz files, each file being 45mb in size.
The easy way to get the files is use "wget -r -np -A files url". This will donwload data in a recursive format and mirrors the website. The donwload rate is very high 4mb/sec.
But, just to play around I... |
python not starting properly | 974,834 | 1 | 0 | 139 | 0 | python,windows,django-admin | you can't run a command that isn't in your path. it should be set globally when you installed python.
type 'set' at a dos prompt and look at the PATH variable. c:\python25 (or whever you installed python) has to be in that variable ie PATH=c:\windows;c:\python25;... etc
if it isn't in PATH then you or the installer mi... | 0 | 0 | 0 | 0 | 2009-06-10T10:42:00.000 | 4 | 0.049958 | false | 974,821 | 1 | 0 | 1 | 3 | I have installed python and django in my system that uses win vista. Now when I go to command prompt and type python or django-admin.py both are not working. Every time I need to set the path to the python folder manually. But i have seen these commands running even without setting path. So how do i make it to run pro... |
python not starting properly | 974,848 | 0 | 0 | 139 | 0 | python,windows,django-admin | Either use the system control panel to set the PATH environment variable that applies permanently or
Reinstall Python as a system administrator so that the installer can set the registry and environment variables for you.
If you install the "just for me" option, then you have to set the PATH variable in the control pan... | 0 | 0 | 0 | 0 | 2009-06-10T10:42:00.000 | 4 | 1.2 | true | 974,821 | 1 | 0 | 1 | 3 | I have installed python and django in my system that uses win vista. Now when I go to command prompt and type python or django-admin.py both are not working. Every time I need to set the path to the python folder manually. But i have seen these commands running even without setting path. So how do i make it to run pro... |
python not starting properly | 975,292 | 0 | 0 | 139 | 0 | python,windows,django-admin | In your path, I think you need to have both the location of the Python install and the Python\Scripts folder. For example, on XP, I have C:\Python25;C:\Python25\Scripts. Can you verify that you have both? | 0 | 0 | 0 | 0 | 2009-06-10T10:42:00.000 | 4 | 0 | false | 974,821 | 1 | 0 | 1 | 3 | I have installed python and django in my system that uses win vista. Now when I go to command prompt and type python or django-admin.py both are not working. Every time I need to set the path to the python folder manually. But i have seen these commands running even without setting path. So how do i make it to run pro... |
Thinking in AppEngine | 979,391 | 1 | 6 | 1,022 | 1 | java,python,google-app-engine,data-modeling | The non relational database design essentially involves denormalization wherever possible.
Example: Since the BigTable doesnt provide enough aggregation features, the sum(cash) option that would be in the RDBMS world is not available. Instead it would have to be stored on the model and the model save method must be ove... | 0 | 1 | 0 | 0 | 2009-06-10T16:13:00.000 | 4 | 0.049958 | false | 976,639 | 0 | 0 | 1 | 2 | I'm looking for resources to help migrate my design skills from traditional RDBMS data store over to AppEngine DataStore (ie: 'Soft Schema' style). I've seen several presentations and all touch on the the overarching themes and some specific techniques.
I'm wondering if there's a place we could pool knowledge from exp... |
Thinking in AppEngine | 978,757 | 1 | 6 | 1,022 | 1 | java,python,google-app-engine,data-modeling | The timeouts are tight and performance was ok but not great, so I found myself using extra space to save time; for example I had a many-to-many relationship between trading cards and players, so I duplicated the information of who owns what: Card objects have a list of Players and Player objects have a list of Cards.
N... | 0 | 1 | 0 | 0 | 2009-06-10T16:13:00.000 | 4 | 0.049958 | false | 976,639 | 0 | 0 | 1 | 2 | I'm looking for resources to help migrate my design skills from traditional RDBMS data store over to AppEngine DataStore (ie: 'Soft Schema' style). I've seen several presentations and all touch on the the overarching themes and some specific techniques.
I'm wondering if there's a place we could pool knowledge from exp... |
Is it more efficient to parse external XML or to hit the database? | 978,590 | 3 | 1 | 856 | 0 | python,mysql,xml,django,parsing | Consuming the webservices is more efficient because there are a lot more things you can do to scale your webservices and webserver (via caching, etc.). By consuming the middle layer, you also have the options to change the returned data format (e.g. you can decide to use JSON rather than XML). Scaling database is muc... | 0 | 0 | 1 | 0 | 2009-06-10T23:09:00.000 | 9 | 0.066568 | false | 978,581 | 0 | 0 | 1 | 9 | I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma... |
Is it more efficient to parse external XML or to hit the database? | 978,717 | 0 | 1 | 856 | 0 | python,mysql,xml,django,parsing | It depends from case to case, you'll have to measure (or at least make an educated guess).
You'll have to consider several things.
Web service
it might hit database itself
it can be cached
it will introduce network latency and might be unreliable
or it could be in local network and faster than accessing even local dis... | 0 | 0 | 1 | 0 | 2009-06-10T23:09:00.000 | 9 | 0 | false | 978,581 | 0 | 0 | 1 | 9 | I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma... |
Is it more efficient to parse external XML or to hit the database? | 978,603 | 1 | 1 | 856 | 0 | python,mysql,xml,django,parsing | There is not enough information to be able to say for sure in the general case. Why don't you do some tests and find out? Since it sounds like you are using python you will probably want to use the timeit module.
Some things that could effect the result:
Performance of the web service you are using
Reliability of the ... | 0 | 0 | 1 | 0 | 2009-06-10T23:09:00.000 | 9 | 0.022219 | false | 978,581 | 0 | 0 | 1 | 9 | I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma... |
Is it more efficient to parse external XML or to hit the database? | 978,773 | 0 | 1 | 856 | 0 | python,mysql,xml,django,parsing | As a few people have said, it depends, and you should test it.
Often external services are slow, and caching them locally (in a database in memory, e.g., with memcached) is faster. But perhaps not.
Fortunately, it's cheap and easy to test. | 0 | 0 | 1 | 0 | 2009-06-10T23:09:00.000 | 9 | 0 | false | 978,581 | 0 | 0 | 1 | 9 | I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma... |
Is it more efficient to parse external XML or to hit the database? | 979,028 | -1 | 1 | 856 | 0 | python,mysql,xml,django,parsing | It sounds like you essentially want to cache results, and are wondering if it's worth it. But if so, I would NOT use a database (I assume you are thinking of a relational DB): RDBMSs are not good for caching; even though many use them. You don't need persistence nor ACID.
If choice was between Oracle/MySQL and external... | 0 | 0 | 1 | 0 | 2009-06-10T23:09:00.000 | 9 | -0.022219 | false | 978,581 | 0 | 0 | 1 | 9 | I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma... |
Is it more efficient to parse external XML or to hit the database? | 978,864 | 0 | 1 | 856 | 0 | python,mysql,xml,django,parsing | Test definitely. As a rule of thumb, XML is good for communicating between apps, but once you have the data inside of your app, everything should go into a database table. This may not apply in all cases, but 95% of the time it has for me. Anytime I ever tried to store data any other way (ex. XML in a content manage... | 0 | 0 | 1 | 0 | 2009-06-10T23:09:00.000 | 9 | 0 | false | 978,581 | 0 | 0 | 1 | 9 | I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma... |
Is it more efficient to parse external XML or to hit the database? | 978,857 | 4 | 1 | 856 | 0 | python,mysql,xml,django,parsing | Everyone is being very polite in answering this question: "it depends"... "you should test"... and so forth.
True, the question does not go into great detail about the application and network topographies involved, but if the question is even being asked, then it's likely a) the DB is "local" to the application (on the... | 0 | 0 | 1 | 0 | 2009-06-10T23:09:00.000 | 9 | 1.2 | true | 978,581 | 0 | 0 | 1 | 9 | I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma... |
Is it more efficient to parse external XML or to hit the database? | 978,607 | 1 | 1 | 856 | 0 | python,mysql,xml,django,parsing | It depends - who is calling the web service? Is the web service called every time the user hits the page? If that's the case I'd recommend introducing a caching layer of some sort - many web service API's throttle the amount of hits you can make per hour.
Whether you choose to parse the cached XML on the fly or call th... | 0 | 0 | 1 | 0 | 2009-06-10T23:09:00.000 | 9 | 0.022219 | false | 978,581 | 0 | 0 | 1 | 9 | I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma... |
Is it more efficient to parse external XML or to hit the database? | 978,593 | 6 | 1 | 856 | 0 | python,mysql,xml,django,parsing | First off -- measure. Don't just assume that one is better or worse than the other.
Second, if you really don't want to measure, I'd guess the database is a bit faster (assuming the database is relatively local compared to the web service). Network latency usually is more than parse time unless we're talking a really... | 0 | 0 | 1 | 0 | 2009-06-10T23:09:00.000 | 9 | 1 | false | 978,581 | 0 | 0 | 1 | 9 | I was wondering when dealing with a web service API that returns XML, whether it's better (faster) to just call the external service each time and parse the XML (using ElementTree) for display on your site or to save the records into the database (after parsing it once or however many times you need to each day) and ma... |
Vim, Python, and Django autocompletion (pysmell?) | 10,666,285 | 2 | 48 | 19,878 | 0 | python,django,vim | Today, you not need special extentions for django autocomplete in vim. Make sure that you have vim with python support.
To check it, type in xterm:
vim --version|grep python
output:
+python -python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs ... ...
To make work autocomplete, add this lines in your .vimrc:
... | 0 | 0 | 0 | 0 | 2009-06-10T23:35:00.000 | 5 | 0.07983 | false | 978,643 | 0 | 0 | 1 | 2 | Does anyone know how to set up auto completion to work nicely with python, django, and vim?
I've been trying to use pysmell, but I can't seem to get it set up correctly (or maybe I don't know how it works). Right now, I run pysmell in the django directory (I'm using the trunk) and move the resulting tags to my project ... |
Vim, Python, and Django autocompletion (pysmell?) | 978,766 | 3 | 48 | 19,878 | 0 | python,django,vim | I've had good luck with exuberant-ctags for this.
I use this macro in my vimrc:
execute 'map :!/usr/bin/exuberant-ctags -f '.&tags.' --recurse '.$_P4ROOT.' '
You'll want to modify that slightly, so that it includes your python /site-packages/django/ directory as well as your own code.
Then, hit F2 inside vim to upda... | 0 | 0 | 0 | 0 | 2009-06-10T23:35:00.000 | 5 | 0.119427 | false | 978,643 | 0 | 0 | 1 | 2 | Does anyone know how to set up auto completion to work nicely with python, django, and vim?
I've been trying to use pysmell, but I can't seem to get it set up correctly (or maybe I don't know how it works). Right now, I run pysmell in the django directory (I'm using the trunk) and move the resulting tags to my project ... |
Finding rendered HTML element positions using WebKit (or Gecko) | 980,098 | 3 | 2 | 3,938 | 0 | python,html,perl,rendering,rendering-engine | lxml isn't going to help you at all. It isn't concerned about front-end rendering at all.
To accurately work out how something renders, you need to render it. For that you need to hook into a browser, spawn the page and run some JS on the page to find the DOM element and get its attributes.
It's totally possible but I ... | 0 | 0 | 0 | 0 | 2009-06-11T08:57:00.000 | 7 | 0.085505 | false | 980,058 | 0 | 0 | 1 | 1 | I would like to get the dimensions (coordinates) for all the HTML elements of a webpage as they are rendered by a browser, that is the positions they are rendered at. For example, (top-left,top-right,bottom-left,bottom-right)
Could not find this in lxml. So, is there any library in Python that does this? I had also loo... |
Get original path from django filefield | 981,666 | 2 | 1 | 1,174 | 0 | python,django,file,forms,field | I think that is not possible, most browsers at least firefox3.0 do not allow fullpath to be seen, so even from JavaScript side you can not get full path
If you could get full path you can send it to server, but I think you will have to be satisfied with file name | 0 | 0 | 0 | 0 | 2009-06-11T14:17:00.000 | 1 | 1.2 | true | 981,371 | 0 | 0 | 1 | 1 | My django app accepts two files (in this case a jad and jar combo). Is there a way I can preserve the folders they came from?
I need this so I can check later that they came from the same path.
(And later on accept a whole load of files and be able to work out which came from the same folder). |
Experiences of creating Social Network site in Django | 990,440 | -1 | 13 | 5,087 | 0 | python,django | Are you saying that a random survey of some posted Django apps (not Django itself) reveals that some people post code that doesn't meet your standards of quality?
Isn't that universally true of all code posted everywhere on the internet?
A random survey of any code in any language for any framework will turn up quality... | 0 | 0 | 0 | 0 | 2009-06-12T13:17:00.000 | 2 | -0.099668 | false | 986,594 | 0 | 0 | 1 | 1 | I plan to sneak in some Python/Django to my workdays and a possible social network site project seems like a good possibility.
Django itself seems excellent, but I am skeptical about the quality of large amount of Django apps that seem to be available.
I would like to hear what kind of experiences you may have had with... |
Python LDAP Authentication from remote web server | 991,550 | 0 | 0 | 2,571 | 0 | python,active-directory,ldap,webserver | There are quite a few components between your hosted django application and your internal AD. You will need to test each to see if everything in the pathways between them is correct.
So your AD server is sitting behind your firewall. Your firewall has ip "a.b.c.d" and all traffic to the firewall ip on port 389 is forwa... | 0 | 0 | 1 | 0 | 2009-06-13T10:09:00.000 | 2 | 0 | false | 990,459 | 0 | 0 | 1 | 1 | I have a django application hosted on webfaction which now has a static/private ip.
Our network in the office is obviously behind a firewall and the AD server is running behind this firewall. From inside the network i can authenticate using python-ldap with the AD's internal IP address and the port 389 and all works we... |
Which template technology should I use with CherryPy? | 994,184 | 3 | 11 | 8,175 | 0 | python,templates,template-engine,cherrypy | I like Genshi.
One reason that I like it is simply that the XML syntax looks much cleaner to me when mixed with HTML versus the text-level syntax of the other popular templating engines. For example, it's nice to be able to stick a py:for attribute on to output a table versus nesting messy #if or whatever lines.
... | 0 | 0 | 0 | 0 | 2009-06-14T15:33:00.000 | 6 | 0.099668 | false | 993,029 | 0 | 0 | 1 | 1 | I'm in the process of building a web application using cherrypy.
What template technology do you recommend I use? |
Customize login in Google App Engine | 995,085 | 2 | 2 | 4,081 | 0 | python,google-app-engine,authentication,registration | You can't customize the login page. Allowing you to do so would introduce the possibility of XSS vulnerabilities, as well as making it harder for users to identify a legitimate login page.
If you want to provide for federated login, you may want to simply redirect users to an interstitial page that allows them to pick ... | 0 | 0 | 0 | 0 | 2009-06-15T08:03:00.000 | 3 | 0.132549 | false | 994,965 | 0 | 0 | 1 | 1 | I need to add few more options for login and therefore need to customize create_login_url with some HTML code.
Is there a way to add on your code in default login screen of Google?
Environment: Python (Google App Engine)
I want to continue having the default Google ext class Users behavior in place. |
python web framework large project | 2,246,687 | 1 | 4 | 2,101 | 1 | python,frameworks,web-frameworks | I would absolutely recommend Repoze.bfg with SQLAlchemy for what you describe. I've done projects now in Django, TurboGears 1, TurboGears 2, Pylons, and dabbled in pure Zope3. BFG is far and away the framework most designed to accomodate a project growing in ways you don't anticipate at the beginning, but is far more l... | 0 | 0 | 0 | 0 | 2009-06-16T18:21:00.000 | 7 | 0.028564 | false | 1,003,131 | 0 | 0 | 1 | 4 | I need your advices to choose a Python Web Framework for developing a large project:
Database (Postgresql)will have at least 500 tables, most of them with a composite primary
key, lots of constraints, indexes & queries. About 1,500 views for starting. The project belongs to the financial area. Alwasy new requirements a... |
python web framework large project | 1,003,329 | 2 | 4 | 2,101 | 1 | python,frameworks,web-frameworks | Depending on what you want to do, you actually have a few possible frameworks :
[Django] Big, strong (to the limit of what a python framework can be), and the older in the race. Used by a few 'big' sites around the world ([Django sites]). Still is a bit of an overkill for almost everything and with a deprecated coding ... | 0 | 0 | 0 | 0 | 2009-06-16T18:21:00.000 | 7 | 0.057081 | false | 1,003,131 | 0 | 0 | 1 | 4 | I need your advices to choose a Python Web Framework for developing a large project:
Database (Postgresql)will have at least 500 tables, most of them with a composite primary
key, lots of constraints, indexes & queries. About 1,500 views for starting. The project belongs to the financial area. Alwasy new requirements a... |
python web framework large project | 1,003,173 | 8 | 4 | 2,101 | 1 | python,frameworks,web-frameworks | Yes. An ORM is essential for mapping SQL stuff to objects.
You have three choices.
Use someone else's ORM
Roll your own.
Try to execute low-level SQL queries and pick out the fields they want from the result set. This is -- actually -- a kind of ORM with the mappings scattered throughout the applications. It may ... | 0 | 0 | 0 | 0 | 2009-06-16T18:21:00.000 | 7 | 1 | false | 1,003,131 | 0 | 0 | 1 | 4 | I need your advices to choose a Python Web Framework for developing a large project:
Database (Postgresql)will have at least 500 tables, most of them with a composite primary
key, lots of constraints, indexes & queries. About 1,500 views for starting. The project belongs to the financial area. Alwasy new requirements a... |
python web framework large project | 1,003,161 | 12 | 4 | 2,101 | 1 | python,frameworks,web-frameworks | Django has been used by many large organizations (Washington Post, etc.) and can connect with Postgresql easily enough. I use it fairly often and have had no trouble. | 0 | 0 | 0 | 0 | 2009-06-16T18:21:00.000 | 7 | 1 | false | 1,003,131 | 0 | 0 | 1 | 4 | I need your advices to choose a Python Web Framework for developing a large project:
Database (Postgresql)will have at least 500 tables, most of them with a composite primary
key, lots of constraints, indexes & queries. About 1,500 views for starting. The project belongs to the financial area. Alwasy new requirements a... |
Number of visitors in Django | 1,004,658 | -2 | 3 | 4,771 | 0 | python,django | Edit: Added some more information about why I present this answer here. I found chartbeat when I tried to answer this same question for my django based site. I don't work for them.
Not specifically Django, but chartbeat.com is very interesting to add to a website as well.
django-tracking is great, +1 for that answer,... | 0 | 0 | 0 | 0 | 2009-06-16T18:50:00.000 | 4 | -0.099668 | false | 1,003,302 | 0 | 0 | 1 | 1 | In Django, how can I see the number of current visitors? Or how do I determine the number of active sessions?
Is this a good method?
use django.contrib.sessions.models.Session, set the expiry time short. Every time when somebody does something on the site, update expiry time. Then count the number of sessions that are ... |
How to distinguish field that requires null=True when blank=True is set in Django models? | 1,005,209 | 2 | 2 | 381 | 0 | python,django,django-models | null=True is used to tell that in DB value can be NULL
blank=True is only for django , so django doesn't raise error if field is blank e.g. in admin interface
so blank=True has nothing to do with DB
NULL requirement will vary from DB to DB, and it is upto you to decide if you want some column NULL or not | 0 | 0 | 0 | 0 | 2009-06-17T04:57:00.000 | 2 | 0.197375 | false | 1,005,187 | 0 | 0 | 1 | 1 | Some model fields such as DateTimeField require null=True option when blank=True option is set.
I'd like to know which fields require that (maybe dependent on backend DBMS), and there is any way to do this automatically. |
Redeclare .net classes in IronPython | 1,040,151 | 0 | 1 | 324 | 0 | c#,ironpython,monkeypatching | You can monkey-patch from IronPython, but IPy is the only environment that will respect your changes; i.e. if you tried to mock out File.Create from IronPython, this would work fine for any IPy code, but if you called a C# method which called File.Create, it would get the real one, not the mock. | 1 | 0 | 0 | 1 | 2009-06-17T18:08:00.000 | 3 | 0 | false | 1,008,686 | 0 | 0 | 1 | 2 | Can anyone tell me if its possible to redeclare a C# class in IronPython? If I have a C# class, would I be able to monkey-patch it from IronPython? |
Redeclare .net classes in IronPython | 3,155,159 | 0 | 1 | 324 | 0 | c#,ironpython,monkeypatching | You cannot monkey patch from IronPython. IronPython treats all .NET classes just like CPython treats built-in types: they cannot be monkey patched. IronRuby on the other hand does support this. | 1 | 0 | 0 | 1 | 2009-06-17T18:08:00.000 | 3 | 1.2 | true | 1,008,686 | 0 | 0 | 1 | 2 | Can anyone tell me if its possible to redeclare a C# class in IronPython? If I have a C# class, would I be able to monkey-patch it from IronPython? |
What to learn for RIA | 1,011,396 | 2 | 1 | 2,163 | 0 | python,silverlight,html,ria | You should focus on “HTML5” where “HTML5” is the new “Ajax” buzzword aka. the “Open Web Platform”—not just the HTML 5 spec itself.
Flash, Silverlight and JavaFX are all single-vendor plug-in offerings but “HTML5” is a multi-vendor browser-native thing.
If you want to an IDE workflow, you can use the Google Web Toolkit ... | 0 | 0 | 0 | 0 | 2009-06-18T06:59:00.000 | 6 | 1.2 | true | 1,011,168 | 1 | 0 | 1 | 2 | I am planning to build a RIA about a year from now (when my current contract ends). What technology would you recommend investing time in?
I will need good cross browser/platform support for video, music, and canvas.
And ideally I would like to leverage my Python skills.
Silverlight looks interesting because I could u... |
What to learn for RIA | 1,011,196 | 2 | 1 | 2,163 | 0 | python,silverlight,html,ria | If you have a year to prepare I recommend that you research all the technologies you can. Build the hello worlds for the different platforms. Then build the SAME simple RIA on each candidate framework to get a good feel for the differences. Obviously you will not uncover every little gotcha, but the gross architectu... | 0 | 0 | 0 | 0 | 2009-06-18T06:59:00.000 | 6 | 0.066568 | false | 1,011,168 | 1 | 0 | 1 | 2 | I am planning to build a RIA about a year from now (when my current contract ends). What technology would you recommend investing time in?
I will need good cross browser/platform support for video, music, and canvas.
And ideally I would like to leverage my Python skills.
Silverlight looks interesting because I could u... |
Configuring Django to use SQLAlchemy | 45,878,579 | 0 | 29 | 30,261 | 1 | python,django,sqlalchemy,configure | There are many benefits of using SQLAlchemy instead of Django ORM, but consider developing a built-in-Django choice of SQLAlchemy
(to have something called a production ready)
By the way, Django ORM is going better - in Django 1.11 they added UNION support (a SQL basic operator), so maybe some day there will be no need... | 0 | 0 | 0 | 0 | 2009-06-18T08:31:00.000 | 5 | 0 | false | 1,011,476 | 0 | 0 | 1 | 1 | How can I configure Django with SQLAlchemy? |
How to get links on a webpage using mechanize and open those links | 1,012,022 | 2 | 3 | 8,097 | 0 | python,mechanize | The Browser object in mechanize has a links method that will retrieve all the links on the page. | 0 | 0 | 1 | 0 | 2009-06-18T10:32:00.000 | 2 | 0.197375 | false | 1,011,975 | 0 | 0 | 1 | 1 | I want to use mechanize with python to get all the links of the page, and then open the links.How can I do it? |
Sandboxing in Linux | 1,029,301 | 0 | 16 | 7,104 | 0 | python,c,linux,security,sandbox | I think your solutions must concentrate on analyzing the source code. I don't know any tools, and I think this would be pretty hard with C, but, for example, a Pascal program which doesn't include any modules would be pretty harmless in my opinion. | 0 | 1 | 0 | 1 | 2009-06-19T19:35:00.000 | 12 | 0 | false | 1,019,707 | 0 | 0 | 1 | 3 | I want to create a Web app which would allow the user to upload some C code, and see the results of its execution (the code would be compiled on the server). The users are untrusted, which obviously has some huge security implications.
So I need to create some kind of sandbox for the apps. At the most basic level, I'd ... |
Sandboxing in Linux | 1,019,986 | -2 | 16 | 7,104 | 0 | python,c,linux,security,sandbox | About the only chance you have is running a VirtualMachine and those can have vulnerabilities. If you want your machine hacked in the short term just use permissions and make a special user with access to maybe one directory. If you want to postpone the hacking to some point in the future then run a webserver inside a ... | 0 | 1 | 0 | 1 | 2009-06-19T19:35:00.000 | 12 | -0.033321 | false | 1,019,707 | 0 | 0 | 1 | 3 | I want to create a Web app which would allow the user to upload some C code, and see the results of its execution (the code would be compiled on the server). The users are untrusted, which obviously has some huge security implications.
So I need to create some kind of sandbox for the apps. At the most basic level, I'd ... |
Sandboxing in Linux | 15,609,095 | 0 | 16 | 7,104 | 0 | python,c,linux,security,sandbox | Spawning a new VM under KVM or qemu to compile and run the code looks like the way to go. Running the code under jail/LXC can compromise the machine if it exploits the unsecured parts of the OS like networking code. Advantage of running under a VM are obvious. One can only hack the VM but not the machine itself. But th... | 0 | 1 | 0 | 1 | 2009-06-19T19:35:00.000 | 12 | 0 | false | 1,019,707 | 0 | 0 | 1 | 3 | I want to create a Web app which would allow the user to upload some C code, and see the results of its execution (the code would be compiled on the server). The users are untrusted, which obviously has some huge security implications.
So I need to create some kind of sandbox for the apps. At the most basic level, I'd ... |
Python database application framework and tools | 1,021,195 | 0 | 9 | 9,831 | 1 | python,frame | just FYI, for PyQT, the book has a chapter 15 with Databases, It looks good. and the book has something with data and view etc. I have read it and I think it's well worth your time:) | 0 | 0 | 0 | 0 | 2009-06-20T02:22:00.000 | 6 | 0 | false | 1,020,775 | 0 | 0 | 1 | 1 | I have been building business database applications such as finance, inventory and other business requirement applications. I am planning to shift to Python. What would be the tools to start with best. I would need to do master, transaction forms, processing (back end), reports and that sort of thing. The database woul... |
Package for creating and validating HTML forms in Python? - to be used in Google Appengine | 1,021,454 | 0 | 1 | 355 | 0 | python,html,google-app-engine,forms | AppEngine includes Django's form framework (or a variation thereof), which I find very nice. It also plays well with your ORM (i.e. getting forms for models is very DRY). The only potential problem is the lack of client-side validation. | 0 | 0 | 0 | 0 | 2009-06-20T11:01:00.000 | 3 | 0 | false | 1,021,411 | 0 | 0 | 1 | 1 | Is there a well maintained package available in Python for creating and validating HTML forms? I will deploying it finally on Google Appengine. |
Deploying Django | 1,022,932 | 2 | 2 | 537 | 0 | python,ruby-on-rails,django | Python is all that is needed.
I think there is a cPanel plugin which allows your users to create and deploy Django applications, so if you have a VPS or Reseller account, or your host is running cPanel, you could simply tell them to install it. If I find the link to the plugin I will post it here. | 0 | 0 | 0 | 0 | 2009-06-21T01:00:00.000 | 5 | 0.07983 | false | 1,022,914 | 0 | 0 | 1 | 1 | When finding web hosting for Rails apps, the hoster must have support for ruby on rails -- that is evident. What about hosting for Django? What support does the hoster need to provide? Python, or more than just Python?
This might seem like an obvious question, but I'm new to web development frameworks so I must ask ... |
What's the best way to implement web service for ajax autocomplete | 1,025,027 | 1 | 2 | 1,169 | 0 | python,ajax,autocomplete,trie | I would use the first option. 'KISS' - (Keep It Simple Stupid).
For small amounts of data there shouldn't be much latency. We run the same kind of thing for a name search and results appear pretty quickly on a few thousand rows.
Hope that helps,
Josh | 0 | 0 | 0 | 0 | 2009-06-21T23:31:00.000 | 2 | 0.099668 | false | 1,025,018 | 1 | 0 | 1 | 1 | I'm implementing a "Google Suggest" like autocomplete feature for tag searching using jQuery's autocomplete.
I need to provide a web service to jQuery giving it a list of suggestions based on what the user has typed. I see 2 ways of implementing the web service:
1) just store all the tags in a database and search the ... |
Call program from within a browser without using a webserver | 1,025,846 | 1 | 2 | 2,904 | 0 | python,html,browser | If you want an an HTML page to have some sort of server-side programming then you will need a webserver of some sort to do the processing.
My suggestion would be to get a web server running on your development box, or try to accomplish what you need to do with a local desktop application or script. | 0 | 0 | 0 | 0 | 2009-06-22T07:03:00.000 | 7 | 0.028564 | false | 1,025,817 | 0 | 0 | 1 | 3 | Is there a way to call a program (Python script) from a local HTML page?
I have a YUI-colorpicker on that page and need to send its value to a microcontroller via rs232. (There is other stuff than the picker, so I can't code an application instead of an HTML page.)
Later, this will migrate to a server, but I need a fas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.