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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
About pyjamas maturity vs GWT maturity (with short dead lines) for a web application
| 3,473,114 | 7 | 6 | 1,811 | 0 |
java,python,gwt,pyjamas
|
In fact, from my beginner point of
view, it seems like the python world
is more suitable for a
quickly-developed and fun web
application. And, on the other hand,
the java world is useful for
performance-oriented, scalable
solutions and for 'serious' projects
with big money involved...
Naah. For example, YouTube is in Python -- where do you see that affecting its performance, scalability, or "big money" characteristics?
Is pyjamas mature enough to replace
GWT on a performance and functionality
point of view?
Completely different question from the previous, silly observation.
GWT has been around for longer, and has more users and contributors. Perhaps pyjamas is "good enough" for many uses -- nevertheless, it is at release 0.7, with GWT at release 2.0, which can be taken as an indication that GWT is better, more developed and mature.
Most real-world, highly-scalable web apps use "real" Javascript (typically with some supporting framework, such as the very popular jQuery or any of its many "competitors"); if, for whatever reason, you can't (or, more likely, don't want to), then GWT is probably a less risky choice than pyjamas, in my opinion.
| 0 | 0 | 0 | 0 |
2010-08-12T22:23:00.000
| 2 | 1.2 | true | 3,472,493 | 0 | 0 | 1 | 2 |
I love both, python and Java and I have this first 'serious' web application project that I would like to carry out.
I find it hard to choose between pyjamas + django and GWT + Hibernate.
In fact, from my beginner point of view, it seems like the python world is more suitable for a quickly-developed and fun web application.
And, on the other hand, the java world is useful for performance-oriented, scalable solutions and for 'serious' projects with big money involved...
My requirements are quite simple: this application has to replace a desktop application. So, the performance factor is there. But my deadlines are pretty short.
Is pyjamas mature enough to replace GWT on a performance and functionality point of view?
|
Good learner book for a 12 year old?
| 3,472,642 | 8 | 10 | 2,051 | 0 |
java,python
|
Head First Java is a great book for any new Java programmer. It has lots of pictures, fun quips and puzzles to solve. Definitely worth the buy.
| 0 | 0 | 0 | 0 |
2010-08-12T22:50:00.000
| 7 | 1 | false | 3,472,634 | 1 | 0 | 1 | 3 |
My 12 year old brother has recently expressed an interest in learning to program. I of course think this is a great idea, why not start him early? I'm wondering what you guys think with regards a book? I was thinking I should start him off on Java but I'm unsure what book would be best? Any suggestions with regards a book or even another language would be much appreciated.
UPDATE: I've went with Python and I'm starting him off with "Snake wrangling for kids".
|
Good learner book for a 12 year old?
| 3,472,998 | 2 | 10 | 2,051 | 0 |
java,python
|
If your brother plays any PC games, you might check to see if any of them are moddable. Many games these days come with scripted campaign editors or have python scripts underlying them that you can modify. They are a great way to get involved with the basic concepts behind programming, as your brother can get pretty immediate feedback in an environment that's already very interesting to him.
It may not be 'programming' per se, but it's an exercise in instructing the computer to do what you want, which requires a clear intention and some work and investigation to actually achieve what you've intended. If he develops that mindset, then more general programming in a more complex environment follows naturally.
| 0 | 0 | 0 | 0 |
2010-08-12T22:50:00.000
| 7 | 0.057081 | false | 3,472,634 | 1 | 0 | 1 | 3 |
My 12 year old brother has recently expressed an interest in learning to program. I of course think this is a great idea, why not start him early? I'm wondering what you guys think with regards a book? I was thinking I should start him off on Java but I'm unsure what book would be best? Any suggestions with regards a book or even another language would be much appreciated.
UPDATE: I've went with Python and I'm starting him off with "Snake wrangling for kids".
|
Good learner book for a 12 year old?
| 3,472,658 | 0 | 10 | 2,051 | 0 |
java,python
|
I too can recommend the Head First series.
You could try "Head First Programming". It uses some python though.
| 0 | 0 | 0 | 0 |
2010-08-12T22:50:00.000
| 7 | 0 | false | 3,472,634 | 1 | 0 | 1 | 3 |
My 12 year old brother has recently expressed an interest in learning to program. I of course think this is a great idea, why not start him early? I'm wondering what you guys think with regards a book? I was thinking I should start him off on Java but I'm unsure what book would be best? Any suggestions with regards a book or even another language would be much appreciated.
UPDATE: I've went with Python and I'm starting him off with "Snake wrangling for kids".
|
Difference between save() and put()?
| 3,476,378 | 5 | 0 | 205 | 0 |
python,google-app-engine
|
save() is a (deprecated) alias for put(). They work exactly equivalently - in fact, they're the same function!
| 0 | 0 | 0 | 0 |
2010-08-13T10:55:00.000
| 1 | 1.2 | true | 3,476,152 | 0 | 0 | 1 | 1 |
What is the difference between Mymodel.save() and Mymodel.put() in appengine with python?
I know that save is used in django but does is work with appengine models too?
|
Twisted vs Google App Engine in serving mobile clients
| 3,480,585 | 6 | 1 | 617 | 0 |
python,google-app-engine,twisted
|
Certainly. App Engine will scale your application up as the load increases automatically and will be spread over many machines. The web api they have is pretty nice too. You don't have to worry about deferreds either because it scales by bringing more instances up instead of making things asynchronous.
BTW: I have web services hosted on app engine that are consumed by iPhone.
| 0 | 1 | 0 | 0 |
2010-08-13T20:41:00.000
| 1 | 1.2 | true | 3,480,524 | 0 | 0 | 1 | 1 |
So far I have been using Twisted to simultaneously serve a lot of mobile clients (Android, iPhone) with their HTTP requests exchanging JSON messages.
For my next project I'd like to try out Google App Engine, but I'm wondering if it is capable of doing the same or if I should rather go with a custom built solution again.
|
Google App Engine - Naked Domain Path Redirect in Python
| 3,483,631 | 0 | 4 | 830 | 0 |
python,google-app-engine,redirect
|
You need to use a third-party site to do the redirection to www.*; many registrars offer this service. Godaddy's service (which is even free with domain registration) forwards foo.com/bar to www.foo.com/bar; I can't speak to the capabilities of the others but it seems to me that any one that doesn't behave this way is broken.
| 0 | 1 | 1 | 0 |
2010-08-14T05:27:00.000
| 2 | 0 | false | 3,482,152 | 0 | 0 | 1 | 1 |
I'm working on a site, colorurl.com, and I need users to be able to type in colorurl.com/00ff00 (or some variation of that), and see the correct page. However, with the naked domain issue, users who type in colorurl.com/somepath will instead be redirected to www.colorurl.com/.
Is there a way to detect this in python, and then redirect the user to where they meant to go (With the www. added?)
EDIT:
Clarification: In my webhost's configuration I have colorurl.com forward to www.colorurl.com. They do not support keeping the path (1and1). I have to detect the previous path and redirect users to it.
User goes to colorurl.com/path
User is redirected to www.colorurl.com
App needs to detect what the path was.
App sends user to www.colorurl.com/path
|
Process field before database insert / update
| 3,485,462 | 3 | 3 | 2,000 | 0 |
python,django,django-admin
|
Stripping the junk and such should be done with a custom formfield.
Downloading the images... there are multiple ways to fix that problem.
If you choose to store the image location and original location in the database, than you should do it with a pre-save signal.
If you choose to store the images locally directly, than you can make it part of the formfield aswell. Simply download all remote images and replace the urls with a local url.
| 0 | 0 | 0 | 0 |
2010-08-14T22:28:00.000
| 3 | 1.2 | true | 3,485,369 | 0 | 0 | 1 | 1 |
I have a Django model with a text field. I'm using a rich text editor (nicEdit) on the admin site to allow the client to easily enter markup into the field. I'd like to process the contents of the field and perform a few actions before anything is inserted into the database.
For example, I want to strip junk generated by MS Word, font tags, etc. I hope this part should be easy, but I'm not sure what to override or hook to get this working.
I also want to detect remotely-linked images, download a local copy to MEDIA_ROOT, and relink the img src to the local image. I'm not quite sure how to go about fetching the remote image; I thought django.Storage might help but it looks like it's unable to fetch content from a remote URL.
Any suggestions?
|
App Engine - Output Response Time
| 3,490,013 | 3 | 4 | 165 | 0 |
python,performance,google-app-engine
|
Call start = time.time() as the very first operation in your handling scripts, and, when you're just about done with everything, as the very last thing you output use (a properly formatted version of) time.time() - start.
If you're using templates for your output (e.g., the Django templates that come with app engine -- 0.96 by default, though you can explicitly ask for newer and better ones;-), or jinja2, mako, ...), it's important to be able to use in those templates a tag or filter to request and format such an expression. (You don't want to compute it at the time you call the template's render method, and pass it as part of that method's context, or else you'll fail to account for all the template rendering time in your estimate of "response time"!-). You may have to code and inject such a tag or filter into the "templating language" if your chosen templating language and version doesn't already supply one but is at least minimally extensible;-).
`
| 0 | 1 | 0 | 0 |
2010-08-16T01:02:00.000
| 1 | 1.2 | true | 3,489,968 | 0 | 0 | 1 | 1 |
Say I wanted to print the response time on my pages like Google do.
How would I go about doing this?
|
Does python have a ruby installer like gem that lets you install modules from the command line even if they are not on your machine?
| 3,490,551 | 4 | 3 | 1,036 | 0 |
python,rubygems
|
no it does not have a ruby installer that I know of. It does have easy_install and pip though. Your google-fu is lacking.
| 0 | 0 | 0 | 1 |
2010-08-16T04:09:00.000
| 2 | 0.379949 | false | 3,490,543 | 1 | 0 | 1 | 1 |
With Ruby you can do gem install from the command line to install a module...even if it is not on your machine.
Can you do that with python. Does someone know of a module?
Seth
|
Can I use Turbogears to develop mobile sites?
| 3,562,868 | 0 | 1 | 254 | 0 |
python,mobile-website,turbogears
|
The simplest version of a "mobile site" is simply CSS. Display a simplified version of the site to USERAGENTS that are identified as mobile.
| 0 | 0 | 0 | 0 |
2010-08-16T12:51:00.000
| 4 | 0 | false | 3,493,244 | 0 | 0 | 1 | 1 |
Is it possible to develop mobile versions of webpages using Turbogears? Can someone please show me an example and how it is done?
|
How to best organize the rules component of a Django system?
| 3,504,714 | 1 | 4 | 177 | 0 |
python,django,architecture,code-organization
|
I would create subdirectory named rules in the app with game logic and there create module named after each game, that you would like serve. Then create a common interface for those modules, that will be utilized by your games and import proper rules module by name (if your game is called adom, then simply __import__('rules.adom') inside the main game engine and call game specific methods.
If your games don't create own models and views, then there seems to be no reason to create specific app for each of them. This is a delicate matter, because code used is based on data stored in the database. Didn't you think about storing additional gaming scripts inside the database to and then exec them? This seems more natural: a game is set of data and additional scripts associated with that game.
| 0 | 0 | 0 | 0 |
2010-08-17T15:54:00.000
| 2 | 1.2 | true | 3,504,405 | 0 | 0 | 1 | 2 |
I'm designing (and ultimately writing) a system in Django that consists of two major components:
A Game Manager: this is essentially a data-entry piece. Trusted (non-public) users will enter information on a gaming system, such as options that a player may have. The interface for this is solely the Django admin console, and it doesn't "do" anything except hold the information.
A Character Manager: this is the consumer of the above data. Public users will create characters in the role-playing systems defined above, pulling from the options entered by those trusted users. This is a separate app in the project from Django's standpoint.
There's one piece I'm not sure where to put, however, and that is the "rules" that are associated with each game. Essentially, for each game put into the first app, there are a sets of prerequisites, limitations, and other business logic specific to that game. (There's also similarly-structured logic that will be common to all games.) The logic is going to be coded in Python, rather than user-entered.
That logic is used in the process of validating a particular character, but is associated with a particular game and will need to be swapped out dynamically. Is it a separate app, or should it be validation tied to the forms of the Character Manager? Or can it be both?
This is the first Django app I've built from scratch (rather than chewing on someone else's code), and I'm new to the Python philosophy to boot, so I'm all ears on this.
Thanks in advance.
|
How to best organize the rules component of a Django system?
| 3,504,959 | 1 | 4 | 177 | 0 |
python,django,architecture,code-organization
|
the "rules" that are associated with each game.
for each game put into the first app, there are a sets of prerequisites, limitations, and other business logic specific to that game.
That's part of the game app, then.
There's also similarly-structured logic that will be common to all games.
That's part of the game app, then.
That logic is used in the process of validating a particular character, but is associated with a particular game.
Correct. That's part of the game app, then. Characters are associated with one or more games.
should it be validation tied to the forms of the Character Manager?
The Character Forms can have data cleansing rules which depend on a Game.
| 0 | 0 | 0 | 0 |
2010-08-17T15:54:00.000
| 2 | 0.099668 | false | 3,504,405 | 0 | 0 | 1 | 2 |
I'm designing (and ultimately writing) a system in Django that consists of two major components:
A Game Manager: this is essentially a data-entry piece. Trusted (non-public) users will enter information on a gaming system, such as options that a player may have. The interface for this is solely the Django admin console, and it doesn't "do" anything except hold the information.
A Character Manager: this is the consumer of the above data. Public users will create characters in the role-playing systems defined above, pulling from the options entered by those trusted users. This is a separate app in the project from Django's standpoint.
There's one piece I'm not sure where to put, however, and that is the "rules" that are associated with each game. Essentially, for each game put into the first app, there are a sets of prerequisites, limitations, and other business logic specific to that game. (There's also similarly-structured logic that will be common to all games.) The logic is going to be coded in Python, rather than user-entered.
That logic is used in the process of validating a particular character, but is associated with a particular game and will need to be swapped out dynamically. Is it a separate app, or should it be validation tied to the forms of the Character Manager? Or can it be both?
This is the first Django app I've built from scratch (rather than chewing on someone else's code), and I'm new to the Python philosophy to boot, so I'm all ears on this.
Thanks in advance.
|
What languages would be a good replacement for Java?
| 3,506,325 | 6 | 3 | 3,718 | 0 |
java,python,qt,programming-languages,replace
|
Might be worth loking at the other JVM languages - Clojure and Scala are the two I personally think are most promising.
Yes you are on the JVM, but you're pretty independent from Java the langauage and don't have to use any Sun/Oracle implementations if you don't want to.
Having said that - I think that you are worrying a little too much about Java, too many players (including Oracle!) have too much invested to let it go too far off course.
| 0 | 0 | 0 | 1 |
2010-08-17T19:35:00.000
| 10 | 1 | false | 3,506,252 | 0 | 0 | 1 | 3 |
I may be posting a premature question, and maybe I'm just freaking out for no reason, but the way Oracle is handling Java is not very promising. I am a nerd who fell in love with Java from the first sight, and use it all the time in my personal/freelance projects but now I am thinking of a replacement.
I am fluent in C#/VB.NET too but I am looking for something more like:
Open Source
Compiled
Cross-Platform
Object Oriented
Large standard library
Extensive documentation
Web development is a major plus
I was thinking about a compromise: Python/Django for web development (or PHP), and Qt for thick client development. Anyone with better thoughts?
|
What languages would be a good replacement for Java?
| 3,509,044 | 0 | 3 | 3,718 | 0 |
java,python,qt,programming-languages,replace
|
C# is the only thing that will meet your needs and not feel hopelessly archaic, or frustrate with limited library. For open source/non-windows, use mono. It's a good, mature implementation of most of what's important in the CLR.
Some things (WPF, WCF, etc) are "missing" from mono, but these aren't so much part of the platform as they are windows-specific proprietary toolkits. Some of them are being implemented slowly in mono, some aren't. Coming from java you won't miss them because you're looking for a platform and good standard libraries to build upon, not a gui toolkit or whiz-bang communication framework.
As far as a platform to build stuff with that's "like" java and offers similar levels of functionality, C# + CLR is the clearest option.
| 0 | 0 | 0 | 1 |
2010-08-17T19:35:00.000
| 10 | 0 | false | 3,506,252 | 0 | 0 | 1 | 3 |
I may be posting a premature question, and maybe I'm just freaking out for no reason, but the way Oracle is handling Java is not very promising. I am a nerd who fell in love with Java from the first sight, and use it all the time in my personal/freelance projects but now I am thinking of a replacement.
I am fluent in C#/VB.NET too but I am looking for something more like:
Open Source
Compiled
Cross-Platform
Object Oriented
Large standard library
Extensive documentation
Web development is a major plus
I was thinking about a compromise: Python/Django for web development (or PHP), and Qt for thick client development. Anyone with better thoughts?
|
What languages would be a good replacement for Java?
| 3,506,402 | 1 | 3 | 3,718 | 0 |
java,python,qt,programming-languages,replace
|
I too would like another Java-like technology to come along. Lately I've been doing Flex/Actionscript. While I really enjoy it, Actionscript technology seriously lacks the elegance that Java has. Adobe can write some good cross platform APIs, but they just don't have the head capital to build elegant languages and compilers. I've also tried Ruby, but the VM for Ruby is really bad. I've gone back to Java after my flirtation with other technologies and I think it's because the language is good enough, but the JVM is by far the best out there.
So do you want to stay with the JVM or do you really want to the leave the JVM altogether? Staying on the JVM there are lots of options: JRuby, Scala, Groovy, Javascript, Clojure are the big players. However, there are tons of great languages that can take advantage of the JVM's features.
Leaving the JVM there are still good options like python, ruby, and erlang. But you give up some of the nice features of the JVM like performance (big one), and the ability to drop down to a nice language like Java if you need speed. Those others mean using C or nothing at all.
I finally stopped worrying about Java's future. Sun did all it could to screw it up and it still turned out pretty darn good. I think Opensource has a lot more influence over Java's success than Oracle or Sun could ever have had.
| 0 | 0 | 0 | 1 |
2010-08-17T19:35:00.000
| 10 | 0.019997 | false | 3,506,252 | 0 | 0 | 1 | 3 |
I may be posting a premature question, and maybe I'm just freaking out for no reason, but the way Oracle is handling Java is not very promising. I am a nerd who fell in love with Java from the first sight, and use it all the time in my personal/freelance projects but now I am thinking of a replacement.
I am fluent in C#/VB.NET too but I am looking for something more like:
Open Source
Compiled
Cross-Platform
Object Oriented
Large standard library
Extensive documentation
Web development is a major plus
I was thinking about a compromise: Python/Django for web development (or PHP), and Qt for thick client development. Anyone with better thoughts?
|
Can deleting a django Model with a ManyToManyField create orphaned database rows?
| 3,509,354 | 2 | 0 | 334 | 0 |
python,django,django-models,many-to-many
|
If I have two classes A and B with a many to many relationship and I want to delete an instance of A, do I need to remove all of its related Bs first or will Django sort that out for me?
Short answer: Django will sort that out for you.
Does it make any difference if the ManyToMany field is declared on class A or B?
As far as I know, no, it does not make a difference.
Does it make any difference if there are additional fields on a join class specified using the "through" parameter?
I haven't tried this myself but I don't see why there should be a problem.
| 0 | 0 | 0 | 0 |
2010-08-18T05:44:00.000
| 1 | 1.2 | true | 3,509,275 | 0 | 0 | 1 | 1 |
If I have two classes A and B with a many to many relationship and I want to delete an instance of A, do I need to remove all of its related Bs first or will Django sort that out for me?
I obviously don't want to leave orphaned rows in the join table.
Does it make any difference if the ManyToMany field is declared on class A or B?
Does it make any difference if there are additional fields on a join class specified using the "through" parameter?
|
django grappelli, filebrowser and Tiny MCE insert image dialog
| 7,351,831 | 1 | 1 | 2,709 | 0 |
python,django,tinymce,django-filebrowser,django-grappelli
|
I managed to get the admin site to look like the django simple admin interface by not setting my admin media prefix to '/media/grappelli/'. Just left it as '/static/admin/' and it didn't break anything seemingly, I've not been able to get the 'choose' to work either way though.
| 0 | 0 | 0 | 0 |
2010-08-18T08:51:00.000
| 3 | 0.066568 | false | 3,510,374 | 0 | 0 | 1 | 1 |
So, I found django admin interface called 'grappelli'. Looked at the screenshots and decided that I like it. Went to sources page and checked out trunk. Set it up and noticed that it looks nothing like screenshots. No dashboard, no side panel, different colors of the elements and model item lists are very narrow.
From that point I'm wondering if I did something wrong and read the docs more closely. Stumbled upon admin-tools, installed them too. Dashboard appeared but it had misplaced buttons and different placements of the elements again. And haven't solved the problems with narrow item lists.
That was rather disappointing, but I decided to lurk more. And checked out branch 2_2. This finally looked like the screenshots in the django project. And tiny mce worked too!
So, question one: is this what everybody who want use grappelli do? Or are those screenshots actually for trunk version and it's just shy to show its beauty to me?
After that I decided to install filebrowser. Went to google project page, read the instruction, noticed grapplelli requirement and rejoiced thinking it'd be easy since I already got it.
So, I checked out trunk, placed the media where it belongs, created paths necessary and it worked. But looked awful. Search field and filters are nothing like in the simple django admin or grappelli, list is narrow, filters do not work. And weird gear like buttons on the right do not work either.
Well, it didn't discourage me to browse through templates, fix them here and there and they started to look more or less ok. But weird gear like buttons still didn't work. And what's worse, image insertion dialog from tiny MCE wasn't working either. It appeared, showed my folders and files but 'Choose' button was disabled.
Now I start to think that I did something wrong and
I reverted filebrowser back to trunk. 'Choose' buttons still don't work.
I wiped out everything and reverted grappelli to trunk. Filebrowser still looks somewhat messed up and worst of all 'Choose' buttons still don't work.
I tried filebrowser-no-grappelli and it doesn't even have those buttons.
I gave up and went here seeking comfort
So, question two: does everybody who wants to use filebrowser with tiny MCE insert image dialog walk the same path? Have you managed to make it work? Please, help me do the same.
TL/DR: How to set up grappelli and filebrowser for django admin and make tiny MCE insert image dialogs work?
I use django 1.2.1.
|
How to get read-only objects from database?
| 3,513,490 | 0 | 0 | 244 | 1 |
python,sqlalchemy
|
You must load the parent object again.
| 0 | 0 | 0 | 0 |
2010-08-18T14:57:00.000
| 1 | 0 | false | 3,513,433 | 0 | 0 | 1 | 1 |
I'd like to query the database and get read-only objects with session object. I need to save the objects in my server and use them through the user session. If I use a object outside of the function that calls the database, I get this error:
"DetachedInstanceError: Parent instance is not bound to a Session; lazy load operation of attribute 'items' cannot proceed"
I don't need to make any change in those objects, so I don't need to load them again.
Is there any way that I can get that?
Thanks in advance!
|
Embedded WSGI backend for Python desktop app using webkit
| 4,376,995 | 0 | 8 | 921 | 0 |
python,local,wsgi
|
Earlier today I saw exactly what you're asking for -- a way to call WSGI through an API without actually connecting over the network. However, it shouldn't be that hard.
On a side note, you might want to look at PySide, of particular interest to you may be the ability to bind python elements to DOM events, so if you're just looking to trigger python code that's an even shorter route.
If you give some more detail on what you're hoping to achieve we might be able to dial it in for you.
| 0 | 0 | 0 | 0 |
2010-08-19T12:05:00.000
| 3 | 0 | false | 3,521,548 | 0 | 0 | 1 | 1 |
Disclaimer: I'm not very familiar with any of the things mentioned in the question title.
Would it be possible to use a browser control (like Webkit) as a frontend for a WSGI app (using a framework like Flask) without starting a local WSGI server?
Basically the requests and responses are managed by a middle layer between the HTML UI and the WSGI backend. A certain URI could mean "Local", for instance "local://" or something similar, and will be routed to the embedded WSGI app with all the original headers etc.
You will lose any features that a normal WSGI server provides unless you implement it yourself or somehow embed a server that is also usable via an API instead of real HTTP requests.
Now that I think of it, this is the only real requirement: A WSGI server that is callable via an API and not just real HTTP requests.
I know the usefulness of this is questionable (and maybe doesn't even make sense). My question is whether this is at all possible?
EDIT: Here's another way of putting it:
I want a single codebase to be both a web app and a desktop app, using an HTML frontend and a Python backend. I don't want to run a server on any port for the desktop app. What's the easiest way to achieve this?
|
Trouble setting up sqlite3 with django! :/
| 3,524,305 | 1 | 5 | 3,575 | 1 |
python,database,django,sqlite
|
if you don't provide full path, it will use the current directory of settings.py,
and if you wish to specify static path you can specify it like: c:/projects/project1/my_proj.db
or in case you want to make it dynamic then you can use os.path module
so os.path.dirname(file) will give you the path of settings.py and accordingly you can alter the path for your database like os.path.join(os.path.dirname(file),'my_proj.db')
| 0 | 0 | 0 | 0 |
2010-08-19T17:02:00.000
| 2 | 0.099668 | false | 3,524,236 | 0 | 0 | 1 | 1 |
I'm in the settings.py module, and I'm supposed to add the directory to the sqlite database. How do I know where the database is and what the full directory is?
I'm using Windows 7.
|
Why do some Django ORM queries end abruptly with the message "Killed"?
| 3,529,637 | 6 | 7 | 1,944 | 1 |
python,django,postgresql
|
Only one thing I could think of that will kill automatically a process on Linux - the OOM killer. What's in the system logs?
| 0 | 1 | 0 | 0 |
2010-08-19T22:19:00.000
| 2 | 1.2 | true | 3,526,748 | 0 | 0 | 1 | 1 |
Sometimes, when fetching data from the database either through the python shell or through a python script, the python process dies, and one single word is printed to the terminal: Killed
That's literally all it says. It only happens with certain scripts, but it always happens for those scripts. It consistently happens with this one single query that takes a while to run, and also with a south migration that adds a bunch of rows one-by-one to the database.
My initial hunch was that a single transaction was taking too long, so I turned on autocommit for Postgres. Didn't solve the problem.
I checked the Postgres logs, and this is the only thing in there:
2010-08-19 22:06:34 UTC LOG: could not receive data from client: Connection reset by peer
2010-08-19 22:06:34 UTC LOG: unexpected EOF on client connection
I've tried googling, but as you might expect, a one-word error message is tough to google for.
I'm using Django 1.2 with Postgres 8.4 on a single Ubuntu 10.4 rackspace cloud VPS, stock config for everything.
|
Store python classes as pickles in GAE?
| 5,152,644 | 0 | 2 | 366 | 0 |
python,google-app-engine,pickle
|
The key advantages of using Django are its ORM and template system. The ORM is not very useful with datastore because of its non-relational nature and the template system is available as part of the app engine to be used with webapp.
I have had good success with using webapp and django templates for our project.
| 0 | 1 | 0 | 0 |
2010-08-20T15:34:00.000
| 2 | 0 | false | 3,532,417 | 0 | 0 | 1 | 2 |
I am porting a Python investing application to Google App Engine. Every market that you can trade in is a plugin: for example the stocks trading and FOREX trading are all plugins.
The application stores the portfolio (which is a Portfolio class instance containing the active investments (class instances) and history) as a pickle. However you can't write to the disk, and it seems a bit crude to use pickles in the Datastore as a blob, and pickles are also slow and CPU intensive (no cPickle).
Does anyone have any ideas how I can store all the current investments, and the history to the datastore without using large and intensive pickles?
Thank you
Ps. webapp or Django?
|
Store python classes as pickles in GAE?
| 3,532,598 | 1 | 2 | 366 | 0 |
python,google-app-engine,pickle
|
The best solution would be to use the Datastore data models, but you'll have to rewrite parts of your app. Using Pickle for data persistance, especially involving much data, is not a good pratice.
| 0 | 1 | 0 | 0 |
2010-08-20T15:34:00.000
| 2 | 0.099668 | false | 3,532,417 | 0 | 0 | 1 | 2 |
I am porting a Python investing application to Google App Engine. Every market that you can trade in is a plugin: for example the stocks trading and FOREX trading are all plugins.
The application stores the portfolio (which is a Portfolio class instance containing the active investments (class instances) and history) as a pickle. However you can't write to the disk, and it seems a bit crude to use pickles in the Datastore as a blob, and pickles are also slow and CPU intensive (no cPickle).
Does anyone have any ideas how I can store all the current investments, and the history to the datastore without using large and intensive pickles?
Thank you
Ps. webapp or Django?
|
Python Regular Expression Match All 5 Digit Numbers but None Larger
| 3,532,984 | 1 | 29 | 93,863 | 0 |
python,regex
|
You probably want to match a non-digit before and after your string of 5 digits, like [^0-9]([0-9]{5})[^0-9]. Then you can capture the inner group (the actual string you want).
| 0 | 0 | 0 | 0 |
2010-08-20T16:40:00.000
| 7 | 0.028564 | false | 3,532,947 | 1 | 0 | 1 | 3 |
I'm attempting to string match 5-digit coupon codes spread throughout a HTML web page. For example, 53232, 21032, 40021 etc... I can handle the simpler case of any string of 5 digits with [0-9]{5}, though this also matches 6, 7, 8... n digit numbers. Can someone please suggest how I would modify this regular expression to match only 5 digit numbers?
|
Python Regular Expression Match All 5 Digit Numbers but None Larger
| 3,532,981 | 3 | 29 | 93,863 | 0 |
python,regex
|
A very simple way would be to match all groups of digits, like with r'\d+', and then skip every match that isn't five characters long when you process the results.
| 0 | 0 | 0 | 0 |
2010-08-20T16:40:00.000
| 7 | 0.085505 | false | 3,532,947 | 1 | 0 | 1 | 3 |
I'm attempting to string match 5-digit coupon codes spread throughout a HTML web page. For example, 53232, 21032, 40021 etc... I can handle the simpler case of any string of 5 digits with [0-9]{5}, though this also matches 6, 7, 8... n digit numbers. Can someone please suggest how I would modify this regular expression to match only 5 digit numbers?
|
Python Regular Expression Match All 5 Digit Numbers but None Larger
| 3,532,978 | 16 | 29 | 93,863 | 0 |
python,regex
|
full string: ^[0-9]{5}$
within a string: [^0-9][0-9]{5}[^0-9]
| 0 | 0 | 0 | 0 |
2010-08-20T16:40:00.000
| 7 | 1 | false | 3,532,947 | 1 | 0 | 1 | 3 |
I'm attempting to string match 5-digit coupon codes spread throughout a HTML web page. For example, 53232, 21032, 40021 etc... I can handle the simpler case of any string of 5 digits with [0-9]{5}, though this also matches 6, 7, 8... n digit numbers. Can someone please suggest how I would modify this regular expression to match only 5 digit numbers?
|
Pylons - catching errors before redirect to document/error for logging
| 3,537,529 | 1 | 0 | 316 | 0 |
python,logging,pylons
|
For custom error handling i think you should look at ErrorHandler and StatusCodeRedirect (from pylons.middleware) and maybe make your own class based on them?
| 0 | 0 | 0 | 0 |
2010-08-20T23:30:00.000
| 2 | 0.099668 | false | 3,535,535 | 0 | 0 | 1 | 1 |
I want to log 404 and 500 errors in a pylons app before they redirect to my custom error message (/error/document).
My problem is that since Pylons does the redirect, I am unable to determine the page on which the error occurred inside the error controller. So without building a parser for the paster.log I don't know a good way to selectively log just the few relevant pieces of data I want: url, referring page, and stack trace.
Ideally, I would like to access the page the error occurred on, the referring page, as well as the full stack trace and throw that into a couchdb for some quick and easy reports.
|
Using Cython with Django. Does it make sense?
| 3,539,136 | 25 | 38 | 16,714 | 0 |
python,django,cython
|
Well, yes, but most things a web app does won't really benefit from this sort of change unless you have firm proof that it will. Profile twice, optimize once.
| 0 | 0 | 0 | 0 |
2010-08-21T21:44:00.000
| 6 | 1 | false | 3,539,120 | 0 | 0 | 1 | 3 |
Is it possible to optimize speed of a mission critical application developed in Django with Cython?
Recently I have read on the internet, that Cython can turn a Python code to C like speed. Is this possible with Django?
|
Using Cython with Django. Does it make sense?
| 52,422,538 | 1 | 38 | 16,714 | 0 |
python,django,cython
|
It depends if you have heavy processes on the backend side. In my case it could improve one of the processes and speed it up ~5 times. I had a function that rework large XML files that is inputed by the user and save the output into database. telling Cython that in some places the input or output is string did the 5x speed up magic.
| 0 | 0 | 0 | 0 |
2010-08-21T21:44:00.000
| 6 | 0.033321 | false | 3,539,120 | 0 | 0 | 1 | 3 |
Is it possible to optimize speed of a mission critical application developed in Django with Cython?
Recently I have read on the internet, that Cython can turn a Python code to C like speed. Is this possible with Django?
|
Using Cython with Django. Does it make sense?
| 3,539,374 | 35 | 38 | 16,714 | 0 |
python,django,cython
|
Is it possible to optimize speed of a mission critical application developed in Django with Cython
It's doubtful.
Most of a web application response time is the non-HTML elements that must be downloaded separately. The usual rule of thumb is 8 static files per HTML page. (.CSS, .JS, images, etc.)
Since none of that static content comes from Django, most of your web application's time-line is Apache (or Nginx or some other server software outside Django).
When looking at just the time to produce the HTML, you'll find that most of the time is spent waiting for the database (even if it's in-memory SQLite, you'll see that the database tends to dominate the timeline)
When you're through making Apache and the database go fast, then -- and only then -- you can consider the Python elements.
Bottom Line. Don't waste any of your time on making Django and Python go faster.
| 0 | 0 | 0 | 0 |
2010-08-21T21:44:00.000
| 6 | 1.2 | true | 3,539,120 | 0 | 0 | 1 | 3 |
Is it possible to optimize speed of a mission critical application developed in Django with Cython?
Recently I have read on the internet, that Cython can turn a Python code to C like speed. Is this possible with Django?
|
Is it possible to run linux on hand-held tablets?
| 3,541,193 | 0 | 3 | 395 | 0 |
python,android,django
|
Do you want it to run on a tablet or a hand-held device? Are netbooks okay?
There are plenty netbooks that run Ubuntu, on which you should be able to run python. I also remember that the sharp zaurus handheld devices were able to run Zope for example (be it very, very slowly)
In general, smaller, embedded systems (i.e. pandora) run versions of OpenWRT that use ipkg, and I think there are django packages for OpenWRT, so that may be an option as well.
| 0 | 1 | 0 | 0 |
2010-08-22T08:53:00.000
| 2 | 0 | false | 3,540,805 | 0 | 0 | 1 | 1 |
I want to run a django app on a hand-held device. It'll need to run Python (obviously) and will write its data to an SQLite database.
Are there any tablets available that will let me do this? Specifically, if I bought an Android tablet, would I have to/be able to install linux instead, or would I be able to run it under Android?
|
Django and FeinCMS: A way to use the Media Library in other normal models?
| 3,777,528 | 1 | 6 | 717 | 0 |
python,django,content-management-system,django-admin,feincms
|
Sure -- there's nothing stopping you from adding a ForeignKey or a ManyToManyField to the MediaFile model to one of your own models. Note that you'll have a hard time limiting the media files to only images. Maybe limit_choices_to will help though.
| 0 | 0 | 0 | 0 |
2010-08-22T18:22:00.000
| 1 | 0.197375 | false | 3,542,723 | 0 | 0 | 1 | 1 |
I'm using Django and FeinCMS on a project. I'm currently using FeinCMS for all the pages on the site. But I also have another separate model that handles very simple stock for the site too. This stock model has the usual fields (name, description, etc) but I also want it to have photos.
Because FeinCMS has a media library already, I would like to technically use that to have the photos with my stock model. I could just normally do a Photo model and ManyToManyField that, but I'm curious to know if I can ManyToManyField with the FeinCMS media library?
I know with FeinCMS you can use the item editor on any other model, but I'm not sure that's the right way to go about it. If it's the only way to do this, then that will have to be it.
Many thanks
|
What encoding do normal python strings use?
| 3,548,031 | 32 | 18 | 18,945 | 0 |
python,encoding
|
In Python 2: Normal strings (Python 2.x str) don't have an encoding: they are raw data.
In Python 3: These are called "bytes" which is an accurate description, as they are simply sequences of bytes, which can be text encoded in any encoding (several are common!) or non-textual data altogether.
For representing text, you want unicode strings, not byte strings. By "unicode strings", I mean unicode instances in Python 2 and str instances in Python 3. Unicode strings are sequences of unicode codepoints represented abstractly without an encoding; this is well-suited for representing text.
Bytestrings are important because to represent data for transmission over a network or writing to a file or whatever, you cannot have an abstract representation of unicode, you need a concrete representation of bytes. Though they are often used to store and represent text, this is at least a little naughty.
This whole situation is complicated by the fact that while you should turn unicode into bytes by calling encode and turn bytes into unicode using decode, Python will try to do this automagically for you using a global encoding you can set that is by default ASCII, which is the safest choice. Never depend on this for your code and never ever change this to a more flexible encoding--explicitly decode when you get a bytestring and encode if you need to send a string somewhere external.
| 0 | 0 | 0 | 0 |
2010-08-23T12:33:00.000
| 6 | 1 | false | 3,547,534 | 1 | 0 | 1 | 4 |
i know that django uses unicode strings all over the framework instead of normal python strings. what encoding are normal python strings use ? and why don't they use unicode?
|
What encoding do normal python strings use?
| 3,547,580 | 1 | 18 | 18,945 | 0 |
python,encoding
|
Python 2.x strings are 8-bit, nothing more. The encoding may vary (though ASCII is assumed). I guess the reasons are historical. Few languages, especially languages that date back to the last century, use unicode right away.
In Python 3, all strings are unicode.
| 0 | 0 | 0 | 0 |
2010-08-23T12:33:00.000
| 6 | 0.033321 | false | 3,547,534 | 1 | 0 | 1 | 4 |
i know that django uses unicode strings all over the framework instead of normal python strings. what encoding are normal python strings use ? and why don't they use unicode?
|
What encoding do normal python strings use?
| 3,552,681 | 4 | 18 | 18,945 | 0 |
python,encoding
|
what encoding are normal python
strings use?
In Python 3.x
str is Unicode. This may be either UTF-16 or UTF-32 depending on whether your Python interpreter was built with "narrow" or "wide" Unicode characters.
The Windows version of CPython uses UTF-16. On Unix-like systems, UTF-32 tends to be preferred.
In Python 2.x
str is a byte string type like C char. The encoding isn't defined by the language, but is whatever your locale's default encoding is. Or whatever the MIME charset of the document you got off the Internet is. Or, if you get a string from a function like struct.pack, it's binary data, and doesn't meaningfully have a character encoding at all.
unicode strings in 2.x are equivalent to str in 3.x.
and why don't they use unicode?
Because Python (slightly) predates Unicode. And because Guido wanted to save all the major backwards-incompatible changes for 3.0. Strings in 3.x do use Unicode by default.
| 0 | 0 | 0 | 0 |
2010-08-23T12:33:00.000
| 6 | 0.132549 | false | 3,547,534 | 1 | 0 | 1 | 4 |
i know that django uses unicode strings all over the framework instead of normal python strings. what encoding are normal python strings use ? and why don't they use unicode?
|
What encoding do normal python strings use?
| 3,547,565 | -2 | 18 | 18,945 | 0 |
python,encoding
|
Before Python 3.0, string encoding was ascii by default, but could be changed. Unicode string literals were u"...". This was silly.
| 0 | 0 | 0 | 0 |
2010-08-23T12:33:00.000
| 6 | -0.066568 | false | 3,547,534 | 1 | 0 | 1 | 4 |
i know that django uses unicode strings all over the framework instead of normal python strings. what encoding are normal python strings use ? and why don't they use unicode?
|
Django ForeignKey which does not require referential integrity?
| 3,829,427 | 3 | 12 | 7,485 | 0 |
python,django,django-models,foreign-keys
|
This is probably as simple as declaring a ForeignKey and creating the column without actually declaring it as a FOREIGN KEY. That way, you'll get o.obj_id, o.obj will work if the object exists, and--I think--raise an exception if you try to load an object that doesn't actually exist (probably DoesNotExist).
However, I don't think there's any way to make syncdb do this for you. I found syncdb to be limiting to the point of being useless, so I bypass it entirely and create the schema with my own code. You can use syncdb to create the database, then alter the table directly, eg. ALTER TABLE tablename DROP CONSTRAINT fk_constraint_name.
You also inherently lose ON DELETE CASCADE and all referential integrity checking, of course.
| 0 | 0 | 0 | 0 |
2010-08-24T16:54:00.000
| 6 | 0.099668 | false | 3,558,907 | 0 | 0 | 1 | 2 |
I'd like to set up a ForeignKey field in a django model which points to another table some of the time. But I want it to be okay to insert an id into this field which refers to an entry in the other table which might not be there. So if the row exists in the other table, I'd like to get all the benefits of the ForeignKey relationship. But if not, I'd like this treated as just a number.
Is this possible? Is this what Generic relations are for?
|
Django ForeignKey which does not require referential integrity?
| 62,528,120 | -2 | 12 | 7,485 | 0 |
python,django,django-models,foreign-keys
|
tablename= columnname.ForeignKey('table', null=True, blank=True, db_constraint=False)
use this in your program
| 0 | 0 | 0 | 0 |
2010-08-24T16:54:00.000
| 6 | -0.066568 | false | 3,558,907 | 0 | 0 | 1 | 2 |
I'd like to set up a ForeignKey field in a django model which points to another table some of the time. But I want it to be okay to insert an id into this field which refers to an entry in the other table which might not be there. So if the row exists in the other table, I'd like to get all the benefits of the ForeignKey relationship. But if not, I'd like this treated as just a number.
Is this possible? Is this what Generic relations are for?
|
Is there no mysql connector for python 2.7 on windows
| 58,359,370 | 1 | 1 | 2,224 | 1 |
mysql,python-2.7
|
For Python 2.7 on specific programs:
sudo chown -R $USER /Library/Python/2.7
brew install [email protected]
brew install mysql-connector-c
brew link --overwrite [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
sed -i -e 's/libs="$libs -l "/libs="$libs -lmysqlclient -lssl -lcrypto"/g' /usr/local/bin/mysql_config
pip install MySql-python
This solved all issues I was having running a program that ran on Python 2.7 on and older version of MySql
| 0 | 0 | 0 | 0 |
2010-08-25T02:15:00.000
| 3 | 0.066568 | false | 3,562,406 | 0 | 0 | 1 | 1 |
While I see a bunch of links/binaries for mysql connector for python 2.6, I don't see one for 2.7
To use django, should I just revert to 2.6 or is there a way out ?
I'm using windows 7 64bit
django - 1.1
Mysql 5.1.50
Any pointers would be great.
|
How to check if DataStore Indexes are being served on AppEngine?
| 3,562,948 | 2 | 1 | 244 | 0 |
python,google-app-engine
|
Attempt to perform a query that requires that index. If it raises a NeedIndexError, it's not uploaded or not yet serving.
| 0 | 1 | 0 | 0 |
2010-08-25T02:32:00.000
| 2 | 1.2 | true | 3,562,466 | 0 | 0 | 1 | 1 |
How can I check if datastore Indexes as defined in index.yaml are serving in the python code?
I am using Python 1.3.6 AppEngine SDK.
|
URL encoding/decoding with Python
| 3,563,366 | 2 | 48 | 83,104 | 0 |
python,url-encoding
|
You are out of your luck with stdlib, urllib.quote doesn't work with unicode. If you are using django you can use django.utils.http.urlquote which works properly with unicode
| 0 | 0 | 1 | 0 |
2010-08-25T05:42:00.000
| 3 | 0.132549 | false | 3,563,126 | 0 | 0 | 1 | 1 |
I am trying to encode and store, and decode arguments in Python and getting lost somewhere along the way. Here are my steps:
1) I use google toolkit's gtm_stringByEscapingForURLArgument to convert an NSString properly for passing into HTTP arguments.
2) On my server (python), I store these string arguments as something like u'1234567890-/:;()$&@".,?!\'[]{}#%^*+=_\\|~<>\u20ac\xa3\xa5\u2022.,?!\'' (note that these are the standard keys on an iphone keypad in the "123" view and the "#+=" view, the \u and \x chars in there being some monetary prefixes like pound, yen, etc)
3) I call urllib.quote(myString,'') on that stored value, presumably to %-escape them for transport to the client so the client can unpercent escape them.
The result is that I am getting an exception when I try to log the result of % escaping. Is there some crucial step I am overlooking that needs to be applied to the stored value with the \u and \x format in order to properly convert it for sending over http?
Update: The suggestion marked as the answer below worked for me. I am providing some updates to address the comments below to be complete, though.
The exception I received cited an issue with \u20ac. I don't know if it was a problem with that specifically, rather than the fact that it was the first unicode character in the string.
That \u20ac char is the unicode for the 'euro' symbol. I basically found I'd have issues with it unless I used the urllib2 quote method.
|
Crash in development server clears datastore?
| 3,570,139 | 0 | 0 | 61 | 0 |
python,google-app-engine
|
The GAE development data store is only functionally equivalent to the production data store. It's really just a file (or set of files) on your local disk simulating BigTable. So if you abort it in the middle of doing something important, it could end up in an inconsistent state.
If you're concerned about this, you can easily back up your local data store and restore it if this happens.
| 0 | 1 | 0 | 0 |
2010-08-25T20:53:00.000
| 2 | 0 | false | 3,570,111 | 0 | 0 | 1 | 1 |
I'm testing my app with the development server.
When I manually interrupt a request, it sometimes clears the datastore.
This clears even models that are not modified by my request, like users, etc.
Any idea why is this?
Thanks
|
Selenium with Python, how do I get the page output after running a script?
| 3,573,288 | 2 | 3 | 4,318 | 0 |
python,selenium,browser-automation
|
There's a Selenium.getHtmlSource() method in Java, most likely it is also available in Python. It returns the source of the current page as string, so you can do whatever you want with it
| 0 | 0 | 1 | 0 |
2010-08-26T00:22:00.000
| 3 | 1.2 | true | 3,571,233 | 0 | 0 | 1 | 1 |
I'm not sure how to find this information, I have found a few tutorials so far about using Python with selenium but none have so much as touched on this.. I am able to run some basic test scripts through python that automate selenium but it just shows the browser window for a few seconds and then closes it.. I need to get the browser output into a string / variable (ideally) or at least save it to a file so that python can do other things on it (parse it, etc).. I would appreciate if anyone can point me towards resources on how to do this. Thanks
|
I can`t decide what to select: ASP.NET MVC 2 (C#) or Django (Python)?
| 3,578,887 | 1 | 0 | 362 | 0 |
c#,python,django,asp.net-mvc-2
|
I would create a small app to try each for a day or two and then choose.
I can't speak for Django, but here are some Asp.Net MVC benefits
Tight integration with other Microsoft technologies
Uses jquery out of the box
Choice of several server-side languages
Very flexible (choice of unit test framework, view engine, model architecture etc)
and a potential negative
Might take extra work getting it running on anything other than Windows
| 0 | 0 | 0 | 0 |
2010-08-26T19:33:00.000
| 4 | 0.049958 | false | 3,578,822 | 0 | 0 | 1 | 4 |
I`m learning programming languages. And I decide that I need to lear a new web framework. I have 2 candidates: Django or ASP.NET MVC 2.
Can you say me the difference between them and what is so interesting?
|
I can`t decide what to select: ASP.NET MVC 2 (C#) or Django (Python)?
| 3,578,857 | 4 | 0 | 362 | 0 |
c#,python,django,asp.net-mvc-2
|
Try both, then decide.
| 0 | 0 | 0 | 0 |
2010-08-26T19:33:00.000
| 4 | 1.2 | true | 3,578,822 | 0 | 0 | 1 | 4 |
I`m learning programming languages. And I decide that I need to lear a new web framework. I have 2 candidates: Django or ASP.NET MVC 2.
Can you say me the difference between them and what is so interesting?
|
I can`t decide what to select: ASP.NET MVC 2 (C#) or Django (Python)?
| 3,579,129 | 1 | 0 | 362 | 0 |
c#,python,django,asp.net-mvc-2
|
What reasons lead you to choose those
two frameworks?
What reasons lead you to choose those
two languages?
If you don't like the answers, then keep looking. Otherwise...
Do you want to be on a
non-Microsoft web stack? Go Django.
Do you want to interface with lots of other
Microsoft web stack technologies? Go
MVC.
Do you want complied language speed? Go C#.
Do you want interpreted language portability? Go Python.
| 0 | 0 | 0 | 0 |
2010-08-26T19:33:00.000
| 4 | 0.049958 | false | 3,578,822 | 0 | 0 | 1 | 4 |
I`m learning programming languages. And I decide that I need to lear a new web framework. I have 2 candidates: Django or ASP.NET MVC 2.
Can you say me the difference between them and what is so interesting?
|
I can`t decide what to select: ASP.NET MVC 2 (C#) or Django (Python)?
| 3,578,889 | 2 | 0 | 362 | 0 |
c#,python,django,asp.net-mvc-2
|
Well, I'm using both and found both to be state of the art, easy to learn, fast and easy to install.
Maybe don't look at it from a technical standpoint but from the context. ASP.NET needs a Windows Server, ASP.NET and an IIS installed. You have the license for that? Django on the other hand is open source runs on cheap but fast linux machines and provides you with the Python Language and it's vast easy to install moduls.
If you don't know Python or C# maybe Django is the better way to go. Djangos Documentation is great and has a great tutorial, which is yet to be found on the ASP.NET MVC side.
Well, the conclusion is: Try both :) And if you're gonna use ASP.NET MVC, watch the Nerddinner Sessions (PDC) by Scott Hanselman and Phil Haack.
| 0 | 0 | 0 | 0 |
2010-08-26T19:33:00.000
| 4 | 0.099668 | false | 3,578,822 | 0 | 0 | 1 | 4 |
I`m learning programming languages. And I decide that I need to lear a new web framework. I have 2 candidates: Django or ASP.NET MVC 2.
Can you say me the difference between them and what is so interesting?
|
How do you create a video file upload form with Django?
| 3,583,993 | 0 | 1 | 3,028 | 0 |
python,django,forms,video,file-upload
|
Additionaly have a look at jquery uploadify. It's pretty useful for large file uploads because it display the progress of the download.
| 0 | 0 | 0 | 0 |
2010-08-27T01:45:00.000
| 3 | 0 | false | 3,580,778 | 0 | 0 | 1 | 1 |
I want a user to be able to upload a video from their computer or record it right from their webcam, then fill out other information with a form. I'm writing this app with Django.
|
Programmatically managing a 'balance' of time (sick/vacation)
| 3,585,722 | 2 | 3 | 1,331 | 0 |
python,django,database-design,date,time
|
If you think your solution is complicated, it's not. Modeling sick/vacation days as accounts that are linked to employees is a very good idea and can be dead easy.
In the simplest case, you can have a "transactions" table, and a "account" table, such that re-running all the transactions from the beginning of the year (for each account) will yield a sum that exactly matches the balance.
Transactions
ID | Account | Delta | Timestamp
Account
ID | Name | Employee | Year | Balance
The transactions provide an audit trail, and the balance provides a point of reference for your next transaction. By ensuring the two match, you've ensured consistency (though, not necessarily correctness - that's got to be checked with unit tests on each type of transaction, i.e. deposit, withdrawal)
I'd recommend a "Transaction Detail" table that refers to the Transactions.ID, and includes all the nice stuff you want like who initiated it, notes, etc.
| 0 | 0 | 0 | 0 |
2010-08-27T14:57:00.000
| 4 | 1.2 | true | 3,585,428 | 0 | 0 | 1 | 3 |
I'm using Python/Django, but this is more about the "data model" and how I interact with the information - I really just want to know if I'm crazy here.
I'm working on a small app at my company (~55 employees) that will keep track of available Vacation/Sick time. Part of the purpose is to integrate "self-service" into our intranet, so that employees can submit "Time Off Requests" electronically, instead of filling out and handing in paper to HR.
Obviously, this app needs to keep a running balance per employee, and will be validating that the employee has enough Vacation remaining for whatever they're requesting.
Like with financial/accounting software, I know that I shouldn't necessarily be storing float values, or just keeping a single running balance.
My idea is to use a database table structure like the following to store time "credits" and "debits":
Employee | Year | Credit/Debit | Amount | Timestamp
'Year' would be the year to which the credit/debit belong, because Vacation and Sick time are handled on a yearly basis, not on a running balance per employee.
To determine the employees available Vacation/Sick time, I would get the 'transactions' for the employee for the given year, and find the balance.
I know I'm leaving out lots of information, but I was wondering: Does this seem like a reasonable way to go about this, being as that it needs to be very accurate, or am I completely over-complicating this?
|
Programmatically managing a 'balance' of time (sick/vacation)
| 3,585,669 | 0 | 3 | 1,331 | 0 |
python,django,database-design,date,time
|
I also agree it's a good start.
I don't see any fields for approval / disapproval. If this app is meant to be used also by HR, then their decisions need to be expressed in your model as well.
If HR is being taken out of the picture (which I doubt, but maybe) then there's no need to do this; the app can keep track of requests and the leave balance and say immediately whether the request is valid or not. But I suspect it can't be this simple. :)
| 0 | 0 | 0 | 0 |
2010-08-27T14:57:00.000
| 4 | 0 | false | 3,585,428 | 0 | 0 | 1 | 3 |
I'm using Python/Django, but this is more about the "data model" and how I interact with the information - I really just want to know if I'm crazy here.
I'm working on a small app at my company (~55 employees) that will keep track of available Vacation/Sick time. Part of the purpose is to integrate "self-service" into our intranet, so that employees can submit "Time Off Requests" electronically, instead of filling out and handing in paper to HR.
Obviously, this app needs to keep a running balance per employee, and will be validating that the employee has enough Vacation remaining for whatever they're requesting.
Like with financial/accounting software, I know that I shouldn't necessarily be storing float values, or just keeping a single running balance.
My idea is to use a database table structure like the following to store time "credits" and "debits":
Employee | Year | Credit/Debit | Amount | Timestamp
'Year' would be the year to which the credit/debit belong, because Vacation and Sick time are handled on a yearly basis, not on a running balance per employee.
To determine the employees available Vacation/Sick time, I would get the 'transactions' for the employee for the given year, and find the balance.
I know I'm leaving out lots of information, but I was wondering: Does this seem like a reasonable way to go about this, being as that it needs to be very accurate, or am I completely over-complicating this?
|
Programmatically managing a 'balance' of time (sick/vacation)
| 3,585,570 | 0 | 3 | 1,331 | 0 |
python,django,database-design,date,time
|
This looks like a good start. A couple of points:
The credits would be autogenerated by the system at the begining of the year, and debits would be created by employees. Should there be a field to indicate who/what created the transaction?
Do you have a mechanism for indicating what kind of time off is requested? I don't know what your company is like but some companies treat vacation and sick time differently. Then there's also caregiver time, time off for compassion grounds (such as a relative dies), time off for civic and statutory holidays, time off for religions holidays, time off for.... well you get the idea. Maybe you want different types of time off to be worth different amounts of credit. Some organizations do that. Do you plan to track these different time-off codes as well? Is it something that you should plan for if you think it will be an issue in the future?
| 0 | 0 | 0 | 0 |
2010-08-27T14:57:00.000
| 4 | 0 | false | 3,585,428 | 0 | 0 | 1 | 3 |
I'm using Python/Django, but this is more about the "data model" and how I interact with the information - I really just want to know if I'm crazy here.
I'm working on a small app at my company (~55 employees) that will keep track of available Vacation/Sick time. Part of the purpose is to integrate "self-service" into our intranet, so that employees can submit "Time Off Requests" electronically, instead of filling out and handing in paper to HR.
Obviously, this app needs to keep a running balance per employee, and will be validating that the employee has enough Vacation remaining for whatever they're requesting.
Like with financial/accounting software, I know that I shouldn't necessarily be storing float values, or just keeping a single running balance.
My idea is to use a database table structure like the following to store time "credits" and "debits":
Employee | Year | Credit/Debit | Amount | Timestamp
'Year' would be the year to which the credit/debit belong, because Vacation and Sick time are handled on a yearly basis, not on a running balance per employee.
To determine the employees available Vacation/Sick time, I would get the 'transactions' for the employee for the given year, and find the balance.
I know I'm leaving out lots of information, but I was wondering: Does this seem like a reasonable way to go about this, being as that it needs to be very accurate, or am I completely over-complicating this?
|
Where is my local App Engine datastore?
| 42,148,664 | 0 | 11 | 11,200 | 0 |
python,google-app-engine,google-cloud-datastore
|
I'll restate a solution to getting permanent datastore as it worked for me (circa Feb 2017), running GoogleAppEngineLauncher on OS X v10.10.
Create the folder path for permanent datastore
In GAEL, click on the project in question e.g. PROJECTNAME
Click Edit-Application Settings
in Extra Flags field:
--datastore_path=/Users/foo/GAE_datastore/PROJECTNAME/datastore.db
Filename has to be included; in my config, datastore.db works.
Having searched all over for GAE datastore path, and head-bonked on dev_appserver.py --datastore_path command line, it was very helpful to find this.
Application Settings under the Edit menu is an odd choice, Google :-)
| 0 | 1 | 0 | 0 |
2010-08-27T23:49:00.000
| 10 | 0 | false | 3,588,817 | 0 | 0 | 1 | 5 |
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
|
Where is my local App Engine datastore?
| 4,180,525 | 6 | 11 | 11,200 | 0 |
python,google-app-engine,google-cloud-datastore
|
To find the file location for the local AppEngine datastore on MacOSX/Python, you can run the following command:
dev_appserver.py -help
Mine was at something like:
/var/folders/uP/uP1GHkGKGqO7QPq+eGMmb++++TI/-Tmp-/dev_appserver.datastore
| 0 | 1 | 0 | 0 |
2010-08-27T23:49:00.000
| 10 | 1 | false | 3,588,817 | 0 | 0 | 1 | 5 |
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
|
Where is my local App Engine datastore?
| 57,534,409 | 0 | 11 | 11,200 | 0 |
python,google-app-engine,google-cloud-datastore
|
The default location of the datastore for the platform you're running the app engine on is provided in the README that comes with the platform (at least, in the one for Linux). The README is in google_appengine_x.x.xx/google_appengine/README. This is what is says in the Linux'es one:
--datastore_path=DS_FILE Path to file to use for storing Datastore file
stub data.
(Default /tmp/dev_appserver.datastore)
| 0 | 1 | 0 | 0 |
2010-08-27T23:49:00.000
| 10 | 0 | false | 3,588,817 | 0 | 0 | 1 | 5 |
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
|
Where is my local App Engine datastore?
| 8,814,627 | 2 | 11 | 11,200 | 0 |
python,google-app-engine,google-cloud-datastore
|
Since it's top question on Google search and I spent quite amount of time searching for an answer I'll say that on Windows/Java mix DB file called local_db.bin.
| 0 | 1 | 0 | 0 |
2010-08-27T23:49:00.000
| 10 | 0.039979 | false | 3,588,817 | 0 | 0 | 1 | 5 |
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
|
Where is my local App Engine datastore?
| 23,270,307 | 4 | 11 | 11,200 | 0 |
python,google-app-engine,google-cloud-datastore
|
I use OS X Mavericks (10.9), Python 2.7.5, and Google App Engine SDK 1.9.3 (Python).
None of the above worked for me, however, referencing @alsmola's answer, I executed sudo find / | grep datastore.db and found the file in /private/var/folders/vw/7w1zhkls4gb1wd8r160c36300000gn/T/appengine.YYYY.XXXXX/datastore.db (YYYY is the project name, XXXXX is my username).
| 0 | 1 | 0 | 0 |
2010-08-27T23:49:00.000
| 10 | 0.07983 | false | 3,588,817 | 0 | 0 | 1 | 5 |
How can I find where my local development datastore is located? I am using the Python SDK and Linux.
|
Bind arbitrary Python objects to CherryPy sessions
| 3,591,183 | 1 | 0 | 751 | 0 |
python,multithreading,session,cherrypy,asynchronous
|
You can create your own session type, derived from CherryPy's base session. Use its clean_up method to do your cleanup.
Look at cherrypy/lib/sessions.py for details and sample session implementations.
| 0 | 0 | 0 | 0 |
2010-08-28T14:10:00.000
| 1 | 1.2 | true | 3,591,020 | 1 | 0 | 1 | 1 |
I'm using CherryPy to make a web-based frontend for SymPy that uses an asynchronous process library on the server side to allow for processing multiple requests at once without waiting for each one to complete. So as to allow for the frontend to function as expected, I am using one process for the entirety of each session. The client-side Javascript sends the session-id from the cookie to the server when the user submits a request, and the server-side currently uses a pair of lists, storing instances of a controller class in one and the corresponding session-id's in another, creating a new interpreter proxy and sending the input if a non-existant session-id is submitted. The only problem with this is that the proxy classes are not deleted upon the expiration of their corresponding sessions. Also, I can't see anything to retrieve the session-id for which the current request is being served.
My questions about all this are: is there any way to "connect" an arbitrary object to a CherryPy session so that it gets deleted upon session expiration, is there something I am overlooking here that would greatly simplify things, and does CherryPy's multi-threading negate the problem of synchronous reading of the stdout filehandle from the child process?
|
Does MongoDB have a Ruby Shell or Python Shell in addition to the Javascript shell?
| 3,597,947 | 1 | 1 | 472 | 0 |
python,ruby,mongodb,nosql
|
Your idea is fundamentally correct. I mean, as long as the language can handle command-line interpretation and support a MongoDB driver, then you could theoretically build a new MongoDB shell.
However, I regularly read through the MongoDB mailing lists and I think that you're kind of on your own for this idea right now. Hey, writing a Ruby shell for Mongo would be an awesome way to learn a lot about Mongo. However, the current Mongo community is still relatively small and no one is really complaining too much about the javascript shell.
| 0 | 0 | 0 | 0 |
2010-08-29T18:07:00.000
| 2 | 0.099668 | false | 3,595,948 | 1 | 0 | 1 | 1 |
Or, does using Ruby's irb and then require 'mongo' and adding some Connect
statement essentially act like a Ruby shell... it would be great if a
Ruby shell can be possible which as convenient as the Javascript
Shell.
|
PHP style inline tags for Python?
| 3,597,157 | 4 | 3 | 1,597 | 0 |
python,web-applications
|
There are a few php style python options out there. Mod_python used to ship with one, and spyce had an alternate implementation, but that modality is out of favor with pythonistas. Instead, use a templating language. Genshi and jinja2 are both popular, but there are lots to choose from.
Since you are new to web programming with python, you would probably be best off choosing an entire framework get started. Django, turbogears, and cherrypy are a few to check out. These frameworks will all include all the tools you need to make a modern website, including a templating language.
| 0 | 0 | 0 | 1 |
2010-08-30T00:19:00.000
| 4 | 0.197375 | false | 3,597,143 | 0 | 0 | 1 | 1 |
I'm just starting out learning python (for webapp usage) but I'm confused as to the best way for using it with html files and dynamic data.
I know php has the <?php ?> tags which are great - does python have something like this or equivalent, if not how should I be doing it?
|
google-app-engine-django loading fixtures
| 3,605,268 | 1 | 1 | 312 | 0 |
python,django,google-app-engine,fixtures,django-fixtures
|
Turns out the issue was caused because I wasn't declaring my model correctly in models.py
When using google-app-engine-django, each model should be a subclass of:
appengine_django.db.BaseModel
after fixing this, it works. I also needed to put a valid pk: value in my fixture.
| 0 | 1 | 0 | 0 |
2010-08-30T01:32:00.000
| 1 | 1.2 | true | 3,597,332 | 0 | 0 | 1 | 1 |
I'm having troubles loading fixtures on GAE with google-app-engine-django. I receive an error that says "DeserializationError: Invalid model identifier: 'fcl.User'"
./manage.py loaddata users
I'm trying to load a fixture that has the following data:
- model: fcl.User
fields:
firstname: test
lastname: testerson
email: [email protected]
user_id: '981167207188616462253'
status: active
usertype: player
creationtime: '2010-08-29 00:00:00'
do I need to do any other qualifying of my model name? The fixture lives at fcl/fixtures/users.yaml and model lives in at 'fcl/models.py'.
Any help would be greatly appreciated.
|
django-admin.py launches IDE
| 3,597,670 | 3 | 0 | 193 | 0 |
python,django,django-admin
|
It sounds like you associated .py files with Komodo Edit instead of with python.exe. The simplest workaround is to type "python django-admin.py ..." to execute the admin.
You can look in your Explorer options to change the association. There's a right-click menu option I think called "Open With..." that will let you change it.
| 0 | 0 | 0 | 0 |
2010-08-30T03:21:00.000
| 1 | 1.2 | true | 3,597,665 | 0 | 0 | 1 | 1 |
I just went to create a new django project and I typed django-admin.py startproject my_project into the command prompt and it opened the django-admin.py file in my ide (komodo edit).
This happens every time I run this command in any form, even if I just try django-admin.py. Any ideas what's going on and how I fix it?
I'm on Win Xp with django 1.2.1
|
Automatic editor of XML (based on XSD scheme)
| 3,599,767 | 1 | 4 | 4,417 | 0 |
java,python,xml,xsd
|
Funny, I'm concerning myself with something similar. I'm building an editor (not really WYSIWYG, but it abstracts the DOM away) for the XMLs Civilization 4 (strategy game) usesu to store about everything. I thought about it for quite a while and built two prototypes (in Python), one of which looks promising so I will extend it in the future. Note that Civ 4 XMLs are merely more than a buzzword-conform database (just the kind of data you better store in JSON/YAML and the like, mostly key-value pairs with a few sublists of key-value pairs - no recursive data structures).
My first approach was based on the fact that there are mostly key-value pairs, which doesn't fit documents that exploit the full power of XML (recursive data structures, etc). My new design is more sophisticated - up to now, I only built a (still buggy) validator factory this way, but I'm looking forward to extend it, e.g. for schema-sensetive editing widgets. The basic idea is to walk the XSD's DOM, recognize the expected content (a list of other nodes, text of a specific format, etc), build in turn (recursively) validators for these, and then build a higher-order validator that applies all the previously generated validators in the right order. It propably takes some exposure to functional programming to get comfortable with the idea. For the editing part (btw, I use PyQt), I plan to generate a Label-LineEdit pair for tags which contain text and a heading (Label) for tags that contain other elements, possibly indenting the subelements and/or providing folding. Again, recursion is the key to build these.
Qt allows us to attach a validator to an text input widget, so this part is easy once we can generate a validator for e.g. a tag containing an "int". For tags containing other tags, something similar to the above is possible: Generate a validator for each subelement and chain them. The only part that needs to change is how we get the content. Ignoring comments, attributes, processing instructions, etc, this should still be relatively simple - for a "tag: content" pair, generate "content" and feed it to your DOM parser; for elements with subelements, generate a representation of the children and put it between "...". Attributes could be implemented as key-value pairs too, only with an extra flag.
| 0 | 0 | 1 | 0 |
2010-08-30T10:33:00.000
| 3 | 0.066568 | false | 3,599,569 | 0 | 0 | 1 | 1 |
Is there any approach to generate editor of an XML file basing on an XSD scheme? (It should be a Java or Python web based editor).
|
Google App Engine self.redirect() POST method
| 40,599,400 | 0 | 4 | 5,118 | 0 |
python,google-app-engine
|
You can pass parameters. Here is an example:
Let's say you have a main page and you want to POST to '/success'. Usually, you may use this way:
self.redirect('/sucess')
But if you want to pass some parameters from the main page to /success page, like username for example, you can modify the code to this:
self.redirect('/sucess?username=' + username)
In this way, you successfully passed the username value into the URL. In /success page, you can read and store the value by using this:
username = self.request.get('username')
At last, you can make you favorite information onto the /success page by using this simple code:
self.response.out.write('You\'ve succeeded, ' + username + '!')
But, it's of course not a safe way to pass password. I wish it helps.
| 0 | 1 | 0 | 0 |
2010-08-30T12:01:00.000
| 3 | 0 | false | 3,600,101 | 0 | 0 | 1 | 1 |
In GAE (Python), using the webApp Framework, calling self.redirect('some_url') redirects the user to that URL via the GET method. Is it possible to do a (redirect) via the POST method with some parameters as well?
If possible, how?
Thanks!
|
Can python's mechanize use localhost sites?
| 3,603,922 | 0 | 0 | 257 | 0 |
python,mechanize
|
Yes. It can use any URL available so long as it is reachable. Just make sure it's properly formatted!
| 0 | 1 | 0 | 1 |
2010-08-30T20:12:00.000
| 2 | 1.2 | true | 3,603,883 | 0 | 0 | 1 | 1 |
Can Mechanize access sites being locally hosted by Apache?
|
if you don't use scaffolding, is ruby on rails still good for rapid development?
| 3,604,329 | 4 | 5 | 396 | 0 |
python,ruby-on-rails,django
|
I have never seen Rails scaffold-generated view code used in a production app. The chances that it's going to create the look that you want is nearly zero. I use the generators for models and controllers all the time, as they are very useful.
To your question of frameworks:
If you know Python better, use Django.
If you know Ruby better, use Rails.
If this is a hobby site, use whichever one interests you the most.
| 0 | 0 | 0 | 0 |
2010-08-30T21:02:00.000
| 3 | 1.2 | true | 3,604,205 | 0 | 0 | 1 | 2 |
If you take out the scaffolding feature where it creates the model/controller, and CRUD pages for you, is ruby on rails still any faster to market than say, django?
It seems very similiar to be if you take away that step...(even though I believe django has similar auto-gen capabilities)
I am reading the starting guide on the rails site, and when it introduces the scaffolding feature, it says that many people prefer to hand code these types of areas.
|
if you don't use scaffolding, is ruby on rails still good for rapid development?
| 3,604,384 | 1 | 5 | 396 | 0 |
python,ruby-on-rails,django
|
Scaffolding is just a demo and learning feature. It's not intended for use in real site development. It's certainly not Rails' primary strength.
| 0 | 0 | 0 | 0 |
2010-08-30T21:02:00.000
| 3 | 0.066568 | false | 3,604,205 | 0 | 0 | 1 | 2 |
If you take out the scaffolding feature where it creates the model/controller, and CRUD pages for you, is ruby on rails still any faster to market than say, django?
It seems very similiar to be if you take away that step...(even though I believe django has similar auto-gen capabilities)
I am reading the starting guide on the rails site, and when it introduces the scaffolding feature, it says that many people prefer to hand code these types of areas.
|
Does django with mongodb make migrations a thing of the past?
| 3,605,615 | 1 | 18 | 5,660 | 1 |
python,django,mongodb
|
What does the migration process look like with a non-relational db?
Depends on if you need to update all the existing data or not.
In many cases, you may not need to touch the old data, such as when adding a new optional field. If that field also has a default value, you may also not need to update the old documents, if your application can handle a missing field correctly. However, if you want to build an index on the new field to be able to search/filter/sort, you need to add the default value back into the old documents.
Something like field renaming (trivial in a relational db, because you only need to update the catalog and not touch any data) is a major undertaking in MongoDB (you need to rewrite all documents).
If you need to update the existing data, you usually have to write a migration function that iterates over all the documents and updates them one by one (although this process can be shared and run in parallel). For large data sets, this can take a lot of time (and space), and you may miss transactions (if you end up with a crashed migration that went half-way through).
| 0 | 0 | 0 | 0 |
2010-08-30T22:01:00.000
| 3 | 0.066568 | false | 3,604,565 | 0 | 0 | 1 | 2 |
Since mongo doesn't have a schema, does that mean that we won't have to do migrations when we change the models?
What does the migration process look like with a non-relational db?
|
Does django with mongodb make migrations a thing of the past?
| 3,604,687 | 2 | 18 | 5,660 | 1 |
python,django,mongodb
|
There is no silver bullet. Adding or removing fields is easier with non-relational db (just don't use unneeded fields or use new fields), renaming a field is easier with traditional db (you'll usually have to change a lot of data in case of field rename in schemaless db), data migration is on par - depending on task.
| 0 | 0 | 0 | 0 |
2010-08-30T22:01:00.000
| 3 | 0.132549 | false | 3,604,565 | 0 | 0 | 1 | 2 |
Since mongo doesn't have a schema, does that mean that we won't have to do migrations when we change the models?
What does the migration process look like with a non-relational db?
|
Is there any python web app framework that provides database abstraction layer for SQL and NoSQL?
| 3,649,176 | 0 | 2 | 1,721 | 1 |
python,sql,database,google-app-engine,nosql
|
Thank you for all the answers. To summarize the answers, currently only web2py and Django supports this kind of abstraction.
It is not about a SQL-NoSQL holy grail, using abstraction can make the apps more flexible. Lets assume that you started a project using NoSQL, and then later on you need to switch over to SQL. It is desirable that you only make changes to the codes in a few spots instead of all over the place. For some cases, it does not really matter whether you store the data in a relational or non-relational db. For example, storing user profiles, text content for dynamic page, or blog entries.
I know there must be a trade off by using the abstraction, but my question is more about the existing solution or technical insight, instead of the consequences.
| 0 | 0 | 0 | 0 |
2010-08-31T05:18:00.000
| 5 | 1.2 | true | 3,606,215 | 0 | 0 | 1 | 3 |
Is it even possible to create an abstraction layer that can accommodate relational and non-relational databases? The purpose of this layer is to minimize repetition and allows a web application to use any kind of database by just changing/modifying the code in one place (ie, the abstraction layer). The part that sits on top of the abstraction layer must not need to worry whether the underlying database is relational (SQL) or non-relational (NoSQL) or whatever new kind of database that may come out later in the future.
|
Is there any python web app framework that provides database abstraction layer for SQL and NoSQL?
| 3,609,648 | 1 | 2 | 1,721 | 1 |
python,sql,database,google-app-engine,nosql
|
Regarding App Engine, all existing attempts limit you in some way (web2py doesn't support transactions or namespaces and probably many other stuff, for example). If you plan to work with GAE, use what GAE provides and forget looking for a SQL-NoSQL holy grail. Existing solutions are inevitably limited and affect performance negatively.
| 0 | 0 | 0 | 0 |
2010-08-31T05:18:00.000
| 5 | 0.039979 | false | 3,606,215 | 0 | 0 | 1 | 3 |
Is it even possible to create an abstraction layer that can accommodate relational and non-relational databases? The purpose of this layer is to minimize repetition and allows a web application to use any kind of database by just changing/modifying the code in one place (ie, the abstraction layer). The part that sits on top of the abstraction layer must not need to worry whether the underlying database is relational (SQL) or non-relational (NoSQL) or whatever new kind of database that may come out later in the future.
|
Is there any python web app framework that provides database abstraction layer for SQL and NoSQL?
| 3,606,610 | 1 | 2 | 1,721 | 1 |
python,sql,database,google-app-engine,nosql
|
Yo may also check web2py, they support relational databases and GAE on the core.
| 0 | 0 | 0 | 0 |
2010-08-31T05:18:00.000
| 5 | 0.039979 | false | 3,606,215 | 0 | 0 | 1 | 3 |
Is it even possible to create an abstraction layer that can accommodate relational and non-relational databases? The purpose of this layer is to minimize repetition and allows a web application to use any kind of database by just changing/modifying the code in one place (ie, the abstraction layer). The part that sits on top of the abstraction layer must not need to worry whether the underlying database is relational (SQL) or non-relational (NoSQL) or whatever new kind of database that may come out later in the future.
|
List query with, facebook friends in list?
| 3,611,807 | 1 | 2 | 442 | 0 |
python,google-app-engine
|
I would suggest the following:
Make 'marked' entities child entities of the users who have marked them.
Use a key name for the 'marked' entity that is based on the URL of the page marked
To find friends who have marked a page, retrieve a list of friends, then generate the list of entity keys from the list of friends (easy, since you know the friend key and the URL), and do a single batch get to retrieve a list of 'mark' entities indicating which friends have marked that page.
| 0 | 1 | 0 | 0 |
2010-08-31T06:59:00.000
| 2 | 0.099668 | false | 3,606,669 | 0 | 0 | 1 | 1 |
In a python based facebook application on GAE, i want to check which friends of current user have "marked" a web page or not.
For this i have to run as many DB queries as the number of friends (say 100)
I fear this may run into "timeout" because of large no of queries.
Google DOCs suggest that "list" queries run in parallel, will this save time ??
Also list has a limit of 30, so i have to make 2 or 3 queries of list type.
Please suggest a better way if possible, using task ques or something....
|
How to edit a StringListProperty value in Google App Engine?
| 3,608,338 | 2 | 0 | 220 | 0 |
python,google-app-engine
|
You need to edit it programmatically. Not all property types can be edited in the data viewer.
| 0 | 1 | 0 | 0 |
2010-08-31T08:12:00.000
| 1 | 1.2 | true | 3,607,201 | 0 | 0 | 1 | 1 |
I would like to edit the value of a StringListProperty variable on App Engine. Is it possible? I don't see any sign of editable field for a StringListProperty variable right inside the DataViewer panel.
|
Django pre_save signal: check if instance is created not updated, does kwargs['created'] (still) exist?
| 32,918,934 | 3 | 31 | 21,951 | 0 |
python,django,keyword-argument
|
Using instance._state.adding is the most logical approach, as you will be able to tell the model state exists or is new, regardless whether the primary key as been assigned or not.
| 0 | 0 | 0 | 0 |
2010-08-31T09:09:00.000
| 5 | 0.119427 | false | 3,607,573 | 0 | 0 | 1 | 2 |
I am using Django's pre_save signal to implement auto_now_add. There is a lot of discussion on the internet on why you should or shouldn't implement it yourself. I do not appreciate comments on this. Neither on whether I should be rewriting the save function (I have a lot of models that use auto_now_add so using signals makes sense).
My question is:
I would like to check if the instance is created or updated. According to some sources on the internet this can be done by testing if kwargs['created'] is True. However 'created' does not appear in my kwargs even though the instance is newly created.
I was just wondering if it has ever existed or that it has disappeared magically.
I know I could also test if kwargs['instance'].id is set (this in fact works for me), but I'd like to know if kwargs['created'] still exists.
|
Django pre_save signal: check if instance is created not updated, does kwargs['created'] (still) exist?
| 12,132,343 | 57 | 31 | 21,951 | 0 |
python,django,keyword-argument
|
Primary key attribute usually assigned by the database when the instance saved first time. So you can use something like if instance.pk is None
| 0 | 0 | 0 | 0 |
2010-08-31T09:09:00.000
| 5 | 1 | false | 3,607,573 | 0 | 0 | 1 | 2 |
I am using Django's pre_save signal to implement auto_now_add. There is a lot of discussion on the internet on why you should or shouldn't implement it yourself. I do not appreciate comments on this. Neither on whether I should be rewriting the save function (I have a lot of models that use auto_now_add so using signals makes sense).
My question is:
I would like to check if the instance is created or updated. According to some sources on the internet this can be done by testing if kwargs['created'] is True. However 'created' does not appear in my kwargs even though the instance is newly created.
I was just wondering if it has ever existed or that it has disappeared magically.
I know I could also test if kwargs['instance'].id is set (this in fact works for me), but I'd like to know if kwargs['created'] still exists.
|
pydev doesn't find python library after installation
| 14,501,729 | 3 | 28 | 12,392 | 0 |
python,eclipse,pydev
|
I've found that closing the project and reopening (after rescanning the interpreter) works for me.
| 0 | 1 | 0 | 0 |
2010-08-31T14:59:00.000
| 4 | 0.148885 | false | 3,610,272 | 1 | 0 | 1 | 4 |
I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install and it got installed in my site-packages directory C:\Python26\Lib\site-packages. I can successfully import it in the python shell with import treebeard. However PyDev complains that it cannot resolve it when I try to import it.
Unfortunately I have no experience with PyDev and I assumed that it would automatically pick up everything in the site-packages directory but apparently it does not. What am I missing?
thanks
|
pydev doesn't find python library after installation
| 3,610,311 | 37 | 28 | 12,392 | 0 |
python,eclipse,pydev
|
Pydev doesn't automatically rescan the site-packages folder. You need to go to Preferences-> Interpreter -> Python and click apply to make it scan again.
| 0 | 1 | 0 | 0 |
2010-08-31T14:59:00.000
| 4 | 1.2 | true | 3,610,272 | 1 | 0 | 1 | 4 |
I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install and it got installed in my site-packages directory C:\Python26\Lib\site-packages. I can successfully import it in the python shell with import treebeard. However PyDev complains that it cannot resolve it when I try to import it.
Unfortunately I have no experience with PyDev and I assumed that it would automatically pick up everything in the site-packages directory but apparently it does not. What am I missing?
thanks
|
pydev doesn't find python library after installation
| 43,832,437 | 0 | 28 | 12,392 | 0 |
python,eclipse,pydev
|
Well, I followed this sequence to make it work:
1) I installed the desired library by using pip install
2) I went in Eclipse to: Window --> Preferences --> Pydev --> Interpreters --> Python Interpreter, and clicked "Quick Auto-Config". It made the trick.
| 0 | 1 | 0 | 0 |
2010-08-31T14:59:00.000
| 4 | 0 | false | 3,610,272 | 1 | 0 | 1 | 4 |
I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install and it got installed in my site-packages directory C:\Python26\Lib\site-packages. I can successfully import it in the python shell with import treebeard. However PyDev complains that it cannot resolve it when I try to import it.
Unfortunately I have no experience with PyDev and I assumed that it would automatically pick up everything in the site-packages directory but apparently it does not. What am I missing?
thanks
|
pydev doesn't find python library after installation
| 6,144,832 | 14 | 28 | 12,392 | 0 |
python,eclipse,pydev
|
I also faced the same error when i had installed a new package.i'm using eclipse Helios.
Even after applying and re scanning the folder it was NOT detecting the new packages. So finally i clicked on the "Click here to configure a interpreter not listed" listed and deleted the already selected interpreter and used the autoconfig to add the interpreter again.
Finally i was able to resolve the issue.
| 0 | 1 | 0 | 0 |
2010-08-31T14:59:00.000
| 4 | 1 | false | 3,610,272 | 1 | 0 | 1 | 4 |
I'm using Django and PyDev/Eclipse. I just installed django-treebeard with setup.py install and it got installed in my site-packages directory C:\Python26\Lib\site-packages. I can successfully import it in the python shell with import treebeard. However PyDev complains that it cannot resolve it when I try to import it.
Unfortunately I have no experience with PyDev and I assumed that it would automatically pick up everything in the site-packages directory but apparently it does not. What am I missing?
thanks
|
Is it possible to memcache a json result in App Engine?
| 3,610,930 | 7 | 2 | 717 | 0 |
python,json,google-app-engine
|
JSON is just text, so yes, you can store it in memcache.
| 0 | 1 | 0 | 0 |
2010-08-31T15:59:00.000
| 1 | 1.2 | true | 3,610,854 | 0 | 0 | 1 | 1 |
I think my question is already clear enough, but to make it even more clear i will illustrate it with my example.
I'm currently returning many json every request, which I would like to cache in some way. I thought memcache would be great, but I only see that they use memcache for caching queries.
|
how do I return all memcached values in Google App Engine?
| 3,611,908 | 0 | 4 | 3,350 | 0 |
python,google-app-engine,memcached,python-memcached
|
as in comments above, I guess I could stick all data in a single memcache entry with a known key.
Still for non-static data there are scenarios where it would be useful.
| 0 | 1 | 0 | 0 |
2010-08-31T17:59:00.000
| 3 | 0 | false | 3,611,830 | 0 | 0 | 1 | 2 |
I want to use all the data in my python app engine memcache. I do not know the keys in advance.
How do I go about getting all data?
|
how do I return all memcached values in Google App Engine?
| 4,524,611 | 1 | 4 | 3,350 | 0 |
python,google-app-engine,memcached,python-memcached
|
I am using a 'well known key' called "config" where I store a list of all other keys and use that to enumerate the rest of the items.
| 0 | 1 | 0 | 0 |
2010-08-31T17:59:00.000
| 3 | 0.066568 | false | 3,611,830 | 0 | 0 | 1 | 2 |
I want to use all the data in my python app engine memcache. I do not know the keys in advance.
How do I go about getting all data?
|
IronPython - What kind of database is useable
| 3,616,111 | 0 | 0 | 495 | 1 |
database,ironpython
|
good
That is highly subjective without far more detailed requirements.
You should be able to use any database with .NET support, whether out of the box (notably SQL Server Express and Compact) or installed separately (SQL Server-other editions, DB2, MySQL, Oracle, ...).
Ten select commands per second should be easily in each of any of the databases above, unless there is some performance issue (e.g. huge amount of data and not able to use an index).
| 0 | 0 | 0 | 0 |
2010-09-01T08:04:00.000
| 2 | 0 | false | 3,616,078 | 0 | 0 | 1 | 1 |
i'm using IronPython 2.6 for .Net4 to build an GUI logging application.
This application received data via serialport and stores these data in an sqlite3 database while showing the last 100 received items in an listview. The listview gathers it's data via an SQL SELECT from the database every 100ms. It only querys data that is not already visible in the listview.
At first, the useage of the sqlite3 module was good and solid but i'm now stuck with several issues that i can't solve.
The sqlite3 module throws after a while exceptions like:
database disk image is malformed
database or disk is full.
These errors occur sporadic and never under high system load.
I stuck with this kind if issues for some weeks now and i'm looking for an alternative way to store binary and ascii data in a database-like object.
Please, does somebody know a good database solution i could use with IronPython 2.6 for .Net4?
Thanks
|
Is it possible to get a list of all versions of an app?
| 3,625,552 | 4 | 1 | 91 | 0 |
python,google-app-engine,version-control
|
No, there's no way to get a list of app versions from inside an app.
| 0 | 1 | 0 | 0 |
2010-09-01T21:07:00.000
| 1 | 1.2 | true | 3,622,165 | 0 | 0 | 1 | 1 |
the title speaks for itself. I play with GAE and some of my apps have versions like (1,2,3,4 and dev). So, is there a way to get all of them, so I could use it in my app to generate links to different versions ?
|
CSS Templating system for Django / Python?
| 3,623,235 | 8 | 6 | 995 | 0 |
python,css,django,dynamic,django-templates
|
The Django templating system can be used for any text you like. It's used for HTML most of the time, but it could also be used to create CSS. The CSS reference in your HTML can be to a dynamic URL instead of to a static file, and the view function can create whatever context you like, then a .css template file can create your CSS.
If you have only a few different CSS possibilities, then you may be better served by creating them as static files, and using the HTML template to select the CSS file you want by writing a different CSS reference depending you your conditions.
| 0 | 0 | 0 | 0 |
2010-09-02T00:36:00.000
| 1 | 1.2 | true | 3,623,070 | 0 | 0 | 1 | 1 |
I'm wondering if there is anything like Django's HTML templating system, for for CSS.. my searches on this aren't turning up anything of use. I am aware of things like SASS and CleverCSS but, as far as I can tell, these still don't solve my issue as I want to dynamically generate a CSS file based on certain conditions, so that a different CSS file would be served based on a specific user session...
I want to minimize the use of javascript / AJAX for some things (since its for a legacy system running in some hospital where they're still using IE 6 ), also I have an interest in possibly minimizing javascript for other projects as well... so it would be where there is 1 CSS file, but that it may need to be changed based on the situation (which would be done with CleverCSS), however the problem is that if I just write the changes to 1 file, then this would be served to everyone, even though they may have a different "state" of the CSS file depending on their use of the application, so I want to remove the physical association of a CSS file and rather have it dynamically generated each time (so that its unique to a specific user's session), the way that Django's HTML templating system works..
|
Is there a way to save a captcha image and view it later in python?
| 3,623,274 | 2 | 0 | 1,432 | 0 |
python,web-applications,firebug,tkinter,urllib2
|
Of course the captcha's served by a page which will serve a new one each time (if it was repeated, then once it was solved for one fake userid, a spammer could automatically make a million!). I think you need some "screenshot" functionality to capture the image you want -- there is no cross-platform way to invoke such functionality, but each platform (or desktop manager in the case of Linux, BSD, etc) tends to have one. Or, you could automate the browser (e.g. via SeleniumRC) to "screenshot" (e.g. "print to PDF") things at the right time. (I believe what you're seeing in firebug may be misleading you because it is "showing a snapshot"... just at the html source or DOM level rather than at a screen/bitmap level).
| 0 | 0 | 1 | 0 |
2010-09-02T00:38:00.000
| 1 | 0.379949 | false | 3,623,077 | 0 | 0 | 1 | 1 |
I am scripting in python for some web automation. I know i can not automate captchas but here is what i want to do:
I want to automate everything i can up to the captcha. When i open the page (usuing urllib2) and parse it to find that it contains a captcha, i want to open the captcha using Tkinter. Now i know that i will have to save the image to my harddrive first, then open it but there is an issue before that. The captcha image that is on screen is not directly in the source anywhere. There is a variable in the source, inside some javascript, that points to another page that has the link to the image, BUT if you load that middle page, the captcha picture for that link changes, so the image associated with that javascript variable is no longer valid. It may be impossible to gather the image using this method, so please enlighten me if you have any ideas on this.
Now if I use firebug to load the page, there is a "GET" that is a direct link to the current Captcha image that i am seeing, and i'm wondering if there is anyway to make python or ullib2 see the "GET"s that are going on when a page is loaded, because if that was possible, this would be simple.
Please let me know if you have any suggestions.
|
Python - How do I save a file delivered from html?
| 3,628,497 | 2 | 1 | 383 | 0 |
python,html,download,urllib
|
If you're getting back a thank you page, the URL to the file is likely to be in there somewhere. Look for <meta http-equiv="refresh"> or JavaScript redirects. Ctrl+F'ing the page for the file name might also help.
Some sites may have extra protection in, so if you can't figure it out, post a link to the site, just in case someone can be bothered to look.
| 0 | 0 | 1 | 0 |
2010-09-02T15:07:00.000
| 1 | 1.2 | true | 3,628,454 | 0 | 0 | 1 | 1 |
I have a form which when submitted by a user redirects to a thank you page and the file chosen for download begins to download.
How can I save this file using python? I can use python's urllib.urlopen to open the url to post to but the html returned is the thank you page, which I suspected it would be. Is there a solution that allows me to grab the contents of the file being served for download from the website and save that locally?
Thanks in advance for any help.
|
Why is mod_python running entire django stack from beginning with each request?
| 3,632,574 | 0 | 1 | 68 | 0 |
django,mod-python
|
It loads Django once per httpd process. Since multiple processes start (each child being a process), multiple instances of Django are started.
| 0 | 0 | 0 | 0 |
2010-09-03T01:47:00.000
| 2 | 0 | false | 3,632,537 | 0 | 0 | 1 | 2 |
My understanding is that mod_python loads the python process into apache, avoiding the overhead of doing that on each call. My expectation was that this would mean that my django stack would also only be loaded once.
What I am observing, however, is that every request is running the entire django stack from the beginning, as though it were the first request. The settings are re-imported. Middleware __init__'s, which are supposed to be run once at django startup, are run each time. And so forth. It seems to be essentially like I would expect CGI to be.
Is this expected behavior? I have mostly worked with mod_wsgi, which I believe does not work this way, but I have to use mod_python for my current client.
Thanks!
|
Why is mod_python running entire django stack from beginning with each request?
| 3,632,878 | 2 | 1 | 68 | 0 |
django,mod-python
|
Apache on UNIX systems is a multiprocess system as pointed out by someone else. Also make sure the MaxRequestsPerChild hasn't been set to be 1 in Apache configuration for some reason. Ideally that directive should be set to 0, meaning keep processes around and not recycle them based on number of requests.
| 0 | 0 | 0 | 0 |
2010-09-03T01:47:00.000
| 2 | 1.2 | true | 3,632,537 | 0 | 0 | 1 | 2 |
My understanding is that mod_python loads the python process into apache, avoiding the overhead of doing that on each call. My expectation was that this would mean that my django stack would also only be loaded once.
What I am observing, however, is that every request is running the entire django stack from the beginning, as though it were the first request. The settings are re-imported. Middleware __init__'s, which are supposed to be run once at django startup, are run each time. And so forth. It seems to be essentially like I would expect CGI to be.
Is this expected behavior? I have mostly worked with mod_wsgi, which I believe does not work this way, but I have to use mod_python for my current client.
Thanks!
|
Strategies for Encryption with Django + Postgres?
| 3,636,320 | 1 | 22 | 14,180 | 0 |
python,django,postgresql,encryption
|
What are you protecting against? If attacker would get access to your DB/filesystem, he would find how you decrypt data & keys. Hiding your encription key is not an easy task (and rarely implemented in "usual" applications).
I would spend more time on protecting the server and fixing all general security issues.
| 0 | 0 | 0 | 0 |
2010-09-03T13:38:00.000
| 4 | 1.2 | true | 3,636,286 | 0 | 0 | 1 | 1 |
I'm going to be storing a few sensitive pieces of information (SSN, Bank Accounts, etc) so they'll obviously need to be encrypted. What strategies do you recommend?
Should I do all the encryption/decryption in the web app itself? Should I use something like pgcrypto and have the conversions done on the DB side? Something else entirely?
Also, if you think I should do encryption on the web app side, what Python libraries would you recommend?
|
What is the best way of running shell commands from a web based interface?
| 3,637,544 | 1 | 8 | 4,016 | 0 |
python,ruby-on-rails,ruby,django,shell
|
I'm not sure if it's what you want, but there are some web based ssh clients out there. If you care about security and really just want dynamic feedback, you could look into comet or just have a frame with its own http session that doesn't end until it's done printing.
| 0 | 1 | 0 | 1 |
2010-09-03T15:59:00.000
| 7 | 0.028564 | false | 3,637,503 | 0 | 0 | 1 | 1 |
Imagine a web application that allows a logged in user to run a shell command on the web server at the press of a button. This is relatively simple in most languages via some standard library os tools.
But if that command is long running you don't want your UI to hang. Again this is relatively easy to deal with using some sort of background process or putting the command to be executed onto a message queue (and maybe saving the output and status somewhere for later consumption). Just return quickly saving we'll run that and get back to you.
What I'd like to do is show the output of said web ui triggered shell command as it happens. So vertically scrolling text like when running in a terminal.
I have a vague idea of how I might approach this, streaming the output to a websocket perhaps and simply printing the output to screen.
What I'd like to ask is:
Are their any plugins, libraries or applications that already do this. Something I can either use or read the source of. Ideally an open source python/django or ruby/rails tool, but other stacks would be interesting too.
|
Error Handling CRM 4 Webservice
| 3,639,310 | 1 | 0 | 211 | 0 |
python,web-services,dynamics-crm,dynamics-crm-4
|
Catch SoapException and take a look at Detail property. You'll find everything about the error in there.
| 0 | 0 | 0 | 0 |
2010-09-03T16:11:00.000
| 1 | 1.2 | true | 3,637,579 | 0 | 0 | 1 | 1 |
What is the best way to trap errors/exceptions with the CRM 4 Web service. Is there a way to get more detailed error messages from the web service? There is a custom application that creates orders and when the get a error message from the web service it is not very details or useful. Is there a better way to get more detailed message from the CRM 4 web service in a custom application written in python.
|
How to parse a web use javascript to load .html by Python?
| 3,637,740 | 0 | 0 | 862 | 0 |
javascript,python
|
How does the search page work? If it loads anything using Ajax, you could do some basic reverse engineering and find the URLs involved using Firebug's Net panel or Wireshark and then use urllib2 to load those.
If it's more complicated than that, you could simulate the actions JS performs manually without loading and interpreting JavaScript. It all depends on how the search page works.
Lastly, I know there are ways to run scripting on pages without a browser, since that's what some functional testing suites do, but my guess is that this could be the most complicated approach.
| 0 | 0 | 1 | 0 |
2010-09-03T16:26:00.000
| 2 | 0 | false | 3,637,681 | 0 | 0 | 1 | 1 |
I'm using Python to parse an auction site.
If I use browser to open this site, it will go to a loading page, then jump to the search result page automatically.
If I use urllib2 to open the webpage, the read() method only return the loading page.
Is there any python package could wait until all contents are loaded then read() method return all results?
Thanks.
|
How to efficiently filter a string against a long list of words in Python/Django?
| 3,644,860 | 1 | 9 | 4,500 | 0 |
python,django,string,nlp
|
If some false positives/negatives are ok, search for bloom filter on wikipedia.
If not look at CDB, (yum install tinycdb, in Fedora -- no python API atm).
| 0 | 0 | 0 | 0 |
2010-09-04T06:25:00.000
| 6 | 0.033321 | false | 3,641,152 | 1 | 0 | 1 | 2 |
Stackoverflow implemented its "Related Questions" feature by taking the title of the current question being asked and removing from it the 10,000 most common English words according to Google. The remaining words are then submitted as a fulltext search to find related questions.
I want to do something similar in my Django site. What is the best way to filter a string (the question title in this case) against a long list of words in Python? Any libraries that would enable me to do that efficiently?
|
How to efficiently filter a string against a long list of words in Python/Django?
| 3,641,324 | 2 | 9 | 4,500 | 0 |
python,django,string,nlp
|
I think a much simpler solution and still reasonably fast is to use sqlite and regular expressions.
Put the long list of words in an sqlite table and build a b-tree index. This gives you log(n) time exists queries. Split the smaller string with a regular expression and loop over the words running an exists query for each of them.
You can stem the words first with the porter stemmer from nltk.
| 0 | 0 | 0 | 0 |
2010-09-04T06:25:00.000
| 6 | 0.066568 | false | 3,641,152 | 1 | 0 | 1 | 2 |
Stackoverflow implemented its "Related Questions" feature by taking the title of the current question being asked and removing from it the 10,000 most common English words according to Google. The remaining words are then submitted as a fulltext search to find related questions.
I want to do something similar in my Django site. What is the best way to filter a string (the question title in this case) against a long list of words in Python? Any libraries that would enable me to do that efficiently?
|
django user model and custom primary key field
| 3,641,584 | 7 | 9 | 16,452 | 0 |
python,django
|
this doesn't seem to be possible without changing the User model source code.
Correct. Unless you are willing to change (or replace) User there isn't a way.
One (tenuous, hackish) way to do this would be to attach an UserProfile for each User instance. Each User should have exactly one UserProfile. You can then add your UUIDField to the profile. You will still have to do custom querying to translate from UUIDField to id.
If you don't like the name UserProfile you can rename it suitably. The key is that you have a one-to-one relationship to User.
| 0 | 0 | 0 | 0 |
2010-09-04T08:35:00.000
| 3 | 1.2 | true | 3,641,483 | 0 | 0 | 1 | 1 |
Django by default makes a primary key field on each model named "id", with a type of AutoField. On my models, I'm overriding this to use a custom UUIDField as the primary key by using the "primary_key" attribute. I would also like the User model in django.contrib.auth to have a UUIDField as the primary key, but this doesn't seem to be possible without changing the User model source code.
Is there any recommended way to approach this problem?
|
Django, Turbo Gears, Web2Py, which is better for what?
| 4,338,367 | 6 | 20 | 15,591 | 0 |
python,django,frameworks,web2py,turbogears
|
I have to say as not particularly skilled developer, the speed at which I have been able to create using web2py has blown my mind. In large part due to the amazing community and the core value Massimo has of making the framework accessible.
When I started I had written 0 lines of code in Python
Never heard of web2py
I've been at it seriously for about a month and have progressed (in my usual fashion) from asking questions that no one could answer (because they didn't make any sense) to coding for hours at a time without picking up a book or asking a question.
I'm really impressed.
| 0 | 0 | 0 | 0 |
2010-09-05T12:11:00.000
| 7 | 1 | false | 3,646,002 | 0 | 0 | 1 | 3 |
I got a project in mind that makes it worth to finally take the plunge into programming.
After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is in the experimental stage, which wouldn't help me do this web app right now.
As for web app fast, I've checked out Django, Turbo Gears and Py2Web. In spite of spending a lot of time reading, I still have no clue which one I should use.
1) Django certainly has the nicest online presence, and a nicely done onsite tutorial, they sure know how to show off their thing.
2) Web2Py attracted me with its no-install-needed and the claim of making Django look complicated. But when you dig around on their website, you quickly find content that hasn't been updated in years with broken external links... There's ghosts on that website that make someone not intimately familiar with the project worry if it might be flatlining.
3) Turbo Gears ...I guess its modular too. People who wrote about it loved it... I couldn't find anything specific that might make it special over Django.
I haven't decided on an IDE yet, though I read all the answers to the Intellisense code completion post here. Showing extra code snippets would be cool too for noobs like me, but I suppose I should choose my web frame work first and then pick an editor that will work well with it.
Since probably no framework is hands down the best at everything, I will give some specifics on the app I want to build:
It will use MySQL, it needs register/sign-in, and there will be a load of simple math operations on data from input and SQL queries. I've completed a functional prototype in Excel, so I know exactly what I want to build, which I hope will help me overcome my noobness. I'll be a small app, nothing big.
And I don't want to see any HTML while building it ;-)
PS: thanks to the people running Stackoverflow, found this place just at the right moment too!
|
Django, Turbo Gears, Web2Py, which is better for what?
| 15,945,257 | 2 | 20 | 15,591 | 0 |
python,django,frameworks,web2py,turbogears
|
I've used both web2py and RoR extensively, and while RoR has gotten a lot of popularity and support in the past few years, web2py is simpler, cleaner, less "magical", and yet also offers more (useful) out-of-the-box functionality. I'd say that web2py has more potential than RoR, but it is a relatively new framework and does yet not have the maturity of RoR. (Despite that, though, I'd choose web2py over RoR any day...)
| 0 | 0 | 0 | 0 |
2010-09-05T12:11:00.000
| 7 | 0.057081 | false | 3,646,002 | 0 | 0 | 1 | 3 |
I got a project in mind that makes it worth to finally take the plunge into programming.
After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is in the experimental stage, which wouldn't help me do this web app right now.
As for web app fast, I've checked out Django, Turbo Gears and Py2Web. In spite of spending a lot of time reading, I still have no clue which one I should use.
1) Django certainly has the nicest online presence, and a nicely done onsite tutorial, they sure know how to show off their thing.
2) Web2Py attracted me with its no-install-needed and the claim of making Django look complicated. But when you dig around on their website, you quickly find content that hasn't been updated in years with broken external links... There's ghosts on that website that make someone not intimately familiar with the project worry if it might be flatlining.
3) Turbo Gears ...I guess its modular too. People who wrote about it loved it... I couldn't find anything specific that might make it special over Django.
I haven't decided on an IDE yet, though I read all the answers to the Intellisense code completion post here. Showing extra code snippets would be cool too for noobs like me, but I suppose I should choose my web frame work first and then pick an editor that will work well with it.
Since probably no framework is hands down the best at everything, I will give some specifics on the app I want to build:
It will use MySQL, it needs register/sign-in, and there will be a load of simple math operations on data from input and SQL queries. I've completed a functional prototype in Excel, so I know exactly what I want to build, which I hope will help me overcome my noobness. I'll be a small app, nothing big.
And I don't want to see any HTML while building it ;-)
PS: thanks to the people running Stackoverflow, found this place just at the right moment too!
|
Django, Turbo Gears, Web2Py, which is better for what?
| 3,757,753 | 2 | 20 | 15,591 | 0 |
python,django,frameworks,web2py,turbogears
|
Django: Heard it has the best administrative
interface. But uses it's own ORM, i.e. doesn't use SQL-Alchemy.
Web2py: Didn't research this.
Turbogears2:
Uses SQL-Alchemy by default, uses Catwalk for admin
interface, but documentation isn't as
great.
I chose Turbogears2 because it uses popular components, so I didn't have to learn anything new...
| 0 | 0 | 0 | 0 |
2010-09-05T12:11:00.000
| 7 | 0.057081 | false | 3,646,002 | 0 | 0 | 1 | 3 |
I got a project in mind that makes it worth to finally take the plunge into programming.
After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is in the experimental stage, which wouldn't help me do this web app right now.
As for web app fast, I've checked out Django, Turbo Gears and Py2Web. In spite of spending a lot of time reading, I still have no clue which one I should use.
1) Django certainly has the nicest online presence, and a nicely done onsite tutorial, they sure know how to show off their thing.
2) Web2Py attracted me with its no-install-needed and the claim of making Django look complicated. But when you dig around on their website, you quickly find content that hasn't been updated in years with broken external links... There's ghosts on that website that make someone not intimately familiar with the project worry if it might be flatlining.
3) Turbo Gears ...I guess its modular too. People who wrote about it loved it... I couldn't find anything specific that might make it special over Django.
I haven't decided on an IDE yet, though I read all the answers to the Intellisense code completion post here. Showing extra code snippets would be cool too for noobs like me, but I suppose I should choose my web frame work first and then pick an editor that will work well with it.
Since probably no framework is hands down the best at everything, I will give some specifics on the app I want to build:
It will use MySQL, it needs register/sign-in, and there will be a load of simple math operations on data from input and SQL queries. I've completed a functional prototype in Excel, so I know exactly what I want to build, which I hope will help me overcome my noobness. I'll be a small app, nothing big.
And I don't want to see any HTML while building it ;-)
PS: thanks to the people running Stackoverflow, found this place just at the right moment too!
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.