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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
when a class is instantiated, storing that instance by user
| 2,265,947 | 1 | 0 | 888 | 0 |
asp.net,ironpython
|
You have to put it into the Session object, which is automatically managed for you.
| 0 | 0 | 0 | 0 |
2010-02-15T12:40:00.000
| 2 | 0.099668 | false | 2,265,928 | 1 | 0 | 1 | 1 |
I have to do the following, when a class is instantiated I need to store that instance by user . Since I'm working in asp.net, I was wondering if I should use some of the ways asp.net provides to persist data between user requests. (Cache cant be because the data needs to be persistent and application state cant be because it needs to be specific to an user) or if I should look a way to store that info inside the class. And it needs to be persisted until I programatically say so
|
Paginating the results of a Django forms POST request
| 2,266,571 | 0 | 20 | 12,612 | 0 |
python,django,django-forms,pagination
|
You can ask request object if it's ajax, simply request.is_ajax. This way you can detect, whether it's first post request or further questions about the next pages.
| 0 | 0 | 0 | 0 |
2010-02-15T14:31:00.000
| 8 | 0 | false | 2,266,554 | 0 | 0 | 1 | 2 |
I'm using Django Forms to do a filtered/faceted search via POST, and I would like to Django's paginator class to organize the results. How do I preserve the original request when passing the client between the various pages? In other words, it seems that I lose the POST data as soon as I pass the GET request for another page back to my views. I've seen some recommendations to use AJAX to refresh only the results block of the page, but I'm wondering if there is a Django-native mechanism for doing this.
Thanks.
|
Paginating the results of a Django forms POST request
| 3,170,694 | 0 | 20 | 12,612 | 0 |
python,django,django-forms,pagination
|
Have the search form and the results display on one single django template. Initially, use css to hide the results display area. On POSTing the form, you could check to see if the search returned any results and hide the search form with css if results exist. If results do not exist, use css to hide the results display area like before. In your pagination links, use javascript to submit the form, this could be as simple as document.forms[0].submit(); return false;
You will need to handle how to pass the page number to django's paging engine.
| 0 | 0 | 0 | 0 |
2010-02-15T14:31:00.000
| 8 | 0 | false | 2,266,554 | 0 | 0 | 1 | 2 |
I'm using Django Forms to do a filtered/faceted search via POST, and I would like to Django's paginator class to organize the results. How do I preserve the original request when passing the client between the various pages? In other words, it seems that I lose the POST data as soon as I pass the GET request for another page back to my views. I've seen some recommendations to use AJAX to refresh only the results block of the page, but I'm wondering if there is a Django-native mechanism for doing this.
Thanks.
|
Subscription web/desktop app [PYTHON]
| 2,277,634 | 0 | 3 | 795 | 0 |
python,django,sms,payment-gateway
|
I'd like to comment on the SMS alert part.
First, I have to admit that I'm not familiar with Django, but I assume it to be just like most other web frameworks: request based. This might be your first problem, as the alert service needs to run independently of requests. You could of course hack together something to externally trigger a request once a day... :-)
Now for the SMS part: much depends on how you plan to implement this. If you are going with an SMS provider, there are many to choose from that let you send SMS with a simple HTTP request. I wouldn't recommend the other approach, namely using a real cellphone or SMS modem and take care of the delivery yourself: it is way too cumbersome and you have to take into account a lot more issues: e.g. retry message transmission for handsets that are turned off or aren't able to receive SMS because their memory is full. Your friendly SMS provider will probably take care of this.
| 0 | 0 | 0 | 0 |
2010-02-16T04:06:00.000
| 2 | 0 | false | 2,270,556 | 0 | 0 | 1 | 1 |
Firstly pardon me if i've yet again failed to title my question correctly.
I am required to build an app to manage magazine subscriptions. The client wants to enter subscriber data and then receive alerts at pre-set intervals such as when the subscription of a subscriber is about to expire and also the option to view all subscriber records at any time. Also needed is the facility to send an SMS/e-mail to particular subscribers reminding them for subscription renewal.
I am very familiar with python but this will be my first real project. I have decided to build it as a web app using django, allowing the admin user the ability to view/add/modify all records and others to subscribe. What options do I have for integrating an online payment service? Also how do I manage the SMS alert functionality? Any other pointers/suggestions would be welcome.
Thank You
|
django calendar free/busy/availabilitty
| 2,271,544 | 0 | 12 | 3,899 | 0 |
python,django,calendar
|
One caveat here is the different timezones of different users, and bring Daylight saving time into the mix things become very complicated.
You might want to take a look at pytz module for taking care of the timezone issue.
| 0 | 0 | 0 | 0 |
2010-02-16T07:17:00.000
| 2 | 0 | false | 2,271,190 | 0 | 0 | 1 | 1 |
I am trying to implement a calendar system with the ability to schedule other people for appointments. The system has to be able to prevent scheduling a person during another appointment or during their unavailable time.
I have looked at all the existing django calendar projects I have found on the internet and none of them seem to have this built-into them (if I missed it somehow, please let me know).
Perhaps I am just getting too tired, but the only way I can think of doing this seems a little messy. Here goes in pseudo code:
when a user tries to create a new appointment, grab the new appointment's start_time and end_time
for each appointment on that same day, check if
existing_start_time < new_start_time AND existing_end_time > new_start_time (is the new appointments start time in between any existing appointment's start and end times)
existing_start_time < new_end_time AND existing_end_time > new_end_time (is the new appointments end time in between any existing appointment's start and end times)
if no objects were found, then go ahead and add the new appointment
Considering Django has no filtering based on time, this must all be done using .extra() on the queryset.
So, I am asking if there is a better way. A pythonic trick or module or anything that might simplify this. Or an existing project that has what I need or can lead me in the right direction.
Thanks.
|
How about having a SingletonModel in Django?
| 2,274,434 | 1 | 20 | 10,738 | 0 |
python,django,orm,singleton
|
rewrite your save method so that every time a Ticker object gets saved it overwrites the existing one (if one exists).
| 0 | 0 | 0 | 0 |
2010-02-16T13:44:00.000
| 5 | 0.039979 | false | 2,273,258 | 0 | 0 | 1 | 1 |
I'm making a very simple website in Django. On one of the pages there is a vertical ticker box. I need to give the client a way to edit the contents of the ticker box as an HTMLField.
The first way that came to mind was to make a model Ticker which will have only one instance. Then I thought, instead of making sure manually that only one instance exists, perhaps there is (or there should be) something like a SingletonModel class in Django, which is like a normal model, except it makes sure no more than one instance gets created?
Or perhaps I should be solving my problem in a different way?
|
Why does django not do for the User model the same as it does for the userprofile model?
| 2,275,652 | 2 | 0 | 89 | 0 |
python,django
|
The User model has a lot of dependencies and must conform to a diverse set of API requirements in order to interoperate with the rest of the django framework. This is because of its relationship with authentication and authorization. Changing User means changing the expected behavior of contrib.auth. If you want to do that, you can, and that is configurable in settings.py.
More likely, what you want to configure is the extra metadata that relates with users. This extra info isn't in any way involved with authentication, and so it can be configured separately without affecting contrib.auth. In order to make the dependencies easy to manage, this is handled in a separate model. This has the added benefit of making the distinction between authorization dependent data and site specific user metadata much clearer.
| 0 | 0 | 0 | 0 |
2010-02-16T17:50:00.000
| 2 | 1.2 | true | 2,275,043 | 0 | 0 | 1 | 2 |
Why doesn't django just have the model to use for User configured in the settings file?
The requirements on the model specified would be that it contain a certain set of fields.
Is there a reason why it couldn't be done this way?
|
Why does django not do for the User model the same as it does for the userprofile model?
| 2,275,208 | 0 | 0 | 89 | 0 |
python,django
|
"Why doesn't django just have the model to use for User configured in the settings file?"
I have a site that doesn't need users or a login or authentication.
I don't want the model for User.
In order to support everyone with applications like mine, User is optional.
| 0 | 0 | 0 | 0 |
2010-02-16T17:50:00.000
| 2 | 0 | false | 2,275,043 | 0 | 0 | 1 | 2 |
Why doesn't django just have the model to use for User configured in the settings file?
The requirements on the model specified would be that it contain a certain set of fields.
Is there a reason why it couldn't be done this way?
|
Program web applications in python without a framework?
| 2,276,041 | 4 | 43 | 35,567 | 0 |
python
|
One of the lightest-weight frameworks is mod_wsgi. Anything less is going to be a huge amount of work parsing HTTP requests to find headers and URI's and methods and parsing the GET or POST query/data association, handling file uploads, cookies, etc.
As it is, mod_wsgi will only handle the basics of request parsing and framing up results.
Sessions, cookies, using a template generator for your response pages will be a surprising amount of work.
Once you've started down that road, you may find that a little framework support goes a long way.
| 0 | 0 | 0 | 1 |
2010-02-16T20:15:00.000
| 6 | 0.132549 | false | 2,276,000 | 0 | 0 | 1 | 1 |
I am just starting Python and I was wondering how I would go about programming web applications without the need of a framework. I am an experienced PHP developer but I have an urge to try out Python and I usually like to write from scratch without the restriction of a framework like flask or django to name a few.
|
Help for novice choosing between Java and Python for app with sql db
| 2,282,470 | 1 | 0 | 594 | 1 |
java,python
|
The largest issue I can think of is the need to install an interpreter.
With Java, a lot of people will already have that interpreter installed, although you won't necessarily know which version. It may be wise to include the installer for Java with the program.
With Python, you're going to have to install the interpreter on each computer, too.
One commenter mentioned .NET. .NET 2.0 has a fairly high likelyhood of being installed than either Java or Python on Windows machines. The catch is that you can't (easily) install it on OSX or Linux.
| 0 | 0 | 0 | 0 |
2010-02-17T16:20:00.000
| 5 | 0.039979 | false | 2,282,360 | 0 | 0 | 1 | 2 |
I'm going to write my first non-Access project, and I need advice on choosing the platform. I will be installing it on multiple friends' and family's computers, so (since I'm sure many, many platforms would suffice just fine for my app), my highest priority has two parts: 1) ease of install for the non-technical user and, 2) minimizing compatibility problems. I want to be able to fix bugs and make changes and roll them out without having to troubleshoot OS and program conflicts on their computers (or at least keeping those things to the absolute minimum-this is why these concerns are my highest priority in choosing a platform.)
I have narrowed it down to Python or Java. I like Java's use of the JVM, which seems like would serve to protect against incompatibilities on individual computers nicely. And I've heard a lot of good things about Python, but I don't know how much more prone to incompatibilities it is vs Java. In case it is important, I know the app will definitely use some flavor of a free server-enabled SQL db (server-enabled because I want to be able to run the app from multiple computers), but I don't know which to use yet. I thought I could decide that next.
My experience level: I've taken a C++ (console app only) class and done some VBA in Access, but mostly I'm going to have to jump in and learn as I go. So of course I don't know much about all of this. I'm not in the computer field, this is just a hobby.
So, which would be better for this app, Java or Python?
(In case it comes up, I don't want to make it browser-based at all. I've dealt with individual computers' browser settings breaking programs, and that goes against part 2 of my top priority - maximum compatibility.)
Thank you.
Update: It will need a gui, and I'd like to be able to do a little bit of customization on it (or use a non-standard, or maybe a non-built-in one) to make it pop a little.
Update 2: Truthfully, I really am only concerned with Windows computers. I am considering Java only for its reliability as a platform.
|
Help for novice choosing between Java and Python for app with sql db
| 2,283,347 | 1 | 0 | 594 | 1 |
java,python
|
If you're going to install only (or mostly) on Windows, I'd go with .Net.
If you have experience with C++, then C# would be natural to you, but if you're comfortable with VBA, you can try VB.NET, but if you prefer Python, then there is IronPython or can give a try to IronRuby, but the best of all is you can mix them all as they apply to different parts of your project.
In the database area you'll have excellent integration with SQL Server Express, and in the GUI area, Swing can't beat the ease of use of WinForms nor the sophistication of WPF/Silverlight.
As an added bonus, you can have your application automatically updated with ClickOnce.
| 0 | 0 | 0 | 0 |
2010-02-17T16:20:00.000
| 5 | 1.2 | true | 2,282,360 | 0 | 0 | 1 | 2 |
I'm going to write my first non-Access project, and I need advice on choosing the platform. I will be installing it on multiple friends' and family's computers, so (since I'm sure many, many platforms would suffice just fine for my app), my highest priority has two parts: 1) ease of install for the non-technical user and, 2) minimizing compatibility problems. I want to be able to fix bugs and make changes and roll them out without having to troubleshoot OS and program conflicts on their computers (or at least keeping those things to the absolute minimum-this is why these concerns are my highest priority in choosing a platform.)
I have narrowed it down to Python or Java. I like Java's use of the JVM, which seems like would serve to protect against incompatibilities on individual computers nicely. And I've heard a lot of good things about Python, but I don't know how much more prone to incompatibilities it is vs Java. In case it is important, I know the app will definitely use some flavor of a free server-enabled SQL db (server-enabled because I want to be able to run the app from multiple computers), but I don't know which to use yet. I thought I could decide that next.
My experience level: I've taken a C++ (console app only) class and done some VBA in Access, but mostly I'm going to have to jump in and learn as I go. So of course I don't know much about all of this. I'm not in the computer field, this is just a hobby.
So, which would be better for this app, Java or Python?
(In case it comes up, I don't want to make it browser-based at all. I've dealt with individual computers' browser settings breaking programs, and that goes against part 2 of my top priority - maximum compatibility.)
Thank you.
Update: It will need a gui, and I'd like to be able to do a little bit of customization on it (or use a non-standard, or maybe a non-built-in one) to make it pop a little.
Update 2: Truthfully, I really am only concerned with Windows computers. I am considering Java only for its reliability as a platform.
|
Suggestions wanted: learning material for Django
| 2,282,645 | 2 | 6 | 514 | 0 |
python,django,model-view-controller,frameworks
|
Well, I have a trivial solution - get used to reading the manual and the django book they host.
Django manual is organized well, and once you have a mental picture of it, you'll really be able to make a good use of it.
Two things I wish Django docs were better at - tell clearly where to import stuff right at each definition of class and sometimes I wish explanations were a little shorter.
| 0 | 0 | 0 | 0 |
2010-02-17T16:52:00.000
| 4 | 0.099668 | false | 2,282,619 | 0 | 0 | 1 | 1 |
I am looking for advice on best resources to learn how to develop webapps with Django [the python framework]. Here's a few information to help responders to narrow-down the gazillion options "out there".
Where I stand
I know python (2.x series) and I have developed a few applications/scripts with it. I wouldn't define myself a python-ninja in any way, but I think got a very good understanding of the language structure and - above all - philosophy.
I have PHP-only experience with web development.
I have fair understanding of MVC approach to frameworks (CakePHP) but not so much experience IRL.
What I am looking for
Structured learning material: book titles, online tutorials, videos, etc...
Life stories and personal accounts: how did you learn? why did you choose to learn that way? did it work? would you change anything in the way you learnt django?
Any kind of advice you think is worth sharing!
I would like to stress that I am not looking just for raw links (I could probably find those myself with google, after all!) but I am rather looking for your opinion and advice (with a link attached to them)!
Thank you in advance for your time!
|
Problem with running Django 1.1.1 on Google App Engine Developement Server
| 2,289,005 | 0 | 0 | 261 | 0 |
python,django,google-app-engine
|
I had module nammed same way as the default GAE launcher (main/ and main.py). After renaming the launcher everything works great.
| 0 | 1 | 0 | 0 |
2010-02-18T13:00:00.000
| 1 | 1.2 | true | 2,288,725 | 0 | 0 | 1 | 1 |
I've downloaded google_appengine version 1.3.1. Using some web tutorials, I've created basic django 1.1.1 application. Using appcfg I managed to deploy it on GAE and it works. The problem is, that application doesn't want to work on dev_appengine.py developement server.
Whenever I run the app GAE local server is returning HTTP 200 without any content. If I set basic environement and run main.py manually, then the page is properly returned on stdout.
I've also created very basic helloworld application, and this one is working ok on the devel server.
Do you have any idea, how can I debug the devel server? Option -d doesn't give any usefull insight at all.
|
Complete django DB reset
| 2,289,931 | 0 | 20 | 24,412 | 1 |
python,django
|
Hm, maybe you lie to manage.py, pretending to make fixtures, but only to look for apps:
apps=$(python manage.py makefixture 2>&1 | egrep -v '(^Error|^django)'|awk -F . '{print $2}'|uniq); for i in $apps; do python manage.py sqlreset $i; done| grep DROP
That prints out a list of DROP TABLE statements for all apps tables of your project, excluding django tables itself. If you want to include them, remove the |^django pattern vom egrep.
But how to feed the correct database backend? sed/awk-ing through settings.conf? Or better by utilizing a little settings.conf-reading python script itself.
| 0 | 0 | 0 | 0 |
2010-02-18T14:16:00.000
| 7 | 0 | false | 2,289,187 | 0 | 0 | 1 | 3 |
How do I completely reset my Django (1.2 alpha) DB (dropping all tables, rather than just clearing them)?
manage.py flush does too little (won't work if there are schema changes) and manage.py reset requires me to specify all apps (and appears to take a format that is different from just " ".join(INSTALLED_APPS)). I can obviously achieve this in a DB specific way, but I figured there must be a sane, DB backend agnostic way to do this.
[Edit: I'm looking for something that I can call from a script, e.g. a Makefile and that continues to work if I change the backend DB or add to settings.INSTALLED_APPS]
|
Complete django DB reset
| 2,289,445 | 0 | 20 | 24,412 | 1 |
python,django
|
Just assign a new database and drop this db from the db console. Seems to me to be the simplest.
| 0 | 0 | 0 | 0 |
2010-02-18T14:16:00.000
| 7 | 0 | false | 2,289,187 | 0 | 0 | 1 | 3 |
How do I completely reset my Django (1.2 alpha) DB (dropping all tables, rather than just clearing them)?
manage.py flush does too little (won't work if there are schema changes) and manage.py reset requires me to specify all apps (and appears to take a format that is different from just " ".join(INSTALLED_APPS)). I can obviously achieve this in a DB specific way, but I figured there must be a sane, DB backend agnostic way to do this.
[Edit: I'm looking for something that I can call from a script, e.g. a Makefile and that continues to work if I change the backend DB or add to settings.INSTALLED_APPS]
|
Complete django DB reset
| 2,289,727 | -2 | 20 | 24,412 | 1 |
python,django
|
take a look at reset command in django's code, and write your own which drops/creates DB first.
| 0 | 0 | 0 | 0 |
2010-02-18T14:16:00.000
| 7 | -0.057081 | false | 2,289,187 | 0 | 0 | 1 | 3 |
How do I completely reset my Django (1.2 alpha) DB (dropping all tables, rather than just clearing them)?
manage.py flush does too little (won't work if there are schema changes) and manage.py reset requires me to specify all apps (and appears to take a format that is different from just " ".join(INSTALLED_APPS)). I can obviously achieve this in a DB specific way, but I figured there must be a sane, DB backend agnostic way to do this.
[Edit: I'm looking for something that I can call from a script, e.g. a Makefile and that continues to work if I change the backend DB or add to settings.INSTALLED_APPS]
|
Who is throwing (and catching) this MySQL Exception?
| 55,394,190 | 0 | 8 | 6,125 | 1 |
python,mysql,django,exception
|
The exceptions in object destructors (__del__) are ignored, which this message indicates. If you execute some MySQL command without fetching results from the cursor (e.g. 'create procedure' or 'insert') then the exception is unnoticed until the cursor is destroyed.
If you want to raise and catch an exception, call explicitly cursor.close() somewhere before going out of the scope.
| 0 | 0 | 0 | 0 |
2010-02-18T19:50:00.000
| 5 | 0 | false | 2,291,714 | 0 | 0 | 1 | 3 |
i'm using Python with MySQL and Django. I keep seeing this error and I can't figure out where the exception is being thrown:
Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now") in <bound method Cursor.__del__ of <MySQLdb.cursors.Cursor object at 0x20108150>> ignored
I have many "try" and "exception" blocks in my code--if the exception occurred within one of those, then I would see my own debugging messages. The above Exception is obviously being caught somewhere since my program does not abort when the Exception is thrown.
I'm very puzzled, can someone help me out?
|
Who is throwing (and catching) this MySQL Exception?
| 2,300,154 | 2 | 8 | 6,125 | 1 |
python,mysql,django,exception
|
After printing out a bunch of stuff and debugging, I figured out the problem I think. One of the libraries that I used didn't close the connection or the cursor. But this problem only shows up if I iterate through a large amount of data. The problem is also very intermittent and I still don't know who's throwing the "command out of sync" exception. But now that we closed both the connection and cursor, I don't see the errors anymore.
| 0 | 0 | 0 | 0 |
2010-02-18T19:50:00.000
| 5 | 0.07983 | false | 2,291,714 | 0 | 0 | 1 | 3 |
i'm using Python with MySQL and Django. I keep seeing this error and I can't figure out where the exception is being thrown:
Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now") in <bound method Cursor.__del__ of <MySQLdb.cursors.Cursor object at 0x20108150>> ignored
I have many "try" and "exception" blocks in my code--if the exception occurred within one of those, then I would see my own debugging messages. The above Exception is obviously being caught somewhere since my program does not abort when the Exception is thrown.
I'm very puzzled, can someone help me out?
|
Who is throwing (and catching) this MySQL Exception?
| 2,292,145 | 2 | 8 | 6,125 | 1 |
python,mysql,django,exception
|
I believe this error can occur if you are using the same connection/cursor from multiple threads.
However, I dont think the creators of Django has made such a mistake, but if you are doing something by yourself it can easily happen.
| 0 | 0 | 0 | 0 |
2010-02-18T19:50:00.000
| 5 | 0.07983 | false | 2,291,714 | 0 | 0 | 1 | 3 |
i'm using Python with MySQL and Django. I keep seeing this error and I can't figure out where the exception is being thrown:
Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now") in <bound method Cursor.__del__ of <MySQLdb.cursors.Cursor object at 0x20108150>> ignored
I have many "try" and "exception" blocks in my code--if the exception occurred within one of those, then I would see my own debugging messages. The above Exception is obviously being caught somewhere since my program does not abort when the Exception is thrown.
I'm very puzzled, can someone help me out?
|
What Python/IronPython web development framework work on the Microsoft technology stack?
| 2,292,804 | 1 | 6 | 1,847 | 0 |
python,ironpython
|
Django does in theory run on Windows, but using Apache and MySQL. It's not possible (and certainly not recommended) to run it on IIS.
I know you totally didn't ask this, but I have to advise that if you really want to get into Python web development then looking into a Linux technology stack is definitely the recommended approach. :)
| 0 | 0 | 0 | 0 |
2010-02-18T22:39:00.000
| 3 | 0.066568 | false | 2,292,775 | 0 | 0 | 1 | 1 |
I started learning Python using the IronPython implementation. I'd like to do some web development now. I'm looking for a python web development framework that works on the Microsoft technology stack (IIS + MS SQL Server). Django looks like an interesting framework but based on what I have read, getting it to work on the Microsoft technology stack seems very hard or not possible.
I want to lean a web framework that leverages python strengths, so ASP.NET is not an option here.
The reasons why I want to do Python on full Microsoft stack are:
We are a .Net shop and our production servers run the full Microsoft stack
With IronPython, I'll be able to interop with our product's existing .Net Libraries
Our existing database runs in SQL Server and I want to develop an app that queries that database
Deploying my Python projects to our server will not be allowed if I have to install another web server
Any recommendations?
|
Building a wiki application?
| 2,299,776 | 1 | 0 | 1,412 | 0 |
python,django,django-models,wiki
|
Assuming that there will be a community of users you can provide good tools for them to spot problems and easily undo damage. The most important of these is to provide a Recent Changes page that summarizes recent edits. Then each page that can be edited should retain prior versions of the page that can be used to replace any damaging edit. This makes it easier to undo damage than it is to damage things.
Then think about how you are going to handle either locking resources or handling simultaneous edits.
If you can tie edits to users you can provide some administrative functions for undoing all edits by a particular user, and banning that user.
Checking for quality would be tied to the particular data that your application is using.
| 0 | 0 | 0 | 0 |
2010-02-19T21:23:00.000
| 3 | 0.066568 | false | 2,299,697 | 0 | 0 | 1 | 2 |
I'm building this app in Python with Django.
I would like to give parts of the site wiki like functionality,
but I don't know how to go on about reliability and security.
Make sure that good content is not ruined
Check for quality
Prevent spam from invading the site
The items requiring wiki like functionality are just a few: a couple of text fields.
Can anyone help on this one?
Would be very much appreciated. :)
|
Building a wiki application?
| 2,299,849 | 1 | 0 | 1,412 | 0 |
python,django,django-models,wiki
|
Make sure that good content is not ruined = version each edit and allow roll-backs.
Check for quality = get people to help with that
Prevent spam from invading the site = get people to help with that, require login, add a captcha if need be, use nofollow for all links
| 0 | 0 | 0 | 0 |
2010-02-19T21:23:00.000
| 3 | 0.066568 | false | 2,299,697 | 0 | 0 | 1 | 2 |
I'm building this app in Python with Django.
I would like to give parts of the site wiki like functionality,
but I don't know how to go on about reliability and security.
Make sure that good content is not ruined
Check for quality
Prevent spam from invading the site
The items requiring wiki like functionality are just a few: a couple of text fields.
Can anyone help on this one?
Would be very much appreciated. :)
|
What does Django do with `MEDIA_ROOT`?
| 8,542,155 | 2 | 9 | 4,138 | 0 |
python,django
|
When you creates a model with ImageField or FileField attributes, you should pass the upload_to argument. That is a relative path will be appended to your MEDIA_ROOT path and there will be save and retrieve that files.
| 0 | 0 | 0 | 0 |
2010-02-20T18:53:00.000
| 3 | 0.132549 | false | 2,303,254 | 0 | 0 | 1 | 1 |
What does Django do with MEDIA_ROOT exactly? I never understood it. Since Django itself doesn't serve static media, and you have to set up apache or something similar for it, why does it care in which directory it sits?
|
Get zip code based on IP Address with Python
| 2,303,976 | -2 | 3 | 3,231 | 0 |
python,django,geolocation
|
You can't collect a real zip code from an IP address as these are assigned by ISP's when you route threw their connection.
| 0 | 0 | 0 | 0 |
2010-02-20T22:17:00.000
| 2 | 1.2 | true | 2,303,966 | 0 | 0 | 1 | 1 |
Is it possible to find the zip code based on a users IP address using python / django (not geodjango)? I assume I would have to use a web service, but I would really like to just be able to query a database if possible.
I am using geopy right now, so it would be cool if I could integrate that somehow.
|
How can I limit an SQL query to be nondestructive?
| 2,305,359 | 1 | 2 | 543 | 1 |
python,sql,django,security,sql-injection
|
Create and use non-modifiable views.
| 0 | 0 | 0 | 0 |
2010-02-21T08:48:00.000
| 2 | 0.099668 | false | 2,305,353 | 0 | 0 | 1 | 2 |
I'm planning on building a Django log-viewing app with powerful filters. I'd like to enable the user to finely filter the results with some custom (possibly DB-specific) SELECT queries.
However, I dislike giving the user write access to the database. Is there a way to make sure a query doesn't change anything in the database? Like a 'dry run' flag? Or is there a way to filter SELECT queries so that they can't be harmful in any way?
I thought about running the queries as a separate MySQL user but I'd rather avoid the hassle. I also thought about using Google App Engine's GQL 'language', but if there is a cleaner solution, I'd certainly like to hear it :)
Thanks.
|
How can I limit an SQL query to be nondestructive?
| 2,305,379 | 14 | 2 | 543 | 1 |
python,sql,django,security,sql-injection
|
Connect with a user that has only been granted SELECT permissions. Situations like this is why permissions exist in the first place.
| 0 | 0 | 0 | 0 |
2010-02-21T08:48:00.000
| 2 | 1.2 | true | 2,305,353 | 0 | 0 | 1 | 2 |
I'm planning on building a Django log-viewing app with powerful filters. I'd like to enable the user to finely filter the results with some custom (possibly DB-specific) SELECT queries.
However, I dislike giving the user write access to the database. Is there a way to make sure a query doesn't change anything in the database? Like a 'dry run' flag? Or is there a way to filter SELECT queries so that they can't be harmful in any way?
I thought about running the queries as a separate MySQL user but I'd rather avoid the hassle. I also thought about using Google App Engine's GQL 'language', but if there is a cleaner solution, I'd certainly like to hear it :)
Thanks.
|
Django: sqlite for dev, mysql for prod?
| 2,306,070 | 24 | 20 | 4,303 | 1 |
python,mysql,django,sqlite,dev-to-production
|
I'd highly recommend using the same database backend in production as in development, and all stages in between. Django will abstract the database stuff, but having different environments will leave you open to horrible internationalisation, configuration issues, and nasty tiny inconsistencies that won't even show up until you push it live.
Personally, I'd stick to mysql, but I never got on with postgres :)
| 0 | 0 | 0 | 0 |
2010-02-21T13:45:00.000
| 6 | 1.2 | true | 2,306,048 | 0 | 0 | 1 | 4 |
Quick question: is it a good idea to use sqlite while developing a Django project, and use MySQL on the production server?
|
Django: sqlite for dev, mysql for prod?
| 9,401,789 | 7 | 20 | 4,303 | 1 |
python,mysql,django,sqlite,dev-to-production
|
Use the same database in all environments.
As much as the ORM tries to abstract the differences between databases, there will always be certain features that behave differently based on the database. Database portability is a complete myth.
Plus, it seems pretty insane to test and develop against code paths that you will never use in production, doesn't it?
| 0 | 0 | 0 | 0 |
2010-02-21T13:45:00.000
| 6 | 1 | false | 2,306,048 | 0 | 0 | 1 | 4 |
Quick question: is it a good idea to use sqlite while developing a Django project, and use MySQL on the production server?
|
Django: sqlite for dev, mysql for prod?
| 2,306,069 | 3 | 20 | 4,303 | 1 |
python,mysql,django,sqlite,dev-to-production
|
In short, no; unless you want to unnecessarily double development time.
| 0 | 0 | 0 | 0 |
2010-02-21T13:45:00.000
| 6 | 0.099668 | false | 2,306,048 | 0 | 0 | 1 | 4 |
Quick question: is it a good idea to use sqlite while developing a Django project, and use MySQL on the production server?
|
Django: sqlite for dev, mysql for prod?
| 12,684,980 | 3 | 20 | 4,303 | 1 |
python,mysql,django,sqlite,dev-to-production
|
Just made this major mistake starting off with sqlite and when i try to deploy on production server with mysql, things didn't work as smooth as i expected. I tried dumpdata/loaddata with various switches but somehow keep getting errors thrown one after another. Do yourself a big favor and use the same db for both production and development.
| 0 | 0 | 0 | 0 |
2010-02-21T13:45:00.000
| 6 | 0.099668 | false | 2,306,048 | 0 | 0 | 1 | 4 |
Quick question: is it a good idea to use sqlite while developing a Django project, and use MySQL on the production server?
|
Exchange Oauth Request Token for Access Token fails Google API
| 3,110,939 | 1 | 2 | 1,332 | 0 |
python,oauth,google-api
|
When you're exchanging for the access token, the oauth_verifier parameter is required. If you don't provide that parameter, then google will tell you that the token is invalid.
| 0 | 0 | 1 | 0 |
2010-02-21T18:50:00.000
| 1 | 1.2 | true | 2,306,984 | 0 | 0 | 1 | 1 |
I am having trouble exchanging my Oauth request token for an Access Token. My Python application successfully asks for a Request Token and then redirects to the Google login page asking to grant access to my website. When I grant access I retrieve a 200 status code but exchanging this authorized request token for an access token gives me a 'The token is invalid' message.
The Google Oauth documentation says: "Google redirects with token and verifier regardless of whether the token has been authorized." so it seems that authorizing the request token fails but then I am not sure how I should get an authorized request token. Any suggestions?
|
GAE Task Queue oddness
| 2,402,964 | 0 | 2 | 630 | 0 |
python,google-app-engine,task-queue
|
When a task-queue ends in error : I believe it stays in your queue ..
Check that
| 0 | 1 | 0 | 0 |
2010-02-22T00:05:00.000
| 1 | 0 | false | 2,308,050 | 0 | 0 | 1 | 1 |
I have been testing the taskqueue with mixed success. Currently I am
using the default queue, in default settings etc etc....
I have a test URL setup which inserts about 8 tasks into the queue.
With short order, all 8 are completed properly. So far so good.
The problem comes up when I re-load that URL twice under say a minute.
Now watching the task queue, all the tasks are added properly, but
only the first batch execute it seems. But the "Run in Last Minute" #
shows the right number of tasks being run....
The request logs tell a different story. They show only the first set
of 8 running, but all task creation URLs working successfully.
The oddness of this is that if I wait say a minute between the task
creation URL requests, it will work fine.
Oddly enough changing the bucket_size or execution speed does not seem
to help. Only the first batch are executed. I have also reduced the
number of requests all the way down to 2, and still found only the
first 2 execute. Any others added display the same issues as above.
Any suggestions?
Thanks
|
How to handle user mangement in Django for groups that has same access but different rules?
| 2,311,740 | 0 | 2 | 439 | 0 |
python,django,user-management
|
If I'm understanding you correctly, it seems like you want to have two different groups have access to all the same views, but they will see different numbers. You can achieve this effect by making separate templates for the different groups, and then loading the appropriate template for each view depending on the group of the current user.
Similarly you can use a context processor to put the current group into the context for every view, and then put conditionals in the templates to select which numbers to show.
The other option is to have two separate sets of views for the two different groups. Then use decorators on the views to make sure the groups only go to the views that are for them.
| 0 | 0 | 0 | 0 |
2010-02-22T13:27:00.000
| 2 | 0 | false | 2,311,094 | 0 | 0 | 1 | 1 |
Background information:
I have created an internal site for a company. Most of the work has gone into making calculation tools that their sale persons can use to make offers for clients. Create pdf offers and contracts that can be downloaded, compare prices etc. All of this is working fine.
Now their sale persons have been divided into two groups.
One group is sale personal that is hired by the company.
The other group is persons a company themselves.
The question:
My challenge now is, that I in some cases need to display different things depending on the type of sales person. Some of the rules for the calculation tools will have different rules as to which numbers will be allowed etc. But a big part of the site will still be the same for both groups.
What I would like to know, is if there is a good way of handling this problem?
My own thoughts:
I thought about managing this by using the groups that is available in contrib.auth. That way I could keep a single code base, but would have to make rules a lot of different places. Rules for validating forms to check if the numbers entered is allowed, will depend on the group the user is in. Some things will have different names, or the workflow might be a bit different. Some tools will only be available to one of the groups. This seems like a quick solution here and now, but if the two groups will need to change more and more, it seems like this would quickly become hard to manage.
I also thought about making two different sites. The idea here was to create apps that both groups use, so I only would need to make the code for that 1 place. Then I could make the custom parts for each site and wouldn't need to check for the user in most templates and views. But I'm not sure if this is a good way to go about things. It will create a lot of extra work, and if the two groups can use a lot of the same code, this might not really be needed.
The biggest concern is that I don't really know how this evolve, so it could end up with the two groups being entire different or with only very few differences. What I would like to do, is write some code that can support both scenarios so I wont end up regretting my choice a half year from now.
So, how do you handle this case of user management. I'm looking for ideas techniques or reusable apps that address this problem, not a ready made solution.
Clarifications:
My issue is not pure presentation that can be done with templates, but also that certain calculation tools (a form that is filled out) will have different rules/validation applied to them, and in some cases the calculations done will also be different. So they might see the same form, but wont be allowed to enter the same numbers, and the same numbers might not give the same result.
|
Allowing users to delete their own comments in Django
| 3,269,190 | 3 | 7 | 5,562 | 0 |
python,django,django-comments
|
I just ran into this problem.
Just re-implementing the logic in comments app's delete view would couple your implementation to that specific version of the comments app. For example the comment app actual also handles signals when you mark something as deleted and the provided version doesn't do that.
Fortunately the comments app provides a function which implement the core delete logic with out any permissions. Using it ties yourself to the internal details, but it does so in a very specific way which will either break or work, it won't ever half work. You can create your own view with its own security model and then call the provided comment app function (from django.contrib.comments.views.moderation import perform_delete)
The code would look something like this:
@login_required
def delete_my_comment(request, comment_id, next=None):
comment = get_object_or_404(comments.get_model(), pk=comment_id)
if comment.user == request.user:
if request.method == "POST":
perform_delete(request, comment)
return redirect("your_view", comment.content_object.id)
else:
return render_to_response('comments/delete.html',
{'comment': comment, "next": next},
RequestContext(request))
else:
raise Http404
You details will vary base on your use case.
I have gone through a few variations (which you can see in this comment's history), and I think this one is better in all ways than the original solution offered here.
| 0 | 0 | 0 | 0 |
2010-02-22T23:51:00.000
| 4 | 0.148885 | false | 2,315,187 | 0 | 0 | 1 | 1 |
I am using the delete() function from django.contrib.comments.views.moderation module. The staff-member is allowed to delete ANY comment posts, which is completely fine. However, I would also like to give registered non-staff members the privilege to delete their OWN comment posts, and their OWN only. How can I accomplish this?
|
Is it possible to write dynamic web pages in Python with the Really Simple HTTP Server?
| 8,673,542 | 0 | 1 | 7,811 | 0 |
python,post,get,webserver,simplehttpserver
|
have you considered using CGIHTTPServer instead of SimpleHTTPServer? Then you can toss your scripts in cgi-bin and they'll execute. You have to include content-type header and whatnot but if you're looking for quick and dirty it's real convenient
| 0 | 0 | 0 | 1 |
2010-02-23T21:19:00.000
| 3 | 0 | false | 2,321,813 | 0 | 0 | 1 | 1 |
I know that with the SimpleHTTPServer I can make my directories accessible by web-browsers via Internet. So, I run just one line of the code and, as a result, another person working on another computer can use his/her browser to see content of my directories.
But I wander if I can make more complicated things. For example, somebody uses his/her browser to load my Python program with a set of parameter (example.py?x=2&y=2) and, as a result, he/she sees the HTML page generated by the Python program (not the Python program).
I also wander if I can process html form submitted to the SimpleHTTPServer.
|
django+flex: Debugging strategies
| 2,323,428 | 1 | 0 | 111 | 0 |
python,django,actionscript-3
|
I've used firebug to debug the flex side of things. But I've been using json or XML for communication between the two. Since flash uses the browser to do the network stuff, the request should be visible in the net tab of firebug.
To debug the django side of things, you have a few options.
If you're using the django dev server, you can add print statements to find out what's going on.
You can write a unit test to see if the django side of things is doing what you expect it to, given known data.
You can use the pyDev debugger to run the django dev server and step through your code.
I use a combination of these to debug my code.
| 0 | 0 | 0 | 0 |
2010-02-24T02:59:00.000
| 1 | 1.2 | true | 2,323,371 | 0 | 0 | 1 | 1 |
I love django, and I like flex. Django for it's cool debugging system (those yellow pages helps a lot to find bugs in my code), and flex for it possibilities.
Recently I come across a problem. If I create a form in flex and then communicate with the django server, I can't see any debugging info (when the exception happens in django).
Not sure, if there is a way to get the debugging info, because it is not accessible in command line (no error output), or in firebug....
Also I tried to create a quick html form, and post same data as I send from flex form, but it's a bit of pain to be honest.
Will be happy to listen how do you solve the problem
|
Django admin - Restrict user view by permission
| 2,325,199 | 1 | 0 | 2,577 | 0 |
python,django,permissions,django-admin,admin
|
If you make sure that User 2 has no permissions for any model related to the app you want to hide away (so no change, add or delete powers for any of the models in that app), then it won't appear in the admin for User 2.
| 0 | 0 | 0 | 0 |
2010-02-24T10:19:00.000
| 1 | 1.2 | true | 2,325,150 | 0 | 0 | 1 | 1 |
I'm starting to learn Django and I have a question.
Is there any way to restric views in the administration interface? I see there are "change, "add" and "delete" permissions, but I wanted to restrict views also.
For example: Two users, "User 1" is superuser and "User 2" is in the editor group. User 1 has access to everything, but User 2 can't view a determined application in the administration.
Is that possible?
|
Code protection system which works with IronPython assemblies?
| 2,326,011 | 1 | 0 | 159 | 0 |
asp.net,ironpython
|
since iron python compiles to IL I would imagine you can use the same obfuscations tools such as DotFuscator.
Are you using the pyc tool included in iron pythons tool folder?
| 0 | 0 | 0 | 1 |
2010-02-24T12:37:00.000
| 1 | 1.2 | true | 2,325,971 | 0 | 0 | 1 | 1 |
do you know/have you tried any code protection system which works with IronPython assemblies? Can you list it/them here?
|
Anyone using Django in the "Enterprise"
| 4,030,459 | 3 | 34 | 17,637 | 0 |
java,python,ruby-on-rails,django,enterprise
|
My company uses Python/Django as a base for our Intramas Platform. An entreprise grade web application platform that is deployed to about a dozen large clients.
Built in features include central contact management, document generator, extra security layers, default GUI for rapid application design (no messing with Django admin interface!).
Overall we are very pleased with Django as a base for our development, it is very extensible and the release cycle produces solid code (we upgrade often).
While our site (http://www.sinax.be) is in Dutch and not very extensive at the moment you can always contact me for more information.
| 0 | 0 | 0 | 0 |
2010-02-24T14:29:00.000
| 7 | 0.085505 | false | 2,326,671 | 0 | 0 | 1 | 4 |
I know that the word “enterprise” gives some people the creeps, but I am curious to know if anyone has experience creating enterprise applications, similar to something like say… Java EE applications, which are highly concurrent, distributed applications with Django? I know Java has its own issues but its kind of viewed as THE enterprise framework and I think that’s unfortunate.
Some people say that Rails is a good replacement for Java EE but what about Django? Has anyone ever used it in this context? You only ever see pretty standard websites on djangosites.org and it seems like its capable of so much more. I am planning on scrapping some of our old systems which are written mostly on ASP.NET and some Java for something more easily maintainable. I started using Django for some other applications and find it to be fantastic for what I am using it for (Corporate news, intranet, etc.) internally but what about something like… an accounts receivable system, or a billing system, etc.
I would hate to see a framework such as this pigeon-holed into a category it doesn't need to be. It seems to be used for social media/networking, content-heavy sites, not so much data processing, etc. I feel that it has all the elements needed to start down this path. Anyone have any thoughts?
|
Anyone using Django in the "Enterprise"
| 9,905,892 | 11 | 34 | 17,637 | 0 |
java,python,ruby-on-rails,django,enterprise
|
My Company uses Django for at least six large scale enterprises such as mercedes, adidas. we often use the Jython wrapper. The advantages are
reduced development cost compared to Java/C#
runs stable via wrappers in IIS or Tomcat/Java environments
protects our software from copycats
Therefore we are well satisfied with Django and are promoting it to all our customers due to the dev cost advantage.
| 0 | 0 | 0 | 0 |
2010-02-24T14:29:00.000
| 7 | 1 | false | 2,326,671 | 0 | 0 | 1 | 4 |
I know that the word “enterprise” gives some people the creeps, but I am curious to know if anyone has experience creating enterprise applications, similar to something like say… Java EE applications, which are highly concurrent, distributed applications with Django? I know Java has its own issues but its kind of viewed as THE enterprise framework and I think that’s unfortunate.
Some people say that Rails is a good replacement for Java EE but what about Django? Has anyone ever used it in this context? You only ever see pretty standard websites on djangosites.org and it seems like its capable of so much more. I am planning on scrapping some of our old systems which are written mostly on ASP.NET and some Java for something more easily maintainable. I started using Django for some other applications and find it to be fantastic for what I am using it for (Corporate news, intranet, etc.) internally but what about something like… an accounts receivable system, or a billing system, etc.
I would hate to see a framework such as this pigeon-holed into a category it doesn't need to be. It seems to be used for social media/networking, content-heavy sites, not so much data processing, etc. I feel that it has all the elements needed to start down this path. Anyone have any thoughts?
|
Anyone using Django in the "Enterprise"
| 6,459,735 | 14 | 34 | 17,637 | 0 |
java,python,ruby-on-rails,django,enterprise
|
One of the biggest drawbacks in django is that although in theory the concept of applications being self-contained sounds nice, in practice it really doesn't work that well; even if you find some app that provides functionality that you need - it is not always easy to plug it in and go - you will always need to edit/hack at it.
Evaluating django as a central platform at my work for developing pluggable apps led to a few roadblocks:
ORM - yes, its great - but it is very specific and tailored. I have used it when I need some quick data processing done, but other than that you need to dive into something proper like SQLAlchemy. One thing we can't do easily is fetch random samples. This became a problem for us on a small data set (538,000+ rows approx.) with postgres.
Template system - again, very specific to django-styled apps. No real concept of pluggable theme components unless you grow it yourself; and this means developing things that are already provided by other platforms.
Not really a point against django per-se but lack of a central place to provide common services turned out to be a big issue for us. For example, no central authentication provider which we can plug into, no abstracted way of providing data credentials (separating of roles). So when we move things to production servers; the database credentials can't be edited on the server (as in the case with Java) and the db guys have to mess with my code base.
All these things have led me to look at Java portal servers as my "platform" and specifically Liferay as it has Python support.
I suggest you look at the big picture first before you commit yourself to django. I really love the framework, and I use it all the time on one-off projects, but as a central platform for developing all that we may need - django is not the answer for us.
I have now delegated django for self contained projects - like some specific mini-site for a department. If we need to use Python for something else, I now evaluate Pyramid as its more pluggable. For anything that needs integration beyond our department, I look at Java.
If all that fails - only then do we go to .NET.
| 0 | 0 | 0 | 0 |
2010-02-24T14:29:00.000
| 7 | 1 | false | 2,326,671 | 0 | 0 | 1 | 4 |
I know that the word “enterprise” gives some people the creeps, but I am curious to know if anyone has experience creating enterprise applications, similar to something like say… Java EE applications, which are highly concurrent, distributed applications with Django? I know Java has its own issues but its kind of viewed as THE enterprise framework and I think that’s unfortunate.
Some people say that Rails is a good replacement for Java EE but what about Django? Has anyone ever used it in this context? You only ever see pretty standard websites on djangosites.org and it seems like its capable of so much more. I am planning on scrapping some of our old systems which are written mostly on ASP.NET and some Java for something more easily maintainable. I started using Django for some other applications and find it to be fantastic for what I am using it for (Corporate news, intranet, etc.) internally but what about something like… an accounts receivable system, or a billing system, etc.
I would hate to see a framework such as this pigeon-holed into a category it doesn't need to be. It seems to be used for social media/networking, content-heavy sites, not so much data processing, etc. I feel that it has all the elements needed to start down this path. Anyone have any thoughts?
|
Anyone using Django in the "Enterprise"
| 2,327,568 | 7 | 34 | 17,637 | 0 |
java,python,ruby-on-rails,django,enterprise
|
For the systems you want to replace, you may find that it is desirable to use something more powerful than Django's ORM like SQLAlchemy. It's not a question of scaling, but the fact is that Django's ORM makes it hard to build complex queries and often pushes you to do in Python what should be done by your RDBMS — when you don't have to resort to raw SQL. Although SQLAlchemy has a steeper learning curve, it has more features and is better suited to complex database operations. It's certainly worth your time to have a look at it before deciding on a web stack to build on.
This is probably less relevant to your questions but all the functionality in Django is also provided by other libraries that I find to be superior : Jinja2 for templating (it has the same syntax as Django templates without the mess that is the template tags system and better performance), WTForms for forms and modelforms, Babel for i18n (with many features not present in Django's own i18n library) and Werkzeug to provide a complete WSGI interface with URL routing.
| 0 | 0 | 0 | 0 |
2010-02-24T14:29:00.000
| 7 | 1 | false | 2,326,671 | 0 | 0 | 1 | 4 |
I know that the word “enterprise” gives some people the creeps, but I am curious to know if anyone has experience creating enterprise applications, similar to something like say… Java EE applications, which are highly concurrent, distributed applications with Django? I know Java has its own issues but its kind of viewed as THE enterprise framework and I think that’s unfortunate.
Some people say that Rails is a good replacement for Java EE but what about Django? Has anyone ever used it in this context? You only ever see pretty standard websites on djangosites.org and it seems like its capable of so much more. I am planning on scrapping some of our old systems which are written mostly on ASP.NET and some Java for something more easily maintainable. I started using Django for some other applications and find it to be fantastic for what I am using it for (Corporate news, intranet, etc.) internally but what about something like… an accounts receivable system, or a billing system, etc.
I would hate to see a framework such as this pigeon-holed into a category it doesn't need to be. It seems to be used for social media/networking, content-heavy sites, not so much data processing, etc. I feel that it has all the elements needed to start down this path. Anyone have any thoughts?
|
It is said best way to deploy django is using wsgi, I am wondering why?
| 2,327,403 | 15 | 7 | 1,155 | 0 |
python,django,mod-wsgi,wsgi,django-wsgi
|
wsgi is usually preferred because it decouples your choice of framework from your choice of web server: if tomorrow you want to move, say, from Apache to nginx, or whatever, the move is trivially easy with wsgi, not so easy otherwise.
Furthermore, using wsgi affords you the option to add some middleware that's framework-independent, rather than having to rely on every possible functionality you want having already been implemented and made available for your framework of choice.
| 0 | 0 | 0 | 0 |
2010-02-24T15:54:00.000
| 3 | 1.2 | true | 2,327,355 | 0 | 0 | 1 | 2 |
We are deploying django application, I found in the documentation that it is recommended to use WSGI appoach for doing that.
Before deploying I wanted to know, why it is recommended over other two approaches i.e. using mod_python and fastcgi...
Thanks a lot.
|
It is said best way to deploy django is using wsgi, I am wondering why?
| 2,327,392 | 5 | 7 | 1,155 | 0 |
python,django,mod-wsgi,wsgi,django-wsgi
|
We tried mod_python. It's slower and harder to configure. It doesn't offer the daemon feature.
We couldn't get fast_cgi built for our combination of Apache, Red Hat and Python. I'm not sure specifically what was wrong, but we couldn't get it built properly. It wouldn't dispatch requests to Django properly, and we couldn't diagnose the problem.
We tried mod_wsgi third. It built nicely. It has the daemon option. It's very easy to configure. It allows trivial restart of the Django applications without restarting all of Apache.
| 0 | 0 | 0 | 0 |
2010-02-24T15:54:00.000
| 3 | 0.321513 | false | 2,327,355 | 0 | 0 | 1 | 2 |
We are deploying django application, I found in the documentation that it is recommended to use WSGI appoach for doing that.
Before deploying I wanted to know, why it is recommended over other two approaches i.e. using mod_python and fastcgi...
Thanks a lot.
|
Django i18n: Common causes for translations not appearing
| 17,742,639 | 0 | 26 | 9,733 | 0 |
python,django,translation,gettext,django-multilingual
|
Another cause can be a wrong directory structure.
Read well the manage command's error message about which directory to create before running the makemassages command for the app translation. (It must be locale for an app, not conf/locale.) Note that the management commands work fine even with the wrong directory structure.
| 0 | 0 | 0 | 0 |
2010-02-24T17:45:00.000
| 9 | 0 | false | 2,328,185 | 0 | 0 | 1 | 5 |
I am making a multilingual Django website. I created a messages file, populated and compiled it. I checked the site (the admin in this case,) in my wanted language (Hebrew) and most phrases appear in Hebrew like they should, but some don't. I checked the source and these still appear as _('Whatever') like they should, also they are translated on the messages file, and yes, I remembered to do compilemessages.
What are some common causes for translations not to appear like that?
|
Django i18n: Common causes for translations not appearing
| 18,593,863 | 0 | 26 | 9,733 | 0 |
python,django,translation,gettext,django-multilingual
|
I noticed that when I had % in my text, the translated text was not being used. There may be other characters that can cause this problem. I fixed the problem by escaping the % as %%.
| 0 | 0 | 0 | 0 |
2010-02-24T17:45:00.000
| 9 | 0 | false | 2,328,185 | 0 | 0 | 1 | 5 |
I am making a multilingual Django website. I created a messages file, populated and compiled it. I checked the site (the admin in this case,) in my wanted language (Hebrew) and most phrases appear in Hebrew like they should, but some don't. I checked the source and these still appear as _('Whatever') like they should, also they are translated on the messages file, and yes, I remembered to do compilemessages.
What are some common causes for translations not to appear like that?
|
Django i18n: Common causes for translations not appearing
| 65,446,782 | 0 | 26 | 9,733 | 0 |
python,django,translation,gettext,django-multilingual
|
My answer here, all my translations were working except for 2 DateFields that I was using in a ModelForm.
Turns out that I had a widget in my forms.py that was not working well with the translations.
I just removed it for now so I can enjoy Xmas =D
| 0 | 0 | 0 | 0 |
2010-02-24T17:45:00.000
| 9 | 0 | false | 2,328,185 | 0 | 0 | 1 | 5 |
I am making a multilingual Django website. I created a messages file, populated and compiled it. I checked the site (the admin in this case,) in my wanted language (Hebrew) and most phrases appear in Hebrew like they should, but some don't. I checked the source and these still appear as _('Whatever') like they should, also they are translated on the messages file, and yes, I remembered to do compilemessages.
What are some common causes for translations not to appear like that?
|
Django i18n: Common causes for translations not appearing
| 2,381,694 | 37 | 26 | 9,733 | 0 |
python,django,translation,gettext,django-multilingual
|
Maybe the translated strings are marked as fuzzy?
| 0 | 0 | 0 | 0 |
2010-02-24T17:45:00.000
| 9 | 1.2 | true | 2,328,185 | 0 | 0 | 1 | 5 |
I am making a multilingual Django website. I created a messages file, populated and compiled it. I checked the site (the admin in this case,) in my wanted language (Hebrew) and most phrases appear in Hebrew like they should, but some don't. I checked the source and these still appear as _('Whatever') like they should, also they are translated on the messages file, and yes, I remembered to do compilemessages.
What are some common causes for translations not to appear like that?
|
Django i18n: Common causes for translations not appearing
| 4,087,770 | 8 | 26 | 9,733 | 0 |
python,django,translation,gettext,django-multilingual
|
Hi just attach some fixes I had to do in the past:
Restart the webserver!
In the setting file
- USE_I18N = True is needed
django.middleware.locale.LocaleMiddleware among middleware modules (but this is not your case for sure as long as Django will not care about your local at all)
django.core.context_processors.i18n among TEMPLATE_CONTEXT_PROCESSORS
for sure I had other issues related to translations but I don't remember them all... hope this can help!
| 0 | 0 | 0 | 0 |
2010-02-24T17:45:00.000
| 9 | 1 | false | 2,328,185 | 0 | 0 | 1 | 5 |
I am making a multilingual Django website. I created a messages file, populated and compiled it. I checked the site (the admin in this case,) in my wanted language (Hebrew) and most phrases appear in Hebrew like they should, but some don't. I checked the source and these still appear as _('Whatever') like they should, also they are translated on the messages file, and yes, I remembered to do compilemessages.
What are some common causes for translations not to appear like that?
|
Any potential gotchas or things to be aware of for a newcomer to Django?
| 2,328,803 | 4 | 2 | 145 | 0 |
python,django
|
Use forms for all data validation. Bulk loading, batch processing, web services, everything.
At first, it seems odd to read a CSV file, populate a Form, and then have the Form validate the data and build the database object. But that's the way it's supposed to work. Use the Forms for all validation no matter what the data source.
| 0 | 0 | 0 | 0 |
2010-02-24T19:15:00.000
| 3 | 0.26052 | false | 2,328,767 | 0 | 0 | 1 | 2 |
In other words, what did you not know when you started with Django that you wish someone had told you?
I've dabbled some in Django but nothing really serious. However, I'm hoping to change that, and I'm wondering if there's any gotchas/shortcomings/whatever that I need to be aware of as I go.
|
Any potential gotchas or things to be aware of for a newcomer to Django?
| 2,328,793 | 4 | 2 | 145 | 0 |
python,django
|
You can't process data in templates. There are a fair number of questions in SO from people trying to do "real" processing in the templates. The Django template language is -- intentionally -- not JSP or ASP or PHP. It just does presentation and retrieval of values computed in view functions.
If you can't figure out how to do it in the template, you may be trying to do too much. Use the view functions as much as possible.
| 0 | 0 | 0 | 0 |
2010-02-24T19:15:00.000
| 3 | 0.26052 | false | 2,328,767 | 0 | 0 | 1 | 2 |
In other words, what did you not know when you started with Django that you wish someone had told you?
I've dabbled some in Django but nothing really serious. However, I'm hoping to change that, and I'm wondering if there's any gotchas/shortcomings/whatever that I need to be aware of as I go.
|
Client polling (reverse AJAX) for chat requests in Django?
| 2,329,704 | 2 | 0 | 1,063 | 0 |
python,ajax,django,session,reverse-ajax
|
A database table for this would put a load on your server, as you said, but might be useful if you want to keep a record of these requests for whatever reason.
Using something like memcached or an AMQP server might give you better performance. If you like you could even use a higher-performance key-value-store such as Tokyo Cabinet / Tokyo Tyrant.
| 0 | 0 | 0 | 0 |
2010-02-24T21:20:00.000
| 2 | 1.2 | true | 2,329,627 | 0 | 0 | 1 | 1 |
I want to make it that one user on the site can chat request another user on my Django site. I want the requestee to get a realtime box that say: "Do you want to chat?"
How does the following client polling approach sound:
user1 clicks on users2 nickname, generating a POST request to some /message/requests, which creates a Message of type CHAT_REQUEST in the database. Meanwhile, a Javascript piece at user2's browser, repeatedly queries the server for message updates. When it receives a Message of type CHAT_REQUEST it opens a popup...
The problem with this approach seems to be the database access.
If the client is polling every 10 seconds, and 100 users leave their browser windows open, that is 10 database requests per seconds.
Would it be better to store these messages not in the database, but in Django RAM or session information? Or will this database table be cached in RAM with PostgreSQL, and the retrieval fast?
|
Customizing the language-guessing algorithm in Django
| 2,336,824 | 0 | 0 | 269 | 0 |
python,django,django-multilingual
|
Maybe you don't have to override anything. You can just check on the first page, (or maybe every page) if the user already has a language cookie and otherwise redirect him to the set_language redirect view. In that way you could force the language to Hebrew.
If the user decides to change back to English, he can do it very easily.
| 0 | 0 | 0 | 0 |
2010-02-25T13:54:00.000
| 2 | 1.2 | true | 2,334,402 | 0 | 0 | 1 | 1 |
I'm developing a multilingual Django website. It has two languages, English and Hebrew. I want the default language for every first-time visitor to be Hebrew, regardless of what his browser's Accept-Language is.
Of course, if he changes language to English (and thus gets the language cookie or the key in the session), it should remain at English.
I think I can program this algorithm myself, but where do I "plug it in"? How do I make my project use it?
|
Send Email in Django without SMTP server. Like php mail() function does
| 2,335,399 | 2 | 8 | 7,844 | 0 |
python,django,email
|
So how does PHP do it? By magic?
If you don't have an SMTP server, sign up for a GMail account and use that.
| 0 | 0 | 0 | 1 |
2010-02-25T15:56:00.000
| 5 | 0.07983 | false | 2,335,384 | 0 | 0 | 1 | 1 |
As far as I read, Django only supports sending mails using SMTP.
I would like to send Emails from my script in Django, but do not want to setup SMTP server (it's too complex for me, I'm a linux newbie).
Is it possible, to send mails in Django in the same way like I do it in PHP, without providing SMTP login, password and etc?
|
How can I make URLs in Django similar to stackoverflow?
| 2,340,258 | -3 | 6 | 826 | 0 |
python,django,url,friendly-url,slug
|
With all due respect to Stackoverflow, this is the wrong way to do it. You shouldn't need to have two elements in the URL that identify the page. The ID is irrelevant - it's junk. You should be able to uniquely identify a page from the slug alone.
| 0 | 0 | 0 | 0 |
2010-02-26T04:08:00.000
| 3 | -0.197375 | false | 2,339,436 | 0 | 0 | 1 | 1 |
I'm creating a video site. I want my direct urls to a video to look like example.com/watch/this-is-a-slug-1 where 1 is the video id. I don't want the slug to matter though. example.com/watch/this-is-another-slug-1 should point to the same page. On SO, /questions/id is the only part of the url that matters. How can I do that?
|
In a MVC patterned framework where would a screen-scraping module be located?
| 2,342,211 | 0 | 1 | 643 | 0 |
python,ruby-on-rails,model-view-controller
|
It depends on how you are planning on implementing the scraper. If you are going to have a UI where you click a button to scrape a screen then it is going to be in all three (M, V, and C). If it is going to be a background process (like mentioned before) it should be in M and C.
| 0 | 0 | 0 | 0 |
2010-02-26T13:50:00.000
| 4 | 0 | false | 2,342,033 | 0 | 0 | 1 | 3 |
In a MVC patterned framework where would a screen-scraping module most logically be located? In the model or the controller? Or is it completely outside of this pattern?
|
In a MVC patterned framework where would a screen-scraping module be located?
| 2,342,064 | 0 | 1 | 643 | 0 |
python,ruby-on-rails,model-view-controller
|
In a sense, the screen-scraper is the user of the application -- I'd think it would be a piece outside the MVC that interacts with the controller, just like a web page sends information to the controller. This would make it easy to put a web page over it if the interface changes.
| 0 | 0 | 0 | 0 |
2010-02-26T13:50:00.000
| 4 | 0 | false | 2,342,033 | 0 | 0 | 1 | 3 |
In a MVC patterned framework where would a screen-scraping module most logically be located? In the model or the controller? Or is it completely outside of this pattern?
|
In a MVC patterned framework where would a screen-scraping module be located?
| 2,342,101 | 0 | 1 | 643 | 0 |
python,ruby-on-rails,model-view-controller
|
I presume the scraper is only used to collect data.
if the data is scraped and stored, this process does not simply drop into either M V or C. You could run this scrapping process as a cron job on intervals you define, store the data and then define models to access the data.
i wouldn't recommend calling the scrapping process every-time the controller requests the model, unless you are caching the scrap request.
EDIT:
the cron could be a controller, but not publicly callable.
| 0 | 0 | 0 | 0 |
2010-02-26T13:50:00.000
| 4 | 0 | false | 2,342,033 | 0 | 0 | 1 | 3 |
In a MVC patterned framework where would a screen-scraping module most logically be located? In the model or the controller? Or is it completely outside of this pattern?
|
How to add an Admin class to a model after syncdb?
| 2,344,046 | 1 | 0 | 187 | 0 |
python,django,django-models,django-south
|
You seem to be very confused, unfortunately. Of course Django reads the code in models.py - otherwise what would be the point of it? Django uses that code initially to define the model SQL when doing syncdb, but it doesn't modify existing database tables in subsequent calls to syncdb - hence the need for South.
But naturally, Django uses models.py and admin.py and all the other Python code to define its own configuration and state. (And note that admin classes are not defined in models.py but in admin.py.)
If you are not seeing changes, you will need to restart your server.
| 0 | 0 | 0 | 0 |
2010-02-26T16:24:00.000
| 3 | 1.2 | true | 2,343,053 | 0 | 0 | 1 | 3 |
I added some models in my models.py and I want to add an admin class to use a wysiwyg-editor in text-fields.
Well, I know that Django itself doesn't support migrations and I've used South, but it doesn't work either.
South doesn't "see" the change.
Could it be, that South just detects changes to fields, but not if I add a new class?
How can I tweak Django to detect such changes?
|
How to add an Admin class to a model after syncdb?
| 2,343,100 | 1 | 0 | 187 | 0 |
python,django,django-models,django-south
|
I'm fairly sure that if you follow the steps as outlined in the tutorial to create an admin app it'll just work. Migration isn't an issue as the admin app creates new tables rather than altering the existing one.
| 0 | 0 | 0 | 0 |
2010-02-26T16:24:00.000
| 3 | 0.066568 | false | 2,343,053 | 0 | 0 | 1 | 3 |
I added some models in my models.py and I want to add an admin class to use a wysiwyg-editor in text-fields.
Well, I know that Django itself doesn't support migrations and I've used South, but it doesn't work either.
South doesn't "see" the change.
Could it be, that South just detects changes to fields, but not if I add a new class?
How can I tweak Django to detect such changes?
|
How to add an Admin class to a model after syncdb?
| 2,343,087 | 2 | 0 | 187 | 0 |
python,django,django-models,django-south
|
syncdb and South are only concerned with descendants of Model in apps listed in INSTALLED_APPS. Everything else is handled by Django directly.
| 0 | 0 | 0 | 0 |
2010-02-26T16:24:00.000
| 3 | 0.132549 | false | 2,343,053 | 0 | 0 | 1 | 3 |
I added some models in my models.py and I want to add an admin class to use a wysiwyg-editor in text-fields.
Well, I know that Django itself doesn't support migrations and I've used South, but it doesn't work either.
South doesn't "see" the change.
Could it be, that South just detects changes to fields, but not if I add a new class?
How can I tweak Django to detect such changes?
|
Creating a Persistent Data Object In Django
| 2,345,334 | 2 | 6 | 5,288 | 0 |
python,django,persistence
|
Consider running it in another process. You could have your Django application submit samples via a socket that the classifier process listens on, or you could run a queue and have Django submit requests to the queue.
| 0 | 0 | 0 | 0 |
2010-02-26T22:24:00.000
| 2 | 0.197375 | false | 2,345,257 | 0 | 0 | 1 | 1 |
I have a Python-based maximum entropy classifier. It's large, stored as a Pickle, and takes about a minute to unserialize. It's also not thread safe. However, it runs fast and can classify a sample (a simple Python dictionary) in a few milliseconds.
I'd like to create a basic Django web app, so users can submit samples to classify in realtime. How would I load the classifier into persistent memory once, and then regulate it so that each request can access the object without conflicting with other requests?
|
Unable to get custom context processor to be invoked
| 2,348,959 | 5 | 8 | 3,744 | 0 |
python,django,django-templates,django-context
|
The setting name should be TEMPLATE_CONTEXT_PROCESSORS, with an S.
| 0 | 0 | 0 | 0 |
2010-02-27T20:57:00.000
| 1 | 1.2 | true | 2,348,943 | 0 | 0 | 1 | 1 |
I am trying to create a custom context processor which will render a list of menu items for a logged in user. I have done the following:
Within my settings.py I have
TEMPLATE_CONTEXT_PROCESSOR = (
'django.contrib.auth.context_processors.auth',
'mysite.accounts.context_processors.user_menu',
)
Under the accounts submodule I have context_processors.py with the following, for now:
def user_menu(request):
return {'user_menu':'Hello World'}
On my template page I have the following:
{% if user.is_authenticated %}
Menu
{{user_menu}}
{% endif %}
The invoking view is as follows:
def profile(request):
return render_to_response('accounts/profile.html',context_instance=RequestContext(request))
However I am unable to get the {{user_menu}} to render anything on the page, I know the user is authenticated as other sections of the template with similar checks render correctly. Am I missing something here. Please help
Thank you
Edit: Thanks Ben, Daniel, I have fixed the (S) in TEMPLATE_CONTEXT_PROCESSOR, however Django now has trouble resolving the module and I get the following message
Error importing request processor module django.contrib.auth.context_processors: "No module named context_processors"
UPDATE: I fixed it by changing the path to django.core.context_processors.auth Seems like the modules have been moved around
|
What can I do if django runserver seems to be caching my urls.py and settings.py?
| 2,349,845 | 2 | 1 | 460 | 0 |
python,django,url
|
You're not running what you think you're running. Check your PYTHONPATH.
| 0 | 0 | 0 | 0 |
2010-02-27T23:02:00.000
| 1 | 1.2 | true | 2,349,302 | 0 | 0 | 1 | 1 |
I detected this problem when updating the patterns in URLConf and seeing that the new pattern wasn't matched anywhere.
So, with urls.py I don't get anywhere when writing random lines on it, I mean, invalid code, and django doesn't throw any exception and serves the urls just fine.
So I checked ROOT_URLCONF in settings.py, and it points to "projectname.urls" so it's reading the right file. I tried deleting urls.py, and the server keeps running and serving just fine. Then I deleted settings.py, just to see if it wasn't being read, and that gave me the expected exception.
I deleted all *.pyc too, restarted runserver many times, and even restarted the whole computer. I also tried deleting the db and running syncdb again.
I created a new empty project, and it runs just fine.
I'm running the latest development version:
Django version 1.2 beta 1 SVN-12617, using settings 'cms.settings'
I am asking for any kind of help of how to override this behavior, I mean, there must be something that's misconfigured.
|
Accessing a ServerFactory from the Service in Twisted
| 2,353,932 | 2 | 1 | 408 | 0 |
python,twisted
|
Well, after some help from a friend. I figured it out. If you create a multiservice, you can just pass the multiservice object to all your child services (I pass it in the init). Then you do setName('servicename'). Then from another service you can just get the information like so: x = self.multiService.getServiceNamed('servicename') and access it that way. Works like a charm!
-omgpants
| 0 | 1 | 0 | 0 |
2010-02-28T07:19:00.000
| 1 | 0.379949 | false | 2,350,394 | 0 | 0 | 1 | 1 |
I've been trying to come up with a decent design for multiple factories access each others information. For example, I have the following services: 1 management web service, a VirtualHost instance (multiple domains) and a built in DNS service. Going through the finger tutorial was very helpful but it lacks some key points. It never has a service accessing or executing a method of a factory. I have a hard time believing everyone is implementing 100% of all their logic inside of a single service, and just using the various factories to call those methods defined in the service. If I wanted to update my DNS records, how would my management service tell the DNS Factory, 'hey reload your authority files'?
Any hints on how everyone else is doing this sort of inter-factory inter-service communication?
|
Clearing Django form fields on form validation error?
| 2,353,816 | -2 | 7 | 12,273 | 0 |
python,django,django-forms
|
I guess you need to use JavaScript to hide or remove the text from the container.
| 0 | 0 | 0 | 0 |
2010-03-01T03:27:00.000
| 7 | -0.057081 | false | 2,353,732 | 0 | 0 | 1 | 1 |
I have a Django form that allows a user to change their password. I find it confusing on form error for the fields to have the *'ed out data still in them.
I've tried several methods for removing form.data, but I keep getting a This QueryDict instance is immutable exception message.
Is there a proper way to clear individual form fields or the entire form data set from clean()?
|
Remote system event Notification Library
| 2,354,106 | 1 | 0 | 286 | 0 |
java,python
|
I think you are looking for a queuing system. Give JMS a try.
| 0 | 0 | 0 | 0 |
2010-03-01T05:31:00.000
| 1 | 1.2 | true | 2,354,064 | 0 | 0 | 1 | 1 |
Hi I am looking for some sort of library that will allow:
- multiple remote applications to register with the system on which events it is interested in
- When this event occurs, the system will sent out notification to these remote applications regarding this event
- Objects, or hash tables information should be able to be exchanged as well between the system and the remote application
The system will be implemented in either Python, or Java, and it will serve as a middleware between a database and external applications. I am not sure if such a library exists, or if it will most suited to implement this as message exchanges. I have heard of twisted, pyro, but not sure of the extent of their capabilities. I had used RPyC previously, but it don't seem to fit the picture naturally. If someone can also point out what is available on the java side as well, I would really appreciated.
Plz advise, thnx!
|
Making Django development server faster at serving static media
| 3,426,911 | 2 | 12 | 6,082 | 0 |
python,django
|
Run lighttpd to serve the static content and use the MEDIA_URL to point the pages at the lighttpd server that servers the static stuff.
| 0 | 0 | 0 | 0 |
2010-03-01T19:26:00.000
| 6 | 0.066568 | false | 2,358,450 | 0 | 0 | 1 | 1 |
I'm using the Django manage.py runserver for developing my application (obviously), but it takes 10 seconds to completely load a page because the development server is very, very slow at serving static media.
Is there any way to speed it up or some kind of workaround? I'm using Windows 7.
|
Compatibility with IIS and Apache -- PHP, Python, etc?
| 2,359,411 | 0 | 1 | 1,120 | 0 |
php,python,apache,iis
|
I have several production php5/6 applications that run on either windows/iis and apache/linux. switching between platforms has not been an issue for me. i test on a windows server talking to a mysql db on a linux machine. i deploy to a linux web server without issue. i cannot speak for rails or pytong as i'm not a ruby or python guy. however, they should work fine from what i understand of them. if i were you i'd pick the language you have the most experience with.
| 0 | 0 | 0 | 1 |
2010-03-01T21:49:00.000
| 2 | 0 | false | 2,359,314 | 0 | 0 | 1 | 2 |
I'm currently planning out a web app that I want to host for people and allow them to host themselves on either Linux/Apache of IIS6 or IIS7 (for the benefits of bandwidth, directory services [login, etc.]).
I see that PHP is supported on both platforms. I've heard people serving Django and Python in IIS using PyISAPIe. I'm not sure about Ruby/Rails on IIS until IronRuby ships. I don't have much Perl experience but understand it would run in IIS as well.
Anyone have input for me? Thanks in advance.
|
Compatibility with IIS and Apache -- PHP, Python, etc?
| 2,359,605 | 0 | 1 | 1,120 | 0 |
php,python,apache,iis
|
Your lowest common denominator for building apps to seemlessly run on both the LAMP and Microsoft stacks is PHP.
Perl is another option, it's well supported on both Windows and Linux/Apache. But I think I'd be choosing PHP over Perl because of support for FastCGI which improves reliability and performance on the Windows stack. Microsoft and Zend have been doing a lot of work on PHP for Windows so that you can write PHP apps and confidently expect them to run well on both platforms. The proof of the pudding of this is that Joomla, WordPress, phpBBS and many other of the well known open source PHP applications run straight out of the box on Windows.
Also as a developer and third line support engineer for a shared web hosting company, with a fair bit of experience in this area, I'd say that PHP on Windows is every bit as flexible, performant and reliable as PHP on the LAMP stack.
Finally, Ruby on Rails and Python/DJango aren't well supported options on IIS and will be non-existant on shared hosting platforms. This is mostly due to the amount of console access you'd need to knock things into shape to be able to run Rails/DJango.
| 0 | 0 | 0 | 1 |
2010-03-01T21:49:00.000
| 2 | 1.2 | true | 2,359,314 | 0 | 0 | 1 | 2 |
I'm currently planning out a web app that I want to host for people and allow them to host themselves on either Linux/Apache of IIS6 or IIS7 (for the benefits of bandwidth, directory services [login, etc.]).
I see that PHP is supported on both platforms. I've heard people serving Django and Python in IIS using PyISAPIe. I'm not sure about Ruby/Rails on IIS until IronRuby ships. I don't have much Perl experience but understand it would run in IIS as well.
Anyone have input for me? Thanks in advance.
|
Python directory list returned to Django template
| 2,360,257 | 1 | 0 | 2,696 | 0 |
python,list,directory-structure
|
If it's a single directory, os.listdir('thedirectory') will give you a list of filename strings that seem to be suitable for your purposes (though it won't make "the urls" -- not sure how you want to make them?). If you need a whole tree of directories (recursively including subdirectories) then it's worth debugging your failed attempts at using os.walk, but it's hard for us to spot the bugs in code that we're not shown;-).
| 0 | 0 | 0 | 0 |
2010-03-02T00:50:00.000
| 2 | 0.099668 | false | 2,360,205 | 0 | 0 | 1 | 1 |
Total Python newb here. I have a images directory and I need to return the names and urls of those files to a django template that I can loop through for links. I know it will be the server path, but I can modify it via JS. I've tried os.walk, but I keep getting empty results.
|
Pickled Object Versioning
| 2,361,252 | 7 | 10 | 2,902 | 0 |
python,serialization,pickle,serialversionuid
|
The pickle format has no such proviso. Why don't you just make the "serial version number" part of the object's attributes, to be pickled right along with the rest? Then the "notification" can be trivially had by comparing actual and desired version -- don't see why it should be a PITA.
| 0 | 0 | 0 | 0 |
2010-03-02T05:45:00.000
| 2 | 1.2 | true | 2,361,140 | 0 | 0 | 1 | 1 |
I am working on a project where we have a large number of objects being serialized and stored to disk using pickle/cPickle.
As the life of the project progresses (after release to customers in the field) it is likely that future features/fixes will require us to change the signature of some of our persisted objects. This could be the addition of fields, removing of fields, or even just changing the invariants on a piece of data.
Is there a standard way to mark an object that will be pickled as having a certain version (like serialVersionUID in Java)? Basically, if I am restoring an instance of Foo version 234 but the current code is 236 I want to receive some notification on unpickle. Should I just go ahead and roll out my own solution (could be a PITA).
Thanks
|
Simple and effective web framework
| 2,362,938 | 5 | 4 | 1,599 | 0 |
python,web-frameworks
|
This question is based on a complete failure to understand any of the tools you have apparently "investigated", or indeed web serving generally.
Django has an admin panel? Well, don't use it if you don't want to. There's no configuration that needs to be done there, it's for managing your data if you want.
PHP has chown problems? PHP is a language, not a framework. If you try and run something with it, you'll need to set permissions appropriately. This would be the case whatever language you use.
You want something that doesn't need to know its address or where its files are? What does that even mean? If you are setting up a webserver, it needs to know what address to respond to. Then it needs to know what code to run in response to a request. Without configuring somewhere the address and the path to the files, nothing can ever happen.
| 0 | 0 | 0 | 0 |
2010-03-02T11:49:00.000
| 12 | 0.083141 | false | 2,362,840 | 0 | 0 | 1 | 5 |
I'm looking for a suitable cross-platform web framework (if that's the proper term). I need something that doesn't rely on knowing the server's address or the absolute path to the files. Ideally it would come with a (development) server and be widely supported.
I've already tried PHP, Django and web2py. Django had an admin panel, required too much information (like server's address or ip) and felt unpleasant to work with; PHP had chown and chmod conflicts with the server (the code couldn't access uploaded files or vice versa) and couldn't handle urls properly; web2py crashed upon compiling and the manual didn't cover that -- not to mention it required using the admin panel. Python is probably the way to go, but even the amount of different web frameworks and distributions for Python is too much for me to install and test individually.
What I need is a simple and effective cross-platform web development language that works pretty much anywhere. No useless admin panels, no fancy user interfaces, no databases (necessarily), no restrictions like users/access/levels and certainly no "Web 2.0" crap (for I hate that retronym). Just an all-powerful file and request parser.
I'm used to programming in C and other low level languages, so difficulty is not a problem.
|
Simple and effective web framework
| 2,363,485 | 1 | 4 | 1,599 | 0 |
python,web-frameworks
|
What I need is a simple and effective cross-platform web development language that works pretty much anywhere.
Have you tried HTML?
But seriously, I think Pekka is right when he says you need to specify and clarify what you want.
Most of the features you don't want are standard modules of a web app (user and role mgmt., data binding, persistence, interfaces).
We use any or a mix of the following depending on customer requirements: perl, PHP, Flash, Moonlight, JSP, JavaScript, Java, (D/X)HTML, zk.
| 0 | 0 | 0 | 0 |
2010-03-02T11:49:00.000
| 12 | 0.016665 | false | 2,362,840 | 0 | 0 | 1 | 5 |
I'm looking for a suitable cross-platform web framework (if that's the proper term). I need something that doesn't rely on knowing the server's address or the absolute path to the files. Ideally it would come with a (development) server and be widely supported.
I've already tried PHP, Django and web2py. Django had an admin panel, required too much information (like server's address or ip) and felt unpleasant to work with; PHP had chown and chmod conflicts with the server (the code couldn't access uploaded files or vice versa) and couldn't handle urls properly; web2py crashed upon compiling and the manual didn't cover that -- not to mention it required using the admin panel. Python is probably the way to go, but even the amount of different web frameworks and distributions for Python is too much for me to install and test individually.
What I need is a simple and effective cross-platform web development language that works pretty much anywhere. No useless admin panels, no fancy user interfaces, no databases (necessarily), no restrictions like users/access/levels and certainly no "Web 2.0" crap (for I hate that retronym). Just an all-powerful file and request parser.
I'm used to programming in C and other low level languages, so difficulty is not a problem.
|
Simple and effective web framework
| 2,362,857 | 0 | 4 | 1,599 | 0 |
python,web-frameworks
|
I'd say Ruby on Rails is what you're looking for. Works anywhere, and no configuration needed. You only have it installed, install the gems you need, and off you go.
I also use ColdFusion, which is totally multi-platform, but relies on the Administrator settings for DSN configuration and stuff.
| 0 | 0 | 0 | 0 |
2010-03-02T11:49:00.000
| 12 | 0 | false | 2,362,840 | 0 | 0 | 1 | 5 |
I'm looking for a suitable cross-platform web framework (if that's the proper term). I need something that doesn't rely on knowing the server's address or the absolute path to the files. Ideally it would come with a (development) server and be widely supported.
I've already tried PHP, Django and web2py. Django had an admin panel, required too much information (like server's address or ip) and felt unpleasant to work with; PHP had chown and chmod conflicts with the server (the code couldn't access uploaded files or vice versa) and couldn't handle urls properly; web2py crashed upon compiling and the manual didn't cover that -- not to mention it required using the admin panel. Python is probably the way to go, but even the amount of different web frameworks and distributions for Python is too much for me to install and test individually.
What I need is a simple and effective cross-platform web development language that works pretty much anywhere. No useless admin panels, no fancy user interfaces, no databases (necessarily), no restrictions like users/access/levels and certainly no "Web 2.0" crap (for I hate that retronym). Just an all-powerful file and request parser.
I'm used to programming in C and other low level languages, so difficulty is not a problem.
|
Simple and effective web framework
| 2,362,864 | -1 | 4 | 1,599 | 0 |
python,web-frameworks
|
I think you need to focus on Restful web applications. Zend is a PHP based MVC framework.
| 0 | 0 | 0 | 0 |
2010-03-02T11:49:00.000
| 12 | -0.016665 | false | 2,362,840 | 0 | 0 | 1 | 5 |
I'm looking for a suitable cross-platform web framework (if that's the proper term). I need something that doesn't rely on knowing the server's address or the absolute path to the files. Ideally it would come with a (development) server and be widely supported.
I've already tried PHP, Django and web2py. Django had an admin panel, required too much information (like server's address or ip) and felt unpleasant to work with; PHP had chown and chmod conflicts with the server (the code couldn't access uploaded files or vice versa) and couldn't handle urls properly; web2py crashed upon compiling and the manual didn't cover that -- not to mention it required using the admin panel. Python is probably the way to go, but even the amount of different web frameworks and distributions for Python is too much for me to install and test individually.
What I need is a simple and effective cross-platform web development language that works pretty much anywhere. No useless admin panels, no fancy user interfaces, no databases (necessarily), no restrictions like users/access/levels and certainly no "Web 2.0" crap (for I hate that retronym). Just an all-powerful file and request parser.
I'm used to programming in C and other low level languages, so difficulty is not a problem.
|
Simple and effective web framework
| 2,363,373 | 0 | 4 | 1,599 | 0 |
python,web-frameworks
|
Use plain old ASP. IIS does not care where files are stored. All paths can be set relative from the virtual directory. That means you can include "/myproject/myfile.asp", whereas in PHP it's often done using relative paths. Global.asa then contains global configuration for the application. You hardly ever have to worry about relative paths in the code.
In PHP you'd have include(dirname(FILE) . '/../../myfile.php") which is of course fugly. The only 'solution' I found for this is making HTML files and then using SSI (server side includes).
The only downside to ASP is the availability, since it has to run on Windows. But ASP files just run, and there's not complex Linux configuration to worry about. The language VBScript is extremely simple, but you can also choose to write server side JavaScript, since you're familiar with C.
| 0 | 0 | 0 | 0 |
2010-03-02T11:49:00.000
| 12 | 0 | false | 2,362,840 | 0 | 0 | 1 | 5 |
I'm looking for a suitable cross-platform web framework (if that's the proper term). I need something that doesn't rely on knowing the server's address or the absolute path to the files. Ideally it would come with a (development) server and be widely supported.
I've already tried PHP, Django and web2py. Django had an admin panel, required too much information (like server's address or ip) and felt unpleasant to work with; PHP had chown and chmod conflicts with the server (the code couldn't access uploaded files or vice versa) and couldn't handle urls properly; web2py crashed upon compiling and the manual didn't cover that -- not to mention it required using the admin panel. Python is probably the way to go, but even the amount of different web frameworks and distributions for Python is too much for me to install and test individually.
What I need is a simple and effective cross-platform web development language that works pretty much anywhere. No useless admin panels, no fancy user interfaces, no databases (necessarily), no restrictions like users/access/levels and certainly no "Web 2.0" crap (for I hate that retronym). Just an all-powerful file and request parser.
I'm used to programming in C and other low level languages, so difficulty is not a problem.
|
How do I run Javascript tests in Windmill when using test_windmill for Django?
| 2,468,981 | 0 | 0 | 354 | 0 |
python,django,unit-testing,automated-tests,windmill
|
Ok, so couldn't find out how to do this so I'm running the website under Apache and using the windmill standard jstests parameter to run the Javascript tests against this.
| 0 | 0 | 0 | 1 |
2010-03-03T17:22:00.000
| 1 | 0 | false | 2,373,446 | 0 | 0 | 1 | 1 |
I'm using the Windmill test system and have it running using test_windmill for Django which works fine for the Python tests. I'd like this to run a suite of Javascript tests also whilst the Django test server is running. I've used the run_js_tests call from the Windmill shell which works fine but I can't find a way to have this run as part of the Python tests.
Does anyone know how to do this?
Thanks
Rob
|
global set up in django test framework?
| 17,461,581 | 3 | 12 | 2,735 | 0 |
python,django,testing
|
This is partially addressed in newer versions of python/django by setUpClass() which will at least allow me to run class level setup.
| 0 | 0 | 0 | 1 |
2010-03-03T19:11:00.000
| 3 | 0.197375 | false | 2,374,197 | 0 | 0 | 1 | 1 |
Is there some way (using the standard Django.test.TestCase framework) to perform a global initialization of certain variables, so that it only happens once.
Putting things setUp() makes it so that the variables are initialized before each test, which kills performance when the setup involves expensive operations. I'd like to run a setup type feature once, and then have the variables initialized here be visible to all my tests.
I'd prefer not to rewrite the test runner framework.
I am thinking of something similar to a before(:all) in the Ruby/RSpec world.
-S
|
Models in database speed vs static dictionaries speed
| 2,391,789 | 0 | 1 | 237 | 0 |
python,django,dictionary
|
If you need fast access from multiple processes, then a database is the best option for you.
However, if you just want to keep data in memory and access it from multiple places in the same process, then Python dictionaries will be faster than accessing a DB.
| 0 | 0 | 0 | 0 |
2010-03-06T07:58:00.000
| 3 | 0 | false | 2,391,788 | 1 | 0 | 1 | 1 |
I have a need for some kind of information that is in essence static. There is not much of this information, but alot of objects will use that information.
Since there is not a lot of that information (few dictionaries and some lists), I thought that I have 2 options - create models for holding that information in the database or write them as dictionaries/lists to some settings file. My question is - which is faster, to read that information from the database or from a settings file? In either case I need to be able to access that information in lot of places, which would mean alot of database read calls. So which would be faster?
|
Is there a better way to parse html tables than lxml
| 2,393,941 | 2 | 0 | 293 | 0 |
python,browser,lxml
|
Actually, browser engines are deliberately stupid in their parsing of HTML, assuming that what they get is only marginally correct. lxml and BeautifulSoup attempt to mimic this level of stupidity, so they are the correct tools to use.
| 0 | 0 | 0 | 0 |
2010-03-06T19:59:00.000
| 2 | 0.197375 | false | 2,393,917 | 0 | 0 | 1 | 1 |
I am working with html documents and ripping out tables to parse them if they turn out to be the correct tables. I am happy with the results - my extraction process successfully maps row labels and column headings in over 95% of the cases and in the cases it does not we can identify the problems and use other approaches.
In my scanning around the iternet I have come to understand that a browser has a very powerful 'engine' to properly display the contents of htm pages even if the underlying htm is mal-formed. The problems we have with parsing tables have to do with things like not being able to separate the header from the data rows or being able to separate the row labels from one or more of the adjacent data values and then not correctly parsing out adjacent data values. (We might have two data values that get mapped to one column heading instead of the two adjacent column headings. That is if I have a column heading labeled apple and then one labeled banana I might have the value '1125 12345' assigned to the banana (or apple) column heading in the output instead of having the value 1125 assigned to apple and 12345 assigned to banana.
As I said at the beginning- we get it right 95% of the time and we can tell in the output when there is a problem. I am starting to think we have gone as far as we can using logic and inferences from the html to clean these up so I am beginning to wonder if I need a new approach.
Is there a way to harness the 'engine' of a browser to help with this parser. Ultimately if the browser can properly display the columns and rows so they are properly displayed on the screen then there is some technology that handles even when the row and column spans are not consistent (for example).
Thanks for any observations
|
Calling an executable from within Python / Django web application running on IIS
| 2,395,623 | 0 | 1 | 1,622 | 0 |
python,windows,django,iis,executable
|
Might be a permissions issue. when you run from the shell, you're using the user that run the python manage.py shell command. When serving requests from the IIS you're using its user (IUSR or something like that). Try giving execution permission on the executable file to the Everyone group just to see if it helps.
| 0 | 1 | 0 | 0 |
2010-03-06T20:48:00.000
| 1 | 0 | false | 2,394,054 | 0 | 0 | 1 | 1 |
I have a Python / Django application which is supposed to call an external windows binary and get its output at some point. And it does so when tested via 'python manage.py shell'.
But when it is run from within the web browser, which is served by IIS, the external application is not executed.
Is IIS blocking something on the way? Can this be avoided?
Any help is much appreciated.
oMat
|
Python _ctypes import error on OSX 10.6
| 2,394,908 | 0 | 3 | 2,937 | 0 |
python,macos
|
The only thing that I can think of is that maybe it's not on your path. Seems unlikely, but I would check that anyways.
| 0 | 1 | 0 | 0 |
2010-03-07T02:09:00.000
| 4 | 0 | false | 2,394,903 | 0 | 0 | 1 | 2 |
I'm very new to Python development, and am having a problem with one of my apps in OSX.
Technologies being used in this project
python 2.6
django
google app engine
rpx (openid)
When loading up the site on my windows app, there are no issues, but when trying to same app on OSX 10.6, I get the following issue:
ImportError at /rpx/rpx/login/
No module named _ctypes
Here's where the error is happening:
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/init.py in
#
"""create and manipulate C data types in Python"""
import os as _os, sys as _sys
version = "1.1.0"
from _ctypes import Union, Structure, Array
Any ideas? Thanks!
|
Python _ctypes import error on OSX 10.6
| 4,802,082 | 3 | 3 | 2,937 | 0 |
python,macos
|
I don't have enough rep to comment so I will make this a post.
The accepted answer is correct in that all you need to do is set the Python Path in the GAE preferences to /usr/bin/python2.5.
There is no need to download python 2.5 via macports or from the official python website.
python 2.5 is still installed in OSX 10.6, it is just not the default python interpreter. For this reason you need to tell GAE explicitly to use version 2.5.
FWIW I'm using GAE Launcher 1.4.1
| 0 | 1 | 0 | 0 |
2010-03-07T02:09:00.000
| 4 | 0.148885 | false | 2,394,903 | 0 | 0 | 1 | 2 |
I'm very new to Python development, and am having a problem with one of my apps in OSX.
Technologies being used in this project
python 2.6
django
google app engine
rpx (openid)
When loading up the site on my windows app, there are no issues, but when trying to same app on OSX 10.6, I get the following issue:
ImportError at /rpx/rpx/login/
No module named _ctypes
Here's where the error is happening:
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/init.py in
#
"""create and manipulate C data types in Python"""
import os as _os, sys as _sys
version = "1.1.0"
from _ctypes import Union, Structure, Array
Any ideas? Thanks!
|
migrating from one framework to another in python
| 2,396,341 | 1 | 0 | 149 | 0 |
python,django,frameworks,migrate
|
Your database queries(and object models), url config, and templates to say the least will all be specific to django. That said - if you understand what you're doing, recreating them in another package shouldn't take too long if you really need to at some later time.
edit: this is all assuming you dont integrate third party projects such as sqlalchemy and mako. Django plays nice with the builtins it ships with so it's often more trouble than its worth to use said modules.
| 0 | 0 | 0 | 0 |
2010-03-07T12:57:00.000
| 2 | 0.099668 | false | 2,396,294 | 0 | 0 | 1 | 1 |
I'm having trouble deciding which python framework to use for my website. So I've decided to bite the bullet and use Django. My question is how easy (or difficult) will it be to migrate to a different framework in future if I have issues with Django ?
|
In Django, what is the best way to manage both a mobile and desktop site?
| 2,396,949 | 9 | 5 | 1,531 | 0 |
python,css,django,mobile,templates
|
Have two sets of templates, one for mobile, one for desktop. Store the filenames in a pair of dictionaries, and use the User-agent header to detect which set should be used. Also allow manual selection of which site to use via a session entry.
| 0 | 0 | 0 | 0 |
2010-03-07T16:18:00.000
| 6 | 1.2 | true | 2,396,938 | 0 | 0 | 1 | 2 |
I'd like everything to function correctly, except when it's mobile, the entire site will used a set of specific templates.
Also, I'd like to autodetect if it's mobile. If so, then use that set of templates throughout the entire site.
|
In Django, what is the best way to manage both a mobile and desktop site?
| 2,397,185 | 1 | 5 | 1,531 | 0 |
python,css,django,mobile,templates
|
If you place a class on your body (Django uses something similar to specify what column style to use), you could use the same templates but simply use different stylesheets. I'm not sure what main differences you are using separate templates for, but this might allow you to cut down on re-coding the templates multiple times.
| 0 | 0 | 0 | 0 |
2010-03-07T16:18:00.000
| 6 | 0.033321 | false | 2,396,938 | 0 | 0 | 1 | 2 |
I'd like everything to function correctly, except when it's mobile, the entire site will used a set of specific templates.
Also, I'd like to autodetect if it's mobile. If so, then use that set of templates throughout the entire site.
|
Web scraping with Python
| 2,397,311 | 1 | 9 | 4,506 | 0 |
python,firefox,webkit,web-scraping
|
Well, WebKit is open source so you could use its own parser (in the WebCore component), if any language is acceptable
| 0 | 0 | 1 | 0 |
2010-03-07T18:07:00.000
| 10 | 0.019997 | false | 2,397,295 | 0 | 0 | 1 | 1 |
I'm currently trying to scrape a website that has fairly poorly-formatted HTML (often missing closing tags, no use of classes or ids so it's incredibly difficult to go straight to the element you want, etc.). I've been using BeautifulSoup with some success so far but every once and a while (though quite rarely), I run into a page where BeautifulSoup creates the HTML tree a bit differently from (for example) Firefox or Webkit. While this is understandable as the formatting of the HTML leaves this ambiguous, if I were able to get the same parse tree as Firefox or Webkit produces I would be able to parse things much more easily.
The problems are usually something like the site opens a <b> tag twice and when BeautifulSoup sees the second <b> tag, it immediately closes the first while Firefox and Webkit nest the <b> tags.
Is there a web scraping library for Python (or even any other language (I'm getting desperate)) that can reproduce the parse tree generated by Firefox or WebKit (or at least get closer than BeautifulSoup in cases of ambiguity).
|
Unit testing aspect-oriented features
| 2,402,152 | 0 | 4 | 258 | 0 |
python,unit-testing,aop
|
Well... let's see. In my opinion you are testing three different things here (sorry for the "Java AOP jargon"):
the features implemented by the interceptors (i.e. the methods that implement the functions activated at the cutpoints)
the coverage of the filters (i.e. whether the intended cutpoints are activated correctly or not)
the interaction between the cutpoints and the interceptors (with the side effects)
You are unit testing (strictly speaking) if you can handle these three layers separatedly. You can actually unit test the first; you can use a coverage tool and some skeleton crew application with mock objects to test the second; but the third is not exactly unit testing, so you may have to setup a test environment, design an end-to-end test and write some scripts to input data in your application and gather the results (if it was a web app you could use Selenium, for example).
| 0 | 0 | 0 | 1 |
2010-03-08T14:03:00.000
| 3 | 0 | false | 2,401,789 | 0 | 0 | 1 | 2 |
I'd like to know what would you propose as the best way to unit test aspect-oriented application features (well, perhaps that's not the best name, but it's the best I was able to come up with :-) ) such as logging or security?
These things are sort of omni-present in the application, so how to test them properly?
E.g. say that I'm writing a Cherrypy web server in Python. I can use a decorator to check whether the logged-in user has the permission to access a given page. But then I'd need to write a test for every page to see whether it works oK (or more like to see that I had not forgotten to check security perms for that page).
This could maybe (emphasis on maybe) be bearable if logging and/or security were implemented during the web server "normal business implementation". However, security and logging usually tend to be added to the app as an afterthough (or maybe that's just my experience, I'm usually given a server and then asked to implement security model :-) ).
Any thoughts on this are very welcome. I have currently 'solved' this issue by, well - not testing this at all.
Thanks.
|
Unit testing aspect-oriented features
| 2,796,926 | 1 | 4 | 258 | 0 |
python,unit-testing,aop
|
IMHO, the way of testing users permissions to the pages depends on the design of your app and design of the framework you're using.
Generally, it's probably enough to cover your permission checker decorator with unit tests to make sure it always works as expected and then write a test that cycles through your 'views' (or whatever term cherrypy uses, haven't used it for a very long time) and just check if these functions are decorated with appropriate decorator.
As for logging it's not quite clear what you want test specifically. Anyway, why isn't it possible to stub the logging functionality and check what's going on there?
| 0 | 0 | 0 | 1 |
2010-03-08T14:03:00.000
| 3 | 0.066568 | false | 2,401,789 | 0 | 0 | 1 | 2 |
I'd like to know what would you propose as the best way to unit test aspect-oriented application features (well, perhaps that's not the best name, but it's the best I was able to come up with :-) ) such as logging or security?
These things are sort of omni-present in the application, so how to test them properly?
E.g. say that I'm writing a Cherrypy web server in Python. I can use a decorator to check whether the logged-in user has the permission to access a given page. But then I'd need to write a test for every page to see whether it works oK (or more like to see that I had not forgotten to check security perms for that page).
This could maybe (emphasis on maybe) be bearable if logging and/or security were implemented during the web server "normal business implementation". However, security and logging usually tend to be added to the app as an afterthough (or maybe that's just my experience, I'm usually given a server and then asked to implement security model :-) ).
Any thoughts on this are very welcome. I have currently 'solved' this issue by, well - not testing this at all.
Thanks.
|
Google App Engine UI Widgets
| 2,404,551 | 3 | 5 | 2,260 | 0 |
python,user-interface,google-app-engine
|
There is no difference in the amount of built in widgets available to the python and java sides of app engine. Neither side has any! App Engine is primarily a back end technology. It allows you to use pretty much whatever web framework you want for your presentation layer, subject to constraints that Alex mentions.
GWT is completely unrelated to App Engine, besides being developed by Google. It is a client side toolkit, and can be used just fine with any web app as a backend, whether created in java, python or [your favorite language]. (Admittedly, you get a few bonus features if your backend is in java.)
| 1 | 0 | 0 | 0 |
2010-03-08T14:52:00.000
| 3 | 0.197375 | false | 2,402,128 | 0 | 0 | 1 | 1 |
Are there any UI widgets available to the python side of Google App Engine? I'd like something like the collapsed/expanded views of Google Groups threads. Are these type things limited to the GWT side?
|
How do I create a set of image files from a PowerPoint file file?
| 2,403,104 | 4 | 4 | 2,977 | 0 |
python,powerpoint,jpeg
|
Off the top of my head, the way I'd do it:
Use OpenOffice.org to convert the .ppt file into a PDF. (OO.o has a very rich Java API. Rich and bloody difficult to use, mind, but once you figure out how to get it to do the task you need, you're all set. Dunno if you can do anything useful with it via Python; not my language.)
Use ImageMagick to convert the PDF into .jpg files. (Though I've been told converting the PDF into a PS file before turning it into images gives better results.) (IM's command line interface is damn near a language unto itself -- though again, once you figure out how to get it to do what you want, you're all set.)
Dunno if that's the most efficient/reliable way to do it. But fundamentally, I'd be on Google trolling for open-source third party tools that do all the dirty work for me.
| 0 | 0 | 0 | 0 |
2010-03-08T16:59:00.000
| 3 | 0.26052 | false | 2,403,041 | 0 | 0 | 1 | 1 |
I'm creating a "slideshow room" web page. The user will upload a PowerPoint file that my server will use to generate a set of .jpg image files representing the slides to present in a custom "gallery viewer".
I'm an experienced Python developer but I cannot find anything useful.
How can I do that?
|
Setting up a python screen scraper that could work on Google App engine
| 2,660,349 | 0 | 3 | 2,539 | 0 |
python,google-app-engine,screen-scraping
|
I have used BeautifulSoup with great success parsing HTML. Problem is that's all BeautifulSoup does, is parse the HTML. I ended up writing all the http interactions using urlfetch.
To web-scrape my target I need a full fledged code driven browser that can execute javascript on my target site's pages. I think I'm having to dump the python app and go java so I can use HTMLUnit - prototyping underway. - mattb
| 0 | 1 | 0 | 0 |
2010-03-09T01:38:00.000
| 4 | 0 | false | 2,406,082 | 0 | 0 | 1 | 2 |
I am looking to setup a automated screen scraper that will run on Google app engine using python. I want it to scrape the site and put the specified results into a Entity in app engine. I am looking for some directions on what to use. I have seen beautifulsoup but wonder if people could recommend anything else that could run on Google App engine.
|
Setting up a python screen scraper that could work on Google App engine
| 2,406,093 | 0 | 3 | 2,539 | 0 |
python,google-app-engine,screen-scraping
|
The other choice is lxml, but it uses C code and so does not work on GAE.
| 0 | 1 | 0 | 0 |
2010-03-09T01:38:00.000
| 4 | 0 | false | 2,406,082 | 0 | 0 | 1 | 2 |
I am looking to setup a automated screen scraper that will run on Google app engine using python. I want it to scrape the site and put the specified results into a Entity in app engine. I am looking for some directions on what to use. I have seen beautifulsoup but wonder if people could recommend anything else that could run on Google App engine.
|
Add directory to PYTHONPATH ( multiple drives ), for auto-complete
| 2,415,055 | 2 | 1 | 1,976 | 0 |
python,autocomplete,pythonpath
|
Have you tried adding Additional import directories in Edit/Preferences/ under Languages/Python in Komodo?
Edit: I think you can also add a .pth file in [komodo-install-dir]/lib/mozilla/python/ or C:\[PythonVersion]\Lib\site-packages\ containing all other path you might want to be available. Not sure wich way is more appropriate in your case.
| 0 | 0 | 0 | 0 |
2010-03-10T06:45:00.000
| 1 | 1.2 | true | 2,415,014 | 0 | 0 | 1 | 1 |
I have 2 hard-drives, C:\ and D:\
Django imports correctly (which is in my C drive), but my application is on my D drive. I can't move it to the C drive because of some back-up software I'm running/
I'm trying to get auto-complete to work in Komodo Edit 5 which works fine for Django, but not for my application. There are a few other reasons for wanting this as well (one of them being my rampant OCD). I have added D:\dev\projects to my PYTHONPATH and my application is a couple folders deep from there. I included a ; between variables but not at the end, and I left off the trailing slash. I'm on Win XP. Here's my exact PYTHONPATH in my settings:
C:\Python26\Lib\site-packages\django-trunk;D:\dev\projects
and here is my Python path as a list output by os.environ['PYTHONPATH'].split(os.pathsep)
['C:\\Python26\\Lib\\site-packages\\django-trunk', 'D:\\dev\\projects']
Why doesn't this work? Django runs OK for my app that is there, but I understand that Django sets an environment variable dynamically in manage.py. I don't get it. I've restarted my computer, and now I'm pulling out my hair.
|
stop django from taking out javascript/frames?
| 2,416,776 | 0 | 0 | 200 | 0 |
python,django,django-templates
|
Django doesn't strip out javascript, because it is client side agnostic.
How are you inserting javascript into your website? If you are trying to put it into database (like ) it will escaped.
| 0 | 0 | 0 | 0 |
2010-03-10T12:08:00.000
| 3 | 0 | false | 2,416,677 | 0 | 0 | 1 | 2 |
Very newbie question, but please be gentle with me. Our site uses Django CMS and we're trying to insert some javascript into particular stories, but it appears Django is stripping out any javascript or iframes we put in there as soon as we save the story. How do we allow javascript to be used in stories? Is it being deliberately excluded, or do we need to code this function into the site?
Any help would be incredibly appreciated.
|
stop django from taking out javascript/frames?
| 2,416,764 | 2 | 0 | 200 | 0 |
python,django,django-templates
|
Django is probably automatically escaping the content the javascript / html as the template renders the content. It does this for security purposes.
The solution depends on which version of django you're running, whether you'll be rendering any content from untrusted sources, how the templates are put together and perhaps the view that prepares the content for the template.
| 0 | 0 | 0 | 0 |
2010-03-10T12:08:00.000
| 3 | 0.132549 | false | 2,416,677 | 0 | 0 | 1 | 2 |
Very newbie question, but please be gentle with me. Our site uses Django CMS and we're trying to insert some javascript into particular stories, but it appears Django is stripping out any javascript or iframes we put in there as soon as we save the story. How do we allow javascript to be used in stories? Is it being deliberately excluded, or do we need to code this function into the site?
Any help would be incredibly appreciated.
|
Django and "get() returned more than one Model name" error in multi-threaded program
| 2,417,080 | 2 | 1 | 4,232 | 0 |
python,mysql,database,multithreading,insert
|
This is not caused by multithreading, but because there are more than one object in database, that satisfies your query. You must select exactly one object from the database using get, otherwise it will raise an exception.
| 0 | 0 | 0 | 0 |
2010-03-10T12:31:00.000
| 1 | 1.2 | true | 2,416,819 | 0 | 0 | 1 | 1 |
Django's get_or_create function always cause "get() returned more than one Model name" error in a multi-threaded program.
I even tried to put get_or_create statement inside a lock.acquire() and lock.release() block but still didn't work.
The program only works when I set thread_count=1
The database is on InnoDB engine. How to fix this kind of problem?
|
Old desktop programmer wants to create S+S project
| 2,430,572 | 0 | 1 | 174 | 1 |
php,python,ruby-on-rails,programming-languages,saas
|
If you wan't to run a version of the server on desktops, your best options would be Python, Rails, or Java servlets, all of which can be easily packaged into small self contained servers with no dependencies.
My recommendation for the desktop would be HTML 5 local storage. The standard hasn't been finalized, but there is experimental support in Google Chrome. If you can force your users to use a specific browser version, you should be OK, until it is finalized.
I would recommend looking at Django and Rails before any other framework. They have different design philosophies, so one of them might be better suited for your application. Another framework to consider is Grails, which is essentially a clone of Rails in the groovy language.
| 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, VB and Pascal, and I have created simple websites using HTML and website creation tools, such as Frontpage.
So from my research, I think I have the following options; PHP, Ruby on Rails, Python or .NET for the programming side. MySQL for the DB. And Apache, or possibly IIS, for the webserver.
I will probably start with a local ISP provider for the cloud servce. But then maybe move to something more "robust" and universal in the future, ie. Amazon, or Azure, or something along that line.
My question then is this. What would you recommend for something like this? I'm sure that I have not listed all of the possibilities, but the ones I have researched and thought of.
Thanks everyone,
Craig
|
Old desktop programmer wants to create S+S project
| 2,429,484 | 0 | 1 | 174 | 1 |
php,python,ruby-on-rails,programming-languages,saas
|
The languages you list are all serverside components. The big question is whether you can sensibly build a thick client - effectively you could develop a multi-tier application where the webserver sits on the client and uses a webservice as a datafeed if/when its available but the solution is not very portable.
You could build a purely ajax driven website in javascript then deploy it to the client as signed javascripts on the local filesystem (they need to be signed to get around the restriction that javscripts can only connect back to the server where they served from normally).
Another approach would be to use Google Gears - but that would be a single browser solution.
C.
| 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, VB and Pascal, and I have created simple websites using HTML and website creation tools, such as Frontpage.
So from my research, I think I have the following options; PHP, Ruby on Rails, Python or .NET for the programming side. MySQL for the DB. And Apache, or possibly IIS, for the webserver.
I will probably start with a local ISP provider for the cloud servce. But then maybe move to something more "robust" and universal in the future, ie. Amazon, or Azure, or something along that line.
My question then is this. What would you recommend for something like this? I'm sure that I have not listed all of the possibilities, but the ones I have researched and thought of.
Thanks everyone,
Craig
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.