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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Unable to run django custom command | 66,928,557 | 0 | 2 | 2,913 | 0 | python,django | Sometimes this can happen if you haven't added your app to
INSTALLED_APPS = [ 'app', ]
in settings.py | 0 | 0 | 0 | 0 | 2012-11-08T14:04:00.000 | 3 | 0 | false | 13,290,514 | 0 | 0 | 1 | 1 | I've create a command in app/management/commands and this command was working fine. I'm unable to run this command now. I'm getting the following error:
Unknown command: 'my_custom_command_name'
I'm using a virtual env. I don't see this in list of commands when I type pythong manage.py. I've this app installed in my se... |
fake geolocation with scrapy crawler | 13,299,332 | 2 | 1 | 722 | 0 | python,web-crawler,scrapy | If the site you are scraping does IP based detection, your only option is going to be to change your IP somehow. This means either using a different server (I don't believe EC2 operates in India) or proxying your server requests. Perhaps you can find an Indian proxy service? | 0 | 0 | 1 | 0 | 2012-11-08T22:16:00.000 | 1 | 0.379949 | false | 13,298,788 | 0 | 0 | 1 | 1 | I am trying to scrape a website which serves different page depending upon the geolocation of the IP sending the request. I am using an amazon EC2 located in US(which means it serves up a page meant for US) but I want the page that will be served in India. Does scrapy provide a way to work around this somehow? |
Apache/PHP to Nginx/Tornado/Python | 13,304,821 | 6 | 5 | 2,544 | 0 | php,python,django,nginx,tornado | I'll go point by point:
Yes. It's ok to run tornado and nginx on one server. You can use nginx as reverse proxy for tornado also.
Haproxy will give you benefit, if you have more than one server instances. Also it will allow you to proxy websockets directly to tornado.
Actually, nginx can be used for redirects, with ... | 0 | 1 | 0 | 1 | 2012-11-08T22:31:00.000 | 1 | 1.2 | true | 13,299,023 | 0 | 0 | 1 | 1 | Our website has developed a need for real-time updates, and we are considering various comet/long-polling solutions. After researching, we have settled on nginx as a reverse proxy to 4 tornado instances (hosted on Amazon EC2). We are currently using the traditional LAMP stack and have written a substantial amount of ... |
Can flask (using jinja2) render templates using 'windows-1251' encoding? | 68,141,752 | 0 | 3 | 3,341 | 0 | python,crystal-reports,flask,jinja2 | In my case loaders.py had a hardcode "utf-8" in several places which I replaced with "windows-1251" and for me everything worked! | 0 | 0 | 0 | 0 | 2012-11-09T06:51:00.000 | 3 | 0 | false | 13,303,464 | 0 | 0 | 1 | 1 | I write a simple frontend for pretty old reporting system, which uses Crystal Reports 8 Web Component Server.
And I need to make a 'POST' request to this Web Component. When I'm making request from page encoded using standard UTF-8, all form data is passed in UTF-8 too. And that's the problem, because CR8 Web Component... |
Appengine Search API - Globally Consistent | 13,315,587 | 0 | 0 | 174 | 0 | python,google-app-engine,full-text-search,gae-search | This depends on whether or not you have any globally consistent indexes. If you do, then you should migrate all of your data from those indexes to new, per-document-consistent (which is the default) indexes. To do this:
Loop through the documents you have stored in the global index and reindexing them in the new index... | 0 | 1 | 0 | 0 | 2012-11-09T17:37:00.000 | 1 | 0 | false | 13,313,118 | 0 | 0 | 1 | 1 | I've been using the appengine python experimental searchAPI. It works great. With release 1.7.3 I updated all of the deprecated methods. However, I am now getting this warning:
DeprecationWarning: consistency is deprecated. GLOBALLY_CONSIST
However, I'm not sure how to address it in my code. Can anyone point me in the ... |
Django collectstatic error | 13,314,802 | 0 | 0 | 1,413 | 0 | python,django | This looks like it's caused by files being collected by collectstatic having outrageously inaccurate last modified timestamps (like before 1970). Try searching google for tools that allow you to modify your files' last modified dates and change them to something reasonable. | 0 | 0 | 0 | 0 | 2012-11-09T18:09:00.000 | 2 | 0 | false | 13,313,609 | 0 | 0 | 1 | 2 | Error:
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\core\management\__init_... |
Django collectstatic error | 14,785,611 | 0 | 0 | 1,413 | 0 | python,django | I discoreved.
This is just cause I put some fonts in /static/fonts/ and the django don't accept fonts on Static Folder. So, i changed this files to /media/fonts/.
Worked! :D | 0 | 0 | 0 | 0 | 2012-11-09T18:09:00.000 | 2 | 0 | false | 13,313,609 | 0 | 0 | 1 | 2 | Error:
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "D:\CODE\wamp\www\AMBIENTES\env\Lib\site-packages\django\core\management\__init_... |
Get list of all routes defined in the Flask app | 57,108,419 | 4 | 179 | 103,592 | 0 | python,flask | You can view all the Routes via flask shell by running the following commands after exporting or setting FLASK_APP environment variable.
flask shell
app.url_map | 0 | 0 | 0 | 0 | 2012-11-09T23:31:00.000 | 11 | 0.072599 | false | 13,317,536 | 0 | 0 | 1 | 1 | I have a complex Flask-based web app. There are lots of separate files with view functions. Their URLs are defined with the @app.route('/...') decorator. Is there a way to get a list of all the routes that have been declared throughout my app? Perhaps there is some method I can call on the app object? |
Scrapyd: How to specify libs and common folders that deployed projects can use? | 13,344,717 | 0 | 3 | 973 | 0 | python,scrapyd | I found the answer by adding mylibs to site-packages of python by using setup.py inside mylib folder. That way I could import everything inside mylib in my projects. Actually mylibs were way outside from the location where setup.py of my deploy-able project is present. setup.py looks for packages on same level and insi... | 0 | 0 | 0 | 0 | 2012-11-10T01:19:00.000 | 2 | 1.2 | true | 13,318,291 | 0 | 0 | 1 | 1 | Scrapyd is service where we can eggify deploy our projects. However I am facing a problem. I have a Project named MyScrapers whose spider classes uses an import statement as follows:
from mylibs.common.my_base_spider import MyBaseSpider
The path to my_base_spider is /home/myprojectset/mylibs/common/my_base_spider
While... |
Python Flask Modifying Page after loaded | 13,338,019 | 3 | 1 | 1,583 | 0 | python,web,flask | Short answer: you can't.
Longer answer: once you have "sent the page" (that is, you have completed a HTTP response) there is no way for you to change what was sent. You can, however, use JavaScript to make additional HTTP requests to the server, and use the HTTP responses to modify the DOM which will change the page th... | 0 | 0 | 0 | 0 | 2012-11-12T03:15:00.000 | 3 | 0.197375 | false | 13,337,924 | 0 | 0 | 1 | 1 | I have a question about using Flask with Python.
Lets say I want to make a website for some mod I'm making for a game, and I want to put in a live chat feed, how would I go around modifying the contents of the page after the page has been sent to the person? |
How to define a Model with fields filled by other data sources than database in django? | 13,399,089 | 0 | 3 | 1,001 | 0 | python,django,django-models,django-forms | I have now a partial solution. I override the Manager and in particular its all() and get() functions (because I only need those functions for now). all() returns a queryset in which I added the result of some logics that give me objects build from external datas (taken through xmlrpc in my case). I added those objects... | 0 | 0 | 0 | 0 | 2012-11-12T15:25:00.000 | 2 | 0 | false | 13,346,470 | 0 | 0 | 1 | 1 | Does anyone can tell me if it's possible to create a Model class, with some model fields and some other fields taking their data from external data sources. The point is that I would like this model to be exploited the same way as another model by ModelForm for instance. I mean if I redefine "objects" Manager of the mo... |
Installing Python modules for OpenERP 6.1 in Windows | 13,358,175 | 1 | 6 | 3,249 | 0 | python,openerp | Good question..
Openerp on windows uses a dll for python (python26.dll in /Server/server of the openerp folder in program files). It looks like all the extra libraries are in the same folder, so you should be able to download the extra libraries to that folder and restart the service. (I usually stop the service and ru... | 0 | 1 | 0 | 0 | 2012-11-12T15:38:00.000 | 2 | 0.099668 | false | 13,346,698 | 0 | 0 | 1 | 1 | I installed OpenERP 6.1 on windows using the AllInOne package. I did NOT install Python separately. Apparently OpenERP folders already contain the required python executables.
Now when I try to install certain addons, I usually come across requirements to install certain python modules. E.g. to install Jasper_Server, I... |
Ironpython: How to see when a WPF application fails? | 13,352,605 | 1 | 0 | 240 | 0 | wpf,xaml,ironpython,sharpdevelop | You could put in some code to catch the error and log it to a file.
Something possibly simpler is to compile your application as a Console Application. This can be done via Project Options - Application - Output type. Then you will get a console window when you run your WPF application and any exception that happens at... | 1 | 0 | 0 | 0 | 2012-11-12T16:22:00.000 | 1 | 1.2 | true | 13,347,378 | 0 | 0 | 1 | 1 | I am doing an application with GUI using WPF/XAML with Ironpython and SharpDevelop, until now it works fine, when I'm in the development environment I can see the errors in console and know what is wrong.
But when I build and deploy the app for us on other system or I ran it outside of the development environment and... |
QuickFIX logon trouble: multiple rapid fire logon attempts being sent | 13,368,991 | 1 | 1 | 1,050 | 0 | python,quickfix | Solved! I think there was something wrong with my datadictionary (FIX44.xml) file. I had seen a problem in it before, but thought I fixed it. I got a new copy online and dropped it in and now everything seems to be working. Maybe the bad dictionary was not letting FIX accept the logon response? | 0 | 0 | 0 | 0 | 2012-11-12T21:10:00.000 | 2 | 1.2 | true | 13,351,608 | 0 | 0 | 1 | 2 | QuickFIX logon trouble: (using QuickFIX, with FIX 4.4 in Python 2.7)
Once I do initiator.start() a connection is made, and logon message is sent. However, I don't ever see the ACK and session status message that the broker is sending back (all the overloaded Application methods are just supposed to print out what they ... |
QuickFIX logon trouble: multiple rapid fire logon attempts being sent | 13,368,881 | 2 | 1 | 1,050 | 0 | python,quickfix | Sounds like you do not have message logs enabled. If your app rejects messages below the application level (such as if the seq no is wrong, or the message is malformed), then it'll be rejected before your custom message handlers even see it.
If you are starting your Initiator with a ScreenLogStore, change it to a File... | 0 | 0 | 0 | 0 | 2012-11-12T21:10:00.000 | 2 | 0.197375 | false | 13,351,608 | 0 | 0 | 1 | 2 | QuickFIX logon trouble: (using QuickFIX, with FIX 4.4 in Python 2.7)
Once I do initiator.start() a connection is made, and logon message is sent. However, I don't ever see the ACK and session status message that the broker is sending back (all the overloaded Application methods are just supposed to print out what they ... |
Django: Implementing a nested, reusable component design | 13,397,523 | 0 | 8 | 1,068 | 0 | python,django,django-views | It is an interesting problem. Ideally you should pull all the components from database before rendering. But looking at hierarchy, making template tags makes sense. These template tag will pull appropriate data. Assume for the purpose of this problem that database query gets cached due to search locality. | 0 | 0 | 0 | 0 | 2012-11-12T21:16:00.000 | 2 | 0 | false | 13,351,694 | 0 | 0 | 1 | 1 | I'm working on a big social networking app in Django where I expect to use certain front-end components many times, and often with functionality designed in such a way that custom components contain other custom components, which might contain yet smaller subcomponents (ad infinitum). All of these components are typic... |
How to FTP into a virtual machine? | 13,353,762 | 1 | 0 | 5,276 | 0 | python,django,ftp,virtualenv,virtualbox | The reason that the the client reported back "Connection refused by server" is that the server returned a TCP packet with the reset bit set, in response to an application trying to connect to a port that is not being listened on by an application, or by a firewall.
I think that the FTP service is not running, or runn... | 0 | 1 | 0 | 0 | 2012-11-12T23:08:00.000 | 1 | 1.2 | true | 13,353,113 | 0 | 0 | 1 | 1 | I've recently started learning Django and have set up a virtual machine running a Django server on VirtualEnv. I can use the runserver command to run the basic Django installation server and view it on another computer with the local IP address.
However, I can't figure out how to connect to my virtual machine with my F... |
Robot Framework - using User Libraries | 13,602,048 | 0 | 2 | 2,367 | 0 | java,python,robotframework | Try to put your Library into this folder:
...YourPythonFolder\Lib\site-packages\
or, if this doesn't work, make in the folder "site-packages" folder with the name "MyLibrary" and put your library there.
This should work. | 0 | 0 | 0 | 1 | 2012-11-13T07:58:00.000 | 2 | 0 | false | 13,357,227 | 0 | 0 | 1 | 1 | i am facing difficulty when trying to run my tests. Here is what i did :
Create a java project with one class which has one method called hello(String name)
Exported this as a jar and kept it in the same directory where i keep my test case file.
my Test case looks like this.
Setting * * Value * * Value * * Value... |
Pros and Cons of html-output for statistical data | 13,358,764 | 3 | 0 | 196 | 0 | python,html,output,tabular | Why not do both ? Make your data available as CSV (for simple export to scripts etc.) and provide a decorated HTML version.
At some stage you may want (say) a proper Excel sheet, a PDF etc. So I would enforce a separation of the data generation from the rendering. Make your generator return a structure that can be cons... | 0 | 0 | 0 | 0 | 2012-11-13T10:03:00.000 | 2 | 0.291313 | false | 13,358,729 | 0 | 0 | 1 | 2 | I am using Python3 to calculate some statistics from language corpora. Until now I was exporting the results in a csv-file or directly on the shell. A few days ago I started learning how to output the data to html-tables. I must say I really like it, it deals perfect height/width of cell and unicodes and you can apply ... |
Pros and Cons of html-output for statistical data | 13,359,571 | 1 | 0 | 196 | 0 | python,html,output,tabular | The question lists some benefits of HTML format. These alone are sufficient for using it as one of output formats. Used that way, it does not really matter much what you cannot easily do with the HTML format, as you can use other formats as needed.
Benefits include reasonable default rendering, which can be fine-tuned ... | 0 | 0 | 0 | 0 | 2012-11-13T10:03:00.000 | 2 | 1.2 | true | 13,358,729 | 0 | 0 | 1 | 2 | I am using Python3 to calculate some statistics from language corpora. Until now I was exporting the results in a csv-file or directly on the shell. A few days ago I started learning how to output the data to html-tables. I must say I really like it, it deals perfect height/width of cell and unicodes and you can apply ... |
Asynchronous replacement for Celery | 13,429,864 | 1 | 4 | 1,476 | 0 | python,django,asynchronous,celery,gevent | Have you tried to use Celery + eventlet? It works well in our project | 0 | 1 | 0 | 0 | 2012-11-13T11:42:00.000 | 2 | 0.099668 | false | 13,360,145 | 0 | 0 | 1 | 1 | We're using Celery for background tasks in our Django project.
Unfortunately, we have many blocking sockets in tasks, that can be established for a long time. So Celery becomes fully loaded and does not respond.
Gevent can help me with sockets, but Celery has only experimental support of gevent (and as I found in prac... |
API Design - JSON or URL Parameters? | 13,365,631 | 3 | 1 | 384 | 0 | python,api,flask | The proper RESTful way of deleting a resource is to send a DELETE request, and put the scoping information in the URI (not the body), like /api/records?id=10 or /api/records/10. The method information should be in the HTTP method, not the URI.
I suggest you read "RESTful web services" to learn the best practices on API... | 0 | 0 | 0 | 0 | 2012-11-13T17:21:00.000 | 1 | 1.2 | true | 13,365,521 | 0 | 0 | 1 | 1 | I am just starting to learn how to design/write RESTful APIs. I have a general question:
Assume I have some sort of simple SQL database and I'm writing an API that allows to create a new record, view records, delete a record or update a record.
Assuming I want to delete a record, is it usually better to pass in the ID ... |
503 error with urllib and flask | 13,393,776 | 0 | 0 | 1,095 | 0 | python,json,heroku,urllib2 | nevermind I fixed it. All i did was I referenced the local json file on my computer rather than the url. | 0 | 0 | 0 | 0 | 2012-11-14T07:09:00.000 | 1 | 0 | false | 13,374,423 | 0 | 0 | 1 | 1 | When i run this Heroku app in debug mode, it works perfectly, but when I push the changes and visit the page, the page refuses to load and i get a 503 error. I can't figure out what is wrong (seeing as how debug says everything is fine :( ) [using python 2.7]
fixed. see comment |
Where does node.js fit in a stack or enhance it | 13,384,050 | 0 | 0 | 228 | 1 | python,node.js,web-applications | It would replace Python (flask/werkzeug) in both your view server and your API server. | 0 | 0 | 0 | 0 | 2012-11-14T15:51:00.000 | 1 | 1.2 | true | 13,382,262 | 0 | 0 | 1 | 1 | I am interested in learning more about node.js and utilizing it in a new project. The problem I am having is envisioning where I could enhance my web stack with it and what role it would play. All I have really done with it is followed a tutorial or two where you make something like a todo app in all JS. That is all fi... |
How to stop Django from caching dynamic templates? | 13,393,855 | 0 | 1 | 1,291 | 0 | python,django,caching | After changing your code, make sure you are restarting your server e.g. apache or fastcgi. | 0 | 0 | 0 | 0 | 2012-11-15T05:37:00.000 | 2 | 0 | false | 13,392,095 | 0 | 0 | 1 | 1 | I am really new to Django, and I'm trying have my site display a server status as text. This text, however, is dynamic. I do not understand why, if I go in my model and change the server status function to return 'cats', I don't see 'cats' appear in my browser for like 5 minutes.
From what I have learned so far, I susp... |
How to expose an NLTK based ML(machine learning) Python Script as a Web Service? | 13,399,425 | 0 | 4 | 1,090 | 0 | python,machine-learning,cherrypy | NLTK based system tends to be slow at response per request, but good throughput can be achieved given enough RAM. | 0 | 0 | 0 | 0 | 2012-11-15T09:51:00.000 | 2 | 0 | false | 13,394,969 | 0 | 1 | 1 | 1 | Let me explain what I'm trying to achieve. In the past while working on Java platform, I used to write Java codes(say, to push or pull data from MySQL database etc.) then create a war file which essentially bundles all the class files, supporting files etc and put it under a servlet container like Tomcat and this becom... |
Python long running process | 13,404,694 | 1 | 0 | 338 | 0 | python | You should use an asynchronous data approach to transfer data from a PHP script - or directly from the Python script, to an already rendered HTML page on the user side.
Check a javascript framework for the way that is easier for you to do that (for example, jquery). Then return an html page minus results to the user, ... | 0 | 0 | 0 | 1 | 2012-11-15T18:22:00.000 | 1 | 1.2 | true | 13,403,741 | 0 | 0 | 1 | 1 | I have a Python web application in which one function that can take up to 30 seconds to complete.
I have been kicking off the process with a cURL request (inc. parameters) from PHP but I don't want the user staring at a blank screen the whole time the Python function is working.
Is there a way to have it process th... |
How can I debug python web site on amazon EC2? | 13,407,676 | 5 | 3 | 743 | 0 | python,django,amazon-s3,amazon-web-services,amazon-ec2 | You just need to find out where your code is located on the server. SSH to one of the instances and then you can use the python interactive shell to run your django code for debugging, use the manage.py commands for database debugging, tests etc.
Once you have connected to the instance, it's just an OS. | 0 | 0 | 0 | 0 | 2012-11-15T22:44:00.000 | 1 | 1.2 | true | 13,407,554 | 0 | 0 | 1 | 1 | I am new to web development. This is probably a dumb question but I could not quite find exact answer or tutorial that could help me. The company I am working at has its site(which is built in python django )hosted on amazon EC2. I want to know where I can start about debugging this production site and check logs and d... |
How do I use a pre-made app with my project? | 13,447,213 | 0 | 0 | 109 | 0 | python,django,macos | Rule of thumb is: if app's documentary doesn't explain how to install (use, etc.) app, then its better to forget about using that app.
How can you rely on 5-month-not-updated-not-tested-not-well-documented app? There should be better solution. | 0 | 0 | 0 | 0 | 2012-11-16T00:32:00.000 | 1 | 0 | false | 13,408,685 | 0 | 0 | 1 | 1 | sorry I'm a total noob but I can't find anywhere that actually explains this. I want to make a web blog, and I figured instead of rolling my own I would use a pre-made one, and I picked the blog from the basic apps project (https://github.com/nathanborror/django-basic-apps). I installed everything fine, added the apps ... |
LLVM IR to Python Compiler | 13,416,469 | 2 | 6 | 1,835 | 0 | python,compiler-construction,code-generation,llvm,converter | LLVM up to 3.0 provided a C backend (see lib/Target/CBackend) which should be a good starting point for implementing a simple Python code generator. | 0 | 0 | 0 | 1 | 2012-11-16T11:26:00.000 | 1 | 1.2 | true | 13,415,660 | 0 | 0 | 1 | 1 | Is there any tool to convert the LLVM IR code to Python code?
I know it is possible to convert it to Javascript (https://github.com/kripken/emscripten/wiki), to Java (http://da.vidr.cc/projects/lljvm/) and I would love to convert it to Python also.
Additionaly if such tool does not exist, could you provide any informat... |
How to run multiple scrapyd servers? | 15,516,604 | 0 | 2 | 1,381 | 0 | python,web-scraping,scrapy,scrapyd | What about use the same sqlite database? The dbs_dir is set in scrapyd.script._get_config(). | 0 | 0 | 0 | 0 | 2012-11-16T15:38:00.000 | 2 | 0 | false | 13,419,734 | 0 | 0 | 1 | 1 | I have been searching for documentation on the Scrapyd Service but it is very slim. I was wondering if anyone has any idea how to set up multiple Scrapyd servers that point to the same schedule queue? |
List of methods and parameters available to Django's class based views? | 13,425,827 | 0 | 0 | 90 | 0 | python,django | You can use python manage.py shell and import the views you want and then use dir() for example, dir(TemplateView) or you can read the source code or you use help() method to give quick overview. For example, help(TemplateView) | 0 | 0 | 0 | 0 | 2012-11-16T21:45:00.000 | 4 | 0 | false | 13,424,875 | 0 | 0 | 1 | 2 | I read the documentation and its kind of vague when it comes to outlining the methods/parameters/properties available to Class based views, is there a list of some website that provides such as list anywhere? |
List of methods and parameters available to Django's class based views? | 13,424,901 | 1 | 0 | 90 | 0 | python,django | You should use your python manage.py shell and simply import your views and
use dir(my_view) and help(my_view) | 0 | 0 | 0 | 0 | 2012-11-16T21:45:00.000 | 4 | 0.049958 | false | 13,424,875 | 0 | 0 | 1 | 2 | I read the documentation and its kind of vague when it comes to outlining the methods/parameters/properties available to Class based views, is there a list of some website that provides such as list anywhere? |
Pass data in google app engine using POST | 13,427,499 | 1 | 1 | 297 | 0 | python,google-app-engine,http-post,http-get | Links inherently generate GET requests. If you want to generate a POST request, you'd need to either:
Use a form with method="POST" and submit it, or
Use AJAX to load the new page. | 0 | 1 | 0 | 0 | 2012-11-17T03:45:00.000 | 1 | 1.2 | true | 13,427,477 | 0 | 0 | 1 | 1 | I'm trying to pass a variable from one page to another using google app engine, I know how to pass it using GET put putting it in the URL. But I would like to keep the URL clean, and I might need to pass a larger amount of data, so how can pass info using post.
To illustrate, I have a page with a series of links, each... |
Streaming audio and video | 13,435,380 | 5 | 2 | 1,745 | 0 | python,linux,streaming,video-streaming,audio-streaming | A good start for trying different options is to use vlc (http://www.videolan.org) Its file->transmit menu command opens a wizard with which you can play.
Another good one is gstreamer, (http://www.gstreamer.net), the gst-launch program in particular, which allows you to build pipelines from the command line. | 0 | 1 | 0 | 0 | 2012-11-17T18:42:00.000 | 2 | 1.2 | true | 13,433,597 | 0 | 0 | 1 | 1 | I've been trying for a while but struggling. I have two projects:
Stream audio to server for distribution over the web
Stream audio and video from a webcam to a server for distribution over the web.
I have thus far tried ffmpeg and ffserver, PulseAudio, mjpegstreamer (I got this working but no audio) and IceCast all... |
Web scraping - web login issue | 13,437,094 | 0 | 2 | 684 | 0 | python,web-scraping,casperjs | Because you mentioned CasperJS I can assume that web site generate some data by using JavaScript. My suggestion would be check WebKit. It is a browser "engine", that will let you do what ever you want with web-site.
You can use PyQt4 framework, which is very good, and has a good documentation. | 0 | 0 | 1 | 0 | 2012-11-17T20:52:00.000 | 5 | 0 | false | 13,434,664 | 0 | 0 | 1 | 1 | So I am trying to scrape something that is behind a login system. I tried using CasperJS, but am having issues with the form, so maybe that is not the way to go; I checked the source code of the site and the form name is "theform" but I can never login must be doing something wrong. Does any have any tutorials on how t... |
Understanding imports in views.py - Django | 13,439,337 | 0 | 1 | 95 | 0 | django,python-2.7,django-views | A Django process is loaded once and remains active to handle incoming requests. So if you define the list as a global variable, it stays in RAM and all is fine. It is discouraged to manipulate the list though. | 0 | 0 | 0 | 0 | 2012-11-18T09:23:00.000 | 1 | 1.2 | true | 13,438,920 | 0 | 0 | 1 | 1 | I have a very big python list ( ~ 1M strings) defined in a .py file. I import it in my views.py to access the list in my views.
My question is does the list gets loaded in RAM for every user coming to the web app, or does it loads just one single time and is used for all users ? |
Python/Django: how to get files fastest (based on path and name) | 13,440,101 | 0 | 0 | 57 | 0 | python,operating-system | The access time for an individual file are not affected by the quantity of files in the same directory.
running ls -l on a directory with more files in it will take longer of course. Same as viewing that directory in the file browser. Of course it might be easier to work with these images if you store them in a subdir... | 0 | 0 | 0 | 0 | 2012-11-18T12:28:00.000 | 2 | 1.2 | true | 13,440,079 | 0 | 0 | 1 | 1 | My website users can upload image files, which then need to be found whenever they are to be displayed on a page (using src = ""). Currently, I put all images into one directory. What if there are many files - is it slow to find the right file? Are they indexed? Should I create subdirectories instead?
I use Python/Dja... |
Python + Django on Android | 21,954,459 | 1 | 14 | 34,933 | 0 | android,python,django | Well if your end goal is to develop Web applications and host host them on your Android and since you had flask there why not give bottle.py a shot. It's just one file that you copy into your sl4a scripts folder and voila. Bottle is minimalist and near similar to flask. No rooting or Unix environments required. | 0 | 0 | 0 | 0 | 2012-11-18T21:01:00.000 | 10 | 0.019997 | false | 13,444,534 | 0 | 0 | 1 | 1 | I am a Django developer and wanted to know if anyone has any idea of the possibilities of installing and developing on Django using an Android tablet such as the nexus 7. This seems like a reasonably powerful device, can be hooked up with a bluetooth keyboard, and has linux at the core of the OS.
So - is it possible to... |
Scrapy Python Crawler - Different Spider for each? | 13,451,254 | 0 | 1 | 252 | 0 | python,search,scrapy,web-crawler | different PROJECT for each site is a WORST idea .
different SPIDER for each site is a GOOD idea .
if you can adjust multiple sites in one SPIDER (based of there nature) is a BEST idea .
but again all depends on your Requirements. | 0 | 0 | 1 | 0 | 2012-11-18T23:08:00.000 | 1 | 1.2 | true | 13,445,585 | 0 | 0 | 1 | 1 | I have a lot of different sites I want to scrape using scrapy. I was wondering what is the best way of doing this?
Do you use a different "project" for each site you want to scrape, or do you use a different "spider", or neither?
Any input would be appreciated |
In practice, how eventual is the "eventual consistency" in HRD? | 21,716,718 | 1 | 8 | 560 | 0 | python,google-app-engine,app-engine-ndb | If you have a small app then your data probably live on the same part of the same disk and you have one instance. You probably won't notice eventual consistency. As your app grows, you notice it more. Usually it takes milliseconds to reach consistency, but I've seen cases where it takes an hour or more.
Generally, quer... | 0 | 0 | 0 | 0 | 2012-11-19T05:49:00.000 | 3 | 1.2 | true | 13,448,366 | 0 | 0 | 1 | 3 | I am in the process of migrating an application from Master/Slave to HRD. I would like to hear some comments from who already went through the migration.
I tried a simple example to just post a new entity without ancestor and redirecting to a page to list all entities from that model. I tried it several times and it w... |
In practice, how eventual is the "eventual consistency" in HRD? | 13,457,830 | 0 | 8 | 560 | 0 | python,google-app-engine,app-engine-ndb | The replication speed is going to be primarily server-workload-dependent. Typically on an unloaded system the replication delay is going to be milliseconds.
But the idea of "eventually consistent" is that you need to write your app so that you don't rely on that; any replication delay needs to be allowable within the ... | 0 | 0 | 0 | 0 | 2012-11-19T05:49:00.000 | 3 | 0 | false | 13,448,366 | 0 | 0 | 1 | 3 | I am in the process of migrating an application from Master/Slave to HRD. I would like to hear some comments from who already went through the migration.
I tried a simple example to just post a new entity without ancestor and redirecting to a page to list all entities from that model. I tried it several times and it w... |
In practice, how eventual is the "eventual consistency" in HRD? | 13,457,661 | 0 | 8 | 560 | 0 | python,google-app-engine,app-engine-ndb | What's the worst case if you get inconsistent results?
Does a user see some unimportant info that's out of date? That's probably ok.
Will you miscalculate something important, like the price of something? Or the number of items in stock in a store? In that case, you would want to avoid that chance occurence.
From ... | 0 | 0 | 0 | 0 | 2012-11-19T05:49:00.000 | 3 | 0 | false | 13,448,366 | 0 | 0 | 1 | 3 | I am in the process of migrating an application from Master/Slave to HRD. I would like to hear some comments from who already went through the migration.
I tried a simple example to just post a new entity without ancestor and redirecting to a page to list all entities from that model. I tried it several times and it w... |
Beautifulsoup 4 prettify outputs XHTML, not HTML | 13,456,177 | 2 | 4 | 1,423 | 0 | python,html,beautifulsoup | No, there is no way to force the .prettify() method to not output XHTML-compliant HTML. | 0 | 0 | 0 | 0 | 2012-11-19T14:37:00.000 | 1 | 1.2 | true | 13,455,988 | 0 | 0 | 1 | 1 | I'm trying to parse and prettify a bunch of files made with Microsoft FrontPage.
Beautifulsoup parses them with no problem, but when I try to print the output with prettify(),
tags like <meta> or <br> are rewritten as <meta ... /> and <br/>.
Is there a way to force HTML output? |
Django hvad - Best practice to work with multi-lingual object in template | 13,459,152 | 2 | 2 | 347 | 0 | python,django,plugins,multilingual,django-hvad | You should act like this: extract each translation in single variable, put them in list ant let that list go to view. Then you can iterate through each translation in view. | 0 | 0 | 0 | 0 | 2012-11-19T16:36:00.000 | 1 | 1.2 | true | 13,458,191 | 0 | 0 | 1 | 1 | I have an article object which has several languages. What's the best way to work with this object?
I need to display all attributes in every language.
Is is possible to get just my article object and iterate through the languages in the template?
Thanks for you help!
Ron |
Can i use selenium with Scrapy without actual browser opening with python | 16,050,387 | 8 | 2 | 2,960 | 0 | python,selenium,scrapy | Updated: PhantomJS is abandoned, and you can use headless browsers directly now, such like Firefox and Chrome!
Use PhantomJS instead.
You can do browser = webdriver.PhantomJS() in selenium v2.32.0. | 0 | 0 | 1 | 0 | 2012-11-20T07:53:00.000 | 2 | 1 | false | 13,468,755 | 0 | 0 | 1 | 1 | I want to do some web crawling with scrapy and python. I have found few code examples from internet where they use selenium with scrapy.
I don't know much about selenium but only knows that it automates some web tasks. and browser actually opens and do stuff. but i don't want the actual browser to open but i want every... |
Scrapy why bother with Items when you can just directly insert? | 13,469,554 | 7 | 1 | 1,529 | 0 | python,scrapy | If you insert directly inside a spider, then your spider will block until the data is inserted. If you create an Item and pass it to the Pipeline, the spider can continue to crawl while the data is inserted. Also, there might be race conditions if multiple spiders try to insert data at the same time. | 0 | 0 | 1 | 0 | 2012-11-20T08:38:00.000 | 2 | 1 | false | 13,469,321 | 0 | 0 | 1 | 1 | I will be using scrapy to crawl a domain. I plan to store all that information into my db with sqlalchemy. It's pretty simple xpath selectors per page, and I plan to use HttpCacheMiddleware.
In theory, I can just insert data into my db as soon as I have data from the spiders (this requires hxs to be instantiated at le... |
How do I make a web server to make timed multiple choice tests? | 13,476,327 | 1 | 1 | 947 | 0 | python,web-applications,haskell,clojure,lisp | When the server-side creates the form, encode an hidden field with the timestamp of the request, so when the users POSTs his form, you can see the time difference.
How to implement that is up to you, which server you have available, and several other factors. | 0 | 0 | 0 | 1 | 2012-11-20T12:44:00.000 | 4 | 0.049958 | false | 13,473,489 | 0 | 0 | 1 | 1 | I'd like to make a webapp that asks people multiple choice questions, and times how long they take to answer.
I'd like those who want to, to be able to make accounts, and to store the data for how well they've done and how their performance is increasing.
I've never written any sort of web app before, although I'm a g... |
How to change the post-login page using django-registration? | 13,481,428 | 0 | 0 | 40 | 0 | python,django,django-registration | LOGIN_REDIRECT_URL = '/'
This redirects to home url. | 0 | 0 | 0 | 0 | 2012-11-20T20:15:00.000 | 1 | 1.2 | true | 13,481,352 | 0 | 0 | 1 | 1 | I am using django-registration and django-registration_defaults (for the templates) in my app. How do I change the page the user sees after he/she logs in? I looked through the documentation but was unable to find anything. |
Django-admin.py not being recognized suddenly | 66,409,423 | 1 | 1 | 4,143 | 0 | python,django | You can try with following code
py -m django startproject add_your_project_name_here | 0 | 0 | 0 | 0 | 2012-11-20T22:05:00.000 | 4 | 0.049958 | false | 13,483,004 | 0 | 0 | 1 | 2 | I tried starting a new Django project yesterday but when I did "django-admin.py startproject projectname" I got an error stating: "django-admin.py is not recognized as an internal or external command." The strange thing is, when I first installed Django, I made a few projects and everything worked fine. But now after g... |
Django-admin.py not being recognized suddenly | 59,301,923 | 1 | 1 | 4,143 | 0 | python,django | i am totally new to coding, so pardon my amateur answers.
I had similar problem - i realized that while my Django was installed on C Drive, my files were saved on D drive and i was trying to run django-admin from D drive in the command prompt which was giving the above error. what worked for me was the following
Loc... | 0 | 0 | 0 | 0 | 2012-11-20T22:05:00.000 | 4 | 0.049958 | false | 13,483,004 | 0 | 0 | 1 | 2 | I tried starting a new Django project yesterday but when I did "django-admin.py startproject projectname" I got an error stating: "django-admin.py is not recognized as an internal or external command." The strange thing is, when I first installed Django, I made a few projects and everything worked fine. But now after g... |
Do i need to pass all the hidden fields as well with the form in scrapy | 13,490,825 | 2 | 0 | 341 | 0 | python,forms,httpwebrequest,scrapy | if you are using FormRequest.from_response() then all hidden values are already pre-populated automatically.
but in most of the cases you need to override them as well depends on website functionality and behavior. | 0 | 0 | 0 | 0 | 2012-11-21T07:25:00.000 | 2 | 0.197375 | false | 13,488,266 | 0 | 0 | 1 | 2 | I want to know that if i need to perform some search on the job site , then do i need to pass only those variables which are visible on the form or all the variables , even some hidden fields like
The form is here http://www.example.com/search.php
Now there are two fields on the form like searchTerm and area and th... |
Do i need to pass all the hidden fields as well with the form in scrapy | 13,492,597 | 1 | 0 | 341 | 0 | python,forms,httpwebrequest,scrapy | Sometimes you can go without some of the hidden fields, other times - not.
You cannot know the server logic. It's up to the website how it is handling each of the form fields. | 0 | 0 | 0 | 0 | 2012-11-21T07:25:00.000 | 2 | 0.099668 | false | 13,488,266 | 0 | 0 | 1 | 2 | I want to know that if i need to perform some search on the job site , then do i need to pass only those variables which are visible on the form or all the variables , even some hidden fields like
The form is here http://www.example.com/search.php
Now there are two fields on the form like searchTerm and area and th... |
postgres installation error on Mac 10.6.8 | 13,495,557 | 1 | 1 | 291 | 1 | python,django,postgresql | Er, not sure how we can help you with that. One is for bash, one is for SQL.
No, that's for running the development webserver, as the tutorial explains.
There's no need to do that, that's what the virtualenv is for.
This has nothing to do with Python versions, you simply don't seem to be in the right directory. Note t... | 0 | 0 | 0 | 0 | 2012-11-21T14:12:00.000 | 1 | 1.2 | true | 13,495,135 | 0 | 0 | 1 | 1 | I'm new to web development and I'm trying to get my mac set up for doing Django tutorials and helping some developers with a project that uses postgres. I will try to specify my questions as much as possible. However, it seems that there are lots of floating parts to this question and I'm not quite understanding some p... |
Heroku Node.js + Python | 13,785,484 | 2 | 3 | 2,109 | 0 | python,node.js,heroku,cedar | After having played around a little, and also doing some reading, it seems like Heroku apps that need this have 2 main options:
1) Use some kind of back-end, that both apps can talk to. Examples would be a DB, Redis, 0mq, etc.
2) Use what I suggested above. I actually went ahead and implemented it, and it works.
Just t... | 0 | 0 | 1 | 0 | 2012-11-21T17:31:00.000 | 1 | 1.2 | true | 13,498,828 | 0 | 0 | 1 | 1 | I am trying to build a web-app that has both a Python part and a Node.js part. The Python part is a RESTful API server, and the Node.js will use sockets.io and act as a push server. Both will need to access the same DB instance (Heroku Postgres in my case). The Python part will need to talk to the Node.js part in order... |
Scrapy Crawling Speed is Slow (60 pages / min) | 13,585,472 | 2 | 8 | 4,117 | 0 | python,http,scrapy,web-crawler | Are you sure you are allowed to crawl the destination site at high speed? Many sites implement download threshold and "after a while" start responding slowly. | 0 | 0 | 1 | 0 | 2012-11-22T02:45:00.000 | 1 | 0.379949 | false | 13,505,194 | 0 | 0 | 1 | 1 | I am experiencing slow crawl speeds with scrapy (around 1 page / sec).
I'm crawling a major website from aws servers so I don't think its a network issue. Cpu utilization is nowhere near 100 and if I start multiple scrapy processes crawl speed is much faster.
Scrapy seems to crawl a bunch of pages, then hangs for sever... |
Why i see `u` in front of all the text in python text | 13,507,452 | 2 | 0 | 170 | 0 | python,scrapy | The u symbol is added in displaying the strings to represent that the object is a Unicode string. Similarly, if you use a unicode string in your code, you can use a unicode literal by adding a u symbol next to the string itself. | 0 | 0 | 0 | 0 | 2012-11-22T07:07:00.000 | 3 | 0.132549 | false | 13,507,434 | 0 | 0 | 1 | 1 | I am using scrapy to scrap the website. My items are appearing like this
{'company': [u'Resource Agility'],
i am sick of this u.
is that normal?
i want to know that if i store my value in database, does the u also get in there?
Is there any way to hide that u? |
Django model naming conventions | 13,518,421 | 0 | 2 | 931 | 0 | python,django,django-models,naming-conventions | Depending on the structure of other parts of your code, you could use the name of the Django app, a package, or a module to further scope the names. | 0 | 0 | 0 | 0 | 2012-11-22T18:21:00.000 | 2 | 0 | false | 13,518,222 | 0 | 0 | 1 | 2 | I have a pretty stupid question about model naming conventions in Django.
Imagine a farmstead which has buildings which have rooms.
Farmstead --> Buildings --> Rooms
With Farmstead it is ok, let's call it a Farmstead. Next one: Building or FarmsteadBuilding? BuildingRoom, Room or FarmsteadBuildingRoom? |
Django model naming conventions | 13,518,370 | 6 | 2 | 931 | 0 | python,django,django-models,naming-conventions | If all your instances of Room belongs to a Building (and there is no another kind of models like Apartment) and all your instances of Building belongs to a Farmstead (following the same idea), so just use the name of your models like Farmstead, Building and Room. It's not necessary to specify something that is already ... | 0 | 0 | 0 | 0 | 2012-11-22T18:21:00.000 | 2 | 1.2 | true | 13,518,222 | 0 | 0 | 1 | 2 | I have a pretty stupid question about model naming conventions in Django.
Imagine a farmstead which has buildings which have rooms.
Farmstead --> Buildings --> Rooms
With Farmstead it is ok, let's call it a Farmstead. Next one: Building or FarmsteadBuilding? BuildingRoom, Room or FarmsteadBuildingRoom? |
element playbin2 query_position always returns query failed | 13,529,688 | 1 | 0 | 700 | 0 | python,gstreamer,python-gstreamer | What does "you'll need to thread your own gst object" mean? And what does "wait until the query succeeds" mean?
State changes from NULL to PAUSED or PLAYING state are asynchronous. You will usually only be able to do a successful duration query once the pipeline is prerolled (so state >= PAUSED). When you get an ASYNC_... | 0 | 0 | 1 | 0 | 2012-11-22T19:38:00.000 | 3 | 0.066568 | false | 13,519,086 | 0 | 0 | 1 | 3 | I'm developing a media player that streams mp3 files. I'm using the python gstreamer module to play the streams.
my player is the playbin2 element
When I want to query the position (with query_position(gst.FORMAT_TIME,None)), it always returns a gst.QueryError: Query failed.
The song is definetly playing. (state is not... |
element playbin2 query_position always returns query failed | 13,529,066 | 0 | 0 | 700 | 0 | python,gstreamer,python-gstreamer | I found it on my own. Problem was with threading. Apparently, you'll need to thread your gst object and just wait until the query succeeds. | 0 | 0 | 1 | 0 | 2012-11-22T19:38:00.000 | 3 | 0 | false | 13,519,086 | 0 | 0 | 1 | 3 | I'm developing a media player that streams mp3 files. I'm using the python gstreamer module to play the streams.
my player is the playbin2 element
When I want to query the position (with query_position(gst.FORMAT_TIME,None)), it always returns a gst.QueryError: Query failed.
The song is definetly playing. (state is not... |
element playbin2 query_position always returns query failed | 13,525,709 | 0 | 0 | 700 | 0 | python,gstreamer,python-gstreamer | From what source are you streaming? If you query the position from the playbin2 I'd say you do everything right. Can you file a bug for gstreamer, include a minimal python snippet that exposes the problem and tell from which source you stream - ideally its public. | 0 | 0 | 1 | 0 | 2012-11-22T19:38:00.000 | 3 | 0 | false | 13,519,086 | 0 | 0 | 1 | 3 | I'm developing a media player that streams mp3 files. I'm using the python gstreamer module to play the streams.
my player is the playbin2 element
When I want to query the position (with query_position(gst.FORMAT_TIME,None)), it always returns a gst.QueryError: Query failed.
The song is definetly playing. (state is not... |
Can the use of Beautiful Soup with Scrapy increase the performance | 13,560,416 | 0 | 0 | 1,925 | 0 | python,beautifulsoup,scrapy | well the answer is you should try to parse couple of pages with HtmlSelector then Using beautiful Soup. and find some stats.
2ndly most of people use beautiful Soup even lxml for parsing because they already used to for using this.
Scrapy basic motive is Crawling if you are not comfortable with Xpath you can go with be... | 0 | 0 | 0 | 0 | 2012-11-23T04:29:00.000 | 2 | 0 | false | 13,523,115 | 0 | 0 | 1 | 1 | I am doing crawling everything in scrapy.
I have seen that many people are using beautiful Soup for parsing.
I just wanted to know that is there any advantage in terms of speed , efficiency or more slectrors etc which help me in creating spiders and crawlers or scrapy alone should be enough for me |
How to check if file exists in Google Cloud Storage? | 13,644,827 | 1 | 40 | 52,000 | 0 | python,google-cloud-storage,file-exists | I guess there is no function to check directly if the file exists given its path.
I have created a function that uses the files.listdir() API function to list all the files in the bucket and match it against the file name that we want. It returns true if found and false if not. | 0 | 0 | 1 | 1 | 2012-11-23T08:39:00.000 | 13 | 1.2 | true | 13,525,482 | 0 | 0 | 1 | 1 | I have a script where I want to check if a file exists in a bucket and if it doesn't then create one.
I tried using os.path.exists(file_path) where file_path = "/gs/testbucket", but I got a file not found error.
I know that I can use the files.listdir() API function to list all the files located at a path and then chec... |
Scrapy inside java? | 13,584,941 | 0 | 0 | 1,443 | 0 | java,python,scrapy | I doubt you can run twisted under jython and scrapy is based on twisted.
Not sure what you want to do but I recommend to run scrapyd and use the web service interface to communicate with java.
Can you give us more details on what you want to achieve? | 0 | 0 | 0 | 0 | 2012-11-23T15:44:00.000 | 2 | 1.2 | true | 13,532,170 | 0 | 0 | 1 | 1 | Is it possible to use Scrapy from within a Java project?
With Jython for example, or maybe "indirect" solutions. |
Web2py unable to access internet [connection refused] | 13,545,399 | 0 | 0 | 412 | 0 | python,linux,apache,web2py | Try testing the proxy theory by ssh -D tunneling to a server outside the proxy and seeing if that works for you. | 0 | 0 | 1 | 0 | 2012-11-24T19:23:00.000 | 1 | 0 | false | 13,544,715 | 0 | 0 | 1 | 1 | I have deployed a web2py application on a server that is running on Apache web server.
All seems to be working fine, except for the fact that the web2py modules are not able to connect to an external website.
in web2py admin page, i get the following errors :
1. Unable to check for upgrades
2. Unable to download becau... |
Detect background color of a website | 13,548,265 | -1 | 1 | 1,034 | 0 | java,python,html | I don't know anything about Java or Python, but could you have it parse the html code and look for something like 'background-color: < color >'? | 0 | 0 | 0 | 0 | 2012-11-25T04:20:00.000 | 3 | -0.066568 | false | 13,548,239 | 0 | 0 | 1 | 1 | I am trying to detect color of different elements in a webpage(saved on machine). Currently I am trying to write a code in python. The initial approach which I followed is:
find color word in html file in different tags using regular expressions.
try to read the hex value.
But this approach is very stupid. I am new t... |
New tables created in web2py not seen when running in Google app Engine | 13,551,914 | 0 | 1 | 100 | 1 | python,google-app-engine,web2py | App Engine datastore doesn't really have tables. That said, if web2py is able to make use of the datastore (I'm not familiar with it), then Kinds (a bit like tables) will only show up in the admin-console (/_ah/admin locally) once an entity has been created (i.e. tables only show up once one row has been inserted, you'... | 0 | 1 | 0 | 0 | 2012-11-25T05:29:00.000 | 1 | 0 | false | 13,548,590 | 0 | 0 | 1 | 1 | I have created an app using web2py and have declared certain new table in it using the syntax
db.define_table() but the tables created are not visible when I run the app in Google App Engine even on my local server. The tables that web2py creates by itself like auth_user and others in auth are available.
What am I miss... |
Python module issue | 13,573,647 | 2 | 2 | 2,446 | 1 | python,linux,mysql-python,bluehost | I think you upgraded your OS installation which in turn upgraded libmysqlclient and broke native extension. What you can do is reinstall libmysqlclient16 again (how to do it depends your particular OS) and that should fix your issue.
Other approach would be to uninstall MySQLdb module and reinstall it again, forcing py... | 0 | 0 | 0 | 0 | 2012-11-26T21:20:00.000 | 2 | 1.2 | true | 13,573,359 | 0 | 0 | 1 | 2 | I have a shared hosting environment on Bluehost. I am running a custom installation of python(+ django) with a few installed modules. All has been working, until yesterday a change was made on the server(I assume) which gave me this django error:
... File "/****/****/.local/lib/python/django/utils/importlib.py", line ... |
Python module issue | 13,591,200 | 0 | 2 | 2,446 | 1 | python,linux,mysql-python,bluehost | You were right. Bluehost upgraded MySQL. Here is what I did:
1) remove the "build" directory in the "MySQL-python-1.2.3" directory
2) remove the egg
3) build the module again "python setup.py build"
4) install the module again "python setup.py install --prefix=$HOME/.local"
Morale of the story for me is to remove the o... | 0 | 0 | 0 | 0 | 2012-11-26T21:20:00.000 | 2 | 0 | false | 13,573,359 | 0 | 0 | 1 | 2 | I have a shared hosting environment on Bluehost. I am running a custom installation of python(+ django) with a few installed modules. All has been working, until yesterday a change was made on the server(I assume) which gave me this django error:
... File "/****/****/.local/lib/python/django/utils/importlib.py", line ... |
Will I have more control over my spider if I use lxml over BeautifulSoup? | 13,578,055 | 3 | 1 | 120 | 0 | python,parsing,beautifulsoup,lxml | I don't really think this question makes a whole lot of sense. You need to give more explanation of what exactly your goals are. BeautifulSoup and lxml are two tools that in large part do the same things, but have different features and API philosophies and structure.
It's not a matter of "which gives you more contro... | 0 | 0 | 1 | 0 | 2012-11-27T05:28:00.000 | 1 | 1.2 | true | 13,577,922 | 0 | 0 | 1 | 1 | I am learning to make spiders and crawlers. This spidering is my passion and I am going to do that for a long time. For parsing I am thinking of using BeautifulSoup. But some people say that if I use lxml, I will have more control.
Now I don't know much. But I am ready to work hard even if using lxml is harder. But if ... |
differences between scrapy.crawler and scrapy.spider? | 13,584,851 | 2 | 3 | 1,470 | 0 | python,scrapy | CrawlerSpider is a sub-class of BaseSpider : This is the calls you need to extend if you want your spider to follow links according to the "Rule" list.
"Crawler" is the main crawler sub-classed by CrawlerProcess.
You will have to sub-class CrawlerSpider in you spider but I don't think you will have to touch Crawler. | 0 | 0 | 1 | 0 | 2012-11-27T05:55:00.000 | 1 | 1.2 | true | 13,578,170 | 0 | 0 | 1 | 1 | I am new to Scrapy and quite confused about crawler and spider. It seems that both of them can crawl the website and parse items.
There are a Crawler class(/usr/local/lib/python2.7/dist-packages/scrapy/crawler.py) and a CrawlerSpider class(/usr/local/lib/python2.7/dist-packages/scrapy/contrib/spiders/crawl.py) in Scra... |
Minimal effort setup of Django for webdesigner | 13,678,321 | 0 | 2 | 215 | 0 | python,django,heroku | Why not store all of the assets on S3?
It sounds to me that they don't really need to be part of the application at all, but external resources that the application references. | 0 | 0 | 0 | 0 | 2012-11-27T12:43:00.000 | 2 | 0 | false | 13,584,524 | 0 | 0 | 1 | 2 | In the old world I had a pretty ideal development setup going to work together with a webdesigner. Keep in mind we mostly do small/fast projects, so this is how it worked:
I have a staging site on a server (Webfaction or other)
Designer accesses that site and edits templates and assets to his satisfaction
I SSH in reg... |
Minimal effort setup of Django for webdesigner | 13,584,919 | 0 | 2 | 215 | 0 | python,django,heroku | How about a static 'showcase' site where all possible UI elements, templates, etc are shown using dummy content. The designer can connect, edit stuff and you merge in the changes in the end. Another option would be a test server with the full application running (kind of like you did it before) but with the option to c... | 0 | 0 | 0 | 0 | 2012-11-27T12:43:00.000 | 2 | 0 | false | 13,584,524 | 0 | 0 | 1 | 2 | In the old world I had a pretty ideal development setup going to work together with a webdesigner. Keep in mind we mostly do small/fast projects, so this is how it worked:
I have a staging site on a server (Webfaction or other)
Designer accesses that site and edits templates and assets to his satisfaction
I SSH in reg... |
Deactivating needless properties in Django Admin | 13,590,715 | 0 | 0 | 57 | 0 | python,django | Another way to solve this is by adding javascript that disable the "other" fields when you set one. You can then enforce this in the form/model validation.
But I should say that I think the best way to deal with this, if it can be applied to your problem, is the way PT114 propose. | 0 | 0 | 0 | 0 | 2012-11-27T17:12:00.000 | 4 | 0 | false | 13,589,417 | 0 | 0 | 1 | 1 | We have three properties on my animal model:
dog_name
cat_name
monkey_name
One of them must be filled (no more! animal is a dog, a cat or a monkey) and if I set for example cat_name, I want dog_name and monkey_name to be deactivated (user shouldn't set more than one name).
Is it possible to set this in django admin... |
Django cannot import from app/models.py | 13,591,321 | 1 | 0 | 426 | 0 | python,django,django-models | Well you already know it is because of mutual dependencies. The way around it would be to split the util file in to two so, that you could avoid circular imports by separating the parts where you are required to call the models.
Also, as suggested by Mipadi instead of using a global import statement you could simply ma... | 0 | 0 | 0 | 0 | 2012-11-27T19:01:00.000 | 1 | 0.197375 | false | 13,591,170 | 0 | 0 | 1 | 1 | In my Django app (lets call it app) I have a number of files: views.py, models.py and I created my own utils.py.
Unfortunately, while I can include my models in my views.py file simply by saying
from models import *
In my utils.py file, if I try the same thing, and then work with a model, I get an exception Global nam... |
Change dependencies code on dotcloud. Django | 13,594,735 | 1 | 1 | 67 | 0 | python,django,dotcloud | If you are using a requirements.txt, no, there is not a way to do that from pypi, since Dotcloud is simply downloading the packages you've specified from pypi, and obviously your changes within your virtualenv are not going to be reflected by the canonical versions of the packages.
In order to use the edited versions o... | 0 | 0 | 0 | 0 | 2012-11-27T22:17:00.000 | 2 | 0.099668 | false | 13,594,164 | 0 | 0 | 1 | 2 | I'm deploying my Django app with Dotcloud. While developing locally, I had to make changes inside the code of some dependencies (that are in my virtualenv).
So my question is: is there a way to make the same changes on the dependencies (for example django-registration or django_socketio) while deploying on dotcloud?
Th... |
Change dependencies code on dotcloud. Django | 13,594,763 | 1 | 1 | 67 | 0 | python,django,dotcloud | There are many ways, but not all of them are clean/easy/possible.
If those dependencies are on github, bitbucket, or a similar code repository, you can:
fork the dependency,
edit your fork,
point to the fork in your requirements.txt file.
This will allow you to track further changes to those dependencies, and easily ... | 0 | 0 | 0 | 0 | 2012-11-27T22:17:00.000 | 2 | 1.2 | true | 13,594,164 | 0 | 0 | 1 | 2 | I'm deploying my Django app with Dotcloud. While developing locally, I had to make changes inside the code of some dependencies (that are in my virtualenv).
So my question is: is there a way to make the same changes on the dependencies (for example django-registration or django_socketio) while deploying on dotcloud?
Th... |
Tracking online status? | 13,610,314 | 0 | 1 | 302 | 0 | javascript,python,html,django,web-applications | As Sanjay says, prefer using memory solutions (online statuses have a quite brief use) like the Django cache (Redis or Memcache).
If you want a simple way of updating the online status of an user on an already loaded web page, use any lib like jQuery, AJAX-poll an URL giving the status of an user, and then update the t... | 0 | 0 | 0 | 0 | 2012-11-28T16:38:00.000 | 2 | 0 | false | 13,609,985 | 0 | 0 | 1 | 2 | I am quite new to web development and am working on this social networking site.
Now I want to add functionality to show if a person is online.
Now one of the ways I figure out doing this is by keeping online status bit in the database.
My question is how to do it dynamically. Say the page is loaded and a user (say c... |
Tracking online status? | 13,610,508 | 1 | 1 | 302 | 0 | javascript,python,html,django,web-applications | Create a new model with a last_activity DateTimeField and a OneToOneField to User. Alternatively, if you are subclassing User, using a custom User in django 1.5, or using a user profile, just add the field to that model.
Write a custom middleware that automatically updates the last_activity field for each user on every... | 0 | 0 | 0 | 0 | 2012-11-28T16:38:00.000 | 2 | 0.099668 | false | 13,609,985 | 0 | 0 | 1 | 2 | I am quite new to web development and am working on this social networking site.
Now I want to add functionality to show if a person is online.
Now one of the ways I figure out doing this is by keeping online status bit in the database.
My question is how to do it dynamically. Say the page is loaded and a user (say c... |
How to setup WSGI server to run similarly to Apache? | 13,619,836 | 3 | 1 | 300 | 0 | python,tornado,wsgi,cherrypy | What you are after would possibly happen anyway for WSGI severs. This is because any Python exception only affects the current request and the framework or WSGI server would catch the exception, log it and translate it to a HTTP 500 status page. The application would still be in memory and would continue to handle futu... | 0 | 1 | 0 | 1 | 2012-11-29T04:49:00.000 | 2 | 0.291313 | false | 13,619,021 | 0 | 0 | 1 | 1 | I'm coming from PHP/Apache world where running an application is super easy. Whenever PHP application crashes Apache process running that request will stop but server will be still ruining happily and respond to other clients. Is there a way to have Python application work in a smilar way. How would I setup wsgi server... |
Virtualenv and python - how to work outside the terminal? | 13,619,252 | 2 | 3 | 2,074 | 0 | python,virtualenv | Tell Eclipse or Idle that the python interpreter is django_venv/bin/python instead of /usr/bin/python | 0 | 1 | 0 | 0 | 2012-11-29T04:55:00.000 | 2 | 1.2 | true | 13,619,088 | 1 | 0 | 1 | 1 | When I enter my virtual environment (source django_venv/bin/activate), how do I make that environment transfer to apps run outside the terminal, such as Eclipse or even Idle? Even if I run Idle from the virtualenv terminal window command line (by typing idle), none of my pip installed frameworks are available within I... |
Sharding a Django Project | 13,639,532 | 1 | 3 | 1,300 | 1 | python,django,postgresql,sharding | I agree with @DanielRoseman. Also, how many is too many rows. If you are careful with indexing, you can handle a lot of rows with no performance problems. Keep your indexed values small (ints). I've got tables in excess of 400 million rows that produce sub-second responses even when joining with other many million ... | 0 | 0 | 0 | 0 | 2012-11-29T07:32:00.000 | 2 | 0.099668 | false | 13,620,867 | 0 | 0 | 1 | 1 | I'm starting a Django project and need to shard multiple tables that are likely to all be of too many rows. I've looked through threads here and elsewhere, and followed the Django multi-db documentation, but am still not sure how that all stitches together. My models have relationships that would be broken by sharding,... |
Transactions in Web2Py over Google App Engine | 13,892,159 | 1 | 0 | 192 | 0 | python,google-app-engine,web2py | Mutual exclusion is already built into DBMS so we just have to use that. Lets take an example.
First, your table in the model should be defined in such a way that your room number should be unique (use UNIQUE constraint).
When User1 and User2 both query for a room, they should get a response saying the room is vacant. ... | 0 | 1 | 0 | 0 | 2012-11-29T09:45:00.000 | 1 | 0.197375 | false | 13,622,895 | 0 | 0 | 1 | 1 | I'm making a room reservation system in Web2Py over Google App Engine.
When a user is booking a Room the system must be sure that this room is really available and no one else have reserved it just a moment before.
To be sure I make a query to see if the room is available, then I make the reservation. The problem is ... |
django site name needs to match domain name registered? | 13,623,382 | 0 | 0 | 102 | 0 | python,django,django-sites | No. The Django site name does not have anything to do with how it's hosted - it's purely used for internal stuff like displaying the name on the site itself and on emails. | 0 | 0 | 0 | 0 | 2012-11-29T10:02:00.000 | 1 | 1.2 | true | 13,623,206 | 0 | 0 | 1 | 1 | I am new to django framework. I created a site with name "project" and it is working on local machine. Now, I am trying to move on to my test server ("ideometrics.se)". I created a subdomain ("project.ideometrics.se") to access this application from that subdomain. Do I have to change my django site name to "project.id... |
How to use browser cookies programmatically | 13,628,291 | 0 | 0 | 925 | 0 | java,python,cookies,http-headers,httpwebrequest | When you send the login information (and usually in response to many other requests) the server will set some cookies to the client, you must keep track of them and send them back to the server for each subsequent request.
A full implementation would also keep track of the time they are supposed to be stored. | 0 | 0 | 1 | 0 | 2012-11-29T14:42:00.000 | 1 | 1.2 | true | 13,628,190 | 0 | 0 | 1 | 1 | I have a crawler that automates the login and crawling for a website, but since the login was changed it is not working anymore.
I am wondering, can I feed the browser cookie (aka, I manually log-in) to my HTTP request? Is there anything particularly wrong in principle that wouldn't make this work? How do I find the b... |
last_accessed time in beaker session always None, but _accessed_time is changing | 13,762,515 | 1 | 1 | 194 | 0 | python,mod-wsgi,wsgi,beaker | It turns out this behaviour is down to multiprocessing via apache.
It was resolved by using an external store to manage tracking when the session ID is first seen, and maintaining my own 'last_accessed_time' etc. | 0 | 0 | 0 | 0 | 2012-11-30T12:19:00.000 | 1 | 0.197375 | false | 13,645,120 | 0 | 0 | 1 | 1 | I'm using beakers WSGI SessionMiddleware to manage a session between browser and application.
I am trying to differentiate between when a session is first accessed against any further requests.
Fom the docs it appears there are two useful values made available in the WSGI environment,
["beaker.session"].last_accessed ... |
How can I disable javascript in firefox with selenium? | 29,955,598 | 0 | 3 | 5,735 | 0 | python | You can disable javascript directly from the browser. Steps:
Type About:config in url
Click I'll be careful, I promise
Search for javascript.enabled
Right click -> Toggle
Value = false | 0 | 0 | 1 | 0 | 2012-12-01T01:35:00.000 | 2 | 0 | false | 13,655,486 | 0 | 0 | 1 | 1 | How can I add preferences to the browser so it launches without javascript? |
When a web backend does more than simply reply to requests, how should my application be structured? | 13,775,086 | 1 | 2 | 183 | 0 | python,architecture,rabbitmq,web-frameworks,gevent | My first thought is that you could use a service oriented architecture to separate these tasks. Each of these services could run a Flask app on a separate port (or machine (or pool of machines)) and communicate to each other using simple HTTP. The breakdown might go something like this:
GameService: Handles incoming... | 0 | 0 | 0 | 0 | 2012-12-01T05:34:00.000 | 1 | 0.197375 | false | 13,656,736 | 0 | 0 | 1 | 1 | I'm creating a website that allows players to queue to find similarly skilled players for a multiplayer video game. Simple web backends only modify a database and create a response using a template, but in addition to that, my backend has to:
Communicate with players in real-time (via gevent-socketio) while they queue... |
New Django middleware not getting called | 13,690,608 | 2 | 2 | 1,449 | 0 | python,django,amazon-ec2,memcached,django-middleware | It was a silly glitch. I found out that i needed to reload gunicorn server to make the new middleware work. Thanks everybody for the help. | 0 | 0 | 0 | 0 | 2012-12-01T14:17:00.000 | 3 | 1.2 | true | 13,660,301 | 0 | 0 | 1 | 1 | I am quite new to web development. I am working on a website hosted on amazon ec2 server. The site is in python using django framework. I am using memcached to cache some client information. My site and caching works on local machine but not on the EC2 server. I checked memcached server and found out that it was not ab... |
How to share the same model on another AWS Instance | 13,664,767 | 2 | 0 | 33 | 0 | python,django | Instead of writing the same data models twice you can create a small django app (which will contain the model definition and logic) as a python module and install it on both the two servers / apps. | 0 | 0 | 0 | 0 | 2012-12-01T22:40:00.000 | 1 | 1.2 | true | 13,664,482 | 0 | 0 | 1 | 1 | I want to write my first Python program using Django. The site will be hosted on Amazon. However my API will use Django and Piston sitting on another instance. I don’t want to have to replicate my Models across two servers. How can I get the API to share the same model as the main Django instance, or should I? |
Where is the django admin media folder situated? | 13,666,236 | 2 | 0 | 1,602 | 0 | python,django | Make sure you have STATIC_ROOT defined in your settings.
Define STATIC_URL.
Use python manage.py collectstatic command to collect every static file from every app (including contrib.admin) in your STATIC_ROOT folder. | 0 | 0 | 0 | 0 | 2012-12-02T02:54:00.000 | 1 | 1.2 | true | 13,665,968 | 0 | 0 | 1 | 1 | My admin css is not working.
I tried to find it in folder: /usr/local/lib/python2.7/site-packages/django/contrib/admin
There is no media folder there.
I am using Django 1.5a. |
Advice on which language to persue for browser automation & scraping | 13,672,402 | 1 | 2 | 155 | 0 | c#,asp.net,python,web2py,browser-automation | Selenium is a pretty good library for automation if you want to scrape information off of javascript enabled pages. It has bindings for a number of languages. If you only want basic scraping though, I would go with Mechanize; no need to open a browser. | 0 | 0 | 1 | 0 | 2012-12-02T18:28:00.000 | 1 | 0.197375 | false | 13,672,346 | 0 | 0 | 1 | 1 | Novice to programming. I have most of my experience in python. I am comparind this to C#. I have created small web apps using Web2py, and have read 'learn python the hard way'. I have limited to no C# experience besides setting up and playing in VS.
My end goal is to be able to develop web apps (So far I do like web2p... |
How will my usage of manage.py and django-admin.py change with virtualenv? | 13,683,513 | 0 | 0 | 72 | 0 | python,django | No, only thing what virtualenv does, is that it creates an environment that has its own installation directories, that doesn’t share libraries with other virtualenv environments (and optionally doesn’t access the globally installed libraries either). Therefore it just means, that your project will use libraries and pac... | 0 | 0 | 0 | 0 | 2012-12-03T12:29:00.000 | 2 | 0 | false | 13,683,289 | 1 | 0 | 1 | 1 | I have completely shifted my all packages to virtualenv, but my project files were generated by the global Django installation.
I want to know what changes I need to make to the manage.py file, and do I need to use the virtualenv django-admin.py file now? |
Application that uses Django models need to be a Django app? | 13,689,659 | 2 | 0 | 56 | 0 | python,django | No, importing your models is enough, as long as you have Django installed and correctly configured. | 0 | 0 | 0 | 0 | 2012-12-03T18:42:00.000 | 1 | 1.2 | true | 13,689,617 | 0 | 0 | 1 | 1 | What is the definition of a Django application? Any application that uses Django features, such as orm and url-view mapping?
I ask because I have a component which has 2 sub-components: a web service server and a standalone application. The web service server uses Django views to map url to request handlers. The web se... |
Parsing data to Objective-C with XML or JSON with Python / Django backend | 13,690,743 | 1 | 0 | 401 | 0 | python,objective-c,xml,django,json | It really depends on the data you need to represent.
If you need to represent programming language objects, JSON is probably you best choice, being more lightweight and human-readable than XML.
If you need to represent a complex data structure with its custom schema, you will probably want to give XML a shot.
That bein... | 0 | 0 | 0 | 0 | 2012-12-03T19:46:00.000 | 1 | 1.2 | true | 13,690,514 | 0 | 0 | 1 | 1 | Ok all! I have a question for you...Currently looking at building an Iphone app with Objective-C and were going to be using Python / Django as the back-end as the website is already built. Meaning all the content is already stored in the database. Were going to use an app called tastypie as our API which can either pul... |
upsert throws error when I pass Id as externalIdFieldName in Beatbox API while contacting Salesforce | 13,695,617 | 3 | 0 | 565 | 0 | python,api,salesforce | If you already know the salesforce Id of the record, just call update instead. | 0 | 0 | 1 | 0 | 2012-12-04T02:48:00.000 | 2 | 1.2 | true | 13,695,322 | 0 | 0 | 1 | 1 | I'm using beatbox API to update/insert data in to salesforce opportunity object.
upsert() throws INVALID FIELD error when I pass Id as externalIDFieldName. Currently I'm using another unique external Id and it's working fine but I want to use the salesforce Id.
Please shed some light on what I'm missing. |
Can i have multiple virtual env on same computer withsame name | 13,697,179 | 5 | 4 | 1,400 | 0 | python,django,virtualenv | It is possible to create multiple virtualenvs with the same name; they must be in different parent directories, however.
Alternately, you could create multiple virtualenvs in the same parent directory, but with different names. | 0 | 0 | 0 | 0 | 2012-12-04T05:48:00.000 | 1 | 1.2 | true | 13,696,872 | 1 | 0 | 1 | 1 | I am making the base skeleton of some Django project files so that I can put them on git and whenever I need to make a new Django site I can grab the files from git and start a blank project.
In my fabfile, I'm generating a virtualenv named virutalenv.
I just want to know that if I need to make many sites on single com... |
Can I store a blob with a key_name with Google Appengine ndb? | 13,714,228 | 1 | 1 | 337 | 0 | python,google-app-engine,blob,blobstore | When you upload data to the blobstore you receive a blob_key and a file_name. The blob_key is unique. The file_name is NOT unique. When you do another upload with the same file_name a new version is stored in the blobstore with the same file_name and a new unique blob_key. The first blob is NOT deleted. You have to do ... | 0 | 1 | 0 | 0 | 2012-12-04T16:54:00.000 | 1 | 1.2 | true | 13,707,922 | 0 | 0 | 1 | 1 | I am building a service where you can upload images. On the blob creation I would like to supply a key_name, which will be used by the relevant entity to retrieve it later. |
Can i divide the models in different files in django | 13,718,988 | 0 | 8 | 2,427 | 0 | python,django,django-models | you can separate the model file like this :
-------models/
-------------- init.py
-------------- usermodels.py
--------------othermodel.py
in the init.py:
---------------from usermodels import *
---------------from othermodel import *
and in the *models.py , add META class:
--------class Meta:
--------------app_... | 0 | 0 | 0 | 0 | 2012-12-05T07:59:00.000 | 5 | 0 | false | 13,718,656 | 0 | 0 | 1 | 1 | Currently all my models are in models.py. Ist becomming very messy.
Can i have the separate file like base_models.py so that i put my main models there which i don't want to touch
Also same case for views and put in separate folder rather than develop a new app |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.