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
Sharing a database between Twisted and Django
5,051,832
2
9
2,454
1
python,database,django,twisted
I would just avoid the Django ORM, it's not all that and it would be a pain to access outside of a Django context (witness the work that was required to make Django support multiple databases). Twisted database access always requires threads (even with twisted.adbapi), and threads give you access to any ORM you choose. SQLalchemy would be a good choice.
0
0
0
0
2011-02-19T14:42:00.000
2
0.197375
false
5,051,408
0
0
1
2
I am developing a multiplayer gaming server that uses Django for the webserver (HTML frontend, user authentication, games available, leaderboard, etc.) and Twisted to handle connections between the players and the games and to interface with the games themselves. The gameserver, the webserver, and the database may run on different machines. What is the "best" way to architect the shared database, in a manner that supports changes to the database schema going forward. Should I try incorporating Django's ORM in the Twisted framework and used deferreds to make it non-blocking? Should I be stuck creating and maintaining two separate databases schemas / interfaces, one in Django's model and the other using twisted.enterprise.row? Similarly, with user authentication, should I utilize twisted's user authentication functionality, or try to include Django modules into the gameserver to handle user authentication on the game side?
Sharing a database between Twisted and Django
5,051,760
10
9
2,454
1
python,database,django,twisted
First of all I'd identify why you need both Django and Twisted. Assuming you are comfortable with Twisted using twisted.web and auth will easily be sufficient and you'll be able to reuse your database layer for both the frontend and backend apps. Alternatively you could look at it the other way, what is Twisted doing better as a game server? Are you hoping to support more players (more simultaneous connections) or something else? Consider that if you must use threaded within twisted to do blocking database access that you are most likely not going to be able to efficently/reliably support hundreds of simultaneous threads. Remember python has a Global Interpreter Lock so threads are not necessarily the best way to scale. You should also consider why you are looking to use a SQL Database and an ORM. Does your game have data that is really best suited to being stored in an relational database? Perhaps it's worth examining something like MongoDB or another key-value or object database for storing game state. Many of these NoSQL stores have both blocking drivers for use in Django and non-blocking drivers for use in Twisted (txmongo for example). That said, if you're dead set on using both Django and Twisted there are a few techniques for embedding blocking DB access into a non-blocking Twisted server. adbapi (uses twisted thread pool) Direct use of the twisted thread pool using reactor.deferToThread The Storm ORM has a branch providing Twisted support (it handles deferToThread calls internally) SAsync is a library that tries to make SQLAlchemy work in an Async way Have twisted interact via RPC with a process that manages the blocking DB So you should be able to manage the Django ORM objects yourself by importing them in twisted and being very careful making calls to reactor.deferToThread. There are many possible issues when working with these objects within twisted in that some ORM objects can issue SQL when accessing/setting a property, etc. I realize this isn't necessarily the answer you were expecting but perhaps more detail about what you're hoping to accomplish and why you are choosing these specific technologies will allow folks to get you better answers.
0
0
0
0
2011-02-19T14:42:00.000
2
1.2
true
5,051,408
0
0
1
2
I am developing a multiplayer gaming server that uses Django for the webserver (HTML frontend, user authentication, games available, leaderboard, etc.) and Twisted to handle connections between the players and the games and to interface with the games themselves. The gameserver, the webserver, and the database may run on different machines. What is the "best" way to architect the shared database, in a manner that supports changes to the database schema going forward. Should I try incorporating Django's ORM in the Twisted framework and used deferreds to make it non-blocking? Should I be stuck creating and maintaining two separate databases schemas / interfaces, one in Django's model and the other using twisted.enterprise.row? Similarly, with user authentication, should I utilize twisted's user authentication functionality, or try to include Django modules into the gameserver to handle user authentication on the game side?
Is it possible to 'import * from DIRECTORY', then somehow (anyhow) iterate over the loaded modules?
5,054,203
4
0
210
0
python,google-app-engine,import
You can read from the filesystem in GAE just fine; you just can't write to the filesystem. from models import * will only import modules listed in __all__ in models/__init__.py; there's no automatic way to import all modules in a package if they're not declared to be part of the package. You just need to read the directory (which you can do) and __import__() everything in it.
0
1
0
0
2011-02-19T23:24:00.000
3
1.2
true
5,054,191
0
0
1
1
Let me explain the use case... In a simple python web application framework designed for Google App Engine, I'd like to have my models loaded automatically from a 'models' directory, so all that's needed to add a model to the application is place a file user.py (for example), which contains a class called 'User', in the 'models/' directory. Being GAE, I can't read from the file system so I can't just read the filenames that way, but it seems to me that I must be able to 'import * from models' (or some equivalent), and retrieve at least a list of module names that were loaded, so I can subject them to further processing logic. To be clear, I want this to be done WITHOUT having to maintain a separate list of these module names for the application to read from.
how to create a survey that has 5 multiple choices
17,245,724
1
0
2,507
0
python,google-app-engine
If you are presenting the survey question in a browser, I would definitely go with one model (in one datastore as noted by Peter) having questions and answers properties. Serialize the questions and answers into two TextProperties (be sure to escape them first). From this point, everything can be done inside Javascript by splitting the text into an array, and building any type of innerHTML you want. You may want to include a third field with meta-data about whether the question is single-answer only (radio buttons or dropdown list), or multi-select (checkboxes). One GAE entity, one get_by_id, auto-memcache if you use ndb, no additional processing costs (e.g. Django template). This is fastest and cheapest, and very flexible imho. HTH. -stevep.
0
0
0
0
2011-02-20T16:30:00.000
2
0.099668
false
5,058,333
0
0
1
1
Hey I am trying to create a survey that asks the users to create his own question and list 5 multiple choices. My first sense is that I create two datastores and one to store the user quesiton and one to to store 5 choices mapping to the question just created. but i dont know how exactly I should do with the 5 multiple choices and how to map them with the question. anybody has an idea? Thank you a lot
MySQL AB, MySQL Server 5.5 Folder in HKEY_LOCAL_MACHINE not present
5,412,380
2
5
854
1
python,mysql,django
I found that the key was actually generated under HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE. Thanks.
0
0
0
0
2011-02-20T20:43:00.000
1
1.2
true
5,059,883
0
0
1
1
I am trying to MySQL for Python (MySQLdb package) in Windows so that I can use it in the Django web frame. I have just installed MySQL Community Server 5.5.9 and I have managed to run it and test it using the testing procedures suggested in the MySQL 5.5 Reference Manual. However, I discovered that I still don't have the MySQL AB folder, the subsequent MySQL Server 5.5 folder and regkey in the HKEY_LOCAL_MACHINE, which is needed to build the MySQLdb package. From the MySQL 5.5 Reference Manual, it says that: The MySQL Installation Wizard creates one Windows registry key in a typical install situation, located in HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB. However, I do have the Start Menu short cut and all the program files installed. I have used the msi installation and installed without problems. Should I be getting the MySQL AB folder? Does anyone know what has happened and how I should get the MySQL AB/MySQL Server 5.5 folder and the regkey?
web: client-side python?
5,060,400
0
1
717
0
python,client-side
Short of writing your own browser plugin — no.
0
0
1
0
2011-02-20T22:02:00.000
5
0
false
5,060,382
0
0
1
3
Is there any way to get Python to run on a web browser, other than silverlight? I'm pretty sure not, but it never hurts to ask (usually).
web: client-side python?
5,060,425
2
1
717
0
python,client-side
Haven't tried it myself but Pyjamas (http://pyjs.org/) claims to contain a Python-to-Javascript compiler. Not exactly what you're asking for but might be worth a look.
0
0
1
0
2011-02-20T22:02:00.000
5
0.07983
false
5,060,382
0
0
1
3
Is there any way to get Python to run on a web browser, other than silverlight? I'm pretty sure not, but it never hurts to ask (usually).
web: client-side python?
9,805,718
1
1
717
0
python,client-side
skulpt is an interesting new project
0
0
1
0
2011-02-20T22:02:00.000
5
0.039979
false
5,060,382
0
0
1
3
Is there any way to get Python to run on a web browser, other than silverlight? I'm pretty sure not, but it never hurts to ask (usually).
Correct way of implementing database-wide functionality
5,064,564
1
3
110
1
python,database,django,django-models,coding-style
I recommend extending Django's Model-Template-View approach with a controller. I usually have a controller.py within my apps which is the only interface to the data sources. So in your above case I'd have something like get_all_parties_and_people_for_user(user). This is especially useful when your "data taken from several tables in the database" becomes "data taken from several tables in SEVERAL databases" or even "data taken from various sources, e.g. databases, cache backends, external apis, etc.".
0
0
0
0
2011-02-21T08:17:00.000
2
1.2
true
5,063,658
0
0
1
2
I'm creating a small website with Django, and I need to calculate statistics with data taken from several tables in the database. For example (nothing to do with my actual models), for a given user, let's say I want all birthday parties he has attended, and people he spoke with in said parties. For this, I would need a wide query, accessing several tables. Now, from the object-oriented perspective, it would be great if the User class implemented a method that returned that information. From a database model perspective, I don't like at all the idea of adding functionality to a "row instance" that needs to query other tables. I would like to keep all properties and methods in the Model classes relevant to that single row, so as to avoid scattering the business logic all over the place. How should I go about implementing database-wide queries that, from an object-oriented standpoint, belong to a single object? Should I have an external kinda God-object that knows how to collect and organize this information? Or is there a better, more elegant solution?
Correct way of implementing database-wide functionality
5,065,280
0
3
110
1
python,database,django,django-models,coding-style
User.get_attended_birthday_parties() or Event.get_attended_parties(user) work fine: it's an interface that makes sense when you use it. Creating an additional "all-purpose" object will not make your code cleaner or easier to maintain.
0
0
0
0
2011-02-21T08:17:00.000
2
0
false
5,063,658
0
0
1
2
I'm creating a small website with Django, and I need to calculate statistics with data taken from several tables in the database. For example (nothing to do with my actual models), for a given user, let's say I want all birthday parties he has attended, and people he spoke with in said parties. For this, I would need a wide query, accessing several tables. Now, from the object-oriented perspective, it would be great if the User class implemented a method that returned that information. From a database model perspective, I don't like at all the idea of adding functionality to a "row instance" that needs to query other tables. I would like to keep all properties and methods in the Model classes relevant to that single row, so as to avoid scattering the business logic all over the place. How should I go about implementing database-wide queries that, from an object-oriented standpoint, belong to a single object? Should I have an external kinda God-object that knows how to collect and organize this information? Or is there a better, more elegant solution?
Extending PloneFormGen
5,065,975
2
3
983
0
python,forms,plone,ploneformgen
All PFG types, adapters etc. are all based on Archetypes. Related example code can be found in PloneFormGen/content. The saveDataAdapter.py or fields.py files provide reasonable example code...
0
0
0
0
2011-02-21T12:26:00.000
3
0.132549
false
5,065,892
0
0
1
1
Are there any example add-ons where to look at when one would like to 1) Create custom action adapters for PloneFormGen 2) Add new field types to PloneFormGen
Update app engine entity
5,720,652
2
4
6,215
0
python,google-app-engine
I use GQL to query a find the Entity and if exists update de atribute. result = db.GqlQuery('select name from Person where name = "tadeu"') if result: for r in result: r.attribute = "value" r.put()
0
1
0
0
2011-02-21T13:12:00.000
4
0.099668
false
5,066,357
0
0
1
1
How to update existing record in app engine.
Pylons - how to use an old project in a new environment?
5,067,114
1
2
68
0
python,project,upgrade,pylons
might be obvious but did you run "python setup.py develop" on the application package so that the dependencies could be installed?
0
1
0
1
2011-02-21T13:28:00.000
1
0.197375
false
5,066,530
0
0
1
1
I have an old project, it written under Python 2.5/2.6, Windows. We had Python 2.6/Win7/x64 now, and I tried to start it. I got the old project that running nondebug mode in a server, and copied into local folder. When I tried to yesterday start it, I got this error: 15:44:58,038 DEBUG [pylons.configuration] Loaded None template engine as the default template renderer I see the google, but they are points to config.init_app, that is does not exists. TOday I reinstalled Python, but with Py2.7, pylons and mako. But when I tried to stat it, I got only this message: 07:36:36,377 DEBUG [pylons.configuration] Initializing configuration, package: 'x' And no more information about die... :-( So what do you meaning, how can I raise this "undead" project to debug some things? ( it was good experience with Python/Pylons, but I'm sad now that I not choose PHP previously, because of package changes). Thanks: dd
Ajax v. including data in the HTML
5,069,558
0
3
196
0
javascript,python,ajax,django,performance
Always include them directly if you have the choice, it will give a considerable benefit to page load speed.
0
0
0
0
2011-02-21T18:02:00.000
2
0
false
5,069,495
0
0
1
2
I'm using JavaScript with jQuery, talking to a Django back end. There are some UI needs that require Ajax, because we can't know what data to send until the user gives some input. However, there is other data that is known at template time. What are the pros and cons of including that data in the template directly, instead of using Ajax? It seems like the former might be simpler.
Ajax v. including data in the HTML
5,069,704
3
3
196
0
javascript,python,ajax,django,performance
The obvious answer in MOST applications is to include them directly, although I would always recommend treating every usage per its own needs. Remember that 'page load speed' is as much perception as it is a measurable stat, especially when dealing with ajax functionality. Example You have loads and loads of data to display, if you include it natively with the page will actually be perceived to take much more time to load to the end user than if you load the initial page and bring in the data in chunks. You can see this in place as an alternative to pagination that facebook uses, and the chunks of data are brought in as the user scrolls.
0
0
0
0
2011-02-21T18:02:00.000
2
1.2
true
5,069,495
0
0
1
2
I'm using JavaScript with jQuery, talking to a Django back end. There are some UI needs that require Ajax, because we can't know what data to send until the user gives some input. However, there is other data that is known at template time. What are the pros and cons of including that data in the template directly, instead of using Ajax? It seems like the former might be simpler.
Is there an easy way in Plone to get email notifications when new users join the portal?
5,070,368
1
2
1,115
0
python,notifications,plone
You can easily customize the registered.pt template add a simple call to a PythonScript sending out an email through the MailHost api. Doing a proper customization of plone.app.users.browser.register.py is much more complex.
0
0
0
1
2011-02-21T19:03:00.000
4
0.049958
false
5,070,055
0
0
1
3
I want to get email notifications to the portal email address whenever a new user joins the portal. My guess is that I should code a new product to do that. Does such product already exist (for Plone 4)? I checked content rules, but AFAICT it could work only if I made the users contentish themselves with something like membrane/remember, but for my requirements that would be overkill.
Is there an easy way in Plone to get email notifications when new users join the portal?
5,146,475
1
2
1,115
0
python,notifications,plone
You can also just have login_next traverse to a Controller Python Script (you'll fine other similar ones in the /plone_login area of the core Plone product that end with the extension '.cpy') that you write that sends the email (perhaps notifyMangersUponLogin ) rather than it's default of traversing to login_success. Then, have your CPT script traverse to login_success to continue the sript/page MVC flow that Plone ships with, if that's what you want. To leverage Controller Page Templates (.cpt files)/Scripts (.cpy files), it's key to not only copy the custom version of login_next.cpy to your custom product's skin path, but also the login.cpy.metadata file that specifies the success/failure actions of the MVC page/script logic flow. With Plone 4.0.2, you'll find the Plone login-related scripts/templates under a path such as: /buildout-cache/eggs/plone-4.0.2-py2.6.egg/Products/CMFPlone/skins/plone_login relative to your buildout structure.
0
0
0
1
2011-02-21T19:03:00.000
4
0.049958
false
5,070,055
0
0
1
3
I want to get email notifications to the portal email address whenever a new user joins the portal. My guess is that I should code a new product to do that. Does such product already exist (for Plone 4)? I checked content rules, but AFAICT it could work only if I made the users contentish themselves with something like membrane/remember, but for my requirements that would be overkill.
Is there an easy way in Plone to get email notifications when new users join the portal?
5,318,895
0
2
1,115
0
python,notifications,plone
If you want to do it the right way, follow Martijn's directions above. If you want another dirty solution, do the following: make a copy of register.cpy insert the following code: context.MailHost.send('Content-Type: text/plain\n\n' + 'User has registered: ' + str(username), mfrom='[email protected]', mto='[email protected]', subject='User Registration', )
0
0
0
1
2011-02-21T19:03:00.000
4
0
false
5,070,055
0
0
1
3
I want to get email notifications to the portal email address whenever a new user joins the portal. My guess is that I should code a new product to do that. Does such product already exist (for Plone 4)? I checked content rules, but AFAICT it could work only if I made the users contentish themselves with something like membrane/remember, but for my requirements that would be overkill.
Django caching for web applications
5,072,157
0
4
1,151
0
python,django,caching
Not quite what you are after, but johnny-cache will cache querysets, automatically invalidating on writes. It may do enough of what you are after: and it is no work to use after setting up.
0
0
0
0
2011-02-21T21:16:00.000
2
0
false
5,071,365
0
0
1
1
My question is about best practices for caching database updates in Django. I'm writing a ticketing system. I have a Ticket model and an Update model. Each time a user adds an update to a ticket, an Update is created and linked as foreign key to the Ticket. I have a TicketDetail view, that shows the Ticket description and the associated Updates. Users can add an Update from this view. I've enabled site-wide caching with memcached. If a user adds an update and then reload this view, they won't see the update for a while. I get why, because I need to enable per-view caching, and turn it off for this view. But to enjoy the full speed of caching, what I'd really like to be able to do is enable caching for this view, but invalidate the cache as soon as a user makes an update. Is there a straightforward way to do this? Thanks much!
Python mysqldb on Mac OSX 10.6 not working
5,072,940
2
2
1,535
1
python,mysql,django,macos
I eventually managed to solve the problem by Installing python 2.7 with Mac Ports and installing mysqldb using Mac Ports - was pretty simple after that.
0
1
0
0
2011-02-21T22:35:00.000
2
1.2
true
5,072,066
0
0
1
2
I am using Python 2.7 and trying to get a Django project running on a MySQL backend. I have downloaded mysqldb and followed the guide here:http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/ Yet when I go to run the django project the following traceback occurs: Traceback (most recent call last): File "/Users/andyarmstrong/Documents/workspace/BroadbandMapper/src/BroadbandMapper/manage.py", line 11, in execute_manager(settings) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(*args, **options.__dict__) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 209, in execute translation.activate('en-us') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 66, in activate return real_activate(language) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/functional.py", line 55, in _curried return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 36, in delayed_loader return getattr(trans, real_name)(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 193, in activate _active[currentThread()] = translation(language) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 176, in translation default_translation = _fetch(settings.LANGUAGE_CODE) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch app = import_module(appname) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 1, in from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/admin/helpers.py", line 1, in from django import forms File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/forms/__init__.py", line 17, in from models import * File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/forms/models.py", line 6, in from django.db import connections File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/__init__.py", line 77, in connection = connections[DEFAULT_DB_ALIAS] File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 92, in __getitem__ backend = load_backend(db['ENGINE']) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 33, in load_backend return import_module('.base', backend_name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 14, in raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/andyarmstrong/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib Referenced from: /Users/andyarmstrong/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-x86_64.egg-tmp/_mysql.so Reason: image not found I have tried the following also:http://whereofwecannotspeak.wordpress.com/2007/11/02/mysqldb-python-module-quirk-in-os-x/ adding a link between the mysql lib directory and somewhere else... Help!
Python mysqldb on Mac OSX 10.6 not working
5,305,496
0
2
1,535
1
python,mysql,django,macos
you needed to add the MySQL client libraries to the LD_LIBRARY_PATH.
0
1
0
0
2011-02-21T22:35:00.000
2
0
false
5,072,066
0
0
1
2
I am using Python 2.7 and trying to get a Django project running on a MySQL backend. I have downloaded mysqldb and followed the guide here:http://cd34.com/blog/programming/python/mysql-python-and-snow-leopard/ Yet when I go to run the django project the following traceback occurs: Traceback (most recent call last): File "/Users/andyarmstrong/Documents/workspace/BroadbandMapper/src/BroadbandMapper/manage.py", line 11, in execute_manager(settings) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(*args, **options.__dict__) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 209, in execute translation.activate('en-us') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 66, in activate return real_activate(language) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/functional.py", line 55, in _curried return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 36, in delayed_loader return getattr(trans, real_name)(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 193, in activate _active[currentThread()] = translation(language) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 176, in translation default_translation = _fetch(settings.LANGUAGE_CODE) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch app = import_module(appname) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 1, in from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/admin/helpers.py", line 1, in from django import forms File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/forms/__init__.py", line 17, in from models import * File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/forms/models.py", line 6, in from django.db import connections File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/__init__.py", line 77, in connection = connections[DEFAULT_DB_ALIAS] File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 92, in __getitem__ backend = load_backend(db['ENGINE']) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 33, in load_backend return import_module('.base', backend_name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 14, in raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/andyarmstrong/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-x86_64.egg-tmp/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib Referenced from: /Users/andyarmstrong/.python-eggs/MySQL_python-1.2.3-py2.7-macosx-10.6-x86_64.egg-tmp/_mysql.so Reason: image not found I have tried the following also:http://whereofwecannotspeak.wordpress.com/2007/11/02/mysqldb-python-module-quirk-in-os-x/ adding a link between the mysql lib directory and somewhere else... Help!
Django-registration & Django-Socialauth
5,085,483
1
0
529
0
python,django,django-authentication,django-apps
There shouldn`t be any problems there. Django-Socialauth adda new auth backends, and it should works fine with permissions and decorators. And Django resistration just register a user on site, so unless you remove standard auth backend, it will work fine too.
0
0
0
0
2011-02-22T05:52:00.000
1
1.2
true
5,074,537
0
0
1
1
Have anyone used these 2 django apps together? I want to know how well these 2 gel together along with Django's User Authentication system. When I mean Django's User Authentication System, I mean I should be able to use decorators like @login_required or grant permission to specific views (or functions in views.py) based on who the user is.
How to write `app.yaml` file for Google App Engine app?
5,077,700
1
1
1,439
0
python,google-app-engine,yaml
you should put your static files into some directory, for example staticdata then your app.yaml would look like: application: temp version: 1 runtime: python api_version: 1 handlers: - url: /staticdata static_dir: staticdata - url: /.* script: temp.py
0
1
0
0
2011-02-22T11:12:00.000
1
1.2
true
5,077,336
0
0
1
1
I registered a Google App Engine app and I have some files below: /index.html /tabs.css /tab.js /temp.py How should I write the app.yaml file?
Automatic deletion or expiration of GAE datastore entities
5,079,939
5
3
2,483
1
python,google-app-engine,google-cloud-datastore
Assuming you have a DateProperty on the entities indicating when the election ended, you can have a cron job search for any older than 3 months every night and delete them.
0
1
0
0
2011-02-22T15:09:00.000
3
1.2
true
5,079,885
0
0
1
1
I'm building my first app with GAE to allow users to run elections, and I create an Election entity for each election. To avoid storing too much data, I'd like to automatically delete an Election entity after a certain period of time -- say three months after the end of the election. Is it possible to do this automatically in GAE? Or do I need to do this manually? If it matters, I'm using the Python interface.
django signal on GAE
5,083,039
0
1
124
0
python,django,google-app-engine,django-nonrel
Does Django signals work on google app engine ? Yes, as long as you save those models use the Model.save()
0
1
0
0
2011-02-22T16:23:00.000
2
0
false
5,080,844
0
0
1
2
Does Django signals work on google app engine ? I am using django-nonrel. Thanks
django signal on GAE
5,080,893
0
1
124
0
python,django,google-app-engine,django-nonrel
Works fine. Signals do not use the db.
0
1
0
0
2011-02-22T16:23:00.000
2
1.2
true
5,080,844
0
0
1
2
Does Django signals work on google app engine ? I am using django-nonrel. Thanks
How can i setup default paths, variables, etc when i launch the IronPython Console?
5,084,686
2
1
163
0
ironpython
For paths, you can set the IRONPYTHONPATH environment variable; it's a semi-colon separated list of paths that are added sys.path on startup. For imports, I like -i option: create a .py file that has your common imports, and run it with ipy -i myscript.py (I would recommend creating a batch file for that). You could also modify site.py, but I wouldn't recommend it, as it will get overwritten if you upgrade your IronPython.
0
0
0
0
2011-02-22T20:51:00.000
1
0.379949
false
5,083,824
1
0
1
1
Everytime i start up the IronPython console to do some playing, the first thing i find myself doing is sys.path.append('myscripts') How can i have the console load default stuff such as appending paths, importing .NET stuff -- that way i dont have to type it in everytime i launch the console. thank you.
Exporting a development django application to production
48,786,643
0
1
2,805
0
python,django,production-environment
Steps to get your Django App from development to Production open your project folder then find settings.py find the following line, SECURITY WARNING: don't run with debug turned on in production! DEBUG = False Change the debug to false. Change your db credentials with the actual production server db credentials in your settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'seocrawler', 'USER': '', 'PASSWORD': '', 'HOST': 'localhost', 'PORT': '' } } once done upload your project folder to the folder in server open putty enter your server credentials, then a terminal or cmd will pop up. check python is installed on your server by executing below command in terminal python -V then check whether django is installed by running django-admin --version, make sure that the django version you used to develop the project matches the one on server if not the install the specific version. now using the cd command to go to the project folder which contains manage.py file. now run python manage.py showmigrations this will list if any db migration is pending for your project. now run python manage.py makemigrations this will migrate the db tables to production server database. now run python manage.py runserver 0.0.0.0:8000 then go to your domain like www.example.com:8000 in browser, to test whether your site is working. once your site is up and working we want python manage.py runserver command to run even after the terminal is closed (means python manage.py runserver command in as background task/process). to do that run nohup python manage.py runserver & this will run command in background and will never die the process even when putty terminal is closed. All done! now your server is up and your site too. Enjoy!
0
0
0
0
2011-02-22T23:02:00.000
3
0
false
5,085,099
0
0
1
1
I've been developing a django web-application for three months now, and I'd like to set it to production. I'm currently using South as database schema manager and I haven't got any clue on how to export my application databases schemas and content, and my project code to another directory; in order to set my production environment. Any clue on how to do this? Thank you.
Editor for use with GoogleAppEngineLauncher on Mac
5,086,257
4
2
226
0
python,google-app-engine,editor,directory,yaml
Why not use your favorite editor? Textmate or gvim or emacs anything should do here. All them support Python and YAML syntax.
0
1
0
0
2011-02-23T02:03:00.000
3
1.2
true
5,086,239
0
0
1
2
What editors are best for use with the "Edit" button in GoogleAppEngineLauncher for Mac? A good editor would preferably be able to edit Python and YAML and be able to open directories.
Editor for use with GoogleAppEngineLauncher on Mac
5,087,788
0
2
226
0
python,google-app-engine,editor,directory,yaml
Have you tried TextWrangler or jEdit? You can get the links to them on Apple site or you can google for them. They are pretty good editors.
0
1
0
0
2011-02-23T02:03:00.000
3
0
false
5,086,239
0
0
1
2
What editors are best for use with the "Edit" button in GoogleAppEngineLauncher for Mac? A good editor would preferably be able to edit Python and YAML and be able to open directories.
Why selenium can not open some asp page?
5,086,635
0
0
218
0
asp.net,python,selenium-rc
Ok, I upgrade my selenium-server to 2.0b2, now it's ok.
0
0
1
0
2011-02-23T02:54:00.000
1
1.2
true
5,086,524
0
0
1
1
I use selenium-rc to test an asp.net website, test script is written in Python and the browser is Firefox 3.6. But When selenium open the first page of the website, A download dialog appear, not the web page, seems the page is proccessed as application/octet-stream, this cause my test script can not run successfully. Seems this behavior happened on some asp.net websites, I select other asp sites to test, and found some asp sites have the same issue. My question is why this happend? and how to fix this? Edit: I use IE to do this test again, seems it's ok. So is this an issue of Firefox?
Programmatically create Google Apps Domain
5,271,776
1
1
671
0
java,python,google-app-engine
There is an API only available to Google Apps Resellers, if you are one of them you should get access to it.
0
1
0
0
2011-02-23T18:13:00.000
2
1.2
true
5,095,117
0
0
1
1
I am currently working on a project that involves the google apps provisioning api. Without getting too detailed about the purpose or inner workings of the project, I would like to ask a very simple question: Is there a way to programmatically create a google apps for business domain (especially as a reseller)? After tooling around the provisioning api for a while all i could find are ways to add and remove users but nothing pertaining to whole domains.
Killing individual Apache processes in mod_python
5,098,486
0
1
318
0
python,apache,mod-python
I'd say that even it is possible, it would be a tremendous hack (and instable) - you should set-up a process external to apache in this case, that would supervise running processes and kill an individual apache when it goes beyond memory/time predefined limits. Such a script can be kept running continuously with a mainloop that is performs it's checks every few seconds, or could even be put in crontab to run every minute. I see no reason to try to that from inside the serving processes themselves.
0
1
0
1
2011-02-23T19:33:00.000
1
0
false
5,096,057
0
0
1
1
We are having a problem with individual apache processes utilizing large amounts of memory, depending on the request, and never releasing it back to the main system. Since these requests can happen at any time, over time the web server is pushed into swap, rendering it unresponsive even to SSH. Worse, after the request has finished, Python fails to release the memory back into the wild, which results in a number 500mb - 1gb Apache processes lying around. We push very few requests per second, but each request has the potential to be very heavy. What I would like to do is have a way to kill an individual apache process child after it has finished serving a request if its resident memory exceeds a certain threshold. I have tried several ways of actually doing this inside mod_python, but it appears that any form of system exit results in the response not completing to the client. Outside of gracefuling all the processes (which we really want to avoid) whenever this happens, is there anyway to tell Apache to arbitrarily kill off a process after it has finished serving a request? All ideas are welcome. As an additional caveat, due to the legacy nature of the system, we can’t upgrade to a later version of Python, so we can’t utilize the improved memory performance of 2.5. Similarly, we are stuck with our current OS. Versions: System: Red Hat Enterprise 4 Apache: 2.0.55 Python: 2.3.5
What are the advantages/disadvantages of using Jython/IronPython/Pyjamas?
5,099,381
0
6
3,513
0
python,ironpython,jython,pyjamas
But how does it scale? As well as anything else. Scalability is about architecture, not language. Anyone use these frameworks in industry? Yes.
0
0
0
1
2011-02-23T22:44:00.000
2
0
false
5,098,183
1
0
1
2
EDIT Okay, rookie here so please bear with me. What I'm trying to ask is the following: Is it plausible for a Python-syntax fan to use one of these options while other team members "plain vanilla" version? Is it a matter of personal preference, or would it require converting other people to using these technologies as well? Is it possible to easily convert between, say, Jython and Java or Pyjamas and Javascript? Also, in general, what advantages/disadvantages have people experienced from using these in the "real world"? I think that states a little more clearly what I'm looking for. Input from anyone who uses these technologies in the industry would be very helpful. Thanks in advance for your insights.
What are the advantages/disadvantages of using Jython/IronPython/Pyjamas?
5,209,736
5
6
3,513
0
python,ironpython,jython,pyjamas
You are talking about two different things. First, Jython and IronPython are Python implementations that you can embed in a Java or C# application to provide scripting capability. This reduces the amount of code that you have to write overall. Or you can look at them as a way to glue together and leverage an existing collection of class libraries. However you look at it, these are good things and lots of people use them. But Pyjamas is something else entirely. It complicates your web stack and makes it harder to pass projects on to other programmers. The main use case is if you have a shop of Python programmers and they need to provide a rich Internet application client side but cannot afford the time to learn Javascript. Not as broadly useful. Also, my personal experience is that most Python programmers already know Javascript reasonably well from building web apps. It really is not much of a learning curve to just dive into Javascript. I've written JSCRIPT scripts on Windows as a batch file replacement and bits of Javascript with Jquery in numerous web pages. When I wanted to learn server-side Javascript for node.js, it really only took a couple of weeks to round out my knowledge of Javascript. In my opinion, Pyjamas should be avoided. Sooner, rather than later, Javascript engines will be supporting version 1.8 of the language which greatly narrows the gap between the languages other than the curly braces issue.
0
0
0
1
2011-02-23T22:44:00.000
2
1.2
true
5,098,183
1
0
1
2
EDIT Okay, rookie here so please bear with me. What I'm trying to ask is the following: Is it plausible for a Python-syntax fan to use one of these options while other team members "plain vanilla" version? Is it a matter of personal preference, or would it require converting other people to using these technologies as well? Is it possible to easily convert between, say, Jython and Java or Pyjamas and Javascript? Also, in general, what advantages/disadvantages have people experienced from using these in the "real world"? I think that states a little more clearly what I'm looking for. Input from anyone who uses these technologies in the industry would be very helpful. Thanks in advance for your insights.
Google App Engine: how to tell sort location for a user value?
5,099,184
1
2
95
0
python,google-app-engine,sorting
You could get the count of number of entities that have total_value less than or equal to the current users total_value. You could use the count() method to do so (on a Query object).
0
0
0
0
2011-02-24T00:23:00.000
3
0.066568
false
5,099,012
0
0
1
1
In my Main model I have a total_value and I sort with this value. When a user enters a value I wish to tell the user the order of his total_value. How do I do this? In other words, if total_values in database are 5,8,10,25 and a user enters a total_value of 15 how do I tell him that he will be in the 4th place? Thanks!
Can python modules be used from Java programs using Jython without modification?
5,100,178
3
0
261
0
java,python,jython,cpython
Python modules can depend on certain Python versions (e.g. Python 3 vs Python 2 and even may require a minimum Python version (e.g. 2.6) in case of using dedicated language features introduced in some Python version) Python modules may depend on C extensions which won't work with Jython Python modules may use CPython features that are not available in Jython In general: most Python-only code should work with Jython - however like in all cases: you have to test, test, test. Good written modules provide unittests - so you should try to run the tests from Jython and see what's happening.
0
0
0
0
2011-02-24T02:48:00.000
1
0.53705
false
5,099,816
1
0
1
1
Can Python code be used from Java using Jython, without modifying the Python code in a way which will prevent it from working correctly in CPython? If yes, what steps would have to be taken (in the Java code)? If not, what are the reasons that this cannot be done (so far)?
Splitting a HTML document using BeautifulSoup
5,484,677
-1
4
1,744
0
python,html,beautifulsoup
Since no solution with a parser has been proposed to you, may I suggest that you should manage by yourself with regular expressions ? The second point of Danish is of the same nature, as the name grep comes from 'global - regular expression - print'. But it is complicated by the fact the prettify functionality must be used for a preliminary treatment. On the contrary, regular expressions are a powerful tool, that can be used directly on a text. Could you give more information on what you want to do ?
0
0
0
0
2011-02-24T03:50:00.000
2
-0.099668
false
5,100,159
0
0
1
1
We deal with long aggregated HTML documents (for conversion to PDF). In some situations the aggregated HTML document must be split by chapter (dedicated HTML pages starting with a H1 tag) or by subchapters (dedicated HTML pages starting with each H1 or H2 tag). We are using BeautifulSoup for manipulating the aggregated HTML so far but we could not find a proper way using BeautifulSoup for extracting the subdocument (e.g. from first H1 to the next H2) in a proper way.
webservices in python
5,104,394
0
0
931
0
python,web-services,frameworks
For REST, I am very satisfied with Flask.
0
1
0
1
2011-02-24T11:48:00.000
2
0
false
5,104,215
0
0
1
1
i want to create a webservice (SOAP & REST) in python which cab be called from iphone, now i have install python 2.7.1 on Ubuntu 10.04.2 LTS using Putty. so now i am searching for a nice and easy framework that helps me in creating webservices and web programming. I have searched a lot but confused with the combination of framworks.
async http request on Google App Engine Python
5,111,470
2
4
1,253
0
python,http,google-app-engine,asynchronous,request
Use the taskqueue. If you're just pushing data, there's no sense in waiting for the response.
0
1
1
0
2011-02-24T16:43:00.000
4
0.099668
false
5,107,675
0
0
1
2
Does anybody know how to make http request from Google App Engine without waiting a response? It should be like a push data with http without latency for response.
async http request on Google App Engine Python
5,111,384
0
4
1,253
0
python,http,google-app-engine,asynchronous,request
I've done this before by setting doing a URLFetch and setting a very low value for the deadline parameter. I put 0.1 as my value, so 100ms. You need to wrap the URLFetch in a try/catch also since the request will timeout.
0
1
1
0
2011-02-24T16:43:00.000
4
0
false
5,107,675
0
0
1
2
Does anybody know how to make http request from Google App Engine without waiting a response? It should be like a push data with http without latency for response.
Improving Performance of Django ForeignKey Fields in Admin
48,409,460
0
18
7,301
0
python,django,django-admin
Another option is to add readonly_fields instead of raw_id_fields
0
0
0
0
2011-02-24T17:18:00.000
4
0
false
5,108,080
0
0
1
1
By default, Django's admin renders ForeignKey fields in admin as a select field, listing every record in the foreign table as an option. In one admin-accessible model, I'm referencing the User model as a ForeignKey, and since I have thousands of users Django is populating the select with thousands of options. This is causing the admin page to load incredibly slowly, and the select is not very useful since it can take a while to scroll through thousands of options to find the one you want. What's the best way to change the rendering of this field in order to improve page load and usability? I'd like the select field to be replaced with some sort of button to launch a search form popup, or a text field that searches keywords via Ajax to find the Id for the specific User they want to associate. Does admin have anything like this builtin, or would I have to write this from scratch?
Does poster.encode module supported in python appengine?
5,119,334
2
0
937
0
python,google-app-engine
You'd need to deploy the module with your code by including it in your application's directory when deploying, but it does appear to be a pure python module and looking through the source I see no reason why it wouldn't work just fine in App Engine. The only modules that won't work are those that use C extensions or make use of features like threads, sockets, etc. that are disabled in the App Engine runtime. poster.streaminghttp, for example, almost certainly won't work, as it uses sockets.
0
1
0
0
2011-02-25T15:46:00.000
2
0.197375
false
5,119,269
0
0
1
1
Does poster.encode module supported in python appengine ?? if No , whats is the possible alternatives ?
Which port should I set my service to listen to?
5,122,409
1
0
422
0
python,rest,service,standards,port
If you mean problem-free for yourself, a separate port like 8080 would be appropriate. If you mean problem-free for your users, ports 80 (http) and 443 (https) are the only choices that make sense because they're the least likely to be blocked by firewalls. Of course, that means your application and web service would be sharing a port, so you'd have to run your python code behind Apache or whatever else is serving your PHP code and static files. Are you married to Twisted? Why not build your Python web service using one of the many WSGI-compatible web frameworks, and plug it into Apache using mod_wsgi?
0
0
0
0
2011-02-25T20:06:00.000
4
0.049958
false
5,122,070
0
0
1
4
I want to create a website which will serve more like a web-application. There will be two parts: the front-end (probably in PHP, Apache) and the back-end services (in Python, using Twisted) The front-end will usually provide some JavaScript which would send Ajax requests to the Python services and receive data back. Since Apache will be listening on port 80, the Python services should listen to another port. So my question is the following: what port should the Python services listen to? I am asking because I am afraid it might get blocked by the proxies, firewalls etc. that not so rarely get in front of the client's way. What would be the most standard, problem-free way to do this?
Which port should I set my service to listen to?
5,122,137
1
0
422
0
python,rest,service,standards,port
If you're intending for this to be distributed, you'd have to use a port above 1024, otherwise people using it on a Unix-type system would have to run it as root, which opens very large can of worms as far as security is concernted.
0
0
0
0
2011-02-25T20:06:00.000
4
0.049958
false
5,122,070
0
0
1
4
I want to create a website which will serve more like a web-application. There will be two parts: the front-end (probably in PHP, Apache) and the back-end services (in Python, using Twisted) The front-end will usually provide some JavaScript which would send Ajax requests to the Python services and receive data back. Since Apache will be listening on port 80, the Python services should listen to another port. So my question is the following: what port should the Python services listen to? I am asking because I am afraid it might get blocked by the proxies, firewalls etc. that not so rarely get in front of the client's way. What would be the most standard, problem-free way to do this?
Which port should I set my service to listen to?
5,122,114
3
0
422
0
python,rest,service,standards,port
The normal choice is http-alt(8080).
0
0
0
0
2011-02-25T20:06:00.000
4
1.2
true
5,122,070
0
0
1
4
I want to create a website which will serve more like a web-application. There will be two parts: the front-end (probably in PHP, Apache) and the back-end services (in Python, using Twisted) The front-end will usually provide some JavaScript which would send Ajax requests to the Python services and receive data back. Since Apache will be listening on port 80, the Python services should listen to another port. So my question is the following: what port should the Python services listen to? I am asking because I am afraid it might get blocked by the proxies, firewalls etc. that not so rarely get in front of the client's way. What would be the most standard, problem-free way to do this?
Which port should I set my service to listen to?
5,122,117
1
0
422
0
python,rest,service,standards,port
You can be blocked all and everywhere. Any uncommon port is likely to be blocked by serious firewall configurations. Either get a dedicated IP address and listen to port 80. Best to talk to your IT network guys.
0
0
0
0
2011-02-25T20:06:00.000
4
0.049958
false
5,122,070
0
0
1
4
I want to create a website which will serve more like a web-application. There will be two parts: the front-end (probably in PHP, Apache) and the back-end services (in Python, using Twisted) The front-end will usually provide some JavaScript which would send Ajax requests to the Python services and receive data back. Since Apache will be listening on port 80, the Python services should listen to another port. So my question is the following: what port should the Python services listen to? I am asking because I am afraid it might get blocked by the proxies, firewalls etc. that not so rarely get in front of the client's way. What would be the most standard, problem-free way to do this?
Need Advice on ide choice for Django Development
5,123,178
2
4
959
0
python,django,ide
This is going to quickly dissolve into a which editor is better discussion. The reality is that with django's "testserver" your choice of editor / ide become less important. The IDE does not have to be tightly bound to the running code with django. We use eclipse w/ pydev here at work almost exclusively. A few developers have jEdit. Really though, the final answer should be, code with whatever you code best in.
0
0
0
0
2011-02-25T21:42:00.000
4
0.099668
false
5,123,030
0
0
1
2
I've been programming with PHP for about 6 years, and wanna start developing on django. Now I have some questions for you django pros. I've been using PHPDesigner for about a year, because I could never be relieved and code well with eclipse/aptana/similar. I just feel weird with them. I also have used Komodo Edit and gmate (gedit hack+plugins to make gedit look and work like textmate) on linux. Of course this question has been answered here before, but most answers were either out of date or were the applications which i'm not feeling comfortable. So, what IDE would you suggest ? Free solutions would be cool, but price is not a criteria here. p.s: some documentations / suggestions like "django for noobs" would also be appreciated. Edit: I'm using Windows 7. Thanks
Need Advice on ide choice for Django Development
5,123,296
3
4
959
0
python,django,ide
There are lots of good choices. What you should mostly look for is a good IDE for Python, although support for Django templates has some benefits too. Personally I use Eclipse plus PyDev, with a vim plugin. This way I can keep my favorite editor, and get the benefits of simple code refactoring, instant code navigation (ctrl-click on a method call to jump to its definition) and syntax checking while you type. IMHO the biggest benefit of an IDE is the ability to interactive debugging - setting breakpoints, line-by-line execution, etc. Netbeans is also a great choice.
0
0
0
0
2011-02-25T21:42:00.000
4
0.148885
false
5,123,030
0
0
1
2
I've been programming with PHP for about 6 years, and wanna start developing on django. Now I have some questions for you django pros. I've been using PHPDesigner for about a year, because I could never be relieved and code well with eclipse/aptana/similar. I just feel weird with them. I also have used Komodo Edit and gmate (gedit hack+plugins to make gedit look and work like textmate) on linux. Of course this question has been answered here before, but most answers were either out of date or were the applications which i'm not feeling comfortable. So, what IDE would you suggest ? Free solutions would be cool, but price is not a criteria here. p.s: some documentations / suggestions like "django for noobs" would also be appreciated. Edit: I'm using Windows 7. Thanks
How to use django-debug-toolbar on AJAX calls?
5,126,825
4
64
15,546
0
python,django,django-debug-toolbar
Ddt plugs itself into a response, which means that there is no standard way of browsing its panels for AJAX request. Also, AJAX response can be in JSON format, which makes it impossible for ddt to plug into it. Personally I'd find a way of logging ddt output to a text file, or maybe it supports client-server architecture in which client works inside AJAX request handler and sends data to the server? I don't know what's possible as there are dozen ddt clones out there.
0
0
0
0
2011-02-26T04:04:00.000
4
0.197375
false
5,124,975
0
0
1
1
I'm curious if there's a reasonable way to use the (amazing) django-debug-toolbar with AJAX queries. For example, I use a jQuery $.get with a bunch of parameters to hit a Django URL and load it inline. If I have an error with that, it isn't registered on the toolbar. I also can't use it by copying the AJAX URL because DDT attaches to the body tag of the response, and it wouldn't make any sense to be including body tags with AJAX responses. Any direction would be helpful! Thanks!
receive delivery list of send mail in django
5,126,778
4
1
415
0
python,django,email,smtp,email-confirmation
List of delivered emails is outside of the scope of Django, which is a web framework and not a replacement for services like Mailchimp.
0
0
0
1
2011-02-26T06:58:00.000
1
1.2
true
5,125,544
0
0
1
1
I want use send_mass_mail() in django and then want receive list of delivery mail list with email address and problem for failed or delivered ok status how i can make this modules ?
What kind of things can be done with Java but not Python?
5,126,443
0
13
13,215
0
java,python,programming-languages
CPython has a lot of libraries with bindings to native libraries--not so Java.
0
0
0
1
2011-02-26T10:26:00.000
5
0
false
5,126,346
0
0
1
1
I would to pick up a new programming language - Java, having been using Python for some time. But it seems most things that can be done with Java can be done with Python. So I would like to know What kind of things can be done with Java but not Python? mobile programming (Android). POSIX Threads Programming. Conversely, What kind of things can be done with Python but not Java if any? clarification: I hope to get an answer from a practical point of view but not a theoretical point of view and it should be about the current status, not future. So theoretically all programming languages can perform any task, practically each is limited in some way.
LMS in Python/Django/Ruby/Rails/PHP
5,135,982
2
10
15,406
0
php,python,ruby-on-rails,django
Moodle seems the only more or less usable open source LMS out there, although it's far from well written IMO. There are good payed LMS like Canvas. I don't think what you are looking for exists at this moment!
0
0
0
0
2011-02-27T19:20:00.000
5
0.07983
false
5,135,325
0
0
1
2
I am looking for an alternative to Moodle. I searched and found pinax-lms-demo, which was Django-based; and Astra which was Rails-based, but both were empty repo... I need a LMS which has the following functions: create class Assign faculty Upload materials Take quiz forum scorm chat I spent more than a month using Moodle and being a developer I felt I should not use it...
LMS in Python/Django/Ruby/Rails/PHP
5,136,052
2
10
15,406
0
php,python,ruby-on-rails,django
This is a real problem as open-source LMS are all in PHP, with the exception of Sakai which is in Java. As I've written a LMS which tries to be compatible with SCORM I can say that it's not a small work to create a SCORM implementation. The only project in Python I know is Cloud Course, created by Google on GAE (http://code.google.com/p/cloudcourse/) You can also use Rustici's SCORM Cloud with Python (https://github.com/RusticiSoftware/SCORMCloud_PythonLibrary)
0
0
0
0
2011-02-27T19:20:00.000
5
0.07983
false
5,135,325
0
0
1
2
I am looking for an alternative to Moodle. I searched and found pinax-lms-demo, which was Django-based; and Astra which was Rails-based, but both were empty repo... I need a LMS which has the following functions: create class Assign faculty Upload materials Take quiz forum scorm chat I spent more than a month using Moodle and being a developer I felt I should not use it...
How to override an app in Django properly?
5,233,036
5
5
2,057
0
python,django,satchmo
What I have done which works is to copy the application that I have changed. In this case satchmo\apps\product. I copied the app into my project folder Amended my setting.py INSTALLED_APPS from 'product', to 'myproject.product', This now carries the changes I've made to this app for this project only and leaves the original product app untouched and still able to be read normally from other projects.
0
0
0
0
2011-02-27T19:45:00.000
3
1.2
true
5,135,453
0
0
1
3
I'm running Satchmo. There are many apps and I've changed some of the source in the Product app. So my question is how can I override this properly because the change is site specific. Do I have to copy over the whole Satchmo framework and put it into my project or can I just copy one of the apps out and place it in say Satchmo>App>Products? (Kinda like with templates) Thanks
How to override an app in Django properly?
5,135,687
2
5
2,057
0
python,django,satchmo
Normally, I'd say the best thing is to fork Satchmo and keep a copy with your changes. If you are willing to play with the python path, make sure that your app's directory appears before the other (default) directory. From my tests, if you have two apps/modules with identical names, the first one found is used.
0
0
0
0
2011-02-27T19:45:00.000
3
0.132549
false
5,135,453
0
0
1
3
I'm running Satchmo. There are many apps and I've changed some of the source in the Product app. So my question is how can I override this properly because the change is site specific. Do I have to copy over the whole Satchmo framework and put it into my project or can I just copy one of the apps out and place it in say Satchmo>App>Products? (Kinda like with templates) Thanks
How to override an app in Django properly?
5,137,813
4
5
2,057
0
python,django,satchmo
When you add a 'Django App' to INSTALLED_APPS in your settings.py file, you're telling Django that there exists an importable python module with that name on your "python path". You can view your python path by viewing the contents of the list stored at sys.path. Whenever Python (and in this case Django) attempts to import a module it checks each of the directories listed in sys.path in order, when it finds a module matching the given name it stops. The solution to your problem then is too place your customized Django Apps, e.g., the Satchmo product module, into a location in your python path which will be checked before the "real" Satchmo product module. Because I don't know how you have your directory structure laid out I'm basically making a guess here, but in your case, it sounds like you have the Satchmo apps living somewhere like /satchmo/apps/ and your project at /my_custom_path/my_project/. In which case you might want to add your customized product module to /my_custom_path/my_project/product/. Because the path at which your Django settings.py file lives is always checked first, that should mean that your customized product module will be found first and imported instead of the built in Satchmo one. FYI: To check and see the order in which your Satchmo installation is checking directories for modules run python manage.py shell and then in the prompt do import sys; print sys.path.
0
0
0
0
2011-02-27T19:45:00.000
3
0.26052
false
5,135,453
0
0
1
3
I'm running Satchmo. There are many apps and I've changed some of the source in the Product app. So my question is how can I override this properly because the change is site specific. Do I have to copy over the whole Satchmo framework and put it into my project or can I just copy one of the apps out and place it in say Satchmo>App>Products? (Kinda like with templates) Thanks
Comparing user's facebook/twitter friends to site's users in Python/Django
5,137,217
1
2
323
0
python,django,twitter
You should store the twitter user's ID because the username can change at any time, but the id will always be the same. You should be comparing the id's, not the usernames in the intersection_set that Ofri recommends.
0
0
0
1
2011-02-28T00:32:00.000
2
0.099668
false
5,137,126
0
0
1
1
I'm wondering if someone could help guide the approach to this fairly common problem: I'm building a simple site which a user connects their twitter account to sign up. I'd like to create an interface which shows them which of their twitter friends are already using the site. So I can get a list the user's twitter friends, and a list of the site's users (which all have the twitter screen name as username, but I'm wondering the most efficient method to compare these lists and create a variable with the commonalities. As an aside, given the Twitter API returns IDs, should I save the twitter user's ID (in addition to their username) when they create an account? Thanks in advance!
Counting records from datastore
5,139,865
4
0
122
0
python,google-app-engine
Store the count in another entity (named Statistics for example), and modify your application so that the stored count is updated each time a new entity is inserted or deleted.
0
1
0
0
2011-02-28T08:44:00.000
1
1.2
true
5,139,767
0
0
1
1
I am using python with Django to develop application on google app engine. Now my entity in data store contain millions or billions of record and I want to count those records in real time. By using count() it takes more time then what I can afford I want to count those record with in 2 or 3 second.. So can any one tell me what I should have to use to improve performance?
Querying on multiple tables using google apps engine (Python)
5,143,851
0
1
873
1
python,google-app-engine,model
If your are looking for join - there is no joins in GAE. BTW, there is pretty easy to make 2 simple queries (Softwares and UserSoftware), and calculate all additional data manually
0
1
0
0
2011-02-28T12:48:00.000
3
0
false
5,142,192
0
0
1
1
I have three tables, 1-Users, 2-Softwares, 3-UserSoftwares. if suppose, Users table having 6 user records(say U1,U2,...,U6) and Softwares table having 4 different softwares(say S1,S2,S3,S4) and UserSoftwares stores the references if a user requested for given software only. For example: UserSoftwares(5 records) have only two columns(userid, softwareid) which references others. and the data is: U1 S1 U2 S2 U2 S3 U3 S3 U4 S1 Now I m expecting following results:(if current login user is U2): S1 Disable S2 Enable S3 Enable S4 Disable Here, 1st column is softwareid or name and 2nd column is status which having only two values(Enable/Disable) based on UserSoftwares table(model). Note status is not a field of any model(table). "My Logic is: 1. loop through each software in softwares model 2. find softwareid with current login userid (U2) in UserSoftwares model: if it found then set status='Enable' if not found then set status='Disable' 3. add this status property to software object. 4. repeat this procedure for all softwares. " What should be the query in python google app engine to achieve above result?
Good Web hosts that support Ruby and Python?
5,149,250
0
2
1,466
0
python,ruby,django,apache,ruby-on-rails-3
I use rackspace, it's 10$ /month for the basic setup, they just give you a clean install of whatever OS you want so it will support any packages/configurations you choose to install.
0
0
0
1
2011-03-01T00:12:00.000
5
0
false
5,149,127
0
0
1
2
I love Python and Ruby equally and I simply cannot standardize on one. I love Heroku, but it can get a speck pricey and is totally specific to Rails. Is there a decently inexpensive host, or many, that adequately supports both Ruby and Python frameworks as well as offering common LAMPish support? Yeah... I wanna know if I can just have it all for cheap (sigh). I'm mostly interested in this for development and startups... scalability is not a big deal, but very welcome.
Good Web hosts that support Ruby and Python?
5,149,489
0
2
1,466
0
python,ruby,django,apache,ruby-on-rails-3
I'm in accordance with elithrar. I switched to webfaction and I'm very happy with the change. They've a very good support (I got answers in less than half hour for my problems/questions) and when my question is got by one of the IT guys, the same guy cares about all the subsequent communications until problem, doubts are resolved. They're cheap too and have very good support to do almost anythong you could need. Just compile what you need and install it in your home by ssh access and ready to go. I'm not from webfaction, but this is my experience with them. Hope this could help you.
0
0
0
1
2011-03-01T00:12:00.000
5
0
false
5,149,127
0
0
1
2
I love Python and Ruby equally and I simply cannot standardize on one. I love Heroku, but it can get a speck pricey and is totally specific to Rails. Is there a decently inexpensive host, or many, that adequately supports both Ruby and Python frameworks as well as offering common LAMPish support? Yeah... I wanna know if I can just have it all for cheap (sigh). I'm mostly interested in this for development and startups... scalability is not a big deal, but very welcome.
Django on python2.5
5,154,551
0
0
238
0
python,django,ubuntu-10.10
Install python2.5 with synaptic, then you will be able to use easy_install2.5 to install django. If you don't have the python2.5 in your package list you can put django on your python2.5 system path and be with it to view the system path do: python2.5 import sys sys.path
0
1
0
0
2011-03-01T12:25:00.000
1
1.2
true
5,154,479
0
0
1
1
AppEngine needs Python2.5. Ubuntu 2010.10 comes with Python 2.6.6 and I didn't want to interfere with it, so I downloaded and compiled Python 2.5 in my home directory. Then I downloaded Django-1.2.5.tar.gz, and ran "sudo python setup.py install". Problem: "import django" says "ImportError: No module named django" I guess django got installed to the system's Python2.6.6, how to install it into my local Python2.5 directory?
GWT or Python or Ruby for Web Development
5,156,600
1
1
3,022
0
python,ruby,gwt
GWT is really a frontend development technology. It includes components that make it play nice with the backend, but it is primarily a UI framework.
0
0
0
1
2011-03-01T15:24:00.000
6
0.033321
false
5,156,496
0
0
1
3
I want to embark on learning a totally new language for web back-end development and I've narrowed down my choice between these three: GWT Ruby Python Do you know or recommend of any sites that walks you through building a simple site using these technologies that could be easily deployed and tested? By the way, I am running a Windows OS, so please let me know if there is anything I may need to configure on my machine to start learning these tools. On the front end side of development, I would also like to see some samples that greatly exemplifies being able to use the technologies in its full potentials. Totally appreciate your suggestions and responses. Thank you. Angelo
GWT or Python or Ruby for Web Development
5,156,700
0
1
3,022
0
python,ruby,gwt
@Finbarr...but it contains a full fledged Java Servlet Backend. And this is probably why I'd suggest you to use RoR or Django or something too cook up a simple website. GWT Applications are usually made of Server components written in Java and Client Side code (mostly JavaScript) that has been generated from Java. Ususally GWT is not what you want for a simple company website.
0
0
0
1
2011-03-01T15:24:00.000
6
0
false
5,156,496
0
0
1
3
I want to embark on learning a totally new language for web back-end development and I've narrowed down my choice between these three: GWT Ruby Python Do you know or recommend of any sites that walks you through building a simple site using these technologies that could be easily deployed and tested? By the way, I am running a Windows OS, so please let me know if there is anything I may need to configure on my machine to start learning these tools. On the front end side of development, I would also like to see some samples that greatly exemplifies being able to use the technologies in its full potentials. Totally appreciate your suggestions and responses. Thank you. Angelo
GWT or Python or Ruby for Web Development
5,164,844
0
1
3,022
0
python,ruby,gwt
I would personally go with Python/Django (you can get nice overview of the technology on djangobook.com) but Ruby/Rails is probably equally good. And about GWT ... hmm we are about to start GWT project at work and I am really scared. Code looks terrible bloated , generated HTML is huge , performance can be a problem and no SEO.
0
0
0
1
2011-03-01T15:24:00.000
6
0
false
5,156,496
0
0
1
3
I want to embark on learning a totally new language for web back-end development and I've narrowed down my choice between these three: GWT Ruby Python Do you know or recommend of any sites that walks you through building a simple site using these technologies that could be easily deployed and tested? By the way, I am running a Windows OS, so please let me know if there is anything I may need to configure on my machine to start learning these tools. On the front end side of development, I would also like to see some samples that greatly exemplifies being able to use the technologies in its full potentials. Totally appreciate your suggestions and responses. Thank you. Angelo
python cache library
5,158,057
1
4
1,693
0
python,caching,memcached
Beaker as said is the way to go. It supports multiple backends including Memcached.
0
0
0
0
2011-03-01T16:59:00.000
2
0.099668
false
5,157,696
0
0
1
1
Before reinventing the wheel, I was wondering if there was a non-Django cache library that was similar to the one provided with Django. Basically, it would allow different backends (ideally, file and memcached to start) to be used just like Django's cache, and then behave identically regardless of backend used. I've seen some libraries that are designed just for memcached but I haven't seen one that is explicitly set up to handle multiple caching systems.
many to many problem django
5,164,550
0
1
352
0
python,django
Post.objects.all(catagory__title="My catagory title")?
0
0
0
0
2011-03-02T06:50:00.000
3
0
false
5,164,307
0
0
1
1
how in django find list of post related with special many to many field? for example catagory have title post have many to many relation to catagory how find all post from category title
Best way to save availability of user over days of week in python/django
5,168,529
0
5
1,639
0
python,django
I'd go for separate boolean columns. It'll be a lot easier for you to then query, say, for users that are available on mondays; or to count the number of users that available through every weekday, or whatever.
0
0
0
0
2011-03-02T13:36:00.000
6
0
false
5,168,207
0
0
1
2
I want to store users preferences for day(s) of week he might be available. e.g. A user can be available on saturday, sunday but not on other days. Currently I am using array of 7 checkboxes(values=1,2,...7) so that user can select individual days of his availability. Now the first question is how can i store this in database. I am thinking of using a string(length=7) and storing preferences like 1100010 where 1 will signify available and 0 not available. Is it good practice? Second question, how can I convert POST data (["1","2","7"]) into string (1100010)
Best way to save availability of user over days of week in python/django
5,168,522
1
5
1,639
0
python,django
One other option is the more-or-less obvious one: define a table of the days of the week, and have a ManyToManyField map one to the other. The admin would just work, you can do searches based on dates, and it works on SQLite unlike some of the functions in django-bitfield. Searches can be fast, since they're within the database and you don't have to use SQL's LIKE (which ignores indexes if there are wildcards at the start of the string, which would be the case for CommaSeparatedIntegerField or a seven-character string). Sure, it takes more storage, but how many users do you have, anyway? Millions? P.S. if you have an ordering field in your weekday table, you can also make the database sort by day of week for you with something like queryset.order_by('available__order').
0
0
0
0
2011-03-02T13:36:00.000
6
0.033321
false
5,168,207
0
0
1
2
I want to store users preferences for day(s) of week he might be available. e.g. A user can be available on saturday, sunday but not on other days. Currently I am using array of 7 checkboxes(values=1,2,...7) so that user can select individual days of his availability. Now the first question is how can i store this in database. I am thinking of using a string(length=7) and storing preferences like 1100010 where 1 will signify available and 0 not available. Is it good practice? Second question, how can I convert POST data (["1","2","7"]) into string (1100010)
Can Python be embedded in HTML like PHP and JSP?
5,168,637
1
24
41,257
0
python,html
Use Cheetah or another templating engine.
0
0
0
1
2011-03-02T14:10:00.000
5
0.039979
false
5,168,588
0
0
1
3
Is there a way of writing Python embedded in HTML like I do with PHP or JSP?
Can Python be embedded in HTML like PHP and JSP?
5,168,640
7
24
41,257
0
python,html
There is... But you're highly suggested to use a templating engine, or some other means of separating the presentation from the business layer. There are some available that use python as the templating language, but it's nasty because python is sensitive to whitespace, so special syntax hacks have to be added.
0
0
0
1
2011-03-02T14:10:00.000
5
1
false
5,168,588
0
0
1
3
Is there a way of writing Python embedded in HTML like I do with PHP or JSP?
Can Python be embedded in HTML like PHP and JSP?
5,168,647
2
24
41,257
0
python,html
Several templating engines support this in one way or another: Mako, Jinja, and Genshi are all popular choices. Different engines support different features of Python and may be better suited to your needs. Your best bet is to try them out and see what works.
0
0
0
1
2011-03-02T14:10:00.000
5
0.07983
false
5,168,588
0
0
1
3
Is there a way of writing Python embedded in HTML like I do with PHP or JSP?
After saving memcache data, is it immediately available on GAE?
5,170,495
3
1
699
0
python,google-app-engine,caching,memcached
The distributed memcache architecture has a pool of memcache instances that serves all the Google App Engine applications; the stored data is not replicated between memcache servers. After successfully saving data on memcache, your data will be there* for any subsequent requests because it is stored in one specific memcache instance. * one caveat: values may be evicted from the cache in case of low memory
0
1
0
0
2011-03-02T14:37:00.000
3
1.2
true
5,169,001
0
0
1
1
On Google App Engine (python), I need to save data with memcache and quickly read it on another page. But before I start coding to have memcache saved, then on the next page I open up that data with the known key, I'm starting to wonder if the data will always be there on the next page? How long does it take to cache the data, and reliably be there on the next page to read? Is this an issue since it's a cloud service, or would this be an issue even if it was on one server? Or is it not an issue at all and I can count on it being there on the next page? NOTE: This method isn't the backbone of my webapp, its just a special case I need to use for one scenario. Also, for this scenario I do not want to persist data between pages with a querystring, cookies or header values.
How can I authenticate my mobile application and underlying server using Facebook?
5,259,777
-1
0
771
0
iphone,python,django,google-app-engine
You can try using the OAuth framework
0
0
0
0
2011-03-02T18:44:00.000
1
-0.197375
false
5,171,905
0
0
1
1
The behaviour I want is simple: User starts up the application. User is prompted for their Facebook username and password. On successful login, user is now authenticated for the application and the web server. There is now a user in the server associated with the Facebook ID. All further HTTP requests will have a cookie that is authenticated on the web server. There are a few problems with this behaviour, as far as I can see. Facebook You cannot login programmatically, according to the terms of service; sign on must be done via the Facebook website or SDK, both of which are interactive. Therefore, I cannot create my own form, pass the username and password to my web server, login there and respond with the successful cookie set. Security If the user logs in via the application, they are authenticated for the application only. Passing the Facebook ID to my web server could be done, but considering how easy it is to find out a user's FB ID, it would be very easy to spoof the server. I've considered auto-generating a password in the application, but this only reduces the window for spoofing and doesn't close the hole entirely. (Security isn't actually a big deal for my project, but I don't want to leave such an obvious hole.) My technology is iOS 3.0+ for the mobile application and Google App Engine for the server, running a modified version of Django. The solution I've worked out, which I believe works around the limitations, is as follows: User starts up the application. Application checks whether the currently set cookie is authenticated on the server. If not, open Safari via URL scheme to actual page on web server with option to login via Facebook (or any other authentication systems I add at a later date). User authenticates and server creates user (if necessary) associated with the Facebook ID. Successfully logged in, server redirects to page that calls mobile application URL scheme with the cookie ID as a parameter. Success? So, my question: am I doing the right thing? Are any of my assumptions wrong?
WIth PyCharm, why is the PYTHONPATH when running a Django project different from when running the manage.py syncdb task?
5,173,224
0
1
1,737
0
python,django,pythonpath,pycharm,syncdb
Did you select the right python install for your project in Settings > Python Interpreter?
0
0
0
0
2011-03-02T19:15:00.000
2
0
false
5,172,214
0
0
1
1
Shouldn't it be the same by default? If not, is there some way to fix this so that the same PYTHONPATH is used?
Django templates syntax highlighting in Eclipse
6,933,282
13
27
15,866
0
python,django,ide,syntax-highlighting,pydev
For clarity Django Templates Editor is only available with Aptana 3.0 and later. Pydev in eclipse alone does not support it. Aptana is available as an eclipse plugin or stand alone. As mentioned by mcoconnor Window -> Preferences -> General -> Editor -> File Associations will give you a list of extensions. Choose *.html as the file type Select HTML.Django Templates Editor (Aptana) from Associated editors Click Default. Reload any html files you had open in the editor This should make Aptana treat the Django specific markup correctly instead of reporting errors and also will offer code completion.
0
0
0
0
2011-03-02T20:28:00.000
5
1
false
5,173,024
0
0
1
2
I use Eclipse and pydev for django development. This has worked more or less ok, including debugging. Syntax highlighting doesn't seem to work everywhere though. I couldn't get any highlighting for the templates thought. Is there a way to get the highlighting and code suggestions for the templates?
Django templates syntax highlighting in Eclipse
5,173,496
-1
27
15,866
0
python,django,ide,syntax-highlighting,pydev
If you install the Eclipse Web Tools Platform (WTP), it bundles a nice HTML editor, which does 95% of the syntax highlighting you'd want in a Django template. It also includes editors for other common web types, like JS and CSS, which are often nice when working with Django projects. This will also give you code completion and automatic tag closing for the HTML elements, at least. If you use a .html extension on your template files, you'll probably get the right editor by default when you open them up, but if not, you can associate the HTML Editor with whatever extension you use in the Window -> Preferences -> General -> Editor -> File Associations interface.
0
0
0
0
2011-03-02T20:28:00.000
5
-0.039979
false
5,173,024
0
0
1
2
I use Eclipse and pydev for django development. This has worked more or less ok, including debugging. Syntax highlighting doesn't seem to work everywhere though. I couldn't get any highlighting for the templates thought. Is there a way to get the highlighting and code suggestions for the templates?
Python or PyPy for small group and large project?
5,180,344
3
0
852
0
python,django,couchdb,pylons,pypy
HTML 5, CSS 3 - PyPy 1.4/CPython 3 + Pylons/Tornado/Django - CouchDB/MongoDB/Riak + Erlang? Simplify. Python 2.7, Django 1.2, SQLite and MongoDB get started building stuff right away. Add later. Upgrade to Python 3 later.
0
0
0
0
2011-03-03T11:26:00.000
4
0.148885
false
5,180,099
0
0
1
4
Early stage of planning a large project - difficult decision of choosing frameworks :) In mind: "select way - run fast". Select technologies with growth opportunity, prototype as fast as possible. "look at horizon - build a ship". Understand the scope, invest in difficult decision but reach the goal. "take the best - enjoy the ride". Bring the best team, do not let them fall aboard. Choose from: HTML 5, CSS 3 - PyPy 1.4/CPython 3 + Pylons/Tornado/Django - CouchDB/MongoDB/Riak + Erlang? First step: 3-4 developers in team + 1 admins + 1 designer. Designer - View + Service Developers - Admin - Balance + Structure Developers Second step: 5-7 developers in team + 2-3 admins + 1-2 designer. Updated: Python + Pyramid (Pylons) + Couchbase (CouchDB)
Python or PyPy for small group and large project?
5,204,074
0
0
852
0
python,django,couchdb,pylons,pypy
It's good prqctice to mix technologies in scope of a project. Depending on purpose for example erlang may be more suitable than python.
0
0
0
0
2011-03-03T11:26:00.000
4
0
false
5,180,099
0
0
1
4
Early stage of planning a large project - difficult decision of choosing frameworks :) In mind: "select way - run fast". Select technologies with growth opportunity, prototype as fast as possible. "look at horizon - build a ship". Understand the scope, invest in difficult decision but reach the goal. "take the best - enjoy the ride". Bring the best team, do not let them fall aboard. Choose from: HTML 5, CSS 3 - PyPy 1.4/CPython 3 + Pylons/Tornado/Django - CouchDB/MongoDB/Riak + Erlang? First step: 3-4 developers in team + 1 admins + 1 designer. Designer - View + Service Developers - Admin - Balance + Structure Developers Second step: 5-7 developers in team + 2-3 admins + 1-2 designer. Updated: Python + Pyramid (Pylons) + Couchbase (CouchDB)
Python or PyPy for small group and large project?
5,180,163
5
0
852
0
python,django,couchdb,pylons,pypy
Go with CPython. All known bindings to external libraries or whatever are supposed to work with CPython. I doubt that you will have success with PyPy here. Just from the prospective of risk management in large projects: stay mainstream.
0
0
0
0
2011-03-03T11:26:00.000
4
0.244919
false
5,180,099
0
0
1
4
Early stage of planning a large project - difficult decision of choosing frameworks :) In mind: "select way - run fast". Select technologies with growth opportunity, prototype as fast as possible. "look at horizon - build a ship". Understand the scope, invest in difficult decision but reach the goal. "take the best - enjoy the ride". Bring the best team, do not let them fall aboard. Choose from: HTML 5, CSS 3 - PyPy 1.4/CPython 3 + Pylons/Tornado/Django - CouchDB/MongoDB/Riak + Erlang? First step: 3-4 developers in team + 1 admins + 1 designer. Designer - View + Service Developers - Admin - Balance + Structure Developers Second step: 5-7 developers in team + 2-3 admins + 1-2 designer. Updated: Python + Pyramid (Pylons) + Couchbase (CouchDB)
Python or PyPy for small group and large project?
5,180,288
5
0
852
0
python,django,couchdb,pylons,pypy
Python (assuming you mean the CPython implementation) and PyPy are not frameworks, but implementations of the Python language. Note that they implement the same language. I'd start with CPython because it's industrial-strength today, and the multitude of Python libraries, frameworks and extensions all target it. PyPy looks promising, and it may become a serious contender for the most popular Python implementation some day. But that day is still far away, and if it does arrive it won't be without PyPy's ability to run CPython libraries without modifications, so I think you're safe for quite some time.
0
0
0
0
2011-03-03T11:26:00.000
4
0.244919
false
5,180,099
0
0
1
4
Early stage of planning a large project - difficult decision of choosing frameworks :) In mind: "select way - run fast". Select technologies with growth opportunity, prototype as fast as possible. "look at horizon - build a ship". Understand the scope, invest in difficult decision but reach the goal. "take the best - enjoy the ride". Bring the best team, do not let them fall aboard. Choose from: HTML 5, CSS 3 - PyPy 1.4/CPython 3 + Pylons/Tornado/Django - CouchDB/MongoDB/Riak + Erlang? First step: 3-4 developers in team + 1 admins + 1 designer. Designer - View + Service Developers - Admin - Balance + Structure Developers Second step: 5-7 developers in team + 2-3 admins + 1-2 designer. Updated: Python + Pyramid (Pylons) + Couchbase (CouchDB)
How can I let android emulator talk to the localhost?
5,185,046
16
6
3,711
0
python,android,android-emulator,webview
Use address 10.0.2.2 instead of localhost.
0
0
1
0
2011-03-03T18:39:00.000
4
1.2
true
5,185,016
0
0
1
4
I'm running an android app on the emulator. This app tries to load a html file using the webview api. I also have a simple http server running on the same computer under the directory where I want to serve the request using the following python command: python -m SimpleHTTPServer 800 However, I couldn't access this link through either the app or the browser on the emulator: http://localhost:800/demo.html Please let me know if I'm missing something.
How can I let android emulator talk to the localhost?
5,185,075
0
6
3,711
0
python,android,android-emulator,webview
Actually localhost refers to the emulators directory itself. Use your system ip to access the link
0
0
1
0
2011-03-03T18:39:00.000
4
0
false
5,185,016
0
0
1
4
I'm running an android app on the emulator. This app tries to load a html file using the webview api. I also have a simple http server running on the same computer under the directory where I want to serve the request using the following python command: python -m SimpleHTTPServer 800 However, I couldn't access this link through either the app or the browser on the emulator: http://localhost:800/demo.html Please let me know if I'm missing something.
How can I let android emulator talk to the localhost?
5,185,051
0
6
3,711
0
python,android,android-emulator,webview
localhost is a short-cut to tell the "whatever" to talk to itself. So, you are telling the emulator to look for a web server running in the emulator. Instead of trying to connect to localhost, look up the IP for your computer and use that instead.
0
0
1
0
2011-03-03T18:39:00.000
4
0
false
5,185,016
0
0
1
4
I'm running an android app on the emulator. This app tries to load a html file using the webview api. I also have a simple http server running on the same computer under the directory where I want to serve the request using the following python command: python -m SimpleHTTPServer 800 However, I couldn't access this link through either the app or the browser on the emulator: http://localhost:800/demo.html Please let me know if I'm missing something.
How can I let android emulator talk to the localhost?
5,186,087
-2
6
3,711
0
python,android,android-emulator,webview
Best solution is not to use emulator at all. Its slow and full of bugs. Get your employer to buy a device or two.
0
0
1
0
2011-03-03T18:39:00.000
4
-0.099668
false
5,185,016
0
0
1
4
I'm running an android app on the emulator. This app tries to load a html file using the webview api. I also have a simple http server running on the same computer under the directory where I want to serve the request using the following python command: python -m SimpleHTTPServer 800 However, I couldn't access this link through either the app or the browser on the emulator: http://localhost:800/demo.html Please let me know if I'm missing something.
What is the reverse equivalent of cascade?
5,185,748
1
6
1,807
0
python,django
I've had a similar problem and I've ended up adding a counter into the Album equivalent. If the count is 0 and the operation is delete(), then the album object is delete()d. Other solution os to overload the delete() method in the song model, or use post-delete to delete the album.
0
0
0
0
2011-03-03T19:34:00.000
4
0.049958
false
5,185,563
0
0
1
1
I am writing a small music database. Learning SQL lies quite a long time in my past and I always wanted to give Django a try. But there is one thing I couldn't wrap my head around. Right now, my models only consist of two Classes, Album and Song. Song has a foreign key pointing to the album it belongs to. Now if I would delete that Album, all Songs "belonging" to it, would be deleted due to the cascading effect. Albums are kinda virtual in my database, only songs are actually represented on the filesystem and the albums are constructed according to the songs tags, therefore I can only know an album doesn't exist anymore if there are no more songs pointing to it (as they no longer exist in the filesystem). Or in short, how can I achieve a cascade in reverse, that means, if no more songs are pointing to an album, the album should be deleted as well?
Cannot find appcfg.py or dev_appserver.py?
5,187,728
1
11
17,655
0
python,google-app-engine,macos,bash
Try: ./appcfg.py Current dir is usually not part of path.
0
1
0
0
2011-03-03T22:48:00.000
7
0.028564
false
5,187,602
0
0
1
2
My computer says... "-bash: appcfg.py: command not found" What is wrong? I can run my application using google-app-engine-launcher and I have python pre-installed. I am trying to upload my app using "appcfg.py update myapp" I am new to Mac development.
Cannot find appcfg.py or dev_appserver.py?
5,188,313
17
11
17,655
0
python,google-app-engine,macos,bash
In App Engine launcher there is a menu option called "Make Symlinks..." that adds symlinks for the various App Engine utility commands, like appcfg.py.
0
1
0
0
2011-03-03T22:48:00.000
7
1.2
true
5,187,602
0
0
1
2
My computer says... "-bash: appcfg.py: command not found" What is wrong? I can run my application using google-app-engine-launcher and I have python pre-installed. I am trying to upload my app using "appcfg.py update myapp" I am new to Mac development.
Multiple pluralisable variables in internationalized django template
5,244,999
4
3
846
0
python,django,internationalization,translation,gettext
After doing some more research and reading, specifically about gettext, I don't think this is possible. gettext documentation only allows one variable to control the pluralization. There are probably problems with having 2 variable pluralization, since in arabic, you'd have to have 36 different strings to translate. In the end I just worked around my original problem, and split it into two strings.
0
0
0
0
2011-03-04T15:53:00.000
1
1.2
true
5,196,084
0
0
1
1
I am internationalizing (i18n) our django project, i.e. adding {% blocktrans %} to our templates. I know about using count and {% plural %} to have different strings for varaibles. However I have a string that has two variables that each need to be pluralized, i.e. 4 possible options. For example, my string is "You have {{ num_unread }} unread message{{ num_unread|pluralize }} out of {{ total }} total message{{ total|pluralize }}" How would I convert that to blocktrans tags?
GAE redirection with a delay
5,203,395
1
1
2,116
0
python,google-app-engine,redirect
import time at the top of your module and do a time.sleep(0.5) before you do a self.redirect call. The sleep argument can take a floating point value of number of seconds to delay. Just make sure that you don't exceed 30 seconds of delay as GAE expects that every request be handled within that otherwise it will be interrupted.
0
1
0
0
2011-03-05T11:02:00.000
2
0.099668
false
5,203,378
0
0
1
2
Is that possible to redirect to another url with a delay in GAE? I know I can use JavaScript for this purpose, but may be there is a way to do delayed redirection without it? Now I use self.redirect("/") from GAE tutorial. Thanks.
GAE redirection with a delay
5,203,418
8
1
2,116
0
python,google-app-engine,redirect
You can use the <meta http-equiv="refresh" content="x;url=http://yoururl/"> tag where x is the number of seconds to wait before redirect. This tag would go in <head> part of the generated page.
0
1
0
0
2011-03-05T11:02:00.000
2
1.2
true
5,203,378
0
0
1
2
Is that possible to redirect to another url with a delay in GAE? I know I can use JavaScript for this purpose, but may be there is a way to do delayed redirection without it? Now I use self.redirect("/") from GAE tutorial. Thanks.
Python Web/UI Options
5,205,268
0
0
3,564
0
python,user-interface
Tkinter is probably going to be the solution you can use quickest. Its API is simple and straight-forward, and you probably already have it installed.
0
0
0
0
2011-03-05T16:24:00.000
4
0
false
5,205,062
0
0
1
1
We are in the process of standing up a UI on top of a python system. This is all throw away code, so we want something quick, yet presentable. We will have a couple of "interfaces" but they will be of two types. One will be control, it will basically be sitting on top of a python thread, and accepting requests from the user. The other will be more of a display screen that will need to be able to display images, and some classic "grid views" of text to the user. We pretty much know we could* do all of this in HTML but wasn't sure what would be the best way to interact with the core python code? Anyone know of a good UI python presentation layer? Since we know we can do all of this in HTML/Jquery pretty quickly, we are also open to suggestions on how to integrate this with a web server.. Any suggestions? Really interested in finding out if there is any way to use python as the back end to a webserver. Let me know if you all need more information.
CUPP (pentest) on google app engine
5,210,681
2
0
272
0
python,google-app-engine
I see a few problems right off: You'll need to create a web interface to the script GAE does not allow long running tasks and this looks like it could take a while. You'd need to recode it to break the work up into chunks. Outbound FTP (for fetching word lists) is not supported on GAE Local file write access is not supported (you'd need to convert this to use the datastore)
0
1
0
0
2011-03-05T21:18:00.000
1
0.379949
false
5,206,838
0
0
1
1
Do you see any limitations for cupp (http://www.securityfocus.com/tools/7320) running on GAE?
Performance between Django and raw Python
5,209,121
3
5
1,142
0
python,django
Premature optimisation is the root of all evil. Django makes things extremely convenient if you're doing web development. That plus a great community with hundreds of plugins for common tasks is a real boon if you're doing serious work. Even if your "raw" implementation is faster, I don't think it will be fast enough to seriously affect your web application. Build it using tools that work at the right level of abstraction and if performance is a problem, measure it and find out where the bottlenecks are and apply optimisations. If after all this you find out that the abstractions that Django creates are slowing your app down (which I don't expect that they will), you can consider moving to another framework or writing something by hand. You will probably find that you can get performance boosts by caching, load balancing between multiple servers and doing the "usual tricks" rather than by reimplementing the web framework itself.
0
0
0
0
2011-03-06T02:06:00.000
4
0.148885
false
5,208,158
0
0
1
4
I was wondering what the performance difference is between using plain python files to make web pages and using Django. I was just wondering if there was a significant difference between the two. Thanks
Performance between Django and raw Python
5,208,366
11
5
1,142
0
python,django
Django IS plain Python. So the execution time of each like statement or expression will be the same. What needs to be understood, is that many many components are put together to offer several advantages when developing for the web: Removal of common tasks into libraries (auth, data access, templating, routing) Correctness of algorithms (cookies/sessions, crypto) Decreased custom code (due to libraries) which directly influences bug count, dev time etc Following conventions leads to improved team work, and the ability to understand code Plug-ability; Create or find new functionality blocks that can be used with minimal integration cost Documentation and help; many people understand the tech and are able to help (StackOverflow?) Now, if you were to write your own site from scratch, you'd need to implement at least several components yourself. You also lose most of the above benefits unless you spend an extraordinary amount of time developing your site. Django, and other web frameworks for every other language, are designed to provide the common stuff, and let you get straight to work on business requirements. If you ever banged out custom session code and data access code in PHP before the rise of web frameworks, you won't even think of the performance cost associated with a framework that makes your job interesting and eas(y)ier. Now, that said, Django ships with a LOT of components. It is designed in such a way that most of the time, they won't affect you. Still, a surprising amount of code is executed for each request. If you build out a site with Django, and the performance just doesn't cut it, you can feel free to remove all the bits you don't need. Or, you can use a 'slim' python framework. Really, just use Django. It is quite awesome. It powers many sites millions times larger than anything you (or I) will build. There are ways to improve performance significantly, like utilizing caching, rather than optimizing a loop over custom Middleware.
0
0
0
0
2011-03-06T02:06:00.000
4
1.2
true
5,208,158
0
0
1
4
I was wondering what the performance difference is between using plain python files to make web pages and using Django. I was just wondering if there was a significant difference between the two. Thanks
Performance between Django and raw Python
5,208,183
5
5
1,142
0
python,django
Depends on how your "plain Python" makes web pages. If it uses a templating engine, for instance, the performance of that engine is going make a huge difference. If it uses a database, what kind of data access layer you use (in the context of the requirements for that layer) is going to make a difference. The question, thus, becomes a question of whether your arbitrary (and presently unstated) toolchain choices have better runtime performance than the ones selected by Django. If performance is your primary, overriding goal, you certainly should be able to make more optimal selections. However, in terms of overall cost -- ie. buying more web servers for the slower-runtime option, vs buying more programmer-hours for the more-work-to-develop option -- the question simply has too many open elements to be answerable.
0
0
0
0
2011-03-06T02:06:00.000
4
0.244919
false
5,208,158
0
0
1
4
I was wondering what the performance difference is between using plain python files to make web pages and using Django. I was just wondering if there was a significant difference between the two. Thanks
Performance between Django and raw Python
5,208,968
2
5
1,142
0
python,django
Django is also plain Python. See the performance mostly relies on how efficient your code is. Most of the performance issues of software arise from the inefficient code, rather than choice of tools and language. So the implementation matters. AFAIK Django does this excellently and it's performance is above the mark.
0
0
0
0
2011-03-06T02:06:00.000
4
0.099668
false
5,208,158
0
0
1
4
I was wondering what the performance difference is between using plain python files to make web pages and using Django. I was just wondering if there was a significant difference between the two. Thanks
What's the best way to handle source-like data files in a web application?
5,210,383
1
4
127
1
python
Okay, here's an idea: Ship all the data as is done now. Have the installation script install it in the appropriate databases. Let users modify this database and give them a button "restore to original" that simply reinstalls from the text file. Alternatively, this route may be easier, esp. when upgrading an installation: Ship all the data as is done now. Let users modify the data and store the modified versions in the appropriate database. Let the code look in the database, falling back to the text files if the appropriate data is not found. Don't let the code modify the text files in any way. In either case, you can keep your current testing code; you just need to add tests that make sure the database properly overrides text files.
0
0
0
0
2011-03-06T11:56:00.000
2
0.099668
false
5,210,318
0
0
1
1
I have about 30 MB of textual data that is core to the algorithms I use in my web application. On the one hand, the data is part of the algorithm and changes to the data can cause an entire algorithm to fail. This is why I keep the data in text files in my source control, and all changes are auto-tested (pre-commit). I currently have a good level of control. Distributing the data along with the source as we spawn more web instances is a non-issue because it tags along with the source. I currently have these problems: I often develop special tools to manipulate the files, replicating database access tool functionality I would like to give non-developers controlled web-access to this data. On the other hand, it is data, and it "belongs" in a database. I wish I could place it in a database, but then I would have these problems: How do I sync this database to the source? A release contains both code and data. How do I ship it with the data as I spawn a new instance of the web server? How do I manage pre-commit testing of the data? Things I have considered thus-far: Sqlite (does not solve the non-developer access) Building an elaborate pre-production database, which data-users will edit to create "patches" to the "real" database, which developers will accept, test and commit. Sounds very complex. I have not fully designed this yet and I sure hope I'm reinventing the wheel here and some SO user will show me the error of my ways... BTW: I have a "regular" database as well, with things that are not algorithmic-data. BTW2: I added the Python tag because I currently use Python, Django, Apache and Nginx, Linux (and some lame developers use Windows). Thanks in advance! UPDATE Some examples of the data (the algorithms are natural language processing stuff): World Cities and their alternate names Names of currencies Coordinates of hotels The list goes on and on, but Imagine trying to parse the sentence Romantic hotel for 2 in Rome arriving in Italy next monday if someone changes the coordinates that teach me that Rome is in Italy, or if someone adds `romantic' as an alternate name for Las Vegas (yes, the example is lame, but I hope you get the drift).
Python frameworks for developing facebook apps
23,464,883
0
6
2,182
0
python,facebook
If you do not want to start on Django now. Try learning Flask(which is comparatively a lot easier to begin than Django) and then start building app with Flask.
0
0
0
1
2011-03-06T13:13:00.000
3
0
false
5,210,692
0
0
1
1
I'd like to ask you about your experiences in developing facebook applications in Python. Which of the popular web frameworks for this language you think best suits this purpose? I know "best" is a very subjective word, so I'm specifically interested in the following: Most reusable libraries. For example one might want to automatically create accounts for new logged in facebook users, but at the same time provide an alternative username + password logging functionality. I need authentication to fit into this nicely. Facebook applications tend to differ from CMS-like sites. They are action intensive. For more complicated use-cases, usually some kind of caching for the data fetched from Open Graph API is required in order to be able to perform some queries on local and facebook data at once (for example join some tables based on friendship relation). I'd definitely prefer popular solutions. They just seem to be much more stable and better thought through. I've previously developed a facebook application in Grails and I as much as I liked the architecture and the general ideas, the amount of bugs and complication that I ran into was just a little bit too much. Also Groovy is still quite an exotic language to develop in, and this time I'm not going to work on my own. I'm not new to Python, but definitely new to web development in Python. Though after the experience with Grails and all its twists and turns I doubt Python could really scare me.