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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Update App Engine Tasks? | 11,308,295 | 1 | 2 | 294 | 0 | python,google-app-engine,task-queue | With pull queues, you can use modify_task_lease to set the ETA relative to the current time (even if you do not currently have the task leased).
You can't change the ETA of a pull queue task.
Each task's name remains unavailable for seven days. | 0 | 1 | 0 | 0 | 2012-07-03T04:53:00.000 | 2 | 0.099668 | false | 11,304,679 | 0 | 0 | 1 | 2 | Is it possible to update an AppEngine task in the task queue?
Specifically, changing the eta property of the task to make it run at a different time?
In my scenario, each item in my datastore has an associated task attached to it. If the element is updated, the task needs to updated with a new eta.
I currently set th... |
Update App Engine Tasks? | 11,313,223 | 1 | 2 | 294 | 0 | python,google-app-engine,task-queue | So I resolved this in the following way:
I created an entry in my Model for a task_name. When I create the element and add a new task, I allow app engine to generate an automated, unique name for the task then retrieve the name of that task and save it with the model.
This allows me to have that reference to the task. ... | 0 | 1 | 0 | 0 | 2012-07-03T04:53:00.000 | 2 | 1.2 | true | 11,304,679 | 0 | 0 | 1 | 2 | Is it possible to update an AppEngine task in the task queue?
Specifically, changing the eta property of the task to make it run at a different time?
In my scenario, each item in my datastore has an associated task attached to it. If the element is updated, the task needs to updated with a new eta.
I currently set th... |
error in accessing table created in django in the python code | 11,308,029 | 1 | 1 | 768 | 1 | python,django,linux,sqlite,ubuntu-10.04 | The exception says: no such table: search_keywords, which is quite self-explanatory and means that there is no database table with such name. So:
You may be using relative path to db file in settings.py, which resolves to a different db depending on place where you execute the script. Try to use absolute path and see ... | 0 | 0 | 0 | 0 | 2012-07-03T09:18:00.000 | 1 | 1.2 | true | 11,307,928 | 0 | 0 | 1 | 1 | Now on writing path as sys.path.insert(0,'/home/pooja/Desktop/mysite'), it ran fine asked me for the word tobe searched and gave this error:
Traceback (most recent call last):
File "call.py", line 32, in
s.save()
File
"/usr/local/lib/python2.6/dist-packages/django/db/models/base.py",
line 463, in save
self.save_... |
Efficent way to calculate Top 10, or Top X, list, across multiple time periods | 11,317,758 | 1 | 1 | 275 | 0 | python,django,sorting,time-complexity,aggregation | The short answer is No.
There is no guarantee that a Top-Ten-Of-Last-Year song was ever on a Top-Ten-Daily list (it's highly likely, but not guaranteed).
The only way to get an absolutely-for-sure Top Ten is to add up all the votes over the specified time period, then select the Top Ten. | 0 | 0 | 0 | 0 | 2012-07-03T18:18:00.000 | 3 | 1.2 | true | 11,316,815 | 0 | 0 | 1 | 2 | What I want to do: Calculate the most popular search queries for: past day, past 30 days, past 60 days, past 90 days, each calendar month, and for all time.
My raw data is a list of timestamped search queries, and I'm already running a nightly cron job for related data aggregation so I'd like to integrate this calculat... |
Efficent way to calculate Top 10, or Top X, list, across multiple time periods | 11,317,049 | 0 | 1 | 275 | 0 | python,django,sorting,time-complexity,aggregation | Could use the Counter() class, part of the high-performance container datatypes. Create a dictionary of all the searches as keys to the dictionary with a count of their frequency.
cnt = Counter()
for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:
cnt[word] += 1
print cnt
Counter({'blue': 3, 'red': 2, 'g... | 0 | 0 | 0 | 0 | 2012-07-03T18:18:00.000 | 3 | 0 | false | 11,316,815 | 0 | 0 | 1 | 2 | What I want to do: Calculate the most popular search queries for: past day, past 30 days, past 60 days, past 90 days, each calendar month, and for all time.
My raw data is a list of timestamped search queries, and I'm already running a nightly cron job for related data aggregation so I'd like to integrate this calculat... |
How to install the Django plugin for the Eric IDE? | 11,370,886 | 4 | 0 | 4,909 | 0 | python,django,ide,eric-ide | In the Plugins dropdown menu click on Plugin repository...
Make sure that the repository URL is: http://eric-ide.python-projects.org/plugins4/repository.xml and then click on update.
The Django plugin will show up in the list of available plugins, click on it and then click the download button. That should download th... | 0 | 0 | 0 | 0 | 2012-07-03T21:01:00.000 | 2 | 0.379949 | false | 11,319,116 | 0 | 0 | 1 | 1 | I can't believe I have to ask this, but I have spent almost three hours looking for the answer. Anyway, I have Eric IDE 4 installed on my linux distro. I can't seem to download any plugins to the plugins repository.
The only one I really want is the Django plugin so when I start a new project in Eric, the Django op... |
key/value store with good performance for multiple tenants | 11,319,983 | 0 | 1 | 239 | 1 | javascript,python,google-app-engine,nosql,multi-tenant | The overhead of making calls from appengine to these external machines is going to be worse than the performance you're seeing now (I would expect). why not just move everything to a non-appengine machine?
I can't speak for couch, but mongo or redis are definitely capable of handling serious load as long as they are se... | 0 | 1 | 0 | 0 | 2012-07-03T22:08:00.000 | 2 | 0 | false | 11,319,890 | 0 | 0 | 1 | 2 | im running a multi tenant GAE app where each tenant could have from a few 1000 to 100k documents.
at this moment im trying to make a MVC javascript client app (the admin part of my app with spine.js) and i need CRUD endpoints and the ability to get a big amount of serialized objects at once. for this specific job appen... |
key/value store with good performance for multiple tenants | 11,323,377 | 2 | 1 | 239 | 1 | javascript,python,google-app-engine,nosql,multi-tenant | Why not use the much faster regular appengine datastore instead of blobstore? Simply store your documents in regular entities as Blob property. Just make sure the entity size doesn't exceed 1 MB in which case you have to split up your data into more then one entity. I run an application whith millions of large Blobs th... | 0 | 1 | 0 | 0 | 2012-07-03T22:08:00.000 | 2 | 1.2 | true | 11,319,890 | 0 | 0 | 1 | 2 | im running a multi tenant GAE app where each tenant could have from a few 1000 to 100k documents.
at this moment im trying to make a MVC javascript client app (the admin part of my app with spine.js) and i need CRUD endpoints and the ability to get a big amount of serialized objects at once. for this specific job appen... |
choosing an application framework to handle offline analysis with web requests | 11,328,214 | 0 | 0 | 168 | 0 | python,web | Given your background and the analysys code already being written in Python, Django + Celery seems like an obvious candidate here. We're currently using this solution for a very processing-heavy app with one front-end django server, one dedicated database server, and two distinct celery servers for the background proce... | 0 | 0 | 0 | 0 | 2012-07-04T11:02:00.000 | 1 | 0 | false | 11,327,779 | 0 | 0 | 1 | 1 | I am trying to design a web based app at the moment, that involves requests being made by users to trigger analysis of their previously entered data. The background analysis could be done on the same machine as the web server or be run on remote machines, and should not significantly impede the performance of the websi... |
Changing a datafield into a database in selenium testcase: django python | 11,331,728 | 0 | 0 | 125 | 0 | python,django,django-models,selenium | Selenium API enables you to interact with a web page and various web elements on it.
To change any value in your database will have have to do that based on which database you are using and which python methods are using to interact with this database provider.
(For eg - one will use JDBC when using Java language)
It ... | 0 | 0 | 0 | 0 | 2012-07-04T12:56:00.000 | 1 | 1.2 | true | 11,329,598 | 0 | 0 | 1 | 1 | There is this field in my database which is
package_expiry_date
, now I want to change its value from selenium test case itself to use it after a while. like extend the date by 5 days by adding
datetime.timedelta(days=5)
. How can I change its value in database table, in python selenium testcase for django. |
Does python have a tool similar to Java's JPS | 11,333,155 | 1 | 2 | 1,045 | 0 | python,process | No. Each Python script has its own independent interpreter, so there is no convenient way to list all Python processes. | 0 | 1 | 0 | 0 | 2012-07-04T17:00:00.000 | 3 | 0.066568 | false | 11,333,061 | 1 | 0 | 1 | 2 | Does Python have a tool to list python processes similar to Java's jps (http://docs.oracle.com/javase/6/docs/technotes/tools/share/jps.html)?
Edit:
Getting the pid's of python processes is relatively easy (ps -A | grep python).
What I am really looking for is a way to query a currently-running python process and find o... |
Does python have a tool similar to Java's JPS | 12,424,762 | 1 | 2 | 1,045 | 0 | python,process | The best way I've found to get the information I need is using ps -x, which gives the original command line arguments of all running processes. | 0 | 1 | 0 | 0 | 2012-07-04T17:00:00.000 | 3 | 1.2 | true | 11,333,061 | 1 | 0 | 1 | 2 | Does Python have a tool to list python processes similar to Java's jps (http://docs.oracle.com/javase/6/docs/technotes/tools/share/jps.html)?
Edit:
Getting the pid's of python processes is relatively easy (ps -A | grep python).
What I am really looking for is a way to query a currently-running python process and find o... |
Python/Django development, windows or linux? | 11,339,389 | 1 | 19 | 25,407 | 0 | python,windows,django,linux | I normally use OSX on my desktop, but I use Linux for Python because that's how it will get deployed. Specifically, I use Ubuntu Desktop in a virtual machine to develop Python applications and I use Ubuntu on the server to deploy them. This means that my understanding of library and module requirements/dependencies a... | 0 | 1 | 0 | 0 | 2012-07-05T05:43:00.000 | 5 | 0.039979 | false | 11,338,382 | 0 | 0 | 1 | 2 | I have been working on Python quite a lot recently and started reading the doc for Django, however I can't deny the fact that most of the video tutorials I find usually shows Linux as the chosen OS. I've ignored this mostly, but I started to come upon some problems with people using commands such as "touch" for which I... |
Python/Django development, windows or linux? | 11,338,865 | 27 | 19 | 25,407 | 0 | python,windows,django,linux | I used Windows for quite some time for Django development, but finally figured out that Linux is simply the better way to go. Here are some reasons why:
some Python packages can not be installed at all or correctly in Windows OR it will create a lot of hassle for you to do so
if you need to deploy your Django app it m... | 0 | 1 | 0 | 0 | 2012-07-05T05:43:00.000 | 5 | 1.2 | true | 11,338,382 | 0 | 0 | 1 | 2 | I have been working on Python quite a lot recently and started reading the doc for Django, however I can't deny the fact that most of the video tutorials I find usually shows Linux as the chosen OS. I've ignored this mostly, but I started to come upon some problems with people using commands such as "touch" for which I... |
Multiple forms in one page in DJANGO | 11,342,225 | 2 | 1 | 543 | 0 | python,django,django-forms | You can make use of AJAX for a single form submission instead of whole page submit. | 0 | 0 | 0 | 0 | 2012-07-05T07:39:00.000 | 1 | 0.379949 | false | 11,339,815 | 0 | 0 | 1 | 1 | I've been developing a django project for 1 month. So I'm new at Django. My current problem with Django is; When I have multiple forms in one page and the page is submitted for a form, the other forms field values are lost. Because they are not posted.
I've found a solution for this problem;
When there is get method,... |
In plone how can I make an uploaded file as NOT downloadable? | 11,350,843 | 3 | 1 | 362 | 0 | python,plone | Cue tune from Hotel California: "You can check out any time you like, but you can never leave."
You do not not really want to disable all downloading, I believe that you really just want to disable downloads from all users but Owner. There is no practical use for putting files into something with no vehicle for EVER... | 0 | 0 | 0 | 0 | 2012-07-05T09:05:00.000 | 2 | 0.291313 | false | 11,341,112 | 0 | 0 | 1 | 2 | I wish to make the uploaded file contents only viewable on the browser i.e using atreal.richfile.preview for doc/xls/pdf files. The file should not be downloadable at any cost. How do I remove the hyperlink for the template in a particular folder for all the files in that folder? I use Plone 4.1 There is AT at_download... |
In plone how can I make an uploaded file as NOT downloadable? | 11,355,784 | 1 | 1 | 362 | 0 | python,plone | Script (Python) at /mysite/portal_skins/archetypes/at_download Just customize to contain nothing. Thought this will be helpful to someone who would like to keep files/ image files in Plone confidential by sharing the folders with view permission and disable checkout and copy option for the role created | 0 | 0 | 0 | 0 | 2012-07-05T09:05:00.000 | 2 | 1.2 | true | 11,341,112 | 0 | 0 | 1 | 2 | I wish to make the uploaded file contents only viewable on the browser i.e using atreal.richfile.preview for doc/xls/pdf files. The file should not be downloadable at any cost. How do I remove the hyperlink for the template in a particular folder for all the files in that folder? I use Plone 4.1 There is AT at_download... |
BooleanField doesn't work (always checked) in Django 1.4 | 11,345,396 | 0 | 0 | 652 | 0 | python,django | By default it shows as active i.e checked/True.
If you want NULL value as well try using NullBooleanField | 0 | 0 | 0 | 0 | 2012-07-05T13:22:00.000 | 2 | 0 | false | 11,345,236 | 0 | 0 | 1 | 1 | I use BooleanField in my model like this:
active = models.BooleanField()
During edition in django admin, attribute 'active' is always checked, why? |
How can I periodically run a Python script to import data into a Django app? | 16,125,317 | 1 | 1 | 3,419 | 0 | python,django,data-importer | I have done the same thing.
Firstly, my script was already parsing the emails and storing them in a db, so I set the db up in settings.py and used python manage.py inspectdb to create a model based on that db.
Then it's just a matter of building a view to display the information from your db.
If your script doesn't alr... | 0 | 0 | 0 | 0 | 2012-07-05T17:30:00.000 | 8 | 0.024995 | false | 11,349,476 | 0 | 0 | 1 | 4 | I have a script which scans an email inbox for specific emails. That part's working well and I'm able to acquire the data I'm interested in. I'd now like to take that data and add it to a Django app which will be used to display the information.
I can run the script on a CRON job to periodically grab new information, b... |
How can I periodically run a Python script to import data into a Django app? | 11,349,554 | 0 | 1 | 3,419 | 0 | python,django,data-importer | When you are saying " get that data into the DJango app" what exactly do you mean?
I am guessing that you are using some sort of database (like mysql). Insert whatever data you have collected from your cronjob into the respective tables that your Django app is accessing. Also insert this cron data into the same tables... | 0 | 0 | 0 | 0 | 2012-07-05T17:30:00.000 | 8 | 0 | false | 11,349,476 | 0 | 0 | 1 | 4 | I have a script which scans an email inbox for specific emails. That part's working well and I'm able to acquire the data I'm interested in. I'd now like to take that data and add it to a Django app which will be used to display the information.
I can run the script on a CRON job to periodically grab new information, b... |
How can I periodically run a Python script to import data into a Django app? | 11,349,556 | 0 | 1 | 3,419 | 0 | python,django,data-importer | Best way?
Make a view on the django side to handle receiving the data, and have your script do a HTTP POST on a URL registered to that view.
You could also import the model and such from inside your script, but I don't think that's a very good idea. | 0 | 0 | 0 | 0 | 2012-07-05T17:30:00.000 | 8 | 0 | false | 11,349,476 | 0 | 0 | 1 | 4 | I have a script which scans an email inbox for specific emails. That part's working well and I'm able to acquire the data I'm interested in. I'd now like to take that data and add it to a Django app which will be used to display the information.
I can run the script on a CRON job to periodically grab new information, b... |
How can I periodically run a Python script to import data into a Django app? | 16,125,548 | 1 | 1 | 3,419 | 0 | python,django,data-importer | Forget about this being a Django app for a second. It is just a load of Python code.
What this means is, your Python script is absolutely free to import the database models you have in your Django app and use them as you would in a standard module in your project.
The only difference here, is that you may need to take ... | 0 | 0 | 0 | 0 | 2012-07-05T17:30:00.000 | 8 | 0.024995 | false | 11,349,476 | 0 | 0 | 1 | 4 | I have a script which scans an email inbox for specific emails. That part's working well and I'm able to acquire the data I'm interested in. I'd now like to take that data and add it to a Django app which will be used to display the information.
I can run the script on a CRON job to periodically grab new information, b... |
Scraper Google App Engine for Steam | 11,350,089 | 1 | 0 | 614 | 0 | jquery,python,html,google-app-engine,steam-web-api | Since you have the steam id from the service you can then make another request to their steam community page via the id. From there you can use beautiful soup to return a dom to grab the required information for your project.
Now onto your question. You can have all this happen within a request in a handler, if you a... | 0 | 1 | 0 | 0 | 2012-07-05T17:46:00.000 | 2 | 0.099668 | false | 11,349,709 | 0 | 0 | 1 | 1 | So basically, at the moment, we are trying to write a basic HTML 5 page that, when you press a button, returns whether the user, on Steam, is in-game, offline, or online. We have looked at the Steam API, and to find this information, it requires the person's 64 bit ID (steamID64) and we, on the website, are only given ... |
What's the difference between timer and rbtimer in uWSGI? | 11,353,126 | 11 | 5 | 826 | 0 | python,timer,uwsgi | @timer uses kernel-level facilities, so they are limited in the maximum number of timers you can create.
@rbtimer is completely userspace so you can create an unlimited number of timers at the cost of less precision | 0 | 1 | 0 | 1 | 2012-07-05T19:06:00.000 | 1 | 1.2 | true | 11,350,907 | 0 | 0 | 1 | 1 | I'm looking to add simple repeating tasks to my current application and I'm looking at the uwsgi signals api and there are two decorators @timer and @rbtimer. I've tried looking through the doc and even the python source at least but it appears it's probably more low level than that somewhere in the c implementation.
I... |
How to respond to an HTTP request using Python | 11,353,286 | 0 | 1 | 750 | 0 | python,ios,webserver,download | If you're literally just serving content (ie, not doing any calculations or look-ups), then use the nginx webserver to serve it based on URL. | 0 | 0 | 1 | 0 | 2012-07-05T22:06:00.000 | 4 | 0 | false | 11,353,206 | 0 | 0 | 1 | 1 | I am trying to write an iPhone application that uses a Python server. The iPhone application will send an HTTP request to the server, which should then respond by sending back a file that is on the server. What is the best way to do this? Thanks. |
Preventing a security breach | 11,378,667 | 1 | 0 | 2,607 | 0 | python,html,pyramid,templating | You can replace the <script>, <iframe> tags with something else or you can html encode the strings so that it appears as text on the page but is not rendered by the browser itself.
Doing a string replace of all <'s and >'s with the < and > should be more than sufficient at preventing the XSS you are seeing as well. | 0 | 0 | 0 | 0 | 2012-07-07T21:08:00.000 | 5 | 0.039979 | false | 11,378,645 | 0 | 0 | 1 | 3 | I am creating a website where you "post", and the form content is saved in a MySql database, and upon loading the page, is retrieved, similar to facebook. I construct all the posts and insert raw html into a template. The thing is, as I was testing, I noticed that I could write javascript or other HTML into the form ... |
Preventing a security breach | 11,378,727 | 0 | 0 | 2,607 | 0 | python,html,pyramid,templating | It's a little out there, but you could write a block of code to recognize certain key aspects of html/javascript codes and act accordingly. recognize the block, for example, and either not allow that query to be passed or edit it so it's no longer valid html.... | 0 | 0 | 0 | 0 | 2012-07-07T21:08:00.000 | 5 | 0 | false | 11,378,645 | 0 | 0 | 1 | 3 | I am creating a website where you "post", and the form content is saved in a MySql database, and upon loading the page, is retrieved, similar to facebook. I construct all the posts and insert raw html into a template. The thing is, as I was testing, I noticed that I could write javascript or other HTML into the form ... |
Preventing a security breach | 11,379,323 | 8 | 0 | 2,607 | 0 | python,html,pyramid,templating | Well, for completeness of the picture I'd like to mention that there are two places where you can sanitize user input in Pyramid - on the way in, before saving data in the database, and on the way out, before rendering the data in the template. Arguably, there's nothing wrong with storing HTML/JavaScript in the databas... | 0 | 0 | 0 | 0 | 2012-07-07T21:08:00.000 | 5 | 1 | false | 11,378,645 | 0 | 0 | 1 | 3 | I am creating a website where you "post", and the form content is saved in a MySql database, and upon loading the page, is retrieved, similar to facebook. I construct all the posts and insert raw html into a template. The thing is, as I was testing, I noticed that I could write javascript or other HTML into the form ... |
Reading RSS feeds in php or python/something else? | 15,361,568 | 0 | 0 | 269 | 0 | php,python,symfony | Is solved this by adding a usleep() function at the end of each iteration of a feed. This drastically lowered cpu and memory consumption. The process used to take about 20 minutes, and now only takes around and about 5! | 0 | 0 | 0 | 1 | 2012-07-08T09:43:00.000 | 3 | 1.2 | true | 11,382,163 | 0 | 0 | 1 | 2 | I currently am developing a website in the Symfony2 framework, and i have written a Command that is run every 5 minutes that needs to read a tonne of RSS news feeds, get new items from it and put them into our database.
Now at the moment the command takes about 45 seconds to run, and during those 45 seconds it also tak... |
Reading RSS feeds in php or python/something else? | 11,393,069 | 0 | 0 | 269 | 0 | php,python,symfony | You could try to check Cache-Headers of the feeds first before parsing them.
This way you can save the expensive parsing operations on probably a lot of feeds.
Store a last_updated date in your db for the source and then check against possible cache headers. There are several, so see what fits best or is served the mos... | 0 | 0 | 0 | 1 | 2012-07-08T09:43:00.000 | 3 | 0 | false | 11,382,163 | 0 | 0 | 1 | 2 | I currently am developing a website in the Symfony2 framework, and i have written a Command that is run every 5 minutes that needs to read a tonne of RSS news feeds, get new items from it and put them into our database.
Now at the moment the command takes about 45 seconds to run, and during those 45 seconds it also tak... |
How to delete an app from a django project | 11,382,790 | 0 | 27 | 47,184 | 0 | python,django | It depends on the app (how it was installed, how it was used, etc) but usually you can remove app from INSTALLED_APPS and then delete its tables in the database. | 0 | 0 | 0 | 0 | 2012-07-08T11:22:00.000 | 3 | 0 | false | 11,382,734 | 0 | 0 | 1 | 2 | Initially I made 2 apps (app_a and app_b) in a single project in Django. Now I want to delete one (say app_a). How should I do so? Is removing the app name from INSTALLED_APPS in the settings file sufficient? |
How to delete an app from a django project | 11,382,770 | 51 | 27 | 47,184 | 0 | python,django | You need to remove or check the following:
Remove the app from INSTALLED_APPS.
Remove any database tables for the models in that app (see app_name_model_name in your database).
Check for any imports in other apps (it could be that they're importing code from that app).
Check templates if they are using any template ta... | 0 | 0 | 0 | 0 | 2012-07-08T11:22:00.000 | 3 | 1.2 | true | 11,382,734 | 0 | 0 | 1 | 2 | Initially I made 2 apps (app_a and app_b) in a single project in Django. Now I want to delete one (say app_a). How should I do so? Is removing the app name from INSTALLED_APPS in the settings file sufficient? |
getting javascript form content with python | 11,383,885 | 0 | 2 | 453 | 0 | javascript,python,xml,forms | Is your system a web application, If so your javascript can post to python back-end using ajax. Then you can encrypt a form to json string and send to back-end, in back en you can parse that string into python variable... Javascript it self does not have access to your local file except you run it local (but it's reall... | 0 | 0 | 1 | 0 | 2012-07-08T14:14:00.000 | 2 | 0 | false | 11,383,796 | 0 | 0 | 1 | 1 | I am a novice python programmer and I am having troubles finding a tool to help me get a form from a javascript. I have written a small script in python and also have a simple interface done in javascript. The user needs to select a few items in the browser and the javascript then returns a sendForm(). I would like to ... |
Django views and templates, including Jinja2 and Mako, tutorials and resources | 11,388,002 | 0 | 0 | 589 | 0 | python,django,jinja2,mako | We use Mako in our workplace, and I highly recommend not using it. It's great for your own views, but if you want to use ANY third party libraries that include templates, they simply won't work.
Other than that, the official documentation, and googling for specific problems you're having is the best way to go when usin... | 0 | 0 | 0 | 0 | 2012-07-09T00:54:00.000 | 2 | 0 | false | 11,387,972 | 0 | 0 | 1 | 1 | I'm new to Python and Django, but now have a pretty firm understanding of basic database and back end programming. However, I am finding it hard to learn the views and templates layers. I was wondering if anyone can suggest additional tutorials and resources, other than the official Django documentation.
I am also new ... |
How to delete project in django | 52,744,961 | 0 | 17 | 46,212 | 0 | python,django,project | Yes.
Just Delete the folder. If the project is installed in your settings.py, remove it. | 0 | 0 | 0 | 0 | 2012-07-09T08:26:00.000 | 4 | 0 | false | 11,391,424 | 0 | 0 | 1 | 4 | Initially, I had a single project in Django now I want to delete the last project and start a fresh new project with the same name as the last one. How should I do so? Can deleting the project folders be sufficient. |
How to delete project in django | 32,165,971 | 0 | 17 | 46,212 | 0 | python,django,project | As @Neverbackdown said deleting folder would be sufficient, but along with that you would also want to delete database or tables. | 0 | 0 | 0 | 0 | 2012-07-09T08:26:00.000 | 4 | 0 | false | 11,391,424 | 0 | 0 | 1 | 4 | Initially, I had a single project in Django now I want to delete the last project and start a fresh new project with the same name as the last one. How should I do so? Can deleting the project folders be sufficient. |
How to delete project in django | 60,130,219 | 3 | 17 | 46,212 | 0 | python,django,project | To delete the project you can delete the project folder.
But this method is good only if you use SQLite as a database.
If you use any other database like Postgresql with Django, you need to delete the database manually.
If you are on VPS. Simply go to the folder where your project folder resides and put command rm -r p... | 0 | 0 | 0 | 0 | 2012-07-09T08:26:00.000 | 4 | 0.148885 | false | 11,391,424 | 0 | 0 | 1 | 4 | Initially, I had a single project in Django now I want to delete the last project and start a fresh new project with the same name as the last one. How should I do so? Can deleting the project folders be sufficient. |
How to delete project in django | 11,391,460 | 28 | 17 | 46,212 | 0 | python,django,project | Deleting the project folder is sufficient and make changes in your apache server too[if you have one]. | 0 | 0 | 0 | 0 | 2012-07-09T08:26:00.000 | 4 | 1.2 | true | 11,391,424 | 0 | 0 | 1 | 4 | Initially, I had a single project in Django now I want to delete the last project and start a fresh new project with the same name as the last one. How should I do so? Can deleting the project folders be sufficient. |
What are the limitations of using Django nonrel with Google App Engine? | 11,398,730 | 2 | 1 | 341 | 0 | django,google-app-engine,google-cloud-datastore,python-2.7 | The big limitation is that the datastore doesn't do JOINs, so anything that uses JOINS, like many-to-many relations won't work.
Any packages/middleware that uses many-to-many won't work, but others will.
For example, the sessions/auth middleware will work. But if you use permissions with auth, it won't. If you use th... | 0 | 0 | 0 | 0 | 2012-07-09T13:39:00.000 | 1 | 1.2 | true | 11,396,216 | 0 | 0 | 1 | 1 | I understand that full django can be used out of the box with CloudSQL. But I'm interested in using HRD. I'd like to learn more about what percentage of django can be used with nonrel. Does middleware work? How about other features of the framework like i18n, forms, etc. Also does nonrel work with NDB?
The background h... |
python on heroku. Get SIGHUP error | 11,418,565 | 0 | 0 | 159 | 0 | python,ruby,heroku | If you are running locally, you can also just run the flask app from the command line using python, skipping Foreman altogether. This is how I run locally on my Windows 7 machines. | 0 | 0 | 0 | 0 | 2012-07-10T14:59:00.000 | 2 | 0 | false | 11,416,158 | 0 | 0 | 1 | 1 | On working through HEROKU's guide to getting Python app to run on HEROKU and one first creates a hello world program ostensibly using python and flask and runs it locally using Foreman. I get an 'unsupported signal SIGHUP' from Ruby/Gems/foreman/engine. I am Running Win7. Anybody else hit this problem or have any ideas... |
request.accept_language is always null in python | 11,420,889 | 2 | 0 | 519 | 0 | python,pylons | Try looking at request.headers['accept-language'], or indeed the entire request.headers object. I suspect your browser is not providing those headers.
Also, take a look at the browser request in wireshark, and the client request on the server. | 0 | 0 | 1 | 0 | 2012-07-10T18:50:00.000 | 1 | 0.379949 | false | 11,419,922 | 0 | 0 | 1 | 1 | In pylons project when I do request.accept_language.best_matches(), it is returning me Null. I have set 2 languages in browser (en-us and es-ar) by going to Preferences-Content- Languages in firefox.
How can I get the languages specified in the browser?
repr(request.accept_language) gives <NilAccept: <class 'webob.acce... |
how to darw the image faster in canvas | 11,427,225 | 1 | 0 | 41 | 0 | javascript,python | It takes time for the image to get from your phone to your server to your desktop client. There's nothing you can do to change that.
The best you can hope to do is to benchmark your entire application, figure out where are your bottlenecks, and hope it's not the network connection itself. | 1 | 0 | 0 | 0 | 2012-07-11T06:57:00.000 | 1 | 0.197375 | false | 11,427,168 | 0 | 0 | 1 | 1 | I am capturing mobile snapshot(android) through monkeyrunner and with the help of some python script(i.e. for socket connection),i made it to display in an html page.but there is some time delay between the image i saw on my browser and that one on the android device.how can i synchronise these things so that the mobil... |
What's the difference between a django package and a python library? | 11,429,918 | 8 | 5 | 1,364 | 0 | python,django | A Django package has the general structure of a Django app (models.py, views.py, et cetera) and it can have additional settings to define in your settings.py file. Using the Django package makes it easier to integrate the functionality into your Django web application rather than simply calling a Python library.
Usuall... | 0 | 0 | 0 | 0 | 2012-07-11T09:44:00.000 | 1 | 1.2 | true | 11,429,862 | 0 | 0 | 1 | 1 | I'm new to django and I've been browsing around the djangopackages site. I'm wondering what is the difference between those "django" packages, and python libraries that are not django packages.
So for example sendgrid has a django package and also a few regular python libraries. If I want to use the sendgrid wrapper f... |
python mechanize odd .read() output | 11,458,357 | 0 | 0 | 155 | 0 | python,mechanize | Problem solved:
If you are getting similar output, check the page headers as it is probably gzipped after instantiating the browser set set_handle_gzip(True) | 0 | 0 | 0 | 1 | 2012-07-11T16:09:00.000 | 1 | 1.2 | true | 11,436,837 | 0 | 0 | 1 | 1 | I am looking for help debugging Mechanize. When I navigate to a page and attempt to call .read(), I get non-unicode result about 1 out of every 5 or so attempts. The non-unicode result looks like the following:
úRW!¤cêLÒ0T¸²ÖþF\<äs +€²Ü@9‚ÈøMq1;=®}ÿ½8¹WP[ëæåñ±øþûÚc!ˆÍzòØåŸ¿þUüþf>àSÕ‹‚~é÷bƪ}Ãp#',®ˆâËýÊæÚ³õµÊZñMyô‘;–s... |
Django Access File on Server | 11,471,280 | 1 | 1 | 846 | 0 | python,ios,django,apple-push-notifications | Never mind, I tried it again using an absolute file path, and it worked after I restarted Django. | 0 | 0 | 0 | 0 | 2012-07-12T04:47:00.000 | 1 | 0.197375 | false | 11,445,143 | 0 | 0 | 1 | 1 | I'm using Django to send iOS push notifications. To do that, I need to access a .pem certificate file currently stored on the server in my app directory along with views.py, models.py, admin.py, etc. When I try to send a push notification from a python shell on the server, everything works fine. But when I try to se... |
Django reverse internalization/localization | 11,445,895 | 0 | 3 | 302 | 0 | python,django,localization,internationalization,timezone | Time zones is rather simple to implement. Simply use pytz and/or dateutil. Your question is quite broad, can you give an example of specific language issues you're facing? | 0 | 0 | 0 | 0 | 2012-07-12T06:01:00.000 | 2 | 0 | false | 11,445,815 | 0 | 0 | 1 | 1 | This is quite different question. We have a django web application in an European language. Now we want same app in English language.
I guess if I just follow the django internalization/localization steps in reverse order, I will be able to make the app in English (The original code was written by someone else). But I... |
Change db.ComputedProperty from StringProperty to TextProperty | 11,497,014 | 0 | 1 | 156 | 0 | python,google-app-engine,text,properties | Have your computed property return an instance of db.Text instead of a String. As Wooble points out, though, there's absolutely no point in doing this: the computed property exists to aid indexing, and if you're not indexing the data, you may as well use a regular property and not store it in the datastore at all. | 0 | 0 | 0 | 0 | 2012-07-12T16:05:00.000 | 1 | 0 | false | 11,455,969 | 0 | 0 | 1 | 1 | I am kind of new to GAE and I was trying to use @db.ComputedProperty to dynamically add field values
However I am getting the error message
Property xxxx is 721 bytes long; it must be 500 or less. Consider Text instead, which can store strings of any length.
It seems that @db.ComputedProperty defaults to StringProperty... |
Google App Engine - Choosing the right direction | 11,460,359 | 4 | 0 | 2,564 | 0 | python,django,google-app-engine,webapp2 | The short answer is you can probably go either way, there will be some pros/some cons, but I don't think either is pure win.
Here's some pros for using Django-nonrel as a newb:
The django docs are generally pretty good. So it helps you get up to speed on some best practices
CSRF protection
Form validation
sessions
au... | 0 | 1 | 0 | 0 | 2012-07-12T19:13:00.000 | 3 | 0.26052 | false | 11,458,969 | 0 | 0 | 1 | 1 | I started web development 2 weeks ago using GAE,WebApp2,Jinja2 and WTForms.
I read though several articles , discussions , watched lessons about web development with gae (udacity) and started a small project.
Now I am very inexperienced in web-development and I don't know which path i should choose.
.
.
The last few da... |
Google App Engine + Google Cloud Storage + Sqlite3 + Django/Python | 11,498,320 | 0 | 1 | 2,078 | 1 | python,django,sqlite,google-app-engine,google-cloud-storage | No. SQLite requires native code libraries that aren't available on App Engine. | 0 | 1 | 0 | 0 | 2012-07-12T23:44:00.000 | 3 | 1.2 | true | 11,462,291 | 0 | 0 | 1 | 2 | since it is not possible to access mysql remotely on GAE, without the google cloud sql,
could I put a sqlite3 file on google cloud storage and access it through the GAE with django.db.backends.sqlite3?
Thanks. |
Google App Engine + Google Cloud Storage + Sqlite3 + Django/Python | 11,463,047 | 0 | 1 | 2,078 | 1 | python,django,sqlite,google-app-engine,google-cloud-storage | Google Cloud SQL is meant for this, why don't you want to use it?
If you have every frontend instance load the DB file, you'll have a really hard time synchronizing them. It just doesn't make sense. Why would you want to do this? | 0 | 1 | 0 | 0 | 2012-07-12T23:44:00.000 | 3 | 0 | false | 11,462,291 | 0 | 0 | 1 | 2 | since it is not possible to access mysql remotely on GAE, without the google cloud sql,
could I put a sqlite3 file on google cloud storage and access it through the GAE with django.db.backends.sqlite3?
Thanks. |
Set up Python on Windows to not type "python" in cmd | 67,924,065 | 2 | 27 | 17,143 | 0 | python,windows,path,cmd | I also had the same issue...
I could fix it by re-associating *.py files with the python launcher.
Right click on a *.py file and open its properties.
Click on the Change button of the "Opens with..." section
Select More apps -> Look for another app on this PC.
Then browse to your windows folder (by default: "C:\Windo... | 0 | 1 | 0 | 0 | 2012-07-13T14:47:00.000 | 4 | 0.099668 | false | 11,472,843 | 0 | 0 | 1 | 1 | How do I have to configure so that I don't have to type python script.py but simply script.py in CMD on Windows?
I added my python directory to %PATH% that contains python.exe but still scripts are not run correctly.
I tried it with django-admin.py Running django-admin.py startproject mysite gives me
Type 'django-admi... |
Throttling brute force login attacks in Django | 11,477,465 | 5 | 30 | 18,059 | 0 | python,django,security,brute-force | You can:
Keep track of the failed login attempts and block the attacker after 3 attempts.
If you don't want to block then you can log it and present a CAPTCHA to make it more difficult in future attempts.
You can also increase the time between login attempts after eached failed attempt. For example, 10 seconds, 30 sec... | 0 | 0 | 0 | 0 | 2012-07-13T19:26:00.000 | 3 | 0.321513 | false | 11,477,067 | 0 | 0 | 1 | 1 | Are there generally accepted tactics for protecting Django applications against this kind of attack? |
Eclipse randomly replacing tabs with spaces | 11,488,572 | 2 | 1 | 166 | 0 | python,eclipse,pydev | This was originally a comment on the OP, but turned out to be the correct answer, so I'm reposting.
The setting to replace tabs with spaces exists in two places in eclipse:
General > Editors > Text Editors
Pydev > Editor
Both these settings need to be set correctly in order to solve this problem as they can override ... | 0 | 0 | 0 | 0 | 2012-07-14T22:45:00.000 | 2 | 1.2 | true | 11,487,954 | 0 | 0 | 1 | 1 | I'm editing django files in Eclipse Indigo with pydev. Suddenly in one file, eclipse has decided to start using four spaces instead of tabs. The file has a .py extension. It's fine in other files, it's just this one that it's having trouble with. The settings are correct for using tabs. I've tried closing and reop... |
Use Satchmo subscription to the store itself | 12,105,661 | 0 | 0 | 118 | 0 | python,django,e-commerce,satchmo | You can listen to satchmo_store.shop.signals.order_success and include in your listener all the required steps for self subscription (user to group, object creation etc.,..). | 0 | 0 | 0 | 0 | 2012-07-15T10:11:00.000 | 1 | 0 | false | 11,491,089 | 0 | 0 | 1 | 1 | I'm trying to set up Satchmo, and I found this cool Subscription Product, but what I want is make a members-only section on the site (a multiple store website) itself. In other words, I want the users to make subscriptions to be able to use certain features. Is this possible in Satchmo?
I guess if my website is called ... |
Nothing happens when I do: python manage.py command | 58,411,790 | 0 | 5 | 14,807 | 0 | python,django,django-admin | If you had your server running till one point and a certain action/change broke it, try going back to the previous state.
In my case there was an email trigger which would put the system in an invalid state if email doesn't go through. Doing git stash followed by selectively popping the stash and trying the runserver h... | 0 | 0 | 0 | 0 | 2012-07-15T11:34:00.000 | 10 | 0 | false | 11,491,529 | 0 | 0 | 1 | 4 | I'm new to django and currently going through the main tutorial. Even though it was working earlier, when I do python manage.py runserver OR python manage.py -h OR with any other command, the shell doesn't output anything. Wondering what I'm doing wrong. |
Nothing happens when I do: python manage.py command | 61,670,225 | 1 | 5 | 14,807 | 0 | python,django,django-admin | Please try this.
Uninstall Python.
Go inside C drive and search Django. You will get many Django related files.
Delete every Django file. don't delete your Django files.
Install Python.
It's worked for me. | 0 | 0 | 0 | 0 | 2012-07-15T11:34:00.000 | 10 | 0.019997 | false | 11,491,529 | 0 | 0 | 1 | 4 | I'm new to django and currently going through the main tutorial. Even though it was working earlier, when I do python manage.py runserver OR python manage.py -h OR with any other command, the shell doesn't output anything. Wondering what I'm doing wrong. |
Nothing happens when I do: python manage.py command | 63,147,601 | 0 | 5 | 14,807 | 0 | python,django,django-admin | if you are using Redis Server on Windows, check it out if Redis Server is running, I had same problem and realized my Redis Server was not running, I ran it and now my manage.py commands work fine. | 0 | 0 | 0 | 0 | 2012-07-15T11:34:00.000 | 10 | 0 | false | 11,491,529 | 0 | 0 | 1 | 4 | I'm new to django and currently going through the main tutorial. Even though it was working earlier, when I do python manage.py runserver OR python manage.py -h OR with any other command, the shell doesn't output anything. Wondering what I'm doing wrong. |
Nothing happens when I do: python manage.py command | 63,864,484 | 0 | 5 | 14,807 | 0 | python,django,django-admin | The same happened with me also, but this issue is a minor one as it happens if you have multiple versions of Python on your system, you can select a specific Python version by running python3 or whichever version you want.
SO you should start from the beginning, uninstall Django first then,
create a virtual environment... | 0 | 0 | 0 | 0 | 2012-07-15T11:34:00.000 | 10 | 0 | false | 11,491,529 | 0 | 0 | 1 | 4 | I'm new to django and currently going through the main tutorial. Even though it was working earlier, when I do python manage.py runserver OR python manage.py -h OR with any other command, the shell doesn't output anything. Wondering what I'm doing wrong. |
Is there any way to upload a very large file use django on nginx? | 11,502,051 | 0 | 5 | 3,455 | 0 | python,django,apache,nginx,webserver | Nginx is probably the best http server, there is no need to replace it. I will advise you to upload very large files via ftp or nfs share. | 0 | 0 | 0 | 0 | 2012-07-16T09:52:00.000 | 4 | 0 | false | 11,501,950 | 0 | 0 | 1 | 1 | I use django to run my website and nginx for front webserver ,
but when i upload a very large file to my site,
it take me very long time ,
there is some thing wrong when nginx hand upload large file;
the nginx will send the file to django after receive all my post file;
so this will take me more time;
i want to find s... |
Python web framework suggestion for a web service | 11,505,774 | 2 | 0 | 170 | 0 | python,json,web-services,web-frameworks | I'm no doubt going to be shot down for this answer, but it needs to be said...
You're going to write a service that allows tens of transfers a second, with very large file sizes... Uptime is going to be essential and so is transfer speeds etc...
If this is for a business, and not just a personal pet project get the per... | 0 | 0 | 1 | 0 | 2012-07-16T13:20:00.000 | 1 | 1.2 | true | 11,505,231 | 0 | 0 | 1 | 1 | I'm gonna write a web service which will allow upload/download of files, managing permissions and users. It will be the interface to which a Desktop app or Mobile App will communicate. I was wondering which of the web frameworks I should use to to that?
It is a sort of remote storage for media files.
I am going to host... |
python website language detection | 11,507,534 | 2 | 5 | 4,124 | 0 | python,scrapy,web-crawler,language-detection | If the sites are multilanguage you can send the "Accept-Language:en-US,en;q=0.8" header and expect the response to be in english. If they are not, you can inspect the "response.headers" dictionary and see if you can find any information about the language.
If still unlucky, you can try mapping the IP to the country and... | 0 | 0 | 1 | 0 | 2012-07-16T15:16:00.000 | 8 | 0.049958 | false | 11,507,279 | 0 | 0 | 1 | 1 | i am writing a Bot that can just check thousands of website either they are in English or not.
i am using Scrapy (python 2.7 framework) for crawling each website first page ,
can some one suggest me which is the best way to check website language ,
any help would be appreciated. |
GoogleAppEngine error: rdbms_mysqldb.py:74 | 11,533,684 | 1 | 3 | 1,146 | 1 | google-app-engine,python-2.7 | it's been a while, but I believe I've previously fixed this by adding import rdbms to dev_appserver.py
hmm.. or was that import MySQLdb? (more likely) | 0 | 1 | 0 | 0 | 2012-07-17T10:25:00.000 | 3 | 0.066568 | false | 11,520,573 | 0 | 0 | 1 | 2 | Trying to do HelloWorld on GoogleAppEngine, but getting the following error.
C:\LearningGoogleAppEngine\HelloWorld>dev_appserver.py helloworld
WARNING 2012-07-17 10:21:37,250 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
Traceback (most recent call last):
File "C:... |
GoogleAppEngine error: rdbms_mysqldb.py:74 | 12,513,978 | 0 | 3 | 1,146 | 1 | google-app-engine,python-2.7 | just had the exact same error messages: I found that restarting Windows fixed everything and I did not have to deviate from the YAML or py file given on the google helloworld python tutorial. | 0 | 1 | 0 | 0 | 2012-07-17T10:25:00.000 | 3 | 0 | false | 11,520,573 | 0 | 0 | 1 | 2 | Trying to do HelloWorld on GoogleAppEngine, but getting the following error.
C:\LearningGoogleAppEngine\HelloWorld>dev_appserver.py helloworld
WARNING 2012-07-17 10:21:37,250 rdbms_mysqldb.py:74] The rdbms API is not available because the MySQLdb library could not be loaded.
Traceback (most recent call last):
File "C:... |
view in base.html django | 56,405,887 | 0 | 0 | 1,353 | 0 | python,django,view | add to setting.py part of TEMPLATE append to context_processors list -> app_name.view.base, | 0 | 0 | 0 | 0 | 2012-07-17T14:30:00.000 | 4 | 0 | false | 11,524,756 | 0 | 0 | 1 | 1 | I have notification scrollbar like on fb or twitter. Top menu.html is directly included by base.html Unfortunatelly, I can use only User method there. Is it possible to not write in every view that I need notifications? I want to once paste in one view and have it always in top menu.html which is in base!
from intarfac... |
When does the App Engine scheduler use a new thread vs. a new instance? | 11,857,757 | 0 | 60 | 2,794 | 0 | python,google-app-engine | If I set threadsafe: true in my app.yaml file, what are the rules that govern when a new instance will be created to serve a request, versus when a new thread will be created on an existing instance?
Like people are saying here, if a previous instance is already using 10 threads, a new instance with a new thread would... | 0 | 1 | 0 | 0 | 2012-07-17T15:23:00.000 | 3 | 0 | false | 11,525,717 | 1 | 0 | 1 | 1 | If I set threadsafe: true in my app.yaml file, what are the rules that govern when a new instance will be created to serve a request, versus when a new thread will be created on an existing instance?
If I have an app which performs something computationally intensive on each request, does multi-threading buy me anythin... |
Selenium stuck loading frame with basic authentication | 11,547,170 | 0 | 0 | 230 | 0 | python,selenium,webdriver,frame,basic-authentication | Solution: go to the url of the frame itself, and set page load timeout on that page | 0 | 0 | 1 | 0 | 2012-07-17T19:25:00.000 | 1 | 0 | false | 11,529,450 | 0 | 0 | 1 | 1 | I'm using selenium in python to check the page of a website that uses basic authentication on one frame. I'm checking to see if the password I am entering is correct or not, so the basic authentication often gets stuck because the password is wrong. Normally I use sel.set_page_load_timeout(8) and then catch the excepti... |
Flask SQLAlchemy query, specify column names | 68,064,416 | 2 | 183 | 191,024 | 1 | python,sqlalchemy,flask-sqlalchemy | result = ModalName.query.add_columns(ModelName.colname, ModelName.colname) | 0 | 0 | 0 | 0 | 2012-07-17T20:16:00.000 | 10 | 0.039979 | false | 11,530,196 | 0 | 0 | 1 | 1 | How do I specify the column that I want in my query using a model (it selects all columns by default)? I know how to do this with the sqlalchmey session: session.query(self.col1), but how do I do it with with models? I can't do SomeModel.query(). Is there a way? |
How to get Django to use an updated python on Mac OS X server? | 11,531,064 | 1 | 0 | 251 | 0 | django,python-2.7,osx-server | Install it against the updated Python. | 0 | 1 | 0 | 0 | 2012-07-17T21:18:00.000 | 2 | 0.099668 | false | 11,531,025 | 0 | 0 | 1 | 1 | I am using Django on my Mac OS X server. Things are fine, so far. I have been using python 2.6.1 and all works well. I upgraded Python to version 2.7.3. Invoking python in the terminal brings up version 2.7.3, as expected. Checking Django using the {% debug %) reveals that Django is still using the original python 2.6.... |
What are the problems with loading CSS and JS from Django to IIS7? | 11,539,473 | 5 | 3 | 2,367 | 0 | python,django,iis-7,iis-7.5 | Right click on your website in IIS7 manager and
add a virtual directory
name it with the same name of your folder you want IIS to handle. lets say static
add the path to your real static folder in your application mine was in myproject/static then ok
and here you go :) | 0 | 0 | 0 | 0 | 2012-07-18T09:46:00.000 | 3 | 1.2 | true | 11,538,607 | 0 | 0 | 1 | 1 | I successfully deployed my Django site to IIS7 but I still have problems about how to configure IIS to serve the static files. I tried many many things from the internet but nothing seems to work. Everything is working fine on Django server (manage.py runserver) and with debug = True, but as soon as I turn off debug (d... |
html5 checker compilation | 26,174,556 | 0 | 3 | 218 | 0 | java,python,html,symfony,liipfunctionaltestbundle | As noted above:
You need to install JDK, not only JRE. That is because you need java compiler. | 0 | 0 | 0 | 1 | 2012-07-18T11:48:00.000 | 1 | 0 | false | 11,540,645 | 0 | 0 | 1 | 1 | I would like to use html5 validator from LiipFunctionalTestBundle in my Symfony2 project.
So, I followed instructions on bundle's github page, but I got this error during python build:
IOError: [Errno 2] No such file or directory: './syntax/relaxng/datatype/java/dist/html5-datatypes.jar'
indeed, there is a "dist" fol... |
How to make Django unit-tests all retrieve from the same test database? | 11,544,226 | 0 | 0 | 133 | 0 | python,database,django,unit-testing | This is the default behavior of Django's transactional test case to perform a rollback after each test.
There is nothing preventing you, though, to have a module function, test case method or to override TestCase.setUp() to dynamically create test data. In fact, whenever you find yourself duplicating code, like creati... | 0 | 0 | 0 | 0 | 2012-07-18T13:32:00.000 | 1 | 1.2 | true | 11,542,640 | 0 | 0 | 1 | 1 | Currently when I run a set of unit-tests on Django, each test makes its own database. This means that traversing multiple features of the site all require a user sign up, login, etc.. It would be much simpler if they all fetched from the same temporary database - anyway to do this? |
Is it possible to TDD when writing a test runner? | 11,546,149 | 10 | 2 | 123 | 0 | python,django,testing,tdd,bootstrapping | Yes. One of the examples Kent Beck works through in his book "Test Driven Development: By Example" is a test runner. | 0 | 0 | 0 | 1 | 2012-07-18T16:11:00.000 | 2 | 1 | false | 11,545,759 | 1 | 0 | 1 | 2 | I am currently writing a new test runner for Django and I'd like to know if it's possible to TDD my test runner using my own test runner. Kinda like compiler bootstrapping where a compiler compiles itself.
Assuming it's possible, how can it be done? |
Is it possible to TDD when writing a test runner? | 11,546,191 | 4 | 2 | 123 | 0 | python,django,testing,tdd,bootstrapping | Bootstrapping is a cool technique, but it does have a circular-definition problem. How can you write tests with a framework that doesn't exist yet?
Bootstrapping compilers can get around this problem in several ways, but it's my understanding that usually the first implementation isn't bootstrapped. Later bootstraps wo... | 0 | 0 | 0 | 1 | 2012-07-18T16:11:00.000 | 2 | 1.2 | true | 11,545,759 | 1 | 0 | 1 | 2 | I am currently writing a new test runner for Django and I'd like to know if it's possible to TDD my test runner using my own test runner. Kinda like compiler bootstrapping where a compiler compiles itself.
Assuming it's possible, how can it be done? |
How to transfer variable data from Python to Javascript without a web server? | 11,547,371 | 4 | 1 | 10,066 | 0 | javascript,python,html,file | You just need to get the data you have in your python code into a form readable by your javascript, right?
Why not just take the data structure, convert it to JSON, and then write a .js file that your .html file includes that is simply var data = { json: "object here" }; | 0 | 0 | 1 | 0 | 2012-07-18T17:37:00.000 | 6 | 1.2 | true | 11,547,150 | 1 | 0 | 1 | 1 | I'm working on automatically generating a local HTML file, and all the relevant data that I need is in a Python script. Without a web server in place, I'm not sure how to proceed, because otherwise I think an AJAX/json solution would be possible.
Basically in python I have a few list and dictionary objects that I need... |
Data structures in python: maintaining filesystem structure within a database | 11,554,828 | 2 | 4 | 1,195 | 1 | python,database,data-structures,filesystems | I suggest to follow the Unix way. Each file is considered a stream of bytes, nothing more, nothing less. Each file is technically represented by a single structure called i-node (index node) that keeps all information related to the physical stream of the data (including attributes, ownership,...).
The i-node does not... | 0 | 0 | 0 | 0 | 2012-07-19T05:50:00.000 | 2 | 0.197375 | false | 11,554,676 | 0 | 0 | 1 | 1 | I have a data organization issue. I'm working on a client/server project where the server must maintain a copy of the client's filesystem structure inside of a database that resides on the server. The idea is to display the filesystem contents on the server side in an AJAX-ified web interface. Right now I'm simply u... |
Good ways to name django projects which contain only one app | 11,555,375 | 6 | 17 | 6,056 | 0 | python,django | Usually, for projects that are going to be used by only one installation, I usually name my projects as "who will be using the system" (e.g. the organization's name) and the apps as "major features of the system".
However, if your app is really that simple that you don't expect to be using multiple apps, then django m... | 0 | 0 | 0 | 0 | 2012-07-19T06:11:00.000 | 3 | 1 | false | 11,554,892 | 0 | 0 | 1 | 1 | When creating projects which contain just a single app, what are the good ways to name the project?
I can think without any confusion how to name my app but I need a project name for it. (Can i create a app without a project? If yes, Is it good to do that ?)
[Update]
I saw some projects on github which contain single ... |
Can I format the output of logger action of a content rule as CSV in Plone 4.1? | 11,560,834 | -1 | 1 | 85 | 0 | python,plone | This can be achieved in two ways, these two methods are differentiated in Step 3:
Step 1: Records are generally written in a line in zinstance.log. (There are some instances where it is written in multiple lines, so you need to handle exceptions). So here you can use readline function to read each record.
Step 2: After... | 0 | 1 | 0 | 0 | 2012-07-19T11:20:00.000 | 1 | -0.197375 | false | 11,559,752 | 0 | 0 | 1 | 1 | I created a content rule to run a logger action, when a new content is added viz a file. When I run the view of the zinstance.log file,on linux I see all the logs. I wish to send the output for each logger action separately to another log file, so that it contains log concerned to that rule only where ever applicable i... |
passing variables to a template on a redirect in python | 11,565,405 | 1 | 7 | 6,838 | 0 | python,google-app-engine,redirect,jinja2 | The easiest way is to use HTML forms, the POST request for submitting the form should include the values on the submit. | 0 | 0 | 0 | 0 | 2012-07-19T16:32:00.000 | 2 | 0.099668 | false | 11,565,313 | 0 | 0 | 1 | 1 | I am relatively new to Python so please excuse any naive questions.
I have a home page with 2 inputs, one for a "product" and one for an "email." When a user clicks submit they should be sent to "/success" where it will say:
You have requested "product"
You will be notified at "email"
I am trying to figure out the best... |
how to prevent multiple votes from a single user | 11,565,728 | 1 | 1 | 430 | 0 | python,google-app-engine,jinja2,voting-system | Store the voting user with the vote, and check for an existing vote by the current user, using your database.
You can perform the check either before you serve the page (and so disable your voting buttons), or when you get the vote attempt (and show some kind of message). You should probably write code to handle both s... | 0 | 0 | 0 | 0 | 2012-07-19T16:53:00.000 | 2 | 1.2 | true | 11,565,662 | 0 | 0 | 1 | 1 | I am writing a web app on google app engine with python. I am using jinja2 as a templating engine.
I currently have it set up so that users can upvote and downvote posts but right now they can vote on them as many times as they would like. I simply have the vote record in a database and then calculate it right afte... |
Getting jobs from beanstalkd - timed out exception | 11,570,528 | 4 | 0 | 1,433 | 0 | python,timeout,jobs,beanstalkd,beanstalkc | Calling beanstalk.reserve(timeout=0) means to wait 0 seconds for a job to become available,
so it'll time out immediately unless a job is already
in the queue when it's called. If you want it never to time out,
use timeout=None (or omit the timeout parameter, since None is the default). | 0 | 1 | 0 | 1 | 2012-07-19T18:53:00.000 | 1 | 1.2 | true | 11,567,431 | 0 | 0 | 1 | 1 | I am using Python 2.7, beanstalkd server with beanstalkc as the client library.
It takes about 500 to 1500 ms to process each job, depending on the size of the job.
I have a cron job that will keep adding jobs to the beanstalkd queue and a "worker" that will run in an infinite loop getting jobs and processing them.
eg... |
How to invoke a python script after successfully running a Django view | 11,576,960 | 1 | 0 | 382 | 0 | python,django,django-views | Runing a script from the javascript is not a clean way to do it, because the user can close the browser, disable js ... etc. instead you can use django-celery, it let you run backgroud scripts and you can check to status of the script dynamically from a middleware. Good luck | 0 | 0 | 0 | 0 | 2012-07-20T06:35:00.000 | 3 | 1.2 | true | 11,574,025 | 0 | 0 | 1 | 1 | Lets say I have a view page(request) which loads page.html.
Now after successfully loading page.html, I want to automatically run a python script behind the scene 10 - 15 sec after the page.html loaded. How it is possible?
Also, is it possible to show the status of the script dynamically (running/ stopped/ Syntax Erro... |
How can I save my secret keys and password securely in my version control system? | 11,575,518 | 10 | 140 | 36,273 | 0 | python,django,git,version-control | I suggest using configuration files for that and to not version them.
You can however version examples of the files.
I don't see any problem of sharing development settings. By definition it should contain no valuable data. | 0 | 0 | 0 | 1 | 2012-07-20T08:11:00.000 | 17 | 1 | false | 11,575,398 | 1 | 0 | 1 | 6 | I keep important settings like the hostnames and ports of development and production servers in my version control system. But I know that it's bad practice to keep secrets (like private keys and database passwords) in a VCS repository.
But passwords--like any other setting--seem like they should be versioned. So what ... |
How can I save my secret keys and password securely in my version control system? | 11,576,543 | 4 | 140 | 36,273 | 0 | python,django,git,version-control | EDIT: I assume you want to keep track of your previous passwords versions - say, for a script that would prevent password reusing etc.
I think GnuPG is the best way to go - it's already used in one git-related project (git-annex) to encrypt repository contents stored on cloud services. GnuPG (gnu pgp) provides a very s... | 0 | 0 | 0 | 1 | 2012-07-20T08:11:00.000 | 17 | 0.047024 | false | 11,575,398 | 1 | 0 | 1 | 6 | I keep important settings like the hostnames and ports of development and production servers in my version control system. But I know that it's bad practice to keep secrets (like private keys and database passwords) in a VCS repository.
But passwords--like any other setting--seem like they should be versioned. So what ... |
How can I save my secret keys and password securely in my version control system? | 11,666,554 | 2 | 140 | 36,273 | 0 | python,django,git,version-control | Encrypt the passwords file, using for example GPG. Add the keys on your local machine and on your server. Decrypt the file and put it outside your repo folders.
I use a passwords.conf, located in my homefolder. On every deploy this file gets updated. | 0 | 0 | 0 | 1 | 2012-07-20T08:11:00.000 | 17 | 0.023525 | false | 11,575,398 | 1 | 0 | 1 | 6 | I keep important settings like the hostnames and ports of development and production servers in my version control system. But I know that it's bad practice to keep secrets (like private keys and database passwords) in a VCS repository.
But passwords--like any other setting--seem like they should be versioned. So what ... |
How can I save my secret keys and password securely in my version control system? | 11,689,937 | 3 | 140 | 36,273 | 0 | python,django,git,version-control | Provide a way to override the config
This is the best way to manage a set of sane defaults for the config you checkin without requiring the config be complete, or contain things like hostnames and credentials. There are a few ways to override default configs.
Environment variables (as others have already mentioned) ar... | 0 | 0 | 0 | 1 | 2012-07-20T08:11:00.000 | 17 | 0.035279 | false | 11,575,398 | 1 | 0 | 1 | 6 | I keep important settings like the hostnames and ports of development and production servers in my version control system. But I know that it's bad practice to keep secrets (like private keys and database passwords) in a VCS repository.
But passwords--like any other setting--seem like they should be versioned. So what ... |
How can I save my secret keys and password securely in my version control system? | 49,701,069 | 2 | 140 | 36,273 | 0 | python,django,git,version-control | This is what I do:
Keep all secrets as env vars in $HOME/.secrets (go-r perms) that $HOME/.bashrc sources (this way if you open .bashrc in front of someone, they won't see the secrets)
Configuration files are stored in VCS as templates, such as config.properties stored as config.properties.tmpl
The template files cont... | 0 | 0 | 0 | 1 | 2012-07-20T08:11:00.000 | 17 | 0.023525 | false | 11,575,398 | 1 | 0 | 1 | 6 | I keep important settings like the hostnames and ports of development and production servers in my version control system. But I know that it's bad practice to keep secrets (like private keys and database passwords) in a VCS repository.
But passwords--like any other setting--seem like they should be versioned. So what ... |
How can I save my secret keys and password securely in my version control system? | 11,713,674 | 0 | 140 | 36,273 | 0 | python,django,git,version-control | You could use EncFS if your system provides that. Thus you could keep your encrypted data as a subfolder of your repository, while providing your application a decrypted view to the data mounted aside. As the encryption is transparent, no special operations are needed on pull or push.
It would however need to mount th... | 0 | 0 | 0 | 1 | 2012-07-20T08:11:00.000 | 17 | 0 | false | 11,575,398 | 1 | 0 | 1 | 6 | I keep important settings like the hostnames and ports of development and production servers in my version control system. But I know that it's bad practice to keep secrets (like private keys and database passwords) in a VCS repository.
But passwords--like any other setting--seem like they should be versioned. So what ... |
How to bind multiple reusable Django apps together? | 11,582,196 | 6 | 22 | 5,702 | 0 | python,django,django-1.4 | Think of it in the same way that you would use any 3rd-party app in your project. "Re-usable" doesn't mean "without dependencies". On the contrary, you'd be hard-pressed to find an app that doesn't have at least one dependency, even if it's just dependent on Django or core Python libraries. (While core Python libraries... | 0 | 0 | 0 | 0 | 2012-07-20T12:19:00.000 | 4 | 1 | false | 11,579,232 | 0 | 0 | 1 | 2 | I try my best to write reusable Django apps. Now I'm puzzled how to put them all together to get the final project.
Here is an example of what I mean:
I have a picture app that stores, resizes and displays images. Also I have a weblog app that stores, edits and displays texts. Now I want to combine these two to show bl... |
How to bind multiple reusable Django apps together? | 11,579,395 | 5 | 22 | 5,702 | 0 | python,django,django-1.4 | This is a good question, and something I find quite difficult to manage also. But - do you imagine these applications being released publicly, or are you only using them yourself? If you're not releasing, I wouldn't worry too much about it.
The other thing is, dependencies are fine to have. The pictures app in your exa... | 0 | 0 | 0 | 0 | 2012-07-20T12:19:00.000 | 4 | 0.244919 | false | 11,579,232 | 0 | 0 | 1 | 2 | I try my best to write reusable Django apps. Now I'm puzzled how to put them all together to get the final project.
Here is an example of what I mean:
I have a picture app that stores, resizes and displays images. Also I have a weblog app that stores, edits and displays texts. Now I want to combine these two to show bl... |
GAE - Online admin console | 11,595,724 | 0 | 0 | 172 | 0 | python,google-app-engine | You can use remote shell, that is on your app engine sdk.
For example
~/bin/google_appengine/remote_api_shell.py -s your-app-identifier.appspot.com s~your-app-identifier
When you are inside the shell, you will have the db module enabled. in order to use your models, you will have to import them. | 0 | 1 | 0 | 0 | 2012-07-21T05:55:00.000 | 2 | 0 | false | 11,589,862 | 0 | 0 | 1 | 1 | Is there some way I can run custom python code on my google appengine app online? Is there a python console somewhere that I can use? I've seen vague references here and there, but nothing concrete. |
Get all IDs in context that come under the active filters in openerp | 11,600,778 | 1 | 1 | 753 | 0 | python,openerp,identifier | Apply your filter and change number of visible records to unlimited (press on the field [1 to 80] of 4000 which is on the right top corner of you product tree view). | 0 | 0 | 0 | 0 | 2012-07-21T06:37:00.000 | 3 | 0.066568 | false | 11,590,033 | 0 | 0 | 1 | 1 | I have created a function to export data of selected record to a csv file. For example I have opened the product tree view, there are so many filters, I have selected 'service products filter' showing 5 products, then I click on the action and then the export button in my export wizard, these 5 products shown in the tr... |
How can I define a constant for model and view in Django | 11,590,623 | 4 | 2 | 1,193 | 0 | python,django,view,model,constants | You can put it in const.py and import it in view as well as model. | 0 | 0 | 0 | 0 | 2012-07-21T08:14:00.000 | 2 | 1.2 | true | 11,590,597 | 0 | 0 | 1 | 2 | How can I define a constant so it would be available in views.py and models.py? |
How can I define a constant for model and view in Django | 11,596,732 | 0 | 2 | 1,193 | 0 | python,django,view,model,constants | It's very likely that views.py will import models.py, so normally it's recommended to put in models.py constants and any other code to be used from views.py, forms.py or any other module inside your app. | 0 | 0 | 0 | 0 | 2012-07-21T08:14:00.000 | 2 | 0 | false | 11,590,597 | 0 | 0 | 1 | 2 | How can I define a constant so it would be available in views.py and models.py? |
Simulate Key Press at hardware level - Windows | 11,598,099 | 0 | 11 | 14,658 | 0 | java,python,hardware,keystroke,simulate | I'm not on a Windows box to test it against MouseKeys, so no guarantees that it will work, but have you tried AutoHotkey? | 0 | 0 | 0 | 1 | 2012-07-22T05:08:00.000 | 4 | 0 | false | 11,597,892 | 0 | 0 | 1 | 1 | I'm looking for a language or library to allow me to simulate key strokes at the maximum level possible, without physically pressing the key.
(My specific measure of the level of the keystroke is whether or not it will produce the same output as a physical Key Press when my computer is already running key listeners (... |
How to write tests for static routes defined in app.yaml? | 11,600,406 | 1 | 1 | 120 | 0 | python,unit-testing,google-app-engine | I have a post deploy script for the staging environment that just does curl on the urls to validate they are all there. If this script passes (among other things) I will deploy from staging to production. | 0 | 1 | 0 | 1 | 2012-07-22T12:39:00.000 | 1 | 0.197375 | false | 11,600,374 | 0 | 0 | 1 | 1 | I have quite a few static files used in my Google App Engine application (CSS, robots.txt, etc.) They are all defined in app.yaml.
I want to have some automated tests that check whether those definitions in app.yaml are valid and my latest changes didn't brake anything. E.g. check that specific URLs return correct resp... |
Difference between pinax.apps.accounts, idios profiles, and django.auth.User | 14,173,262 | 1 | 2 | 674 | 0 | python,django,pinax | Profiles are meant to be used for public data, or data you'd share with other people and is also more descriptive in nature.
Account data are more like settings for you account that drive certain behavior (language or timezone settings) that are private to you and that control how various aspects of the site (or other ... | 0 | 0 | 0 | 0 | 2012-07-22T16:15:00.000 | 2 | 0.099668 | false | 11,601,907 | 0 | 0 | 1 | 1 | What's the difference between pinax.apps.accounts and the idios profiles app that were installed with the profiles base project?
As I understand it, the contrib.auth should be just for authentication purpose (i.e. username and password), and the existence of User.names and User.email in the auth model is historical an... |
Is virtualenv recommended even for single django based application on a server? | 11,609,403 | 3 | 1 | 91 | 0 | python,django,virtualenv | I'd recommend always using virtualenv, because it makes your environment more reproducible -- you can version your dependencies alongside your application, you're not tied to the versions of the python packages in your system repository, and if you need to replicate your environment elsewhere, you can do that even if y... | 0 | 0 | 0 | 0 | 2012-07-23T08:59:00.000 | 1 | 1.2 | true | 11,609,339 | 0 | 0 | 1 | 1 | If we just want to host single django application on a VPS or some cloud instance, is it still benefitial to use virtualenv ?
Or will it be an overkill , and better to use global python setup instead, as only one django application say Project X , will be hosted on that server ?
Does virtualenv provide any major benefi... |
Difference between Model and Form validation | 11,610,267 | 0 | 2 | 1,664 | 0 | python,django,forms,model | Generally models represent business entities which may be stored in some persistent storage (usually relational DB). Forms are used to render HTML forms which may retreive data from users.
Django supports creating forms on the basis of models (using ModelForm class). Forms may be used to fetch data which should be save... | 0 | 0 | 0 | 0 | 2012-07-23T09:37:00.000 | 2 | 0 | false | 11,609,943 | 0 | 0 | 1 | 1 | I'm currently working on a model that has been already built and i need to add some validation managment. (accessing to two fields and checking data, nothing too dramatic)
I was wondering about the exact difference between models and forms at a validation point of view and if i would be able to just make a clean method... |
What should I use instead of deprecated ImageWithThumbnailsField of django-sorl? | 11,617,059 | 0 | 0 | 579 | 0 | python,django,sorl-thumbnail | That must have been a very old version of sorl-thumbnail you were using. I'm not sure what that field actually did for you, but now all you have is ImageField. It serves to automatically update the thumbnail registry if you change or delete it and adds a thumbnail of the assigned image next to the form field in the adm... | 0 | 0 | 0 | 0 | 2012-07-23T16:56:00.000 | 1 | 1.2 | true | 11,616,994 | 0 | 0 | 1 | 1 | I'm struggling with ImageWithThumbnailsField which seems deprecated. What should I use instead? I don't want to rewrite large parts of my project as I'm doing only slight bugfixing and updating...
Error I'm getting:
File "/var/www/project/images/models.py", line 6, in
from sorl.thumbnail.fields import ImageWit... |
Capturing search data from other websites | 11,629,117 | 0 | 2 | 220 | 0 | php,python,search,web-scraping | You can check the http referrer and see what values have been put in the GET variable, but this is restricted to GET variables ONLY! | 0 | 0 | 1 | 0 | 2012-07-24T10:38:00.000 | 1 | 0 | false | 11,629,077 | 0 | 0 | 1 | 1 | Is there a way to capture search data from other websites? For example, if a user visits any website with a search field, I am interested in what that user types into that search field to get to the desired blogpost/webpage/product. I want to know if this is possible by scraping the site, or by any other means. Also, i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.