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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Django delete superuser | 67,849,420 | -1 | 73 | 57,795 | 0 | python,django | There is no way to delete it from the Terminal (unfortunately), but you can delete it directly. Just log into the admin page, click on the user you want to delete, scroll down to the bottom and press delete. | 0 | 1 | 0 | 0 | 2014-11-03T11:36:00.000 | 7 | -0.028564 | false | 26,713,443 | 0 | 0 | 1 | 2 | This may be a duplicate, but I couldn't find the question anywhere, so I'll go ahead and ask:
Is there a simple way to delete a superuser from the terminal, perhaps analogous to Django's createsuperuser command? |
Django delete superuser | 62,485,147 | 4 | 73 | 57,795 | 0 | python,django | No need to delete superuser...just create another superuser... You can create another superuser with same name as the previous one.
I have forgotten the password of the superuser so I create another superuser with the same name as previously. | 0 | 1 | 0 | 0 | 2014-11-03T11:36:00.000 | 7 | 0.113791 | false | 26,713,443 | 0 | 0 | 1 | 2 | This may be a duplicate, but I couldn't find the question anywhere, so I'll go ahead and ask:
Is there a simple way to delete a superuser from the terminal, perhaps analogous to Django's createsuperuser command? |
Import Data Efficiently from Datastore to BigQuery every Hour - Python | 26,722,516 | 2 | 2 | 541 | 1 | python,google-app-engine,google-bigquery,google-cloud-datastore | There is no full working example (as far as I know), but I believe that the following process could help you :
1- You'd need to add a "last time changed" to your entities, and update it.
2- Every hour you can run a MapReduce job, where your mapper can have a filter to check for last time updated and only pick up those... | 0 | 1 | 0 | 0 | 2014-11-03T20:00:00.000 | 2 | 0.197375 | false | 26,722,127 | 0 | 0 | 1 | 1 | Currently, I'm using Google's 2-step method to backup the datastore and than import it to BigQuery.
I also reviewed the code using pipeline.
Both methods are not efficient and have high cost since all data is imported everytime.
I need only to add the records added from last import.
What is the right way of doing it?
... |
Relate stock location to product model - OpenERP report | 26,728,276 | 1 | 1 | 462 | 0 | python,openerp,openerp-7,odoo | You have to create a parser for you report. And it is this parser that returns the list of products. | 0 | 0 | 0 | 0 | 2014-11-03T20:29:00.000 | 1 | 1.2 | true | 26,722,621 | 0 | 0 | 1 | 1 | I made a new report on OpenERP, for stock module, which uses the product.product model, like the default one which is Stock Level Forecast.
Now, what is the problem I have, I need this report to be shown on "Location Structure->Physical Locations->Warehouse->Analyze current inventory"
It is showing there, no errors, ev... |
Django field that is a hybrid of text file upload and/or text box | 26,726,763 | 0 | 0 | 121 | 0 | python,django,forms,django-admin | Regardless of the method of input chosen, the data would be stored as
a text column in the backing database.
In that case, I would use a regular CharField. It just makes more sense.
In the form, use 2 not required fields instead: key_text and key_file. Overwrite clean() to make at least one required. Then overwrite ... | 0 | 0 | 0 | 0 | 2014-11-04T01:12:00.000 | 1 | 0 | false | 26,726,169 | 0 | 0 | 1 | 1 | I'm trying to see if this is possible: a Field object that is rendered as both a file upload prompt as well as a text box. Since my app deals with SSL certificates and keys, it makes sense to allow the user to either upload a key/cert file, or paste the key/cert in directly.
Regardless of the method of input chosen, th... |
Django site-external access | 26,743,769 | 0 | 0 | 290 | 0 | python,django | By others, do you mean someone on your local network or someone on internet.
On local network its very easy, instead starting the local developmnet server by
python manage.py runserver you can do
python manage.py runserver 10.1.0.123:8000 (assuming 10.1.0.123 is your system's ip),
then people on you local network ca... | 0 | 0 | 0 | 0 | 2014-11-04T19:30:00.000 | 2 | 0 | false | 26,743,435 | 0 | 0 | 1 | 1 | A bit of a beginner question.Iv just started learning Django and can pretty much create basic stuff .Now when I want to access my website on my computer I just type in the local URL and I can access the site,other links etc.
If I want to show this to someone else how would I do it?..They wouldn't be able to just type i... |
Control activated webservices | 26,754,714 | 0 | 0 | 39 | 0 | python,django,web-services | Usually you have a webserver (Apache, nginx...) before that. Depending on the webserver and OS it can be rather easy to deactivate a site. For example Ubuntu + Apache
configure a default host that returns only 503 Service Unavailable
configure a site configuration with a VirtualHost with the actual WSGI setup for the ... | 0 | 0 | 0 | 0 | 2014-11-05T10:07:00.000 | 1 | 0 | false | 26,754,378 | 0 | 0 | 1 | 1 | i'm new in all of webservices and more webservices with python.
I tested bottle, ladon, flask and django REST framework... With different opinions but all working more or less fine. Now i need to have something like a admin view to start or stop these services. Looking these frameworks i cant find anything about it.
I ... |
Why should I use an API as django-tastypie or django-rest-framework? | 26,779,279 | 2 | 0 | 768 | 0 | python,django,rest,django-rest-framework,tastypie | For the exact same reasons than you used the django-admin for the admin instead of writing views, forms and templates from scratch:
less work
tested and approved by many other developers
therefore more secured
DRF has a really nice architecture. When you use it, you'd think "that's how I would have done it" (the truth... | 0 | 0 | 0 | 0 | 2014-11-06T11:52:00.000 | 1 | 0.379949 | false | 26,778,828 | 0 | 0 | 1 | 1 | I have been looking at django-tastypie and django-rest-framework.
What is the advantage of using an API?
I've thought of following use cases. Which use cases is an API primarily intended for?
'External developers' who wants to use the data from my website on their own website?
For me to get a nice overview of my data ... |
Scrapy ROBOTSTXT_OBEY not working in all cases | 29,877,623 | 0 | 0 | 890 | 0 | python,scrapy,robots.txt | Scrapy uses Python standard robots.txt parser which doesn't support wildcards. | 0 | 0 | 0 | 0 | 2014-11-06T14:06:00.000 | 1 | 1.2 | true | 26,781,438 | 0 | 0 | 1 | 1 | So I have a Scrapy project set up and I have enabled the ROBOTSTXT_OBEY middleware which is working fine on robot.txt files that are in the following format:
User-agent: *
Disallow: /tools/
But when the same spider on a site with a robots.txt file in the following format it doesn't work:
User-agent: *
Disallow: *?next
... |
use email address as datastore key using python app engine | 26,784,116 | 0 | 0 | 98 | 0 | python,google-app-engine,google-cloud-datastore | When you create your entity do this:
MyModel(id=emailAddress).put()
then use get_by_id
user = MyModel.get_by_id(emailAddress) | 0 | 0 | 0 | 0 | 2014-11-06T15:44:00.000 | 1 | 1.2 | true | 26,783,510 | 0 | 0 | 1 | 1 | I define my model ndb in python. I want to use the email address of a user as the key, how do I do that? user is passing in the email address through an html form. I have everything setup and working. I just don't know how to specify that the email address string is the key. |
How to get Authentication header to persist | 26,803,136 | 4 | 4 | 364 | 0 | python,django,http,authentication,cookies | No, only cookies stored in browser persistently. All other headers are transient by HTTP protocol definition. | 0 | 0 | 1 | 0 | 2014-11-07T01:50:00.000 | 1 | 0.664037 | false | 26,792,751 | 0 | 0 | 1 | 1 | I am trying to setup token based authentication in python. using Django/DRF. but this is more about http in general i think.
When users put in username/password I return to them their token via JSON.
The client then can post the token in HTTP Header for me to check.
My problem is I want the token to persist in the head... |
Web application + Mobile App Python/Django architecture | 26,801,669 | 0 | 0 | 2,645 | 0 | android,python,django,architecture,django-rest-framework | I don't use Django but I am currently using Angular with Flask as my REST backend. I think the hybrid approach is useful if your app benefits from caching rendered content. An example would be something like a blogging site where you may store Markdown but render HTML and thus the content is largely unchanging. If this... | 0 | 0 | 0 | 0 | 2014-11-07T11:47:00.000 | 1 | 0 | false | 26,800,566 | 0 | 0 | 1 | 1 | I'm starting a new side project in order to learn some new technologies and I have several doubts about the architecture I should use. My idea is developing an app both for web and for mobile (Android app mainly), so I think I need to implement the following:
REST API service (with django-rest-framework).
Web applicat... |
Pycharm doesn't recognize Django installation | 26,851,321 | 1 | 0 | 2,279 | 0 | python,django,macos,pycharm | Thanks guys, just tried again and got an "install django" option which fixed it. Don't know why that showed up now but not before. | 0 | 0 | 0 | 0 | 2014-11-10T15:32:00.000 | 2 | 1.2 | true | 26,847,210 | 1 | 0 | 1 | 2 | I'm trying to create a new django project in Pycharm and I'm getting an error "No Django Support Installed in Selected Interpreter". After getting the message the first time I installed django, but the message persists. I have three versions of python installed: 2.5, 2.6 and 2.7, and I get the same message with all thr... |
Pycharm doesn't recognize Django installation | 58,051,603 | 0 | 0 | 2,279 | 0 | python,django,macos,pycharm | go to file/setting/Project:"name project"
there you should add your interpreter that you want use for your project | 0 | 0 | 0 | 0 | 2014-11-10T15:32:00.000 | 2 | 0 | false | 26,847,210 | 1 | 0 | 1 | 2 | I'm trying to create a new django project in Pycharm and I'm getting an error "No Django Support Installed in Selected Interpreter". After getting the message the first time I installed django, but the message persists. I have three versions of python installed: 2.5, 2.6 and 2.7, and I get the same message with all thr... |
How to move from Django to REST-API/Thin Client? | 26,850,033 | 1 | 0 | 146 | 0 | javascript,python,rest | If I understand what you're trying to do, you might be looking for something like jQuery. It's a subtle JS framework that will make it easier to talk to your Django API, especially using Ajax and JSON. | 0 | 0 | 1 | 0 | 2014-11-10T17:54:00.000 | 2 | 0.099668 | false | 26,849,884 | 0 | 0 | 1 | 1 | We are thinking to move away from Django and separate the backend and frontend.
The backend is straight forward as I have done it plenty of times by exposing it as a Python RESTful API.
Whats new to me is the thin client part.
Theoretically I could just write HTML and plain javascript to talk to the API.
Is there a ma... |
Python Flask application cannot be accessed by remote computers in network | 26,857,138 | 7 | 2 | 1,120 | 0 | python,python-2.7,flask | Your app.run() function must be app.run(host='0.0.0.0') in order to give access other devices on same network. | 0 | 0 | 0 | 0 | 2014-11-11T03:45:00.000 | 1 | 1.2 | true | 26,857,111 | 0 | 0 | 1 | 1 | I ran a simple flask web application on python on my localhost.
The web application is running on 127.0.0.1:8000. But I cannot access it from a remote machine in my network using myHostComputerIPaddress:8000.
My host is a windows machine. Please advise. |
how to protect request information from 3rd party android apps using python | 26,860,181 | 1 | 0 | 39 | 0 | android,python | Assuming you will be using a REST-based setup you might want to look into using ssl certificates and use https for verification and signal protection.
For a simpler solution, use a pre-shared-key and put it in the header of the request.
With that said your setup will only be as safe as your key management. Encryption a... | 0 | 0 | 1 | 0 | 2014-11-11T06:53:00.000 | 1 | 1.2 | true | 26,859,236 | 0 | 0 | 1 | 1 | how to protect request information from 3rd party android apps using server side.
Hello,
anybody can help, how to identify 3rd party android apps and we protect access from 3rd party |
How to access a given list element in django templates? | 26,866,366 | 0 | 0 | 983 | 0 | python,css,django | You can just use menu.2 in your template. | 0 | 0 | 0 | 0 | 2014-11-11T13:43:00.000 | 3 | 0 | false | 26,866,307 | 0 | 0 | 1 | 3 | I have a list of values in my view where I want to store some classes name and pass them to the template. Here is the list in the view: menu = ['','disabled','','',''] and my code for the template <li class="{{ menu|slice:"1:2"|first }}"></li>.
So far this is the only working code I came with, is there a better way to ... |
How to access a given list element in django templates? | 26,866,393 | 0 | 0 | 983 | 0 | python,css,django | An alternative is to get the element[n] that you need in your view, and pass it to the template directly.
Generally speaking, It's a better approch to pass to the template the data that you're going to actually use. So why pass a full list to use only one item of it? | 0 | 0 | 0 | 0 | 2014-11-11T13:43:00.000 | 3 | 0 | false | 26,866,307 | 0 | 0 | 1 | 3 | I have a list of values in my view where I want to store some classes name and pass them to the template. Here is the list in the view: menu = ['','disabled','','',''] and my code for the template <li class="{{ menu|slice:"1:2"|first }}"></li>.
So far this is the only working code I came with, is there a better way to ... |
How to access a given list element in django templates? | 26,866,364 | 0 | 0 | 983 | 0 | python,css,django | menu.1 should work
if you know the exact index of your list, it could be cleaner and more explicit to do retrieval in your view.
context['menu_target'] = menu[1]
instead of having a list of empty values and accessing them in your template | 0 | 0 | 0 | 0 | 2014-11-11T13:43:00.000 | 3 | 1.2 | true | 26,866,307 | 0 | 0 | 1 | 3 | I have a list of values in my view where I want to store some classes name and pass them to the template. Here is the list in the view: menu = ['','disabled','','',''] and my code for the template <li class="{{ menu|slice:"1:2"|first }}"></li>.
So far this is the only working code I came with, is there a better way to ... |
Selenium webdriver + PhantomJS processes not closing | 29,312,102 | 0 | 1 | 809 | 0 | python,selenium-webdriver,phantomjs | Go figure. Problem resolved with a reboot. | 0 | 0 | 1 | 0 | 2014-11-11T15:34:00.000 | 2 | 1.2 | true | 26,868,492 | 0 | 0 | 1 | 1 | Here's just about the simplest open and close you can do with webdriver and phantom:
from selenium import webdriver
crawler = webdriver.PhantomJS()
crawler.set_window_size(1024,768)
crawler.get('https://www.google.com/')
crawler.quit()
On windows (7), every time I run my code to test something out... |
Removing the .py file of a Django view does not actually remove the view | 26,870,947 | 0 | 0 | 85 | 0 | python,django,django-views | The most likely explanation is that you did not remove pages/views.pyc If that file is still present, then Python will load it. Whenever you remove a .py file make sure to remove the .pyc too. The .pyc is the "compiled" version of your .py file. | 0 | 0 | 0 | 0 | 2014-11-11T16:58:00.000 | 1 | 0 | false | 26,870,235 | 0 | 0 | 1 | 1 | I have a project in Django.
I'm trying to change some logic in /pages/views.py. But my changes are not applied. Then to test I removed /pages/views.py but the pages still work. When I try to delete the /pages/templates/page.html, I get the error, which is as it should be.
I don't understand why removing the script does... |
Generate HMAC signature for Google Maps at work API on Apigee Edge | 27,083,574 | 0 | 1 | 490 | 0 | javascript,python,google-maps,apigee,hmacsha1 | I was able to make it work with Python. My solution is based mostly on Google's example script. I had to make changes to the line to decode the signature in order for it to work on Apigee Edge. Of course, this will only work for those who have a paid Apigee Edge account as the free version does not support Python. | 0 | 0 | 0 | 0 | 2014-11-11T20:26:00.000 | 1 | 1.2 | true | 26,873,898 | 0 | 0 | 1 | 1 | I am trying to generate a valid signature for the google maps API on Apigee edge.
I've tried using a javascript callout to no avail. I am able to generate signatures but they don't match what google expects. I suspect it has to do with the encoding of the crypto key.
I can't get python scripts to deploy at all (already... |
Check if current user is logged in using any django social auth provider | 49,575,484 | 1 | 7 | 4,806 | 0 | django,django-socialauth,python-social-auth | i was searching on that and the solution is user.social_auth.exists()
it will return True if the user exists in the database else it will return false. | 0 | 0 | 0 | 0 | 2014-11-12T03:58:00.000 | 7 | 0.028564 | false | 26,879,011 | 0 | 0 | 1 | 1 | I would like to check if a user is logged in via social authentication or using the django default authentication.
something like
if user.social_auth = true? |
Photologue zip uploader not working | 26,918,549 | 0 | 1 | 98 | 0 | python,django,photologue | There was a bug in Photologue 3.1 - the templates required for this feature were missing.
Photologue 3.1.1 fixes this :-) | 0 | 0 | 0 | 0 | 2014-11-13T03:29:00.000 | 1 | 0 | false | 26,900,849 | 0 | 0 | 1 | 1 | According to the docs, The 'zip upload' functionality has been moved to a custom admin page as of 11/4/2014. This functionality is nowhere to be found, and my galleries upload field in admin disallows uploading zip files. |
What is the most efficient way to write 3GB of data to datastore? | 26,917,183 | 2 | 0 | 102 | 0 | python-2.7,google-app-engine,google-cloud-datastore | If you need to store each row as a separate entity, it does not matter how you create these entities - you can improve the performance by batching your requests, but it won't affect the costs.
The costs depend on how many indexed properties you have in each entity. Make sure that you only index the properties that you ... | 0 | 1 | 0 | 0 | 2014-11-13T19:45:00.000 | 2 | 0.197375 | false | 26,917,114 | 0 | 1 | 1 | 1 | I have a 3Gb csv file. I would like to write all of the data to GAE datastore. I have tried reading the file row by row and then posting the data to my app, but I can only create around 1000 new entities before I exceed the free tier and start to incur pretty hefty costs. What is the most efficient / cost effective way... |
long-type in Python vs Java & C | 26,939,554 | 0 | 0 | 1,680 | 0 | java,python,long-integer,primitive | Python stores long integers with unlimited percision, allowing you to store large numbers as long as you have available address space.
As for Java, use BigInteger class | 0 | 0 | 0 | 1 | 2014-11-14T21:50:00.000 | 2 | 0 | false | 26,939,410 | 0 | 0 | 1 | 1 | Why is Python able to store long-integers of any length were as Java and C only provide 64 bits?
If there is a way in Java to do it, please show it. |
Why does GAE use classes and self.response.out.write over functions and print? | 26,952,993 | 3 | 0 | 733 | 0 | python,google-app-engine,webapp2 | Using Methods
Each handler class has methods with names like get and post, after the HTTP methods GET and POST etc. Those methods are functions that handle requests.
Each request to your server will be routed to a request handler object, which is a new instance of some request handler class. So, a request handler insta... | 0 | 1 | 0 | 0 | 2014-11-15T06:51:00.000 | 1 | 0.53705 | false | 26,943,368 | 1 | 0 | 1 | 1 | I'm a beginner and am wondering why we use self.response.out.write instead of print, and why we use classes, instead of functions, for the request handlers in the first place. Are there any special reasons? |
Check whether element is clickable in selenium | 26,947,299 | 9 | 20 | 53,151 | 0 | python,html,selenium,selenium-webdriver | You can use webElement.isEnabled() and webElement.isDisplayed() methods before performing any operation on the input field...
I hope this will solve you problem...
Else, you can also put a loop to check above 2 conditions and if those are true you can specify the input text and again you can find the same element and y... | 0 | 0 | 1 | 0 | 2014-11-15T08:01:00.000 | 3 | 1 | false | 26,943,847 | 0 | 0 | 1 | 1 | I'm able to verify whether or not an element exists and whether or not it is displayed, but can't seem to find a way to see whether it is 'clickable' (Not talking about disabled).
Problem is that often when filling a webform, the element i want may be overlayed with a div while it loads. The div itself is rather hard t... |
With PyCharm, how do I reference django files when using remote AWS interpreter? | 27,120,852 | 0 | 1 | 215 | 0 | python,django,pycharm | (Using PyCharm 4.0) Go to Tools --> Deployment --> and either select an existing server connection or create a new one. Under the Mappings tab, you can associate a local path with a remote path. I keep my Django project folder mapped to the one on the server.
Once you hit OK, go back to Tools --> Deployment, and you ... | 0 | 0 | 0 | 0 | 2014-11-15T17:16:00.000 | 1 | 0 | false | 26,948,469 | 1 | 0 | 1 | 1 | I have an existing django project on an AWS instance. I have copied my Python files to my local machine. PyCharm is configured to use the Python interpreter on the remote machine. The django file references are, naturally, not resolved by PyCharm, since the django files are not on the local machine.
Is the usual pro... |
Monitor Management Command Execution in Django | 26,971,741 | 0 | 0 | 142 | 0 | python,django | You could create a file named "i_am_running.log" at the beginning of your management command and remove it at the end if it. When running same management command, check for its' presence. In case of no exist - go further. Otherwise - abort. | 0 | 1 | 0 | 0 | 2014-11-17T06:15:00.000 | 2 | 0 | false | 26,966,645 | 0 | 0 | 1 | 1 | I'm writing a Django app that uses a management command to pull data from various sources. The plan is to run this command hourly with cron, and also have it run on user command from a view (i.e. when they add a new item that needs data, I don't want them to wait for the next hour to roll around to see results). The qu... |
Real-time communication between app and webpage | 26,985,616 | 2 | 1 | 651 | 0 | android,python,sockets,redis,real-time | One approach might be:
set up a database on a server on the internet
program your app to save data to that remote database
set up a webservice
program the webservice to read data from the database and serve it as an html page
For extra credit
implement a REST style API which retrieves and serves data from the databa... | 0 | 0 | 1 | 0 | 2014-11-18T02:28:00.000 | 1 | 1.2 | true | 26,985,577 | 0 | 0 | 1 | 1 | I'm trying to figure out how to have a real time data displayed on a webpage through the use of an android app.
For example, users are using android app and are scored (answering questions). My webpage will display the scores in order in real-time.
Iv come to the conclusion to use Redis, but what exactly do i need for ... |
Python mechanize wait and click | 26,986,649 | 0 | 1 | 1,315 | 0 | python,mechanize,mechanize-python | If it's an anchor tag, then just GET/POST whatever it is.
The timer between links appearing is generally done in javascript - some sites you are attempting to scrape may not be usable without javascript, or requires a token generated in javascript with clientside math.
Depending on the site, you can either extract the ... | 0 | 0 | 1 | 0 | 2014-11-18T04:31:00.000 | 2 | 0 | false | 26,986,623 | 0 | 0 | 1 | 1 | Using mechanize, how can I wait for some time after page load (some websites have a timer before links appear, like in download pages), and after the links have been loaded, click on a specific link?
Since it's an anchor tag and not a submit button, will browser.submit() work(I got errors while doing that)? |
Rails app to work with a remote heroku database | 26,994,319 | 1 | 0 | 58 | 0 | python,ruby-on-rails,ruby,ruby-on-rails-3,heroku | I don't see any problem in doing this, as far as rails manages the database structure and python script populates it with data.
My advice, but just to make it simpler, is to define the database schema through migrations in your rails app and build it like the python script doesn't exist.
Once you have completed it, sim... | 0 | 0 | 0 | 1 | 2014-11-18T09:32:00.000 | 1 | 1.2 | true | 26,990,840 | 0 | 0 | 1 | 1 | I have built an application in python that is hosted on heroku which basically uses a script written in Python to store some results into a database (it runs as a scheduled task on daily basis). I would have done this with ruby/rails to avoid this confusion, but the application partner did not support Ruby.
I would lik... |
Python3 Django -> HTML to PDF | 27,025,464 | 0 | 10 | 13,449 | 0 | python,django,pdf,html-to-pdf | wkhtmltopdf requires
CSS to be inlined
static files to be locally present on the server
static file urls to be os paths, eg: /home/ubuntu/project/project/static/file_name | 0 | 0 | 0 | 0 | 2014-11-18T14:42:00.000 | 4 | 0 | false | 26,996,976 | 0 | 0 | 1 | 1 | There are a lot of different ways of generating pdfs from a django webpage in python2. The most clean, probably, is pisa and reportlab.
These do not work for python3 though.
So far, the only method I've had success with is to render the template, write it to a file, and then use wkhtmltopdf via subprocess.popen. This w... |
Run script on remote server from Django Webserver | 27,115,581 | 1 | 3 | 1,638 | 0 | python,django | After reading through and trying out various forum suggestions and spending solid time in Google, I've settled down with paramiko. It does exactly what I wanted and works like a charm for now.
On click of a button on my website, running on server1, I make a request to run a python script. The python script uses parami... | 0 | 0 | 0 | 0 | 2014-11-18T23:11:00.000 | 2 | 1.2 | true | 27,005,924 | 0 | 0 | 1 | 2 | I have a basic (server1) Django development web server and another server (server2) which has a python script that does some scientific calculations. Assume that the server1 has necessary authentication in place to run the script on server2. All I want to do is, click a button on the django website which would run the ... |
Run script on remote server from Django Webserver | 27,006,689 | 0 | 3 | 1,638 | 0 | python,django | There is no reason why server one cannot execute something like selenium or phantomjs on itself to navigate to your website on server2 and click a button on server 2 which then uses something like python's subprocess module to execute a program from server 2. | 0 | 0 | 0 | 0 | 2014-11-18T23:11:00.000 | 2 | 0 | false | 27,005,924 | 0 | 0 | 1 | 2 | I have a basic (server1) Django development web server and another server (server2) which has a python script that does some scientific calculations. Assume that the server1 has necessary authentication in place to run the script on server2. All I want to do is, click a button on the django website which would run the ... |
How do I truncate floats to two decimal places in cheetah templates? | 27,010,118 | 3 | 1 | 525 | 0 | python,templates,cheetah | I just discovered a solution via output from complex expressions using #echo:
#echo '%.2f' % $my_float_var#
This prints out my float in the variable $my_float_var with only two decimal places. | 1 | 0 | 0 | 0 | 2014-11-19T05:49:00.000 | 3 | 0.197375 | false | 27,009,879 | 0 | 0 | 1 | 1 | I'm currently using Cheetah Templates with my python code and I'm passing in a number of floating point numbers. I'd like to truncate these floats to only two decimal places within the template, e.g. 0.2153406 would become 0.21
Is it possible to do this within the Cheetah template of do I have to pass in already trunca... |
Running CGI Python Javascript to retrieve JSON object | 29,558,961 | 0 | 0 | 847 | 0 | javascript,python,ajax,json,cgi | Have you checked your host's server logs to see if it's giving you any output?
Before asking here, a good idea would be to ssh to your host, if you can, and running the program directly, which will most likely print the error in the terminal.
This is far too general at the moment, there are so many reasons why a CGI re... | 0 | 0 | 1 | 1 | 2014-11-19T14:38:00.000 | 2 | 0 | false | 27,019,558 | 0 | 0 | 1 | 1 | I want to use javascript to retrieve a json object from a python script
Ive tried using various methods of ajax and post but cant get anything working.
For now I have tried to set it up like this
My Javascript portion:
I have tried
$.post('./cgi-bin/serverscript.py', { type: 'add'}, function(data) {
cons... |
Selenium PhantomJS click element with href="#" | 51,226,805 | 0 | 2 | 800 | 0 | python,selenium,selenium-webdriver,phantomjs | href="#" just refreshes the page when you select the link, for example if it was href=#top" when you select the link you would be brought to the top of that same page.
You are probably doing it correctly, you can use driver.find_element_by_link_text('some text') or driver.find_element_by_partial_link_text('some text')... | 0 | 0 | 1 | 0 | 2014-11-19T22:54:00.000 | 1 | 0 | false | 27,028,599 | 0 | 0 | 1 | 1 | Coding in Python 2.7.
I have a crawler I setup and it works perfectly fine when driven by FireFox, but breaks when driven by PhantomJS.
I'm trying to click on an element with href="#"
The crux of the issue is that when the FF driver clicks on this element with the # href, it performs the javascript action (in this case... |
PyDev not appearing in Eclipse after install | 27,035,599 | 0 | 3 | 7,516 | 0 | python,eclipse | Had this same problem a few days ago. You might have downloaded the wrong version of PyDev for your python version (2.7.5 or something is my python version, but I downloaded PyDev for version 3.x.x)
1) Uninstall your current version PyDev
2) you have to install the correct version by using the "Install New Software", ... | 0 | 1 | 0 | 0 | 2014-11-20T08:11:00.000 | 3 | 0 | false | 27,034,666 | 1 | 0 | 1 | 1 | I have Java version 7 and had installed PyDev version 3.9 from Eclipse Marketplace..but it's not showing up in New project or in Windows perspective in Eclipse..Can some one please tell me what i need to do ??? |
How to use java libraries in python processing | 40,499,350 | 0 | 1 | 390 | 0 | java,python | Use the add_library function:
add_library("sound") | 0 | 0 | 0 | 0 | 2014-11-21T02:12:00.000 | 2 | 0 | false | 27,053,070 | 1 | 0 | 1 | 2 | Im using processing in python mode but I want to use the processing library sound. But I dont know how to import this into my program in python syntax.
In java its like this:
Import processing.sound.*;
Thanks |
How to use java libraries in python processing | 28,146,057 | 0 | 1 | 390 | 0 | java,python | You can use add_library(processing.sound). I used it with g4p library | 0 | 0 | 0 | 0 | 2014-11-21T02:12:00.000 | 2 | 0 | false | 27,053,070 | 1 | 0 | 1 | 2 | Im using processing in python mode but I want to use the processing library sound. But I dont know how to import this into my program in python syntax.
In java its like this:
Import processing.sound.*;
Thanks |
django development server, how to stop it when it run in background? | 27,074,081 | 6 | 52 | 122,154 | 0 | python,django,server | well it seems that it's a bug that django hadn't provided a command to stop the development server . I thought it have one before~~~~~ | 0 | 0 | 0 | 0 | 2014-11-21T16:50:00.000 | 10 | 1 | false | 27,066,366 | 0 | 0 | 1 | 5 | I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development? |
django development server, how to stop it when it run in background? | 27,066,460 | 3 | 52 | 122,154 | 0 | python,django,server | As far as i know ctrl+c or kill process is only ways to do that on remote machine.
If you will use Gunicorn server or somethink similar you will be able to do that using Supervisor. | 0 | 0 | 0 | 0 | 2014-11-21T16:50:00.000 | 10 | 0.059928 | false | 27,066,366 | 0 | 0 | 1 | 5 | I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development? |
django development server, how to stop it when it run in background? | 50,886,343 | 1 | 52 | 122,154 | 0 | python,django,server | From task manager you can end the python tasks that are running.
Now run python manage.py runserver from your project directory and it will work. | 0 | 0 | 0 | 0 | 2014-11-21T16:50:00.000 | 10 | 0.019997 | false | 27,066,366 | 0 | 0 | 1 | 5 | I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development? |
django development server, how to stop it when it run in background? | 53,480,387 | -3 | 52 | 122,154 | 0 | python,django,server | You can Quit the server by hitting CTRL-BREAK. | 0 | 0 | 0 | 0 | 2014-11-21T16:50:00.000 | 10 | -0.059928 | false | 27,066,366 | 0 | 0 | 1 | 5 | I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development? |
django development server, how to stop it when it run in background? | 66,500,994 | 4 | 52 | 122,154 | 0 | python,django,server | Ctrl+c should work. If it doesn't Ctrl+/ will force kill the process. | 0 | 0 | 0 | 0 | 2014-11-21T16:50:00.000 | 10 | 0.07983 | false | 27,066,366 | 0 | 0 | 1 | 5 | I use a Cloud server to test my django small project, I type in manage.py runserver and then I log out my cloud server, I can visit my site normally, but when I reload my cloud server, I don't know how to stop the development server, I had to kill the process to stop it, is there anyway to stop the development? |
Django: Not responding to the changes after git pull | 27,075,384 | 1 | 1 | 923 | 0 | python,django,git,digital-ocean | Two things:
git reset --hard will just remove any changes to your current branch you may have. Try git fetch --all && git pull --rebase or git fetch --all && git pull.
Try removing all '.pyc' files. An easy command to do that is (assuming you're in the root directory of your project): find . -name '*.pyc' -exec rm {} ... | 0 | 0 | 0 | 0 | 2014-11-22T08:01:00.000 | 1 | 1.2 | true | 27,075,344 | 0 | 0 | 1 | 1 | I have a Django 1.6 project using Gunicorn+Nginx. I have cloned it to my web server (DigitalOcean) and it looked fine and the site was working.
Then I made some changes on the projects in my PC and pushed to GitHub. Then I downloaded the updates by using git fetch -all and git reset --HARD. The project in the ... |
celery: programmatically queue task to a specific queue? | 27,100,098 | 0 | 0 | 283 | 0 | python,celery | you should do something like that:
sometask.apply_async(args = ['args1','args2'], queue = 'dev') | 0 | 1 | 0 | 0 | 2014-11-24T06:40:00.000 | 1 | 1.2 | true | 27,099,187 | 0 | 0 | 1 | 1 | When I do sometask.async_apply(args=['args1','args2'], kwargs={'queue': 'dev'}) nothing ends up on the queue 'dev'. I'm wondering if I am missing a step somewhere? I have created the queue 'dev' already and it shows up under queues when I check the rabbitmq management. |
Django Rest Framework organizing ViewSets and Routers | 27,130,805 | 3 | 0 | 1,162 | 0 | python,django,django-rest-framework | For what it's worth, I've always created a separate api/ subdirectory within my Django apps to hold all Django REST Framework related files. This is just one way of doing things but it's helped keep separation of concerns within our applications.
The hierarchy looked like this...
Django Project/
Django App/
views.p... | 0 | 0 | 0 | 0 | 2014-11-25T14:44:00.000 | 1 | 1.2 | true | 27,129,642 | 0 | 0 | 1 | 1 | Hi there so my question is probably about best practices when organizing ViewSets and the corresponding Routers in Django Rest Framework.
According to the official documentation, the routers should be stored in the urls.py and the viewsets should be stored in views.py.
My idea of an approach would be having the viewse... |
How to modify Django admin ManyToManyField text? | 27,135,554 | 0 | 2 | 579 | 0 | python,django,admin,manytomanyfield | The Django Admin select menus use the unicode value of the model instance to populate things like menus. Whatever your __unicode__ method returns should be what is in the select menu. | 0 | 0 | 0 | 0 | 2014-11-25T19:49:00.000 | 4 | 0 | false | 27,135,428 | 0 | 0 | 1 | 1 | I have "Articles" and "Modules" apps. Inside "Modules" app there is model which have to display articles and they're linked by ManyToManyField in "Modules".
My question is how to modify text value in select field in Django admin? As default it displays names of articles, but i want also some information from Article mo... |
Is there a way to integrate a processing sketch written in Python in a webpage? | 49,843,328 | 0 | 4 | 144 | 0 | javascript,python,processing | At the moment there is no straightforward way to do this. But some workarounds can be found. For example, since Processing's python mode is using Jython language (Python on JVM) you can do the following:
Compile the Jython code to Java bytecode
Decompile Java bytecode to real Java code
Use processing.js to make the sk... | 0 | 0 | 0 | 0 | 2014-11-26T09:05:00.000 | 1 | 0 | false | 27,145,014 | 1 | 0 | 1 | 1 | The title says it all.
I spent a lot of time designing a sketch in Processing using the Python language.
Now, I would like to put the sketch on a webpage.
Of course, I could just translate the sketch from python language to javascript and use a javascript library for processing.
However, this would be a very lengthy pr... |
How can I remove version 0.9.7 of sqlalchemy and install 0.7.8 instead? | 27,371,294 | 2 | 1 | 1,813 | 1 | python,linux,python-2.7,ubuntu,sqlalchemy | To get passed this error I just simply ran the command:
sudo easy_install "SQLAlchemy==0.7.8"
The virtual environments do seem like the preferred method though, so hopefully I don't run into any additional problems from downgrading system-wide. | 0 | 0 | 0 | 0 | 2014-11-27T01:37:00.000 | 2 | 1.2 | true | 27,161,760 | 0 | 0 | 1 | 1 | I am using Ubuntu 14.04 and trying to run snoopy_auth which is a part of the snoopy-ng application I downloaded and installed from their GitHub.
When running, I get an error that is documented on snoopy-ng's GitHub page, which says that it works using version 0.7.8.
How can I downgrade sqlalchemy to 0.7.8?
The error lo... |
How to synchronise local Django sqlite database with the server one? | 27,163,084 | 2 | 0 | 860 | 1 | python,django,database,git | Follow the following steps to push from local and pull to server.
make changes to models.py
Use this cmd to add change to git . > git add models.py
use this cmd to commit > git commit -m "your message"
git push > this will push your local changes to repo.
go to sever now.
run cmd > git status
see if there are any loc... | 0 | 0 | 0 | 0 | 2014-11-27T04:17:00.000 | 1 | 1.2 | true | 27,162,982 | 0 | 0 | 1 | 1 | I have a working Django 1.6 project using sqlite deployed in Digital Ocean, Ubuntu.
I use Git to update my project on server side. (Git clone and git pull thereafter)
My question is: every time after I update my database locally (e.g. added some new tables), how can I synchronise with the server one? Using git pull res... |
SQLAlchemy ORM: safely passing objects between threads without manually reattaching? | 27,194,059 | 5 | 2 | 1,254 | 1 | python,multithreading,sqlalchemy | Session.merge() is enough and should do what you're after, but even then it gets fiddly with threads. You might want to rethink this.
Pass the primary key(s) to the worker instead of the objects, and then handle object loading and the actual work in the worker itself. No messing around with threading and open/closed se... | 0 | 0 | 0 | 0 | 2014-11-28T17:57:00.000 | 1 | 1.2 | true | 27,193,849 | 0 | 0 | 1 | 1 | I'm working on a multithreaded application that uses the SQLAlchemy ORM. It already uses scoped_session with the thread as its scope, but we are having some issues when we pass an ORM object from a worker thread back to the main thread. Since the objects are attached to the worker thread's session, when the worker thre... |
Django custom command works on command line, but not call_command | 27,198,456 | 0 | 1 | 591 | 0 | python,django,python-2.7 | It turns out that for my purposes, I needed to be calling my custom commands from within another custom command file. My intent was to have one file that would call my other custom commands and this wasn't working with just a regular Python file. As soon as I made this regular Python file into another custom command ... | 0 | 0 | 0 | 0 | 2014-11-28T22:47:00.000 | 1 | 1.2 | true | 27,196,845 | 0 | 0 | 1 | 1 | I have a custom django admin call that I am able to successfully call from the command line using: python manage.py mycustomcommand. Therefore, the directories are setup with the necessary init files in 'management' and 'commands' folders, and I have listed the apps under INSTALLED_APPS in my settings file.
When I t... |
DLL loading (C#/IronPython/C#) in VS2012 | 27,233,826 | 1 | 0 | 390 | 0 | c#,.net,dll,ironpython | You can try replicating what "works for me". Create a solution containing:
python project (ironpython)
C# project
Add a reference to desired oracle library (Oracle.DataAccess.dll) to C# project using the standard VS mechanism. C# project should also contains a post build step to copy the resulting dll and pdb into th... | 1 | 0 | 0 | 0 | 2014-11-30T01:01:00.000 | 1 | 1.2 | true | 27,208,926 | 0 | 0 | 1 | 1 | I want to debug separate pieces of my application in Visual Studio 2012.
I have C# executable which works with Oracle.DataAccess dll. It works fine.
Within it IronPython runtime is invoked and it works fine too.
Within these IronPython modules object from main C# application is invoked and it works fine with Oracle dll... |
Storing client secrets on Django app on App Engine | 27,214,235 | 0 | 7 | 812 | 0 | python,django,google-app-engine | You can hardly hide the secret keys from an attacker that can access your server, since the server needs to know the keys. But you can make it hard for an attacker with low privileges.
Obfuscating is generally not considered as a good practice.
Your option 5 seems reasonable. Storing the keys in a non-source controlled... | 0 | 1 | 0 | 0 | 2014-11-30T14:06:00.000 | 2 | 0 | false | 27,214,104 | 0 | 0 | 1 | 2 | I have a Django app that uses some secret keys (for example for OAuth2 / JWT authentication). I wonder where is the right place to store these keys.
Here are the methods I found so far:
Hardcoding: not an option, I don't want my secrets on the source control.
Hardcoding + obfuscating: same as #1 - attackers can just r... |
Storing client secrets on Django app on App Engine | 37,824,536 | 0 | 7 | 812 | 0 | python,django,google-app-engine | A solution I've seen is to store an encrypted copy of the secret configuration in your repository using gpg. Depending on the structure of your team you could encrypt it symmetrically and share the password to decrypt it or encrypt it with the public keys of core members / maintainers.
That way your secrets are backed ... | 0 | 1 | 0 | 0 | 2014-11-30T14:06:00.000 | 2 | 0 | false | 27,214,104 | 0 | 0 | 1 | 2 | I have a Django app that uses some secret keys (for example for OAuth2 / JWT authentication). I wonder where is the right place to store these keys.
Here are the methods I found so far:
Hardcoding: not an option, I don't want my secrets on the source control.
Hardcoding + obfuscating: same as #1 - attackers can just r... |
Access URL parameters in django 1.7 template without using context processors | 27,217,307 | 0 | 0 | 815 | 0 | python,django,python-2.7,django-templates,django-views | You can try using custom tags in django templates. | 0 | 0 | 0 | 0 | 2014-11-30T19:26:00.000 | 2 | 0 | false | 27,217,237 | 0 | 0 | 1 | 1 | http://www.example.com/soe/?param1=val1
this is current url and I want to access variable {{param1}} in django template. (Django 1.7)
I know there are already many threads available for this problem but all of them are using ContextProcessor.(or render_to_response)
I'm simply using return render(request, template, {})... |
Operator in Java like // in python? | 57,453,225 | 1 | 2 | 2,327 | 0 | java,python,operators | One thing to notice is:
in python 3:
6 // -132 = -1
in java:
6 / -132 = 0 | 0 | 0 | 0 | 0 | 2014-11-30T19:43:00.000 | 4 | 0.049958 | false | 27,217,401 | 0 | 0 | 1 | 1 | Is there a form of the // operator that is used in python that I can use in java, or some sort of workaround?
10 // 3 = 3 |
Django best user model design | 27,220,032 | 2 | 3 | 603 | 0 | python,django,database-design,design-principles | First, if you want to use email as username, use the Django custom user functionnality. It works well.
Then, note that it's not because you created your own User that you can't extend it with a Profile.
So, a good solution could be :
Create a Django custom User without trying to add specific fields to it (the one and ... | 0 | 0 | 0 | 0 | 2014-11-30T19:59:00.000 | 1 | 0.379949 | false | 27,217,584 | 0 | 0 | 1 | 1 | Probably some of you would tell that is a recurrent topic, but after reading many articles, it still seems very ambiguous to me. My question is about the best way to use and to extend the User model preserving the authentication (and others) mechanisms available in Django. However, I prefer to describe my design:
Th... |
Show instant error page when database host is unavailable - django | 27,225,478 | 0 | 0 | 271 | 0 | python,django | You need to keep checking the socket connection status continuously in a script that will inform you regarding the same.
In case you are more concerned with the performance issues then you can make use of a in memory caching system like redis etc.
cheers :-) | 0 | 0 | 0 | 0 | 2014-12-01T09:22:00.000 | 2 | 0 | false | 27,225,181 | 0 | 0 | 1 | 1 | I want to show instant error page when database host is unavailable. Default behavior for django is that ,when user requests , it takes long time and then displays error page.
Is there is any way to display some error instantly when database host is unreachable or database host is invalid with django without any delay ... |
How to run Debug server for Django project in PyCharm Community Edition? | 28,256,637 | 125 | 43 | 28,760 | 0 | python,django,configuration,ide,pycharm | Yes you can.
In Run -> Edit Configurations create new configuration
[+] / Python
Name: runserver
Scrip Path: path_to/manage.py
Parameters: runserver | 0 | 0 | 0 | 0 | 2014-12-03T10:42:00.000 | 2 | 1.2 | true | 27,269,574 | 0 | 0 | 1 | 1 | Has anyone had issues setting up a debug configuration for Django project in PyCharm Community Edition?
Community Edition of the IDE is lacking the project type option on project setup and then when I am setting up Debug or Run config it asks me for a script it should run. What script would it be for Django, manage.py?... |
can I combine NDB and mysqldb in one app on google cloud platform | 28,197,823 | 0 | 1 | 62 | 1 | google-app-engine,google-cloud-storage,google-cloud-datastore,mysql-python,app-engine-ndb | MySQL commands cannot be run on NoSQL. You will need to do some conversions during manipulation of the data from both DBs. | 0 | 1 | 0 | 0 | 2014-12-03T17:47:00.000 | 1 | 0 | false | 27,278,297 | 0 | 0 | 1 | 1 | Is it just about creating models that use the best fitting data store API?
For part of the data I need relations, joins and sum(). For other this is not necessary but nosql way is more appropriate. |
Plone Unified Installer missing Python | 27,300,059 | 4 | 1 | 226 | 0 | linux,python-2.7,plone,sles | The installer command:
./install.sh standalone --build-python --static-lxml=yes
worked perfectly for me. The installer downloaded and built the Python and libxml2/libxslt components necessary to remedy the terribly out-of-date (and vulnerable) versions included with sles11sp3.
System packages needed for the build wer... | 0 | 1 | 0 | 0 | 2014-12-04T11:42:00.000 | 1 | 0.664037 | false | 27,293,173 | 0 | 0 | 1 | 1 | I'm trying to install plone 4.3.4 on a SLES 11 SP3 64bit server via the Unified Installer. I've fullfilled all the dependencies listed in the readme.txt, but when I try to get the installer running with the command sudo ./install.sh --password=******* standalone I get the error message: which: no python2.7 in (/usr/bin... |
In using OpenErp 7 or Odoo 8, how do I modify it such that a manager assigned to a project is the one who will approve all timesheet entries for it? | 27,353,088 | 1 | 0 | 364 | 0 | python,module,openerp-7,odoo,time-management | You can manage this by grouping each employee according to their privilege. For example you have two groups Managerial and employee group so each of them might have different or some how common privilege on certain python objects from OpenERP so please identify those python objects and explore more in Setting >> Users... | 0 | 0 | 0 | 0 | 2014-12-05T04:35:00.000 | 1 | 1.2 | true | 27,308,836 | 0 | 0 | 1 | 1 | I have downloaded and installed and also tested via a virtual machine online Odoo 8 and OpenErp 7. I have spent many hours tinkering with the apps and features of both. I am unable to find any way from hours I spend searching or tinkering for a method to change the approve timesheet functionality in the manner I will e... |
Moving from RabbitMQ to Amazon SQS | 27,317,451 | 4 | 0 | 3,023 | 0 | python,django,amazon-web-services,rabbitmq,amazon-sqs | I haven't had any problems with slow performance on SQS, but then again it maybe that the be the nature of my apps don't count on sub-millisecond response times for items in my queue. For me the work done on the items in the queue contributes more to the lag than the time it takes to use the queue.
For me the distribut... | 0 | 0 | 0 | 1 | 2014-12-05T12:32:00.000 | 2 | 1.2 | true | 27,315,968 | 0 | 0 | 1 | 1 | Our startup is currently using RabbitMQ (with Python/Django) for messaging queues, now we are planning to move to Amazon SQS for its high availability & their delayed queue feature.
But I am reading on INTERNET everywhere that SQS is slow performing & also very cost effective, so is it wise decision to move to Amazon S... |
How to select tables in scrapy using selectors whose class id have spaces in it? | 41,831,890 | 0 | 0 | 2,468 | 0 | python,xpath,web-scraping,scrapy | I had the same issue because I was trying to scrape a wikipedia page. The class name for the table shows up as "wikitable sortable jquery-tablesorter" because of the plugin mentioned in the other answer which adds to the class name after it is used.
In order to pick up the table you can just look for the following cla... | 0 | 0 | 1 | 0 | 2014-12-06T11:59:00.000 | 2 | 0 | false | 27,331,444 | 0 | 0 | 1 | 1 | I'm trying to select all the tables inside a division which has xpath similar to //*[@id="mw-content-text"]/table[@class="wikitable sortable jquery-tablesorter"]. But the selector doesn't returns any value. How can I get through those tags which have spaces in their id/class ? |
Python : How to read file timestamp which is in html page in python | 27,334,938 | 0 | 0 | 225 | 0 | python,html,timestamp,zip | In general, there is no way to know about the file's timestamp unless the web page gives it to you. Sometimes you can read the file's parent container and get an index page for all of its files, but most public web servers try to block that sort of thing. | 0 | 0 | 0 | 0 | 2014-12-06T17:47:00.000 | 1 | 0 | false | 27,334,562 | 1 | 0 | 1 | 1 | I have a zipfile in html page, Is there any way to read that file's create\modified timestamp in python. I know we can read timestamp if it is in local directory.
Thanks in advance. |
Problems setting up Python development server at http://127.0.0.1:8000/ | 27,339,105 | 0 | 0 | 1,753 | 0 | python,django | You do not have to do more than you have done, however, you should make sure that you do not have the server from your previous project running, for one.
To confirm, are you at the point in the tutorial where you have run django-admin.py startproject mysite . You have also run python manage.py migrate.
Also, make sure ... | 0 | 0 | 0 | 0 | 2014-12-07T02:56:00.000 | 3 | 0 | false | 27,339,088 | 0 | 0 | 1 | 1 | I'm running into problems trying to use "python manage.py runserver."
According to the tutorial, I'm supposed to get a “Welcome to Django” screen when I visit my development server at http://127.0.0.1:8000/ but instead, I see one of my previous projects that's locally hosted on my computer. I'm wondering why this is,... |
uWSGI --http :80 doesn't listen IPv6 interface | 27,342,634 | 7 | 3 | 1,462 | 0 | http,python-3.x,ipv6,uwsgi | In your INI config file specify something like this
[uwsgi]
socket = [::]:your_port_number
Or from the CL,
./uwsgi -s [::]:your_port_number
The server shall now listen along all the interfaces (including IPv4, if the underlying OS supports dual stack TCP sockets) | 0 | 1 | 0 | 1 | 2014-12-07T11:41:00.000 | 1 | 1.2 | true | 27,342,256 | 0 | 0 | 1 | 1 | Why doesn't uWSGI listen on IPv6 interface, even if system is 100% IPv6 ready? As far as I could see there aren't parameters nor documentation covering this issue. |
How to downgrade from Django 1.7 to Django 1.6 | 71,538,417 | 0 | 17 | 28,236 | 0 | python,django,django-1.6,django-1.7 | pip install Django==1.6 in CMD | 0 | 0 | 0 | 0 | 2014-12-08T14:17:00.000 | 4 | 0 | false | 27,359,964 | 0 | 0 | 1 | 1 | I started a new project a few months back using Django 1.7. The company has decided to settle on using Django 1.6 for all projects.
Is there a nice way to downgrade from Django 1.7 to 1.6?
Are migrations the only thing I have to worry about? Are the changes between the two versions large enough that I need to rewrite t... |
Can't connect to redis using django-redis | 27,382,430 | 15 | 8 | 6,100 | 0 | python,django,amazon-web-services,redis,django-redis | Ok, figured it out. What I needed to do was prefix my location with redis://. This is specific to the django-redis library and how it parses the location url. That explains why when I manually set up a StrictRedis connection using the python redis library I was able to connect. | 0 | 0 | 0 | 0 | 2014-12-08T18:09:00.000 | 2 | 1.2 | true | 27,364,149 | 0 | 0 | 1 | 1 | I've got a django project using django-redis 3.8.0 to connect to an aws instance of redis. However, I receive ConnectionError: Error 111 connecting to None:6379. Connection refused. when trying to connect. If I ssh into my ec2 and use redis-py from the shell, I am able to read and write from the cache just fine, so I d... |
Django 1054 - Unknown Column in field list | 60,700,719 | 0 | 4 | 8,200 | 0 | python,mysql,django,database,data-migration | I faced the same issue all what i do to get out this issue just drop all tables in my DB and then run:
python manage.py makemigrations
and :
python manage.py migrate | 0 | 0 | 0 | 0 | 2014-12-10T14:05:00.000 | 4 | 0 | false | 27,403,050 | 0 | 0 | 1 | 4 | I have a Django project and I did the following:
Added a table with some columns
Insert some records into the db
Added a new column that I didn't realize I needed
Made an update to populate that column
When I did a migrate everything worked just fine. The new db column was created on the table and the values were po... |
Django 1054 - Unknown Column in field list | 40,621,929 | 0 | 4 | 8,200 | 0 | python,mysql,django,database,data-migration | This happened to me because I faked one migration (m1), created another (m2), and then tried to migrate m2 before I had faked my initial migration (m1).
So in my case I had to migrate --fake <app name> m1 and then migrate <app name> m2. | 0 | 0 | 0 | 0 | 2014-12-10T14:05:00.000 | 4 | 0 | false | 27,403,050 | 0 | 0 | 1 | 4 | I have a Django project and I did the following:
Added a table with some columns
Insert some records into the db
Added a new column that I didn't realize I needed
Made an update to populate that column
When I did a migrate everything worked just fine. The new db column was created on the table and the values were po... |
Django 1054 - Unknown Column in field list | 29,351,981 | 0 | 4 | 8,200 | 0 | python,mysql,django,database,data-migration | Unless the new column has a default value defined, the insert statement will expect to add data to that column. Can you move the data load to be after the second migration. (I would have commented, but do not yet have sufficient reputation.) | 0 | 0 | 0 | 0 | 2014-12-10T14:05:00.000 | 4 | 0 | false | 27,403,050 | 0 | 0 | 1 | 4 | I have a Django project and I did the following:
Added a table with some columns
Insert some records into the db
Added a new column that I didn't realize I needed
Made an update to populate that column
When I did a migrate everything worked just fine. The new db column was created on the table and the values were po... |
Django 1054 - Unknown Column in field list | 31,042,146 | 0 | 4 | 8,200 | 0 | python,mysql,django,database,data-migration | I believe this was because the migration scripts were getting called out of order, due to a problem I had setting them up. Everything is ok now. | 0 | 0 | 0 | 0 | 2014-12-10T14:05:00.000 | 4 | 1.2 | true | 27,403,050 | 0 | 0 | 1 | 4 | I have a Django project and I did the following:
Added a table with some columns
Insert some records into the db
Added a new column that I didn't realize I needed
Made an update to populate that column
When I did a migrate everything worked just fine. The new db column was created on the table and the values were po... |
How to track django user details using zoho CRM | 27,498,436 | 0 | 0 | 812 | 0 | python,django,crm,zoho | All you need is export django auth but if extender user model is there then you can also take extended user model too...
Please update your question what Database you are using ? | 0 | 0 | 0 | 0 | 2014-12-11T06:46:00.000 | 2 | 0 | false | 27,416,913 | 0 | 0 | 1 | 1 | How to track django user details using zoho CRM?
I am new zoho CRM, I got the few information and details how ZOHO CRm will be.
Now I want to know one thing, I had implement the django project and also have a account in zoho CRM. Now I would like to Tacke all my user details from app database in zoho crm.
how to ... |
Django-allauth login on fb canvas | 27,430,041 | 0 | 0 | 123 | 0 | python,django,angularjs,facebook | The answer is yes.
Just simply setup your fb canvas url to this:
https://yourdomain.com/your-allauth-url/facebook/login/?process=login
With this, your canvas app visitor will go through the allauth facebook login process. If the user has connected to your app it will redirect him/her to the login redirect url you have ... | 0 | 0 | 0 | 0 | 2014-12-11T17:20:00.000 | 2 | 0 | false | 27,428,711 | 0 | 0 | 1 | 1 | I've been trying to connect user on my fb canvas app.
I've implemented django-allauth fb login on my website. In fb canvas app, I'm trying to get user as already logged in since user has already been connected on fb.
Is there any way to make it using django-allauth? |
How does django know which migrations have been run? | 27,430,841 | 4 | 40 | 13,694 | 0 | python,django,database-migration,django-migrations | If it is django1.7, it stores history to database, table django_migrations.
South also stores migrations in database, and you can enable feature to show migration history in django admin. | 0 | 0 | 0 | 0 | 2014-12-11T19:18:00.000 | 5 | 0.158649 | false | 27,430,688 | 0 | 0 | 1 | 2 | How does django know whether a migration has been applied yet? It usually gets it right, but when it doesn't I don't ever know where to start troubleshooting. |
How does django know which migrations have been run? | 27,430,820 | 44 | 40 | 13,694 | 0 | python,django,database-migration,django-migrations | Django writes a record into the table django_migrations consisting of some information like the app the migration belongs to, the name of the migration, and the date it was applied. | 0 | 0 | 0 | 0 | 2014-12-11T19:18:00.000 | 5 | 1.2 | true | 27,430,688 | 0 | 0 | 1 | 2 | How does django know whether a migration has been applied yet? It usually gets it right, but when it doesn't I don't ever know where to start troubleshooting. |
Python bottle requests and unicode | 61,842,769 | 0 | 8 | 3,378 | 0 | python,unicode,bottle | in this case, to convert it ,I did like this search_field.encode("ISO-8859-1").decode("utf-8") | 0 | 0 | 1 | 0 | 2014-12-11T20:56:00.000 | 2 | 0 | false | 27,432,211 | 0 | 0 | 1 | 1 | I'm building a small RESTful API with bottle in python and am currently experiencing an issue with character encodings when working with the request object.
Hitting up http://server.com/api?q=äöü and looking at request.query['q'] on the server gets me "äöü", which is obviously not what I'm looking for.
Same goes for... |
Running Out of Threads: UWSGI + Multithreaded Python Application with GeventHTTPClient | 27,436,888 | 1 | 1 | 777 | 0 | python,multithreading,uwsgi,gevent | Mixing non-blocking programming (geventhttpclient) with blocking one (a uWSGI thread/process) is completely wrong. This is a general rule: even if your app is 99% non blocking it is still blocking. This is amplified by the fact that gevent makes use of stack switching to simulate blocking programming paradigms.
This i... | 0 | 1 | 0 | 0 | 2014-12-11T21:52:00.000 | 1 | 1.2 | true | 27,433,087 | 0 | 0 | 1 | 1 | I'm currently running a python web API that is NOT multithreaded with much success on the uWSGI + NGINX stack. Due to new operational needs, I have implemented a new build that includes multithreaded requests to external data sources. However, when I deploy this new multithreaded build under uWSGI with --enable-threads... |
Manage.py runserver for demonstration | 27,433,470 | 0 | 0 | 71 | 0 | python,django | python3 manage.py runserver <your IP address>:8000 | 0 | 0 | 0 | 0 | 2014-12-11T22:14:00.000 | 2 | 1.2 | true | 27,433,412 | 0 | 0 | 1 | 1 | How would I run a Django application on, a digitalocean droplet let's say, with just using the development server Django provides. I've tried just running python3 manage.py runserver, but I can't pull it up with the browser from another computer
I know this is bad practice, but I really only need it up to demonstrate f... |
django social auth get wrong access_token from google oauth2 | 27,487,490 | 0 | 0 | 123 | 0 | python,django,google-oauth | all right.
it turns out to be a problem of scope .
the sample code set a default scope to mail.google.com while social-auth only have a default scope to read user information.
the difference in length of token must be related to the scope | 0 | 0 | 0 | 0 | 2014-12-12T01:15:00.000 | 1 | 0 | false | 27,435,367 | 0 | 0 | 1 | 1 | I am integrating google oauth2 to my website using django social auth.
The problem is that with django social auth , I get an access_token like
ya29.2QCqpS-uKGXMNOP8yZnN6Z-F5LfVnyd7jwa8TaLP43nTEp2NUPB_p7Hi
While with the code sample from google code
the access token is like :
ya29.2QCVXKc7XSNR3QxqRVAi0Z8Uz6mvolDGp... |
How to change django version in PyCharm? | 27,440,698 | 13 | 11 | 13,451 | 0 | python,django,pycharm | Go to Settings->Project Interpreter.
Double-click the Django package. Activate the check box Specify version and select the version you want.
Press the button Install Package.
Django will use pip in the background to install the package. | 0 | 0 | 0 | 0 | 2014-12-12T09:26:00.000 | 7 | 1 | false | 27,440,489 | 1 | 0 | 1 | 2 | I've installed new PyCharm that uses django v1.71(default), but I would like to change it to v1.68.
How can we achieve this with PyCharm? |
How to change django version in PyCharm? | 34,903,153 | 2 | 11 | 13,451 | 0 | python,django,pycharm | Go to file>>settings>>Project Interpreter and click the plus sign at the right edge of the popup window and look for django and install it. You need internet access though. It will install the new version. | 0 | 0 | 0 | 0 | 2014-12-12T09:26:00.000 | 7 | 0.057081 | false | 27,440,489 | 1 | 0 | 1 | 2 | I've installed new PyCharm that uses django v1.71(default), but I would like to change it to v1.68.
How can we achieve this with PyCharm? |
Jenkins : how to print the contents of a text file to the build log? | 27,465,483 | 9 | 5 | 15,107 | 0 | python,jenkins,jenkins-plugins | If your Jenkins is running on Linux, a simple "Execute Shell" build-step with cat filename.txt will print the file to console
If running Windows, an "Execute Windows batch command" build-step with type filename.txt will do the same.
The filename path is relative to WORKSPACE | 0 | 0 | 0 | 0 | 2014-12-12T22:34:00.000 | 1 | 1.2 | true | 27,453,156 | 0 | 0 | 1 | 1 | I have a non-deterministically working Jenkins build step that prints text. It's multi line and has lots of urls in it. It's a python build step.
print("""\
xxxx
yyy
")
It works many times, but not all the times - it messes up the next step when it fails.
I'm not sure how to debug, but maybe I should just add a step... |
Run Python script in background on remote server with Django view | 27,461,927 | 2 | 1 | 1,029 | 0 | python,django | I'd humbly reccomend the standard library module multiprocessing for this. As long as the background process can run on the same server as the one processing the requests, you'll be fine.
Although i consider this to be the simplest solution, this wouldn't scale well at all, since you'd be running extra processess on y... | 0 | 0 | 0 | 0 | 2014-12-13T13:29:00.000 | 3 | 0.132549 | false | 27,459,327 | 0 | 0 | 1 | 1 | What I want to achieve is to run python some script which will collect data and insert it to DB in a background.
So basically, a person opens Django view, clicks on a button and then closes the browser and Django launches this script on a server, the script then collects data in background while everything else goes on... |
Python/lxml: Retrieving variable data | 27,468,960 | 0 | 0 | 57 | 0 | jquery,python,xpath,lxml | What happens here is, upon selecting a value form the dropdown, an AJAX request is generated and gets the data.
You can analyze the request url in your browser. If you use firefox, use firebug and take a look at the Net tab, what requests are generating and what is the url. In google chorme, look in Network tab. If you... | 0 | 0 | 1 | 0 | 2014-12-14T11:07:00.000 | 1 | 1.2 | true | 27,468,688 | 0 | 0 | 1 | 1 | I want to parse some data from a website. However, there's a certain peculiarity:
There is a dropdown list (layed out using div and child a tags, made functional with a jQuery script). Upon selecting one of the values, a subsequent text field would change its value.
I want to retrieve the first dropdown value, and the ... |
Interact with python script running infinitive loop from web | 27,474,586 | 1 | 0 | 229 | 0 | python,http,web,raspberry-pi | You have to write somewhere your configuration for looping script. So file or database are possible choices but I would say that a formatted file (ini, yaml, …) is the way to go if you have a little number of parameters. | 0 | 0 | 1 | 1 | 2014-12-14T21:52:00.000 | 2 | 1.2 | true | 27,474,557 | 0 | 0 | 1 | 1 | I have a python script on my raspberry-pi continuously (every 5 seconds) running a loop to control the temperature of a pot with some electronics through GPIO.
I monitor temperature on a web page by having the python script write the temperature to a text file witch I request from java script and HTTP on a web page.
I... |
Sidebar Object on Sublime Plugin | 27,475,157 | 0 | 0 | 70 | 0 | python,sublimetext,sublimetext3,sublime-text-plugin | There is no sidebar API in Sublime currently, so unfortunately what you are trying to do isn't possible at present. | 0 | 0 | 0 | 0 | 2014-12-14T21:53:00.000 | 1 | 1.2 | true | 27,474,576 | 0 | 0 | 1 | 1 | I want to build a plugin in order to affect the sidebar. Mainly visual stuff at first.
But I can't find any documentation about it.
Is it possible, as we can obtain view() and window() in the plugin, to have something like sidebar(), and be able to treat all the nodes on the Folders sections (for individual files) and ... |
Ejabberd server not getting started? | 27,539,662 | 0 | 0 | 75 | 0 | python-2.7,ubuntu-14.04,openfire,ejabberd | Solved the issue problem wan with my settings,and then restarted the server
using sudo service ejabbers restart.It worked | 0 | 1 | 0 | 0 | 2014-12-15T13:33:00.000 | 1 | 1.2 | true | 27,485,296 | 0 | 0 | 1 | 1 | I have re-installed ejabberd server in my localhost.When i run sudo service ejabberd restart its no getting restarted.Instead its craeting error.The following error is shown in erl_crash.dump.All my configurations in conf file is correct.
Kernel pid terminated (application_controller) ({application_start_failure,kernel... |
Runtime error alongside Django on Amazon AWS EC2 Linux AMI issue | 27,500,649 | 1 | 0 | 274 | 0 | python,linux,django,amazon-web-services,amazon-ec2 | Just install blinker by typing pip install blinker in the console.
Be sure you install it in your virtualenv if by any chance you use one, just by activating it before executing the pip command.
You may also review your staging procedure to correctly install project dependencies. | 0 | 0 | 0 | 0 | 2014-12-16T03:27:00.000 | 1 | 1.2 | true | 27,497,044 | 0 | 0 | 1 | 1 | I am getting this error: signalling support is unavailable because the blinker library is not installed.
I am running Django 1.6.5 under python 2.6.9.
Is it possible that the error will go away if i update python on the server to 2.7.x?
If so how can I update the server without losing everything I have done upto this ... |
Is it possible to ensure audio isn't modified when playing back under Windows | 27,499,520 | 2 | 1 | 39 | 0 | python,windows,audio | Sound cards are for playing audio, not sending data. You can't rely on an arbitrary signal not being altered by the hardware, much less the software. For example, many sound cards have a capacitor in series with the output to filter out DC bias. If you try to pass a DC-biased (or very low frequency) signal through s... | 0 | 0 | 0 | 0 | 2014-12-16T07:05:00.000 | 1 | 0.379949 | false | 27,499,268 | 0 | 0 | 1 | 1 | We have a python program which outputs specific waveforms over the audio to drive an LED, for an easy and cheap robot programming device.
With the windows systems that we've tested everything works fine, but on some systems the waveform seems to be altered. We've used the control panel to disable any 'enhancements' fo... |
scrapy debug Request object | 27,499,859 | 3 | 4 | 764 | 0 | python,post,scrapy | Use some traffic monitoring software , i personally use fiddler. it will help you to check the requests sent from python as well as from browsers | 0 | 0 | 1 | 0 | 2014-12-16T07:24:00.000 | 2 | 0.291313 | false | 27,499,546 | 0 | 0 | 1 | 2 | How to debug a scrapy Request object?
requestobj= FormRequest.from_response(response, formxpath =form_xpath,callback=self.parse1)
I need to check formdata of requestobj .But I didn't find any documentation for debugging Request object |
scrapy debug Request object | 27,615,272 | 1 | 4 | 764 | 0 | python,post,scrapy | try sending request to:
http://httpbin.org/
or
http://echo.opera.com/
you will get a response with information your request | 0 | 0 | 1 | 0 | 2014-12-16T07:24:00.000 | 2 | 0.099668 | false | 27,499,546 | 0 | 0 | 1 | 2 | How to debug a scrapy Request object?
requestobj= FormRequest.from_response(response, formxpath =form_xpath,callback=self.parse1)
I need to check formdata of requestobj .But I didn't find any documentation for debugging Request object |
Keeping custom module synced in OpenERP7 | 27,548,485 | 0 | 4 | 46 | 0 | python,openerp,pycharm,openerp-7 | Any change made directly in the OpenERP/Odoo GUI is not written back to the module and will overwritten in the next module upgrade.
Use those direct changes only for experimenting or fast prototyping.
Changes you mean to be final should always be made in your module files. | 0 | 0 | 0 | 0 | 2014-12-16T16:16:00.000 | 1 | 0 | false | 27,509,088 | 0 | 0 | 1 | 1 | SO i'm using Open ERP 7 and wanted to make a custom module. I've put everything into PyCharm to edit parts there, but sometimes I edit some forms or add some fields with in OpenERP itself under the Database structure.
Any changes I make under the Database Structure (e.g adding a field) won't show up in my PyCharm. Is t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.