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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
How limiting are web frameworks
| 2,125,979 | 5 | 7 | 653 | 0 |
python,ruby-on-rails,django,rest
|
You can still use the full potential of the language in question, even if you also use a framework. A framework isn't a limiting factor, it's basically a tool to ease development of certain parts of your application. Django and rails, for instance, abstract away some database functionality, so you'll only have to worry about your model objects. That doesn't mean you can't do stuff on your own as well...
| 0 | 0 | 0 | 0 |
2010-01-24T03:53:00.000
| 11 | 0.090659 | false | 2,125,865 | 0 | 0 | 1 | 7 |
This is a general question about how limiting are web development frameworks such as Django and ruby-on-rails.
I am planning on building a RESTful web service which will have a purely JSON/XML interface, no GUI. The service will rely on a database however for a few of the more important operations there is no clear way of persisting a "model" object directly into a database table. In addition I require full control over when and how the data is being written to the database. I will need to maintain multiple database connections in order to use some connections only for reads and others only for writes.
I've looked at the "full" MVC frameworks such as Django and more basic ones such web.py and pylons. The impression I currently have is that if I go with the full framework initially things will go faster but eventually I will get stuck because I will be limited by the framework in what I can do. If I go with a more basic framework it will take much longer to get everything running but I will be free to do what I need.
This is what it seems like but I suspect that it might be an incorrect impression given how many sites are written in Django and Rails. Could you please provide your opinion. Am I totally wrong and there is a way to easily do anything with a framework like Django or Rails or given my requirements I should go with something like web.py?
Thank you!
|
How limiting are web frameworks
| 2,126,030 | 1 | 7 | 653 | 0 |
python,ruby-on-rails,django,rest
|
I have used Ruby/Rails for years now, and unlike just about every other language/framework I have used (across nearly 15 years of Java, PHP, ColdFusion, ASP, etc etc) it gets out of the way when you need it to.
It sounds like you might benefit from a "lighter-weight" framework like Sinatra, but with the upcoming Rails 3 release the benefits are becoming less pronounced. Rails 3 makes everything configurable ... in fact, Rails will now just be a particular set of plugins and extensions sitting onto of an infinitely flexible core.
I am interested in this statement:
"The service will rely on a database however for a few of the more important operations
there is no clear way of persisting a "model" object directly into a database table."
Not sure what you mean by this statement ... at some point you have something going into the database, right?
In most non-trivial applications you rarely have a single model tied to the end of a request ... you might actually have a quite complex network of models that are returned or updated.
If you are working with JSON, I would definitely suggest looking at a database like MongoDB. MongoDB is based entirely on storing JSON data, and may therefore fit really neatly with your application.
| 0 | 0 | 0 | 0 |
2010-01-24T03:53:00.000
| 11 | 0.01818 | false | 2,125,865 | 0 | 0 | 1 | 7 |
This is a general question about how limiting are web development frameworks such as Django and ruby-on-rails.
I am planning on building a RESTful web service which will have a purely JSON/XML interface, no GUI. The service will rely on a database however for a few of the more important operations there is no clear way of persisting a "model" object directly into a database table. In addition I require full control over when and how the data is being written to the database. I will need to maintain multiple database connections in order to use some connections only for reads and others only for writes.
I've looked at the "full" MVC frameworks such as Django and more basic ones such web.py and pylons. The impression I currently have is that if I go with the full framework initially things will go faster but eventually I will get stuck because I will be limited by the framework in what I can do. If I go with a more basic framework it will take much longer to get everything running but I will be free to do what I need.
This is what it seems like but I suspect that it might be an incorrect impression given how many sites are written in Django and Rails. Could you please provide your opinion. Am I totally wrong and there is a way to easily do anything with a framework like Django or Rails or given my requirements I should go with something like web.py?
Thank you!
|
How limiting are web frameworks
| 2,126,628 | 2 | 7 | 653 | 0 |
python,ruby-on-rails,django,rest
|
In average, the more complete and helpful the web framework is, the more limiting it is when you try to do things another way than the way the web framework thinks is The Right Way. Some web frameworks try to be very helpful and still not restrictive, and some do that better than others.
And the general recommendation there is: Don't fight the framework. You will lose. So it's important to chose a framework that helps you with the things you want to do, but doesn't enforce anything else. For your webservice case, this should not be a problem. There are tons of minimalistic web frameworks out there, at least in the Python world (which is all I care about). Bobo, BFG, Pylons, Werkzeug, etc, etc. None of these will get in your way one bit.
Also don't forget that you often can use several frameworks together by having them run side by side. Especially using techniques such as Dexterity/XDV. Plone.org for example is mostly Plon (duh) an excellent content management system, but extremely restrictive if you want to do something else. So part of the site is Trac, the excellent Python bug tracker. It's all integrated to look the same.
| 0 | 0 | 0 | 0 |
2010-01-24T03:53:00.000
| 11 | 0.036348 | false | 2,125,865 | 0 | 0 | 1 | 7 |
This is a general question about how limiting are web development frameworks such as Django and ruby-on-rails.
I am planning on building a RESTful web service which will have a purely JSON/XML interface, no GUI. The service will rely on a database however for a few of the more important operations there is no clear way of persisting a "model" object directly into a database table. In addition I require full control over when and how the data is being written to the database. I will need to maintain multiple database connections in order to use some connections only for reads and others only for writes.
I've looked at the "full" MVC frameworks such as Django and more basic ones such web.py and pylons. The impression I currently have is that if I go with the full framework initially things will go faster but eventually I will get stuck because I will be limited by the framework in what I can do. If I go with a more basic framework it will take much longer to get everything running but I will be free to do what I need.
This is what it seems like but I suspect that it might be an incorrect impression given how many sites are written in Django and Rails. Could you please provide your opinion. Am I totally wrong and there is a way to easily do anything with a framework like Django or Rails or given my requirements I should go with something like web.py?
Thank you!
|
How limiting are web frameworks
| 2,129,721 | 1 | 7 | 653 | 0 |
python,ruby-on-rails,django,rest
|
If you know you're not going to use an ORM, or create a user interface, then you've just eliminated about 90% of what you'd use a web application framework for in the first place. If you look at the feature set of Django, for instance: what parts of that would you use to implement a web service that you couldn't get from using something much simpler, like Werkzeug or CherryPy?
The principal differences between building a web service and building any old black box that takes input and produces output are the various technical limitations imposed by the API being HTTP-based, the problem of statelessness, and the problem of idempotence. A web application framework is going to give you a little help with those issues, but not much.
| 0 | 0 | 0 | 0 |
2010-01-24T03:53:00.000
| 11 | 0.01818 | false | 2,125,865 | 0 | 0 | 1 | 7 |
This is a general question about how limiting are web development frameworks such as Django and ruby-on-rails.
I am planning on building a RESTful web service which will have a purely JSON/XML interface, no GUI. The service will rely on a database however for a few of the more important operations there is no clear way of persisting a "model" object directly into a database table. In addition I require full control over when and how the data is being written to the database. I will need to maintain multiple database connections in order to use some connections only for reads and others only for writes.
I've looked at the "full" MVC frameworks such as Django and more basic ones such web.py and pylons. The impression I currently have is that if I go with the full framework initially things will go faster but eventually I will get stuck because I will be limited by the framework in what I can do. If I go with a more basic framework it will take much longer to get everything running but I will be free to do what I need.
This is what it seems like but I suspect that it might be an incorrect impression given how many sites are written in Django and Rails. Could you please provide your opinion. Am I totally wrong and there is a way to easily do anything with a framework like Django or Rails or given my requirements I should go with something like web.py?
Thank you!
|
Using Django's Model API without having to *include* the full Django stack
| 2,127,512 | 1 | 0 | 191 | 1 |
python,django,deployment,size,sqlalchemy
|
The Django ORM is usable on its own - you can use "settings.configure()" to set up the database settings. That said, you'll have to do the stripping down and repackaging yourself, and you'll have to experiment with how much you can actually strip away. I'm sure you can ditch contrib/, forms/, template/, and probably several other unrelated pieces. The ORM definitely relies on conf/, and quite likely on core/ and util/ as well. A few quick greps through db/* should make it clear what's imported.
| 0 | 0 | 0 | 0 |
2010-01-24T08:27:00.000
| 2 | 0.099668 | false | 2,126,433 | 0 | 0 | 1 | 2 |
Currently an application of mine is using SQLAlchemy, but I have been considering the possibility of using Django model API.
Django 1.1.1 is about 3.6 megabytes in size, whereas SQLAlchemy is about 400 kilobytes (as reported by PyPM - which is essentially the size of the files installed by python setup.py install).
I would like to use the Django models (so as to not have other developers learn yet-another-ORM), but do not want to include 3.6 megabytes of stuff most of which are not needed. (FYI - the application, final executable that is, actually bundles the install_requires from setup.py)
|
Using Django's Model API without having to *include* the full Django stack
| 2,130,014 | 1 | 0 | 191 | 1 |
python,django,deployment,size,sqlalchemy
|
You may be able to get a good idea of what is safe to strip out by checking which files don't have their access time updated when you run your application.
| 0 | 0 | 0 | 0 |
2010-01-24T08:27:00.000
| 2 | 0.099668 | false | 2,126,433 | 0 | 0 | 1 | 2 |
Currently an application of mine is using SQLAlchemy, but I have been considering the possibility of using Django model API.
Django 1.1.1 is about 3.6 megabytes in size, whereas SQLAlchemy is about 400 kilobytes (as reported by PyPM - which is essentially the size of the files installed by python setup.py install).
I would like to use the Django models (so as to not have other developers learn yet-another-ORM), but do not want to include 3.6 megabytes of stuff most of which are not needed. (FYI - the application, final executable that is, actually bundles the install_requires from setup.py)
|
web2py - my application doesn' login
| 2,391,381 | 1 | 2 | 199 | 0 |
python,web2py
|
I have seen something like this happen with cookie based load balancing. The cookie was being set too late, so the user would switch frontends sometimes when they logged it.
If you have a load balancer over 2 frontends, you might see this happen 50% of the time.
Check the logs and make sure the hits are all going to the same frontend.
| 0 | 0 | 0 | 0 |
2010-01-24T11:24:00.000
| 1 | 0.197375 | false | 2,126,824 | 0 | 0 | 1 | 1 |
i have a web2py application and am using default/user/login to login to my application but sometimes when i login the application redirect to the login page agin and sometimes the system logged fine and there is no problem i dont know why ?
so please can anyone tell me ?
Thanks in advance
|
Can you really scale up with Django...given that you can only use one database? (In the models.py and settings.py)
| 2,127,162 | 3 | 5 | 1,742 | 0 |
python,django,web-services,scalability
|
Read scaling to millions of users is not a database problem, but is fixed with load balancing and caching, etc, see S. Lott above.
Write scaling can indeed be a database problem. "Sharding" and having multiple databases can be one solution, but that's hard with SQL while still retaining the relationality of the database. Popular solutions there are the new types of "nosql" databases. But if you really have those problems, then you need serious expert help, not just answers from dudes Stackoverflow. :)
| 0 | 0 | 0 | 0 |
2010-01-24T12:46:00.000
| 6 | 0.099668 | false | 2,127,067 | 0 | 0 | 1 | 2 |
Django only allows you to use one database in settings.py.
Does that prevent you from scaling up? (millions of users)
|
Can you really scale up with Django...given that you can only use one database? (In the models.py and settings.py)
| 2,127,160 | 0 | 5 | 1,742 | 0 |
python,django,web-services,scalability
|
If you find out that the DB is the bottlenck of your app, and their is now way around it (like using caching) then you should scale your DB as well. Django has nothing to do with this
| 0 | 0 | 0 | 0 |
2010-01-24T12:46:00.000
| 6 | 0 | false | 2,127,067 | 0 | 0 | 1 | 2 |
Django only allows you to use one database in settings.py.
Does that prevent you from scaling up? (millions of users)
|
TextMate and Django Integration - Supporting {% %} markup
| 2,133,642 | 2 | 3 | 796 | 0 |
python,django,textmate
|
It's possible - the Rails bundle does this for ERB (<% automatically gets closing %> tags).
So that's a place you could go look.
| 0 | 0 | 0 | 0 |
2010-01-24T17:17:00.000
| 2 | 0.197375 | false | 2,127,956 | 0 | 0 | 1 | 2 |
I have installed a TextMate bundle that I believe enables the ability for automatic closing of the "{{" markup (so that it will automatically close the markup with "}}"), but this does not seem to be possible with the other markup that uses "{%" and "%}".
So, I was wondering if anyone out there knows how to get TextMate to add the automatic closing tags for the {% %} just like is already done with {{ }}.
Any help is appreciated!
|
TextMate and Django Integration - Supporting {% %} markup
| 2,128,058 | 1 | 3 | 796 | 0 |
python,django,textmate
|
I don't think that's possible, but the Django bundle for TextMate does allow you to insert the opening and closing tags in one go, placing the cursor in the middle, with ctrl-% (ctrl-shift-5).
Click the Bundles -> Python Django Templates menu to see all the shortcuts that are available.
| 0 | 0 | 0 | 0 |
2010-01-24T17:17:00.000
| 2 | 0.099668 | false | 2,127,956 | 0 | 0 | 1 | 2 |
I have installed a TextMate bundle that I believe enables the ability for automatic closing of the "{{" markup (so that it will automatically close the markup with "}}"), but this does not seem to be possible with the other markup that uses "{%" and "%}".
So, I was wondering if anyone out there knows how to get TextMate to add the automatic closing tags for the {% %} just like is already done with {{ }}.
Any help is appreciated!
|
Django-registration, force unique e-mail
| 37,694,543 | 1 | 16 | 8,343 | 0 |
python,django
|
For unique e-mail addresses in django-registration-redux 1.4.
In url.py add following
from registration.forms import RegistrationFormUniqueEmail
from registration.backends.default.views import RegistrationView
urlpatterns = [
url(r'^accounts/register/$',RegistrationView.as_view(form_class=RegistrationFormUniqueEmail),
name='registration_register'),
url(r'^accounts/', include('registration.backends.default.urls'))
]
| 0 | 0 | 0 | 0 |
2010-01-25T10:16:00.000
| 7 | 0.028564 | false | 2,131,533 | 0 | 0 | 1 | 1 |
Can I force users to make unique e-mail addresses in django-registration?
|
Which technology is preferable to build a web based GUI Client?
| 2,140,012 | 0 | 5 | 2,943 | 0 |
python,django,gwt,extjs,webclient
|
How about Pylons + SQLAlchemy + ExtJS? We use it and it works great!
| 0 | 0 | 1 | 0 |
2010-01-26T10:51:00.000
| 5 | 0 | false | 2,138,868 | 0 | 0 | 1 | 2 |
I've well developed Python Server having workflows, views, object - ORM/OSV, etc...
Server/Client communication based on socket protocol, can be done by any of service
1. XMLRPC Service
2. Socket Service
now I want to develop a Fully Ajax based GUI web Client..
I've web/socket services to communicate with server.
what I need is to select the technology, I've several options like,
ExtJS - CherryPy
GWT
Ext-GWT
CheeryPy
Django + JQuery
Django + Extjs
???
???...
|
Which technology is preferable to build a web based GUI Client?
| 2,138,949 | 1 | 5 | 2,943 | 0 |
python,django,gwt,extjs,webclient
|
I'm not sure I understood exactly on the server side, but i'm a big fan of Flex as a way to develop proper software for the browser, rather than mess of trying to make HTML do things it was never made for. Partly an idealistic reasoning, but I also am still not impressed by the 'feel' of JS-based GUIs.
Flex has good server-communication options... web-services, sockets, remote objects, etc.
| 0 | 0 | 1 | 0 |
2010-01-26T10:51:00.000
| 5 | 0.039979 | false | 2,138,868 | 0 | 0 | 1 | 2 |
I've well developed Python Server having workflows, views, object - ORM/OSV, etc...
Server/Client communication based on socket protocol, can be done by any of service
1. XMLRPC Service
2. Socket Service
now I want to develop a Fully Ajax based GUI web Client..
I've web/socket services to communicate with server.
what I need is to select the technology, I've several options like,
ExtJS - CherryPy
GWT
Ext-GWT
CheeryPy
Django + JQuery
Django + Extjs
???
???...
|
PyFacebook Infinite Session
| 2,140,233 | 0 | 2 | 819 | 0 |
python,facebook,pyfacebook
|
I've never used PyFacebook. Or tried to resume sessions in this manner. But I'd imagine just storing session_key and uid is not enough. There are other params too, and a signature param that's calculated based on all the fb_* params. So you might need to store all of them.
But even so, they might only work for 20-30 minutes if you're unlucky.
| 0 | 0 | 0 | 1 |
2010-01-26T14:53:00.000
| 3 | 0 | false | 2,140,142 | 0 | 0 | 1 | 2 |
I am trying to set a cron task to read updates for a Facebook application. I have prompted the user to grant Offline Access permissions and i have store the session_key in the db.
I am crearing a new Facebook object and besides api and secret key I also use the session_key (previously stored in db) and the fb uid. When i am trying to create the auth token or do a API call i get a Error 104: Incorrect signature
Any ideas, experience, hints ?
|
PyFacebook Infinite Session
| 11,015,676 | 1 | 2 | 819 | 0 |
python,facebook,pyfacebook
|
I faced the same problem where the error displayed was:
"facebook.FacebookError: Error 104: Incorrect signature"
Just reset your APP Secret_key and make corresponding change in the code and that sgould fix the problem.
Cheers!
| 0 | 0 | 0 | 1 |
2010-01-26T14:53:00.000
| 3 | 0.066568 | false | 2,140,142 | 0 | 0 | 1 | 2 |
I am trying to set a cron task to read updates for a Facebook application. I have prompted the user to grant Offline Access permissions and i have store the session_key in the db.
I am crearing a new Facebook object and besides api and secret key I also use the session_key (previously stored in db) and the fb uid. When i am trying to create the auth token or do a API call i get a Error 104: Incorrect signature
Any ideas, experience, hints ?
|
IronPython and Targetting to MS Framework 1.1
| 2,140,900 | 3 | 1 | 58 | 0 |
ironpython,.net-1.1
|
IronPython since version 1.0 is only compatible with .NET 2.0 and higher, it uses Generic and features only available since .NET 2.0.
| 0 | 0 | 0 | 0 |
2010-01-26T16:38:00.000
| 1 | 1.2 | true | 2,140,869 | 1 | 0 | 1 | 1 |
In IronPython Studio -> Properties -> General Tab i see a Property with Name Target Plataform and found Microsoft Framework 1.0, 1.1 and 2.0, selected 1.1 and next opened my Visual Studio 2003 -> Add Reference and for my surprise this not work. Not compatibility. Why? What i do wrong?
|
Fastest Way to Update a bunch of records in queryset in Django
| 4,230,081 | 0 | 7 | 1,711 | 1 |
python,database,django,django-queryset
|
Actually, that didn't work out for me.
The following did:
Entry.objects.all().update(value=(F('value')==False))
| 0 | 0 | 0 | 0 |
2010-01-26T18:50:00.000
| 3 | 0 | false | 2,141,769 | 0 | 0 | 1 | 1 |
I have a queryset with a few million records. I need to update a Boolean Value, fundamentally toggle it, so that in the database table the values are reset. What's the fastest way to do that?
I tried traversing the queryset and updating and saving each record, that obviously takes ages? We need to do this very fast, any suggestions?
|
How do I detect when a user has been idle for a certain time and destroy their session in PHP?
| 2,145,413 | 1 | 1 | 2,505 | 0 |
php,session,python-idle
|
I assume you mean 'idle' time. There is no need to calculate that, but you have to store the last (authenticated) access made by that user and reset the counter.
Typically, one would should issue an authentication cookie with a certain timestamp. Upon authentication of the cookie, you compare the current time with the timestamp. If this difference is larger than some threshold, say 5 minutes, you present an error page.
To improve the user experience, you might also want to display a timer to the user so there is no bad surprise.
| 0 | 0 | 0 | 1 |
2010-01-27T08:23:00.000
| 4 | 0.049958 | false | 2,145,365 | 0 | 0 | 1 | 4 |
I would like to have my PHP website destroy a users session if they have been idle for 5 minutes. If this does happen, I'd like to present the user with a message stating why they were logged out and redirect them to the login page.
What is the best way to handle this?
I am running on php and myadmin.
Thanks
Avinash
|
How do I detect when a user has been idle for a certain time and destroy their session in PHP?
| 2,145,866 | 1 | 1 | 2,505 | 0 |
php,session,python-idle
|
Can you not just use PHP's built-in session functions to set session expiry time to 5 mins. and re-direct if a session no longer exists?
| 0 | 0 | 0 | 1 |
2010-01-27T08:23:00.000
| 4 | 0.049958 | false | 2,145,365 | 0 | 0 | 1 | 4 |
I would like to have my PHP website destroy a users session if they have been idle for 5 minutes. If this does happen, I'd like to present the user with a message stating why they were logged out and redirect them to the login page.
What is the best way to handle this?
I am running on php and myadmin.
Thanks
Avinash
|
How do I detect when a user has been idle for a certain time and destroy their session in PHP?
| 2,145,390 | 7 | 1 | 2,505 | 0 |
php,session,python-idle
|
Every time you load a page, store a timestamp in a session variable. When the user goes to a page, check to see if $SESSION['lastActivity'] < time() - <your idle time>. If true, then redirect to a 'your session has expired' page or similar. If not, continue loading the page.
| 0 | 0 | 0 | 1 |
2010-01-27T08:23:00.000
| 4 | 1.2 | true | 2,145,365 | 0 | 0 | 1 | 4 |
I would like to have my PHP website destroy a users session if they have been idle for 5 minutes. If this does happen, I'd like to present the user with a message stating why they were logged out and redirect them to the login page.
What is the best way to handle this?
I am running on php and myadmin.
Thanks
Avinash
|
How do I detect when a user has been idle for a certain time and destroy their session in PHP?
| 2,145,652 | 0 | 1 | 2,505 | 0 |
php,session,python-idle
|
Create a javascript function that has a x minute timeout that pops up and redirects.
Also on the server make sure their session expires so that in the case of Javascript not being available, they cannot continue actions after their idle time has passed.
| 0 | 0 | 0 | 1 |
2010-01-27T08:23:00.000
| 4 | 0 | false | 2,145,365 | 0 | 0 | 1 | 4 |
I would like to have my PHP website destroy a users session if they have been idle for 5 minutes. If this does happen, I'd like to present the user with a message stating why they were logged out and redirect them to the login page.
What is the best way to handle this?
I am running on php and myadmin.
Thanks
Avinash
|
scrape html generated by javascript with python
| 2,148,595 | 4 | 18 | 17,188 | 0 |
javascript,python,browser,screen-scraping
|
I have had to do this before (in .NET) and you are basically going to have to host a browser, get it to click the button, and then interrogate the DOM (document object model) of the browser to get at the generated HTML.
This is definitely one of the downsides to web apps moving towards an Ajax/Javascript approach to generating HTML client-side.
| 0 | 0 | 1 | 0 |
2010-01-27T16:20:00.000
| 5 | 0.158649 | false | 2,148,493 | 0 | 0 | 1 | 1 |
I need to scrape a site with python. I obtain the source html code with the urlib module, but I need to scrape also some html code that is generated by a javascript function (which is included in the html source). What this functions does "in" the site is that when you press a button it outputs some html code. How can I "press" this button with python code? Can scrapy help me? I captured the POST request with firebug but when I try to pass it on the url I get a 403 error. Any suggestions?
|
Is PHP the only choice re: massive and rapid uptake of a re-deployable, extensible web application?
| 2,150,982 | 3 | 3 | 181 | 0 |
php,python,wordpress,deployment,hosting
|
As far as points #1 and #2 go, you are probably right. No other platform is so widely, easily and cheaply available in terms of hosting companies and packages like the LAMP stack. Plus, most incompatibilities that can occur when deploying an application to a completely unknown web space are well documented, their number is limited, and can mostly be checked beforehand (register_globals, safe mode, allocated script memory, etc.)
If I were thinking about developing a web application that I want to see spreading as quickly and as far as possible also among non-professionals and end users, PHP would be my platform of choice for these reasons. I must add that I am deeply familiar only with the hosting market in Germany, but I'm quite sure the basic characteristics are the same.
As for developer availability: People who claim to be able to speak PHP are easy to find. Those who will actually do a good job for you, less so. Still, I think it is safe to say that PHP developers are easier to find than, say, Pythonists or Ruby developers.
I don't expect this to stay this way forever, though. Other languages are gaining popularity, and in the end, developers and which languages they like influences the hosting market massively in the long term.
| 0 | 0 | 0 | 1 |
2010-01-27T22:55:00.000
| 1 | 1.2 | true | 2,150,947 | 0 | 0 | 1 | 1 |
My own answer to this question is YES, but I'd like to hear from others. Put another way the question could be: Would the success of 1-click-install WordPress (not WordPress.com, which is SaaS) be possible if it weren't written in PHP, all other things being equal?
The critical associated requirements I believe support PHP are:
hosting/deployment flexibility
developer reach
flexibility and depth of knowledge around server performance tuning
Items #1 and #2 are equally critical, and both are far more important than #3.
FWIW, I'm not a particular fan of PHP - can anyone truly be? - but the goals of re-deployment and extensibility point wherever they point. Please, please do not pollute this space if you do not grok the question. This is not about PHP and it's relative merits, or lack of merit, compared to other programming languages out of context. I am looking for insight specifically around language choice as it relates to deployment/uptake/extensibility strategy as outlined.
Thanks.
|
Can I get my instance of mechanize.Browser to stay on the same page after calling b.form.submit()?
| 2,167,177 | 7 | 3 | 1,070 | 0 |
python,screen-scraping,mechanize
|
The answer to my immediate question in the headline is yes, with mechanize.Browser.open_novisit(). It works just like open(), but it doesn't change the state of the Browser instance -- that is, it will retrieve the page, and your Browser object will stay where it was.
| 0 | 0 | 1 | 0 |
2010-01-28T03:24:00.000
| 1 | 1.2 | true | 2,152,098 | 0 | 0 | 1 | 1 |
In Python's mechanize.Browser module, when you submit a form the browser instance goes to that page. For this one request, I don't want that; I want it just to stay on the page it's currently on and give me the response in another object (for looping purposes). Anyone know a quick to do this?
EDIT:
Hmm, so I have this kind of working with ClientForm.HTMLForm.click(), which returns a urllib2 request, but I need the cookies from mechanize's cookiejar to be used on my urllib2.urlopen request. Is there a method in mechanize that will let me send a request just like urllib2 with the exception that cookies will be imported?
|
Django Haystack exact filtering
| 18,338,048 | 0 | 5 | 2,527 | 0 |
python,django,xapian,django-haystack
|
For solr backend I need to use _exact (just one underline instead of two).
| 0 | 0 | 0 | 0 |
2010-01-28T17:35:00.000
| 5 | 0 | false | 2,156,559 | 0 | 0 | 1 | 3 |
I have a haystack search which has the following SearchIndex:
class GrantIndex(indexes.SearchIndex):
"""
This provides the search index for the Grant application.
"""
text = indexes.CharField(document=True, use_template=True)
year = indexes.IntegerField(model_attr='year__year')
date = indexes.DateField(model_attr='date')
program = indexes.CharField(model_attr='program__area')
grantee = indexes.CharField(model_attr='grantee')
amount = indexes.IntegerField(model_attr='amount')
site.register(Grant, GrantIndex)
If I want to search filtering out any programs that ARE NOT 'Health', I run the following query:
from haystack.query import SearchQuerySet
sqs = SearchQuerySet()
sqs = sqs.filter(program='Health')
Unfortunately, this also produces objects from the program 'Health\Other' and 'Health\Cardiovascular'. How do I stop the search from allowing those other programs in?
I run Ubuntu 9.10 with Xapian as my search back-end.
|
Django Haystack exact filtering
| 2,990,433 | 3 | 5 | 2,527 | 0 |
python,django,xapian,django-haystack
|
You've problably solved the problem already, but I just stumbled over the same problem with the Whoosh backend. Maybe the Xapian and Whoosh backends behave the same? Seems Whoosh is stemming all CharFields by default, and searching inside them with some kind of contains-query. Switching to a custom backend, without stemming enabled on CharFields, fixed this issue for me.
Hopefully this will push someone else in the right direction.
| 0 | 0 | 0 | 0 |
2010-01-28T17:35:00.000
| 5 | 0.119427 | false | 2,156,559 | 0 | 0 | 1 | 3 |
I have a haystack search which has the following SearchIndex:
class GrantIndex(indexes.SearchIndex):
"""
This provides the search index for the Grant application.
"""
text = indexes.CharField(document=True, use_template=True)
year = indexes.IntegerField(model_attr='year__year')
date = indexes.DateField(model_attr='date')
program = indexes.CharField(model_attr='program__area')
grantee = indexes.CharField(model_attr='grantee')
amount = indexes.IntegerField(model_attr='amount')
site.register(Grant, GrantIndex)
If I want to search filtering out any programs that ARE NOT 'Health', I run the following query:
from haystack.query import SearchQuerySet
sqs = SearchQuerySet()
sqs = sqs.filter(program='Health')
Unfortunately, this also produces objects from the program 'Health\Other' and 'Health\Cardiovascular'. How do I stop the search from allowing those other programs in?
I run Ubuntu 9.10 with Xapian as my search back-end.
|
Django Haystack exact filtering
| 8,370,572 | 0 | 5 | 2,527 | 0 |
python,django,xapian,django-haystack
|
use "prepare_data" for program field and get rid of health\blabla things
| 0 | 0 | 0 | 0 |
2010-01-28T17:35:00.000
| 5 | 0 | false | 2,156,559 | 0 | 0 | 1 | 3 |
I have a haystack search which has the following SearchIndex:
class GrantIndex(indexes.SearchIndex):
"""
This provides the search index for the Grant application.
"""
text = indexes.CharField(document=True, use_template=True)
year = indexes.IntegerField(model_attr='year__year')
date = indexes.DateField(model_attr='date')
program = indexes.CharField(model_attr='program__area')
grantee = indexes.CharField(model_attr='grantee')
amount = indexes.IntegerField(model_attr='amount')
site.register(Grant, GrantIndex)
If I want to search filtering out any programs that ARE NOT 'Health', I run the following query:
from haystack.query import SearchQuerySet
sqs = SearchQuerySet()
sqs = sqs.filter(program='Health')
Unfortunately, this also produces objects from the program 'Health\Other' and 'Health\Cardiovascular'. How do I stop the search from allowing those other programs in?
I run Ubuntu 9.10 with Xapian as my search back-end.
|
which is a minimalistic python wsgi development server with support for code reload?
| 2,270,464 | 1 | 11 | 4,339 | 0 |
python,wsgi
|
Also, you missed web.py, which is both small and supports code reload.
| 0 | 0 | 0 | 0 |
2010-01-29T12:13:00.000
| 7 | 0.028564 | false | 2,161,778 | 0 | 0 | 1 | 4 |
From what I can tell
wsgiref - no code reload
CherryPy - more than just the server
mod_wsgi - all the apache overhead
paste.httpserver - paste is a huge package with other stuff in it
flup - same as paste, too much stuff.
Spawning - never used it but seems lightweight enough.
Tornado - not really wsgi + full "framework"
Werkzeug - runcommand
any others out there? which one you prefer?
|
which is a minimalistic python wsgi development server with support for code reload?
| 2,161,869 | 1 | 11 | 4,339 | 0 |
python,wsgi
|
So far I've been using CherryPy, and compared to Django (which, while not in your list, is the only other dev server I used) I like it heaps more. It does what is says: it is only there when you need it, and gets out of the way for the rest of the time.
Using Django seemed like I needed to subscribe to the Django way of doing things. Although Django provides heaps more functionality out of the box (default admin interface, widgets on your webpages) , using CherryPy seems like just another import that has very good (often surprising you with extra) functionality.
| 0 | 0 | 0 | 0 |
2010-01-29T12:13:00.000
| 7 | 0.028564 | false | 2,161,778 | 0 | 0 | 1 | 4 |
From what I can tell
wsgiref - no code reload
CherryPy - more than just the server
mod_wsgi - all the apache overhead
paste.httpserver - paste is a huge package with other stuff in it
flup - same as paste, too much stuff.
Spawning - never used it but seems lightweight enough.
Tornado - not really wsgi + full "framework"
Werkzeug - runcommand
any others out there? which one you prefer?
|
which is a minimalistic python wsgi development server with support for code reload?
| 2,161,981 | 1 | 11 | 4,339 | 0 |
python,wsgi
|
I'd recommend paste or CherryPy. They're the easiest to get up and running with.
| 0 | 0 | 0 | 0 |
2010-01-29T12:13:00.000
| 7 | 0.028564 | false | 2,161,778 | 0 | 0 | 1 | 4 |
From what I can tell
wsgiref - no code reload
CherryPy - more than just the server
mod_wsgi - all the apache overhead
paste.httpserver - paste is a huge package with other stuff in it
flup - same as paste, too much stuff.
Spawning - never used it but seems lightweight enough.
Tornado - not really wsgi + full "framework"
Werkzeug - runcommand
any others out there? which one you prefer?
|
which is a minimalistic python wsgi development server with support for code reload?
| 2,270,443 | 0 | 11 | 4,339 | 0 |
python,wsgi
|
You can use paste.reloader with any wsgi-server, aside of other paste modules.
# run paste reloader
import paste.reloader as reloader
reloader.install()
# run wsgiref server
from wsgiref import simple_server
simple_server.make_server('', 8080, main_wsgi_app).serve_forever()
Is that minimalistic enough?
| 0 | 0 | 0 | 0 |
2010-01-29T12:13:00.000
| 7 | 0 | false | 2,161,778 | 0 | 0 | 1 | 4 |
From what I can tell
wsgiref - no code reload
CherryPy - more than just the server
mod_wsgi - all the apache overhead
paste.httpserver - paste is a huge package with other stuff in it
flup - same as paste, too much stuff.
Spawning - never used it but seems lightweight enough.
Tornado - not really wsgi + full "framework"
Werkzeug - runcommand
any others out there? which one you prefer?
|
Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX
| 29,235,036 | 0 | 10 | 6,718 | 0 |
python,google-app-engine,facebook,macos
|
In Android Studio with Google App Engine plugin.
Just add httpAddress = '0.0.0.0' to app cfg in build.grade file.
| 0 | 1 | 0 | 0 |
2010-01-30T15:47:00.000
| 5 | 0 | false | 2,168,409 | 0 | 0 | 1 | 1 |
Can access AppEngine SDK sites via local ip-address when localhost works just fine and a MacOSX using the GoogleAppEngineLauncher.
I'm trying to setup facebook development site (using a dyndns.org hostname pointing at my firewall which redirects the call to my mac book).
It seems like GoogleAppEngineLauncher defaults to localhost and blocks access to the ip-address directly.
Is there a way to change that behaviour in GoogleAppEngineLauncher?
Is this some kind of limitation built in by Google?
It doesn't seem to be an issue of configuration, because there isn't any settings for this.
So I'm guessing patching the source will be required?
|
How to check if a user is logged on in mediawiki in a different app?
| 2,456,365 | 0 | 4 | 4,553 | 0 |
python,authentication,mediawiki
|
All you need to do is essentially forward the session, cookies and all, to the API as if it's the user querying.
How would one go about doing that? I can access the API directly and see my login info, but if I access it via PHP, it shows me as not being logged in (anonymous user id "0"). How do I forward the session, cookies, etc. to the API via PHP to show the user's info?
| 0 | 0 | 0 | 1 |
2010-01-31T08:01:00.000
| 5 | 0 | false | 2,170,990 | 0 | 0 | 1 | 1 |
Here is the situation:
I have a Mediawiki installation, and a few additional server-side scripts that require more resources and were already written in a different language (python). The python code will be very loosely coupled with the Mediawiki code (only called by clicking on a link here or there)
What I would like is that when a GET or POST command is sent to the server to execute a python script, I would like to check to see if a user is already logged in to Mediawiki. If not, I would like to just redirect them to the Mediawiki login page.
Any ideas?
There are several articles on integrating Mediawiki with other PHP frameworks like Drupal and forum software, but that is more than I need.
What is the best way to do this?
-check for cookies somehow (is this secure?)
-does the Mediawiki database keep track of who is logged in?
Thanks
|
How to implement a client admin in Django?
| 2,171,917 | 3 | 4 | 537 | 0 |
python,django,django-admin
|
+1 for custom app, hacking admin can take more time than just putting together your own admin from generic views.
| 0 | 0 | 0 | 0 |
2010-01-31T13:32:00.000
| 2 | 0.291313 | false | 2,171,820 | 0 | 0 | 1 | 1 |
I'm building a simple app, a sort of project/tasks manager where I can have several projects and several tasks that are assigned to one project.
I enabled Django admin for all this sort of tasks and it's working like a charm. Also, I have some users that have projects assigned to them. So what I want now is to enable a cut down version of the admin for those users, where:
They can only manage/see tasks within their own project.
They can only delete their own tasks
some other minor restrictions.
What would be the best approach to this? Should I create another app with custom views and pages for client editing tasks or should I drop another admin instance and fine-tune it just for them?
I hope it was clear and not too subjective. Thanks.
|
Problem deploying Django-Mingus with Flup and Cherokee. Strange admin behaviour
| 2,236,822 | 0 | 1 | 298 | 0 |
python,django,cherokee,scgi
|
I dropped all tables from the database, upgraded to last version of django-mingus after having deleted some dependencies to get them clean installed and I launched the scgi process using a shell script that activate the virtual environment before.
Now everything seems to be stable.
| 0 | 0 | 0 | 0 |
2010-02-01T08:13:00.000
| 1 | 0 | false | 2,175,377 | 0 | 0 | 1 | 1 |
I have a django-mingus blog running perfectly fine with the integrated development web server of django. It's installed in a virtualenv.
Once deployed using the django app wizard of cherokee 0.99.42 the admin pannel is displaying a strange behaviour. Sometimes all apps are displayed in the admin pannel sometime only a subset of the apps are displayed. It's always the same apps that disapear from the main admin view.
The manage.py runfcgi command is launched through the python interpreter installed in the virtualenv.
Do you have a method to track that kind of problem ? Could it be related to environment variable that are not set correctly ?
EDIT:
Could this be a circular import problem ?
2nd EDIT:
The same problem occur with nginx.
Adding Debug=True to the ./manage.py runfcgi command make the setup stable.
|
Using Jython with Django?
| 2,191,492 | 2 | 5 | 462 | 0 |
python,jython
|
I use Jython in testing and rapid-development.
From my point of view it is stable.
| 0 | 0 | 0 | 0 |
2010-02-01T19:19:00.000
| 3 | 0.132549 | false | 2,179,395 | 1 | 0 | 1 | 2 |
I am planning to use Jython with Django. I want to know how stable the Jython project is, how easy to use it is, and how large its developer community is.
|
Using Jython with Django?
| 2,181,008 | 3 | 5 | 462 | 0 |
python,jython
|
I have not used Django with Jython, so I can't speak to that specific issue, but I've used Jython for other things and I've found it quite stable of late, and just as easy as plain Python. I believe the "core committers" in Jython are substantially fewer than in C-Python (maybe 1/3 the number or less), if that's what you mean by "developer community", but I'm not quite sure what's the point in asking about this -- are you considering joining either developer community (Jython or Core Python) and wondering where you could have the best impact?
If that's the case, I think the key issue isn't really how many others are already helping out, but, "what do you bring to the party" -- if you're a JVM wizard, or an expert at any important Java framework, you could be a real boon to the Jython community while that same skill would help much less in the C-Python community; vice versa, if you're a wizard, say, with autoconfigure and C-coded system calls, that would be precious for the C-Python community, but not as useful for the Jython community.
| 0 | 0 | 0 | 0 |
2010-02-01T19:19:00.000
| 3 | 0.197375 | false | 2,179,395 | 1 | 0 | 1 | 2 |
I am planning to use Jython with Django. I want to know how stable the Jython project is, how easy to use it is, and how large its developer community is.
|
Django templates condition check
| 2,182,519 | 0 | 1 | 3,034 | 0 |
python,django
|
Not as shown. Use the ifequal and with template tags instead.
| 0 | 0 | 0 | 0 |
2010-02-02T07:42:00.000
| 2 | 0 | false | 2,182,512 | 0 | 0 | 1 | 1 |
All,
Can t we do the following in templates
{% if subject.id == selected_id %}
and also cannot we assign variable like {{selected="selected"}}
Thank........
|
Pylons and Flex 3
| 2,258,476 | 0 | 0 | 251 | 0 |
python,apache-flex,pylons,twisted
|
I'm working on webapp which has client-side UI coded in Flex 3 and backend is Pylons app. Our client communicates with backend using HTTP GET and POST requests, POST request bodies and all response bodies carry data in JSON format. Works well, just few gotchas:
Flex apps cannot do PUT and DELETE requests. We work around this by doing POST requests and specifying the "real" intended method in X-HTTP-Method-Override header. Then we have some extra routes in routing configuration that handle these requests and treat them as normal PUTs and GETs.
Flex apps can send custom HTTP headers but cannot read custom headers received from server (well they can on IE, but cannot on Firefox and Chrome, IIRC).
| 0 | 1 | 0 | 0 |
2010-02-02T15:45:00.000
| 1 | 0 | false | 2,185,329 | 0 | 0 | 1 | 1 |
Has anyone used Python/Pylons as the server backend for a Flex 3 application? Does anyone have any thoughts on how well this would work? I read Bruce Eckel's article about tying Flex 3 to Twisted, and I've done Twisted programming, but for just a web service I think Pylons is simpler to use.
Thanks in advance,
Doug
|
how to check if request is ajax in turbogears
| 2,187,227 | 1 | 0 | 1,369 | 0 |
python,ajax,mako,turbogears2
|
jQuery, YUI, Prototype, Dojo, and MooTools all set the header X-Requested-With: XMLHttpRequest. You should be able to check for that header.
| 0 | 0 | 0 | 0 |
2010-02-02T19:45:00.000
| 1 | 1.2 | true | 2,187,115 | 0 | 0 | 1 | 1 |
How do I go about checking if a request is an ajax request in a controller method in Turbogears? Further, is it possible to return a 'partial' much like in rails or symfony if the request is an ajax request. I know about the json decorator but I need a way to return a partial of a mako template (because I need to format the data and don't want to to do it all in Javascript). For example if I want to return the formatted list for page two of a list of news stories, I do not want to return the entire page (but rather just the formatted list).
Thanks
|
How can I render a Django template that has UTF8 characters in it?
| 2,187,606 | 1 | 2 | 4,616 | 0 |
python,django,django-templates
|
0x94 is not part of î in UTF-8. The UTF-8 encoding for î is 0xc3 0xae.
| 0 | 0 | 0 | 0 |
2010-02-02T20:47:00.000
| 2 | 0.099668 | false | 2,187,561 | 0 | 0 | 1 | 2 |
I'm trying to send a django email with UTF-8 characters in the template, specifically:
S'il vous plaît
I get the error:
UnicodeDecodeError: 'utf8' codec can't decode byte 0x94 in position 147: unexpected code byte
When trying to encode the special "î" character (that is the character at that position.)
Here is my code for generating the email body:
template = loader.get_template('french_thank_you.html')
|
How can I render a Django template that has UTF8 characters in it?
| 2,187,613 | 6 | 2 | 4,616 | 0 |
python,django,django-templates
|
The editor you're using has saved the file using Mac Roman encoding. Open the template, re-save it as UTF-8, and it should work fine.
| 0 | 0 | 0 | 0 |
2010-02-02T20:47:00.000
| 2 | 1.2 | true | 2,187,561 | 0 | 0 | 1 | 2 |
I'm trying to send a django email with UTF-8 characters in the template, specifically:
S'il vous plaît
I get the error:
UnicodeDecodeError: 'utf8' codec can't decode byte 0x94 in position 147: unexpected code byte
When trying to encode the special "î" character (that is the character at that position.)
Here is my code for generating the email body:
template = loader.get_template('french_thank_you.html')
|
Which is web.py killer app?
| 2,205,554 | 0 | 4 | 3,386 | 0 |
python,web.py
|
A killer app isn't necessarily defined by whether it makes the framework/language famous. The Killer 'App' is an application that disrupts its industry in such a way that the rules or status quo of that industry is changed forever. E.g. the iPhone.
It is 'killer' because it 'kills' off market leaders in its industry.
A by-product of a killer app is that the technology used to bring it to market gets a fair amount of media attention. This is inevitably happens because the majority of developers(in our case) who operate in the killer app's industry want to be up on the latest trends/concepts/etc...
In the iPhone's case: It has sold millions; meaning the iPhone is a cash cow; therefore developers flock; developers need to then know what technology to use; more developers=more attention; etc...
Obviously this is a short summary on what generally happens.
Anyway... Pylons is pretty good. Its gaining quite a bit of attention because it is easily customizable, robust and focused on doing what is necessary which is rapid development.
There is also Turbo Gears, but the latest version is built on Pylons anyway.
Hope this helps.
| 0 | 0 | 0 | 0 |
2010-02-02T20:53:00.000
| 3 | 0 | false | 2,187,610 | 0 | 0 | 1 | 1 |
A killer app is an app that make a library or framework famous. I think web.py is quite famous, but I don't know any big, widely used app written in web.py.
Could you point out any? I've head that the first version of youtube.com was coded using web.py but I'd like you to mention an open source one so I can see its code.
|
django csv import threading
| 2,196,168 | 2 | 0 | 570 | 0 |
python,django,multithreading,csv
|
Django is Python, so yeah you can use threads, processing etc. Look at python docs on this matter.
But, spawning threads in web environment might be not be such a good idea, try searching here for "django asynchronous" - you'll get many ideas of how to this without threading.
| 0 | 0 | 0 | 0 |
2010-02-03T06:19:00.000
| 1 | 1.2 | true | 2,190,075 | 1 | 0 | 1 | 1 |
Is it possible to use threading when importing data from csv files to django.
|
Screen scraping with Python
| 2,190,517 | -2 | 14 | 10,580 | 0 |
python,screen-scraping,htmlunit,pycurl
|
I have not found anything for this. I use a combination of beautifulsoup and custom routines...
| 0 | 0 | 1 | 0 |
2010-02-03T08:11:00.000
| 7 | -0.057081 | false | 2,190,502 | 0 | 0 | 1 | 1 |
Does Python have screen scraping libraries that offer JavaScript support?
I've been using pycurl for simple HTML requests, and Java's HtmlUnit for more complicated requests requiring JavaScript support.
Ideally I would like to be able to do everything from Python, but I haven't come across any libraries that would allow me to do it. Do they exist?
|
Recommended Django setup?
| 2,193,943 | 2 | 1 | 703 | 0 |
python,django,apache
|
Ubuntu is far and away a better platform nowadays. I'm a refugee from RHEL and Fedora. Get Ubuntu 9.10, and if you'd like, spawn it on Amazon ec2 for total flexibility (i.e. launch it in about 90 seconds, play around, do what you want, delete it, and only pay a buck). Otherwise, just use Ubuntu on the desktop.
Ubuntu has Python 2.6 by default so you don't have to go out and find weird upgrade paths. Also Ubuntu has ready-to-go installations for django 1.1.1 (the latest and greatest) that integrate with Apache, etc...
In other words, with zero usage of PIP, easy_install or source installations, you can get running with Django on Ubuntu/Apache.
Once you're comfortable, PIP is the tool you should use for all non-stock python library installations as it's more up to date.
MySQL is easier than Postgres but it doesn't really matter either way.
=== edit ====
I forgot to add that I use mod_wsgi. I forgot all about it since the Ubuntu Apache installation was so easy that I hardly had to even think about it.
| 0 | 0 | 0 | 0 |
2010-02-03T14:40:00.000
| 4 | 1.2 | true | 2,192,685 | 0 | 0 | 1 | 2 |
I am about to embark a major django project. If I install the latest stable release... is the a suggested setup ie. this OS, this RDBMS, this version of python etc?? I'm normally a CentOS man but their repos don't play too well with the django requirements...
|
Recommended Django setup?
| 2,192,712 | 1 | 1 | 703 | 0 |
python,django,apache
|
We use Fedora 11, MySQL, Apache, mod_wsgi, Python 2.6. Works great.
| 0 | 0 | 0 | 0 |
2010-02-03T14:40:00.000
| 4 | 0.049958 | false | 2,192,685 | 0 | 0 | 1 | 2 |
I am about to embark a major django project. If I install the latest stable release... is the a suggested setup ie. this OS, this RDBMS, this version of python etc?? I'm normally a CentOS man but their repos don't play too well with the django requirements...
|
Linux development/minimal smtp and pop3 server
| 2,195,237 | 2 | 1 | 839 | 0 |
python,ruby-on-rails,linux,email
|
Why does it need to be a simple mail server?
Can't you just use something like postfix which is very easy for simple configurations
| 0 | 0 | 0 | 1 |
2010-02-03T20:31:00.000
| 1 | 1.2 | true | 2,195,203 | 0 | 0 | 1 | 1 |
I use python based as well as rails applications on ubuntu linux. We have functionalities like register, forgot password, reset password, email alerts etc features based on emails. Since now a days, we go on offline development, we want to run a local smtp & pop3 server to send and receive emails.
Emails shall be send via the our web application and we will use the email clients like thunderbird to receive emails(just to verify).
I have used jmailsrv (I have used 6 years ago, but could not locate exact package now), a java based simple email server. Are there any other light alternative for development work?
|
DB Permissions with Django unit testing
| 2,195,979 | 2 | 2 | 1,622 | 0 |
python,database,django,unit-testing
|
Don't force Django to do something unnatural.
Allow it to create the test schema. It's a good thing.
From your existing schema, do an unload to create .JSON dump files of the data. These files are your "fixtures". These fixtures are used by Django to populate the test database. This is The Greatest Testing Tool Ever. Once you get your fixtures squared away, this really does work well.
Put your fixture files into fixtures directories within each app package.
Update your unit tests to name the various fixtures files that are required for that test case.
This -- in effect -- tests with an existing schema. It rebuilds, reloads and tests in a virgin database so you can be absolutely sure that it works without destroying (or even touching) live data.
| 0 | 0 | 0 | 0 |
2010-02-03T21:58:00.000
| 5 | 1.2 | true | 2,195,791 | 0 | 0 | 1 | 2 |
Disclaimer:
I'm very new to Django. I must say that so far I really like it. :)
(now for the "but"...)
But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions error when trying to create the schema. So, I get what it's trying to do (create a clean sandbox), but what I really want is to test against an existing schema. And I want to run the test with the same username/password that my server is going to use in production. And of course, that user is NOT going to have any kind of DDL type rights.
So, the basic problem/issue that I see boils down to this: my system (and most) want to have their "app_user" account to have ONLY the permissions needed to run. Usually, this is basic "CRUD" permissions. However, Django unit tests seem to need more than this to do a test run.
How do other people handle this? Is there some settings/work around/feature of Django that I'm not aware (please refer to the initial disclaimer).
Thanks in advance for your help.
David
|
DB Permissions with Django unit testing
| 2,197,772 | 2 | 2 | 1,622 | 0 |
python,database,django,unit-testing
|
After I read David's (OP) question, I was curious about this too, but I don't see the answer I was hoping to see. So let me try to rephrase what I think at least part of what David is asking. In a production environment, I'm sure his Django models probably will not have access to create or drop tables. His DBA will probably not allow him to have permission to do this. (Let's assume this is True). He will only be logged into the database with regular user privileges. But in his development environment, the Django unittest framework forces him to have higher level privileges for the unittests instead of a regular user because Django requires it to create/drop tables for the model unittests. Since the unittests are now running at a higher privilege than will occur in production, you could argue that running the unittests in development are not 100% valid and errors could happen in production that might have been caught in development if Django could run the unittests with user privileges.
I'm curious if Django unittests will ever have the ability to create/drop tables with one user's (higher) privileges, and run the unittests with a different user's (lower) privileges. This would help more accurately simulate the production environment in development.
Maybe in practice this is really not an issue. And the risk is so minor compared to the reward that it not worth worrying about it.
| 0 | 0 | 0 | 0 |
2010-02-03T21:58:00.000
| 5 | 0.07983 | false | 2,195,791 | 0 | 0 | 1 | 2 |
Disclaimer:
I'm very new to Django. I must say that so far I really like it. :)
(now for the "but"...)
But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions error when trying to create the schema. So, I get what it's trying to do (create a clean sandbox), but what I really want is to test against an existing schema. And I want to run the test with the same username/password that my server is going to use in production. And of course, that user is NOT going to have any kind of DDL type rights.
So, the basic problem/issue that I see boils down to this: my system (and most) want to have their "app_user" account to have ONLY the permissions needed to run. Usually, this is basic "CRUD" permissions. However, Django unit tests seem to need more than this to do a test run.
How do other people handle this? Is there some settings/work around/feature of Django that I'm not aware (please refer to the initial disclaimer).
Thanks in advance for your help.
David
|
no procedural code and non mvc in ruby and python?
| 2,198,673 | 3 | 0 | 116 | 0 |
python,ruby,model-view-controller,oop
|
They don't require OOP, but they do require procedural code, as they are imperative languages, and not functional ones. You can use some functional techniques.
There are plenty of frameworks that use MVC for both languages, yes.
| 0 | 0 | 0 | 0 |
2010-02-04T09:35:00.000
| 2 | 0.291313 | false | 2,198,562 | 1 | 0 | 1 | 2 |
i know that these 2 languages require oop.
but inside the classes, could you have procedural code?
and for the mvc part, that pattern comes with their frameworks right?
nothing to do with the actual language itself?
|
no procedural code and non mvc in ruby and python?
| 2,198,616 | 4 | 0 | 116 | 0 |
python,ruby,model-view-controller,oop
|
Neither of these languages require OOP, especially Python. In Python you can write as many ordinary functions as you want, and there are plenty of modules which don't define any classes. In Ruby you can do the same thing, except instead of functions you have methods on a module.
You are correct that MVC is related to the frameworks and not to the languages themselves.
| 0 | 0 | 0 | 0 |
2010-02-04T09:35:00.000
| 2 | 1.2 | true | 2,198,562 | 1 | 0 | 1 | 2 |
i know that these 2 languages require oop.
but inside the classes, could you have procedural code?
and for the mvc part, that pattern comes with their frameworks right?
nothing to do with the actual language itself?
|
Need a way to count entities in GAE datastore that meet a certain condition? (over 1000 entities)
| 4,088,516 | 3 | 4 | 4,016 | 0 |
python,google-app-engine,google-cloud-datastore
|
Results of datastore count() queries
and offsets for all datastore queries
are no longer capped at 1000.
Since Version 1.3.6
| 0 | 1 | 0 | 0 |
2010-02-04T17:02:00.000
| 6 | 0.099668 | false | 2,201,580 | 0 | 0 | 1 | 1 |
I'm building an app on GAE that needs to report on events occurring. An event has a type and I also need to report by event type.
For example, say there is an event A, B and C. They occur periodically at random. User logs in and creates a set of entities to which those events can be attributed. When the user comes back to check the status, I need to be able to tell how many events of A, B and/or C occurred during a specific time range, say a day or a month.
The 1000 limit is throwing a wrench into how I would normally do it. I don't need to retrieve all of the entities and present them to the user, but I do need to show the total count for a specific date range. Any suggestions?
I'm a bit of python/GAE noob...
|
S60 camera focusing
| 2,203,194 | 0 | 0 | 202 | 0 |
python,camera,s60
|
This is just a guess. Are you maybe getting low-res images that are suitable for sending via MMS? I would look at the API.
| 0 | 0 | 0 | 0 |
2010-02-04T20:34:00.000
| 1 | 1.2 | true | 2,202,991 | 1 | 0 | 1 | 1 |
In my project I have to use mobile camera from my own program.
I use python with S60 platform under NOKIA 6220 Classic. It has 5mp-camera.
The problem is that photos quality are very-very low. Seems that auto-focusing doesn't work.
I'd like to know maybe anyone from you made something before. I can buy new telephone if I'll need this.
The main problem - quality of photo. I'm going to screen paper with text.
|
What's a good web framework and/or tool for a software developer?
| 2,204,294 | 0 | 4 | 335 | 0 |
php,python,ruby
|
django on Google App Engine gets you free(up to a point) and scalable hosting
| 0 | 0 | 0 | 1 |
2010-02-05T00:19:00.000
| 5 | 0 | false | 2,204,223 | 0 | 0 | 1 | 2 |
I'd like to make a website, it's not a huge project, but I'm a bit out of the web design loop. The last time I made a website was probably around 2002. I figure the web frameworks and tools have come a ways since then. It's mostly the design aspect that I'd like it to make easier. I can do the backend language in any language.
My question is:
What are some tools or web frameworks that make the design aspect of making a website easier. It could be a framework in php/python/ruby.
As far as tools go, free/open source is preferred, but I wouldn't mind looking at good commercial alternatives.
|
What's a good web framework and/or tool for a software developer?
| 2,204,292 | 0 | 4 | 335 | 0 |
php,python,ruby
|
It really depends on a couple things:
What are you familiar with? You indicated that you've done some web development in the past. What did you use? If you were using classic ASP, then learning ASP.NET should be less of a jump for you.
What are you trying to create? If all you need are static HTML files with a tiny bit of functionality, you could try learning PHP as it's pretty quick and easy to get going. If you need light database access, then maybe Ruby on Rails will be your cup of tea.
With that being said, I'd recommend the following in no particular order (just because I've tried them and they're all pretty decent):
Ruby on Rails
ASP.NET / ASP.NET MVC
PHP
| 0 | 0 | 0 | 1 |
2010-02-05T00:19:00.000
| 5 | 0 | false | 2,204,223 | 0 | 0 | 1 | 2 |
I'd like to make a website, it's not a huge project, but I'm a bit out of the web design loop. The last time I made a website was probably around 2002. I figure the web frameworks and tools have come a ways since then. It's mostly the design aspect that I'd like it to make easier. I can do the backend language in any language.
My question is:
What are some tools or web frameworks that make the design aspect of making a website easier. It could be a framework in php/python/ruby.
As far as tools go, free/open source is preferred, but I wouldn't mind looking at good commercial alternatives.
|
best (python) setup for cpu / memory intensive task
| 2,205,899 | 2 | 3 | 839 | 0 |
c#,java,.net,python,memory
|
Since you can install all of those for free and it sounds like you already have the code implemented in both .Net and Java then I suggest you benchmark the program on all four platforms (windows/linux * java/.net).
It sounds like all the heavy lifting is done in Java/C#, so I suspect the relative performance of Jython vs. IronPython is largely irrelevant.
| 0 | 0 | 0 | 1 |
2010-02-05T08:19:00.000
| 2 | 1.2 | true | 2,205,832 | 1 | 0 | 1 | 2 |
i'm doing simulation which generates thousands of result objects.
Each object size is around 1mb, and all the result objects should be on memory to be queried for various ad hoc reports. And it takes 1~2 secs to make one result object.
So it takes more than 5 minutes to get one simulation done even though i fully use my quad-core cpu with parallel execution. And the task process takes more than 4~5 gb memory for one simulation set. The problem is, I want to run more simulation sets simultaneously and get it done more quickly.
Currently, I'm doing this job using c# and ironpython on windows vista64, quad-core cpu with 8g memory. I gonna order a new computer, 24 gb memory with better cpu and ultimately, i may buy workstation with multi cpus and more memories.
So my question is, what is the best way to utilize new hardware?
I consider one of the combinations below.
ironpython + c# on windows 64
ironpython + c# (mono) on linux 64
jython + java on windows 64
jython + java on linux 64
Simulation engine is written in c# / java, and i use python to make reports.
Which combination do you guys think is the best?
Is there no big difference between .net and java platform to handle memory consuming task?
Is there no difference between windows and linux?
I sometimes run my current c# + ironpython code on my ubuntu laptop (32bit, 2g ram) and feel that it seems pretty stable compared to windows .net env on the same spec hardware. But i dont know when the underlying hardware is pretty better.
And i welcome any kind of suggestion regardless of the choices above.
|
best (python) setup for cpu / memory intensive task
| 2,205,986 | 2 | 3 | 839 | 0 |
c#,java,.net,python,memory
|
@Dave is spot on, if you really care benchmark each combination and see.
Personally I'd suggest you stick with the tool set that you are most comfortable with, be that Windows, Java, Linux, .Net or any random combination there of. Your level of productivity in maintaining and developing your software usually trumps any minor performance gain you might get from switching OS or VM.
| 0 | 0 | 0 | 1 |
2010-02-05T08:19:00.000
| 2 | 0.197375 | false | 2,205,832 | 1 | 0 | 1 | 2 |
i'm doing simulation which generates thousands of result objects.
Each object size is around 1mb, and all the result objects should be on memory to be queried for various ad hoc reports. And it takes 1~2 secs to make one result object.
So it takes more than 5 minutes to get one simulation done even though i fully use my quad-core cpu with parallel execution. And the task process takes more than 4~5 gb memory for one simulation set. The problem is, I want to run more simulation sets simultaneously and get it done more quickly.
Currently, I'm doing this job using c# and ironpython on windows vista64, quad-core cpu with 8g memory. I gonna order a new computer, 24 gb memory with better cpu and ultimately, i may buy workstation with multi cpus and more memories.
So my question is, what is the best way to utilize new hardware?
I consider one of the combinations below.
ironpython + c# on windows 64
ironpython + c# (mono) on linux 64
jython + java on windows 64
jython + java on linux 64
Simulation engine is written in c# / java, and i use python to make reports.
Which combination do you guys think is the best?
Is there no big difference between .net and java platform to handle memory consuming task?
Is there no difference between windows and linux?
I sometimes run my current c# + ironpython code on my ubuntu laptop (32bit, 2g ram) and feel that it seems pretty stable compared to windows .net env on the same spec hardware. But i dont know when the underlying hardware is pretty better.
And i welcome any kind of suggestion regardless of the choices above.
|
global variable from django to javascript
| 2,206,464 | 1 | 5 | 1,966 | 0 |
javascript,python,django
|
I'm not familiar with django, so this might be completely incorrect.
Can you write out the variables to hidden HTML fields on the page. This will allow you to access them from JavaScript, or utilise them in form posts should you require that.
| 0 | 0 | 0 | 0 |
2010-02-05T09:57:00.000
| 3 | 0.066568 | false | 2,206,353 | 0 | 0 | 1 | 2 |
I would like some variables from my settings.py to be available in every javascript running across my project.
What is the most elegant way of achieving this?
Right now I can think of two:
write a context processor and declare those globals in a base template. All templates must extend the base template.
declare those globals in a dynamically generated .js file (by some view) and load this file using <script> tag in a base template. All templates must extend the base template.
Can I do it without a base template?
|
global variable from django to javascript
| 2,206,532 | 6 | 5 | 1,966 | 0 |
javascript,python,django
|
I would use option 1. You should use a base template in any case, and a context processor is probably the best way of getting the variables into it.
| 0 | 0 | 0 | 0 |
2010-02-05T09:57:00.000
| 3 | 1.2 | true | 2,206,353 | 0 | 0 | 1 | 2 |
I would like some variables from my settings.py to be available in every javascript running across my project.
What is the most elegant way of achieving this?
Right now I can think of two:
write a context processor and declare those globals in a base template. All templates must extend the base template.
declare those globals in a dynamically generated .js file (by some view) and load this file using <script> tag in a base template. All templates must extend the base template.
Can I do it without a base template?
|
How to write dynamic Django models?
| 2,207,718 | 0 | 1 | 580 | 0 |
python,django
|
One, popular, option would be to use something like tags. So you'd have the stuff that's common to all items, like an item ID, name, description, price. Then you'd have some more generic tags or described tags in another table, associated with those items. You could have a tag that represents the season, or automobile specifications, etc...
Of course, it really depends on how you design the system to cope with that additional information.
| 0 | 0 | 0 | 0 |
2010-02-05T13:44:00.000
| 2 | 0 | false | 2,207,562 | 0 | 0 | 1 | 1 |
what i want, is to receive advices to define a re-usefull Product model, for a shopping site app, nowadays I know that the store is going to commerce with "clothing", so the product model will have a "season or collections" relationship, but in the future I should use that app to commerce with X product, e.g: "cars" which have "mechanical specifications" relationships.
So Im thinking in metamodels, creating a generic model defined by key/values, but, how to make the relationships?.
But, you are the experts community and I hope you help me to see beyond.
|
how do people normally deal with class variables in django?
| 2,213,602 | 1 | 2 | 680 | 0 |
python,django-models
|
The default primary key will already be a unique monotonic integer (even in SQLite if you don't delete any records), so you can just use that for it.
| 0 | 0 | 0 | 0 |
2010-02-06T15:27:00.000
| 3 | 1.2 | true | 2,213,595 | 0 | 0 | 1 | 1 |
I can't see any provision for this in the django docs, so how do people go about doing this.
My specific case is this.
I have a shopping cart, each cart instance has an invoice number field, however the invoice number is only generated if the cart goes to a paid status, so not all shopping cart instances will have an invoice number. I want all invoice numbers to be sequential with no gaps between them, so the default pk isn't perfect in this case, so I want a class variable that acts as a counter for the invoice numbers, and is accessable by all instances.
|
Django: Making ForeignKey not create a back-reference
| 2,214,882 | 1 | 1 | 1,714 | 0 |
python,django
|
Why would you want to do this? You don't have to use it if you don't want to.
In any case, the back-reference is only a code shortcut - it's exactly equivalent to Car.objects.filter(person_id=person.id).
| 0 | 0 | 0 | 0 |
2010-02-06T20:59:00.000
| 2 | 0.099668 | false | 2,214,705 | 0 | 0 | 1 | 1 |
I know that I can use ForeignKey's related_name argument to control what the back-reference's name will be. But is it possible to avoid creating a back-reference completely?
(e.g., I have in Car a field ForeignKey(Person), and I don't want Person to have an attribute that leads backs to Car.)
|
Python + Komodo Edit
| 2,219,126 | 1 | 1 | 654 | 0 |
python,scapy,komodoedit
|
Autocomplete in Python is a hit or miss proposition. It varies widely -- some things can be analyzed by Komodo and some can't.
If it won't autocomplete, it's probably because it relies on too many metaclass techniques that seem to baffle Komodo.
| 0 | 0 | 0 | 0 |
2010-02-07T22:30:00.000
| 2 | 0.099668 | false | 2,218,637 | 0 | 0 | 1 | 2 |
I am trying to get scapy to auto complete in komodo edit with no success, has anyone successfully done this?
Thanks,
Python New Comer
|
Python + Komodo Edit
| 2,220,978 | 1 | 1 | 654 | 0 |
python,scapy,komodoedit
|
If you're in virtualenv or have some tricky python paths you have to add additional import directories in:
Preferences -> Languages -> Python ->
Additional Python Import Directories
Komodo can't understand these things out of the box.
Also make sure you have following option enabled:
Preferences -> Code Intelligence ->
Include all files and directories from the project base directory
These steps would enable code completion to decent quality but as mentioned by S.Lott it is nearly impossible to implement full-featured auto-completion (like in Java or C#) in Python due its dynamic nature.
| 0 | 0 | 0 | 0 |
2010-02-07T22:30:00.000
| 2 | 0.099668 | false | 2,218,637 | 0 | 0 | 1 | 2 |
I am trying to get scapy to auto complete in komodo edit with no success, has anyone successfully done this?
Thanks,
Python New Comer
|
Online identity verification solution
| 2,223,896 | 0 | 5 | 747 | 0 |
python,identity,verification
|
You should have a look at WS-Trust.
A implementation of that is Windows Identity Foundation. But I'm sure You'll find more.
| 0 | 0 | 1 | 0 |
2010-02-08T18:12:00.000
| 4 | 0 | false | 2,223,790 | 0 | 0 | 1 | 2 |
I am building a Python web application and we will need a user identity verification solution... something to verify the users identity during account registration.
I was wondering if anyone had any experience in integrating such a solution. What vendors/products out there have worked well with you? Any tips?
I don't have any experience in this matter so feel free to let me know if any additional information is required.
Thanks in advance!
|
Online identity verification solution
| 2,224,273 | 1 | 5 | 747 | 0 |
python,identity,verification
|
There are many different ways to implement a verification system, the concept is quite simple but actually building can be a hassle, especially if you are doing it from scratch.
The best way to approach this is to find a framework that handles the aspect of verification. Turbogears and Pylons are both capable of this rather than doing it yourself or using third party apps.
Personally I have worked on commercial projects using both frameworks and was able to sort out verification quite easily.
User verification utilizes specific concepts and low level technology such as: the internet's stateless characteristic, session handling, database design, etc...
So the point I am making is that it would be better if you rather got a good, stable framework that could do the dirty work for you.
By the way what framework are you thinking of using? That would help me give a more detailed answer.
Hope this helps?
| 0 | 0 | 1 | 0 |
2010-02-08T18:12:00.000
| 4 | 0.049958 | false | 2,223,790 | 0 | 0 | 1 | 2 |
I am building a Python web application and we will need a user identity verification solution... something to verify the users identity during account registration.
I was wondering if anyone had any experience in integrating such a solution. What vendors/products out there have worked well with you? Any tips?
I don't have any experience in this matter so feel free to let me know if any additional information is required.
Thanks in advance!
|
RSS Feed aggregator using Google App Engine - Python
| 2,253,676 | 1 | 4 | 3,392 | 0 |
python,rss,feed
|
I found a way to work around this issue, though I am not sure if this is the optimal solution.
Instead of Minidom I have used cElementTree to parse the RSS feed. I process each "item" tag and its children in a seperate task and add these tasks to the task queue.
This has helped me avoid the DeadlineExceededError. I get the "This resource uses a lot of CPU resources" warning though.
Any idea on how to avoid the warning?
A_iyer
| 0 | 1 | 0 | 0 |
2010-02-08T19:20:00.000
| 3 | 0.066568 | false | 2,224,219 | 0 | 0 | 1 | 1 |
I am trying to build a GAE app that processes an RSS feed and stores all the data from the feed into Google Datastore. I use Minidom to extract content from the RSS feed. I also tried using Feedparser and BeautifulSoup but they did not work for me.
My app currently parses the feed and saves it in the Google datastore in about 25 seconds on my local machine. I uploaded the app and I when I tried to use it, I got the "DeadLine Exceeded Error".
I would like to know if there are any possible ways to speed up this process? The feed I use will eventually grow to have more than a 100 items over time.
|
Interpreting WAV Data
| 2,226,925 | 2 | 7 | 12,203 | 0 |
python,audio,pcm
|
The duration is simply the number of frames divided by the number of frames per second. From your data this is: 96333 / 44100 = 2.18 seconds.
| 0 | 0 | 0 | 0 |
2010-02-09T05:01:00.000
| 6 | 0.066568 | false | 2,226,853 | 0 | 0 | 1 | 2 |
I'm trying to write a program to display PCM data. I've been very frustrated trying to find a library with the right level of abstraction, but I've found the python wave library and have been using that. However, I'm not sure how to interpret the data.
The wave.getparams function returns (2 channels, 2 bytes, 44100 Hz, 96333 frames, No compression, No compression). This all seems cheery, but then I tried printing a single frame:'\xc0\xff\xd0\xff' which is 4 bytes. I suppose it's possible that a frame is 2 samples, but the ambiguities do not end there.
96333 frames * 2 samples/frame * (1/44.1k sec/sample) = 4.3688 seconds
However, iTunes reports the time as closer to 2 seconds and calculations based on file size and bitrate are in the ballpark of 2.7 seconds. What's going on here?
Additionally, how am I to know if the bytes are signed or unsigned?
Many thanks!
|
Interpreting WAV Data
| 2,226,910 | 2 | 7 | 12,203 | 0 |
python,audio,pcm
|
Each sample is 16 bits and there 2 channels, so the frame takes 4 bytes
| 0 | 0 | 0 | 0 |
2010-02-09T05:01:00.000
| 6 | 0.066568 | false | 2,226,853 | 0 | 0 | 1 | 2 |
I'm trying to write a program to display PCM data. I've been very frustrated trying to find a library with the right level of abstraction, but I've found the python wave library and have been using that. However, I'm not sure how to interpret the data.
The wave.getparams function returns (2 channels, 2 bytes, 44100 Hz, 96333 frames, No compression, No compression). This all seems cheery, but then I tried printing a single frame:'\xc0\xff\xd0\xff' which is 4 bytes. I suppose it's possible that a frame is 2 samples, but the ambiguities do not end there.
96333 frames * 2 samples/frame * (1/44.1k sec/sample) = 4.3688 seconds
However, iTunes reports the time as closer to 2 seconds and calculations based on file size and bitrate are in the ballpark of 2.7 seconds. What's going on here?
Additionally, how am I to know if the bytes are signed or unsigned?
Many thanks!
|
Does anyone know of a Urwid like environment that is cross-platform for Python 3.x?
| 2,239,928 | 0 | 0 | 322 | 0 |
python,cross-platform,python-3.x
|
Help port Urwid to Python 3! That is most likely more work that just running 2to3 on it, though.
| 0 | 1 | 0 | 0 |
2010-02-09T05:18:00.000
| 3 | 0 | false | 2,226,913 | 0 | 0 | 1 | 1 |
I would like it to run on Linux, OS X, and Windows (XP/Vista/7).
Thanks for any input.
|
Python Django simple site
| 2,229,018 | 0 | 4 | 926 | 0 |
python,django
|
I have python scripts which provides output and I need to have this output on the web.
What is Django for? Use either CGI script on python (probably you already have one) or WSGI application (which is a bit harder to deploy)
| 0 | 0 | 0 | 0 |
2010-02-09T12:30:00.000
| 6 | 0 | false | 2,228,966 | 0 | 0 | 1 | 3 |
I'm trying to create site using Django framework. I looked on tutorial on Django project site but contains much information which I don't need. I have python scripts which provides output and I need to have this output on the web. My question is how simply manage Django to have link which start the script and provides its output on the web or perhaps you provide the link where I can read about this?
Thank you.
|
Python Django simple site
| 2,229,044 | 0 | 4 | 926 | 0 |
python,django
|
Django is a frame work. Just use CGI scripts.
| 0 | 0 | 0 | 0 |
2010-02-09T12:30:00.000
| 6 | 0 | false | 2,228,966 | 0 | 0 | 1 | 3 |
I'm trying to create site using Django framework. I looked on tutorial on Django project site but contains much information which I don't need. I have python scripts which provides output and I need to have this output on the web. My question is how simply manage Django to have link which start the script and provides its output on the web or perhaps you provide the link where I can read about this?
Thank you.
|
Python Django simple site
| 2,228,989 | 0 | 4 | 926 | 0 |
python,django
|
That's not how Django works. Do the tutorial, you'll save a lot of time and frustration.
| 0 | 0 | 0 | 0 |
2010-02-09T12:30:00.000
| 6 | 0 | false | 2,228,966 | 0 | 0 | 1 | 3 |
I'm trying to create site using Django framework. I looked on tutorial on Django project site but contains much information which I don't need. I have python scripts which provides output and I need to have this output on the web. My question is how simply manage Django to have link which start the script and provides its output on the web or perhaps you provide the link where I can read about this?
Thank you.
|
Python CDROM Production
| 2,228,998 | 0 | 0 | 214 | 0 |
python,adobe,media,dvd,cd-rom
|
It sounds like you're not asking so much for mass-copying of CDs/DVDs (which is what I assumed from reading the title), but for a Python-based replacement for Adobe Director? I don't think anything like that presently exists.
However, Python could certainly help you out with the scripting and control of various elements in the production process -- for example, taking the tedium out of assembling lots of files together into one final package. You'd have to be more specific about what you're looking for, though.
| 0 | 0 | 0 | 1 |
2010-02-09T12:36:00.000
| 3 | 0 | false | 2,228,988 | 0 | 0 | 1 | 2 |
I have been using Macromedia / Adobe Director & Lingo since 1998. I am extremely familiar with using this software to create CDROMs and DVDs and also have a good knowledge of design elements and their integration such as flash videos, images & audio etc.
I am always keen to explore other technologies and understand that Python can be used to create CDROMs.
I have tried Googling some information on this subject but to no avail. Does anyone know the pros and cons of Python CDROM production? Is it capable of delivering such media rich experiences as Adobe Director? What are the limitations?
Any help / resources would be greatly appreciated.
|
Python CDROM Production
| 2,229,023 | 1 | 0 | 214 | 0 |
python,adobe,media,dvd,cd-rom
|
Python isn't the tool you are looking for... [waves hand across in front of Mindblip's face]
Stick with Director or try Flash with either MPlayer or Zinc.
| 0 | 0 | 0 | 1 |
2010-02-09T12:36:00.000
| 3 | 0.066568 | false | 2,228,988 | 0 | 0 | 1 | 2 |
I have been using Macromedia / Adobe Director & Lingo since 1998. I am extremely familiar with using this software to create CDROMs and DVDs and also have a good knowledge of design elements and their integration such as flash videos, images & audio etc.
I am always keen to explore other technologies and understand that Python can be used to create CDROMs.
I have tried Googling some information on this subject but to no avail. Does anyone know the pros and cons of Python CDROM production? Is it capable of delivering such media rich experiences as Adobe Director? What are the limitations?
Any help / resources would be greatly appreciated.
|
Django ModelForm with extra fields that are not in the model
| 2,230,669 | 5 | 65 | 49,864 | 0 |
python,django,forms
|
First, you shouldn't have artist_id and artist fields. They are build from the model. If you need some artist name, add artist_name field, that is CharField.
Furthermore, you are trying to retrieve something from cleaned_data inside clean value. There might not be data you need - you should use values from self.data, where is data directly from POST.
| 0 | 0 | 0 | 0 |
2010-02-09T12:44:00.000
| 7 | 0.141893 | false | 2,229,039 | 0 | 0 | 1 | 1 |
I have done a ModelForm adding some extra fields that are not in the model. I use these fields for some calcualtions when saving the form.
The extra fields appear on the form and they are sent in the POST request when uploading the form. The problem is they are not added to the cleaned_data dictionary when I validate the form. How can I access them?
|
Django: Setting one page as the main page
| 2,229,654 | 1 | 0 | 327 | 0 |
python,django
|
Create MAIN_PAGE setting inside settings.py with primary key. Then create view main_page nad retrieve the main_page object from the database using the setting.
EDIT:
You can also do it like this: add a model, which will reference a SimplePage and point to the main page. In main page view, you will retrieve the wanted SimplePage and it can be easily changed by anyone in django admin.
| 0 | 0 | 0 | 0 |
2010-02-09T14:13:00.000
| 2 | 1.2 | true | 2,229,640 | 0 | 0 | 1 | 1 |
I'm a newbie at Django and I want to do something that I'm not sure how to do.
I have a model SimplePage, which simply stands for a webpage that is visible on the website and whose contents can be edited in the admin. (I think this is similar to FlatPage.)
So I have a bunch of SimplePages for my site, and I want one of them to be the main page. (a.k.a. the index page.) I know how to make it available on the url /. But I also want it to receive slightly different processing. (It contains different page elements than the other pages.)
What would be a good way to mark a page as the main page? I considered adding a boolean field is_main_page to the SimplePage model, but how could I assure that only one page could be marked as the main page?
|
Get all related Django model objects
| 40,207,709 | 2 | 96 | 54,612 | 0 |
python,django,django-models,merge
|
Unfortunately, user._meta.get_fields() returns only relations accessible from user, however, you may have some related object, which uses related_name='+'. In such case, the relation would not be returned by user._meta.get_fields(). Therefore, if You need generic and robust way to merge objects, I'd suggest to use the Collector mentioned above.
| 0 | 0 | 0 | 0 |
2010-02-10T01:46:00.000
| 9 | 0.044415 | false | 2,233,883 | 0 | 0 | 1 | 1 |
How can I get a list of all the model objects that have a ForeignKey pointing to an object? (Something like the delete confirmation page in the Django admin before DELETE CASCADE).
I'm trying to come up with a generic way of merging duplicate objects in the database. Basically I want all of the objects that have ForeignKeys points to object "B" to be updated to point to object "A" so I can then delete "B" without losing anything important.
Thanks for your help!
|
SQLAlchemy ForeignKey relation via an intermediate table
| 2,248,806 | 1 | 0 | 928 | 1 |
python,sqlalchemy
|
Assuming I understand you question correctly, then No, you can't model that relationship as you have suggested. (It would help if you described your desired result, rather than your perceived solution)
What I think you may want is a many-to-many mapping table called ArticleCategories, consisting of 2 int columns, ArticleID and CategoryID (with respective FKs)
| 0 | 0 | 0 | 0 |
2010-02-10T02:30:00.000
| 1 | 0.197375 | false | 2,234,030 | 0 | 0 | 1 | 1 |
Suppose that I have a table Articles, which has fields article_id, content and it contains one article with id 1.
I also have a table Categories, which has fields category_id (primary key), category_name, and it contains one category with id 10.
Now suppose that I have a table ArticleProperties, that adds properties to Articles. This table has fields article_id, property_name, property_value.
Suppose that I want to create a mapping from Categories to Articles via ArticleProperties table.
I do this by inserting the following values in the ArticleProperties table: (article_id=1, property_name="category", property_value=10).
Is there any way in SQLAlchemy to express that rows in table ArticleProperties with property_name "category" are actually FOREIGN KEYS of table Articles to table Categories?
This is a complicated problem and I haven't found an answer myself.
Any help appreciated!
Thanks, Boda Cydo.
|
How do I prevent duplicating code with pylons html table updated via ajax?
| 2,234,168 | 1 | 0 | 118 | 0 |
python,ajax,html-table,pylons
|
One possibility would be to actually generate the AJAX HTML server-side (instead of generating JSON), and insert it right into the DOM tree (instead of parsing the JSON and generating the HTML on the client). Then you could use the same functions on the server side to generate the AJAX rows before they are shipped off. An advantage here is that you don't have to worry about parsing anything in the browser, so the JavaScript could become much simpler, and potentially faster.
| 0 | 0 | 0 | 0 |
2010-02-10T03:06:00.000
| 1 | 0.197375 | false | 2,234,153 | 0 | 0 | 1 | 1 |
I have a pylons web-page with a table. I have created python functions in the template which help with the construction of the table html. One of these functions takes an 'item' and generates an html row while also adding css zebra striping. The other def generates the header row's html.
This works perfectly for loading the initial table using the context variable 'items'. However, when I try to update the table via ajax, I pull new table contents off the server in JSON format. My 'items' are then Javascript objects in a Javascript array. I can no longer use the pylons 'getHeaderHtml()' and 'getRowHtml(item)'. So the handling of my zebra striping as well as the formatting of the html must be duplicated? There has to be a better way, right?
|
Django user impersonation by admin
| 2,242,953 | -2 | 25 | 10,136 | 0 |
python,django,impersonation
|
Set up so you have two different host names to the same server. If you are doing it locally, you can connect with 127.0.0.1, or localhost, for example. Your browser will see this as three different sites, and you can be logged in with different users. The same works for your site.
So in addition to www.mysite.com you can set up test.mysite.com, and log in with the user there. I often set up sites (with Plone) so I have both www.mysite.com and admin.mysite.com, and only allow access to the admin pages from there, meaning I can log in to the normal site with the username that has the problems.
| 0 | 0 | 0 | 0 |
2010-02-11T07:35:00.000
| 6 | -0.066568 | false | 2,242,909 | 0 | 0 | 1 | 2 |
I have a Django app. When logged in as an admin user, I want to be able to pass a secret parameter in the URL and have the whole site behave as if I were another user.
Let's say I have the URL /my-profile/ which shows the currently logged in user's profile. I want to be able to do something like /my-profile/?__user_id=123 and have the underlying view believe that I am actually the user with ID 123 (thus render that user's profile).
Why do I want that?
Simply because it's much easier to reproduce certain bugs that only appear in a single user's account.
My questions:
What would be the easiest way to implement something like this?
Is there any security concern I should have in mind when doing this? Note that I (obviously) only want to have this feature for admin users, and our admin users have full access to the source code, database, etc. anyway, so it's not really a "backdoor"; it just makes it easier to access a user's account.
|
Django user impersonation by admin
| 2,249,857 | 1 | 25 | 10,136 | 0 |
python,django,impersonation
|
i don't see how that is a security hole any more than using su - someuser as root on a a unix machine. root or an django-admin with root/admin access to the database can fake anything if he/she wants to. the risk is only in the django-admin account being cracked at which point the cracker could hide tracks by becoming another user and then faking actions as the user.
yes, it may be called a backdoor, but as ibz says, admins have access to the database anyways. being able to make changes to the database in that light is also a backdoor.
| 0 | 0 | 0 | 0 |
2010-02-11T07:35:00.000
| 6 | 0.033321 | false | 2,242,909 | 0 | 0 | 1 | 2 |
I have a Django app. When logged in as an admin user, I want to be able to pass a secret parameter in the URL and have the whole site behave as if I were another user.
Let's say I have the URL /my-profile/ which shows the currently logged in user's profile. I want to be able to do something like /my-profile/?__user_id=123 and have the underlying view believe that I am actually the user with ID 123 (thus render that user's profile).
Why do I want that?
Simply because it's much easier to reproduce certain bugs that only appear in a single user's account.
My questions:
What would be the easiest way to implement something like this?
Is there any security concern I should have in mind when doing this? Note that I (obviously) only want to have this feature for admin users, and our admin users have full access to the source code, database, etc. anyway, so it's not really a "backdoor"; it just makes it easier to access a user's account.
|
WSGI/Django: pass username back to Apache for access log
| 2,244,295 | 1 | 9 | 2,209 | 1 |
python,django,apache,authentication,mod-wsgi
|
This probably isn't what you're expecting, but you could use the username in your URL scheme. That way the user will be in the path section of your apache logs.
You'd need to modify your authentication so that auth-required responses are obvious in the apache logs, otherwise when viewing the logs you may attribute unauthenticated requests to authenticated users. E.g. return a temporary redirect to the login page if the request isn't authenticated.
| 0 | 0 | 0 | 0 |
2010-02-11T12:03:00.000
| 5 | 0.039979 | false | 2,244,244 | 0 | 0 | 1 | 2 |
My Django app, deployed in mod_wsgi under Apache using Django's standard WSGIHandler, authenticates users via form login on the Django side. So to Apache, the user is anonymous. This makes the Apache access log less useful.
Is there a way to pass the username back through the WSGI wrapper to Apache after handling the request, so that it appears in the Apache access log?
(Versions: Django 1.1.1, mod_wsgi 2.5, Apache 2.2.9)
|
WSGI/Django: pass username back to Apache for access log
| 10,406,967 | 1 | 9 | 2,209 | 1 |
python,django,apache,authentication,mod-wsgi
|
Correct me if I'm wrong, but what's stopping you from creating some custom middleware that sets a cookie equal to the display name of the current user logged in. This middleware will run on every view, so even though technically the user could spoof his username to display whatever he wants it to display, it'll just be reset anyway and it's not like its a security risk because the username itself is just for log purposes, not at all related to the actual user logged in. This seems like a simple enough solution, and then Apache log can access cookies so that gives you easiest access. I know some people wouldn't like the idea of a given user spoofing his own username, but i think this is the most trivial solution that gets the job done. Especially, in my case, when it's an iPhone app and the user doesn't have any direct access to a javascript console or the cookies itself.
| 0 | 0 | 0 | 0 |
2010-02-11T12:03:00.000
| 5 | 0.039979 | false | 2,244,244 | 0 | 0 | 1 | 2 |
My Django app, deployed in mod_wsgi under Apache using Django's standard WSGIHandler, authenticates users via form login on the Django side. So to Apache, the user is anonymous. This makes the Apache access log less useful.
Is there a way to pass the username back through the WSGI wrapper to Apache after handling the request, so that it appears in the Apache access log?
(Versions: Django 1.1.1, mod_wsgi 2.5, Apache 2.2.9)
|
GeoModel with Google App Engine - queries
| 7,342,144 | 1 | 5 | 941 | 0 |
python,google-app-engine,geolocation,geospatial
|
There's no practical way to do this, because a call to geoquery devolves into multiple datastore queries, which it merges together into a single result set. If you were able to specify an offset, geoquery would still have to fetch and discard all the first n results before returning the ones you requested.
A better option might be to modify geoquery to support cursors, but each query would have to return a set of cursors, not a single one.
| 0 | 0 | 0 | 0 |
2010-02-11T22:41:00.000
| 2 | 0.099668 | false | 2,248,341 | 0 | 0 | 1 | 1 |
I'm trying to use GeoModel python module to quickly access geospatial data for my Google App Engine app.
I just have a few general questions for issues I'm running into.
There's two main methods, proximity_fetch and bounding_box_fetch, that you can use to return queries. They actually return a result set, not a filtered query, which means you need to fully prepare a filtered query before passing it in. It also limits you from iterating over the query set, since the results are fetched, and you don't have the option to input an offset into the fetch.
Short of modifying the code, can anyone recommend a solution for specifying an offset into the query? My problem is that I need to check each result against a variable to see if I can use it, otherwise throw it away and test the next. I may run into cases where I need to do an additional fetch, but starting with an offset.
|
Django Master-Detail View Plugins
| 2,250,366 | 2 | 2 | 2,025 | 0 |
python,django,django-templates,django-views,master-detail
|
2 common solution I use for this problem:
Partial Templates:
Create a template for rendering "social" and "financial" that does not need stuff from the view, other than the object it is working on (and uses the objects functions or template tags to render it).
then you can easily {% include %} it (and set the needed variable first).
This partial view does not render a full HTML page, but only a single DIV or some other HTML element you wish to use. If you also need a "social-only" page, you can create a page that renders the header and then includes the partial template. You can use a convention like _template.html for the partial template, and template.html for the regular template.
AJAX:
Make your "social" and "financial" views aware of being called in XMLHTTPRequest (request.is_ajax()). If they are, they return only a DIV element, without all the HTML around it. This way your master page can render without it, and add that content on the fly.
The AJAX way has several advantages: you don't render the plugin views on the same request as the whole page, so if you have many of these plugin views, the master page will load faster, and you can have a smart javascript choose only the relevant plugin views to ask for.
Also, you can use the normal view to generate data you need in the template (which you can't really do in the Partial Templates method).
| 0 | 0 | 0 | 0 |
2010-02-12T02:23:00.000
| 1 | 1.2 | true | 2,249,285 | 0 | 0 | 1 | 1 |
Let's say I have 3 django apps, app Country, app Social and app Financial.
Country is a 'master navigation' app. It lists all the countries in a 'index' view and shows details for each country on its 'details' view.
Each country's details include their Social details (from the social app) and their Financial details (from the financial app).
Social and Financial both have a detail view (for each country)
Is there an elegant way to 'plug' in those sub-detail views into the master detail view provided by Countries? So for each country detail page I would see 2 tabs showing the social and the financial details for that country.
|
How to improve the throughput of request_logs on Google App Engine
| 2,249,540 | 1 | 1 | 499 | 0 |
python,google-app-engine,logging
|
You can increase the per-request batch size of logs. In the latest SDK (1.3.1), check out google_appengine/google/appengine/tools/appcfg.py around like 861 (RequestLogLines method of LogsRequester class). You can modify the "limit" parameter.
I am using 1000 and it works pretty well.
| 0 | 1 | 0 | 0 |
2010-02-12T03:40:00.000
| 1 | 1.2 | true | 2,249,530 | 0 | 0 | 1 | 1 |
Downloading logs from App Engine is nontrivial. Requests are batched; appcfg.py does not use normal file IO but rather a temporary file (in reverse chronological order) which it ultimately appends to the local log file; when appending, the need to find the "sentinel" makes log rotation difficult since one must leave enough old logs for appcfg.py to remember where it left off. Finally, Google deletes old logs after some time (20 minutes for the app I use).
As an app scales, and the log generation rate grows, how can one increase the speed of fetching the logs so that appcfg.py does not fall behind?
|
Running script on server start in google app engine, in Python
| 2,253,428 | 4 | 5 | 2,804 | 0 |
python,google-app-engine
|
I use appengine python with the django helper. As far as I know you cannot hook anything on the deploy, but you could put a call to check if you need to do your setup in the main function of main.py. This is how the helper initializes itself on the first request. I haven't looked at webapp in a while, but I assume main.py acts in a similar fashion for that framework.
Be aware that main is run on the first request, not when you first deploy. It will also happen if appengine starts up a new instance to handle load, or if all instances were stopped because of inactivity. So make sure you check to see if you need to do your initialization and then only do it if needed.
| 0 | 1 | 0 | 0 |
2010-02-12T15:03:00.000
| 4 | 1.2 | true | 2,252,672 | 0 | 0 | 1 | 3 |
Is it possible to run a script each time the dev server starts? Also at each deploy to google?
I want the application to fill the database based on what some methods returns.
Is there any way to do this?
..fredrik
|
Running script on server start in google app engine, in Python
| 2,252,697 | 2 | 5 | 2,804 | 0 |
python,google-app-engine
|
You can do this by writing a script in your favorite scripting language that performs the actions that you desire and then runs the dev server or runs appcfg.py update.
| 0 | 1 | 0 | 0 |
2010-02-12T15:03:00.000
| 4 | 0.099668 | false | 2,252,672 | 0 | 0 | 1 | 3 |
Is it possible to run a script each time the dev server starts? Also at each deploy to google?
I want the application to fill the database based on what some methods returns.
Is there any way to do this?
..fredrik
|
Running script on server start in google app engine, in Python
| 2,259,561 | 1 | 5 | 2,804 | 0 |
python,google-app-engine
|
Try to make wrapper around the server runner and script that run deployment. So you will be able to run custom code when you need.
| 0 | 1 | 0 | 0 |
2010-02-12T15:03:00.000
| 4 | 0.049958 | false | 2,252,672 | 0 | 0 | 1 | 3 |
Is it possible to run a script each time the dev server starts? Also at each deploy to google?
I want the application to fill the database based on what some methods returns.
Is there any way to do this?
..fredrik
|
cron job and Long process problem
| 3,487,091 | 0 | 0 | 253 | 0 |
python,django,cron
|
I'd advice to avoid launching threads inside the django application. Most of the times you can run the thread as a separate application.
If you deploy the app in a Apache server and you don't control it properly each Apache process will assume that a request is the first one and you could end up with more than one instance of twitterthread.
| 0 | 0 | 0 | 1 |
2010-02-12T17:23:00.000
| 1 | 0 | false | 2,253,714 | 0 | 0 | 1 | 1 |
Via django iam launching a thread (via middle ware the moment the first request comes) which continously fetches the twitter public steam and puts it down into the database.Assume the thread name is twitterthread.
I also have have several cron jobs which periodically interacts with other third party api services.
Observed the following Problem:
if i don't launch twitterthread cron jobs are running fine.
Where as if i launch twitterthread cron jobs are not running
Any idea on what can go wrong? and any guidelines on the way to fix it.
|
Django-tinymce not working; Getting a normal textarea instead
| 2,254,470 | 0 | 1 | 919 | 0 |
javascript,python,django,django-admin,tinymce
|
What are your webserver and web browser. Perhaps it is trying to set the gzip/bzip header and the server isn't processing it... so it goes out plaintext but the client expects compressed?
| 0 | 0 | 0 | 0 |
2010-02-12T19:06:00.000
| 1 | 0 | false | 2,254,398 | 0 | 0 | 1 | 1 |
I'm trying to use django-tinymce to make fields that are editable through Django's admin with a TinyMCE field. I am using tinymce.models.HTMLField as the field for this.
The problem is it's not working. I get a normal textarea. I check the HTML source, and it seems like all the code needed for TinyMCE is there. I also confirmed that the statically-served JavaScript file is indeed being served. But for some reason it isn't working.
What I did notice though, is that if I avoid setting TINYMCE_COMPRESSOR = True in the settings file, it does start to work. What can cause this behavior?
|
Recommended Django Deployment
| 2,257,323 | 4 | 9 | 3,882 | 0 |
python,linux,django,deployment,webserver
|
Update your question to remove the choices that don't work. If it has Python 2.4, and an installation is a headache, just take it off the list, and update the question to list the real candidates. Only list the ones that actually fit your requirements. (You don't say what your requirements are, but minimal upgrades appears to be important.)
Toss a coin.
When choosing between two platforms which meet your requirements (which you haven't identified) tossing a coin is the absolute best way to choose.
If you're not sure if something matches your requirements, it's often good to enumerate what you value. So far, the only thing in the question that you seem to value is "no installations". Beyond that, I can only guess at what requirements you actually have.
Once you've identified the set of features you're looking for, feel free to toss a coin.
Note that Linux distributions all have more-or-less the same open-source code base. Choosing among them is a preference for packaging, support and selection of pre-integrated elements of the existing Linux code base. Just toss a coin.
Choosing among web front-ends is entirely a question of what features you require. Find all the web front-ends that meet your requirements and toss a coin to choose among them.
None of these are "lock-in" decisions. If you don't like the linux distro you chose initially, you can simply chose another. They all have the same basic suite of apps and the same API's. The choice is merely a matter of preference.
Don't like the web server you chose? At the end of the mod_wsgi pipe, they all appear the same to your Django app (plus or minus a few config changes). Don't like lighttpd? Switch to nginx or Apache -- your Django app doesn't change. So there's no lock-in and no negative consequences to making a sub-optimal choice.
When there's no down-side risk, just toss a coin.
| 0 | 1 | 0 | 0 |
2010-02-13T08:47:00.000
| 4 | 0.197375 | false | 2,256,987 | 0 | 0 | 1 | 3 |
Short version: How do you deploy your Django servers? What application server, front-end (if any, and by front-end I mean reverse proxy), and OS do you run it on? Any input would be greatly appreciated, I'm quite a novice when it comes to Python and even more as a server administrator.
Long version:
I'm migrating between server hosts, so much for weekends... it's not all bad, though. I have the opportunity to move to a different, possibly better "deployment" of Django.
Currently I'm using Django through Tornado's WSGI interface with an nginx front-end on Debian Lenny. I'm looking to move into the Rackspace Cloud so I've been given quite a few choices when it comes to OS:
Debian 5.0 (Lenny)
FC 11 or 12
Ubuntu 9.10 or 8.04 (LTS)
CentOS 5.4
Gentoo 10.1
Arch Linux 2009.02
What I've gathered is this:
Linux Distributions
Debian and CentOS are very slow to release non-bugfix updates of software, since they focus mainly on stability. Is this good or bad? I can see stability being a good thing, but the fact that I can't get Python 2.6 without quite a headache of replacing Python 2.4 is kind of a turn-off--and if I do, then I'm stuck when it comes to ever hoping to use apt/yum to install a Python library (it'll try to reinstall Python 2.4).
Ubuntu and Fedora seem very... ready to go. Almost too ready to go, it's like everything it already done. I like to tinker with things and I prefer to know what's installed and how it's configured versus hitting the ground running with a "cookie-cutter" setup (no offense intended, it's just the best way to describe what I'm trying to say). I've been playing around with Fedora and I was pleasently surprised to find that pycurl, simplejson and a bunch of other libraries were already installed; that raised the question, though, what else is installed? I run a tight ship on a very small VPS, I prefer to run only what I need.
Then there's Gentoo... I've managed to install Gentoo on my desktop (took a week, almost) and ended up throwing it out after quite a few events where I wanted to do something and had to spend 45 minutes recompiling software with new USE flags so I can parse PNG's through PIL. I've wondered though, is Gentoo good for something "static" like a server? I know exactly what I'm going to be doing on my server, so USE flags will change next to never. It optimizes compiles to fit the needs of what you tell it to, and nothing more--something I could appreciate running on minimal RAM and HDD space. I've heard, though, that Gentoo has a tendency to break when you attempt to update the software on it... that more than anything else has kept me away from it for now.
I don't know anything about Arch Linux. Any opinions on this distro would be appreciated.
Web Server
I've been using Tornado and I can safely say it's been the biggest hassle to get running. I had to write my own script to prefork it since, at the time I setup this server, I was probably around 10% of Tornado's user-base (not counting FriendFeed). I have to then setup another "watchdog" program to make sure those forks don't misbehave. The good part is, though, it uses around 40MB of RAM to run all 7 of my Django powered sites; I liked that, I liked that a lot.
I've been using nginx as a front-end to Tornado, I could run nginx right in front of Django FastCGI workers, but those don't have the reliability of Tornado when you crank up the concurrency level. This isn't really an option for me, but I figured I might as well list it.
There's also Apache, which Django recommends you use through mod_wsgi. I personally don't like Apache that much, I understand it's very, very, very mature and what not, but it just seems so... fat, compared to nginx and lighttpd. Apache/mod_python isn't even an option, as I have very limited RAM.
Segue to Lighttpd! Not much to say here, I've never used it. I've heard you can run it in front of Apache/mod_wsgi or run it in front of Django FastCGI workers, also. I've heard it has minor memory leaking issues, I'm sure that could be solved with a cron job, though.
What I'm looking for is what you have seen as the "best" deployment of Django for your needs. Any input or clarifications of what I've said above would be more than welcome.
|
Recommended Django Deployment
| 2,257,450 | 3 | 9 | 3,882 | 0 |
python,linux,django,deployment,webserver
|
At the place I rent server, they have shaved down the Ubuntu images to bare minimum. Presumably because they had to make a special image anyway with just the right drivers and such in it, but I don't know exactly.
They have even removed wget and nano. So you get all the apt-get goodness and not a whole lot of "cookie-cutter" OS.
Just saying this because I would imagine that this is the way it is done almost everywhere and therefore playing around with a normal Ubuntu-server install will not provide you with the right information to make your decision.
Other than that, I agree with the others, that it is not much of a lock-in so you could just try something.
On the webserver-side I would suggest taking a look at cherokee, if have not done so already.
It might not be your cup of joe, but there is no harm in trying it.
I prefer the easy setup of both Ubuntu and Cherokee. Although I play around with a lot of things for fun, I prefer these for my business. I have other things to do than manage servers, so any solution that helps me do it faster, is just good. If these projects are mostly for fun then this will most likely not apply since you won't get a whole lot of experience from these easy-setup-with-nice-gui-and-very-helpfull-wizards
| 0 | 1 | 0 | 0 |
2010-02-13T08:47:00.000
| 4 | 0.148885 | false | 2,256,987 | 0 | 0 | 1 | 3 |
Short version: How do you deploy your Django servers? What application server, front-end (if any, and by front-end I mean reverse proxy), and OS do you run it on? Any input would be greatly appreciated, I'm quite a novice when it comes to Python and even more as a server administrator.
Long version:
I'm migrating between server hosts, so much for weekends... it's not all bad, though. I have the opportunity to move to a different, possibly better "deployment" of Django.
Currently I'm using Django through Tornado's WSGI interface with an nginx front-end on Debian Lenny. I'm looking to move into the Rackspace Cloud so I've been given quite a few choices when it comes to OS:
Debian 5.0 (Lenny)
FC 11 or 12
Ubuntu 9.10 or 8.04 (LTS)
CentOS 5.4
Gentoo 10.1
Arch Linux 2009.02
What I've gathered is this:
Linux Distributions
Debian and CentOS are very slow to release non-bugfix updates of software, since they focus mainly on stability. Is this good or bad? I can see stability being a good thing, but the fact that I can't get Python 2.6 without quite a headache of replacing Python 2.4 is kind of a turn-off--and if I do, then I'm stuck when it comes to ever hoping to use apt/yum to install a Python library (it'll try to reinstall Python 2.4).
Ubuntu and Fedora seem very... ready to go. Almost too ready to go, it's like everything it already done. I like to tinker with things and I prefer to know what's installed and how it's configured versus hitting the ground running with a "cookie-cutter" setup (no offense intended, it's just the best way to describe what I'm trying to say). I've been playing around with Fedora and I was pleasently surprised to find that pycurl, simplejson and a bunch of other libraries were already installed; that raised the question, though, what else is installed? I run a tight ship on a very small VPS, I prefer to run only what I need.
Then there's Gentoo... I've managed to install Gentoo on my desktop (took a week, almost) and ended up throwing it out after quite a few events where I wanted to do something and had to spend 45 minutes recompiling software with new USE flags so I can parse PNG's through PIL. I've wondered though, is Gentoo good for something "static" like a server? I know exactly what I'm going to be doing on my server, so USE flags will change next to never. It optimizes compiles to fit the needs of what you tell it to, and nothing more--something I could appreciate running on minimal RAM and HDD space. I've heard, though, that Gentoo has a tendency to break when you attempt to update the software on it... that more than anything else has kept me away from it for now.
I don't know anything about Arch Linux. Any opinions on this distro would be appreciated.
Web Server
I've been using Tornado and I can safely say it's been the biggest hassle to get running. I had to write my own script to prefork it since, at the time I setup this server, I was probably around 10% of Tornado's user-base (not counting FriendFeed). I have to then setup another "watchdog" program to make sure those forks don't misbehave. The good part is, though, it uses around 40MB of RAM to run all 7 of my Django powered sites; I liked that, I liked that a lot.
I've been using nginx as a front-end to Tornado, I could run nginx right in front of Django FastCGI workers, but those don't have the reliability of Tornado when you crank up the concurrency level. This isn't really an option for me, but I figured I might as well list it.
There's also Apache, which Django recommends you use through mod_wsgi. I personally don't like Apache that much, I understand it's very, very, very mature and what not, but it just seems so... fat, compared to nginx and lighttpd. Apache/mod_python isn't even an option, as I have very limited RAM.
Segue to Lighttpd! Not much to say here, I've never used it. I've heard you can run it in front of Apache/mod_wsgi or run it in front of Django FastCGI workers, also. I've heard it has minor memory leaking issues, I'm sure that could be solved with a cron job, though.
What I'm looking for is what you have seen as the "best" deployment of Django for your needs. Any input or clarifications of what I've said above would be more than welcome.
|
Recommended Django Deployment
| 2,259,882 | 0 | 9 | 3,882 | 0 |
python,linux,django,deployment,webserver
|
Personally I find one of the BSD systems far superior to Linux distros for server related tasks. Give OpenBSD or perhaps FreeBSD a chance. Once you do you´ll never go back.
| 0 | 1 | 0 | 0 |
2010-02-13T08:47:00.000
| 4 | 0 | false | 2,256,987 | 0 | 0 | 1 | 3 |
Short version: How do you deploy your Django servers? What application server, front-end (if any, and by front-end I mean reverse proxy), and OS do you run it on? Any input would be greatly appreciated, I'm quite a novice when it comes to Python and even more as a server administrator.
Long version:
I'm migrating between server hosts, so much for weekends... it's not all bad, though. I have the opportunity to move to a different, possibly better "deployment" of Django.
Currently I'm using Django through Tornado's WSGI interface with an nginx front-end on Debian Lenny. I'm looking to move into the Rackspace Cloud so I've been given quite a few choices when it comes to OS:
Debian 5.0 (Lenny)
FC 11 or 12
Ubuntu 9.10 or 8.04 (LTS)
CentOS 5.4
Gentoo 10.1
Arch Linux 2009.02
What I've gathered is this:
Linux Distributions
Debian and CentOS are very slow to release non-bugfix updates of software, since they focus mainly on stability. Is this good or bad? I can see stability being a good thing, but the fact that I can't get Python 2.6 without quite a headache of replacing Python 2.4 is kind of a turn-off--and if I do, then I'm stuck when it comes to ever hoping to use apt/yum to install a Python library (it'll try to reinstall Python 2.4).
Ubuntu and Fedora seem very... ready to go. Almost too ready to go, it's like everything it already done. I like to tinker with things and I prefer to know what's installed and how it's configured versus hitting the ground running with a "cookie-cutter" setup (no offense intended, it's just the best way to describe what I'm trying to say). I've been playing around with Fedora and I was pleasently surprised to find that pycurl, simplejson and a bunch of other libraries were already installed; that raised the question, though, what else is installed? I run a tight ship on a very small VPS, I prefer to run only what I need.
Then there's Gentoo... I've managed to install Gentoo on my desktop (took a week, almost) and ended up throwing it out after quite a few events where I wanted to do something and had to spend 45 minutes recompiling software with new USE flags so I can parse PNG's through PIL. I've wondered though, is Gentoo good for something "static" like a server? I know exactly what I'm going to be doing on my server, so USE flags will change next to never. It optimizes compiles to fit the needs of what you tell it to, and nothing more--something I could appreciate running on minimal RAM and HDD space. I've heard, though, that Gentoo has a tendency to break when you attempt to update the software on it... that more than anything else has kept me away from it for now.
I don't know anything about Arch Linux. Any opinions on this distro would be appreciated.
Web Server
I've been using Tornado and I can safely say it's been the biggest hassle to get running. I had to write my own script to prefork it since, at the time I setup this server, I was probably around 10% of Tornado's user-base (not counting FriendFeed). I have to then setup another "watchdog" program to make sure those forks don't misbehave. The good part is, though, it uses around 40MB of RAM to run all 7 of my Django powered sites; I liked that, I liked that a lot.
I've been using nginx as a front-end to Tornado, I could run nginx right in front of Django FastCGI workers, but those don't have the reliability of Tornado when you crank up the concurrency level. This isn't really an option for me, but I figured I might as well list it.
There's also Apache, which Django recommends you use through mod_wsgi. I personally don't like Apache that much, I understand it's very, very, very mature and what not, but it just seems so... fat, compared to nginx and lighttpd. Apache/mod_python isn't even an option, as I have very limited RAM.
Segue to Lighttpd! Not much to say here, I've never used it. I've heard you can run it in front of Apache/mod_wsgi or run it in front of Django FastCGI workers, also. I've heard it has minor memory leaking issues, I'm sure that could be solved with a cron job, though.
What I'm looking for is what you have seen as the "best" deployment of Django for your needs. Any input or clarifications of what I've said above would be more than welcome.
|
Generating & Merging PDF Files in Python
| 2,263,276 | 1 | 4 | 6,428 | 0 |
python,pdf,merge,reportlab,pypdf
|
You could generate a document through, for example, TeX, or OpenOffice, or whatever gives you the most comfortable bindings and then print the document with a pdf printer.
This allows you not to have to figure out where to put fields precisely or figure out what to do if your content overflows the space allocated for it.
| 0 | 0 | 0 | 0 |
2010-02-14T23:19:00.000
| 3 | 0.066568 | false | 2,263,263 | 1 | 0 | 1 | 1 |
I want to automatically generate booking confirmation PDF files in Python. Most of the content will be static (i.e. logos, booking terms, phone numbers), with a few dynamic bits (dates, costs, etc).
From the user side, the simplest way to do this would be to start with a PDF file with the static content, and then using python to just add the dynamic parts. Is this a simple process?
From doing a bit of search, it seems that I can use reportlab for creating content and pyPdf for merging PDF's together. Is this the best approach? Or is there a really funky way that I haven't come across yet?
Thanks!
|
How to upload all .html files to a remote server using FTP and preserving file structure?
| 2,263,804 | 0 | 0 | 409 | 0 |
python,networking,scripting,ftp
|
umm, maybe by pressing F5 in mc for linux or total commander for windows?
| 0 | 0 | 1 | 1 |
2010-02-15T02:37:00.000
| 4 | 0 | false | 2,263,782 | 0 | 0 | 1 | 2 |
I have edited about 100 html files locally, and now I want to push them to my live server, which I can only access via ftp.
The HTML files are in many different directories, but hte directory structure on the remote machine is the same as on the local machine.
How can I recursively descend from my top-level directory ftp-ing all of the .html files to the corresponding directory/filename on the remote machine?
Thanks!
|
How to upload all .html files to a remote server using FTP and preserving file structure?
| 2,299,546 | 0 | 0 | 409 | 0 |
python,networking,scripting,ftp
|
if you have a mac, you can try cyberduck. It's good for syncing remote directory structures via ftp.
| 0 | 0 | 1 | 1 |
2010-02-15T02:37:00.000
| 4 | 0 | false | 2,263,782 | 0 | 0 | 1 | 2 |
I have edited about 100 html files locally, and now I want to push them to my live server, which I can only access via ftp.
The HTML files are in many different directories, but hte directory structure on the remote machine is the same as on the local machine.
How can I recursively descend from my top-level directory ftp-ing all of the .html files to the corresponding directory/filename on the remote machine?
Thanks!
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.