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
Old desktop programmer wants to create S+S project
2,428,452
0
1
174
1
php,python,ruby-on-rails,programming-languages,saas
If you want a 'desktop component' that is available for you to do development on whenever your internet is out, you could really choose any of those technologies. You can always have a local server (like apache) running on your machine, as well as a local sql database, though if your database contains a large amount of...
0
0
0
0
2010-03-11T19:38:00.000
3
0
false
2,428,077
0
0
1
3
I have an idea for a product that I want to be web-based. But because I live in a part of the world where the internet is not always available, there needs to be a client desktop component that is available for when the internet is down. Also, I have been a SQL programmer, a desktop application programmer using dBase, ...
Issues running python scripts in Command Prompt (Specifically with command line arguments)?
2,437,395
4
4
1,347
0
python,scripting,command-prompt
Check assoc and ftype. If properly set, you can run a .py with arguments. > assoc .py .py=Python.File > ftype Python.File Python.File="C:\Python26\python.exe" "%1" %* Depending on how your Python was installed, these may or may not be in place. You can set them with assoc and ftype. > assoc .py=Python.File > ftype...
0
0
0
0
2010-03-13T03:31:00.000
2
0.379949
false
2,437,167
0
0
1
2
I am trying to run my python scripts in the command-prompt without calling python.exe first. I am specifically doing this in relation to running django-admin.py. I have C:\Python26 and C:\Python26\Scripts in my PATH. However, if I try running django-admin.py by doing: django-admin.py startproject helloworld I get...
Issues running python scripts in Command Prompt (Specifically with command line arguments)?
4,603,488
1
4
1,347
0
python,scripting,command-prompt
I know this is an old thread, but I have searched for a few weeks for this very same problem and found nothing. Today, however, I tried something new: If you are using Windows 7, do not use Command Prompt for scripting purposes. Instead, use the Windows PowerShell located at: All Programs -> Accessories -> Windows ...
0
0
0
0
2010-03-13T03:31:00.000
2
0.099668
false
2,437,167
0
0
1
2
I am trying to run my python scripts in the command-prompt without calling python.exe first. I am specifically doing this in relation to running django-admin.py. I have C:\Python26 and C:\Python26\Scripts in my PATH. However, if I try running django-admin.py by doing: django-admin.py startproject helloworld I get...
Django migrations--is it possible to use South in the middle of the project?
2,445,802
4
5
561
0
python,mysql,database,django,django-south
Yes. I think it is not too late. I've moved to south in a middle of a project and I am happy with that choice. I think it is a big help for deployment. The initialization of the south app can be done at any moment.
0
0
0
0
2010-03-15T08:07:00.000
3
1.2
true
2,445,761
0
0
1
1
I already started a project, and the models are all synced and everything.
Programming in Python vs. programming in Java
2,495,504
1
34
7,368
0
java,python
Try to find algorithms that you understand well and see how they are implemented in python standard libraries. Persist. :)
0
0
0
0
2010-03-15T12:45:00.000
13
0.015383
false
2,447,118
1
0
1
4
I've been writing Java for the last couple of years , and now I've started to write in python (in addition). The problem is that when I look at my Python code it looks like someone tried to hammer Java code into a python format , and it comes out crappy because - well , python ain't Java. Any tips on how to escape th...
Programming in Python vs. programming in Java
2,447,141
0
34
7,368
0
java,python
Learn a few other languages. It will help you make the difference between algorithms (the structure of processing, unchanged between languages) and the local syntaxic features of the language. Then you can "write Foo in Bar" for any combination of languages "Foo" and "Bar".
0
0
0
0
2010-03-15T12:45:00.000
13
0
false
2,447,118
1
0
1
4
I've been writing Java for the last couple of years , and now I've started to write in python (in addition). The problem is that when I look at my Python code it looks like someone tried to hammer Java code into a python format , and it comes out crappy because - well , python ain't Java. Any tips on how to escape th...
Programming in Python vs. programming in Java
2,495,445
0
34
7,368
0
java,python
Eat Python, Sleep Python and Drink Python. That is the only way........
0
0
0
0
2010-03-15T12:45:00.000
13
0
false
2,447,118
1
0
1
4
I've been writing Java for the last couple of years , and now I've started to write in python (in addition). The problem is that when I look at my Python code it looks like someone tried to hammer Java code into a python format , and it comes out crappy because - well , python ain't Java. Any tips on how to escape th...
Programming in Python vs. programming in Java
2,448,287
3
34
7,368
0
java,python
Definitely not a panacea but I think you should try some code golf in Python. Obviously nobody should write "golfed" code IRL, but finding the most terse way to express something really forces you to exploit the built in functionality of the language.
0
0
0
0
2010-03-15T12:45:00.000
13
0.046121
false
2,447,118
1
0
1
4
I've been writing Java for the last couple of years , and now I've started to write in python (in addition). The problem is that when I look at my Python code it looks like someone tried to hammer Java code into a python format , and it comes out crappy because - well , python ain't Java. Any tips on how to escape th...
How to customize pickle for django model objects
2,448,188
0
4
2,714
0
python,django,pickle
You can overload the serialization methods. But it would be simpler to put the id and class in a tuple or dict and pickle that.
0
0
0
0
2010-03-15T14:58:00.000
2
0
false
2,448,035
0
0
1
2
My app uses a "per-user session" to allow multiple sessions from the same user to share state. It operates very similarly to the django session by pickling objects. I need to pickle a complex object that refers to django model objects. The standard pickling process stores a denormalized object in the pickle. So if t...
How to customize pickle for django model objects
2,448,369
1
4
2,714
0
python,django,pickle
It's unclear what your goal is. "But if I just store the id and class in a tuple then I'm necessarily going back to the database every time I use any of the django objects. I'd like to be able to keep the ones I'm using in memory over the course of a page request." This doesn't make sense, since a view function is a pa...
0
0
0
0
2010-03-15T14:58:00.000
2
1.2
true
2,448,035
0
0
1
2
My app uses a "per-user session" to allow multiple sessions from the same user to share state. It operates very similarly to the django session by pickling objects. I need to pickle a complex object that refers to django model objects. The standard pickling process stores a denormalized object in the pickle. So if t...
Python Image Library, Close method
2,449,251
0
0
773
0
python,django,python-imaging-library
Ah, if i only open the orginal image once and create the thumbnail after resizing then the problem is solved
0
0
0
0
2010-03-15T17:28:00.000
1
1.2
true
2,449,115
0
0
1
1
I have been using pil for the first time today. And I wanted to resize an image assuming it was larger than 800x600 and also create a thumbnail. I could do either of these tasks separately but not together in one method (I am doing a custom save method in django admin). This returns a "cannot identify image file" error...
How to create a custom admin configuration panel in Django?
2,455,815
0
2
4,970
0
python,django,panel,admin
The automatically generated administration area created by Django is for data maintenance. It provides forms to edit data in your models. If it doesn't "handle this feature", then it sounds like your "configuration panel" (configuration panel should let me choose some basic options like highlighting some news, setting ...
0
0
0
0
2010-03-16T14:13:00.000
3
0
false
2,455,018
0
0
1
1
I would like to create a configuration panel for the homepage of the web-app I'm designing with Django. This configuration panel should let me choose some basic options like highlighting some news, setting a showcase banner, and so on. Basically I don't need an app with different rows, but just a panel page with some c...
Checkboxes with pylons
2,457,303
0
1
1,306
0
python,pylons
I'm assuming that "I can only get the first value" means you've got a series of checkboxes with the same value for the 'name' attribute within your form? Now, if that's the case and you're wanting a list of boolean values based on whether or not the boxes are checked or not, you'll need to do two things: First, whe...
1
0
0
0
2010-03-16T18:11:00.000
1
0
false
2,456,926
0
0
1
1
I have been trying to add some check boxes in a pylons mako. However I don't know how to get their values in the controller. It seems that it can only get the first value of the check boxes. I tried using form encode but i got several errors. Is there an easier way to do this? Thanks
Giving users a "reputation system" - Should I...?
2,458,468
6
8
550
0
python,django,web-applications
In Django, I'd suggest having a property on the User (or Profile) model that calculates a user's reputation on-demand. Then, cache the reputation with your caching framework and/or store to the database for fast retrieval. This way, in addition to having the records of what impacts reputation, you can change your repu...
0
0
0
0
2010-03-16T21:39:00.000
2
1
false
2,458,355
0
0
1
2
I'm thinking of adding a reputation system to my Django web application; the site is already being used so I'm trying to be careful about my choices. Reputation is generated in all actions that contribute to the site, similar to Stackoverflow's system. I know there are literally millions of ways of implementing this, a...
Giving users a "reputation system" - Should I...?
2,458,375
4
8
550
0
python,django,web-applications
keep track of the reasons, IMHO. It surely wouldn't be that complex, and you don't need to store a huge amount of information, just a datetime, point value, command, target, and originator. If the data gets to be too much after some time dump the DB to a backup medium and clear the history.
0
0
0
0
2010-03-16T21:39:00.000
2
0.379949
false
2,458,355
0
0
1
2
I'm thinking of adding a reputation system to my Django web application; the site is already being used so I'm trying to be careful about my choices. Reputation is generated in all actions that contribute to the site, similar to Stackoverflow's system. I know there are literally millions of ways of implementing this, a...
web2py or grok (zope) on a big portal,
9,985,357
1
3
1,388
1
python,zope,web2py,zodb,grok
Zope and the ZODB have been used with big applications, but I'd still consider linking Zope with MySQL or something like that for serious large-scale applications. Even though Zope has had a lot of development cycles, it is usually used with another database engine for good reason. As far as I know, the argument appl...
0
0
0
0
2010-03-17T02:26:00.000
3
0.066568
false
2,459,549
0
0
1
2
I am planning to make some big project (1 000 000 users, approximately 500 request pre second - in hot time). For performance I'm going to use no relational dbms (each request could cost lot of instructions in relational dbms like mysql) - so i can't use DAL. My question is: how web2py is working with a big traffic, i...
web2py or grok (zope) on a big portal,
2,459,620
7
3
1,388
1
python,zope,web2py,zodb,grok
First, don't assume that a data abstraction layer will have unacceptable performance, until you actually see it in practice. It is pretty easy to switch to RAW sql if and when you run into a problem. Second, most users who worry about there server technology handling a million users never finish their applications. P...
0
0
0
0
2010-03-17T02:26:00.000
3
1
false
2,459,549
0
0
1
2
I am planning to make some big project (1 000 000 users, approximately 500 request pre second - in hot time). For performance I'm going to use no relational dbms (each request could cost lot of instructions in relational dbms like mysql) - so i can't use DAL. My question is: how web2py is working with a big traffic, i...
django: search forms and redirect
2,461,426
3
0
726
0
python,django,redirect,search-form
Search queries should probably be GETs, rather than POSTs, because they are not changing anything - they are simply passing parameters to get certain information. POST should be reserved for forms that actually change things in the database, or result in a specific action (eg submitting an email). To reply to your comm...
0
0
0
0
2010-03-17T10:15:00.000
1
1.2
true
2,461,364
0
0
1
1
After processing form from POST I should redirect, to prevent user from hitting back. However, I am using form to determine search query on a database, so I need to either pass params to the redirected site or the result of a search. Or maybe there is some other good practice, how to solve this problem? Maybe in this s...
Running a python script in background from a CGI
2,462,349
2
1
1,221
0
python,cgi,backgroundworker
well, short answer: you can't. medium answer: CGI sucks. long answer: CGI works by running your script and returning whatever your script prints to the browser. If your script is still running, the browser will be waiting. If your script launches a background job and returns data to the browser, then the background job...
0
0
0
1
2010-03-17T11:59:00.000
1
0.379949
false
2,461,964
0
0
1
1
I have a python CGI which runs some script in the background and shows the stdout in the html page. I run the script when the user clicks some button in the page. My problem is when the script starts running the page becomes busy and the user can't use the other client side features in the page. What I want is: The scr...
Call macro from Python script?
2,466,236
0
1
334
0
python,zope
Maybe you could create a new template including (use-macro) just the macros you want to access from python and then use z3c.pt.pagetemplate.PageTemplateFile() to render it? Actually, it might be possible (and certainly easier) to use chameleon.zpt.template.PageTemplate('<div tal:use-macro="<your-macro-here>" />'), but ...
0
0
0
1
2010-03-17T17:32:00.000
2
1.2
true
2,464,442
0
0
1
2
One of our page templates is made up of a bunch of macros. These items are a bunch of html tables. Now, I want a couple of these tables in a Python script to create a PDF. Is there a way call a macro from a Python script and get back the HTML that is produced? If so, can you explain? Thanks Eric
Call macro from Python script?
2,464,507
0
1
334
0
python,zope
I'd probably use urllib.urlopen(url), pull the data from the page back to python and use BeautifulSoup to pull the table(s) out of the HTML... And then render that to PDF with XHTML2PDF (pisa.ho). There might be a simpler way but for me, this would be the least stressful approach.
0
0
0
1
2010-03-17T17:32:00.000
2
0
false
2,464,442
0
0
1
2
One of our page templates is made up of a bunch of macros. These items are a bunch of html tables. Now, I want a couple of these tables in a Python script to create a PDF. Is there a way call a macro from a Python script and get back the HTML that is produced? If so, can you explain? Thanks Eric
Artificial Intelligence in online game using Google App Engine
2,471,015
2
1
1,026
0
python,google-app-engine,artificial-intelligence
If the game is turn based then it would probably be best to avoid the Cron task and just update the NPCs every time the player moves. I'm not sure how big of a map you are planning on but you may consider even having the player object find the NPCs that are close to it and call their AI routine. That way NPCs that are...
0
1
0
0
2010-03-17T18:59:00.000
3
0.132549
false
2,465,056
0
0
1
3
I am currently in the planning stages of a game for google app engine, but cannot wrap my head around how I am going to handle AI. I intend to have persistant NPCs that will move about the map, but short of writing a program that generates the same XML requests I use to control player actions, than run it on another s...
Artificial Intelligence in online game using Google App Engine
2,471,126
2
1
1,026
0
python,google-app-engine,artificial-intelligence
Bear in mind that you can also break up your updates into multiple requests (internally): do a bit of work, redirect to the same handler but different state; do more work; etc. (I'm failing somehow to comment on Peter Recore's answer, which is where this really belongs.) I see that the free service only allows 100k ta...
0
1
0
0
2010-03-17T18:59:00.000
3
0.132549
false
2,465,056
0
0
1
3
I am currently in the planning stages of a game for google app engine, but cannot wrap my head around how I am going to handle AI. I intend to have persistant NPCs that will move about the map, but short of writing a program that generates the same XML requests I use to control player actions, than run it on another s...
Artificial Intelligence in online game using Google App Engine
2,465,142
3
1
1,026
0
python,google-app-engine,artificial-intelligence
Will your game be turn based or real time? Either way, I think you have 2 options to look into. One is to use the Cron feature so you can schedule NPC updates at regular intervals, the other is to stick a "update NPCs" task into the Task Queue every time a human player moves.
0
1
0
0
2010-03-17T18:59:00.000
3
1.2
true
2,465,056
0
0
1
3
I am currently in the planning stages of a game for google app engine, but cannot wrap my head around how I am going to handle AI. I intend to have persistant NPCs that will move about the map, but short of writing a program that generates the same XML requests I use to control player actions, than run it on another s...
C/C++ for Core Logic Development of a Web Application?
2,468,907
0
2
390
0
c++,python,c
I don't think you should use a compiled language (at least not c++) for web programming. I thought about doing this once too but remember that for any change you'll have to compile etc. Facebook uses php and it's hip hop application changes php into c++. Maybe you should take a look at that. Of course c++ (or any compi...
0
0
0
1
2010-03-18T06:03:00.000
3
0
false
2,467,807
0
0
1
1
Can C/C++ be choice of keeping all your logic (business/domain) for web application? Why? I've two resources (cousins) having knowledge on C/C++ and me also good in C/C++, Python, HTML, CSS and JavaScript. We like to utilize our free time to work on our some good ideas we developed together. The ideas require knowledg...
Bad auto completion with python on pydev?
5,761,144
0
5
1,825
0
python,pydev
Well, as you didn't say what 'garbage' is showing, it's a bit hard to guess, but I believe you mean the __hash__, __str__, etc from the object class (is that it?) If that's the case, this has been dealt in the current nightly build (the '_' methods will still appear, but with lower priority, so, the methods you're prob...
0
0
0
1
2010-03-18T13:31:00.000
3
0
false
2,470,121
0
0
1
1
I began learning and loving python about a month ago. Dive into python, django and now Tornado is the path i followed during this time. I chose pydev as an IDE since it seems to be the most up to date and i wanted to come back to eclipse since i'm using Netbeans for php and Java. My question is the following: When i wr...
A debugger for IronPython
12,800,514
1
2
337
0
debugging,ironpython
I love Eclipse. I learned it over several years while developing JAVA, and as soon as I found out there was a PyDev plug in that was enough for me. I would recommend seeing if there is a plugin for what ever IDE you are most comfortable with.
0
0
0
0
2010-03-21T14:29:00.000
3
0.066568
false
2,487,410
1
0
1
1
Is there a good debugger for IronPython?
Djangobb problem
2,488,505
2
4
1,302
0
python,django,mod-python
There are two obvious reasons to why this might happen: djangobb_forum is not on your Python path There is no __init__.py in the djangobb_forum folder If the code says from djangobb_forum import ... then you need to have the parent folder of djangobb_forum on your Python path.
0
0
0
0
2010-03-21T18:17:00.000
1
0.379949
false
2,488,142
0
0
1
1
I've installed Djangobb app on my server (Debian, mod_python) by cloning original source. The only things I've changed is database options in settings.py. All needed components are installed - syncdb query was executed right. But, when I'm trying to enter on my forum, it returns me error: ImproperlyConfigured: Error i...
django admin - adding fields on the fly
2,488,729
1
2
515
0
python,django,django-admin,shopping-cart,django-nonrel
Sounds like you want two related models - Item and Option. Item would contain the name of the item, and Option would contain the option - eg size - and the price of that option. You would then set up your admin to use an inline form for Option.
0
0
0
0
2010-03-21T21:04:00.000
3
0.066568
false
2,488,710
0
0
1
1
Basically I am writing a simple shopping cart. Each item can have multiple prices. (i.e. shirts where each size is priced differently). I would like to have a single price field in my admin panel, where when the first price is entered, an additional price field pops up. However I am kind of at a loss as to how to do th...
Tricky model inheritance - Django
2,489,866
2
14
2,669
0
python,django,inheritance,django-models,django-orm
I agree about the roles solution, as depicted by Alex. What you have is not different subclasses of persons. You have different roles a person can have. But I hear you say: "hey, the ninja can have a property "numberOfStars", while a singer can have a property "highestNote". Same as for the interface: a ninja can have ...
0
0
0
0
2010-03-22T02:01:00.000
4
0.099668
false
2,489,620
0
0
1
2
I think this is a bit tricky, at least for me. :) So I have 4 models Person, Singer, Bassist and Ninja. Singer, Bassist and Ninja inherit from Person. The problem is that each Person can be any of its subclasses. e.g. A person can be a Singer and a Ninja. Another Person can be a Bassist and a Ninja. Another one can b...
Tricky model inheritance - Django
16,554,051
1
14
2,669
0
python,django,inheritance,django-models,django-orm
You could make all your professions (Ninja, Bassist....) inherit from Person in the models, and then use the function isinstance in the backend code to distinguish between the professions of a Person.
0
0
0
0
2010-03-22T02:01:00.000
4
0.049958
false
2,489,620
0
0
1
2
I think this is a bit tricky, at least for me. :) So I have 4 models Person, Singer, Bassist and Ninja. Singer, Bassist and Ninja inherit from Person. The problem is that each Person can be any of its subclasses. e.g. A person can be a Singer and a Ninja. Another Person can be a Bassist and a Ninja. Another one can b...
Performance Wise, Python VS JAVA For File Based Processing
2,490,299
0
1
1,498
0
java,python,file-io
Performance-wise, for an I/O - syscall bound task such as you're mentioning, it's going to be a wash, most likely, depending a bit on the platform. Java tends to have better CPU usage (partly because a JVM can effectively use multiple cores on a multicore CPU on different threads, with CPython having problems with tha...
0
1
0
1
2010-03-22T06:07:00.000
1
1.2
true
2,490,291
0
0
1
1
I need to create daemon that will monitor certain directory and will process every file that's written to that particular path. My choice is either java or python. Did you guys have any experience using both technology? what is the best one? EDIT 1: files that will be processed is simple text file (one line with tab s...
Use URL Fetch of Google App Engine just to call a php script
2,491,775
0
1
658
0
python,google-app-engine
Why not rewrite what your php script does in python? Php is a awful scripting language, and considering your thinking about calling it from inside a very powerful language, why not do it all in python
0
1
0
0
2010-03-22T07:36:00.000
3
0
false
2,490,592
0
0
1
1
I wanto call a PHP script using Google App Engine. I just want to execute the script. The script updates a couple of databases on my webhost. But I guess Google App waits for the response. Is there a way by which I can start the script. The script takes some time and Google App might die during that time.
GAE, Python 2.5, Python 2.6 Side-by-side on windows
2,492,830
0
2
470
0
python,django,google-app-engine
Re virtualenv question above: virtualenv have a parameter --python=PYTHON_EXE that you can point to the interpreter you'd like it to use. Running virtualenv without parameters or with an --help option whill show you which options you may pass it.
0
1
0
0
2010-03-22T10:08:00.000
3
0
false
2,491,280
0
0
1
2
On my development system, I have Python 2.6, Django 1.1 and GAE. I have three projects running on Python 2.6 and Django 1.1. I have 1 project using GAE, Python 2.6 and Django 1.1. I have heard that my set-up for running GAE using Python 2.6 may create some head-scratching problems while deploying it on the producti...
GAE, Python 2.5, Python 2.6 Side-by-side on windows
2,491,639
0
2
470
0
python,django,google-app-engine
Unless you are using python 2.6 specific syntax/code your application is safe to run on GAE.
0
1
0
0
2010-03-22T10:08:00.000
3
0
false
2,491,280
0
0
1
2
On my development system, I have Python 2.6, Django 1.1 and GAE. I have three projects running on Python 2.6 and Django 1.1. I have 1 project using GAE, Python 2.6 and Django 1.1. I have heard that my set-up for running GAE using Python 2.6 may create some head-scratching problems while deploying it on the producti...
Python XML + Java XML interoperability
2,492,599
1
2
475
0
java,python,xml,marshalling,interop
As Ignacio says, XML is XML. On the python side, I recommend using lxml, unless you have more specific needs that are better met by another library. If you are restricted to the standard library, look at ElementTree or cElementTree, which are also excellent, and which inspired (and are functionally mostly equivalent ...
0
0
1
0
2010-03-22T13:23:00.000
2
1.2
true
2,492,490
0
0
1
1
I need a recommendation for a pythonic library that can marshall python objects to XML(let it be a file). I need to be able read that XML later on with Java (JAXB) and unmarshall it. I know JAXB has some issues that makes it not play nice with .NET XML libraries so a recommendation on something that actually works woul...
Python or Ruby for webbased Artificial Intelligence?
2,497,026
7
4
3,942
0
python,ruby-on-rails,artificial-intelligence,prolog
The selection of language is completely irrelevant, all other things being equal. If you're trying to do X and there's a library for it in language Y and meshes well with your Web-based framework, then use it. Without knowing more about what specific areas of AI you're interested in, the question is far too vague to be...
0
0
0
1
2010-03-22T20:09:00.000
5
1
false
2,495,350
0
0
1
2
A new web application may require adding Artificial Intelligence (AI) in the future, e.g. using ProLog. I know it can be done from a Java environment, but I am wondering about the opportunities with modern web languages like Ruby or Python. The latter is considered to be "more scientific" (at least used in that environ...
Python or Ruby for webbased Artificial Intelligence?
2,498,323
0
4
3,942
0
python,ruby-on-rails,artificial-intelligence,prolog
You could also use Scala (which is a bit functional and runs on the JVW) and the existing Lift framework for web-stuff.
0
0
0
1
2010-03-22T20:09:00.000
5
0
false
2,495,350
0
0
1
2
A new web application may require adding Artificial Intelligence (AI) in the future, e.g. using ProLog. I know it can be done from a Java environment, but I am wondering about the opportunities with modern web languages like Ruby or Python. The latter is considered to be "more scientific" (at least used in that environ...
Keeping track of changes - Django
2,504,441
1
6
1,579
0
python,django,django-models
Quoth my elementary chemistry teacher: "If you don't write it down, it didn't happen", therefore save logs in a file. Since the log information is disjoint from your application data (it's meta-data, actually), keep them separate. You could log to a database table but it should be distinct from your model. Text pickle ...
0
0
0
0
2010-03-23T23:27:00.000
3
0.066568
false
2,504,386
0
0
1
1
I have various models of which I would like to keep track and collect statistical data. The problem is how to store the changes throughout time. I thought of various alternative: Storing a log in a TextField, open it and update it every time the model is saved. Alternatively pickle a list and store it in a TextField. ...
What is the Simplest Possible Payment Gateway to Implement? (using Django)
17,987,815
1
18
23,610
0
python,django,payment-gateway,payment-processing
Consider enabling more than one payment gateways. If you add only one, and this gateway fails for some reason you'll start losing money (actually happened to one of the persons I know).
0
0
0
0
2010-03-24T03:05:00.000
5
0.039979
false
2,505,072
0
0
1
2
I'm developing a web application that will require users to either make one time deposits of money into their account, or allow users to sign up for recurring billing each month for a certain amount of money. I've been looking at various payment gateways, but most (if not all) of them seem complex and difficult to get ...
What is the Simplest Possible Payment Gateway to Implement? (using Django)
2,505,692
2
18
23,610
0
python,django,payment-gateway,payment-processing
I've done successful integrations for both Google Checkout and PayPal ExpressCheckout in Django. Both services have stable, well-developed APIs, and neither one was too difficult to implement. There are good Python libraries already written to do the heavy lifting for you, too.
0
0
0
0
2010-03-24T03:05:00.000
5
0.07983
false
2,505,072
0
0
1
2
I'm developing a web application that will require users to either make one time deposits of money into their account, or allow users to sign up for recurring billing each month for a certain amount of money. I've been looking at various payment gateways, but most (if not all) of them seem complex and difficult to get ...
Web framework for an application utilizing existing database?
2,512,975
0
1
1,525
1
java,php,python,ruby
There are no clear cut winners when picking a web framework. Each platform you mentioned has its benefits and drawbacks (cost of hardware, professional support, community support, etc.). Depending on your time table, project requirements, and available hardware resources you are probably going to need some different an...
0
0
0
0
2010-03-24T12:11:00.000
8
0
false
2,507,463
0
0
1
2
A legacy web application written using PHP and utilizing MySql database needs to be rewritten completely. However, the existing database structure must not be changed at all. I'm looking for suggestions on which framework would be most suitable for this task? Language candidates are Python, PHP, Ruby and Java. Accordin...
Web framework for an application utilizing existing database?
2,507,492
2
1
1,525
1
java,php,python,ruby
I have very good experience with Django. Every time I needed it was up to the task for interfacing with existing database. Autogenerated models are the start, as MySQL is not the strictest with its schema. Not that it will not work only that usually some of the db restrictions are held in app itself.
0
0
0
0
2010-03-24T12:11:00.000
8
0.049958
false
2,507,463
0
0
1
2
A legacy web application written using PHP and utilizing MySql database needs to be rewritten completely. However, the existing database structure must not be changed at all. I'm looking for suggestions on which framework would be most suitable for this task? Language candidates are Python, PHP, Ruby and Java. Accordin...
webapp, tipfy or django on google app engine
2,512,079
1
10
2,218
0
python,django,google-app-engine,web-applications,tipfy
I'm still investigating, but I think webapp and tipfy will be a lighter framework than django. Right now, I am using just webapp and the cold start times are already too long. I want to use tipfy for sessions and keep everything else in webapp. What are you trying to optimize for? Speed of development? Easy of progra...
0
1
0
0
2010-03-24T19:45:00.000
6
0.033321
false
2,510,903
0
0
1
3
which one are you using on google app engine? what were the reasons behind your decision?
webapp, tipfy or django on google app engine
3,184,831
1
10
2,218
0
python,django,google-app-engine,web-applications,tipfy
I would still prefer Django for its structure and a high support available over internet for it and for the following reasons: Webapp offcourse is light weight, but Django comes with a nice structure which saves a lots of time while working on a large application. Google app engine does provide a good document for wo...
0
1
0
0
2010-03-24T19:45:00.000
6
0.033321
false
2,510,903
0
0
1
3
which one are you using on google app engine? what were the reasons behind your decision?
webapp, tipfy or django on google app engine
3,304,317
4
10
2,218
0
python,django,google-app-engine,web-applications,tipfy
Imho.. Django - the only part that's relevant is the templating and maybe the no rel.. Webapp - never tried it after Tipfy - is what I'm using, seems to be more "pylons" like, has a basic apps/modules structure and lots of "helpers" which quite frankly should be in the google.appengine.api Easy to implement templates a...
0
1
0
0
2010-03-24T19:45:00.000
6
0.132549
false
2,510,903
0
0
1
3
which one are you using on google app engine? what were the reasons behind your decision?
Idiots guide to app engine and memcache
2,514,663
3
2
2,620
0
python,google-app-engine,memcached
If you cache a query, is there an accepted method for ensuring that the cache is cleared/updated when an object stored in that query is updated. Typically you wrap your reads with a conditional to retrieve the value from the main DB if it's not in the cache. Just wrap your updates as well to fill the cache whe...
0
1
0
0
2010-03-25T01:20:00.000
3
0.197375
false
2,512,571
0
0
1
2
I am struggling to find a good tutorial or best practices document for the use of memcache in app engine. I'm pretty happy with it on the level presented in the docs. Get an object by ID, checking memcache first, but I'm unclear on things like: If you cache a query, is there an accepted method for ensuring that the ...
Idiots guide to app engine and memcache
5,571,331
0
2
2,620
0
python,google-app-engine,memcached
About reference properties, let's say you have MainModel and RefModel with a reference property 'ref' that points to a MainModel instance. Whenever you cal ref_model.ref it does a datastore get operation and retrieves the object from datastore. It does not interact with memcache in any way.
0
1
0
0
2010-03-25T01:20:00.000
3
0
false
2,512,571
0
0
1
2
I am struggling to find a good tutorial or best practices document for the use of memcache in app engine. I'm pretty happy with it on the level presented in the docs. Get an object by ID, checking memcache first, but I'm unclear on things like: If you cache a query, is there an accepted method for ensuring that the ...
Django OpenID django-openid-auth Login Error
2,520,867
1
0
577
0
python,django,openid
Are you supplying an email address or URL? OpenID needs a URL and *******@gmail.com is an email address.
0
0
0
0
2010-03-25T23:22:00.000
1
1.2
true
2,520,144
0
0
1
1
I get the following error when attempting to use django-openid-auth OpenID discovery error: No usable OpenID services found for *******@gmail.com I have followed the instructions that come with it, though it seems there is something I am missing. the installation is on my localhost.
Is it possible to detect the browser version from Django server side?
2,522,807
2
1
948
0
python,django
request.env['HTTP_USER_AGENT'] will give the user agent string the browser sent.
0
0
0
0
2010-03-26T11:16:00.000
3
0.132549
false
2,522,774
0
0
1
2
in server side, not browser.
Is it possible to detect the browser version from Django server side?
2,588,289
1
1
948
0
python,django
Unfortunately request.env won't work. However, you can get it through request.META.get("HTTP_USER_AGENT")
0
0
0
0
2010-03-26T11:16:00.000
3
1.2
true
2,522,774
0
0
1
2
in server side, not browser.
Error handling with Python + Pylons
2,526,649
1
3
698
0
python,error-handling,pylons
I use formencode @validate decorator. It is possible to write custom validator for it but the problem with handling exceptions that occur in the model after validation still exists. You could write custom action decorator similar to formencode one which will handle your model exceptions and populate c.form_errors.
0
0
0
0
2010-03-26T20:17:00.000
3
0.066568
false
2,526,458
0
0
1
1
What is the proper way to handle errors with Python + Pylons? Say a user sets a password via a form that, when passed to a model class via the controller, throws an error because it's too short. How should that error be handled so that an error message gets displayed on the web page rather than the entire script termi...
I need a simple command line program to transform XML using an XSL Stylesheet
2,541,765
0
15
23,093
0
java,python,xml,macos,xslt
I have used Saxon 6.5 for years for command line transformations. (Java, XSLT 1) An excellent fallback if a native solution is not available.
0
1
0
0
2010-03-26T20:55:00.000
8
0
false
2,526,681
0
0
1
1
I am on OSX Snow Leopard (10.6.2) I can install anything I need to. I would preferably like a Python or Java solution. I have searched on Google and found lots of information on writing my own program to do this, but this is a just a quick and dirty experiment so I don't want to invest a lot of time on writing a bunch ...
Standardizing a Release/Tools group on a specific language
2,529,182
-1
4
196
0
python,perl,groovy
First, it's important to note that it is very hard to convince someone they're wrong. He's advocating bash scripts and Perl, due to their universality and simplicity Bash scripts are not simple. The bash programming model is really complex and unfriendly. if statements and expressions, in particular are horrify...
0
0
0
1
2010-03-27T02:10:00.000
4
-0.049958
false
2,527,867
0
0
1
2
I'm part of a six-member build and release team for an embedded software company. We also support a lot of developer tools, such as Atlassian's Fisheye, Jira, etc., Perforce, Bugzilla, AnthillPro, and a couple of homebrew tools (like my Django release notes generator). Most of the time, our team just writes little plug...
Standardizing a Release/Tools group on a specific language
2,527,917
4
4
196
0
python,perl,groovy
Google standardized on Python for such tasks (and many more) a bit before I joined the company; as far as I know, huge advantages such as Python's great implementations on the JVM and .NET didn't even play a role in the decision -- it was all about readability. At the time (and to some extent, even now) the theory at ...
0
0
0
1
2010-03-27T02:10:00.000
4
0.197375
false
2,527,867
0
0
1
2
I'm part of a six-member build and release team for an embedded software company. We also support a lot of developer tools, such as Atlassian's Fisheye, Jira, etc., Perforce, Bugzilla, AnthillPro, and a couple of homebrew tools (like my Django release notes generator). Most of the time, our team just writes little plug...
How to change db in django depending on request.get_host()?
5,369,262
0
2
466
0
python,django,django-middleware,django-orm
You can set up one site for each "site", with it's own settings file, listening to it's own socket, using the same codebase. I'm doing that and I can easily support more than 30 concurrent sites on a middle-size server. Maintainability of configurations and startup scripts is the only issue.
0
0
0
0
2010-03-28T08:05:00.000
2
0
false
2,532,268
0
0
1
2
I am creating multisites platform. Anybody can make simple site, with my platform. I plan to use django multidb support. One db for one site. And i need to change db settings depending on request.get_host(). I think that i's not good idea. Prompt other decisions? How it is realised on various designers of sites?
How to change db in django depending on request.get_host()?
2,534,950
1
2
466
0
python,django,django-middleware,django-orm
You might want to reconsider using a separate db for reach site. In reviewing the multi-db source, it looks like you'll run into a few scalability issues, depending on how many sites you want to support: Currently all the databases are set up in settings.py. This could cause a few issues: Each new site would require r...
0
0
0
0
2010-03-28T08:05:00.000
2
0.099668
false
2,532,268
0
0
1
2
I am creating multisites platform. Anybody can make simple site, with my platform. I plan to use django multidb support. One db for one site. And i need to change db settings depending on request.get_host(). I think that i's not good idea. Prompt other decisions? How it is realised on various designers of sites?
Using Django CMS
30,400,944
2
0
1,502
0
python,django,content-management-system
I would say no. Django CMS is well designed, if you change content frequently. It has nice features to build up a page. But that means it only shows its benefits, when you create a lot pages/subpages and so on. For a simple website that only presents data, without adding new pages/views, Django will suffice. And from ...
0
0
0
0
2010-03-28T12:19:00.000
2
0.197375
false
2,532,840
0
0
1
1
I know python and have just read a basic intro of django. I have to built something like a travel website with real time updates. Will django be sufficent for this? Somebody advised me to look at django-CMS, I couldn't find a very beginner's tutorial there. Should I opt for django-CMS? Also how much of django should i ...
Accessing php $_SESSION from python (wsgi) - is it possible?
2,534,567
1
8
5,062
0
php,python,session,wsgi
Depends on the PHP app, if it's keeping session data in a database (MySQL maybe) you can just connect to the database and get the data, if it's using native PHP sessions you should look to the session.save_path config setting in php.ini, that's the place where the runtime saves files with the session data. Once you hav...
0
0
0
1
2010-03-28T20:55:00.000
3
0.066568
false
2,534,525
0
0
1
2
I've got a python/WSGI app which needs to check to see if a user has logged on to a PHP web app. The problem is that the PHP app checks if a user has logged on by comparing a value in the $_SESSION variable to a value in the cookie from the user's browser. I would prefer to avoid changing the behavior of the php app if...
Accessing php $_SESSION from python (wsgi) - is it possible?
2,534,558
4
8
5,062
0
php,python,session,wsgi
yep. session (in default) is a regular file. so all what you need is look over session directory and find file with name of session cookie value. then - you have to implement php-like serialize/unserialize and do whatever you want. nope
0
0
0
1
2010-03-28T20:55:00.000
3
0.26052
false
2,534,525
0
0
1
2
I've got a python/WSGI app which needs to check to see if a user has logged on to a PHP web app. The problem is that the PHP app checks if a user has logged on by comparing a value in the $_SESSION variable to a value in the cookie from the user's browser. I would prefer to avoid changing the behavior of the php app if...
Thread Synchronization in Django
24,900,469
0
5
5,313
0
python,django,synchronized
Great article Justin, just one thing using python 2.5 makes this way easier In Python 2.5 and later, you can also use the with statement. When used with a lock, this statement automatically acquires the lock before entering the block, and releases it when leaving the block: from future import with_statement # 2.5 only ...
0
0
0
0
2010-03-28T23:05:00.000
4
0
false
2,534,943
0
0
1
1
Is there any way to block a critical area like with Java synchronized in Django?
Pylons: View latest debug message
2,536,493
0
0
90
0
python,debugging,pylons
(On the off-chance that this helps...) Ubuntu's default Terminal program auto-detects URLs. When my pylons programs burp, I just ctrl-click on the link in the console.
0
0
0
0
2010-03-29T07:56:00.000
1
1.2
true
2,536,468
0
0
1
1
Is there a way to view the latest debug message instead of having to copy and paste something like "_debug/view/1269848287" to the browser everytime?
Tornado or Django works with CGI?
3,244,176
5
2
1,611
0
python,django,cgi,webserver,tornado
Main feature of Tornado is that it is high performance web-server written in Python, for creating web applications using Python programming language. Running Tornado as CGI application negates the very reason it exists, because running CGI scripts is expensive in terms of performance, and most probably there is no way ...
0
1
0
0
2010-03-29T10:02:00.000
2
0.462117
false
2,537,065
0
0
1
1
Tornado is a webserver + framework like Django but for real-time features. On my server I don't have a python module or wsgi module so I thought CGI. Is there a way to get Tornado ( or Django ) works by using CGI folder ? If yes, Could you explain me how do I do that ?
Logging users out of a Django site after N minutes of inactivity
2,539,518
4
28
17,914
0
python,django,authentication
Setting the session cookie age in the django session middleware just sets the expiry time in the set-cookie header passed back to the browser. It's only browser compliance with the expiry time that enforces the "log out". Depending on your reasons for needing the idle log-out, you might not consider browser compliance ...
0
0
0
0
2010-03-29T15:24:00.000
3
0.26052
false
2,539,109
0
0
1
1
I'm working on a website that requires us to log a user out after N minutes of inactivity. Are there any best practices for this using Django?
Access to content of Lotus Notes database without Lotus Notes software installed
2,542,163
3
0
3,704
0
python,lotus-notes,lotus
The short answer is, unfortunately you will need the Notes client installed. There are a few ways to access data from an NSF such as NotesSQL, COM, C/C++, but all rely on the Lotus C API at the core, and you'll need a notes client and a notes ID file to gain access via that API.
0
0
0
0
2010-03-29T22:34:00.000
3
0.197375
false
2,541,702
0
0
1
3
I am looking for a programatic way to access content in a Lotus Notes database (.nsf file) without having Lotus Notes software installed. Python would be preferred but I'm also willing to look at other languages e.g. C/C++ or other means e.g. SQL From what I have read, all of the methods e.g. Python COM access, pyodbc ...
Access to content of Lotus Notes database without Lotus Notes software installed
2,551,002
0
0
3,704
0
python,lotus-notes,lotus
Like Ken says, inevitably there has to be a server in the mix. If you're searching for specific text in a Notes / Domino application, and looking to replace it, there's a tool out there which does this: Teamstudio Configurator. Configurator also has an API (written in Lotusscript, which is very like old-skool VB) so yo...
0
0
0
0
2010-03-29T22:34:00.000
3
0
false
2,541,702
0
0
1
3
I am looking for a programatic way to access content in a Lotus Notes database (.nsf file) without having Lotus Notes software installed. Python would be preferred but I'm also willing to look at other languages e.g. C/C++ or other means e.g. SQL From what I have read, all of the methods e.g. Python COM access, pyodbc ...
Access to content of Lotus Notes database without Lotus Notes software installed
2,607,921
1
0
3,704
0
python,lotus-notes,lotus
If this is a one-time need, you may be able to find sites that will do some simple Domino/Notes hosting for free. If you could put the NSF up to a service like that, you could then use Domino URL's (REST) to extract the data and search for links, etc.
0
0
0
0
2010-03-29T22:34:00.000
3
0.066568
false
2,541,702
0
0
1
3
I am looking for a programatic way to access content in a Lotus Notes database (.nsf file) without having Lotus Notes software installed. Python would be preferred but I'm also willing to look at other languages e.g. C/C++ or other means e.g. SQL From what I have read, all of the methods e.g. Python COM access, pyodbc ...
Most secure way to generate a random session ID for a cookie?
2,542,128
4
6
13,882
0
python,cookies,session,security
If the only information in the cookie is an identifier, essentially a label, the only attack you're trying to protect from is an attacker guessing what it is. So use some random bytes. Enough random bytes that it's "unguessable." Then squish the random bytes into something that fits within the confines of which chara...
0
0
0
0
2010-03-29T22:42:00.000
8
1.2
true
2,541,742
0
0
1
2
I'm writing my own sessions controller that issues a unique id to a user once logged in, and then verifies and authenticates that unique id at every page load. What is the most secure way to generate such an id? Should the unique id be completely random? Is there any downside to including the user id as part of the ...
Most secure way to generate a random session ID for a cookie?
29,989,100
0
6
13,882
0
python,cookies,session,security
I would avoid the random factor completely. What I've generally done is: Generate a sequential session_id (which I store locally). When the user logs in, sign session_id with a private key (I use itsdangerous for this). When I get a request, if the session_id's signature is intact, I proceed, otherwise, 403 (400 would...
0
0
0
0
2010-03-29T22:42:00.000
8
0
false
2,541,742
0
0
1
2
I'm writing my own sessions controller that issues a unique id to a user once logged in, and then verifies and authenticates that unique id at every page load. What is the most secure way to generate such an id? Should the unique id be completely random? Is there any downside to including the user id as part of the ...
No matter what I do, django-admin.py is not found, even though it's in my path
2,542,702
5
3
6,085
0
python,django
The python interpreter does not look everywhere on your path to find the script. It does look everywhere for imports, but not for scripts. Try typing django-admin.py, just django-admin.py and not python django-admin.py, and it should work. Windows should find it on the path, then execute it as a python script. OK, If W...
0
0
0
0
2010-03-30T03:20:00.000
5
0.197375
false
2,542,674
0
0
1
4
I have added C:\Python26\Lib\site-packages\django\bin to my path, I have started a new cmd session in Windows 7, but when I try to do 'python django-admin.py ...' it says there is no file django-admin.py. When I type path, there is the full path to ...\django\bin. This is driving me nuts. Clearly it's there, but it's ...
No matter what I do, django-admin.py is not found, even though it's in my path
2,543,312
4
3
6,085
0
python,django
python -mdjango-admin looks like what you're looking for. -m tells Python to find a module on sys.path and run that module as "the main script" -- which seems exactly your goal!
0
0
0
0
2010-03-30T03:20:00.000
5
0.158649
false
2,542,674
0
0
1
4
I have added C:\Python26\Lib\site-packages\django\bin to my path, I have started a new cmd session in Windows 7, but when I try to do 'python django-admin.py ...' it says there is no file django-admin.py. When I type path, there is the full path to ...\django\bin. This is driving me nuts. Clearly it's there, but it's ...
No matter what I do, django-admin.py is not found, even though it's in my path
14,559,937
5
3
6,085
0
python,django
I realize this is old, but came across the same issue. On Windows, your path should include the following: C:\Python27\;C:\Python27\Scripts This is assuming python 2.7.3 is installed and django 1.4.3
0
0
0
0
2010-03-30T03:20:00.000
5
0.197375
false
2,542,674
0
0
1
4
I have added C:\Python26\Lib\site-packages\django\bin to my path, I have started a new cmd session in Windows 7, but when I try to do 'python django-admin.py ...' it says there is no file django-admin.py. When I type path, there is the full path to ...\django\bin. This is driving me nuts. Clearly it's there, but it's ...
No matter what I do, django-admin.py is not found, even though it's in my path
2,718,527
0
3
6,085
0
python,django
I had the same problem, and python -mdjango-admin works. but i had to define PYTHONHOME & PYTHONPATH first
0
0
0
0
2010-03-30T03:20:00.000
5
0
false
2,542,674
0
0
1
4
I have added C:\Python26\Lib\site-packages\django\bin to my path, I have started a new cmd session in Windows 7, but when I try to do 'python django-admin.py ...' it says there is no file django-admin.py. When I type path, there is the full path to ...\django\bin. This is driving me nuts. Clearly it's there, but it's ...
Pylons: Set global variable for Authkit user
2,543,332
1
0
360
0
python,pylons,authkit
There is no single "logged-in user" if you're serving requests on multiple threads -- by setting a single global variable the threads would trample upon each other and end up very very confused on who "the logged-in user" actually is. There is (at most;-) a single logged-in user per request, so keeping that info in th...
0
0
0
0
2010-03-30T06:52:00.000
1
1.2
true
2,543,315
0
0
1
1
How can I can set a global variable for the username of the logged-in user? At the moment i have the following code in all my controllers to get the username. I rather set it as a global variable if possible. request.environ.get("REMOTE_USER") I tried putting the same code in the app_globals.py file but it gave me the ...
Overwrite the Soap Envelope in Suds python
2,545,937
3
7
4,252
0
python,xml,soap,suds,envelope
I managed to get this working, the soap envelope is hard coded into bindings.py that is stored in suds.egg installed in your site-packages. I changed the SOAP envelope address to http://www.w3.org/2003/05/soap-envelope. This was compatible with my camera. I was unable to find a command to overwrite this envelope in sud...
0
0
0
0
2010-03-30T10:09:00.000
4
1.2
true
2,544,331
0
0
1
1
I have a camera and I am trying to connect to it vis suds. I have tried to send raw xml and have found that the only thing stopping the xml suds from working is an incorrect Soap envelope namespace. The envelope namespace is: xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" and I want to rewrite it to: xmlns:...
Optimization Techniques in Python
2,545,940
6
11
1,942
1
python
ok, not entirely to the point, but before you go and start fixing it, make sure everyone understands the situation. it seems to me that they're putting some pressure on you to fix the "problem". well first of all, when you wrote the application, have they specified the performance requirements? did they tell you that t...
0
0
0
1
2010-03-30T14:07:00.000
9
1
false
2,545,820
0
0
1
3
Recently i have developed a billing application for my company with Python/Django. For few months everything was fine but now i am observing that the performance is dropping because of more and more users using that applications. Now the problem is that the application is now very critical for the finance team. Now the...
Optimization Techniques in Python
2,546,955
4
11
1,942
1
python
A surprising feature of Python is that the pythonic code is quite efficient... So a few general hints: Use built-ins and standard functions whenever possible, they're already quite well optimized. Try to use lazy generators instead one-off temporary lists. Use numpy for vector arithmetic. Use psyco if running on x86 3...
0
0
0
1
2010-03-30T14:07:00.000
9
1.2
true
2,545,820
0
0
1
3
Recently i have developed a billing application for my company with Python/Django. For few months everything was fine but now i am observing that the performance is dropping because of more and more users using that applications. Now the problem is that the application is now very critical for the finance team. Now the...
Optimization Techniques in Python
2,546,996
2
11
1,942
1
python
before you can "fix" something you need to know what is "broken". In software development that means profiling, profiling, profiling. Did I mention profiling. Without profiling you don't know where CPU cycles and wall clock time is going. Like others have said to get any more useful information you need to post the det...
0
0
0
1
2010-03-30T14:07:00.000
9
0.044415
false
2,545,820
0
0
1
3
Recently i have developed a billing application for my company with Python/Django. For few months everything was fine but now i am observing that the performance is dropping because of more and more users using that applications. Now the problem is that the application is now very critical for the finance team. Now the...
Does anyone have any feedback on using Psyco in a wsgi application?
9,439,466
1
2
186
0
python,wsgi
Psyco is dead -- its successor is called PyPy. You are unlikely to get any speed increase with an I/O bound application however.
0
0
0
1
2010-03-30T21:02:00.000
2
0.099668
false
2,548,705
0
0
1
2
Have you tried Psyco in a wsgi application (custom, Pylons, Django...)? What does your set up look like? Did you get measurable results?
Does anyone have any feedback on using Psyco in a wsgi application?
2,553,516
2
2
186
0
python,wsgi
The question you should ask is not did you get measurable results, but does it make your site noticeably faster? Most web applications are not CPU bound, so even if JIT makes them faster, you probably weren't fully utilizing your processor to begin with. It has been a very long time since I played with psyco, but orde...
0
0
0
1
2010-03-30T21:02:00.000
2
1.2
true
2,548,705
0
0
1
2
Have you tried Psyco in a wsgi application (custom, Pylons, Django...)? What does your set up look like? Did you get measurable results?
how to write re-usable views in django?
2,550,450
0
0
151
0
python,django,views
whenever the view needs a particular object from the ORM, it attempts to fetch it using any "id" parameter in several ways (e.g. as a slug, as a database id) (this may be a bad practice...) So... why not just expect a model instance to be passed in as a parameter? Or a QuerySet from which you will take element 0? Th...
0
0
0
0
2010-03-31T03:25:00.000
2
0
false
2,550,308
0
0
1
2
These are the techniques that I use regularly to make my views reusable: take the template_name as an argument with a default take an optional extra_context which defaults to empty {} right before the template is rendered the context is updated with the extra_context for further re-usability, call any callable in ex...
how to write re-usable views in django?
2,550,339
0
0
151
0
python,django,views
I would think that doing all of those puts a large burden on your urlconf to get everything right. Perhaps making a function that takes all that and hardcoding your views to be a glorified wrapper around said function would be better.
0
0
0
0
2010-03-31T03:25:00.000
2
0
false
2,550,308
0
0
1
2
These are the techniques that I use regularly to make my views reusable: take the template_name as an argument with a default take an optional extra_context which defaults to empty {} right before the template is rendered the context is updated with the extra_context for further re-usability, call any callable in ex...
Django newbie question: can't start a new project
2,553,104
2
0
2,582
0
python,django,django-admin
do you have permission to write to the directory?
0
0
0
0
2010-03-31T13:04:00.000
4
0.099668
false
2,553,088
0
0
1
2
I'm totally new to django, and I'm using its documentation to get help on how to use it but seems like something is missing. i installed django using setup.py install command and i added the ( django/bin ) to system path variable but. i still cant start a new project i use the following syntax to start a project : d...
Django newbie question: can't start a new project
2,559,610
0
0
2,582
0
python,django,django-admin
check whether you have djagno or not and the it is in python path or not.if using linux go to terminal type python and then try to import django
0
0
0
0
2010-03-31T13:04:00.000
4
0
false
2,553,088
0
0
1
2
I'm totally new to django, and I'm using its documentation to get help on how to use it but seems like something is missing. i installed django using setup.py install command and i added the ( django/bin ) to system path variable but. i still cant start a new project i use the following syntax to start a project : d...
What should I use - Mako or Django?
2,562,356
4
4
1,845
0
python,django,template-engine,mako
Ask yourself this question: What are you getting out of this project? What do you want to learn? If you want to know the nuts and bolts of a web server the hard way: concoct your own web framework using Mako and other useful building blocks as needed. As @pulegium says, you'll have to choose how to handle the HTTP laye...
0
0
0
0
2010-04-01T17:03:00.000
3
0.26052
false
2,562,167
0
0
1
3
I'm making a website that mail users when a movie or a pc game has released. It isn't too complex - users can sign up, choose movies/music or a genre and save the settings. When the movie/music is released - it mails the user. Some other functionality too but this is the jist. Now, I've been working with Python for a b...
What should I use - Mako or Django?
2,562,185
2
4
1,845
0
python,django,template-engine,mako
Django. Because it takes care for all bits and pieces (url mapping, request object handling etc) and hides the DB access from you as well. If you want you can use SQLite DB so no need for MysQL or other "proper" DBs. If you were using just template engine you'd have to take care of HTTP layer yourself. And the DB stuff...
0
0
0
0
2010-04-01T17:03:00.000
3
1.2
true
2,562,167
0
0
1
3
I'm making a website that mail users when a movie or a pc game has released. It isn't too complex - users can sign up, choose movies/music or a genre and save the settings. When the movie/music is released - it mails the user. Some other functionality too but this is the jist. Now, I've been working with Python for a b...
What should I use - Mako or Django?
5,249,036
0
4
1,845
0
python,django,template-engine,mako
I have used mako for some time and have also tried to get to grips with django in google appengine. If you are a python whizz... definitely opt for Mako. I'm finding django frustrating as the syntax doesn't allow me to do really nice pythonic code. I'm going to drop Mako into my appengine project before it's too late!
0
0
0
0
2010-04-01T17:03:00.000
3
0
false
2,562,167
0
0
1
3
I'm making a website that mail users when a movie or a pc game has released. It isn't too complex - users can sign up, choose movies/music or a genre and save the settings. When the movie/music is released - it mails the user. Some other functionality too but this is the jist. Now, I've been working with Python for a b...
Django - Threading in views without hanging the server
2,565,806
2
0
458
0
python,django,multithreading,django-models
But why you need thread? why can't you just do whatever you want to do in django view? If you are using servers like apache with mod-wsgi you should be able to have good control over number of process and threads , so that part shouldn't be your worry or should not be in django views.
0
0
0
0
2010-04-02T07:15:00.000
2
0.197375
false
2,565,484
0
0
1
2
One of my applications in my Django project require each request/visitor to that instance to have their own thread. This might sound confusing, so I'll describe what I'm looking to accomplish in a case based scenario, with steps: User visits application Thread starts Until the thread finishes, that user's server insta...
Django - Threading in views without hanging the server
4,045,424
0
0
458
0
python,django,multithreading,django-models
I dread to think why you'd want to do that. Are you sure you're not looking for session variables?
0
0
0
0
2010-04-02T07:15:00.000
2
0
false
2,565,484
0
0
1
2
One of my applications in my Django project require each request/visitor to that instance to have their own thread. This might sound confusing, so I'll describe what I'm looking to accomplish in a case based scenario, with steps: User visits application Thread starts Until the thread finishes, that user's server insta...
How use the google maps hand cursor in Python?
2,565,793
0
0
593
0
python,wxpython,cursor
Use two cursors and change them on events as they need to be.
0
0
0
0
2010-04-02T08:43:00.000
2
1.2
true
2,565,776
0
0
1
1
I want to use the google maps hand cursor in Python but I don't know how to do it. I've downloaded the cursor but I only get to use the hand open, I also have a event that "closes" the hand when clicked but I don't know how can I change the style cursor on it. I say this because the google maps hand cursor has two styl...
Eclipse: PyDev installation difficulties
15,892,577
0
0
1,097
0
python,eclipse,pydev
there's an easy way to install plugin for eclipse, download the pydev package zip file (not install it via eclipse update), extract it, and put it into your eclipse/dropins/pydev folder. this is a hidden way to install plugin.
0
1
0
1
2010-04-02T16:48:00.000
1
0
false
2,567,895
0
0
1
1
I'm having difficulty getting PyDev to work. I had an installation of Eclipse for PHP developers (1.2.1.20090918-0703). A month ago, I installed PyDev, and everything worked great. I go to fire it up this morning, and PyDev is gone. There is no option to create a Python project, the Python language editor is missing, e...
How to handle redirects while parsing HTML? - Python
2,574,423
1
1
553
0
python,html,http,forms,screen-scraping
If it uses meta tags then you need to parse the HTML manually. Otherwise mechanize will handle the redirect automatically.
0
0
1
0
2010-04-02T20:42:00.000
2
0.099668
false
2,569,089
0
0
1
1
I'm trying to submit a few forms through a Python script, I'm using the mechanized library. This is so I can implement a temporary API. The problem is that before after submission a blank page is returned informing that the request is being processed, after a few seconds the page is redirected to the final page. I und...
How to convert tag-and-username-like text into proper links in a twitter message?
2,570,547
0
0
207
0
python,django,twitter
I'm not sure exactly what you're asking, but what's wrong with something like {{ user.get_absolute_url }}? For the tag detail URLs, it really depends on what you're looking for, but you would have to construct the url and view for that yourself.
0
0
0
0
2010-04-03T04:03:00.000
3
0
false
2,570,193
0
0
1
1
I'm writing a twitter-like note-taking web app. In a page the latest 20 notes of the user will be listed, and when the user scroll to the bottom of the browser window more items will be loaded and rendered. The initial 20 notes are part of the generated html of my django template, but the other dynamically loaded item...
Django manage.py can't find an INSTALLED_APP even though the module is in the path
2,574,461
0
0
2,147
0
python,django,django-evolution
You need to add it to your INSTALLED_APPS section of settings.py.
0
0
0
0
2010-04-04T13:04:00.000
4
0
false
2,574,451
0
0
1
4
When I run python manage.py shell I get an error about the last app I've added to INSTALLED_APPS, namely django-evolution, saying it's an undefined module. This is despite the fact that I've added the path to django-evolution to the system path. In fact right after this error I can run python and do an import on django...
Django manage.py can't find an INSTALLED_APP even though the module is in the path
2,575,989
1
0
2,147
0
python,django,django-evolution
Does your django_evolution have a init.py file in it? Also any folder containing django_evolution needs one.
0
0
0
0
2010-04-04T13:04:00.000
4
0.049958
false
2,574,451
0
0
1
4
When I run python manage.py shell I get an error about the last app I've added to INSTALLED_APPS, namely django-evolution, saying it's an undefined module. This is despite the fact that I've added the path to django-evolution to the system path. In fact right after this error I can run python and do an import on django...
Django manage.py can't find an INSTALLED_APP even though the module is in the path
8,602,397
0
0
2,147
0
python,django,django-evolution
If you are using virtualenv and ipython is installed at the system level but your app at the env level, it will lead to this. The way out of it is to remove ipython from the system and to install it into your env.
0
0
0
0
2010-04-04T13:04:00.000
4
0
false
2,574,451
0
0
1
4
When I run python manage.py shell I get an error about the last app I've added to INSTALLED_APPS, namely django-evolution, saying it's an undefined module. This is despite the fact that I've added the path to django-evolution to the system path. In fact right after this error I can run python and do an import on django...
Django manage.py can't find an INSTALLED_APP even though the module is in the path
52,769,162
0
0
2,147
0
python,django,django-evolution
I know this is super old, but in case anyone has this issue, my issue was because I had elevated to root inside my venv. I had initialized my virtual environment, and then upgraded my privileges to root. If deactivate doesn't work and you're root, then you should exit then deactivate, then you can do sudo su and then s...
0
0
0
0
2010-04-04T13:04:00.000
4
0
false
2,574,451
0
0
1
4
When I run python manage.py shell I get an error about the last app I've added to INSTALLED_APPS, namely django-evolution, saying it's an undefined module. This is despite the fact that I've added the path to django-evolution to the system path. In fact right after this error I can run python and do an import on django...
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
2,844,890
0
21
30,143
0
python,django,cakephp,web-frameworks,yii
If for the PHP part I would choose CodeIgniter - it doesn't get too much into your way. But it doesn't have any code/view/model generators out of the box, you need to type a bit. But languages other than PHP appear to be more sexy.
0
0
0
1
2010-04-05T13:18:00.000
8
0
false
2,578,540
0
0
1
5
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
10,847,083
4
21
30,143
0
python,django,cakephp,web-frameworks,yii
Codeigniter it's fast and very documented also has a large community to and finaly friendly with the programmer.
0
0
0
1
2010-04-05T13:18:00.000
8
0.099668
false
2,578,540
0
0
1
5
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...
PHP Frameworks (CodeIgniter, Yii, CakePHP) vs. Django
7,084,868
0
21
30,143
0
python,django,cakephp,web-frameworks,yii
I am using CodeIgniter 1.7.2 and for complex websites it's very good and powerfull, but it definitely is missing some kind of code generator which will allow for example to build an IT application in one click. I had the impression (from watching a tutorial) that Django has it.
0
0
0
1
2010-04-05T13:18:00.000
8
0
false
2,578,540
0
0
1
5
I have to develop a site which has to accomodate around 2000 users a day and speed is a criterion for it. Moreover, the site is a user oriented one where the user will be able to log in and check his profile, register for specific events he/she wants to participate in. The site is to be hosted on a VPS server.Although ...