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
Webapp2 - Invalidate user login session, when the user logs in from a different browser
12,605,535
0
1
891
0
python,session,sessionid,webapp2
When you open a website for the first time in a browser session a site session is created. When he logs in you just store the session id in the database. You need to have a nice table with active logins. You can also set a cookie in his browser if you want to keep him logged in if he closes and restarts the browser lat...
0
0
0
0
2012-09-12T15:34:00.000
3
0
false
12,391,736
0
0
1
2
I have the following requirement in a webapp2 application. When a user leaves his machine or browser, that user's previous authentication session should be terminated. I am able to do this when a user logs in from a different machine, by storing the remote_addr in the User object at login. When the user's session is re...
Which one data load method is the best for perfomance?
12,394,712
2
0
96
0
python,database,python-3.x,redis
The method entirely depends on the requirements. If there is only one client reading and modifying the properties, this is a rather simple problem. When modifying data, just change the instance attributes in your current Python program and -- at the same time -- keep the DB in sync while keeping your program responsive...
0
0
0
0
2012-09-12T18:54:00.000
1
1.2
true
12,394,528
0
0
1
1
For example, I have object user stored in database (Redis) It has several fields: String nick String password String email List posts List comments Set followers and so on... In Python programm I have class (User) with same fields for this object. Instances of this class maps to object in database. The question is h...
Migrating virtualenv and Github between computers
12,410,239
9
8
8,279
0
python,git,github,virtualenv
That's because you're not even supposed to move virtualenvs to different locations on one system (there's relocation support, but it's experimental), let alone from one system to another. Create a new virtualenv: Install virtualenv on the other system Get a requirements.txt, either by writing one or by storing the out...
0
0
0
0
2012-09-13T15:47:00.000
4
1
false
12,410,113
1
0
1
3
I primarily work these days with Python 2.7 and Django 1.3.3 (hosted on Heroku) and I have multiple projects that I maintain. I've been working on a Desktop with Ubuntu running inside of a VirtualBox, but recently had to take a trip and wanted to get everything loaded up on my notebook. But, what I quickly discovered...
Migrating virtualenv and Github between computers
12,410,172
1
8
8,279
0
python,git,github,virtualenv
The nice thing about a virtualenv is that you can describe how to make one, and you can make it repeatedly on multiple platforms. So, instead of cloning the whole thing, clone a method to create the virtualenv consistently, and have that in your git repository. This way you avoid platform-specific nasties.
0
0
0
0
2012-09-13T15:47:00.000
4
0.049958
false
12,410,113
1
0
1
3
I primarily work these days with Python 2.7 and Django 1.3.3 (hosted on Heroku) and I have multiple projects that I maintain. I've been working on a Desktop with Ubuntu running inside of a VirtualBox, but recently had to take a trip and wanted to get everything loaded up on my notebook. But, what I quickly discovered...
Migrating virtualenv and Github between computers
12,410,230
3
8
8,279
0
python,git,github,virtualenv
In addition to scripting creating a new virtualenv, you should make a requirements.txt file that has all of your dependencies (e.g Django1.3), you can then run pip install -r requirements.txt and this will install all of your dependencies for you. You can even have pip create this for you by doing pip freeze > stable-r...
0
0
0
0
2012-09-13T15:47:00.000
4
0.148885
false
12,410,113
1
0
1
3
I primarily work these days with Python 2.7 and Django 1.3.3 (hosted on Heroku) and I have multiple projects that I maintain. I've been working on a Desktop with Ubuntu running inside of a VirtualBox, but recently had to take a trip and wanted to get everything loaded up on my notebook. But, what I quickly discovered...
Django - multi site
12,416,400
3
1
330
0
python,django,e-commerce
Better idea to use sites framework? Yes. I don't think so but I could be wrong? No. How would django handle many websites? vhosts. Could it be solved through some kind of middleware? As well. Sure. How to go about that? Pay a programmer
0
0
0
0
2012-09-13T23:42:00.000
1
0.53705
false
12,416,328
0
0
1
1
I am currently planning to build a SaaS e-commerce application in python (django). The application will create new e-commerce websites as requested. Each e-commerce needs its own templates/configuration but the core functions stay the same. Each owner decides what goes where and the page layout. So, from what I underst...
Use compressed JavaScript file (not run time compression)
12,436,279
0
3
332
0
javascript,python,extjs,embedded
What you need to do, when the "all-classes.js" file is requested, is to return the content of "all-classes.js.gzip" with the additional "Content-Encoding: gzip" HTTP header. But it's only possible if the request contained the "Accept-Encoding: gzip" HTTP header in the first place...
0
0
0
1
2012-09-14T05:50:00.000
1
1.2
true
12,418,822
0
0
1
1
I have to deploy a heavily JS based project to a embedded device. Its disk size is no more than 16Mb. The problem is the size of my minified js file all-classes.js is about 3Mb. If I compress it using gzip I get a 560k file which saves about 2.4M. Now I want to store all-classes.js as all-classes.js.gz so I can save s...
Openerp: onChange event to create lines on account move
12,600,879
0
2
2,338
0
python,onchange,openerp
sometimes error '0' will be generate so we have to write a code with like this. In case of above Example lis.append((0,0,res))
0
0
0
0
2012-09-14T15:40:00.000
3
0
false
12,427,782
0
0
1
1
I have a field amount on the Journal Entries (account move form) and I need to define an onChange event which automatically inserts the lines once I fill in the amount. But I am not sure how.
Safe objective multiplayer game state with multiple threads
12,430,890
0
2
414
0
python,django,redis,multiplayer,gevent
You have described your options well enough. Probably you need to combine both approaches. Ensure that you have as little shared state as possible. Use queue for modifications to whatever shared state remains.
0
0
0
0
2012-09-14T17:50:00.000
1
0
false
12,429,556
0
0
1
1
I'm building a multiplayer card game with Python, gevent and django-socketio and I'm wondering about the best way to maintain state on things, bearing in mind that there'll be multiple clients connecting at once and doing things. I'm using Redis as a datastore for the in game bits, with light object models on top (Redi...
Disable caching in Apache 2 for Python Development
12,432,255
4
2
1,461
0
python,apache,caching,wsgi
Its a very bad setting from a performance point of view, but what I do in my http.conf is set MaxRequestsPerChild to 1. This has the effect of each apache process handles a single request before dying. It kills throughput (so don't run benchmarks with that setting, or use it on a production site), but it has the effe...
0
0
0
1
2012-09-14T21:18:00.000
2
0.379949
false
12,432,130
0
0
1
1
Developing in Python using mod-python mod-wsgi on Apache 2. All running fine, but if I do any change on my PY file, the changes are not propagated until I restart Apache /etc/init.d/apache2 restart. This is annoying since I can't SSH and restart Apache service everytime in development. Is there any way to disable Apach...
Detecting serial port settings
12,436,940
1
4
2,135
0
python,serial-port,communication
Although part 1 is no direct answer to your question: There are devices, which just have a autodetection (called Auto-bauding) method included, that means: Send a character using your current settings (9k6, 115k2, ..) to the device and chances are high that the device will answer with your (!) settings. I've seen this...
0
0
0
1
2012-09-15T08:46:00.000
1
0.197375
false
12,435,923
0
0
1
1
From time to time I suddenly have a need to connect to a device's console via its serial port. The problem is, I never remember what port settings (baud rate, data bits, stop bits, etc...) to use with each particular device, and documentation never seems to be lying around when it's really needed. I wrote a Python scri...
Python : Rendering part of webpage with proper styling from server
12,437,002
1
0
118
0
python,web-scraping
Download the complete webpage, extract the style elements and the stylesheet link elements and download the files referenced the latter. That should give you the CSS used on the page.
0
0
1
0
2012-09-15T10:24:00.000
1
1.2
true
12,436,551
0
0
1
1
I am building a screen clipping app. So far: I can get the html mark up of the part of the web page the user has selected including images and videos. I then send them to a server to process the html with BeautifulSoup to sanitize the html and convert all relative paths if any to absolute paths Now I need to render t...
Auto Text Summarization
55,256,456
0
2
1,797
0
python,django,nlp,summarization
About papers, I would like to add to the previous answer next ones: "Text Data Management and Analysis" by ChengXiang Zhai and Sean Massung, chapter 16. "Texts in Computer Science: Fundamentals of Predictive Text Mining" by Sholom M. Weiss, Nitin Indurkhya and Tong Zhang (second edition), chapter 9.
0
0
0
0
2012-09-16T04:55:00.000
2
0
false
12,444,496
0
0
1
2
I have decided to develop a Auto Text Summarization Tool using Python/Django. Can someone please recommend books or articles on how to get started? Is there any open source algorithm or made project in the Auto Text Summarization so that I can gain the idea? Also, would you like to suggest me the new challenging FYP...
Auto Text Summarization
43,989,780
2
2
1,797
0
python,django,nlp,summarization
First off for Paper, I recommend: 1- Recent automatic text summarization techniques: a survey by M.Gambhir and V.Gupta 2- A Survey of Text Summarization Techniques, A.Nenkova As for tools for Python, I suggest taking a look at these tools: The Conqueror: NLTK The Prince: TextBlob The Mercenary: Stanford CoreNLP Th...
0
0
0
0
2012-09-16T04:55:00.000
2
0.197375
false
12,444,496
0
0
1
2
I have decided to develop a Auto Text Summarization Tool using Python/Django. Can someone please recommend books or articles on how to get started? Is there any open source algorithm or made project in the Auto Text Summarization so that I can gain the idea? Also, would you like to suggest me the new challenging FYP...
Design recommendations for a multi-user web based count down timer
12,462,388
0
1
414
0
java,python,web-applications,timer,clock
Single master clock that is always running (no users need be logged in for clock to continue running) That's not hard. The variance between what any given viewer sees and the actual time on the master clock can not be greater than 1 second. That's pretty much impossible. You can take into account network delays and...
0
1
0
0
2012-09-17T14:44:00.000
2
0
false
12,461,724
0
0
1
1
I help with streaming video production on a weekly basis. We stream live video to a number of satellite locations in the Dallas area. In order to ensure that all of the receiving locations are on the same schedule as the broadcasting location we use a desktop clock/timer application and the remote locations VNC into th...
Django 1.1 TemplateSyntaxError - could not import *.static.views
12,468,227
0
0
118
0
python,django,django-1.1
I'm still unsure as to where the reference to cmldb.static.views originated from, but I discovered that there was a missing folder in my svn database that solved the problem. The cmldb.static.views module is now in place, and the site is up and running.
0
0
0
0
2012-09-17T21:50:00.000
1
1.2
true
12,467,607
0
0
1
1
I'm attempting to import a site from an old server that's using Django 1.1 onto a new server. For compatability reasons, I haven't been able to upgrade to the new version of Django. When I attempted to view localhost:8080/admin/, I was able to access the login screen, but after that point I ran into a TemplateSyntaxErr...
How to create a file and append data from html page ?
12,468,383
2
4
6,771
0
javascript,python,html,file,server-side
Browsers have lots of security that prevent this level of control over your computer. This is a good thing. You dont want random websites to be able to do this stuff on anyone's computer that visits them. They way to do this would be to write a web application that your browser could access. The browser can submit dat...
0
0
0
0
2012-09-17T23:12:00.000
5
0.07983
false
12,468,335
0
0
1
2
I have an html file on my desktop that takes some input. How would I go about writing that input into a file onto my computer? Would I have to use another language to do it (i.e python or javascript?) and how would I go about doing this? On a related note, is there any way I can have javascript start an application fro...
How to create a file and append data from html page ?
15,305,888
0
4
6,771
0
javascript,python,html,file,server-side
Short answer: you can't. The web browser security and sandbox'ing prevents this. Longer answer: setup a small LAMP stack, Ruby on rails(local host server), Python/Django(local host server) to host your HTML/web form. The local daemon can handle appending data to a file, as you enter it into a form. With HTML5, you g...
0
0
0
0
2012-09-17T23:12:00.000
5
0
false
12,468,335
0
0
1
2
I have an html file on my desktop that takes some input. How would I go about writing that input into a file onto my computer? Would I have to use another language to do it (i.e python or javascript?) and how would I go about doing this? On a related note, is there any way I can have javascript start an application fro...
Django website, basic 2d python game
12,470,648
1
11
16,058
0
python,django,web-applications
The game will most probably have to run on the client side. You should take a look into Javascript and AJAX.
0
0
0
0
2012-09-18T04:59:00.000
3
0.066568
false
12,470,633
0
0
1
1
I'm fairly new to web development and Django so bear with me. I'm planning to make a fairly simple website in Django, that part I can manage. I'm then looking to build a few basic 2d games into it, I fully appreciate that you can easily manage this in flash or as a java web app but I'm looking to implement them in pyt...
creating a configurable permissions system in django
12,480,077
1
0
167
0
python,django
What about storing the new levels in a prefix tree? you could use each level as a node of a branch of the tree. When a new user wants do define a new level, the prefix tree will be updated starting from the level where the user belongs. If your problem is just about giving visibility to the user of the sub-branch of t...
0
0
0
0
2012-09-18T14:35:00.000
1
0.197375
false
12,479,206
0
0
1
1
I am using django to create a web based app. This app will be used as a service by multiple clients. It has several models / tables that represent a hierarchical relationship. Users are given access based on this hierarchical relationship - ex County -> Schools -> Divisions -> Classrooms. So a user having access to a...
How to convert Django dynamic page to static HTML file?
12,482,179
0
2
380
0
python,django,gunicorn
put it in your /media/ folder then just point to some.url/media/html/some_static_html.html
0
0
0
0
2012-09-18T17:36:00.000
1
0
false
12,482,150
0
0
1
1
The current website is running on Django, Gunicorn and nginx. I want a way to convert the current front page into a static HTML page and want nginx to serve this static page instead of going through the whole web stack. I want the front page to load faster. This can be done manually, but is there a tool integrated with...
Django: Create Submodel in Model
12,485,870
1
1
4,720
0
python,django
There is a one-to-many relationship between Book and Page. This means that one Book has several Pages and each Page only one Book. In a database (and therefore in an ORM mapper) you would model this by creating a foreign key in Page. This foreign key would point to the Book instance that contains these Pages. If you wa...
0
0
0
0
2012-09-18T22:02:00.000
3
0.066568
false
12,485,733
0
0
1
1
Suppose I have two models, Book and Page, such there is a one-to-many relationship between Page to Book. I would like each Book model, to have a function which creates a bunch of Pages for the respective Book model, but I'm not sure how to associate each Page's foreign key back to the Book instance it was created in. I...
Hide sidebar button in OpenERP
12,493,719
1
3
1,819
0
python,openerp
Go to the "Settings" module: Open menu option Customization -> Low Level Objects -> Window Actions. Search for "SMS" in the Action Name and open it's form. In the "Security" tab you can set the groups that can view this action. Add the "Administrator / Configuration" group and it will be hidden to regular users.
0
0
0
0
2012-09-19T00:12:00.000
5
0.039979
false
12,486,861
0
0
1
2
I'm trying to write a module for OpenERP 6.1 that will hide the "Send an SMS" button on the Partner form. I tried overwriting the window action's id with a different name and src_model, but only the name change appeared. I traced through the code, and it looks like the ir_values records from the base module are still l...
Hide sidebar button in OpenERP
12,497,448
0
3
1,819
0
python,openerp
Please try by creating a new group and provide this group to your button/link and don't add this group to any user.
0
0
0
0
2012-09-19T00:12:00.000
5
0
false
12,486,861
0
0
1
2
I'm trying to write a module for OpenERP 6.1 that will hide the "Send an SMS" button on the Partner form. I tried overwriting the window action's id with a different name and src_model, but only the name change appeared. I traced through the code, and it looks like the ir_values records from the base module are still l...
python/django no module named yelp
12,489,306
3
0
699
0
python,django,api
You need to have an __init__.py inside both the mysite and yelp directories, and you need to import it as mysite.yelp. Older versions of python will allow implicit relative imports, but in general there should be one root package that's importable, and anything inside of it should be imported with the full name. And th...
0
0
0
0
2012-09-19T05:52:00.000
1
1.2
true
12,489,235
0
0
1
1
I downloaded the yelp github for python and there's three files inside the python folder. I placed these three folders inside a folder named yelp which lays inside mysite. (I'm following django's creating first app documentation). This mysite folder has the polls folder as well. When I added yelp into the settings.py ...
Why won't pip install anything?
12,583,628
2
2
2,355
0
python-2.7,virtualenv,pip,ubuntu-12.04
Following @HugoTavares's suggestion I found I needed to install python-dev. I don't know why this helped but it seems to have solved this particular problem. I'm putting this answer on for now but Hugo, if you read this, please post an identical one and I'll remove acceptance on this and accept yours, since you deserve...
0
0
0
0
2012-09-19T15:34:00.000
1
1.2
true
12,498,011
1
0
1
1
Whenever I try to pip install anything in my virtualenvs I am told it is Downloading/Unpacking. My terminal then stays on that line indefinitely. The longest I have left this running was 2 hours (trying to install iPython) without success. Most recently, I tried installing django in one virtualenv using pip. Once it sa...
Javascript-Python: serve dynamically generated images to client browser?
12,498,821
1
0
88
0
php,javascript,python
I personally love Socket.IO and I would to it with it. Because it would be simpler a way. But that may be a bit too much work to set up just for that. Especially since it is not that simple in Python from what I heard compare to node where it really is about 10 lines server side. Without Socket.IO could do a long polli...
0
0
1
0
2012-09-19T16:11:00.000
2
0.099668
false
12,498,694
0
0
1
1
Scenario: User loads a page, image is being generated, show loading bar, notification event sent to browser. I am using python code to generate the image. Would it be ideal to have a web server that launches the script or embed a webserver code into the python script? Once the image is finished rendering, the client sh...
Django: How to upload directly files submitted by a user to another server?
12,623,702
1
2
1,077
0
python,django,file-upload,django-file-upload
You can't actually do both of these at once: I'd like to upload directly these files to the file server. I'd like to make the file server simple as possible. The file server just serve files. Under your requirements, the file server needs to both Serves Files and Accepts Uploads of files. There are a few ways to get ...
0
0
0
0
2012-09-19T18:22:00.000
2
0.099668
false
12,500,623
0
0
1
1
I'm using Django 1.4. There are two servers (app server and file server). The app server provide a web service using django, wsgi, and apache. User can upload files via the web service. I'd like to upload directly these files to the file server. "directly" means that the files aren't uploaded via the app server. I'd li...
How to export an IPython notebook to HTML for a blog post?
47,238,955
2
37
14,387
0
ipython,ipython-notebook
Click on file > Download > html
0
0
0
0
2012-09-19T20:13:00.000
5
0.07983
false
12,502,187
1
0
1
1
What is the best way to get an ipython notebook into html format for use in a blog post? It is easy to turn an ipython notebook into a PDF, but I'd rather publish as an html notebook. I've found that if I download the notebook as a .ipynb file, then load it onto gist, then look at it with the ipython notebook viewer (n...
scrape websites with infinite scrolling
12,529,766
1
31
29,452
0
python,screen-scraping,scraper
Finding the url of the ajax source will be the best option but it can be cumbersome for certain sites. Alternatively you could use a headless browser like QWebKit from PyQt and send keyboard events while reading the data from the DOM tree. QWebKit has a nice and simple api.
0
0
1
0
2012-09-20T18:56:00.000
3
0.066568
false
12,519,074
0
0
1
1
I have written many scrapers but I am not really sure how to handle infinite scrollers. These days most website etc, Facebook, Pinterest has infinite scrollers.
Finding out which module is setting the root logger
12,523,536
0
4
205
0
python,logging
I'm assuming you mean import logging imports a different logging module? In this case, there are many special attributes of modules/packages that can help, such as __path__. Printing logging.__path__ should tell you where python is importing it from.
0
0
0
1
2012-09-20T22:53:00.000
2
0
false
12,522,080
1
0
1
1
How would I be able to find which module is overriding the Python root logger? My Django project imports from quite a few external packages, and I have tried searching for all instances of logging.basicConfig and logging.root setups, however most of them are in tests and should not be overriding it unless specifically ...
What do I need to successfully run a website in my browser that executes Python scripts?
12,522,631
2
0
132
0
python,mysql,web
If you have MySQL installed on your machine along with Python, get a version of MySQLDb library for Python and have fun with it. Moreover, you can do almost any data operation with these combinations. If you want your website to go live (and do not wish to go through web frameworks) just look for a hosting plan that gi...
0
0
0
0
2012-09-20T23:00:00.000
2
0.197375
false
12,522,136
0
0
1
1
I currently simply have a local website on my Mac. I can view the webpage's HTMl and CSS and run the javascript functions in browser on my computer, but the next step I want to take is incorporating python scripts for accessing a MySQL database and returning results. I am clearly new to this, and would love some guida...
How to fetch time-based entity from datastore in app engine
12,522,188
2
1
391
0
python,google-app-engine,app-engine-ndb
You could add another field for the date. A ComputedProperty would probably make sense for that. Or you could fetch from the start of the day, in batches, and stop fetching once you reach the end of your day. I'd imagine you could come up with a sensible default based on how many appointments you'd typically have in on...
0
1
0
0
2012-09-20T23:03:00.000
3
1.2
true
12,522,160
0
0
1
2
I have an application on app engine, and this application has an entity called Appointment. An Appointment has a start_time and a end_time. I want to fetch appointments based on the time, so I want to get all appointments for a given day, for example. Since app engine doesn't support inequality query based on two fiel...
How to fetch time-based entity from datastore in app engine
12,535,660
1
1
391
0
python,google-app-engine,app-engine-ndb
The biggest problem is that a "date" means a different start and end "time" depending on a time zone of a user. And you cannot force all of your users to stick to one time zone all of the lives, not to mention DST changes twice a year. So you cannot simply create a new property in your entity to store a "date" object a...
0
1
0
0
2012-09-20T23:03:00.000
3
0.066568
false
12,522,160
0
0
1
2
I have an application on app engine, and this application has an entity called Appointment. An Appointment has a start_time and a end_time. I want to fetch appointments based on the time, so I want to get all appointments for a given day, for example. Since app engine doesn't support inequality query based on two fiel...
pydev with eclipse does create test database when running test
12,535,217
1
0
234
0
python,django,pydev
The Django test runner can be accessed by creating a new (Run or Debug) configuration for your project using the Django template. Set your main module as manage.py and under the Arguments tab enter "test" (or any other manage.py arguments you need).
0
0
0
1
2012-09-21T14:24:00.000
1
1.2
true
12,532,465
0
0
1
1
It is a django project. I am using pydev 2.6. How do I make it to use the Django test runner?
Python Audio library for fast, gapless looping of many short audio tracks
31,437,197
0
4
1,335
0
python,audio,loops,playback
I am using PyAudio for a lot of things and are quite happy with it. If it can do this, I do not know, but I think it can. One solution is to feed sound buffer manually and control / set the needed latency. I have done this and it works quite well. If you have the latency high enough it will work. An other solution, s...
0
0
0
1
2012-09-21T14:34:00.000
1
0
false
12,532,631
0
0
1
1
I'm writing an application to simulate train sounds. I got very short (0.2s) audio samples for every speed of the train and I need to be able to loop up to 20 of them (one for every train) without gaps at the same time. Gapless changing of audio samples (train speed) is also a Must-Have. I've been searching for possibl...
blueprint of blueprints (Flask)
24,216,134
3
6
6,797
0
python,web-services,web-applications,flask,blueprint
I wish the Blueprint object has a register_blueprint function just as the Flask object does. It would automatically place and registered blueprints under the current Blueprints' url.
0
0
0
0
2012-09-21T15:40:00.000
4
0.148885
false
12,533,745
0
0
1
1
I have a series of blueprints I'm using, and I want to be able to bundle them further into a package I can use as seamlessly as possible with any number of other applications. A bundle of blueprints that provides an entire engine to an application. I sort of created my own solution, but it is manual and requires too mu...
A web application to serve static files
12,546,511
3
0
402
0
python,django,apache,webserver,openshift
How about this: Use nginx to serve static files Keep the files in some kind of predefined directory structure, build a django app as the dashbord with the filesystem as the backend. That is, moving, adding or deleting files from the dashboard changed them the filesystem and nginx doesn't have to be aware of this dashb...
0
0
0
0
2012-09-22T16:07:00.000
1
0.53705
false
12,545,418
0
0
1
1
I am thinking to design my own web app to serve static files. I just don't want to use Amazon services.. So, can anyone tell me how to start the project? I am thinking to develop in Python - Django on Openshift (Redhat's). This is how ideas are going through in my mind: A dashboard helps me to add/ delete/ manage sta...
Flask-Babel -0 pybabel: error: unknown locale 'jp'
12,559,877
5
0
1,091
0
python,flask,python-babel,flask-babel
Babel does support Japanese and indeed, the error comes because 'jp' is not a valid locale. Babel uses language codes from CLDR (which I believe are the standardized language codes from ISO et al). In your case the confusion comes from the language/territory split ('de' for German language, 'AT' for Austrian territory,...
0
0
0
0
2012-09-23T08:27:00.000
1
0.761594
false
12,550,810
1
0
1
1
I am having issues with Flask-babel. I cant create a translation for Japanese. pybabel: error: unknown locale 'jp' Is this a Flask-Babel issue? That is the same error when a language does not exists. But, german works. So.....babel does nit support Japanese? Is there an alternative to Babel that support a major l...
Messed up records - separator inside field content
12,553,211
0
1
111
1
python,perl,language-agnostic
If you know what each field is supposed to be, perhaps you could write a regular expression which would match that field type only (ignoring tildes) and capture the match, then replace the original string in the file?
0
0
0
0
2012-09-23T14:36:00.000
2
0
false
12,553,197
0
0
1
1
I am provided with text files containing data that I need to load into a postgres database. The files are structured in records (one per line) with fields separated by a tilde (~). Unfortunately it happens that every now and then a field content will include a tilde. As the files are not tidy CSV, and the tilde's not e...
Celery Task Grouping/Aggregation
12,705,857
4
13
3,185
0
python,asynchronous,task,celery,aggregation
An easy way to accomplish this is to write all the actions a task should take on a persistent storage (eg. database) and let a periodic job do the actual process in one batch (with a single connection). Note: make sure you have some locking in place to prevent the queue from being processes twice! There is a nice examp...
0
1
0
0
2012-09-23T21:14:00.000
2
0.379949
false
12,556,309
0
0
1
1
I'm planning to use Celery to handle sending push notifications and emails triggered by events from my primary server. These tasks require opening a connection to an external server (GCM, APS, email server, etc). They can be processed one at a time, or handled in bulk with a single connection for much better performanc...
User-generated Jinja 2 templates with Flask
12,561,340
1
6
576
0
python,flask,jinja2
If you allow users to upload arbitrary jinja2 templates, you allow them arbitrary html and javascript and thus become a web hosting company, with all the consequences. You also have to be careful with the variables you give them access to, so that private user data (if any) is kept separated from each other.
0
0
0
0
2012-09-24T07:56:00.000
2
0.099668
false
12,560,963
0
0
1
1
I am writing a web application where users can create their own designs. The easiest way to do this would be by allowing them to upload their own Jinja 2 templates. However, I’m concerned about the security. What are things I should be cautious for? Should I set a custom Jinja 2 environment for this?
Delete Server File When Exiting from Web Page
12,566,448
1
0
457
0
javascript,python,cgi
As Lajos Arpad wrote, you should send notification to the server when the page is unloaded (XmlHTTPRequest in onbeforeunload event for example); but beware, that it will not be bulletproof - for example if user resets his/her machine, or forces killing browser process ungracefully (unix kill -9 for example), the browse...
0
0
0
0
2012-09-24T13:27:00.000
2
0.099668
false
12,566,049
0
0
1
2
Using a python cgi script and I have a form with both a Submit and Cancel button. When a user tries to leave the web page by clicking Cancel, closing the window or hitting the back button, I want to delete a file that exists on the server. The file name is dependent on the values in the form. When the user clicks t...
Delete Server File When Exiting from Web Page
12,566,229
0
0
457
0
javascript,python,cgi
You can't access server files using Javascript because of security reasons. However, you can make a postback in the onbeforeunload event and on the server-side event (which handles this postback) you can delete the server file(s) to be deleted.
0
0
0
0
2012-09-24T13:27:00.000
2
1.2
true
12,566,049
0
0
1
2
Using a python cgi script and I have a form with both a Submit and Cancel button. When a user tries to leave the web page by clicking Cancel, closing the window or hitting the back button, I want to delete a file that exists on the server. The file name is dependent on the values in the form. When the user clicks t...
Big mysql query versus an http post connection in terms of long term speed
12,568,898
1
0
34
0
python,mysql,django
It depends a lot on what you plan on doing with the data. However, thinking long term you're going to have much more flexibility with breaking out the friends into distinct units than just storing them all together. If the friend creation process is taking too long, you should consider off-loading it to a separate proc...
0
0
0
0
2012-09-24T16:01:00.000
1
1.2
true
12,568,725
0
0
1
1
right now I think i'm stuck between two main choices for grabbing a user's friends list. The first is a direct connection with facebook, and the pulling the friends list out and creating a list of friend models with the json. (Takes quite a while whenever I try it out, like 2 seconds?) The other is whenever a user log...
How to upload a file to S3 without creating a temporary local file
56,126,467
0
38
52,339
1
python,amazon-s3,amazon
Given that encryption at rest is a much desired data standard now, smart_open does not support this afaik
0
0
1
0
2012-09-24T18:09:00.000
12
0
false
12,570,465
0
0
1
2
Is there any feasible way to upload a file which is generated dynamically to amazon s3 directly without first create a local file and then upload to the s3 server? I use python. Thanks
How to upload a file to S3 without creating a temporary local file
12,570,568
2
38
52,339
1
python,amazon-s3,amazon
I assume you're using boto. boto's Bucket.set_contents_from_file() will accept a StringIO object, and any code you have written to write data to a file should be easily adaptable to write to a StringIO object. Or if you generate a string, you can use set_contents_from_string().
0
0
1
0
2012-09-24T18:09:00.000
12
0.033321
false
12,570,465
0
0
1
2
Is there any feasible way to upload a file which is generated dynamically to amazon s3 directly without first create a local file and then upload to the s3 server? I use python. Thanks
Options for Image Caching
12,585,067
1
0
717
0
python,google-app-engine,caching,distributed-caching,image-caching
Blobstore is fine. Just make sure you set the HTTP cache headers in your url handler. This allows your files to be either cached by the browser (in which case you pay nothing) or App Engine's Edge Cache, where you'll pay for bandwidth but not blobstore accesses. Be very careful with edge caching though. If you set an...
0
1
0
0
2012-09-24T22:40:00.000
3
0.066568
false
12,573,915
0
0
1
1
I am running a website on google app engine written in python with jinja2. I have gotten memcached to work for most of my content from the database and I am fuzzy on how I can increase the efficiency of images served from the blobstore. I don't think it will be much different on GAE than any other framework but I wan...
Log in with Django-social-auth & tastypie on iOS
12,587,020
8
2
1,488
0
python,ios,django,api,django-socialauth
You cannot use django-social-auth directly. To do Facebook login, you need to use the Facebook SDK for iOS (https://developers.facebook.com/docs/reference/iossdk/). It will return you the access token which you would send to your API created using TastyPie. When you have the access token, you can register a new user ba...
0
0
0
0
2012-09-25T06:05:00.000
1
1.2
true
12,577,045
0
0
1
1
I'm building out an API using tastypie for an iOS app. I can handle normal authentication / authorization just fine but I'm a bit confused when it comes to using django-social-auth to register / login / link THROUGH Tastypie. If I'd, for example like to authenticate or register users on an iOS app using django-social-...
Hadoop Hbase query
21,502,085
0
0
1,019
1
java,python,hadoop,hbase,thrift
Phoenix is a good solution for low latency result from Hbase tables than Hive. It is good for range scans than Hbase scanners because they use secondary indexes and SkipScan. As in your case , you use Python and phoenix API have only JDBC connectors. Else Try Hbase Coprocessors. Which do SUM, MAX, COUNT,AVG functions. ...
0
0
0
0
2012-09-25T14:35:00.000
3
0
false
12,585,286
0
0
1
1
I have the below setup 2 node hadoop/hbase cluster with thirft server running on hbase. Hbase has a table with 10 million rows. I need to run aggregate queries like sum() on the hbase table to show it on the web(charting purpose). For now I am using python(thrift client) to get the dataset and display. I am looking f...
Is there a curated repository for DJango based website templates?
12,590,919
1
2
1,017
0
python,django
There's no similar "themes" for Django like you'd find for Wordpress. Wordpress is a CMS -- a full application -- whereas Django is a framework -- i.e., you could use it to build a Wordpress, but it is not a Wordpress. You could start off with a pure HTML/CSS template and use that to build in functionality, but you won...
0
0
0
0
2012-09-25T20:24:00.000
2
0.099668
false
12,590,492
0
0
1
1
Where can I find a list of (preferably curated) DJango based, simple-website, templates (or equivalent, prewritten, boilerplate DJango code and layout)? Context I'm considering a project which requires me to deploy a large number of (fairly simple) personal/vanity websites. They are simple enough that, most likely, I s...
How does HTML templating fit in with the backend language and database?
12,594,044
0
1
160
0
javascript,python,templates,web-applications
There are obviously many ways this can all work together, but it sounds like you have the (a) right idea. Generally the frontend deals with JSON, and the server provides JSON. What's consuming or providing those responses is irrelevant; you shouldn't need to worry that Mongo is your database, or that underscore is hand...
0
0
0
0
2012-09-26T01:58:00.000
1
1.2
true
12,593,541
0
0
1
1
I apologize if this question is not specific enough, but I do need some help understanding this concept. I've been researching many Javascript libraries including JQuery, MooTools, Backbone, Underscore, Handlebars, Mustache, etc - also Node.js and Meteor (I know all those serve different purposes). I have a basic idea ...
Deploying Flask, parallel requests
12,620,810
4
6
2,708
0
python,flask,wsgi
I use uWSGI with the gevent loop. That is the ticket. In fact, this is how I use py-redis which is blocking to not be blocking. Also, I use uWSGI to write requests after the response while still accepting more requests.
0
0
0
0
2012-09-27T11:48:00.000
3
1.2
true
12,620,695
0
0
1
1
When I test my new Flask application with the built in web server, everything is "single threaded" and blocking. The server can not serve one request without finishing another. It can only process one request at a time. When deploying a web service, this is obviously not desirable. How do you deploy Flask applications ...
Moving nodes from one tree to another with Dynatree
12,659,689
0
1
908
0
python,django,dynatree
There is a difference between 'selected' and 'active'. Selection is typically done using checkboxes, while only one node can be activated (typically by a mouse click). A 2nd click on an active node will not fire an 'onActivate' event, but you can implement the 'onClick' handler to catch this and call node.deactivate()
0
0
0
0
2012-09-28T09:00:00.000
3
0
false
12,636,812
0
0
1
3
I'm currently working on a django project and i'm using dynatree to build treeview. I have two trees, first tree has items that user can select and the selected items will be moved to second tree. Is there a way that I can do so in dynatree?And there's an option for user to "unselect" the item so the selected item wil...
Moving nodes from one tree to another with Dynatree
19,162,943
1
1
908
0
python,django,dynatree
I have a dynamTree on a DIV dvAllLetterTemplates (which contains a master List) and a DIV dvUserLetterTemplates to which items are to be copied. //Select the Parent Node of the Destination Tree var catNode = $("#dvUserLetterTemplates").dynatree("getTree").selectKey(catKey, false); if (catNode != null) { //Select the s...
0
0
0
0
2012-09-28T09:00:00.000
3
0.066568
false
12,636,812
0
0
1
3
I'm currently working on a django project and i'm using dynatree to build treeview. I have two trees, first tree has items that user can select and the selected items will be moved to second tree. Is there a way that I can do so in dynatree?And there's an option for user to "unselect" the item so the selected item wil...
Moving nodes from one tree to another with Dynatree
15,516,606
2
1
908
0
python,django,dynatree
I've solved my problem using the copy/paste concept of context menu. And for the second problem, I used global variable to store the original parent node so when user unselect the item, it will move back to its original parent.
0
0
0
0
2012-09-28T09:00:00.000
3
1.2
true
12,636,812
0
0
1
3
I'm currently working on a django project and i'm using dynatree to build treeview. I have two trees, first tree has items that user can select and the selected items will be moved to second tree. Is there a way that I can do so in dynatree?And there's an option for user to "unselect" the item so the selected item wil...
Storing text files > 1MB in GAE/P
12,648,928
1
2
223
0
python,google-app-engine,google-docs-api,blobstore,google-cloud-storage
If you're already using the Files API to read and write the files, I'd recommend you use Google Cloud Storage rather than the Blobstore. GCS offers a richer RESTful API (makes it easier to do things like access control), does a number of things to accelerate serving static data, etc.
0
1
0
0
2012-09-28T12:52:00.000
3
0.066568
false
12,640,409
0
0
1
2
I have a Google App Engine app where I need to store text files that are larger than 1 MB (the maximum entity size. I'm currently storing them in the Blobstore and I make use of the Files API for reading and writing them. Current operations including uploading them from a user, reading them to process and update, an...
Storing text files > 1MB in GAE/P
12,641,339
0
2
223
0
python,google-app-engine,google-docs-api,blobstore,google-cloud-storage
Sharing data is more easy in Google Docs (now Google Drive) and Google Cloud Storage. Using Google drive u can also use the power of Google Apps scripts.
0
1
0
0
2012-09-28T12:52:00.000
3
0
false
12,640,409
0
0
1
2
I have a Google App Engine app where I need to store text files that are larger than 1 MB (the maximum entity size. I'm currently storing them in the Blobstore and I make use of the Files API for reading and writing them. Current operations including uploading them from a user, reading them to process and update, an...
Installing a django site on GoDaddy
12,659,723
3
32
61,875
0
python,django,installation
I am not familiar with GoDaddy's setup specifically, but in general, you cannot install Django on shared hosting unless it is supported specifically (a la Dreamhost). So unless GoDaddy specifically mentions Django (or possibly mod_wsgi or something) in their documentation, which is unlikely, you can assume it is not s...
0
0
0
0
2012-09-30T03:39:00.000
5
0.119427
false
12,658,427
0
0
1
1
I have never deployed a Django site before. I am currently looking to set it up in my deluxe GoDaddy account. Does anyone have any documentation on how to go about installing python and django on GoDaddy?
Pyramid app not releasing memory between views
12,673,353
2
3
223
0
pyramid,pickle,python-3.2
Pyramid's debug toolbar keeps objects alive. Deactivating it fixes most memory leak problems. The leak that was the cause of my searching for errors in Pyramid doesn't seem to be a problem with Pyramid at all
0
0
0
0
2012-09-30T10:24:00.000
1
1.2
true
12,660,516
0
0
1
1
I've got a Pyramid view that's misbehaving in an interesting way. What the view does is grab a pretty complex object hierarchy from a file (using pickle), does a little processing, then renders an html form. Nice and simple. Setup: I'm running Ubuntu 12.04 64bit, Python3.2, Pyramid 1.3.3, SQLAlchemy 0.7.8 and using the...
Scheduling update functions in Django and Heroku?
12,664,898
0
0
164
0
python,django,heroku,celery
Based on you use case description you do not need a Scheduler, so APScheduler will not match your requirements well. Do you have a web dyno besides your worker dyno? The usual design pattern for this type of processing is to set up a control thread or control process (your web dyno) that accepts requests. These request...
0
0
0
0
2012-09-30T20:11:00.000
1
0
false
12,664,713
0
0
1
1
I am working on a project, to be deployed on Heroku in Django, which has around 12 update functions. They take around 15 minutes to run each. Let's call them update1(), update2()...update10(). I am deploying with one worker dyno on Heroku, and I would like to run up to n or more of these at once (They are not really co...
How to modify the url in plone so that we don't get the same page if it is modified?
12,671,365
5
0
298
0
python,plone
In the example above, sample.pdf is presumably a File created in Plone. In this case, the URL without /view will render the file for download, and the URL with /view will render a Plone page with a link to download it. This is standard behaviour. It isn't really possible to stop people from downloading the PDF. You can...
0
0
0
0
2012-10-01T06:54:00.000
1
1.2
true
12,668,710
0
0
1
1
After using atreal.richfile.preview in plone, we get the preview of a pdf file with the url like : http://localhost:8090/plone/sample.pdf/view. If we delete part of the url i.e "/view", and enter the url: http://localhost:8090/plone/sample.pdf in the browser, it still can be viewed and the pdf becomes printable or can ...
What are the non-obvious problems you encounter, moving from Django to Flask?
12,674,458
1
0
170
0
python,django,web-services,web-applications,flask
I tend to use Django for "big" projects and Flask for projects requiring less than a ~300 lines file. The challenges in moving to Flask are in my sense to go look for the extensions for forms, mails, databases... When you need them, and referring to different documentations. But it is naturally the price of flexibility...
0
0
0
0
2012-10-01T07:33:00.000
1
0.197375
false
12,669,115
0
0
1
1
Question is for programmers who have used Django and Flask for real projects. What challenges do you face going to the Flask? Interested in the situation when there may be unexpected difficulties (after using django). Specific examples are welcome.
Tastypie: Add meta codes to dispatch_list
12,686,954
1
0
883
0
python,django,api,rest,tastypie
You can add a new field to the resource and dehydrate it with dehydrate_field_name().
0
0
0
1
2012-10-02T02:08:00.000
2
1.2
true
12,683,630
0
0
1
1
How can I add custom fields (in this case, meta codes) to a dispatch_list in Tastypie?
Easiest way to tackle this web crawling task?
12,697,280
1
3
321
0
c++,python,ruby-on-rails,web-applications,web-crawler
Adding to mechanize: if your page has a javascript component that mechanize cant handle, selenium drives an actual web browser. If you're hellbent on using ruby, you can also use WATIR, but selenium has both ruby and python bindings.
0
0
1
0
2012-10-02T15:08:00.000
3
0.066568
false
12,693,054
0
0
1
2
I currently have been assigned to create a web crawler to automate some reporting tasks I do. This web crawler would have to login with my credentials, search specific things in different fields (some in respect to the the current date), download CSVs that contain the data if there is any data available, parse the CSVs...
Easiest way to tackle this web crawling task?
12,693,218
0
3
321
0
c++,python,ruby-on-rails,web-applications,web-crawler
While this is not a great Stackoverflow question, since you are a student and it's for an internship, it seems like it would be in poor form to flag it, or down-vote it. :) Basically, you can pretty much accomplish this task with any of the languages you listed. If you want learning Ruby as a part of your experience f...
0
0
1
0
2012-10-02T15:08:00.000
3
0
false
12,693,054
0
0
1
2
I currently have been assigned to create a web crawler to automate some reporting tasks I do. This web crawler would have to login with my credentials, search specific things in different fields (some in respect to the the current date), download CSVs that contain the data if there is any data available, parse the CSVs...
south migration making incorrect initial schemamigration
12,697,732
1
0
91
0
python,django,migration,django-south
--initial is not about detecting changes, you shouldn't expect it to. It takes the current state of the tables and exports them as create table statements to get your first migration off the ground such that on a new install, you simply run "python manage.py migrate" to build your tables from start to finish. No matter...
0
0
0
0
2012-10-02T20:16:00.000
1
1.2
true
12,697,595
0
0
1
1
I'm trying to run migration by south, But when I run : manage.py schemamigration <my_app> --initial it makes wrong modifications, creating "Added model treinoclub_app.Endereco Added model treinoclub_app.Academia". But I didn't make any changes for this table.
How to debug Celery/Django tasks running locally in Eclipse
19,998,790
1
29
23,443
0
python,eclipse,celery
I create a management command to test task.. find it easier than running it from shell..
0
1
0
0
2012-10-02T20:57:00.000
5
0.039979
false
12,698,212
0
0
1
1
I need to debug Celery task from the Eclipse debugger. I'm using Eclipse, PyDev and Django. First, I open my project in Eclipse and put a breakpoint at the beginning of the task function. Then, I'm starting the Celery workers from Eclipse by Right Clicking on manage.py from the PyDev Package Explorer and choosing "De...
Django: using {{STATIC_URL}} from python side
12,865,154
0
0
148
0
python-2.7,django-views,django-1.3
As zzzirk says: Django really isn't about flat pages, so the most Djangonic solution is to put flat pages beside the django app, not within it.
0
0
0
0
2012-10-03T00:27:00.000
2
0
false
12,700,350
0
0
1
2
Building a "history" system that serves static pages based on the date the user asks for. Not all dates have associated pages, and it isn't possible to know, based on what's in the database which do, which don't. I haven't been able to find a way to redirect to a static page because there doesn't seem to be any way to ...
Django: using {{STATIC_URL}} from python side
12,739,819
0
0
148
0
python-2.7,django-views,django-1.3
I'm not certain from your question if you understand the intention of the {{ STATIC_URL }} tag. It is a URL prefix for static content files such as css, javascript, or image files. It is not intended as a path for your own static HTML files. In the end I'm not sure you are asking the right question for what you are ...
0
0
0
0
2012-10-03T00:27:00.000
2
0
false
12,700,350
0
0
1
2
Building a "history" system that serves static pages based on the date the user asks for. Not all dates have associated pages, and it isn't possible to know, based on what's in the database which do, which don't. I haven't been able to find a way to redirect to a static page because there doesn't seem to be any way to ...
Boto reverse the stream
12,716,129
3
4
636
1
python,stream,twisted,boto
boto is a Python library with a blocking API. This means you'll have to use threads to use it while maintaining the concurrence operation that Twisted provides you with (just as you would have to use threads to have any concurrency when using boto ''without'' Twisted; ie, Twisted does not help make boto non-blocking o...
0
1
1
0
2012-10-03T18:54:00.000
2
1.2
true
12,714,965
0
0
1
1
I have a server which files get uploaded to, I want to be able to forward these on to s3 using boto, I have to do some processing on the data basically as it gets uploaded to s3. The problem I have is the way they get uploaded I need to provide a writable stream that incoming data gets written to and to upload to boto ...
How to set the content type header in response for a particular file type in Pyramid web framework
26,917,124
1
4
1,474
0
python,pyramid
Simply add this following code where your Pyramid web app gets initialized. import mimetypes mimetypes.add_type('application/x-font-woff', '.woff') For instance, I have added it in my webapp.py file, which gets called the first time the server gets hit with a request.
0
0
0
1
2012-10-04T08:13:00.000
2
0.099668
false
12,723,009
0
0
1
1
I am using pyramid web framework to build a website. I keep getting this warning in chrome console: Resource interpreted as Font but transferred with MIME type application/octet-stream: "http:static/images/fonts/font.woff". How do I get rid of this warning message? I have configured static files to be served using ad...
Including common Django Project in multiple projects
12,728,830
1
1
1,451
0
python,django
I would separate out the common models, ect... into it's own python package. Then each project will have this package installed, or just install the package at the system level and they both can use it. If you handle this properly you shouldn't have to change much of your imports and you can easily update the package b...
0
0
0
0
2012-10-04T13:39:00.000
3
1.2
true
12,728,547
0
0
1
1
I have two Django Projects where I use a lot of common models. Custom user classes, Algorithm classes, Product classes. The two projects are related to e-commerce, both run on different machines and serve completely different purposes. However, considering that they have these models in "common", I was wondering if it ...
Automate translation for personal use
16,074,293
0
0
184
0
python,web-scraping,translation
Or go to MicrosoftTranslator.com, and paste your text in one box, have it translate and cut and paste the result? Failing that, the MS Translator API can be used for up to 2 million characters a month for free...so maybe use that?
0
0
1
0
2012-10-04T15:14:00.000
3
0
false
12,730,426
0
0
1
1
I would like to translate a few hundred words for an application I'm writing. This is a simple, one-off project, so I'm not willing to pay for the the google translate API. Is there another web service which will do this? Another idea is to just send a search to Google, and scrape the result from the first result. For ...
Can I used simple sql commands in django
12,740,533
1
0
77
1
python,sql,django,django-queryset
Try this. https://docs.djangoproject.com/en/dev/topics/db/sql/
0
0
0
0
2012-10-05T06:05:00.000
2
0.099668
false
12,740,424
0
0
1
1
I want to select data from multiple tables, so i just want to know that can i used simple SQL queries for that, If yes then please give me an example(means where to use these queries and how). Thanks.
Passing JSON (dict) vs. Model Object to Templates in Django
12,750,335
2
0
662
0
python,django
Converting this to a model objects doesn't require storing it in database. Also if you are sure you don't want to store it maybe placing it in models.py and making it Django models is wrong idea. Probably it should be just normal Python classes e.g. in resources.py or something like that, not to mistake it with models....
0
0
0
0
2012-10-05T15:45:00.000
2
1.2
true
12,749,702
0
0
1
1
Question In Django, when using data from an API (that doesn't need to be saved to the database) in a view, is there reason to prefer one of the following: Convert API data (json) to a json dictionary and pass to the template Convert API data (json) to the appropriate model object from models.py and then pass that to t...
Android apps with Dojo and geodjango
12,750,812
0
1
197
0
android,python,django,dojo
I suggest to take a look at PhoneGap. I use it to embed JQuery mobile inside a Android application. PhoneGap makes it easy to embed javascript inside an Android application. Just try the PhoneGap tutorial. Edit: PhoneGap let u use the GPS sensor through javascript
1
0
0
0
2012-10-05T16:53:00.000
1
1.2
true
12,750,731
0
0
1
1
I am trying to make a android apps using Dojo toolkit and GeoDjango. Its a project based on GPS work. Can anyone help in this issue? I want to have the staring steps? I have some source code and SDK installed in my computer. But still confused about the staring. can Anyone help? How I will make it possible to create th...
How to Access files on Heroku?
38,451,714
4
9
9,743
0
python,heroku
You can run heroku run bash and backup the file then deploy your app run heroku run bash again and remove the new file and replace it with the old one you backed up. Hope it helps
0
0
0
0
2012-10-06T20:13:00.000
3
0.26052
false
12,763,440
1
0
1
1
I have a project on Heroku. This project allows me to update a JSON file. If update something on Heroku via the project's web interface I see the update. I can close the browser, open it again and the update persists. Now, I want to push something to this project. If I do, the JSON file will be overwritten. So, I pull...
Web2Py - Custom File Upload Form with Crud
21,023,517
0
1
764
0
python,web2py
I think you should attack one thing at the time and, for each one, try paste some code that helps a lot. I try to answer the last question: I think you won't be able to do that with crud interface without change the inner code (DO NOT DO THAT!). With SQLFORM, you can, altering CSS on Fields. But, the best and more cont...
0
0
0
0
2012-10-06T20:56:00.000
1
0
false
12,763,814
0
0
1
1
I'm creating a custom file upload form in Web2Py, and was hoping some more experienced users could help me solve a few issues. Basically, the database ("t_file") is defined in "db_wizard.py", and in the controller, I'm calling crud.create(db.t_file, next=URL('upload')); a form is added in the html file with {{form}}. ...
Flask request.remote_addr is wrong on webfaction and not showing real user IP
12,770,986
4
33
42,164
0
python,flask,webfaction
The problem is there's probably some kind of proxy in front of Flask. In this case the "real" IP address can often be found in request.headers['X-Forwarded-For'].
0
0
1
0
2012-10-07T17:09:00.000
5
0.158649
false
12,770,950
0
0
1
1
I just deployed a Flask app on Webfaction and I've noticed that request.remote_addr is always 127.0.0.1. which is of course isn't of much use. How can I get the real IP address of the user in Flask on Webfaction? Thanks!
Django - How does order_by work?
12,775,949
14
8
16,934
0
python,django,postgresql,sql-order-by
order_by can have multiple params, I think order_by('score', '-create_time') will always return the same queryset.
0
0
0
0
2012-10-08T05:34:00.000
3
1.2
true
12,775,844
0
0
1
1
I'd like to know how Django's order_by works if the given order_by field's values are same for a set of records. Consider I have a score field in DB and I'm filtering the queryset using order_by('score'). How will records having the same values for score arrange themselves? Every time, they're ordered randomly within ...
Is it possible to return (stream) a response (xml) from django as the output is rendering?
12,778,355
0
1
445
0
python,django,dhtmlx
Turns out you can't do this with templates, and so you have to move over to HttpResponces and building up your return manually, which may not be worth it for a lot of people.
0
0
0
0
2012-10-08T08:38:00.000
1
1.2
true
12,778,033
0
0
1
1
I have a page, which returns 10,000+ records as XML, which takes 7 seconds to return which i'm happy with, as most of it isn't displayed until the user scrolls down. But my front end has to wait 7 seconds for django to return anything so it can start showing the output, DHTMLX is able to render as data is being receiv...
Combining Tornado and Flask templates
12,786,744
2
0
394
0
python,routes,flask,tornado
Tornado templates uses syntax similar to Jinja, but the rendering engine is not Jinja. You might be able to get away with it, but then you would have to keep track of which templates are Jinja and which are Tornado. For the sake of sanity, just keep them separate.
0
0
0
0
2012-10-08T17:35:00.000
2
0.197375
false
12,786,680
0
0
1
2
Is possible to combine Tornado and Flask web templates together? For example: Use Index.html as "base" template setting up block for extensions: Then ,extend index with "block" from Flask for Flask Routes Then, extend index with "block" from Tornado for Tornado Routes..
Combining Tornado and Flask templates
12,859,244
1
0
394
0
python,routes,flask,tornado
You are not bound to the default template engine in Flask. Maybe you could somehow use Tornado's template engine in Flask, then it'd be possible to use the templates in both.
0
0
0
0
2012-10-08T17:35:00.000
2
0.099668
false
12,786,680
0
0
1
2
Is possible to combine Tornado and Flask web templates together? For example: Use Index.html as "base" template setting up block for extensions: Then ,extend index with "block" from Flask for Flask Routes Then, extend index with "block" from Tornado for Tornado Routes..
Web2Py - Validate uploaded file by email
12,809,067
0
0
262
0
python,web2py
In your table that contains the upload information, add a new string field called 'validation_key'. When a file is uploaded, insert a GUID or reasonably long alpha-numeric string in it. Send this key as part of the link in the email. When the user clicks the link, search for the key and if found, set the matched 'valid...
0
0
0
0
2012-10-08T18:23:00.000
2
0
false
12,787,317
0
0
1
1
web2py experts. The task I'm trying to accomplish is the following: -permit a person browsing my site to upload a file to my site through a form (implemented through crud.create()) -the visitor is not required to establish an account or log in to upload a file -the user is required to provide an email address in or...
Reportlab: How to add uncertain contents using BaseDocTemplate?
13,022,662
1
0
384
0
python,pdf,reportlab
If you use Platypus with ReportLab you can get a table of contents "for free": just see the ReportLab manual for details but you basically just add a TableOfContents to the list of Flowables for the document and you're done. Otherwise you'll have to figure out all the logic for building a table of contents yourself.
0
0
0
0
2012-10-09T01:42:00.000
1
1.2
true
12,791,769
0
0
1
1
I want to add contents on first page. But the data is uncertain, contents must draw depend on the data. I try to fix this problem by drawing twice, calculating and recording the contents, and it works well. But it wastes time and ungainly. Can I insert first page after completing drawing? Or other ways to fix this prob...
For what purpose Django is used for?
12,798,019
48
64
66,634
0
python,django
No. It's not for making websites. Your sample just sounds like you want plain old HTML. Django is for creating web applications. That is, software, normally backed by a database, that includes some kind of interactivity, that operates through a browser. A Framework provides a structure and common methods for making th...
0
0
0
0
2012-10-09T10:26:00.000
3
1.2
true
12,797,999
0
0
1
1
I heard a lot of people talking about Django on various forums. But I am having a very basic question : What is meant by Framework and why Django is used. After listening a lot about Django, I ran few chapters for Django (from Djangobook.com). After running these chapters, I am wondering how Django can be used to crea...
How to fetch user's mobile number from facebook?
12,824,092
4
4
2,059
0
python,django,facebook,facebook-graph-api,django-socialauth
The API does not let you access the user's contact number. You will have to request the user's contact details manually using a form.
0
0
0
0
2012-10-09T12:12:00.000
1
1.2
true
12,799,772
0
0
1
1
I am using django-social_auth to make users register and login via facebook. I want to access the phone number of the user. Tried searching on google and stackoverflow , but didn't find any answer. Searched the facebook docs as well. There I found that there used to be permission for 'user_mobile_phone' but it has bee...
Leanest way to prevent scripted abuse of a web app?
12,806,423
2
4
1,007
0
python,security,flask,spam-prevention
You should sit down and decide what exactly your "core" problems in the scenario of your app are, and who your likely users will be. That will help you guide the right solution. In my experience, there are a lot of different problems and solutions in this subject - and none are a "one size fits all" If you have a pro...
0
0
0
1
2012-10-09T17:59:00.000
3
0.132549
false
12,805,732
0
0
1
3
I am running flask/memcached and am looking for a lean/efficient method to prevent automated scripts from slamming me with requests and/or submitting new posts too quickly. I had the thought of including a 'last_action' time in the session cookie and checking against it each request but no matter what time I set, the s...
Leanest way to prevent scripted abuse of a web app?
14,003,551
0
4
1,007
0
python,security,flask,spam-prevention
An extremely simple method that I have used before is to have an additional input in the registration form that is hidden using CSS (i.e. has display:none). Most form bots will fill this field in whereas humans will not (because it is not visible). In your server-side code you can then just reject any POST with the inp...
0
0
0
1
2012-10-09T17:59:00.000
3
0
false
12,805,732
0
0
1
3
I am running flask/memcached and am looking for a lean/efficient method to prevent automated scripts from slamming me with requests and/or submitting new posts too quickly. I had the thought of including a 'last_action' time in the session cookie and checking against it each request but no matter what time I set, the s...
Leanest way to prevent scripted abuse of a web app?
12,806,126
4
4
1,007
0
python,security,flask,spam-prevention
There is no way to achieve this with cookies, since a malicious script can just silently drop your cookie. Since you have to support the case where a user first visits (meaning without any cookies set), there is no way to distinguish between a genuine new user and a malicious script by only considering state stored on ...
0
0
0
1
2012-10-09T17:59:00.000
3
0.26052
false
12,805,732
0
0
1
3
I am running flask/memcached and am looking for a lean/efficient method to prevent automated scripts from slamming me with requests and/or submitting new posts too quickly. I had the thought of including a 'last_action' time in the session cookie and checking against it each request but no matter what time I set, the s...
Bitnami - /opt/bitnami/python/bin/.python2.7.bin: error while loading shared libraries: libreadline.so.5
12,898,508
7
4
1,566
0
python,django,centos,bitnami
Can you execute the following and see if it solves your issue? . /opt/bitnami/scripts/setenv.sh (notice the space between the dot and the path to the script) Also what are you executing that gives you that error?
0
1
0
1
2012-10-10T08:20:00.000
1
1
false
12,814,973
0
0
1
1
I getting the below issue when firing up django or ipython notebook /opt/bitnami/python/bin/.python2.7.bin: error while loading shared libraries: libreadline.so.5 However libreadline.so.5 exists in my system after locating it as shown below root@linux:/opt/bitnami/scripts# locate libreadline.so.5 /opt/bitnami/common/li...
Django fixture in csv
12,827,105
7
4
2,175
0
python,django,csv,fixture
Django's built-in fixtures functionality doesn't support CSV. You'd need to process the file automatically using the csv module, probably in the test's setUp method.
0
0
0
0
2012-10-10T19:21:00.000
2
1.2
true
12,826,756
0
0
1
1
For a Django test I'd like to load a fixture, which is in a csv file. What is the best way to do that?
How to use a python script on a django website
12,840,259
0
0
1,101
0
python,django,webpage
In your view, you can get the form data using request object. You can pass the form values to your script and send output to your response object. It seems you didn't completely understand how django works. Please go through the tutorial again.
0
0
0
0
2012-10-11T12:26:00.000
2
0
false
12,839,509
0
0
1
1
Am new to Django but want to learn it and have covered pretty much the basics on the Django website. Here is my problem: I have written a python script which presently works in the python shell, but I want to make use of the script on my web. So that when a user goes to my website and provides the neccesary input, cli...
Exclude files from causing GAE server restart
12,847,050
0
0
94
0
python,google-app-engine,go
If you change the files that comprise your application, the application will need to restart in order to serve the new files. If this is a real sticking point for you, I would suggest hosting the files elsewhere, like a CDN. Your application and the static resources that it employs do not need to be all in the same pla...
0
1
0
0
2012-10-11T17:40:00.000
1
1.2
true
12,845,400
0
0
1
1
Is there a way to avoid GAE server restart when the file within the root of my application changes. I use Go (GAE server is python based) runtime. The intention is not to reload the server when some of my files (html, css, js files; which are under /static folder) changes. This is to avoid startup time during developm...
What Python Framework/database should I use for my webapp
12,849,885
0
0
457
0
javascript,python,database,web-applications,web-frameworks
There are many, many, many ways to do what you seem to want to do. I've been working on a home project that uses tornado.web (easy REST api), mongodb (storage, works espectially well with JSON documents), and nginx (load balancing for surges in requests). For the front-end, I'm using nginx to serve static web content...
0
0
0
0
2012-10-11T22:58:00.000
3
0
false
12,849,846
0
0
1
1
I am working on building a webapp. I have been learning Python on my own for a few months but I need help figuring out HOW to proceed with building the app, specifically which web framework/database to use. As I'm fairly new to this, I may not be using the correct terms, and I'm sure many of these things may be obvious...
PostgreSQL for Django on Elastic Beanstalk
21,391,684
5
5
2,422
1
python,django,postgresql,amazon-elastic-beanstalk
Postgre is now selectable from the AWS RDS configurations. Validated through Elastic Beanstalk application setup 2014-01-27.
0
0
0
0
2012-10-12T00:21:00.000
2
0.462117
false
12,850,550
0
0
1
1
I'm reading conflicting reports about using PostgreSQL on Amazon's Elastic Beanstalk for python (Django). Some sources say it isn't possible: (http://www.forbes.com/sites/netapp/2012/08/20/amazon-cloud-elastic-beanstalk-paas-python/). I've been through a dummy app setup, and it does seem that MySQL is the only optio...
Ultrasonic thread that runs in the background in python
12,852,400
2
0
235
0
python,multithreading,nxt-python
You used the daemon thread instead of normal thread. because this is different to normal thread. I hope so daemon thread resolve your problem.
0
0
0
1
2012-10-12T02:26:00.000
1
1.2
true
12,851,374
1
0
1
1
How do I create a thread that continuously checks for obstacles using the ultrasonic class in nxt-python 2.2.2? I want to implement it in a way that while my robot is moving it also detects obstacles in a background process and once it detects an object it will brake and do something else
Tastypie documentation generation
12,867,026
0
14
2,869
0
django,python-sphinx,tastypie,documentation-generation
Perhaps I'm completely missing the point of your question but if you are just trying to build the docs that come with the source distribution there is a Makefile in the docs directory that performs the necessary actions. You are required to specify a target output type such as html, json, latex, etc. I keep a local co...
0
0
0
1
2012-10-12T03:43:00.000
3
0
false
12,851,898
0
0
1
1
I'm trying to use auto-doc tool to generate API doc for Tastypie REST API. I tried Tastytool, but it seems not showing the API's result parameters but the model's columns. Then I tried Sphinx seems more promising since Tastypie supports Sphinx, but I can't find an example to show where & how to put comment for the API ...
Generating a url with the same GET parameters as the current page in a Django template
12,864,644
3
10
1,843
0
python,django
you could pass request.META['QUERY_STRING'] to the template. You can grab the get params before you render the template and pass them to the template and render them on the correct link. You could also build a query string from request.GET
0
0
0
0
2012-10-12T17:58:00.000
3
0.197375
false
12,864,616
0
0
1
1
I have a certain link to a url in a Django template. I would like to grab all the GET parameters of the current page url and add them to the url of the template's link. The current page might have zero GET parameters.