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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PyDev project for Google App Engine not finding webapp2
| 7,789,156 | 3 | 6 | 5,907 | 0 |
python,eclipse,google-app-engine,pydev
|
The current SDK does not support the Python 2.7 runtime on the dev_appserver, so it doesn't bundle new libraries like webapp2. If all you need is the libraries, you can download them and include them in your app yourself, but if you need extra runtime features like multithreading and PIL, you will need to do your development in the production environment for now.
| 0 | 1 | 0 | 0 |
2011-10-13T16:00:00.000
| 5 | 0.119427 | false | 7,756,981 | 0 | 0 | 1 | 3 |
I am attempting to try out Google App Engine with python. Being familiar with Eclipse, I decided to use PyDev. After some trouble, I have a hello world program working... almost. It cannot find the webapp2 import, telling me it is unresolved. I have followed all of the instructions I can find, and have the google app engine libraries linked up - I think. I have searched for webapp2 as a potential import, and cannot find this anywhere in any of the library files. I am really new to python in general, and even newer to the Google App Engine, so I am certain that this is a simple problem that is exacerbated by my newness.
I am running on OS-X, running Eclipse Indigo Service Release 1. I have the latest version of PyDev available for download as of Tuesday evening.
|
PyDev project for Google App Engine not finding webapp2
| 8,238,441 | 3 | 6 | 5,907 | 0 |
python,eclipse,google-app-engine,pydev
|
I encounter this problem, too.
And I follow TorelTwiddler's instruction -> he's right, there's no webapp2.
You have to add ${GOOGLE_APP_ENGINE}/lib/webapp2 to the "External Libraries".
This occurs because(I guess) you only change the interpreter of the project, not create a whole new GAE project with PyDev.
This action didn't re-scan the libs it should include.
If you are Create a new GAE project w/ Pydev, you'll see webapp2 is in the external libs' list.
| 0 | 1 | 0 | 0 |
2011-10-13T16:00:00.000
| 5 | 0.119427 | false | 7,756,981 | 0 | 0 | 1 | 3 |
I am attempting to try out Google App Engine with python. Being familiar with Eclipse, I decided to use PyDev. After some trouble, I have a hello world program working... almost. It cannot find the webapp2 import, telling me it is unresolved. I have followed all of the instructions I can find, and have the google app engine libraries linked up - I think. I have searched for webapp2 as a potential import, and cannot find this anywhere in any of the library files. I am really new to python in general, and even newer to the Google App Engine, so I am certain that this is a simple problem that is exacerbated by my newness.
I am running on OS-X, running Eclipse Indigo Service Release 1. I have the latest version of PyDev available for download as of Tuesday evening.
|
Keep python module in memory
| 7,766,483 | 2 | 3 | 292 | 0 |
python,persistence,nltk
|
I believe that the most efficient and quick way to accomplish that is to have a separate server or process which receives text and replies with the results of post_tag() function, or whatever function you want.
| 0 | 0 | 0 | 0 |
2011-10-13T21:14:00.000
| 1 | 1.2 | true | 7,760,513 | 0 | 0 | 1 | 1 |
I'm using the Natural Language Toolkit for python and in it there is a useful function called pos_tag. You can run nltk.pos_tag() on any a list of words that were tokenized from a sentence and it will return a list of tuples with each word in the sentence and its part of speech (POS).
Well thats great, but I need to run this every time some runs an AJAX call on my website. Unfortunately the function has a lot of initial overhead and takes about 10 seconds to do everything it needs to do to work. Once it does, I can call nltk.pos_tag() and it will run very fast. But Each time I make the AJAX call it has to load the function again.
So I was wondering if there is a way to make that persist so I don't have to load it every time someone comes to my page or updates it with an AJAX call. I've tried pickling and that didn't work. I've looked at shelve but it seems like its similar to pickle. Hope someone can help.
Thanks.
|
which is better for production with web2py?
| 9,021,132 | 0 | 2 | 1,454 | 1 |
python,web2py
|
I say. Whatever you can work with from console. Some events may require fixing db from fingertip, you may also want to have some other ongoing actions in db and it might need to be done outside web2py.
PosgreSQL is my choice as there are much less irregular behaviours thus its easier to grasp...
| 0 | 0 | 0 | 0 |
2011-10-13T22:50:00.000
| 4 | 0 | false | 7,761,339 | 0 | 0 | 1 | 1 |
which is better for production with web2py? please more insights.
I'm very new 2 web2py and i am working on a small pharmacy mgt system.
pls which is better for production postgres or mysql? if postgres, step by step installation guide pls so to smoothly work with web2py. thanks
|
Trouble with parsing HTML with unicodes through Beautiful Soup
| 7,769,860 | 1 | 1 | 147 | 0 |
python,regex,html-parsing,beautifulsoup
|
The problem is not with parsing the file. Using the link you gave in your comment to Marco, doing soup = BeautifulSoup(urllib.urlopen(your_link)) works absolutely fine.
It's just when you try and print that parsed data to the console that you get a problem, because it's now been converted to Unicode, and Python will try and output that as ASCII unless you tell it otherwise. So doing print soup rather than just soup in your console will work.
| 0 | 0 | 0 | 0 |
2011-10-14T14:43:00.000
| 1 | 0.197375 | false | 7,769,322 | 0 | 0 | 1 | 1 |
Beautiful Soup doesn't seem to work properly(for me) in case HTML contains unicodes whose ascii exceeds 128. What suitable decoding-encoding should be used for this ?
raw = open('index.html').read()
BeautifulSoup.BeautifulSoup(raw)
Error
...stacktrace...
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 8094: ordinal not in range(128)
|
reliable way to deploy new code into a production celery cluster without pausing service
| 13,168,517 | 4 | 9 | 1,747 | 0 |
python,django,celery
|
The challenging part here seems to be identifying which celery tasks are new versus old. I would suggest creating another vhost in rabbitmq and performing the following steps:
Update django web servers with new code and reconfigure to point to the new vhost.
While tasks are queuing up in the new vhost, wait for celery works to finish up with the tasks from the old vhost.
When workers have completed, update the code and configuration to the new vhost
I haven't actually tried this but I don't see why this wouldn't work. One annoying aspect is having to alternate between the vhosts with each deploy.
| 0 | 1 | 0 | 0 |
2011-10-14T19:05:00.000
| 2 | 1.2 | true | 7,772,378 | 0 | 0 | 1 | 2 |
I have a few celery nodes running in production with rabbitmq and I have been handling deploys with service interruption. I have to take down the whole site in order to deploy new code out to celery. I have max tasks per child set to 1, so in theory, if I make changes to an existing task, they should take effect when the next time they are run, but what about registering new tasks? I know that restarting the daemon won't kill running workers, but instead will let them die on their own, but it still seems dangerous. Is there an elegant solution to this problem?
|
reliable way to deploy new code into a production celery cluster without pausing service
| 7,780,065 | 0 | 9 | 1,747 | 0 |
python,django,celery
|
a kind of work around for you can be to set the config variable MAX_TASK_PER_CHILD.
This variable specify the number of task that a Pool Worker execute before kill himself.
Off course when a new Pool Worker is executed this will load the new code.
On my system normally I use to restart celery leaving other task running on background, normally everything goes fine, sometimes happen that one of this task is never killed and you can still kill it with a script.
| 0 | 1 | 0 | 0 |
2011-10-14T19:05:00.000
| 2 | 0 | false | 7,772,378 | 0 | 0 | 1 | 2 |
I have a few celery nodes running in production with rabbitmq and I have been handling deploys with service interruption. I have to take down the whole site in order to deploy new code out to celery. I have max tasks per child set to 1, so in theory, if I make changes to an existing task, they should take effect when the next time they are run, but what about registering new tasks? I know that restarting the daemon won't kill running workers, but instead will let them die on their own, but it still seems dangerous. Is there an elegant solution to this problem?
|
Case insensitive unique model fields in Django?
| 31,082,203 | 3 | 63 | 26,513 | 0 |
python,django,postgresql,model
|
You can use citext postgres type instead and not bother anymore with any sort of iexact. Just make a note in model that underlying field is case insensitive.
Much easier solution.
| 0 | 0 | 0 | 0 |
2011-10-14T20:41:00.000
| 9 | 0.066568 | false | 7,773,341 | 0 | 0 | 1 | 1 |
I have basically a username is unique (case insensitive), but the case matters when displaying as provided by the user.
I have the following requirements:
field is CharField compatible
field is unique, but case insensitive
field needs to be searchable ignoring case (avoid using iexact, easily forgotten)
field is stored with case intact
preferably enforced on database level
preferably avoid storing an extra field
Is this possible in Django?
The only solution I came up with is "somehow" override the Model manager, use an extra field, or always use 'iexact' in searches.
I'm on Django 1.3 and PostgreSQL 8.4.2.
|
Using Django/Python to CONSUME existing web services
| 7,774,952 | 2 | 2 | 2,113 | 0 |
python,django,web-services,rest
|
Inside your Django app, you can easily use the urllib and json modules in the Python standard library to pull data from URLs, and then parse them as JSON.
| 0 | 0 | 0 | 0 |
2011-10-15T00:36:00.000
| 1 | 1.2 | true | 7,774,930 | 0 | 0 | 1 | 1 |
I have an existing REST application serving either JSON or XML. I can use the framework (Play) to render templates directly, but I'm not allowed to (arbitrary homework requirement they just invented), and forced to use a second layer to consume, process and render the REST objects.
I want to use Django/Python if possible. What do you recommend? Something where I'm not parsing JSON directly would be nice.
Is it possible in Django? I would like to do all my templating and views at this level. So something with a good templating language is needed.
Or should I be using something even more lightweight like httpLib/urlLib?
|
Using Sqlite3 on Heroku Cedar stack
| 7,784,785 | 22 | 12 | 3,398 | 0 |
python,sqlite,heroku
|
The cedar stack's filesystem is not readonly.
However, you still mustn't store any data on it because the filesystem is ephemeral.
Any time your application restarts, whatever you had written to your application's filesystem disappears forever.
Any time you add a dyno, the two dynos each have their own ephemeral system; any data stored by one dyno to its ephemeral filesystem is not available to the other dyno or to any additional dynos you may add later.
Sqlite3 writes data to the local filesystem. You cannot use Sqlite3 with Heroku.
Heroku provides a default PostgreSQL installation, which Heroku manages. You can use that.
You can also use any third-party-managed cloud database system, such as Amazon RDS' or Xeround's MySQL, MongoHQ's or MongoLab's MongoDB, or Cloudant's CouchDB - all of which are available as Heroku addons.
| 0 | 0 | 0 | 0 |
2011-10-16T13:07:00.000
| 2 | 1.2 | true | 7,784,471 | 0 | 0 | 1 | 1 |
Is there a way to use Sqlite3 with Django on Heroku?
|
PyDev Auto-Complete Doesn't Work
| 7,784,801 | 0 | 1 | 2,773 | 0 |
python,django,pydev
|
I had the some problem when I upgraded my Ubuntu, it was fixed when i installed the aptana studio package fully.
| 0 | 0 | 0 | 0 |
2011-10-16T13:21:00.000
| 2 | 0 | false | 7,784,555 | 0 | 0 | 1 | 1 |
Today I reinstalled my OS (Ubuntu 11.10) and installed Django and PyDev.
I ran one of my programs that import Django framework. It works, but PyDev doesn't detect my project, Django, Simple Django Captcha and most Python libraries.
What can I do to fix this problem?
Actually, I must say I configured my PYTHONPATH in PyDev, too.
|
How to control the "Updating skeletons" background task in PyCharm for IronPython interpreter?
| 8,680,085 | -8 | 44 | 23,741 | 0 |
ironpython,pycharm,python
|
Please upgrade to PyCharm 2.0. It's likely that the problem with generating skeletons of binary modules is already fixed.
| 0 | 0 | 0 | 0 |
2011-10-17T19:35:00.000
| 3 | -1 | false | 7,798,623 | 1 | 0 | 1 | 1 |
Is there a way to suppress, stop or, otherwise, control the settings for, or display of, background tasks in PyCharm? Selecting the IronPython interpreter causes it to update skeletons (seemingly) every time the interpreter is selected and usually takes 20-30 minutes to complete, rendering the IDE nearly unusable. Most times, I can't even carry on with normal work as most of the context menus are disabled during the operation.
|
Best practice for decoupling a database from a message queue
| 7,802,664 | 2 | 0 | 639 | 1 |
python,database,pylons,message-queue,celery
|
It seems that your goal is not to decouple the database from the MQ, but rather from the workers. As such, you can create another queue that receives completion notifications, and have another single worker that picks up the notifications and updates the database appropriately.
| 0 | 0 | 0 | 0 |
2011-10-18T04:41:00.000
| 1 | 1.2 | true | 7,802,504 | 0 | 0 | 1 | 1 |
I am building a web application that allows a user to upload an image. When the image is uploaded, it needs to be resized to one or more sizes, each of which needs to be sent to Amazon s3 for storage. Metadata and urls for each size of the image are stored in a single database record on the web server. I'm using a message queue to perform the resizing and uploading asynchronously (as there is potential for large images and multiple resizes per request). When the resize/upload task completes, the database record needs to be updated with the url.
My problem is that the worker executing the task will not have access to the database. I was thinking of firing off a http callback from the worker back to the web application after the task is complete with the appropriate information for updating the database record. Are there any other alternatives or reasons I should do this another way?
I'm using python/pylons for the web backend, mysql for the database and celery/amqp for messaging.
Thanks!
|
Bespoke CMS or 3rd Party?
| 7,804,591 | 0 | 1 | 591 | 0 |
php,python,zend-framework,content-management-system
|
Sounds like Symfony would be just what you're looking for - with the recent Symfony 2 release, it's also very easy and convenient to integrate additional libraries like Zend, so you can have the best of both worlds for any custom components.
That said, the studio I work for run all our CMS work as Zend apps, so we can fine tune the content management process as needed etc.
| 0 | 0 | 0 | 0 |
2011-10-18T08:35:00.000
| 2 | 0 | false | 7,804,468 | 0 | 0 | 1 | 1 |
I am planning a side project and I want to know your experiences with CMS builds. The project is a fairly straightforward CMS with no e-commerce functionality needed. I know I can build something like this using Zend Framework quite simply. As it is a side project I don't want to spending time doing the tedious stuff like building and styling the dashboard and I want to focus on doing the bits that are bespoke and important. So I am tempted to use a 3rd party CMS like Symphony or even going in the direction of TurboGears or Django as I have been looking for an excuse to get on with a Python build for ages.
My question is it best to 're-invent the wheel' using Zend Framework which could add an unnecessary overhead to development time, or go with the untried and untested (by me) and cut out the backend design. I like the second option but I am worried that the time taken learning a new platform could also add an unnecessary overhead. Both choices seem to have upsides and downsides.
Any advice, suggestions or personal experiences that can help me here?
|
Overwrite getter to act differently depending on where it was called in template o not. Django
| 7,816,060 | 0 | 0 | 71 | 0 |
python,django
|
No. It is not possible. You could write a custom template tag like {% divwrapper model.attr %} or you could write a model method like "html_dump_all_attrs" that returned something. But no, your solution won't work.
| 0 | 0 | 0 | 0 |
2011-10-18T14:13:00.000
| 1 | 1.2 | true | 7,808,650 | 0 | 0 | 1 | 1 |
Is it posible object to know if it getter called in template or not?
Check for same global variables or any ideas?
I wanna Moddel to give field attributes wrapped in div when it is called in template.
|
How do I convert a Django QuerySet into list of dicts?
| 54,346,385 | -2 | 170 | 211,404 | 0 |
python,django
|
Simply put list(yourQuerySet).
| 0 | 0 | 0 | 0 |
2011-10-18T17:52:00.000
| 11 | -0.036348 | false | 7,811,556 | 0 | 0 | 1 | 2 |
How can I convert a Django QuerySet into a list of dicts? I haven't found an answer to this so I'm wondering if I'm missing some sort of common helper function that everyone uses.
|
How do I convert a Django QuerySet into list of dicts?
| 69,901,744 | 0 | 170 | 211,404 | 0 |
python,django
|
If you already have a query set you just use the list function to turn it into a list of dicts, eg:
list(MyModel.objects.values())
| 0 | 0 | 0 | 0 |
2011-10-18T17:52:00.000
| 11 | 0 | false | 7,811,556 | 0 | 0 | 1 | 2 |
How can I convert a Django QuerySet into a list of dicts? I haven't found an answer to this so I'm wondering if I'm missing some sort of common helper function that everyone uses.
|
Exist a diference in use django-admin.py or manage.py
| 7,818,084 | 1 | 2 | 1,552 | 0 |
python,django
|
manage.py is a file that excists in a project environment and is created after starting a project. It's purpose is to control project commands. Django-admin.py is a script to start a project ( you can put it anyhwhere, or shortcut it via .bash or .profile )
| 0 | 0 | 0 | 0 |
2011-10-19T07:39:00.000
| 3 | 1.2 | true | 7,818,002 | 0 | 0 | 1 | 2 |
I'm learning something about Django.In some tutorials that i've read is used django-admin.py for execute commands like " syncdb, startapp and startproject", in the others tutorials is used manage.py, So exist any important diference between use django-admin.py or manage.py ?
|
Exist a diference in use django-admin.py or manage.py
| 7,818,099 | 1 | 2 | 1,552 | 0 |
python,django
|
manage.py is django-admin fitted in your project: it uses settings.py in your project dir
| 0 | 0 | 0 | 0 |
2011-10-19T07:39:00.000
| 3 | 0.066568 | false | 7,818,002 | 0 | 0 | 1 | 2 |
I'm learning something about Django.In some tutorials that i've read is used django-admin.py for execute commands like " syncdb, startapp and startproject", in the others tutorials is used manage.py, So exist any important diference between use django-admin.py or manage.py ?
|
Override specific admin css files in Django
| 7,820,620 | 0 | 3 | 3,643 | 0 |
python,css,django,django-admin
|
Probably you can hack your urls.py file and point only a single media URL to be served from a local folder while the others are served from the Django directory(in development mode).
| 0 | 0 | 0 | 0 |
2011-10-19T10:14:00.000
| 3 | 0 | false | 7,819,730 | 0 | 0 | 1 | 1 |
Overriding admin templates is as easy as creating a folder admin in your templates directory and copying whatever template files you'd like to override into it. I simply want to play with the admin style sheets however, so I made a folder admin in my static files folder and put css/base.css into it. Unlike the templates solution, this doesn't seem to work.
So is there any way to override individual css files for django.contrib.admin in the same way that you can override templates? If nay, what would be the best solution for overriding css files? I'm looking for a solution short of copying all the admin media files into my project and changing admin's static directory
|
Django i18n not working
| 7,830,439 | 2 | 5 | 3,330 | 0 |
python,django,internationalization
|
Django's LocaleMiddleware tries to determine the locale from the given request and replaces the LANGUAGE_CODE accordingly. It goes through the following steps:
Checks the session for a session variable called django_language. Set the language to the given locale in this session. If not existing it goes to 2.
Checks the cookies for a similar variable set (you can define the name yourself). It not existing it goes to 3.
Tries to determine the language from the HTTP_ACCEPT_LANGUAGE header. If not possible it will go to 4.
At last it will use the LANGUAGE_CODE setting as given locale.
In all steps except 4 it will check if the language is given in your LANGUAGES setting, which is a tuple of 2-tuples representing language code and language title. Make sure you set/overwrite the default, since the default would be a tuple of all available Django languages.
If you have multiple languages in your Django site:
Make sure your session or cookies are set correctly. You could use Django's internal view for setting the language (django.views.i18n.set_language).
If you got only one language:
If you only have Spanish you usually don't need to bother with this. Just make sure LANGUAGES and LANGUAGE_CODE is set. It will not attempt to set the pages language to your browsers language if it is not provided in LANGUAGES. Additionally you should make sure that USE_I18N = True. That should be the default though, so make at least sure you didn't set it to False somewhere.
| 0 | 0 | 0 | 0 |
2011-10-19T23:19:00.000
| 3 | 0.132549 | false | 7,829,384 | 0 | 0 | 1 | 2 |
I cannot get translations to show up for my templates. Here is what I have done:
In my template file (index.html), I have loaded i18n and used the trans tag where I want translations.
In my project directory, I rand ./manage.py makemessages -l es
My django.po file is in ./conf/locale/es/LC_MESSAGES/django.po
I edited this file with the translations.
I then ran ./manage.py compilemessages
I set my LANGUAGE_CODE to 'es' in settings.py
Added django.middleware.locale.LocaleMiddleware to MIDDLEWARE_CLASSES in between SessionMiddleware and CommonMiddleware.
Restarted Django, refreshed my page.
Only the english representations are still showing. What am I doing wrong here? Did I miss something?
|
Django i18n not working
| 7,838,833 | 0 | 5 | 3,330 | 0 |
python,django,internationalization
|
Ok, I found the problem... My po files were in ./conf/locale instead of just ./locale.
The reason I created ./conf/locale was because when I rand django-admin.py makemessages, it instructed me to do so. However, if it's in your local project directory, then it is just simply ./locale.
| 0 | 0 | 0 | 0 |
2011-10-19T23:19:00.000
| 3 | 1.2 | true | 7,829,384 | 0 | 0 | 1 | 2 |
I cannot get translations to show up for my templates. Here is what I have done:
In my template file (index.html), I have loaded i18n and used the trans tag where I want translations.
In my project directory, I rand ./manage.py makemessages -l es
My django.po file is in ./conf/locale/es/LC_MESSAGES/django.po
I edited this file with the translations.
I then ran ./manage.py compilemessages
I set my LANGUAGE_CODE to 'es' in settings.py
Added django.middleware.locale.LocaleMiddleware to MIDDLEWARE_CLASSES in between SessionMiddleware and CommonMiddleware.
Restarted Django, refreshed my page.
Only the english representations are still showing. What am I doing wrong here? Did I miss something?
|
fetch text from a web site and displaying it back
| 7,853,614 | 1 | 0 | 105 | 0 |
python,screen-scraping
|
I have something similiar to what you have, but you left out what my main question revolves around. I looked at htmlparser and bs, but I am unsure how to do something like if($posttext == gold) echo "gold in so and so".. seems like bs deals a lot with tags..i suppose since facebook posts can use a variety of tags, how would i go about doing just a search on the text and to return the 'post' ??
| 0 | 0 | 1 | 0 |
2011-10-20T00:21:00.000
| 2 | 0.099668 | false | 7,829,768 | 0 | 0 | 1 | 1 |
Currently, there's a game that has different groups, and you can play for a prize 'gold' every hour. Sometimes there is gold, sometimes there isn't. It is posted on facebook every hour ''gold in group2" or "gold in group6'', and other times there isn't a post due to no gold being a prize for that hour. I want to write a small script that will check the site hourly and grab the result (if there is gold or not, and what group) and display it back to me. I was wanting to write it in python as I'm learning it. Would this be the best language to use? And how would I go about doing this? All I can really find is information on extracting links. I don't want to extract links, just the text. Thanks for any and all help. I appreciate it.
|
Django: Does unique_together imply db_index=True in the same way that ForeignKey does?
| 7,834,946 | 14 | 29 | 9,904 | 0 |
python,django,django-models,database-indexes
|
If unique_together does add an index, it will be a multiple column index.
If you want one of the columns to be indexed individually, I believe you need to specify db_index=True in the field definition.
| 0 | 0 | 0 | 0 |
2011-10-20T01:17:00.000
| 5 | 1 | false | 7,830,091 | 0 | 0 | 1 | 1 |
A field on a model, foo = models.ForeignKey(Foo) will automatically add a database index for the column, in order to make look-ups faster. That's good and well, but Django's docs don't state whether the fields in a model-meta's unique_together receive the same treatment. I happen to have a model in which one char field which is listed in unique_together requires an index for quick lookups. I know that it won't hurt anything to add a duplicate db_index=True in the field definition, but I'm curious.
|
how to synchronize data between two connects
| 7,841,692 | 0 | 0 | 58 | 0 |
javascript,python,ajax
|
Thanks Prusse,It works now - I have increased time limit from 1 to 200 on function queue(s)
| 0 | 0 | 0 | 0 |
2011-10-20T15:31:00.000
| 1 | 1.2 | true | 7,838,401 | 0 | 0 | 1 | 1 |
I'm using a python tool called "Ajaxterm"(http://wiki.kartbuilding.net/index.php/Ajaxterm). After setting it up. The problem , I face is,when type few chars - they appear as jumbled character.For example,When i type "abcde" it may come as "cdbea" - but no character missing. From my understanding - I tried to debug the python code,it seems like ajaxterm internal server (qweb - QWebRequest Request Handler) processes the request it.There seems to be nothing wrong with it.
The problem is (I assume) - From .js file (javascript) to ajaxterm.py , for every character i type a connect() is initiated and thus characters typed later may be arriving sooner than the previously typed character.
How should I make sure,character appear in the order it was typed.
(The problem is does (mostly) happen only when network is slow)
Thanks for any help.
|
Can I deploy a django app which uses sqlite3 as backend on google app engine?
| 7,838,935 | 5 | 3 | 582 | 1 |
python,django,google-app-engine,web-applications,sqlite
|
Unfortunately, no you can't. Google App Engine does not allow you to write files, and that is needed by SQLite.
Until recently, it had no support of SQL at all, preferring a home-grown solution (see the "CAP theorem" as for why). This motivated the creation of projects like "Django-nonrel" which is a version of Django that does not require a relational database.
Recently, they opened a beta service that proposes a MySQL database. But beware that it is fundamentally less reliable, and that it is probably going to be expensive.
EDIT: As Nick Johnson observed, this new service (Google Cloud SQL) is fundamentally less scalable, but not fundamentally less reliable.
| 0 | 1 | 0 | 0 |
2011-10-20T15:52:00.000
| 1 | 0.761594 | false | 7,838,667 | 0 | 0 | 1 | 1 |
I created a simple bookmarking app using django which uses sqlite3 as the database backend.
Can I upload it to appengine and use it? What is "Django-nonrel"?
|
How to use datastore id instead of key_name?
| 7,855,122 | 2 | 0 | 147 | 0 |
python,google-app-engine,google-cloud-datastore
|
get_by__id()
no change; it's still a key whether it has an ID or a name
key().id()
| 0 | 0 | 0 | 0 |
2011-10-21T20:46:00.000
| 1 | 1.2 | true | 7,855,099 | 0 | 0 | 1 | 1 |
How to define that?
What should be used instead of
get_by_key_name
SELECT __key__
key().name()
|
RFID + Android --> where do I start?
| 7,858,130 | 1 | 1 | 1,251 | 0 |
java,android,python,rfid
|
Buy a Nexus-S, buy some tags.
Then take a look at the code of the 'Tags' application that comes with android. Play with it, modify it. Write some tags with your own application.
Learn what Ndef is and how you craft your own messages/records. Learn how to use the transceive function to do direct communication to the tags. This will open up a world on it's own (aka you can write-protect tags that are not write protectable by Android itself etc).
All in all that can be done in two weeks. The Android NFC/RFID subsystem is easy to use. Most of the the hard stuff is hidden from you.
Afterwards write your own little application, show it to advertising agencies that do Android apps and get a high payed job. NFC experience is highly sought after at the moment.
| 0 | 0 | 1 | 0 |
2011-10-22T07:00:00.000
| 1 | 1.2 | true | 7,857,940 | 0 | 0 | 1 | 1 |
I've heard that the Google Nexus S has RFID capabilities. I'd like to start learning about RFID and programmatically doing things. Where should I start? Good tutorials or code examples are what I'm after. (or hardware if it's not Android I suppose).
Doesn't have to be Android, could be python or java libraries as well. Preference for Android.
I see this as the future, and I want to get in on it :)
|
Parse and interact with obfuscated javascript
| 7,860,906 | 1 | 1 | 754 | 0 |
python,screen-scraping,mechanize,web-scraping,deobfuscation
|
Rather than trying to process the page, how about just use Firebug to figure out the names of the form fields, and then use httplib or whatever to send a request with the necessary fields and settings?
If it's sent using ajax, you should be able to determine the values being sent to the server in Firebug as well.
| 0 | 0 | 0 | 1 |
2011-10-22T09:25:00.000
| 1 | 0.197375 | false | 7,858,552 | 0 | 0 | 1 | 1 |
I'm trying to interact with a HTML 4.0 website which uses heavily obfuscated javascript to hide the regular HTML elements. What I want to do is to fill out a form and read the returned results, and this is proving harder to do than expected.
When I read the page using Firebug, it gave me the source code deobfuscated, and I can then use this to do what I want to accomplish. The Firebug output showed all the regular elements of a website, such as -tags and the like, which were hidden in the original source.
I've written the rest of my application in Python, using mechanize to interact with other web services, so I'd rather use an existing Python module to do this if that's possible. The problem is not only how to read the source code in a way mechanize can understand, but also how to generate the response which the web server can interpret. Could I use regular mechanize controls even though the html code is obfuscated?
In the beginning of my project I used pywebkitgtk instead of mechanize, but ditched it because it wasn't really implemented that well in python. Most functions are missing. Would that be a sensible method perhaps, to start up a webkit-browser which I read the HTML from, and use that with mechanize?
Any help would be greatly appreciated, I'm really in a bind here. Thanks!
Edit: I tried dumping the HTML fetched from mechanize and opening that with pywebkitgtk, using load_html_string, and then evaluating the html that way. Unfortunately, since the document I'm trying to parse loads more resources dynamically, that scripts just stops waiting for resources to be loaded. Note that I can't use webkit to load the document itself since I use mechanize's CookieJar function to allow me to log in first.
I also tried dumping the HTML from webkit, which for some reason dumped the obfuscated javascript only, while displaying the website perfectly fine. If webkit could dump the deobfuscated javascript the way Firebug does, I could work with that and form a request according to the clean code..
|
Mongo DB or Couch DB with django for building an app that is similar to top coder?
| 10,204,764 | 3 | 3 | 2,560 | 1 |
python,django,mongodb,couchdb
|
I've used mongo-engine with Django but you need to create a file specifically for Mongo documents eg. Mongo_models.py. In that file you define your Mongo documents. You then create forms to match each Mongo document. Each form has a save method which inserts or updates whats stored in Mongo. Django forms are designed to plug into any data back end ( with a bit of craft ).
If you go this route you can dodge Django non-rel which is still not part of Django 1.4. In addition I believe django-nonrel is on hiatus right now.
I've used both CouchDB and Mongo extensively. CouchDB has a lovely interface. My colleague is working on something similar for Mongo. Mongo's map and reduce are far faster than CouchDB. Mongo is more responsive loading and retrieving data. The python libraries for Mongo are easier to get working with ( both pymongo and mongo-engine are excellent )
Be sure you read the Mongo production recommendations! Do not run one instance on the same node as Django or prepare to be savagely burned when traffic peaks. Mondo works great with Memcache/Redis where one can store reduced data for rapid lookups.
BEWARE: If you have very well defined and structured data that can be described in documents or models then don't use Mongo. Its not designed for that and something like PostGreSQL will work much better.
I use PostGreSQL for relational or well structured data because its good for that. Small memory footprint and good response.
I use Redis to cache or operate in memory queues/lists because its very good for that. great performance providing you have the memory to cope with it.
I use Mongo to store large JSON documents and to perform Map and reduce on them ( if needed ) because its very good for that. Be sure to use indexing on certain columns if you can to speed up lookups.
Don't use a circle to fill a square hole. It won't fill it.
| 0 | 0 | 0 | 0 |
2011-10-22T13:09:00.000
| 3 | 0.197375 | false | 7,859,775 | 0 | 0 | 1 | 1 |
This is what I have :-
Ubuntu 11.10.
Django 1.3
Python 2.7
What I want to do is build an app that is similar to top-coder and I have the skeletal version of the app sketched out. The basic requirements would be:-
1. Saving the code.
2. Saving the user name and ranks.(User-profile)
3. Should allow a teacher to create multiple choice questions too.( Similar to Google docs).
I have basic knowledge of Django and have built couple of (basic) apps before. Rather than building an online tool, is it possible to build something very similar to conf2py that sits on top of web2py, in Django.
Lets call this small project examPy( I know, very original), is it possible to build an app that acts more a plug-in to Django or is my concept of Django absolutely wrong?
The primary question being:
As I want to learn a new DB and have worked on postgres in Django, should I chose CouchDB or MongoDB for Django?
Answers can be explanations or links to certain documentations or blogs that can tell me the pros and cons.
|
To use unicode or not in web development project using flask and sqlalchemy
| 7,860,959 | 2 | 2 | 293 | 0 |
unicode,python-3.x,flask-sqlalchemy
|
No, but make sure you separate binary data from text data. That makes it easier to port.
It's easier to use Unicode from the start, but of course you can postpone it. But it's really not very difficult.
You replace everything that should be text data with Unicode, yes.
Only of you make loads of conversions of really massive amounts of text.
| 0 | 0 | 0 | 0 |
2011-10-22T15:43:00.000
| 1 | 1.2 | true | 7,860,643 | 0 | 0 | 1 | 1 |
I am working on a web development project using flask and sqlalchemy orm. My post is related to use of unicode in developing this app.
What I have understood till now about unicode :
If I want my webapp to handle data in languages other than English I need to use unicode data type for my variables. Because string variables can't handle unicode data.
I use some database which stores unicode data or take responsibility to convert unicode to raw while saving and vice versa while retrieving. Sqlalchemy gives me option to set automatic conversion both ways, so that I dont have to worry about them.
I am using python2.7 so I have to be aware of processing unicode data properly. Normal string operations on unicode data maybe buggy.
Correct me if any of the above assumption is wrong.
Now my doubts or questions :
If I dont use unicodes now then will I have some problems if I or flask people decide to port to python3?
I dont want to hassle with the thought of my webapp catering to different languages right now. I just want to concentrate on first creating the app. Can I do that later without using unicode right now?
If I use unicode now then how it affects my code. Do I replace every string input and output with unicode or what?
Conversion of unicode when saving to database, Can it be source of performance problems?
Basically I am asking whether to use unicode or not with explaining my needs and requirement out of the project.
|
Why don't processes die after page load? - Django
| 7,869,753 | 2 | 0 | 100 | 0 |
python,django,memory,garbage-collection
|
mod_wsgi keeps loaded python process in memory to speed up any further requests. That is absolutely normal/
| 0 | 0 | 0 | 0 |
2011-10-23T22:15:00.000
| 1 | 0.379949 | false | 7,869,624 | 0 | 0 | 1 | 1 |
It seems logical to me that processes should die and memory be cleared after the python scripts have run and the HTTP response has been sent.
however It seems I have four processes running, one of which is using over 100MB of memory.
It seems like way too much for what I am doing. Is there some garbage collector settings I need to configure or something?
|
Dealing with timezones for sending sms -python /django
| 7,871,122 | 0 | 0 | 125 | 0 |
python
|
You probably want to store each user's timezone in your database and then you can change a particular datetime object's timezone by using datetime.astimezone(tz) .
Now deciding what a good time to to sms them is entirely up to you.
| 0 | 0 | 0 | 1 |
2011-10-24T03:10:00.000
| 1 | 0 | false | 7,870,966 | 0 | 0 | 1 | 1 |
I need to send sms globally to different timezones to each customer registered online
The messages are scheduled to be send each month.
I have the country details of each cutomer . I would be writing a python script and add it to cronjobs for sending sms.
The issue I am facing is knowing a safe time ( sometime during the day) based on the country for sending the SMS.
MY server runs in Australian/Melbourne timezone.What is the best way for me to find the safe time to send SMS to a customer from another country
|
Warning while saving opportunity in OpenERP
| 23,337,385 | 0 | 1 | 1,027 | 0 |
python,openerp
|
same problem here.I'm using Multi-company, I provid all permistion to the user
| 0 | 0 | 0 | 0 |
2011-10-24T11:14:00.000
| 3 | 0 | false | 7,874,752 | 0 | 0 | 1 | 2 |
After creating an opportunity, when I click on save, it gives me this warning for some users:
"Operation prohibited by access rules, or performed on an already deleted document (Operation: read, Document type: User Modification)."
What's causing this problem?
Update: I have created a new user of admin type and I added these groups:
Sales/User,Sales/User All Leads,Survey/User,Tools/User. It gives me a warning while creating an opportunity.
I added the following groups to the new user and it's working fine: Employee, PartnerManager, Marketing/User, Accounting/Accountant, Accounting/Invoice, Accounting/Manager, Administration/Access Rights, Human Resource/Manager, Human Resource/User, Knowledge/User, Marketing/Manager, Project/Manager, Sales/Manager, Tools/Manager, trimax/AdminMeeting, Trimax/SalesExecutive, Trimax/Vertical, Trimax/SalesHead, Trimax/SalesManager, Useability/AnalyticAccounting, Useability/Extended, View, Useability/MultiCompanies, Useability/No One, Useability/Product Uos View, Useability/Product Variant, Warehouse/Manager, Warehouse/User, Tools/User, Administration/Configuration
But in already created user if I remove the above groups which give warning ,then also it shows same warning.
The solution I mentioned above was for new users,but for some existing users it was still giving problem. So I removed some unwanted groups, which I didn't needed for those users and it worked, now it does not show warning. Was the warning due to some access right overlap or something else?
|
Warning while saving opportunity in OpenERP
| 19,397,247 | 0 | 1 | 1,027 | 0 |
python,openerp
|
Hi these is due to the access right problem .So you give the proper access right to your user(for creating the oppurtunity)
| 0 | 0 | 0 | 0 |
2011-10-24T11:14:00.000
| 3 | 0 | false | 7,874,752 | 0 | 0 | 1 | 2 |
After creating an opportunity, when I click on save, it gives me this warning for some users:
"Operation prohibited by access rules, or performed on an already deleted document (Operation: read, Document type: User Modification)."
What's causing this problem?
Update: I have created a new user of admin type and I added these groups:
Sales/User,Sales/User All Leads,Survey/User,Tools/User. It gives me a warning while creating an opportunity.
I added the following groups to the new user and it's working fine: Employee, PartnerManager, Marketing/User, Accounting/Accountant, Accounting/Invoice, Accounting/Manager, Administration/Access Rights, Human Resource/Manager, Human Resource/User, Knowledge/User, Marketing/Manager, Project/Manager, Sales/Manager, Tools/Manager, trimax/AdminMeeting, Trimax/SalesExecutive, Trimax/Vertical, Trimax/SalesHead, Trimax/SalesManager, Useability/AnalyticAccounting, Useability/Extended, View, Useability/MultiCompanies, Useability/No One, Useability/Product Uos View, Useability/Product Variant, Warehouse/Manager, Warehouse/User, Tools/User, Administration/Configuration
But in already created user if I remove the above groups which give warning ,then also it shows same warning.
The solution I mentioned above was for new users,but for some existing users it was still giving problem. So I removed some unwanted groups, which I didn't needed for those users and it worked, now it does not show warning. Was the warning due to some access right overlap or something else?
|
How do I exclude South migrations from Pylint?
| 68,687,946 | 0 | 14 | 3,484 | 0 |
python,django,django-south,pylint
|
The anser here didn't work for me, the ignore list doesn't work on directories.
I had to add
ignore-paths=.*/migrations
| 0 | 0 | 0 | 0 |
2011-10-24T18:36:00.000
| 4 | 0 | false | 7,880,180 | 0 | 0 | 1 | 1 |
I'm using South for migration in my Django project. When I run Pylint on my project I get a bunch of errors from the migration files. How can I exclude migration files from Pylint?
I'm on a Windows system so I can't use filename exclusions in the Pylint options. I've tried to resort to adding # pylint: disable-msg-cat=WCREFI to the top of each of my migration files. It seems very kludgy and seems to be the last resort but this documented directive doesn't work and I get the error [E] Unrecognized file option 'disable-msg-cat'.
|
deploying a WSGI application on mod_python
| 7,881,775 | 1 | 5 | 1,117 | 0 |
python,mod-wsgi,mod-python,mod-fastcgi
|
The best solution might be to use mod_proxy and run the Python web app in a different webserver.
| 0 | 0 | 0 | 1 |
2011-10-24T20:19:00.000
| 4 | 0.049958 | false | 7,881,474 | 0 | 0 | 1 | 1 |
I wrote a WSGI application which I need to deploy to a server, however I've been given a server that already has mod_python installed.
I am not allowed to remove mod_python since there are some mod_python applications running on it already.
One option I considered was installing mod_wsgi alongside mod_python, however I went through sources and found that was a bad idea. Apparently mod_wsgi and mod_python don't mix well.
Another option I considered was installing mod_fastcgi and deploying it using fastcgi.
I would love to hear if someone has a better idea which doesn't break the current mod_python applications running on the server.
|
Django Admin: let people test a regexp?
| 7,883,376 | 1 | 1 | 66 | 0 |
python,django,user-interface,django-admin
|
My guess is that it would be easiest to do this as a javascript widget--it'll be easier to wedge into the admin and there's tons of examples to work off of.
Daring to venture slightly off of the question though, I'll say I'd be pretty nervous trying to write regexes to parse human-generated responses of any complexity, particularly if the mode of submission will be text messages or other smartphone text. My guess is that typos will ruin your day (though obviously I don't know what kind of data you are collecting).
| 0 | 0 | 0 | 0 |
2011-10-24T21:52:00.000
| 1 | 1.2 | true | 7,882,442 | 0 | 0 | 1 | 1 |
I'm building a Django app that will let researchers send text messages to study participants and parse the responses. While parsing, say, 'Y/N' and numbers is going to be pretty easy, we'll need to send messages that need more complex responses. Which, I think, means regular expressions.
All this is easy enough; the thing I want to do, however, is let researchers test their regex to see what it does to various responses. So, I'd have a text box with a regex, a text box with a test response, and a button to see what happens.
If I were just building an app, this would again be easy -- is there a way to do this within the confines of the Django admin app?
|
What programming language features are well suited for developing a live coding framework?
| 7,898,079 | 4 | 13 | 1,317 | 0 |
python,ruby,clojure,lua,livecoding
|
The only thing that’s necessary to make this work is a form of dynamic binding, e.g., message passing in Erlang or eval in many other languages.
If you have dynamic binding, then you can change the target of a message without affecting the message, or a message without affecting the target—provided that a target is defined when you try to send a message to it, and a message is defined for the targets to which you send it, when you send it.
When changing a target, all you have to do is serve messages to the previous version until the new version is in place, then do a small locked update to transition to the new version. Similarly, when changing a message, you just serve the old version till the new one is available.
Readily hot-swappable code must still be designed as such, however—the application must be modular enough that replacing the implementation of a component does not cause an interruption, and that can only come from careful programming.
| 1 | 0 | 0 | 0 |
2011-10-25T02:20:00.000
| 8 | 0.099668 | false | 7,884,010 | 0 | 0 | 1 | 3 |
I would like to build a "live coding framework".
I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding.
Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. If you want to modify your application you must repeat this process. A live coding framework enables code to be updated while the application is running and reloaded on demand. Perhaps this reloading happens each time a file containing code is changed or by some other action. Changes in the code are then reflected in the application as it is running. There is no need to close the program and to recompile and relaunch it.
In this case, the application is a windowed app that has an update/draw loop, is most likely using OpenGL for graphics, an audio library for sound processing ( SuperCollider? ) and ideally a networking lib.
Of course I have preferred languages, though I'm not certain that any of them would be well suited for this kind of architecture. Ideally I would use Python, Lua, Ruby or another higher level language. However, a friend recently suggested Clojure as a possibility, so I am considering it as well.
I would like to know not only what languages would be suitable for this kind of framework but, generally, what language features would make a framework such as this possible.
|
What programming language features are well suited for developing a live coding framework?
| 36,677,720 | 2 | 13 | 1,317 | 0 |
python,ruby,clojure,lua,livecoding
|
Smalltalk is probably the best bet for this. As unlike the others, it has a whole IDE for live coding, not just a REPL
| 1 | 0 | 0 | 0 |
2011-10-25T02:20:00.000
| 8 | 0.049958 | false | 7,884,010 | 0 | 0 | 1 | 3 |
I would like to build a "live coding framework".
I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding.
Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. If you want to modify your application you must repeat this process. A live coding framework enables code to be updated while the application is running and reloaded on demand. Perhaps this reloading happens each time a file containing code is changed or by some other action. Changes in the code are then reflected in the application as it is running. There is no need to close the program and to recompile and relaunch it.
In this case, the application is a windowed app that has an update/draw loop, is most likely using OpenGL for graphics, an audio library for sound processing ( SuperCollider? ) and ideally a networking lib.
Of course I have preferred languages, though I'm not certain that any of them would be well suited for this kind of architecture. Ideally I would use Python, Lua, Ruby or another higher level language. However, a friend recently suggested Clojure as a possibility, so I am considering it as well.
I would like to know not only what languages would be suitable for this kind of framework but, generally, what language features would make a framework such as this possible.
|
What programming language features are well suited for developing a live coding framework?
| 7,897,130 | 1 | 13 | 1,317 | 0 |
python,ruby,clojure,lua,livecoding
|
Tcl has such a thing already. For example, you can write a gui program that creates a separate window that has an interactive prompt. From there you can reload your code, type in new code, etc.
You can do this with any gui toolkit, though some will be much harder than others. It should be easy with python, though the indentation thing -- IMHO -- makes interactive use challenging. I'm reasonably certain most other dynamic languages can do this without too much trouble.
Look at it this way: if your toolkit lets you open more than one window, there's no reason why one of those windows can't be an interactive prompt. All you need is the ability to open a window, and some sort of "eval" command that runs code fed to it as a string.
| 1 | 0 | 0 | 0 |
2011-10-25T02:20:00.000
| 8 | 0.024995 | false | 7,884,010 | 0 | 0 | 1 | 3 |
I would like to build a "live coding framework".
I should explain what is meant by "live coding framework". I'll do so by comparing live coding to traditional coding.
Generally put, in traditional programming you write code, sometimes compile it, then launch an executable or open a script in some sort of interpreter. If you want to modify your application you must repeat this process. A live coding framework enables code to be updated while the application is running and reloaded on demand. Perhaps this reloading happens each time a file containing code is changed or by some other action. Changes in the code are then reflected in the application as it is running. There is no need to close the program and to recompile and relaunch it.
In this case, the application is a windowed app that has an update/draw loop, is most likely using OpenGL for graphics, an audio library for sound processing ( SuperCollider? ) and ideally a networking lib.
Of course I have preferred languages, though I'm not certain that any of them would be well suited for this kind of architecture. Ideally I would use Python, Lua, Ruby or another higher level language. However, a friend recently suggested Clojure as a possibility, so I am considering it as well.
I would like to know not only what languages would be suitable for this kind of framework but, generally, what language features would make a framework such as this possible.
|
plone 4.1 - plone.app.caching issue - unable to reduce http requests
| 7,888,725 | 1 | 2 | 181 | 0 |
python,caching,plone
|
Firebug shows all resource responses, including those taken from the browser cache. The way to differentiate between the two is the colour of the entry; black means it required network access (e.g. the browser asked the server), gray is a cached response.
In other words, just because you see resources listed in Firebug, does not mean Firefox actually asked the server.
The Cache-Control and Expires otherwise look correct, your browser should be caching these results.
| 0 | 0 | 0 | 0 |
2011-10-25T10:10:00.000
| 1 | 1.2 | true | 7,887,707 | 0 | 0 | 1 | 1 |
Problem: I'd like to reduce the number of http request just by caching in browser some resources.
I've succesfully configured plone.app.caching in plone4.1 (without caching proxy), and no debug/develop mode (css, js, kss) is active.
I'm getting correct "X-Cache-Operation" headers in responses, but the number of http requests does not change (in firebug and instance logs I see status "200" for every resource, even for those with strongCaching option).
Here's a sample response for a png image with strongCaching option:
Server Zope/(2.13.8, python 2.6.6, linux2) ZServer/1.1
Date Tue, 25 Oct 2011 10:06:20 GMT
Content-Length 3676
X-Cache-Operation plone.app.caching.strongCaching
Expires Tue, 01 Nov 2011 11:06:20 GMT
Last-Modified Thu, 11 Aug 2011 15:13:14 GMT
Cache-Control max-age=604800, proxy-revalidate, public
X-Cache-Rule plone.resource
Content-Type image/png
Any ideas?
Thank you
|
django smart decimal field
| 7,891,949 | 3 | 1 | 1,215 | 0 |
python,django,django-models
|
TBH for a shoe size field I'd probably use a CharField with choices attribute - there are a relatively small number of valid shoe sizes and that way you can format them how you want to.
If it's part of a Product model that may contain things other than shoes, a CharField for 'size' is useful because you can also store values like 'M', 'L', 'XXL' etc.
You won't need to do any math on the shoe sizes so there's no point to using a DecimalField.
For that reason it doesn't really matter what is saved in the db, only what you display and @j_syk had a couple of good alternative suggestions along those lines in the comments.
| 0 | 0 | 0 | 0 |
2011-10-25T14:25:00.000
| 3 | 1.2 | true | 7,890,810 | 0 | 0 | 1 | 1 |
I am creating an app that basically stores shoe sizes, along with other information. I have been using the Django Decimal field to store the sizes, however the decimal field stores sizes like 10 as 10.0, so my question is, is there a way to make or if already exists a field that when provided an int ( 10 ) it stores the value as int and when provided a decimal
( 10.5 ) then stores it as decimal ?
|
Run python script (with numpy dependency) from java
| 7,892,106 | 3 | 1 | 2,255 | 0 |
java,python,numpy,jython
|
If you're using Numpy you probably have to just use C Python, as it's a compiled extension. I'd recommend saving the image to disk, perhaps as a temporary file, and then calling the Python as a subprocess. If you're dealing with binary data you could even try memory mapping the data in Java and passing in in the path to the subprocess.
Alternatively, depending on your circumstances, you could set up a simple data processing server in Python which accepts requests and returns processed data.
| 0 | 0 | 0 | 0 |
2011-10-25T15:19:00.000
| 3 | 1.2 | true | 7,891,586 | 0 | 1 | 1 | 1 |
In a java application I need to use a specific image processing algorithm that is currently implemented in python.
What would be the best approach, knowing that this script uses the Numpy library ?
I alreayd tried to compile the script to java using the jythonc compiler but it seems that it doesn't support dependencies on native libraries like Numpy.
I also tried to use Jepp but I get an ImportError when importing Numpy, too.
Any suggestion ?
|
Will a website recover from a Denial of Service attack on its own?
| 7,909,570 | 0 | 2 | 702 | 0 |
python,django,dos,recover
|
You should stop your screen-scraping software if you have not already.
Depending on what part of the system is down (Either the database, the server, the network or all), there is a chance it will recover by itself when the loads come back down.
If your application cannot sustain 250 simultaneous connections, you will want to investigate why. The culprit is usually database load (no indexes, un-optimized queries).
Linode could also have restrictions in place to limit how much bandwidth can be used within a certain period of time. You should probably contact them (or whoever is in charge).
| 0 | 0 | 0 | 0 |
2011-10-26T22:08:00.000
| 2 | 0 | false | 7,909,527 | 0 | 0 | 1 | 2 |
I'm in a rather peculiar situation right now. To make a long story short, I'm part of a (real life) volunteer organization of about 2000 members. Our current website was built and maintained by a member who is no longer part of the organization (he quit). Unfortunately, he was the only one that actually had access to the server, and hasn't been cooperative in handing over the reigns to someone else after he left. As a result, myself and a small team of people have been working on creating a new website for ourselves from scratch. The data on the original website would be awesome to have for the new one, so without direct access to the database we have been screen-scraping what we need.
Which brings me to my current conundrum. The screen-scraping script I was using was being really slow, so I had the brilliant (not) idea of parallelizing it. I assumed the bottleneck was caused by my slow internet, so I foolishly decided to run 250 threads at once. After I tried that, the web server mysteriously went down and hasn't gone up since (it's been about 30 minutes now).
I'm not any kind of hacker or security expert, but I'm pretty sure I just accidentally caused a Denial of Service attack on the server. Which brings me to my question - assuming the owner of the website does nothing to help us, will the server come back to life of its own accord? (it's being hosted by Django on Linode if that matters). How do websites typically recover from DoS attacks? Have I potentially misdiagnosed what's going on, and could there be an alternative explanation? Or is the website lost forever?
Edit: All 250 of the requests were simple http requests going to pages within the Django admin panel if that changes anything.
|
Will a website recover from a Denial of Service attack on its own?
| 7,909,619 | 1 | 2 | 702 | 0 |
python,django,dos,recover
|
More than likely the system is not truly down for good, unless the guy might have gotten pissed or the hosting provider, etc disabled it due to the traffic load. But there are a number of things to think of. But 250 connections isn't that much load, even for a shared hosting account, unless you were just flooding the server with requests.
Depending on what technology is used, there are a number of things that "could" have happened.
You could have simply hit throttling limits on the webserver side for queuing, etc, that might need the application to restart. This could be automatic after a period of time or need intervention from the hosting provider.
You could have overloaded the application and had it use too much memory where it was forcefully shut down. Some hosting providers will do this, but typiclaly provider for small windows of time and will allow the application to start back up. (Give it an hour or so)
You could have pushed it over the monthly limit for bandwidth, in that case, it could be down until the next billing cycle...
WIthout knowing the hosting provider or environment these are just guesses.
I would strongly recommend though turning off your scraper!
| 0 | 0 | 0 | 0 |
2011-10-26T22:08:00.000
| 2 | 1.2 | true | 7,909,527 | 0 | 0 | 1 | 2 |
I'm in a rather peculiar situation right now. To make a long story short, I'm part of a (real life) volunteer organization of about 2000 members. Our current website was built and maintained by a member who is no longer part of the organization (he quit). Unfortunately, he was the only one that actually had access to the server, and hasn't been cooperative in handing over the reigns to someone else after he left. As a result, myself and a small team of people have been working on creating a new website for ourselves from scratch. The data on the original website would be awesome to have for the new one, so without direct access to the database we have been screen-scraping what we need.
Which brings me to my current conundrum. The screen-scraping script I was using was being really slow, so I had the brilliant (not) idea of parallelizing it. I assumed the bottleneck was caused by my slow internet, so I foolishly decided to run 250 threads at once. After I tried that, the web server mysteriously went down and hasn't gone up since (it's been about 30 minutes now).
I'm not any kind of hacker or security expert, but I'm pretty sure I just accidentally caused a Denial of Service attack on the server. Which brings me to my question - assuming the owner of the website does nothing to help us, will the server come back to life of its own accord? (it's being hosted by Django on Linode if that matters). How do websites typically recover from DoS attacks? Have I potentially misdiagnosed what's going on, and could there be an alternative explanation? Or is the website lost forever?
Edit: All 250 of the requests were simple http requests going to pages within the Django admin panel if that changes anything.
|
How do I find the number of visitors to my web hosted django application?
| 7,912,158 | 1 | 0 | 307 | 0 |
python,django,web-applications,ubuntu
|
How about using some free statistics provider like Statcounter or Google Analytics?
| 0 | 0 | 0 | 0 |
2011-10-27T05:50:00.000
| 4 | 0.049958 | false | 7,912,140 | 0 | 0 | 1 | 2 |
I have a django application hosted on a server running on Apache + Ubuntu. I deployed the application using mod_wsgi. Is there any way to find out the number of visitors to my web site.
I realize that this query might have little to do with django and more do with the server. Any help would be appreciated.
|
How do I find the number of visitors to my web hosted django application?
| 7,912,159 | 1 | 0 | 307 | 0 |
python,django,web-applications,ubuntu
|
Why not just use Google Analytics? You can easily monitor user behavior, traffic source, time spend on each page, etc.
If you really want to do this with Django you could write a context processor to record each request, but then you would have to write the user's IP and check if the user has not visited before and this would be incredibly imprecise since there might be different users sharing the same IP, etc.
| 0 | 0 | 0 | 0 |
2011-10-27T05:50:00.000
| 4 | 1.2 | true | 7,912,140 | 0 | 0 | 1 | 2 |
I have a django application hosted on a server running on Apache + Ubuntu. I deployed the application using mod_wsgi. Is there any way to find out the number of visitors to my web site.
I realize that this query might have little to do with django and more do with the server. Any help would be appreciated.
|
Turbogears2: analog of django context processors
| 9,769,018 | 4 | 0 | 198 | 0 |
python,django,turbogears,genshi
|
You have three possible solutions to achieve this.
First you can use tg.tmpl_context which is available inside every template as tmpl_context.
You can fill the variables inside the BaseController.__call__ so that they are available everywhere.
Another approach is to register base_config.variable_provider inside app_cfg.py which must be a function that returns a dictionary of variables that will be available inside any template. Those variables will be overridden from the controller returned ones if there is a name collision, so it is a good way to provide defaults for controller returned variables.
Otherwise in recent versions it is also possible to register the before_render hook systemwide using base_config.register_hook inside app_cfg.py the callback can append and override any template parameter.
| 0 | 0 | 0 | 0 |
2011-10-27T09:25:00.000
| 2 | 1.2 | true | 7,913,999 | 0 | 0 | 1 | 1 |
Is there any analog of django context processors in turbogears2?
In tg1 was stdvars, but not in tg2 anymore.
Explaining:
I need to have some template tags, avaible on each page, without obvious declaring in each controller.
|
PDF scraping using R
| 7,918,885 | 11 | 10 | 4,014 | 0 |
python,r,pdf,screen-scraping
|
Extracting text from PDFs is hard, and nearly always requires lots of care.
I'd start with the command line tools such as pdftotext and see what they spit out. The problem is that PDFs can store the text in any order, can use awkward font encodings, and can do things like use ligature characters (the joined up 'ff' and 'ij' that you see in proper typesetting) to throw you.
pdftotext is installable on any Linux system...
| 0 | 0 | 1 | 0 |
2011-10-27T15:54:00.000
| 4 | 1.2 | true | 7,918,718 | 0 | 0 | 1 | 1 |
I have been using the XML package successfully for extracting HTML tables but want to extend to PDF's. From previous questions it does not appear that there is a simple R solution but wondered if there had been any recent developments
Failing that, is there some way in Python (in which I am a complete Novice) to obtain
and manipulate pdfs so that I could finish the job off with the R XML package
|
Deciding to WSGI or Django for new web app
| 7,925,410 | 0 | 4 | 213 | 0 |
python,django,wsgi,django-wsgi
|
I've worked a bit with some django "apps" ,its really easy, but setting up the "apps" can be a bit of a long process. Django has a lot of nice features that you won't be using and I agree that you might be on one "extreme" here.
| 0 | 0 | 0 | 0 |
2011-10-27T17:34:00.000
| 3 | 0 | false | 7,919,968 | 0 | 0 | 1 | 1 |
I'm in the process of setting up a new web app and deciding whether to just do it with WSGI or go the full framework route with Django.
The app's foremost requirements:
1) The app has no UI what so ever and all of the data is exposed to clients via a REST api with JSON.
2) It will have data to persist so MongoDB & probably Amazon's SimpleDB will be used for the database side.
Is there a reason to use Django or can I get marginal speed improvement with WSGI only?
Previous server-side apps I've built were either with Java/Struts and Groovy/Grails on the JVM. My understanding is that Django is an MVC framework similar to Rails and Grails.
I've also played around with Google App Engine which uses WSGI as thin layer above your code for managing and routing requests.
|
Pre-fill a form with attached file taken from some URL in Django
| 7,929,052 | 1 | 0 | 851 | 0 |
javascript,python,django
|
Most sites that do something like this implement it with a second form where you attach the file. Doing the upload via ajax means you do need to store the file on your server for some amount of time, and then your original form just needs a reference to that file so you know when you're done with it.
Then you just need to know when you can delete it.
| 0 | 0 | 0 | 0 |
2011-10-28T12:06:00.000
| 2 | 0.099668 | false | 7,929,014 | 0 | 0 | 1 | 2 |
I have a form with "subject", "body" and "file" fields on some page on my Django site.
If "subject" and/or "body" parameters exist in GET, I pre-fill them in the form from server side.
I want to do the same with "file" field - more exactly, I want if there is an "URL" parameter in request.GET, take the file from this URL and pre-fill the "file" field with it.
I've googled and still have no idea how to implement this whether with pure Javascript or with server-side help, and from my experience, it isn't possible (or at least hard to do) in most browsers due to input type="file" nature.
Is it in fact possible to implement it in some way?
|
Pre-fill a form with attached file taken from some URL in Django
| 7,929,043 | 1 | 0 | 851 | 0 |
javascript,python,django
|
You can't pre-fill a file field. But I don't think you need to use one at all, since you're getting the file from a URL, not from the user's local machine. Just use a normal text field for the URL, and get the file server-side (eg using urllib) after the form is submitted.
| 0 | 0 | 0 | 0 |
2011-10-28T12:06:00.000
| 2 | 1.2 | true | 7,929,014 | 0 | 0 | 1 | 2 |
I have a form with "subject", "body" and "file" fields on some page on my Django site.
If "subject" and/or "body" parameters exist in GET, I pre-fill them in the form from server side.
I want to do the same with "file" field - more exactly, I want if there is an "URL" parameter in request.GET, take the file from this URL and pre-fill the "file" field with it.
I've googled and still have no idea how to implement this whether with pure Javascript or with server-side help, and from my experience, it isn't possible (or at least hard to do) in most browsers due to input type="file" nature.
Is it in fact possible to implement it in some way?
|
Getting `django-registration` to send you to the page you were originally trying to visit
| 7,937,107 | -4 | 9 | 2,566 | 0 |
python,django,django-authentication,django-registration
|
You should use the same decorator @login_required, django-registration uses that too.
| 0 | 0 | 0 | 0 |
2011-10-28T14:23:00.000
| 2 | -1 | false | 7,930,526 | 0 | 0 | 1 | 1 |
django.contrib.auth has an awesome feature: When you try to access a page that's decorated by login_required, you get redirected to the login page with a next argument, so after you login you get redirected back to the page you were originally trying to access. That's good for the user flow.
But, apparently django-registration does not provide a similar feature. I expected that if you register instead of login, you would also get a next thing, and after registering-n'-activating you'll get redirected to the page you were originally trying to visit. This is not the case, you're just redirected to some success page. This hurts the flow.
Does django-registration perhaps provide this option but I'm not using it or correctly? Or is there an easy way to do this?
|
get amount of used resources in app engine
| 7,934,948 | 0 | 0 | 34 | 0 |
python,google-app-engine
|
Unfortunately this is not possible, there is no API that you can use for this.
Looking at the App Engine roadmap there is no such feature coming along any time soon.
The only thing i can recommend is you sign up for billing and recieve the 50$ free quota, it's here till 31 october. You can enable billing and disable it and keep the free 50$!
Hope this helped.
| 0 | 1 | 0 | 0 |
2011-10-28T16:15:00.000
| 1 | 1.2 | true | 7,931,936 | 0 | 0 | 1 | 1 |
I am thinking about implementing resource throttling in my application in google app engine.
My idea is checking whether I am running out of resources (for example, bandwidth) and disabling part of the website, using the final part of the available daily traffic to inform the user that the site is running in a "resources saving" mode.
I read the GAE documentation, but I just found that if I run out of traffic, it directly returns HTTP 403.
Is there a way to make my python application aware of the used resources and to try not to be so rude with my users?
|
Python or Java module to render HTML page on server side and obtain DOM object
| 51,939,389 | 0 | 1 | 412 | 0 |
java,python,webkit,rendering,server-side
|
If you want to process (execute) the javascript on headless server to generate the HTML snapshot, try using a tool like Selenium.
Selenium will allow you to fully render the HTML webpage on server side and then you can use the generated HTML to make a snapshot.
| 0 | 0 | 1 | 0 |
2011-10-29T13:02:00.000
| 1 | 0 | false | 7,939,069 | 0 | 0 | 1 | 1 |
I am looking for a library in Python OR Java that can use webkit or similar rendering engine on the server side (without GUI) and return the DOM object for further processing like selecting the elements etc.
|
Using Python Flask, mod_wsgi, apache2 - unable to get custom 500 error page
| 7,942,317 | 1 | 2 | 873 | 1 |
python,apache,wsgi,flask
|
Are you sure the error is actually coming from Flask if you are getting a generic Apache 500 error page? You should look in the Apache error log to see what error messages are in there first. The problem could be configuration or your WSGI script file being wrong or failing due to wrong sys.path etc.
| 0 | 0 | 0 | 0 |
2011-10-29T18:13:00.000
| 1 | 0.197375 | false | 7,940,745 | 0 | 0 | 1 | 1 |
I am running Ubuntu, Flask 0.8, mod_wsgi 3 and apache2. When an error occurs, I am unable to get Flask's custom 500 error page to trigger (and not the debug mode output either). It works fine when I run it without WSGI via app.run(debug=True).
I've tried setting WSGIErrorOverride to both On and Off in apache settings but same result.
Anyone has gotten this issue? Thanks!
|
how do i create a database in psycopg2 and do i need to?
| 7,942,855 | 0 | 0 | 1,391 | 1 |
python,database,django,psycopg2
|
Generally, you would create the database externally before trying to hook it up with Django.
Is this your private server? If so, there are command-line tools you can use to set up a PostgreSQL user and create a database.
If it is a shared hosting situation, you would use CPanel or whatever utility your host provides to do this. For example, when I had shared hosting, I was issued a database user and password by the hosting administrator. Perhaps you were too.
Once you have this set up, there are places in your settings.py file to put your username and password credentials, and the name of the database.
| 0 | 0 | 0 | 0 |
2011-10-29T20:52:00.000
| 2 | 0 | false | 7,941,623 | 0 | 0 | 1 | 2 |
I'm create a blog using django.
I'm getting an 'operational error: FATAL: role "[database user]" does not exist.
But i have not created any database yet, all i have done is filled in the database details in setting.py.
Do i have to create a database using psycopg2? If so, how do i do it?
Is it:
python
import psycopg2
psycopg2.connect("dbname=[name] user=[user]")
Thanks in advance.
|
how do i create a database in psycopg2 and do i need to?
| 7,941,712 | 0 | 0 | 1,391 | 1 |
python,database,django,psycopg2
|
before connecting to database, you need to create database, add user, setup access for user you selected.
Reffer to installation/configuration guides for Postgres.
| 0 | 0 | 0 | 0 |
2011-10-29T20:52:00.000
| 2 | 0 | false | 7,941,623 | 0 | 0 | 1 | 2 |
I'm create a blog using django.
I'm getting an 'operational error: FATAL: role "[database user]" does not exist.
But i have not created any database yet, all i have done is filled in the database details in setting.py.
Do i have to create a database using psycopg2? If so, how do i do it?
Is it:
python
import psycopg2
psycopg2.connect("dbname=[name] user=[user]")
Thanks in advance.
|
Should I ensure that all my web application code is UTF-8?
| 7,945,023 | 3 | 4 | 101 | 0 |
python,django,utf-8,file-encodings
|
The # coding: utf-8 line is only necessary for files which contain special characters directly. Depending on how you want to achieve l10n, you have to take care how you process the strings.
In Python2, you should use unicode() objects, while in Python3, normal str()ings are the thing to use.
| 0 | 0 | 0 | 0 |
2011-10-30T12:49:00.000
| 1 | 1.2 | true | 7,944,992 | 1 | 0 | 1 | 1 |
I have a Django site that contains only English language strings. I'll be localising this to other languages. I haven't set any sort of file encoding options. Do need to convert all my Python code to UTF-8? is this a good practice? If so, do I need to actually convert the file to be UTF-8 or do I simply need to add this snippet to each of my Python files # -*- coding: utf-8 -*-
Thanks.
|
Web application to sign PDF documents with digital certificates released by CAs
| 7,959,329 | 0 | 3 | 4,082 | 0 |
python,django,cryptography,certificate,digital-signature
|
This sounds like something from EU. Unfortunately there are countless of different existing online signature plugins. Keep in mind that many depend on the client side software as well (if the certificates come from a smart card, smart card middleware usually needs to be present as well). So you better study your target market.
| 0 | 0 | 0 | 0 |
2011-10-31T14:52:00.000
| 3 | 0 | false | 7,955,410 | 0 | 0 | 1 | 2 |
Immagine a web application written in python/django in which users authenticate with digital certificates via apache+mod_ssl (and a custom django authentication backend), how can they sign files then? The certificates are released by government approved CAs.
If I'm not wrong, a file needs to be signed with the private key of a certificate, because that is the proof that the file has been really signed by someone (and not someone-else pretending to be someone).
How can a web application have access to the private key of a certificate stored in the browser of the user?
Is this possible without the need of a software running on the user's machine?
EDIT:
So this can be done either with an ActiveX control or a Java applet, right? Does this need to be developed from scratch or does anybody know an open source solution?
|
Web application to sign PDF documents with digital certificates released by CAs
| 7,955,645 | 0 | 3 | 4,082 | 0 |
python,django,cryptography,certificate,digital-signature
|
As tawman described in his answer, the right approach is to have a client-side module in the browser, and have this module do actual signing. You can have signed Java applet or signed ActiveX control to do the job.
We offer such solution for distributed signing with ready to use client modules, but server-side part requires either .NET or VCL (no python, sorry). Our solution doesn't need to transfer the document to the client side (unlike tawman's scheme) - only small chunk of data is sent to the client and signed there.
Side note: client-side certificate used for authentication as a client via SSL most likely won't work for signing: these two operations require different key usage extension in the certificate.
| 0 | 0 | 0 | 0 |
2011-10-31T14:52:00.000
| 3 | 0 | false | 7,955,410 | 0 | 0 | 1 | 2 |
Immagine a web application written in python/django in which users authenticate with digital certificates via apache+mod_ssl (and a custom django authentication backend), how can they sign files then? The certificates are released by government approved CAs.
If I'm not wrong, a file needs to be signed with the private key of a certificate, because that is the proof that the file has been really signed by someone (and not someone-else pretending to be someone).
How can a web application have access to the private key of a certificate stored in the browser of the user?
Is this possible without the need of a software running on the user's machine?
EDIT:
So this can be done either with an ActiveX control or a Java applet, right? Does this need to be developed from scratch or does anybody know an open source solution?
|
Boto: how to keep EMR job flow running after completion/failure?
| 9,055,033 | 3 | 2 | 2,242 | 0 |
python,boto,amazon-emr
|
If it finishes correctly, it should not terminate with keep_alive=True. That said, it would normally exit on failure, so you want to add terminate_on_failure="CONTINUE" to your add_job_steps arguments.
| 0 | 0 | 0 | 0 |
2011-10-31T22:33:00.000
| 3 | 1.2 | true | 7,960,578 | 0 | 0 | 1 | 1 |
How can I add steps to a waiting Amazon EMR job flow using boto without the job flow terminating once complete?
I've created an interactive job flow on Amazon's Elastic Map Reduce and loaded some tables. When I pass in new steps to the job flow using Boto's emr_conn.add_jobflow_steps(...), the job flow terminates after it finishes or fails.
I know I can start a job flow with boto using run_jobflow with the keep_alive parameter -- but I'd like to work with flows that are already running.
|
Does Django password_reset support html email templates?
| 51,285,099 | 1 | 10 | 6,136 | 0 |
python,django
|
Here is the simple approach worked for me. Add our custom template path in such a way worked for me.
path('users/password/reset/', password_reset, {'html_email_template_name': 'registration/password_reset_email.html'},name='password_reset'),
| 0 | 0 | 0 | 0 |
2011-11-01T11:14:00.000
| 9 | 0.022219 | false | 7,965,611 | 0 | 0 | 1 | 2 |
It seems to me django only supports plain text messages for password reset emails out of the box. How can I use html templates for this purpose?
|
Does Django password_reset support html email templates?
| 7,965,953 | 5 | 10 | 6,136 | 0 |
python,django
|
You can override save method of django.contrib.auth.forms.PasswordResetForm and pass new form as an argument to password_reset view.
| 0 | 0 | 0 | 0 |
2011-11-01T11:14:00.000
| 9 | 0.110656 | false | 7,965,611 | 0 | 0 | 1 | 2 |
It seems to me django only supports plain text messages for password reset emails out of the box. How can I use html templates for this purpose?
|
HTML/Javascript/CSS GUI for the development of desktop applications with python?
| 7,967,656 | 0 | 5 | 3,024 | 0 |
python,html,css,user-interface
|
you could always use django, django templates support html, js, css, php etc.
| 1 | 0 | 0 | 0 |
2011-11-01T13:59:00.000
| 3 | 0 | false | 7,967,575 | 0 | 0 | 1 | 2 |
I wonder if there's a python GUI like pyqt etc. which works purely with html and javascript for layouting desktop applications...
Do you know if there are projects like this? Does this make sense at all ;-) Or it it just me finding that a nice tool...
|
HTML/Javascript/CSS GUI for the development of desktop applications with python?
| 7,967,652 | 2 | 5 | 3,024 | 0 |
python,html,css,user-interface
|
Since you mention PyQt yourself, you could perhaps just create a simple GUI using these tools, with your entire application made up of a QtWebKit module. Then just point to some files you created locally, and browse them using your appliction? But, this would not be any different compared to using a normal browser, so there's not really any point in doing this in my opinion...
| 1 | 0 | 0 | 0 |
2011-11-01T13:59:00.000
| 3 | 0.132549 | false | 7,967,575 | 0 | 0 | 1 | 2 |
I wonder if there's a python GUI like pyqt etc. which works purely with html and javascript for layouting desktop applications...
Do you know if there are projects like this? Does this make sense at all ;-) Or it it just me finding that a nice tool...
|
Django Translation : User data --vs-- Site Content --vs-- UI static text?
| 7,977,014 | 0 | 1 | 493 | 0 |
python,django,localization,internationalization
|
UI text: gettext is the way to go.
User Data (Dynamic): Very simple: you don't translate it at all. The only things you could do is asking the users to provide more than one language (only few will do) or using machine translations (will piss of people - usually they prefer english over a crappy translation). Especially when translations like that get into the google index it's EXTREMELY annoying to get them instead of the original english content.
Site content: You need to provide a way for gettext to extract the strings you have in the database and they shouldn't change too often (otherwise it's an annoying amount of work). The alternative to using gettext would be storing multiple languages in the database.
| 0 | 0 | 0 | 0 |
2011-11-02T06:18:00.000
| 1 | 1.2 | true | 7,976,495 | 0 | 0 | 1 | 1 |
I am confused with how to proceed on Internationalization & Localizations, so I categorized a website's data as follows :
Site Content : Content that is hosted by the website i.e. the data about the subject. Eg: Mobile Phone Site (Data about mobile models, specs, prices, etc.)
User Data : Data that is added by the users over time. Eg: Comments, reviews, profile info, etc.
UI Text : Static text that changes with the UI (Template). Eg: Menus, Footer, Header, etc.
-- Hope I catgorized the data well.
Possible Tools for Translation :
from django.utils.translation import ugettext
What are other options ?
Translation Problem (Django) :
Site Content (Dynamic) : How is possible to have .po files for Dynamic content from the database ? (Is ugettext the right tool ?)
User Data (Dynamic) : How to translate this dynamic data ? (.po files ?) what if a user comments in English and other in Spanish ?
UI Text (static) : This is static text that can be done with .po files and could change with templates. So, is there a better way ?
Please help.. How is i18n and l10n handled in practice ?
|
scrapy script called from cron only constructor called
| 7,984,842 | 1 | 0 | 359 | 0 |
python,crontab,scrapy
|
Scrapy executes correctly, but doesn't output all its messages to STDOUT, so the simple pipe (>) doesn't redirect everything into your file, only that stuff that goes to STDOUT (which as you say, seems to be the constructor only).
With &> it fetches all messages from scrapy and puts them into your log.
| 0 | 0 | 0 | 1 |
2011-11-02T17:29:00.000
| 1 | 0.197375 | false | 7,984,714 | 0 | 0 | 1 | 1 |
scrapy crawler is called through a shell script, which is used as the command line in a crontab entry. The shell script looks like:
scrapy crawl targethost.com
when time is due and it did execute, but seems only the constructor is called (I verified with debug output). The problem is solved by re-write the shell script as:
scrapy crawl targethost.com &> cronlog.log
I just don't know why.
|
interacting with an external django project from within another django project
| 7,987,920 | -1 | 5 | 1,952 | 0 |
python,django,django-models
|
Why not replicate the models from the crawler into your new project (so they are created in the same project space), then simply use django's manage.py to dump the data from the old crawler project into json files and migrate them over to your new project?
Provided your crawler project is settings/db type independent, you should be able to migrate your handlers/views/urls whatever you have to the new project and merge them together too?
If you keep the external models in sync in the new project, you will not have to do any extra work and you could use something like south app to migrate the data context.
That way you can simply import the old models in the new project and have them interact directly.
Otherwise, you are looking at message passing/network communication i.e. inter process communication.
| 0 | 0 | 0 | 0 |
2011-11-02T21:59:00.000
| 2 | -0.099668 | false | 7,987,845 | 0 | 0 | 1 | 1 |
I'm looking for a way to interact with the models of a django project from within a separate django project. I don't mean different apps, I mean 2 separate projects with 2 separate settings files.
I'm in the process of migrating an old web store (really old, it's all static html) to our django based backend. To do this, I created a separate django app that would handle all of the crawling and parsing, using the django orm and a few views for human assisted parsing. Now I'm at a point where I need to populate the catalog data of our backend with the data stored in the crawler project. I've spent the better part of the last 2 days trying to figure out a method, with no luck.
What I'd ideally like to do is import the store project as a module into a django command class and then interact with it that way (mind you, they are working off of 2 separate settings files, so setup_environ won't work). I'd like to avoid serializing the crawler data and then importing it from the store or interacting with the store database outside of django's orm because this project is far from over and I'd prefer to keep things as flexible as possible.
What would you suggest? I'm up for wild ideas, so long as I can interact with the orm of both projects from within a single script.
|
How can I stop the debugger server from pydev?
| 7,993,203 | 0 | 1 | 525 | 0 |
python,eclipse,pydev
|
This was a bug -- and it was fixed in the latest version (PyDev 2.2.4), so, please upgrade to the latest version and that should be working already.
| 0 | 1 | 0 | 0 |
2011-11-03T00:02:00.000
| 1 | 0 | false | 7,988,856 | 0 | 0 | 1 | 1 |
I am using the pydev remote debugger feature for my application.
When I try to stop the debugger server via the stop button it shows on the console that the server is successfully terminated but it isn't because it is still accepting new connections on its default port (5678).
Do you know how can I stop the server in a reliable way?
Thanks in advance.
|
Funny issue; localStorage and MongoDB
| 8,487,539 | -1 | 1 | 1,051 | 0 |
javascript,python,html,mongodb
|
It's nothing about MongoDB, it's the AJAX call.
The string in response of an AJAX call will be converted to character entities, or they will break ur DOM with characters like '<'. All u need to do is converted them back.
| 0 | 0 | 0 | 0 |
2011-11-03T03:48:00.000
| 2 | -0.099668 | false | 7,990,060 | 0 | 0 | 1 | 1 |
I'm having a peculiar issue. I'm reading the HTML from a div contenteditable, and then sending an AJAX request to my backend that saves that HTML to a mongodb document, and I also save that exact same HTML to localStorage.
And, guess what happens? When the text is loaded back later, the localStorage renders fine, but, the data retrieved from the database turns into text with  's and <div>s scattered throughout. Does MongoDB do something to the data before saving it?
|
Why are templatetags stored in directories?
| 7,993,570 | 3 | 0 | 107 | 0 |
python,django,django-templates
|
Django expects you to arrange your apps in certain ways. Requiring a templatetags directory in the app is not the exception. Some other requirements are:
ModelAdmin in admin.py (for autodiscovery)
Models in models.py
Management commands in management/commands directory
Fixtures in the fixtures directory
Unlike templates, where there are hooks to specify how your templates are loaded, there is no easy way to store your templatetags modules in a different location.
| 0 | 0 | 0 | 0 |
2011-11-03T10:28:00.000
| 2 | 1.2 | true | 7,993,348 | 0 | 0 | 1 | 1 |
I'm now working with template tags and one thing I haven't understood is why do template-tags have to be stored inside a templatetags directory in the app. Is there an underlying reason for this? Is it possible to store them in a templatetags.py file somehow so that I can reduce the extra bloat around having extra directories?
|
Streaming audio and video with Python
| 7,994,014 | 2 | 10 | 18,589 | 0 |
python,video,streaming,live,ipv6
|
You can use gstreamer's python module. I mean gst-python mentioned above. Use rtmp protocol to synchronize client/server videos. Last time I use gst-python, there was no support for rtmp. At the time, my solution was to limit buffer size. When buffer gets full oldest frames will be dropped.
| 0 | 0 | 1 | 0 |
2011-11-03T10:51:00.000
| 3 | 1.2 | true | 7,993,624 | 1 | 0 | 1 | 1 |
I need to make an application which streams live multimedia. At present my application is taking image frames from a webcam (using OpenCV) and sending it to the client. It is also sending audio using pymedia module. The problem is that both the image and audio packets that arrive at the client are out of sync.
So I have following questions:
Is there any module in python for live-multimedia streaming?
Can I make the audio and image frames somehow in sync for the client?
PS. pymedia has not been in development since 2006 and is not working.
|
Android and Python
| 7,995,273 | 0 | 4 | 1,064 | 0 |
android,python,sl4a
|
I think, what you want to do is make an independently apk file, that includes the python interpret and your script code.
I don't know if this can be done in Android. The only whay I know is running your script from Android Scripting Environment.
| 1 | 0 | 0 | 0 |
2011-11-03T12:53:00.000
| 4 | 0 | false | 7,995,202 | 0 | 0 | 1 | 2 |
Can I port existing python scripts on android using SL4A or ASE ? What I specifically want to do is to create an android application with normal UI elements and run the python scripts from the application itself, get the output and display it. Is this possible ?
|
Android and Python
| 7,995,341 | 2 | 4 | 1,064 | 0 |
android,python,sl4a
|
Personnaly I think that you ask implicitly for three points:
Compatibility Desktop/Mobile
The first is the compatibility between the python library on the phone and the python library in your computer. If you don't use third party library and be sure to include the extra python library provided by sl4a, you should generally be ok.
Packaging
The second point is about how to package a Python app for android. It can easily be done with a wrapper as well described on the sl4a website. In fact they distribute a copy of a chapter of a book about SL4A that describes how to do that. So that is possible, but bear in mind that the user will be required to install python if he hasn't done so already (this is a sort of alert at the launch of the app)
UI
The third thing that you should have in mind is that you are not a 100% free concerning the widget/layout you can use with sl4a. Namely you can't really do whatever you would be able to do in Java or Scala. So you might have to consider altering your UI and do a webview instead (that can communicate back and forth with the python) with a framework to obtain a "mobile look and feel"
Hope this helps.
| 1 | 0 | 0 | 0 |
2011-11-03T12:53:00.000
| 4 | 1.2 | true | 7,995,202 | 0 | 0 | 1 | 2 |
Can I port existing python scripts on android using SL4A or ASE ? What I specifically want to do is to create an android application with normal UI elements and run the python scripts from the application itself, get the output and display it. Is this possible ?
|
How to become productive using Vim/Emacs
| 8,001,512 | 3 | 6 | 1,355 | 0 |
python,ruby,linux,vim,emacs
|
I am an Emacs guy (using vi only to edit configuration files under /etc). I think that with Emacs, you should start it at most daily (and it is very different with vim), and you should configure it in your .emacs file. For example, I compile using the F12 key, with (global-set-key [f12] 'recompile) in my .emacs.
| 0 | 1 | 0 | 1 |
2011-11-03T20:24:00.000
| 5 | 0.119427 | false | 8,001,384 | 0 | 0 | 1 | 3 |
I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow:
Subclipse (or alternatively I use command line)
m2clipse (Maven Eclipse plugin)
Data Source Explorer (dealing with SQL)
The typical Eclipse activities I do (and would like to transfer that to Vim/Emacs) are (this is for multi-module/multi-projects/multi-folder source code):
Refactor (rename method throughout the whole "open project")
Jump to class implementation
Search for all usage of a particular class or method
Updating dependencies (3rd party JARs) via maven pom.xml
Jump to the 3rd party library implementation (maven can download the source.jar if local repository does not have it, eclipse will bring me to the actual Java code for let say, Hibernate entity manager implementation).
Write and run unit-test
All of the above activities would not require me to use mouse. There are a few activities where I would need to use a little bit of mouse such as Global Search file
Lately I've been wanting to try development using VMs. The idea here is to create a barebone VM (let's say to use Ubuntu Server) and start coding there or use Putty/SSH.
I have a MacBook Pro 13" which would benefit of using VIM/Emacs or any lightweight editor.
There are 2 major goals:
Mobility (as in, travelling and coding)
VM as development environment
Tools I'd like to use are as follow:
Linux
Ruby, Python, PHP (and occasionally maybe even Java but definitely not Microsoft .NET)
Any RDBMS
Any build/dependency system
Unit-testing framework
What would you recommend: VIM? Emacs? Others? What about other tools? Gnu Screen, ctags, etc.
Help me build my dream environment: lightweight, productive, easily replicable :)
Thanks!
|
How to become productive using Vim/Emacs
| 8,001,471 | 5 | 6 | 1,355 | 0 |
python,ruby,linux,vim,emacs
|
If you ask a question which involves "vim OR emacs" you will never get an useful answer. It's a religious question, which does not have a correct answer! That said, you should clearly use Vim! ;-)
But seriously: Vim is much more lightweight, so it might better suite the scenario you are describing. Vim can be scripted in different languages and you can find many useful scripts at www.vim.org.
Emacs is "heavier", but Lisp is a very powerful scripting languages. So Emacs is much more of a general tool than just a text editor. IDE functionality (like project management) is something I'm missing from time to time in Vim. There are some scripts to do that, but I don't like them. If you need that, I would go for Emacs.
| 0 | 1 | 0 | 1 |
2011-11-03T20:24:00.000
| 5 | 0.197375 | false | 8,001,384 | 0 | 0 | 1 | 3 |
I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow:
Subclipse (or alternatively I use command line)
m2clipse (Maven Eclipse plugin)
Data Source Explorer (dealing with SQL)
The typical Eclipse activities I do (and would like to transfer that to Vim/Emacs) are (this is for multi-module/multi-projects/multi-folder source code):
Refactor (rename method throughout the whole "open project")
Jump to class implementation
Search for all usage of a particular class or method
Updating dependencies (3rd party JARs) via maven pom.xml
Jump to the 3rd party library implementation (maven can download the source.jar if local repository does not have it, eclipse will bring me to the actual Java code for let say, Hibernate entity manager implementation).
Write and run unit-test
All of the above activities would not require me to use mouse. There are a few activities where I would need to use a little bit of mouse such as Global Search file
Lately I've been wanting to try development using VMs. The idea here is to create a barebone VM (let's say to use Ubuntu Server) and start coding there or use Putty/SSH.
I have a MacBook Pro 13" which would benefit of using VIM/Emacs or any lightweight editor.
There are 2 major goals:
Mobility (as in, travelling and coding)
VM as development environment
Tools I'd like to use are as follow:
Linux
Ruby, Python, PHP (and occasionally maybe even Java but definitely not Microsoft .NET)
Any RDBMS
Any build/dependency system
Unit-testing framework
What would you recommend: VIM? Emacs? Others? What about other tools? Gnu Screen, ctags, etc.
Help me build my dream environment: lightweight, productive, easily replicable :)
Thanks!
|
How to become productive using Vim/Emacs
| 8,001,983 | 1 | 6 | 1,355 | 0 |
python,ruby,linux,vim,emacs
|
Either of those text editors will have a learning curve. That being said I have successfully used emacs to do the following tasks that are in line w/ what you've asked:
Write PL/SQL and execute it on an oracle DB all from the editor.
Write, Compile, Run java.
Edit pom files.
Keep a pretty good TODO list in org mode.
You can launch a shell in emacs, and that feature alone does MOST of what you've asked for (SVN, make/ant/mvn/etc).
If you're jumping into one of these editors and hoping for pretty eclipse and vis studio features such as the green junit bar, i'm not sure that they exist. Eclipse' refactor tool works pretty well too and I don't know what is possible in emacs. Though with emacs, I've found that someone has typically written some extension to do what i want, you just need to be able to find it and learn how to use it. I'm an emacs neophyte at best but in scaled down projects I've found it to be pretty efficient and I don't have to take my hands off the keyboard very much.
Disclaimer(java/ee/spring eclipse developer by day that messes around with lua and the love framework using emacs at night)
| 0 | 1 | 0 | 1 |
2011-11-03T20:24:00.000
| 5 | 0.039979 | false | 8,001,384 | 0 | 0 | 1 | 3 |
I've been an Eclipse user for the last 3 years or more. I do Java EE (and Spring) development in it and so far I've done 90% of my tasks without having to touch the mouse. Typically my Eclipse setup is as follow:
Subclipse (or alternatively I use command line)
m2clipse (Maven Eclipse plugin)
Data Source Explorer (dealing with SQL)
The typical Eclipse activities I do (and would like to transfer that to Vim/Emacs) are (this is for multi-module/multi-projects/multi-folder source code):
Refactor (rename method throughout the whole "open project")
Jump to class implementation
Search for all usage of a particular class or method
Updating dependencies (3rd party JARs) via maven pom.xml
Jump to the 3rd party library implementation (maven can download the source.jar if local repository does not have it, eclipse will bring me to the actual Java code for let say, Hibernate entity manager implementation).
Write and run unit-test
All of the above activities would not require me to use mouse. There are a few activities where I would need to use a little bit of mouse such as Global Search file
Lately I've been wanting to try development using VMs. The idea here is to create a barebone VM (let's say to use Ubuntu Server) and start coding there or use Putty/SSH.
I have a MacBook Pro 13" which would benefit of using VIM/Emacs or any lightweight editor.
There are 2 major goals:
Mobility (as in, travelling and coding)
VM as development environment
Tools I'd like to use are as follow:
Linux
Ruby, Python, PHP (and occasionally maybe even Java but definitely not Microsoft .NET)
Any RDBMS
Any build/dependency system
Unit-testing framework
What would you recommend: VIM? Emacs? Others? What about other tools? Gnu Screen, ctags, etc.
Help me build my dream environment: lightweight, productive, easily replicable :)
Thanks!
|
Django forms: reasons to use them?
| 8,006,177 | 2 | 2 | 282 | 0 |
python,django,django-forms
|
The more built-in forms, the less work for developers. You are free to implement them from 0 but it is always faster to use something that is already done and tested.
Anyway, you have something in the middle: inherit from built-in forms and customize them.
| 0 | 0 | 0 | 0 |
2011-11-04T07:14:00.000
| 3 | 1.2 | true | 8,005,948 | 0 | 0 | 1 | 1 |
Are there any real reason to use builtin forms in django?
One of them as I understand is validation. Ok. And maybe some convinience (but not for me).
Anything else?
Is there any acceleration in site work with forms?
|
nohup not logging in nohup.out
| 10,672,167 | 3 | 0 | 1,610 | 0 |
python,logging,web2py,nohup
|
Nothing to worry. Actually the python process along with nohup was logging the file in batch mode and i could see the output only after quite some time and not instantaneously.
| 0 | 1 | 0 | 0 |
2011-11-05T16:50:00.000
| 4 | 1.2 | true | 8,021,674 | 0 | 0 | 1 | 3 |
I am running a python script of web2py and want to log its output. I am using following command
nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 &
The process is running but it is not logging into the file. I have tried without nohup also but it is still same.
The default logging of nohup in nohup.out is also not working.
Any suggestion what might be going wrong?
|
nohup not logging in nohup.out
| 12,594,155 | 0 | 0 | 1,610 | 0 |
python,logging,web2py,nohup
|
If you've got commas in your print statements there's a good chance it's due to buffering. You can put a sys command (forget which) in your code or when you run the nohup, just add the option -u and you'll disable std(in|out|err) buffering
| 0 | 1 | 0 | 0 |
2011-11-05T16:50:00.000
| 4 | 0 | false | 8,021,674 | 0 | 0 | 1 | 3 |
I am running a python script of web2py and want to log its output. I am using following command
nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 &
The process is running but it is not logging into the file. I have tried without nohup also but it is still same.
The default logging of nohup in nohup.out is also not working.
Any suggestion what might be going wrong?
|
nohup not logging in nohup.out
| 8,022,039 | 0 | 0 | 1,610 | 0 |
python,logging,web2py,nohup
|
nohup will try to create the file in the local directory. Can you create a file in the folder you are running it from ?
| 0 | 1 | 0 | 0 |
2011-11-05T16:50:00.000
| 4 | 0 | false | 8,021,674 | 0 | 0 | 1 | 3 |
I am running a python script of web2py and want to log its output. I am using following command
nohup python /var/www/web2py/web2py.py -S cloud -M -N -R applications/cloud/private/process.py >>/var/log/web2pyserver.log 2>&1 &
The process is running but it is not logging into the file. I have tried without nohup also but it is still same.
The default logging of nohup in nohup.out is also not working.
Any suggestion what might be going wrong?
|
Datastore 'Response too large error' since migrated to Python27
| 8,034,730 | 3 | 4 | 190 | 0 |
python,google-app-engine
|
This is a known bug in the Python 2.7 runtime - if the result of a datastore query is >1MB then you will get this response.
It will be fixed in 1.6.1.
| 0 | 1 | 0 | 0 |
2011-11-06T01:24:00.000
| 1 | 1.2 | true | 8,024,609 | 0 | 0 | 1 | 1 |
I just migrated my GAE/python app from M/S to HRD and then activated the new python27 runtime.
Now most of my datastore queries are failing with this error:
ResponseTooLargeError: The response from API call datastore_v3.RunQuery() was too large.
The same code is still running on older GAE app (M/S and python25) with no problems at all.
What is going on? Is this because of the new runtime or because of the HRD? Should I change my models/app to make request smaller?
Thanks!
|
mechanize could not retrieve all forms(including some generated by js)
| 8,025,567 | 0 | 0 | 225 | 0 |
python,perl,forms,mechanize
|
Use a browser that understands javascript as per WWW::Mechnize::FAQ, a browser like WWW::Mechanize::Firefox or WWW::Scripter
| 0 | 0 | 0 | 0 |
2011-11-06T05:19:00.000
| 3 | 0 | false | 8,025,379 | 0 | 0 | 1 | 2 |
it is a html including two forms. One of them is generated dynamic by js when the page is loaded
So, if I try to fetch them, only one form could be return, and the form generated dynamic not found.
the question is
how to fetch all forms even if they are generated by js.
|
mechanize could not retrieve all forms(including some generated by js)
| 8,026,558 | 1 | 0 | 225 | 0 |
python,perl,forms,mechanize
|
Launch Firefox, use HTTP Live Headers to inspect what the javascript does, then imitate that using Mechanize / relevant HTTP requests.
| 0 | 0 | 0 | 0 |
2011-11-06T05:19:00.000
| 3 | 0.066568 | false | 8,025,379 | 0 | 0 | 1 | 2 |
it is a html including two forms. One of them is generated dynamic by js when the page is loaded
So, if I try to fetch them, only one form could be return, and the form generated dynamic not found.
the question is
how to fetch all forms even if they are generated by js.
|
Android SL4A query
| 8,026,521 | 0 | 1 | 432 | 0 |
android,python,sl4a
|
You need a file explorer (I used andexplorer) to transfer the files to sl4a's install dir (ideally in a subdirectory), and unzip them there.
| 0 | 0 | 0 | 0 |
2011-11-06T07:05:00.000
| 3 | 0 | false | 8,025,677 | 0 | 0 | 1 | 1 |
How do I download zipped files containing python source code into the android SL4A ? I've tried going to the website and downloading it but the download always fails. Also can I install python-urwid in android?
|
authentication on python for wsgi application
| 8,026,738 | 0 | 0 | 320 | 0 |
python,wsgi
|
If you are not going to use any frameworks or libraries, you just have to implement it manually: use some kind of storage for credentials, generate forms, check passwords preferrably using salted hashes, create and store session identifiers in cookies and so on.
But maybe if it's not intended to be a public application, you can go with just basic HTTP auth implemented in Apache, nginx or any other web server you are using to launch your wsgi app.
| 0 | 0 | 0 | 0 |
2011-11-06T09:28:00.000
| 2 | 0 | false | 8,026,162 | 0 | 0 | 1 | 1 |
I try to make simple wsgi application without any frameworks, only standard library (wsgiref). And now I looking for simple way to make authentication in my application. How I can make it?
Thanks.
|
Do AWS Canonical UserIDs exist for AWS Federated Users (temporary security credentials)?
| 8,074,814 | 1 | 2 | 718 | 1 |
python,amazon-s3,amazon-web-services,boto,amazon-iam
|
Contacted the author of boto and learned of:
get_canonical_user_id() for the S3Connection class.
This will give you the canonical user ID for the credentials associated with the connection. The connection will have to have been used for some operation (e.g.: listing buckets).
Very awkward, but possible.
| 0 | 0 | 0 | 0 |
2011-11-07T03:57:00.000
| 1 | 1.2 | true | 8,032,576 | 0 | 0 | 1 | 1 |
Does a canonical user id exist for a federated user created using STS? When using boto I need a canonical user id to grant permissions to a bucket.
Here's a quick tour through my code:
I've successfully created temporary credentials using boto's STS module (using a "master" account), and this gives me back:
federated_user_arn
federated_user_id
packed_policy_size
access_key
secret_key
session_token
expiration
Then I create the bucket using boto:
bucket = self.s3_connection.create_bucket('%s_store' % (app_id))
Now I want to grant permissions I'm left with two choices in boto:
add_email_grant(permission, email_address, recursive=False, headers=None)
add_user_grant(permission, user_id, recursive=False, headers=None, display_name=None)
The first method isn't an option since there isn't an email attached to the federated user, so I look at the second. Here the second parameter ("userid") is to be "The canonical user id associated with the AWS account your are granting the permission to." But I can't seem to find a way to come with this for the federated user.
Do canonical user ids even exist for federated users? Am I overlooking an easier way to grant permissions to federated users?
|
What is an Object Oriented desktop application framework similar to Rails?
| 8,032,682 | 2 | 0 | 228 | 0 |
java,python,ruby-on-rails,ruby
|
My rule of thumb for personal (which I think this is) projects is to either use the language you're most familiar with OR the one you're most interested in learning. Java, python and ruby are all great languages and MVC frameworks such as RoR exist for all of them.
That being said if you're interested in trying C# (which is very similar to Java) I'd recommend trying that with WPF for your GUI as it's both nice to use and very powerful.
| 0 | 0 | 0 | 0 |
2011-11-07T04:14:00.000
| 3 | 0.132549 | false | 8,032,655 | 0 | 0 | 1 | 1 |
I'm building a Rails web app but I would like to start building a desktop version but I don't know what language or framework to use.
I've been thinking on developing it with Ruby too or Python or Java. I'm open to new languages as long as the framework is awesome and enjoyable to work with.
What LANGUAGE and FRAMEWORK would you recommend?
|
On what side is 'HTTP Error 403: request disallowed by robots.txt' generated?
| 8,035,293 | 0 | 3 | 997 | 0 |
python,mechanize
|
The server blocks your activity with such response.
Is it your site? If not, follow the rules:
Obey robots.txt file
Put a delay between request, even if robots.txt doesn't require it.
Provide some contact information (e-mail or page URL) in the User-Agent header.
Otherwise be ready site owner blocking you based on User-Agent, IP or other information he thinks distinguish you from legitimate users.
| 0 | 0 | 0 | 1 |
2011-11-07T09:37:00.000
| 2 | 0 | false | 8,034,767 | 0 | 0 | 1 | 1 |
I am trying out Mechanize to make some routine simpler. I have managed to bypass that error by using br.set_handle_robots(False). There are talks about how ethical it's to use it. What I wonder about is where this error is generated, on my side, or on server side? I mean does Mechanize throw the exception when it sees some robots.txt rule or does server decline the request when it detects that I use an automation tool?
|
Resource usage of google Go vs Python and Java on Appengine
| 8,038,951 | 23 | 53 | 12,094 | 0 |
java,python,google-app-engine,go
|
The cost of instances is only part of the cost of your app. I only use the Java runtime right now, so I don't know how much more or less efficient things would be with Python or Go, but I don't imagine it will be orders of magnitude different. I do know that instances are not the only cost you need to consider. Depending on what your app does, you may find API or storage costs are more significant than any minor differences between runtimes. All of the API costs will be the same with whatever runtime you use.
Language "might" affect these costs:
On-demand Frontend Instances
Reserved Frontend Instances
Backed Instances
Language Independent Costs:
High Replication Datastore (per gig stored)
Outgoing Bandwidth (per gig)
Datastore API (per ops)
Blobstore API storge (per gig)
Email API (per email)
XMPP API (per stanza)
Channel API (per channel)
| 0 | 1 | 0 | 0 |
2011-11-07T14:26:00.000
| 5 | 1 | false | 8,037,783 | 0 | 0 | 1 | 4 |
Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will I benefit from using Go in app engine from a cost perspective? (only taking to account the cost of the appengine resources not development time)
|
Resource usage of google Go vs Python and Java on Appengine
| 10,370,469 | 17 | 53 | 12,094 | 0 |
java,python,google-app-engine,go
|
The question is mostly irrelevant.
The minimum memory footprint for a Go app is less than a Python app which is less than a Java app. They all cost the same per-instance, so unless your application performs better with extra heap space, this issue is irrelevant.
Go startup time is less than Python startup time which is less than Java startup time. Unless your application has a particular reason to churn through lots of instance startup/shutdown cycles, this is irrelevant from a cost perspective. On the other hand, if you have an app that is exceptionally bursty in very short time periods, the startup time may be an advantage.
As mentioned by other answers, many costs are identical among all platforms - in particular, datastore operations. To the extent that Go vs Python vs Java will have an effect on the instance-hours bill, it is related to:
Does your app generate a lot of garbage? For many applications, the biggest computational cost is the garbage collector. Java has by far the most mature GC and basic operations like serialization are dramatically faster than with Python. Go's garbage collector seems to be an ongoing subject of development, but from cursory web searches, doesn't seem to be a matter of pride (yet).
Is your app computationally intensive? Java (JIT-compiled) and Go are probably better than Python for mathematical operations.
All three languages have their virtues and curses. For the most part, you're better off letting other issues dominate - which language do you enjoy working with most?
| 0 | 1 | 0 | 0 |
2011-11-07T14:26:00.000
| 5 | 1 | false | 8,037,783 | 0 | 0 | 1 | 4 |
Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will I benefit from using Go in app engine from a cost perspective? (only taking to account the cost of the appengine resources not development time)
|
Resource usage of google Go vs Python and Java on Appengine
| 10,283,180 | 47 | 53 | 12,094 | 0 |
java,python,google-app-engine,go
|
Will google Go use less resources than Python and Java on Appengine?
Are the instance startup times for go faster than Java's and Python's
startup times?
Yes, Go instances have a lower memory than Python and Java (< 10 MB).
Yes, Go instances start faster than Java and Python equivalent because the runtime only needs to read a single executable file for starting an application.
Also even if being atm single threaded, Go instances handle incoming request concurrently using goroutines, meaning that if 1 goroutine is waiting for I/O another one can process an incoming request.
Is the go program uploaded as binaries or source code and if it is
uploaded as source code is it then compiled once or at each instance
startup?
Go program is uploaded as source code and compiled (once) to a binary when deploying a new version of your application using the SDK.
In other words: Will I benefit from using Go in app engine from a cost
perspective?
The Go runtime has definitely an edge when it comes to performance / price ratio, however it doesn't affect the pricing of other API quotas as described by Peter answer.
| 0 | 1 | 0 | 0 |
2011-11-07T14:26:00.000
| 5 | 1 | false | 8,037,783 | 0 | 0 | 1 | 4 |
Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will I benefit from using Go in app engine from a cost perspective? (only taking to account the cost of the appengine resources not development time)
|
Resource usage of google Go vs Python and Java on Appengine
| 8,044,755 | 0 | 53 | 12,094 | 0 |
java,python,google-app-engine,go
|
I haven't used Go, but I would strongly suspect it would load and execute instances much faster, and use less memory purely because it is compiled. Anecdotally from the group, I believe that Python is more responsive than Java, at least in instance startup time.
Instance load/startup times are important because when your instance is hit by more requests than it can handle, it spins up another instance. This makes that request take much longer, possibly giving the impression that the site is generally slow. Both Java and Python have to startup their virtual machine/interpreter, so I would expect Go to be an order of magnitude faster here.
There is one other issue - now Python2.7 is available, Go is the only option that is single-threaded (ironically, given that Go is designed as a modern multi-process language). So although Go requests should be handled faster, an instance can only handle requests serially. I'd be very surprised if this limitation last long, though.
| 0 | 1 | 0 | 0 |
2011-11-07T14:26:00.000
| 5 | 0 | false | 8,037,783 | 0 | 0 | 1 | 4 |
Will google Go use less resources than Python and Java on Appengine? Are the instance startup times for go faster than Java's and Python's startup times?
Is the go program uploaded as binaries or source code and if it is uploaded as source code is it then compiled once or at each instance startup?
In other words: Will I benefit from using Go in app engine from a cost perspective? (only taking to account the cost of the appengine resources not development time)
|
Getting login credentials when using webapp
| 8,060,118 | 1 | 2 | 198 | 0 |
python,google-app-engine,web-applications,authentication,credentials
|
Are you using the built in authentication, or trying to roll your own? If the former, you can't access a user's credentials - just get the information you need from the User object. If the latter, you can handle the credentials any way you wish - you're rolling your own, and App Engine has no magic way to detect that what you're handling is a username or password.
| 0 | 0 | 1 | 0 |
2011-11-07T16:24:00.000
| 2 | 1.2 | true | 8,039,374 | 0 | 0 | 1 | 2 |
What is an accepted way to get authentication credentials (login and password) when using webapp?
I'm pretty sure that they get submitted and/or interpreted differently than the rest of the information coming through the request and I'm afraid I can't remember where exactly I'm supposed to get them from.
FYI: The requests are forced to https
Thanks!
|
Getting login credentials when using webapp
| 8,039,432 | 2 | 2 | 198 | 0 |
python,google-app-engine,web-applications,authentication,credentials
|
If you've got HTTPS enabled, sending them along with the request (usually a POST) is acceptable, and the "standard" method of logging in.
If you want to get clever, you could hash the password using SHA1 on the client end so that even an sslstrip won't reveal the password in plaintext (though it won't prevent replay attacks).
| 0 | 0 | 1 | 0 |
2011-11-07T16:24:00.000
| 2 | 0.197375 | false | 8,039,374 | 0 | 0 | 1 | 2 |
What is an accepted way to get authentication credentials (login and password) when using webapp?
I'm pretty sure that they get submitted and/or interpreted differently than the rest of the information coming through the request and I'm afraid I can't remember where exactly I'm supposed to get them from.
FYI: The requests are forced to https
Thanks!
|
How to develop a simple web application with server-side Python
| 8,077,102 | 0 | 0 | 7,276 | 0 |
python,scripting
|
Plain CGI is a good starting point to learn about server side scripting, but it is an outdated technology and gets difficult to maintain after certain level of complexity. I would think it is no longer used in industrial-grade web server anymore. Plus you have to setup a web server and then install some module to interpret python script (like Apache with mod_python) just to get started.
I had some experience with Django (https://www.djangoproject.com/) and found it fairly easy to get started with since they come with development test server. All you need to have is a Python interpreter + Django and you can get up-and-running quickly and worry about the deployment setup later. They have pretty good documentation for beginner as well.
| 0 | 0 | 0 | 0 |
2011-11-07T19:30:00.000
| 5 | 0 | false | 8,041,501 | 0 | 0 | 1 | 1 |
I am wondering how to go about implementing a web application with Python.
For example, the html pages would link to python code that would give it increased functionality and allow it to write to a database.
Kind of like how Reddit does it.
|
Alternatives to php for in-line web programming?
| 8,045,724 | 3 | 12 | 7,993 | 0 |
php,python,ruby,web-applications
|
I'd say given your requirement
Just relatively small amounts of dynamic content among otherwise HTML pages.
then, PHP is going to be hard to beat for getting going quickly and a minimum of learning overhead. It avoids all the CGI issues that you would otherwise have to deal with, and is in fact its own templating language. That's why so many get started with it. Once you get past the point of your goal of mixing a little programming logic into HTML pages, and developing more flexible, maintainable and testable applications, then frameworks such as Rails, Django and others will be worth your time to learn.
| 0 | 0 | 0 | 1 |
2011-11-08T03:32:00.000
| 5 | 0.119427 | false | 8,045,630 | 0 | 0 | 1 | 1 |
I first learned web programming with php a while back. It has some features that I find very helpful, but the overall language is not something I enjoy, just as a matter of personal preference. I am wondering what alternatives I could use to provide similar functionality using a different underlying programming language (Python? Ruby?).
What I am looking for:
general purpose programming capability
in-line server-side code embedded in HTML (i.e. I want to be able to make my documents pure HTML if desired, rather than demanding special syntax even where I don't want dynamic content)
access to request parameters
ability to send headers, set cookies, etc
Preferably:
does not require a separate server process
easy to connect with Apache
Does anyone have any suggestions?
One thing I tried to do was embedded Ruby (erb) through CGI. This looked like a good fit on paper. Unfortunately, I was not able to get it to work, because I was following a few different guides and the result of combining them did not work out. At any rate, it seems this would not allow me to set arbitrary headers (and more importantly, use sessions and cookies).
Note: I'm not looking for a full web framework at the moment. Just relatively small amounts of dynamic content among otherwise HTML pages.
Thanks!
|
Is there a way to comment out python code in a django html file?
| 8,047,122 | 8 | 4 | 3,772 | 0 |
python,html,django
|
Django templates has {# ... #} as comments. NOTE: These comments are not multi-line.
| 0 | 0 | 0 | 0 |
2011-11-08T07:17:00.000
| 4 | 1 | false | 8,047,092 | 0 | 0 | 1 | 1 |
I'm curious, i have the following code {% code_goes_here %}, how do I comment it out in the html file?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.