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
Print html tags in Django
19,448,846
1
0
2,731
0
python,django,django-templates
That happens by default, because of Django's autoescaping. You have to specifically mark content as safe before it will be interpreted as HTML.
0
0
0
0
2013-10-18T10:29:00.000
4
0.049958
false
19,447,427
0
0
1
3
Is it possible in django to print a string keeping the html tags? So if I write {{ variable }} the html content inside the variable doesn't get interpreted by the browser as html. (Really a newbie) Thanks
Print html tags in Django
19,447,655
2
0
2,731
0
python,django,django-templates
You can use the escape filter {{variable|escape}} Same as php's htmlentities or htmlspecialchars
0
0
0
0
2013-10-18T10:29:00.000
4
0.099668
false
19,447,427
0
0
1
3
Is it possible in django to print a string keeping the html tags? So if I write {{ variable }} the html content inside the variable doesn't get interpreted by the browser as html. (Really a newbie) Thanks
Print html tags in Django
61,307,178
0
0
2,731
0
python,django,django-templates
You can use the safe filter {{variable|safe}}
0
0
0
0
2013-10-18T10:29:00.000
4
0
false
19,447,427
0
0
1
3
Is it possible in django to print a string keeping the html tags? So if I write {{ variable }} the html content inside the variable doesn't get interpreted by the browser as html. (Really a newbie) Thanks
Hierarchy in Google App Engine NDB
19,454,685
5
3
1,057
0
python,google-app-engine
If you use the ancestor in the key you will create a big entity group (assuming a single root to the tree/hierarchy) which may in fact not be what you want from a write performance point of view. Also a deep hierarchy can mean very big keys. If you want to move nodes around using ancestor keys, you have to delete an...
0
1
0
0
2013-10-18T14:28:00.000
2
1.2
true
19,452,172
0
0
1
1
I'm trying to store a hierarchy in NDB and I'm confused about if I should use just the 'parent' parameter while constructing the keys to new entities or should I include an extra property in my models to hold the parent key?
Django, project structure
19,463,759
1
4
2,336
0
python,django,structure
If the module is independent from Django, then it should be a standalone Python package, complete with a setup.py to install it. The Django models and webservices that use it can import like any other external dependencies. If the module depends on you Django app, then it should be inside the app's directory. If it doe...
0
0
0
0
2013-10-19T07:42:00.000
2
1.2
true
19,463,702
0
0
1
1
I'm currently working on a django project. I'm not completly new in django, but have some difficulties figuring out how would be the most 'djangonic' way to organize some files. I have some classe that compute stuff, and can be used from the manage.py's cli, and by a webservice app. Those computation uses models from m...
Issue creating project with mezzanine - shared hosting
21,524,630
0
0
265
0
python,shared-hosting,mezzanine
Now supporting with Mezzanine 3.x
0
1
0
0
2013-10-19T10:44:00.000
2
0
false
19,465,158
0
0
1
1
I'm trying to use Mezzanine cms in a shared hosting at 1and1. I installed a recent python version 3.3.2. setup works well but when i try to create a project I got the following error message: ~/Mezzanine-1.4.16 > mezzanine-project blog Traceback (most recent call last): File "/kunden/homepages/x/dxxxxxxx/htdocs/custo...
RedirectRoute in Google App Engine and url arguments
19,500,983
1
1
156
0
python,google-app-engine,webapp2
A RedirectRoute will issue a HTTP redirect telling the browser to go to the new URL, then the browser will make a new request at that URL. How this is implemented is that two routes are created - your original route, and one for redirecting. So, in your case, a route with /do/some/<action:.*>/ would be created that red...
0
1
0
0
2013-10-21T15:48:00.000
1
0.197375
false
19,499,079
0
0
1
1
I have a RESTful API like /do/some/<action:.*> so my app with get <action> and run it. My question is, if I use RedirectRoute and strict_slash=True, will my app keep getting <action> as argument or will it start getting <action>/ (notice the / at the end)? EDIT: I'm using webapp2
Django FileField appending temporary path name to media_root path on save
19,501,434
0
0
343
0
python,django
The problem lies in the to_upload method, I was getting filename and using it as it came. The fix was to do: filename = os.path.basename(filename) and use that
0
0
0
0
2013-10-21T17:23:00.000
1
0
false
19,500,897
0
0
1
1
I have this custom ModelAdmin that unzips the uploaded file to /tmp and the sets the unzipped file to a FileField in a model doing mymodel.myfilefield = File(open(path_to_file)) The thing is that after doing that the new file is copied to <MEDIA_ROOT>/<upload_to>/tmp/<filename> And that's not desired. Why is appending ...
How to avoid hitting App Engines free limits with tons of writes?
19,508,340
0
0
49
0
python,google-app-engine
Pack more data into an entity, and arrange to not index any fields you're never going to query on. That may interfere with querying your logs, but if writes predominate, pack more into each write, saving writes and index updates. You'll pay for it later when querying, but if queries are infrequent, it may be a net win.
0
1
0
0
2013-10-22T02:12:00.000
1
1.2
true
19,507,887
0
0
1
1
I'm trying to handle remote logging with app engine, but I find just by myself I'm exceeding the daily write limit. Are there any datastore tricks I can use to consume less of my write quota while posting data to the server constantly?
Parse HTML Infinite Scroll
19,512,436
1
1
1,165
0
python,infinite-scroll
Those pages update their html with AJAX. Usually you just need to find the new AJAX requests send by browser, guess the meaning of the AJAX url parameters and fetch the data from the API. API servers may validate the user agent, referer, cookie, oauth_token ... of the AJAX request, keep an eye on them.
0
0
1
0
2013-10-22T08:01:00.000
2
1.2
true
19,512,250
0
0
1
1
I'm trying to parse the HTML of a page with infinite scrolling. I want to load all of the content so that I can parse it all. I'm using Python. Any hints?
Does print statement will make performance issue for a website
19,527,376
2
0
1,976
0
python,django,web
Yes, since the arguments will need to be converted to strings before outputting and that can be a costly operation. However, using print causes another issue. Some WSGI containers, notably mod_wsgi among them, do not like anything sent to stdout by default and so will raise an exception whenever that happens. You can f...
0
0
0
0
2013-10-22T19:54:00.000
2
1.2
true
19,527,097
1
0
1
1
We are using the python/Django for web development. While development phase wile coding i tends to put print statement a lot places to check the control flow of the code. And same code with print statement is uploaded for server, I know logging is a place to be more suitable but i find myself more comfortable with prin...
Passing flash messages in flask framework
19,535,937
2
0
4,516
0
python,flask
Redirect with parameter: you set parameter for page1 link/form on page2 and if parameter set for page1 then show message. Good solution. Redirect with special route: you have special route for page1 redirection from page2. It's similar to parameter. Redirect with referer: you check http referer header to page2 for page...
0
0
0
0
2013-10-23T05:47:00.000
2
1.2
true
19,533,736
0
0
1
1
I have a use case where, when page2 redirects user to page1, page 1 is supposed to show a flash message (e..g Your order was successfully placed). When a user visits page1 directly without being redirected from page2, I don't show any flash messages. What is the best way to send flash_message from page2 to page1 while ...
Using Scrapy with OS X 10.9
20,172,902
2
2
1,390
0
python,macos,scrapy
Some questions from osx 10.9. try xcode-select --install
0
0
1
0
2013-10-23T15:22:00.000
1
0.379949
false
19,545,847
0
0
1
1
I recently updated from OS X 10.8 to OS X 10.9. It looks like the upgrade removed the previous version of Python and all the libraries that were installed. I am trying to re-install Scrapy on OS X 10.9 but I keep getting an error using both pip and easy_install. Here is the error message I am encountering. /private/tm...
Is Django's "Model" API thread-safe?
19,551,006
3
1
1,406
0
python,django,multithreading,thread-safety
As far as we speak about save versus get and query, you are safe, since distinct querysets objects are involved. In fact, every query, filter, get call and so on creates a new queryset instance, and do not modify any previously existed object. But obviously, you can run into issues when accessing/modifying same db reco...
0
0
0
0
2013-10-23T18:31:00.000
1
1.2
true
19,549,655
0
0
1
1
Specifically, I'm only talking about modifying separate instances of a Model (not sharing the same exact instance) across threads. But is it safe to be calling save() from one thread, while multiple other threads are invoking Model.objects.query() or Model.objects.get() for example?
How to serialize and deserialize Django ORM query (not queryset)?
19,561,000
2
2
1,324
0
python,sql,django,serialization
According to your answer, User passes some content-specific parameters into a form, then view function, that recieves POST, constructs query one option is to store parameters (pickle'd or json'ed, or in a model) and reconstruct query with regular django means. This is somewhat more robust solution, since it can hand...
0
0
0
0
2013-10-24T08:30:00.000
3
0.132549
false
19,560,838
0
0
1
2
My use case is that I need to store queries in DB and retrieve them from time to time and evaluate. Thats needed for mailing-app where every user can subscribe to a web-site content selected by individually customized query. Most basic solution is to store raw SQL and use it with RawQuerySet. But I wonder is there bett...
How to serialize and deserialize Django ORM query (not queryset)?
19,561,051
1
2
1,324
0
python,sql,django,serialization
You could create a new model user_option and store the selections in this table. From your question, it's hard to determine whether it is a better solution, but it would make your user's choices more explicit in your data structure.
0
0
0
0
2013-10-24T08:30:00.000
3
0.066568
false
19,560,838
0
0
1
2
My use case is that I need to store queries in DB and retrieve them from time to time and evaluate. Thats needed for mailing-app where every user can subscribe to a web-site content selected by individually customized query. Most basic solution is to store raw SQL and use it with RawQuerySet. But I wonder is there bett...
What is the difference between using HttpUwsgiModule for NGINX and using NGINX as a reverseproxy to uWSGI?
19,688,569
2
1
125
0
python,nginx,webserver,reverse-proxy,uwsgi
Simply put, when you use HttpUwsgiModule NGINX speaks the uwsgi protocol and it can leave out useless informations of the http protocol leading to less overhead and thus better performance.
0
1
0
1
2013-10-24T15:42:00.000
1
1.2
true
19,570,490
0
0
1
1
Using HttpUwsgiModule with NGINX to control uWSGI has become quite popular since its release. I was wondering though, what is the advantage of it, compared to using NGINX as a reverse-proxy to uWSGI application? What are the gains and losses in two differing use cases?
Host Parameter While Creating a User in Rackspace Cloud Database Instance
19,761,340
0
1
70
1
python,mysql,database,cloud,rackspace-cloud
I released version 1.6.1 of pyrax a few days ago that adds support for the 'host' parameter for users, as well as for Cloud Database backups.
0
0
0
0
2013-10-25T09:17:00.000
2
1.2
true
19,585,830
0
0
1
1
Rackspace has added the feature to select certain cloud servers (as hosts) while creating a user in a cloud database instance. This allows the specified user to be accessed, only from those cloud servers. So I would like to know whether there is an API available in pyrax(python SDK for Rackspace APIs) to accomplish thi...
Generating a date relative to another date in Django template
19,624,727
0
3
3,339
0
python,django,django-templates
This cannot be done in Django templates as of this writing without writing a custom template tag in Python.
0
0
0
0
2013-10-25T19:44:00.000
2
1.2
true
19,598,213
0
0
1
1
I have a date in my template context, and I want to display that date plus 7 days in the rendered output. Something like this (which does not exist): {{some_date|plus_days:7}} How can I do this in a Django template without writing any Python code?
Android Client and Google App Engine APIs
19,613,781
1
0
127
0
java,android,python,google-app-engine
Yes, you can use Python to do what you want. Google designs their services (such as GAE and endpoints) to be language agnostic, e.g. using JSON to serialize objects. There are a few advantages to using Java on both, such as being able to share code between client and service projects, but Google does not promote such d...
0
1
0
0
2013-10-26T22:37:00.000
1
1.2
true
19,612,642
0
0
1
1
Am I confused as to what is possible between an Android Client and Google App Engine? I would like to be able to create a Python API that would handle requests between GAE services such as Datastore, and an Android Client. I have found some examples that detail how to make a call from within an Android Client, but it d...
Testing Django application cookies , sessions and states
19,616,880
2
1
1,147
0
python,django,session,testing,cookies
The two statements do not contradict one another. You can use self.client more than once during one test. You can log in, and the cookie handling in the test client will 'remember' your session, for subsequent requests. Only when the test is done, is that state cleared. You do not need to log out, because that's a clie...
0
0
0
0
2013-10-27T10:02:00.000
1
1.2
true
19,616,817
0
0
1
1
While reading the documentation I've come across two contradicts paragraphes that I couldn't really understand First one says: The test client is stateful. If a response returns a cookie, then that cookie will be stored >in the test client and sent with all subsequent get() and post() requests. Expiration policies fo...
Crawl and monitor +1000 websites
19,618,864
0
2
3,232
0
python,scrapy
I will be interested to see what other answers come up for this. I have done some web crawling / scrapping with code that I have written myself using urllib to get the html then just searching the html for what I need, but not tried scrapy yet. I guess to see if there are differences you may just need to compare the p...
0
0
1
0
2013-10-27T13:44:00.000
2
0
false
19,618,735
0
0
1
1
I need help defining an architecture for a tool that will scrape more than 1000 big websites daily for new updates. I'm planning to use Scrapy for this project: Giving that Scrapy needs a project for each website, how can I handle scraping 1000+ websites and storing it's data with Scrapy in just one project? I tried a...
Django admin: live update of change list page
19,624,592
0
0
665
0
python,ajax,django,django-admin
For an easy implantation you could set up a button to only refresh the changelist through an ajax call instead of the whole page (though setting it up with a view would be easier than changing the built in admin site without breaking anything). You can also set that function to refresh on a given interval. Another opti...
0
0
0
0
2013-10-27T22:38:00.000
1
1.2
true
19,624,484
0
0
1
1
I use the Django admin "change list" page to monitor the state of objects created and updated by my site's users. I find myself frequently refreshing the page as my users do their work. Is there a good way to make it automatically refresh, so that I can see new changes within a few seconds? Looking for a technique that...
Issue with path to python/pythonpath
19,962,347
0
1
137
0
python,apache,unix,path,fastcgi
I had a call to python interpreter via env program in my fast cgi dispatch script. When I explicitly put path to 2.7 to the first line of the script it works as expected.
0
1
0
1
2013-10-28T05:30:00.000
3
1.2
true
19,627,743
0
0
1
2
I have a VPS with system-wide installed python 2.5. I installed python 2.7 to one of the user's home dir (using --prefix). added it to bashrc and bash_profile, exported python variable to env, and now when I type python in console python 2.7 is running. But when I checked python version from my application (Django usi...
Issue with path to python/pythonpath
27,295,744
0
1
137
0
python,apache,unix,path,fastcgi
I've set PYTHONPATH in my /home/me/.bashrc and all worked ok from terminal, but when Apache w/ mod_wsgi starts my python scripts, it acts under sysem or dedicated user, which knows nothing of my .bashrc. For this particular situation, I just used apache config (apache2.conf) to set python path for apache (WSGIPythonPat...
0
1
0
1
2013-10-28T05:30:00.000
3
0
false
19,627,743
0
0
1
2
I have a VPS with system-wide installed python 2.5. I installed python 2.7 to one of the user's home dir (using --prefix). added it to bashrc and bash_profile, exported python variable to env, and now when I type python in console python 2.7 is running. But when I checked python version from my application (Django usi...
Shopify Recurring Application Charge related issue
19,648,899
1
0
482
0
python,shopify
I created a test recurring charge, it worked fine but I was not able to locate where to accept the charge in my test Shopify shop using admin. When you created your charge, you had to provide a callback so that Shopify could send the charge for you to accept. I would look there for it.
0
0
0
0
2013-10-29T02:03:00.000
1
0.197375
false
19,648,377
0
0
1
1
While testing Shopify recurring application charge today I got stuck in following issues, can anyone please look into this.... I created a test recurring charge, it worked fine but I was not able to locate where to accept the charge in my test Shopify shop using admin. I can see or query the newly created test recurri...
Suspend on exceptions caused inside Django app in PyCharm
19,657,857
0
1
277
0
python,django,debugging,exception,pycharm
This should happen automatically in PyCharm. What you need to do is set no breakpoints, but run as debug (click on the green bug icon). When the exception occurs, execution should automatically halt.
0
0
0
0
2013-10-29T11:46:00.000
1
0
false
19,657,370
1
0
1
1
I debug django application and want to suspend code execution at the point where exception occurs with cursor pointing to problematic place in code. Pretty HTML display by django would be helpful either but not mandatory. My IDE is PyCharm. If I set pycharm to suspend on termination of exception, then I never catch it,...
SELECT using psql returns no rows even though data is there
19,665,116
1
1
82
1
python,django,postgresql
I guess you forgot to enter semicolon: SELECT * FROM myapp_stories;
0
0
0
0
2013-10-29T17:05:00.000
2
0.099668
false
19,664,732
0
0
1
2
I'm using Django + Postgres. When I do a SQL query using psql, e.g. \d+ myapp_stories correctly shows the columns in the table But when I do SELECT * FROM myapp_stories, it returns nothing. But querying the same database & table from my python code returns data just fine. So there is data in the table. Any thoughts? I...
SELECT using psql returns no rows even though data is there
19,666,882
1
1
82
1
python,django,postgresql
Prefix the table in your query with the schema, as the search_path might be causing your query (or psql) to look in a schema other than what you are expecting.
0
0
0
0
2013-10-29T17:05:00.000
2
0.099668
false
19,664,732
0
0
1
2
I'm using Django + Postgres. When I do a SQL query using psql, e.g. \d+ myapp_stories correctly shows the columns in the table But when I do SELECT * FROM myapp_stories, it returns nothing. But querying the same database & table from my python code returns data just fine. So there is data in the table. Any thoughts? I...
pyramid static view and file upload
19,686,469
0
1
198
0
python,file-upload,pyramid
This sounds like your browser is caching the images. Try setting the cache_max_age=0 on your add_static_view, or viewing the page in your browser's incognito mode where it'll use a different cache.
0
0
0
0
2013-10-29T20:05:00.000
1
1.2
true
19,668,027
0
0
1
1
I created new directory via 'myimages' under static directory. And whenever user upload files, file get stores in that directory. Once file uploaded I can access that on html using '/static/myimages/imagename.png'. It works fine whenever I am uploading new image. But whenver I try to override image. It shows me old ima...
Difference between BeautifulSoup and Scrapy crawler?
66,479,925
1
150
84,428
0
python,beautifulsoup,scrapy,web-crawler
Beautifulsoup is web scraping small library. it does your job but sometime it does not satisfy your needs.i mean if you scrape websites in large amount of data so here in this case beautifulsoup fails. In this case you should use Scrapy which is a complete scraping framework which will do you job. Also scrapy has...
0
0
1
0
2013-10-30T15:43:00.000
9
0.022219
false
19,687,421
0
0
1
6
I want to make a website that shows the comparison between amazon and e-bay product price. Which of these will work better and why? I am somewhat familiar with BeautifulSoup but not so much with Scrapy crawler.
Difference between BeautifulSoup and Scrapy crawler?
54,838,886
0
150
84,428
0
python,beautifulsoup,scrapy,web-crawler
The differences are many and selection of any tool/technology depends on individual needs. Few major differences are: BeautifulSoup is comparatively is easy to learn than Scrapy. The extensions, support, community is larger for Scrapy than for BeautifulSoup. Scrapy should be considered as a Spider while BeautifulSoup...
0
0
1
0
2013-10-30T15:43:00.000
9
0
false
19,687,421
0
0
1
6
I want to make a website that shows the comparison between amazon and e-bay product price. Which of these will work better and why? I am somewhat familiar with BeautifulSoup but not so much with Scrapy crawler.
Difference between BeautifulSoup and Scrapy crawler?
49,187,707
1
150
84,428
0
python,beautifulsoup,scrapy,web-crawler
Using scrapy you can save tons of code and start with structured programming, If you dont like any of the scapy's pre-written methods then BeautifulSoup can be used in the place of scrapy method. Big project takes both advantages.
0
0
1
0
2013-10-30T15:43:00.000
9
0.022219
false
19,687,421
0
0
1
6
I want to make a website that shows the comparison between amazon and e-bay product price. Which of these will work better and why? I am somewhat familiar with BeautifulSoup but not so much with Scrapy crawler.
Difference between BeautifulSoup and Scrapy crawler?
46,601,960
3
150
84,428
0
python,beautifulsoup,scrapy,web-crawler
Both are using to parse data. Scrapy: Scrapy is a fast high-level web crawling and web scraping framework, used to crawl websites and extract structured data from their pages. But it has some limitations when data comes from java script or loading dynamicaly, we can over come it by using packages like splash, seleniu...
0
0
1
0
2013-10-30T15:43:00.000
9
0.066568
false
19,687,421
0
0
1
6
I want to make a website that shows the comparison between amazon and e-bay product price. Which of these will work better and why? I am somewhat familiar with BeautifulSoup but not so much with Scrapy crawler.
Difference between BeautifulSoup and Scrapy crawler?
19,687,572
21
150
84,428
0
python,beautifulsoup,scrapy,web-crawler
I think both are good... im doing a project right now that use both. First i scrap all the pages using scrapy and save that on a mongodb collection using their pipelines, also downloading the images that exists on the page. After that i use BeautifulSoup4 to make a pos-processing where i must change attributes values a...
0
0
1
0
2013-10-30T15:43:00.000
9
1
false
19,687,421
0
0
1
6
I want to make a website that shows the comparison between amazon and e-bay product price. Which of these will work better and why? I am somewhat familiar with BeautifulSoup but not so much with Scrapy crawler.
Difference between BeautifulSoup and Scrapy crawler?
24,040,613
2
150
84,428
0
python,beautifulsoup,scrapy,web-crawler
The way I do it is to use the eBay/Amazon API's rather than scrapy, and then parse the results using BeautifulSoup. The APIs gives you an official way of getting the same data that you would have got from scrapy crawler, with no need to worry about hiding your identity, mess about with proxies,etc.
0
0
1
0
2013-10-30T15:43:00.000
9
0.044415
false
19,687,421
0
0
1
6
I want to make a website that shows the comparison between amazon and e-bay product price. Which of these will work better and why? I am somewhat familiar with BeautifulSoup but not so much with Scrapy crawler.
Using GPIO in webpage
19,702,189
2
0
467
0
python,django,raspberry-pi
You don't have to run the webbrowser as root but your django app (the webserver). Of course running a web application as root is an incredibly bad idea (even on a pi), so you might want to use a separate worker process (e.g. using celery) that runs as root and accesses the GPIOs.
0
1
0
0
2013-10-31T08:59:00.000
1
1.2
true
19,702,170
0
0
1
1
I am using Django 1.5.4 to design a web page in which i want to use GPIO, but i got following error: "Noᅠaccessᅠtoᅠ/dev/mem. Tryᅠrunningᅠasᅠroot! " in browser. Since web browser itself is an application, how can i assign "root" privileges to it when it tried to render a web page ? If it can be done without any need to ...
how to run python code on amazon ec2 webservice?
19,714,085
0
0
718
0
python,amazon-web-services,amazon-s3,amazon-ec2,cluster-computing
You do not need to use S3, you would likely want to use EBS for storing the code if you need it to be preserved between instance launches. When you launch an instance you have the option to add an ebs storage volume to the drive. That drive will automatically be mounted to the instance and you can access it just like y...
0
1
0
0
2013-10-31T17:35:00.000
1
0
false
19,713,141
0
0
1
1
I have never used amazon web services so I apologize for the naive question. I am looking to run my code on a cluster as the quad-core architecture on my local machine doesn't seem to be doing the job. The documentation seems overwhelming and I don't even know which AWS services are going to be used for running my scri...
Stress test on Django makes it slow while there are free system resources
19,714,529
1
0
389
0
python,mysql,django,apache
Probably caching is your answer. I don't know how Django runs on Apache as I run a Gunicorn setup but it makes round trips for every database call. If you institute some memcache to handle common result sets you should see a large improvement so you don't have to make trips for each request. Also, 50 concurrent conne...
0
0
0
0
2013-10-31T18:53:00.000
2
0.099668
false
19,714,463
0
0
1
2
Today I was doing a stress test to a new Django (1.5.4) running on an Ubuntu Server 12.04 site before going into production and I've found some unexpected results: Doing 50 requests per second, htop showed a CPU usage of ~50% and RAM also ~50%. I'm not currently using Django cache and doing a normal browser request whi...
Stress test on Django makes it slow while there are free system resources
19,719,423
0
0
389
0
python,mysql,django,apache
How many workers of django you are running? Maybe server can't load to 100% because you are running small amount of workers, but there are many database connections, so most of the time workers are waiting database, and blocking new connections.
0
0
0
0
2013-10-31T18:53:00.000
2
1.2
true
19,714,463
0
0
1
2
Today I was doing a stress test to a new Django (1.5.4) running on an Ubuntu Server 12.04 site before going into production and I've found some unexpected results: Doing 50 requests per second, htop showed a CPU usage of ~50% and RAM also ~50%. I'm not currently using Django cache and doing a normal browser request whi...
Flask logs everyone out when ever I make changes to the code
19,728,271
2
1
130
0
python,nginx,flask,uwsgi
Sessions are signed against the app.secret_key so perhaps you're automatically generating a new secret key each time you launch your app?
0
0
0
0
2013-10-31T23:57:00.000
2
1.2
true
19,718,673
0
0
1
1
I am using Flask and Nginx on my production server and Flask seems to log everyone out whenever I make a change to the code. I realize the reason for this, but I was wondering if there is any way to prevent this. I am using a proxy with Nginx if that makes any difference, I could easily switch back to uwsgi if that wil...
Are django signals always synchronous?
19,731,987
8
4
3,964
0
python,django,queue,signals
Not sure synchronicity is your real concern here. Django's signals are always executed in-process: that is, they will be executed by the process that did the rest of that request, before returning a response. However, if your server itself is asynchronous, there's a possibility that one request will finish processing a...
0
0
0
0
2013-11-01T16:48:00.000
1
1.2
true
19,731,349
0
0
1
1
I'm developing a django IPN plugin that saves IPN data to a model and then calls a post_save signal. I'm worried that under this use case (gunicorn, gevent, etc) that the signals may be called/completed asynchronously. The IPN often sends more than 1 request to the ipn url, and I need to be able to process those requ...
How to get the list of users currently logged in to a server for any web service?
21,433,269
0
0
1,048
0
web-services,apache,python-2.7,postgresql-9.2
Note that you cannot get a list of "all users logged into a web application". You can get a list of "all users who have recently authenticated", or possibly "all users with a valid authentication token", but due to the stateless nature of web connections, the concept of "currently logged in" is a tricky one (if I clos...
0
0
0
0
2013-11-01T16:52:00.000
1
0
false
19,731,409
0
0
1
1
I am planning to install bugzilla/trac, mediawiki and some other web services on a server via apache. I would like to know if there is a way to track which all users(username of the specific web service from different client machines ie) are logged into the server. I am thinking of creating a database, and doing some l...
How can I automate google docs with Google App Engine?
19,746,281
0
0
559
0
python,google-app-engine,google-docs-api
There is currently no API to create google docs directly except for: 1) make a google apps script service, which does have access to the docs api. 2) create a ".doc" then upload and convert to gdoc. 1 is best but a gas service has some limitations like quotas. If you are only creating dozens/hundreds per day you will b...
0
1
0
0
2013-11-02T18:16:00.000
1
1.2
true
19,745,169
0
0
1
1
Listmates: I am designing a google app engine (python) app to automate law office documents. I plan on using GAE, google docs, and google drive to create and store the finished documents. My plan is to have case information (client name, case number, etc.) entered and retrieved using GAE web forms and the google data...
GAE SDK for Python 2.5
19,748,534
1
2
272
0
google-app-engine,sdk,python-2.5
In the 1.8.6 SDK, there's an old_dev_appserver.py that works with Python 2.5. That'll help you along as you migrate.
0
1
0
0
2013-11-02T22:26:00.000
2
1.2
true
19,747,596
0
0
1
2
I have an existing app that uses the deprecated Python 2.5 and the deprecated master/slave datastore. According to the docs, I must migrate the datastore to HRD before I can upgrade to Python 2.7. Before I can migrate my M/S datastore to HRD, I need to do some work on the app and test it using the dev server. However,...
GAE SDK for Python 2.5
20,110,862
0
2
272
0
google-app-engine,sdk,python-2.5
Dave W. Smith gave me the answer but I didn't know how to implement it until I made a discovery that maybe most people already know, But in case it might be helpful to somebody, I will tell it here: I do all my GAE/Python/Flex development work in Eclispe, except that I used the launcher for local testing and deploying...
0
1
0
0
2013-11-02T22:26:00.000
2
0
false
19,747,596
0
0
1
2
I have an existing app that uses the deprecated Python 2.5 and the deprecated master/slave datastore. According to the docs, I must migrate the datastore to HRD before I can upgrade to Python 2.7. Before I can migrate my M/S datastore to HRD, I need to do some work on the app and test it using the dev server. However,...
Is a single Python executable file shared by all clients when run on a server?
19,750,550
1
0
269
0
python,django,heroku,tornado
Each client will have their own running version. Definitely. If you want to have some sort of global variables, you should use some inter-process communication tools (message passing, synchronization, shared memory, or rpc). Redis, for example.
0
0
0
0
2013-11-03T06:35:00.000
3
0.066568
false
19,750,453
1
0
1
2
I've been working with a Tornado project on my local machine by running server.py. When deployed to the server (e.g. Heroku), will a single instance of server.py be shared by all clients or will each client have their own running version? I am wondering this because I am thinking of making use of global variables in se...
Is a single Python executable file shared by all clients when run on a server?
19,757,868
0
0
269
0
python,django,heroku,tornado
With Tornado you'll have at least one process per machine/VM (Heroku calls these "dynos"); in multicore environments you'll want to run multiple processes per machine (one per core). Each process handles many users, so in the simple case where there is only one process you can use global variables to share state betwe...
0
0
0
0
2013-11-03T06:35:00.000
3
0
false
19,750,453
1
0
1
2
I've been working with a Tornado project on my local machine by running server.py. When deployed to the server (e.g. Heroku), will a single instance of server.py be shared by all clients or will each client have their own running version? I am wondering this because I am thinking of making use of global variables in se...
Easiest way to implement paypal shopping for e-books
21,199,468
0
2
165
0
python,django,paypal,django-paypal
With respect, the question is slightly naive, in that there is typically a separation between the shopping cart, and the payment processing. A payment returns a binary result - it either worked or it didn't. It is up to your application to recall what was being paid for. The Paypal API returns the success or failure o...
0
0
0
0
2013-11-03T18:57:00.000
1
0
false
19,756,725
0
0
1
1
I have an existing django website, and I would like to sell some pdf files through it using paypal. The buyer needs to be able to select 1 or more books, get transferred to the paypal site to enter in payment info. Then after a successful payment, the buyer gets redirected back to my website and the books start downl...
Using the GAE remote_api to Create Local Scripts
19,760,171
1
0
71
0
python,google-app-engine,google-cloud-datastore
Why is including the paths that onerous ? Normally the remote_api shell is used interactively but it is a good tool that you can use as the basis of acheiving what your want. The simplest way will be to copy and modify the remote_api shell so that rather than presenting an interactive shell you get it to run a named s...
0
1
0
0
2013-11-04T00:23:00.000
1
1.2
true
19,759,934
0
0
1
1
I'm trying to do some local processing of data entries from the GAE datastore and I am trying to do this by using the remote_api. I just want to write some quick processing scripts that pull some data, but I am getting import errors saying that Python cannot import from google. Am I supposed to run the script from with...
Why does django stops loading a page after opening several pages?
19,762,217
0
0
908
0
python,django,windows
It is hard to tell whether the issue is related to Windows specifically, rather than compatibility issues with images/CSS/Javascript/plugins such as Flash. Are you running the latest versions of those browsers (or at least the same versions as on your desktop)? Do you have different security software/firewalls? Do othe...
0
0
0
0
2013-11-04T05:01:00.000
2
0
false
19,761,898
0
0
1
1
I have several django projects and they work well on my desktop. But when I run them on my laptop, they run ok for sometime. Then on a random occasion, opening a page won't work. The browser keeps trying to load the page (title tab keeps spinning, URL changes to the page its trying to open, and the page turns blank), w...
Next button is grey
20,859,383
0
0
735
0
eclipse,python-2.7,django-1.5
I had the same problem and managed to fix. Apparently, what caused the problem is that I have included the site-packages directory from a virtual environment into the PYTHONPATH of interpreters. After removing it, the grayed out buttons went normal.
0
0
0
0
2013-11-04T06:19:00.000
1
0
false
19,762,614
0
0
1
1
I have installed eclipse(indego)/python(2.7)/django(1.5.5) properly on a ubuntu 12.04 64bit. but when I start a new pydev project and give a new project name, the 'next' button and 'finish' button are both grey, and no error are shown in create diaglog box. How to create a django project?
How to add a calculated tax in OpenERP 7
19,797,646
0
0
963
0
python,openerp,invoice
A couple of things: You can't just add the tax to the invoice total. Invoice totals are stored functional fields that are calculated as the sum of the invoice lines so you would need to adjust the tax on a specific invoice line, or add a line with the taxes. Taxes are managed via fiscal positions. Create your tax obje...
0
0
0
0
2013-11-04T08:16:00.000
1
0
false
19,763,836
0
0
1
1
I am working with OpenERP 7. For business requirement, I have to add a tax to the invoice, this tax will be calculated like that : tax1= amount_untaxed * 0,1 % + amount_tax * 0.1 % A little bit of help will be appreciated .
Django can't find libssl on OS X Mavericks
19,772,866
2
2
9,380
1
python,django,macos,postgresql
It seems that it's libssl.1.0.0.dylib that is missing. Mavericks comme with libssl 0.9.8. You need to install libssl via homebrew. If loaderpath points to /usr/lib/, you also need to symlink libssl from /usr/local/Cell/openssl/lib/ into /usr/lib.
0
1
0
0
2013-11-04T12:15:00.000
5
0.07983
false
19,767,569
0
0
1
1
I'm trying to get Django running on OS X Mavericks and I've encountered a bunch of errors along the way, the latest way being that when runpython manage.py runserver to see if everything works, I get this error, which I believe means that it misses libssl: ImportError: dlopen(/Library/Frameworks/Python.framework/Versi...
How to create a django User using DRF's ModelSerializer
19,815,648
0
7
1,321
0
python,django,django-rest-framework
It seems like you should be overriding restore_object() in your serializer, not save(). This will allow you to create your object correctly. However, it looks like you are trying to abuse the framework -- you are trying to make a single create() create two objects (the user and the profile). I am no DRF expert, but I s...
0
0
0
0
2013-11-04T13:53:00.000
4
0
false
19,769,186
0
0
1
1
In django, creating a User has a different and unique flow from the usual Model instance creation. You need to call create_user() which is a method of BaseUserManager. Since django REST framework's flow is to do restore_object() and then save_object(), it's not possible to simply create Users using a ModelSerializer in...
Selenium python: simulate file drag
19,771,618
1
0
1,516
0
jquery,python,selenium,selenium-webdriver
Selenium only works with your web browser. If you are opening something other than a web browser such as file browser you cannot interact with it. Drag and drops work with items within a web browser but not from program such as Windows Explorer or a Linux file explorer to a web browser. Create and element in your brows...
0
0
1
0
2013-11-04T15:35:00.000
4
0.049958
false
19,771,234
0
0
1
1
how can I simulate the action of dragging and dropping a file from the filesystem to an element that has a ondrag event trigger? As for the normale "file" input, I was able to set the value of the input with jQuery. Can't I create a javascript File object or use any similar hack? Thanks Thanks
What type of server Django runserver uses?
19,776,830
12
4
2,017
0
python,django,webserver
It's exactly what it says on the tin - a simple, lightweight web server implemented in Python that ships with Django and is intended for development purposes only. It's not a free-standing web server in its own right and is intended purely for developing applications with Django - you should never use it in production ...
0
0
0
0
2013-11-04T20:19:00.000
1
1.2
true
19,776,363
0
0
1
1
What type of server Django uses when "runserver" command is ran? Documentation says more or less that it's "lightweight development Web server". Is it for example Apache? Thanks in advance.
Create a responsive web app with Django or jQueryMobile?
19,904,103
0
1
7,995
0
python,django,responsive-design
My solution now is as follows: I will use the bottle microframework for generating serverside dynamic html-pages on request. This will cause me to reload the page everytime I want to see new machine information, but for now it is enough for me. Later I can add AJAX for live monitoring (I know this is javascript, I thin...
0
0
0
0
2013-11-05T13:12:00.000
3
1.2
true
19,789,816
0
0
1
1
I have a bigger project to handle, so this is what I want to do: I have a Server with an MySQL database and Apache webserver running on. I save some machine information data in the database and want to create a web app to see, e. g. if the machine is running. The web app should be designed responsive, i. e. changing d...
Preferences and settings in a Django Project
19,790,956
1
0
196
0
python,django,settings,preferences
IMHO if the settings depends on user preferences I think a database is the way to store them, not files. Settings files are inherent to project's settings and database storage (normally) is the one who should persist dynamic user preferences.
0
0
0
0
2013-11-05T14:02:00.000
2
0.099668
false
19,790,818
0
0
1
2
I want to add to my django project the ability a user to set his own settings, and Django should remember that when the user logins. I also want my project to have some global settings that will be the same for every user. E.g before a user logs in the system the will be a language set for every user.(global setting) b...
Preferences and settings in a Django Project
19,790,987
1
0
196
0
python,django,settings,preferences
Edit: I thought first you want to generate the Django settings based on the admins, I didn't read your question completely. Anyway for user specific settings and preferences, definitely use a database. None use files for such tasks, you can query a database and create all your fields easily using Django's ORM.
0
0
0
0
2013-11-05T14:02:00.000
2
0.099668
false
19,790,818
0
0
1
2
I want to add to my django project the ability a user to set his own settings, and Django should remember that when the user logins. I also want my project to have some global settings that will be the same for every user. E.g before a user logs in the system the will be a language set for every user.(global setting) b...
How to execute PERL scripts in Django using async tasker like Celery?
19,791,772
3
0
555
0
python,django,perl,rabbitmq,celery
The easiest way to execute a Perl script from Celery would probably be a thin wrapper written in Python that runs the script as a subprocess.
0
1
0
0
2013-11-05T14:41:00.000
2
0.291313
false
19,791,570
0
0
1
1
I have a need to execute PERL scripts through a Django web interface. The user will select the parameters of the script and execute it. I am wondering if it is possible to use Celery/RabbitMQ to execute these script as Celery tasks? If so, would I need to modify the PERL script? Would I have to write RabbitMQ code int...
Where to instantiate shared thread objects in Django, equiv of pyramid registry?
19,795,569
0
1
152
0
python,django,sqlalchemy,pyramid,wsgi
I place my SQLAlchemy/SQLSoup connections at models.py, because it is related to persistence (and to the "model" layer of Model-View-Whatever). You can even replace the Django ORM with SQLAlchemy if you are not using applications relying on the first like django.contrib.admin or django.contrib.auth.
0
0
0
0
2013-11-05T17:21:00.000
1
0
false
19,794,979
0
0
1
1
I'm plugging some framework agnostic code of mine into Django instead of Pyramid. It uses SQLAlchemy and has a customized session factory object for getting db sessions. In pyramid, I instantiate this at server start up in the main app method and attach it to the registry so that all other parts of my app can get at it...
Modules not Working across different python versions
19,801,757
0
0
50
1
python,python-2.7,beautifulsoup,mysql-python
If you have 2 versions of python installed on your system, then you've somehow installed one library in each of them. You either need to install both libraries in both versions of python (which 2 seperate versions of pip can do), or need to setup your PYTHONPATH environment variable to allow loading of modules from add...
0
0
0
0
2013-11-05T21:42:00.000
1
0
false
19,799,605
0
0
1
1
I have two different python programs. One of the program uses the python BeautifulSoup module, the other uses the MySQLdb module. When I run the python files individually, I have no problem and the program run fine and give me the desired output. However I need to combine the two programs so to achieve my ultimate goa...
South Migration Error
19,804,412
0
1
666
0
python,django,django-south
First thing you must run initial migration. python manage.py schemamigration --initial You are getting this error because of your project structure or there is some issue with your south package .try to remove and reinstalling south. You need to see that there should not be any extra .py file in your migration folder.
0
0
0
0
2013-11-06T03:33:00.000
2
0
false
19,803,591
0
0
1
1
I am trying to learn Django by setting up one of the projects I found on github. Afetr I ran the syncdb command it showed Not synced (use migrations): - django_extensions - djangoratings - profiles - guardian (use ./manage.py migrate to migrate these). When I am running "python manage.py migrate app" , it gives A...
How to set form field default value without showing the field in django forms?
65,434,713
0
4
6,103
0
python,django
if you just want to set an initial value in the form, form = MyForm(initial={'field': field_var})
0
0
0
0
2013-11-06T15:23:00.000
4
0
false
19,815,949
0
0
1
1
I'm using a forms.ModelForm to set a model's attributes. For one of the attributes, I'd like to set a default value, and I want to handle it in the form, thus no default=value on the model attribute in the model class. On the form, though, I don't want to show the user the value, not even a hidden value, therefore, I ...
phantomjs vs selenium performance
45,224,165
0
1
1,072
0
python,selenium,selenium-webdriver,phantomjs
set load images equals to false , which will definitely help you to increase the speed of phantomJS.
0
0
1
0
2013-11-06T18:50:00.000
1
0
false
19,820,306
0
0
1
1
I've been using selenium in python to drive phantomjs. The problem is that it is quite slow. I'm beginning to think that it is selenium that is slow, not the core phantomjs functionality of emulating a browser, Javascript and all. Is there a more direct way to drive phantom that is faster?
How do I register tastypie resources from external app?
19,831,689
0
1
38
0
python,django,tastypie
Turns out the clients in question override urls.py to include their apps. I replaced the API url pattern with a custom one and it seems to work.
0
0
0
0
2013-11-07T06:59:00.000
1
0
false
19,829,799
0
0
1
1
I have a django based CMS system I am working on and it uses tastypie. While all resources native to the CMS are registered in a separate file imported later into urls.py some of the clients using the system require loading their own custom apps. Is there some way to register an additional resource without changing the...
forwarding large files on servers
19,851,945
1
0
39
0
python,web-applications,flask
Yes. What would be the problem exactly? Personally I would recommend setting up an Nginx server at both ends to serve the file from the filesystem. Using Flask for hosting files is a waste of resources.
0
0
0
0
2013-11-08T03:55:00.000
1
0.197375
false
19,851,323
0
0
1
1
I have two Flask servers A and B. My user is on machine C. A is the public interface machine. The user wants to retrieve a 500GB octet-stream from B, but only the public interface on A is exposed. So I'd like something where: User on machine C sends GET request to server A, request gets routed to server B, server B re...
PyDev is installed but does not show up in ADT
19,976,691
4
3
960
0
python,eclipse,adt,pydev
The non-obvious answer here is that JDK 7 needs to be installed. Otherwise, the PyDev installation succeeds but then silently is hidden in Eclipse. I just went through this, and getting JDK 7 fixes it right up.
0
0
0
0
2013-11-08T04:47:00.000
2
1.2
true
19,851,780
1
0
1
2
I tried to setup PyDev on my ADT/eclipse. I am wondering the installation did not prompt any errors but I could not see pydev plugin after restarting ADT. Moreover I tried to extract plugin files in to eclipse>plugin folder for pydev it did not work either. Any solutions or ideas for it to work on ADT.
PyDev is installed but does not show up in ADT
19,902,911
0
3
960
0
python,eclipse,adt,pydev
You need to run Eclipse as an administartor when you do the Pydev (or any other) install.
0
0
0
0
2013-11-08T04:47:00.000
2
0
false
19,851,780
1
0
1
2
I tried to setup PyDev on my ADT/eclipse. I am wondering the installation did not prompt any errors but I could not see pydev plugin after restarting ADT. Moreover I tried to extract plugin files in to eclipse>plugin folder for pydev it did not work either. Any solutions or ideas for it to work on ADT.
Is parsing JSON on the serverside dangerous?
19,870,206
0
0
768
0
python,json
any seralizer/deserializer/parser is a potential security threat to the application It is true on the serverside as long as you write seralizer/deserializer/parser by yourself. As long as you use standard library you can trust its programmers.
0
0
0
0
2013-11-08T23:09:00.000
6
0
false
19,870,149
1
0
1
6
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
19,870,208
0
0
768
0
python,json
You never know what the parser does inside. A parsing itself is a possible security threat, although the developers try to do their best to avoid it. For a stable library that's been developed for a long time, there's nearly no danger.
0
0
0
0
2013-11-08T23:09:00.000
6
0
false
19,870,149
1
0
1
6
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
19,870,248
3
0
768
0
python,json
JSON data can only contain basic types: strings, numbers, Booleans, null, objects, and lists. This means that properly formatted JSON data poses no risk at all to your application, unless you are doing something silly like executing that code with eval(). So if valid JSON is not an issue, the question becomes "can a c...
0
0
0
0
2013-11-08T23:09:00.000
6
1.2
true
19,870,149
1
0
1
6
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
19,870,358
0
0
768
0
python,json
Yes. You should be paranoid. Just because the parsers are trusted does't mean you can't screw up.
0
0
0
0
2013-11-08T23:09:00.000
6
0
false
19,870,149
1
0
1
6
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
19,870,379
0
0
768
0
python,json
Well... to take any user input is potentially dangerous, especially when using external libraries you don't know well. For instance, it's simple to demonstrate how a quicksort algorithm poorly implemented can be used to a Denial of Service attack by feeding it tailored data that leads all iterations to an O(n²). Does t...
0
0
0
0
2013-11-08T23:09:00.000
6
0
false
19,870,149
1
0
1
6
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
Is parsing JSON on the serverside dangerous?
19,870,187
1
0
768
0
python,json
In general that blurb is true, but is dependent on how security-enabled/conscious the parser and its developers are. The json module itself has been vetted for a long time, and does not do anything that would compromise the security of the server.
0
0
0
0
2013-11-08T23:09:00.000
6
0.033321
false
19,870,149
1
0
1
6
I'm writing a Python application with Django and serializing objects to and from JSON using Python's standard json library. I've heard something along the lines that any seralizer/deserializer/parser is a potential security threat to the application Is this really true on the serverside? Do I need to fear someone se...
How can a django project detect if the system has django installed?
19,883,259
1
4
262
0
python,django
Simply the module won't be found when you try to run your project. You can run 'python' in your command line and try to 'import django' if it returns an error then django isn't found it means that django isn't installed on the current machine.
0
0
0
0
2013-11-09T21:15:00.000
2
0.099668
false
19,883,186
0
0
1
1
I've built a small project on my system. After building the project, I put it on a USB drive, and copied to another system. When I run the project, how can it detect if django is installed in the system or if the system has all of the the requirements for the project? For example, I made a blog example project on a lap...
How do Python developers manage Javascript/CSS library dependencies?
19,887,048
2
1
220
0
python
python is the language, I guess you mean some web platform like django. however, there is no javascript / css management tool at part of the platform.
0
0
0
0
2013-11-10T06:01:00.000
3
0.132549
false
19,886,791
1
0
1
1
Coming from C#, management of -all- dependencies was done using NuGet. In Python, PIP is used to manage python packages. Is there any de facto standard for managing Javascript and CSS library dependencies?
In which tables changes are made in openERP when an items is sold at Point of sale
19,897,059
0
0
49
1
python,openerp
All the sales done through post is registered in post.order. If you are creating orders from an external source other than pos, you can create the order in this table and call the confirm bottom action. Rest changes in all other table will be done automatically..
0
0
0
0
2013-11-10T17:46:00.000
1
0
false
19,892,934
0
0
1
1
I got one table in which modifications are made :-account_bank_statement, what other tables are needed for the point of sale and if i make a sale in which tables modifications are made.I want to make a sale but not through the pos provided.
How to use WTForms in Ajax validation?
25,145,753
3
16
8,644
0
python,flask,wtforms,flask-wtforms
A great question. This is what we do (flask backend, jquery frontend): use jquery.forms plugin to ajax forms. Pretty solid mature code. Shortcoming, cannot send json encoded data, only form-urlencoded. Receives plain or json data. use wtfroms for form validation. Very mature codebase. tried to use wtforms-json for ac...
0
0
0
0
2013-11-11T04:42:00.000
2
0.291313
false
19,898,967
0
0
1
1
I accustomed of using WTForms by means of Flask-WTF in my flask application. Doing server side validation is trivial. But how do I leverage this server validation to become a field level, ajax, client side validation? So, when user tab to another input fields, my application can directly goes on validating it and give ...
Over-riding Debian/Ubuntu's lintian profile
20,292,610
1
4
683
0
python,ubuntu,debian,deb,lintian
For future reference, here's what I did. I generated and packaged the .pyo files into their own tar.gz file In the postinst script, the tar.gz file is extracted, and the tar.gz file is deleted In the postrm script, the pyo files are deleted. This isn't the nicest solution in the world, but it works with Debian/Ubuntu...
0
1
0
0
2013-11-11T08:14:00.000
2
0.099668
false
19,901,647
0
0
1
1
I have written a proprietary application that needs to install some .pyo files. When I create a .deb from the app, lintian complains that package-installs-python-bytecode. I tried adding an override, but apparently this tag is marked as non-overridable by ftp-master-auto-reject.profile in /usr/share/lintian/profiles/de...
where can i find the source file of 'admin.site.urls'?
21,247,209
17
11
11,132
0
python,django,django-admin,admin
In python, modules can be loaded from within a package's __init__.py; it doesn't need to be a file in the same directory. If you look in django/contrib/admin/__init__.py you will see: from django.contrib.admin.sites import AdminSite, site So then if you look in django/contrib/admin/sites.py you will see: site = AdminSi...
0
0
0
0
2013-11-12T01:59:00.000
1
1
false
19,919,547
0
0
1
1
In my urls.py, I have a line of codes of ('include(admin.site.urls). But I cannot find the source file in the setup dir of python like ..\site-packages\django\contrib\admin Where are they?
How do I access my django app running on Amazon ec2?
51,827,225
0
4
6,277
0
python,django,amazon-web-services,amazon-ec2
Make sure to include your IPv4 Public IP address in the ALLOWED_HOSTS section in Django project/app/settings.py script...
0
1
0
0
2013-11-12T05:37:00.000
2
0
false
19,921,705
0
0
1
1
So, I have looked around stack overflow + other sites, but havent been able to solve this problem: hence posting this question! I have recently started learning django... and am now trying to run it on ec2. I have an ec2 instance of this format: ec2-xx-xxx-xx-xxx.us-west-2.compute.amazonaws.com on which I have a djang...
is is necessary to learn java for hadoop?
19,932,204
2
2
689
0
java,python,hadoop
No, you don't necessarily need java knowledge, as you can write map-reduce jobs perfectly well in pig or hive (similar to SQL). However, as with all layers of abstraction, at some point you may well need to know what is going on "behind the scenes" and being able to look, understand and debug the underlying java is a b...
0
0
0
0
2013-11-12T14:40:00.000
3
0.132549
false
19,932,110
0
0
1
1
I wanted to start learning the big data technology from the scratch. I wanted to know is it necessary to learn java for operating with hadoop as i am already well versed in python?
django-allauth with multiple domains
21,147,716
1
3
848
0
python,django,oauth-2.0,multi-tenant,django-allauth
You should use Django sites framework together with django-allauth. Consumer keys, tokens make use of the Django sites framework. This is especially helpful for larger multi-domain projects, but also allows for for easy switching between a development (localhost) and production setup without messing with your se...
0
0
0
0
2013-11-12T18:45:00.000
1
0.197375
false
19,937,402
0
0
1
1
I am creating a web application that will support several domains. For example, if my app were named www.webapp.com, I'd also have numerous customers mapping their domains to my site via DNS CNAME mappings, i.e. webapp.yourdomain.com CNAME www.webapp.com and foo.anotherdomain.com CNAME www.webapp.com, etc... I want us...
Streaming Tweets Via Python
22,292,555
0
0
225
0
php,python,ajax,twitter,streaming
I am using twython and using long polling technique for displaying the streams.
0
0
1
1
2013-11-13T05:41:00.000
2
1.2
true
19,946,192
0
0
1
1
I am using twiiter streaming api and twython module with python 2.7 windows 7 os. I want to click a button and streaming of tweets should start. and on clicking the streaming should stop.I am using python for backend and HTML on front end.I am communicating to python via php using passthru function.when i am giving an ...
How do I make a standalone application out of a Docker container?
19,951,847
1
5
3,690
0
python,docker
In order to use a Docker container, you will always need the basics - Docker installed on a Linux OS (that supports LXC and any other required filesystem type). In a production environment, you'd be running a recent, native install of Linux, and the initial install of Docker would be easy, and a one-time event (in a cl...
0
1
0
0
2013-11-13T09:17:00.000
3
0.066568
false
19,949,809
0
0
1
3
I'll like to create a python flask application that can run on any platform. I've put it in a Docker container. But unless I've misunderstood something the host machine still need docker installed to launch the container. Which in turn required Vagrant and and Ubuntu VM (at least on Mac). Am I missing something? What i...
How do I make a standalone application out of a Docker container?
20,142,281
0
5
3,690
0
python,docker
The simple answer is: you can't. The long answer is: Docker is not intended to be used to make cross platform standalone applications (but JAVA is, for example). Docker instead focuses on having a light weight container that acts like a virtual machine but basically isn't. It's just a box inside a linux(!) system that ...
0
1
0
0
2013-11-13T09:17:00.000
3
0
false
19,949,809
0
0
1
3
I'll like to create a python flask application that can run on any platform. I've put it in a Docker container. But unless I've misunderstood something the host machine still need docker installed to launch the container. Which in turn required Vagrant and and Ubuntu VM (at least on Mac). Am I missing something? What i...
How do I make a standalone application out of a Docker container?
20,142,478
0
5
3,690
0
python,docker
A Linux VM is a dependency if you are on Windows or Mac. Vagrant is not though. It is mentioned only because it's probably the easiest way to get a VM up and running.
0
1
0
0
2013-11-13T09:17:00.000
3
0
false
19,949,809
0
0
1
3
I'll like to create a python flask application that can run on any platform. I've put it in a Docker container. But unless I've misunderstood something the host machine still need docker installed to launch the container. Which in turn required Vagrant and and Ubuntu VM (at least on Mac). Am I missing something? What i...
Django Jenkins Test runner - Slow
25,029,569
0
0
560
0
python,django,jenkins
Check the latest version of original django-jenkins library. It has same unit test discovery method and coverage disabled by default. Coverage could be enabled with --enable-coverage command line option.
0
0
0
1
2013-11-13T18:58:00.000
2
0
false
19,962,129
0
0
1
1
I am using django_discover_jenkins module for generating jenkins reports as a part of unit test runs. Has anyone used this before and found it to be slower? The coverage tasks slow this down considerably. How do I remove coverage task from the django_discover_jenkins task set without editing the settings file.
Flask RESTful cross-domain issue with Angular: PUT, OPTIONS methods
47,288,580
5
47
58,328
0
python,angularjs,flask,cors,flask-restful
Just an update to this comment. Flask CORS is the way to go, but the flask.ext.cors is deprecated. use: from flask_cors import CORS
0
0
1
0
2013-11-13T19:31:00.000
9
0.110656
false
19,962,699
0
0
1
2
I've developed a small write-only REST api with Flask Restful that accepts PUT request from a handful of clients that can potentially have changing IP addresses. My clients are embedded Chromium clients running an AngularJS front-end; they authenticate with my API with a simple magic key -- it's sufficient for my very ...
Flask RESTful cross-domain issue with Angular: PUT, OPTIONS methods
28,923,164
36
47
58,328
0
python,angularjs,flask,cors,flask-restful
You can use the after_request hook: @app.after_request def after_request(response): response.headers.add('Access-Control-Allow-Origin', '*') response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization') response.headers.add('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE') ret...
0
0
1
0
2013-11-13T19:31:00.000
9
1
false
19,962,699
0
0
1
2
I've developed a small write-only REST api with Flask Restful that accepts PUT request from a handful of clients that can potentially have changing IP addresses. My clients are embedded Chromium clients running an AngularJS front-end; they authenticate with my API with a simple magic key -- it's sufficient for my very ...
Autocompleting list of choices with 'other' option in django
20,029,341
0
0
59
0
jquery,python,django,autocomplete,django-forms
It would be helpful to see the model and form. If you are using a simple charfield in your model and set the choices in the automcomplete class, you should be able to input arbitrary values.
0
0
0
0
2013-11-14T03:29:00.000
1
0
false
19,968,985
0
0
1
1
I have a django form element (Musical Instrument) where I'd like to autocomplete from a list of choices (e.g. ['Piano', 'Guitar', 'Drums', 'Bass']), but allow the user to enter something else if it isn't in the list. I'm currently using autocomplete-light, but can swap this for something else if need be. Any ideas?
What's the difference between `from django.conf import settings` and `import settings` in a Django project
19,976,181
32
112
77,463
0
python,django,django-settings
from django.conf import settings is better option. I use different settings files for the same django project (one for "live", one for "dev"), the first one will select the one being executed.
0
0
0
0
2013-11-14T11:09:00.000
2
1
false
19,976,115
0
0
1
1
I'm reading up that most people do from django.conf import settings but I don't undertstand the difference to simply doing import settings in a django project file. Can anyone explain the difference?
Django tinymce safe template tag
19,978,127
2
1
500
0
python,django,django-tinymce
1) Django includes a template tag striptags to strip html tags. It uses regular expressions, it's not the right solution but it'll do the job. 2) It seems, browsing images is not included as an option in django-tinymce. You need to use another module and integrate it with TinyMCE to do the job.
0
0
0
0
2013-11-14T12:35:00.000
2
1.2
true
19,977,832
0
0
1
1
I'm currently trying django tinymce, I want to show on the main page a truncated text of around 200 characters in total. The problem is that I don't want html tags to show up nor images to show up in this truncated text.. Is there an easy way to solve it? Example: If an image is in between the 200 characters, the img ...
Does Django request.REQUEST.get() contain BOTH GET and POST parameters?
41,547,619
1
6
8,947
0
python,django,post,get
Try this: name = request.GET.get('name', request.POST.get('name'))
0
0
0
0
2013-11-14T17:22:00.000
4
0.049958
false
19,984,224
0
0
1
2
Are the parameters in request.POST and request.GET BOTH in request.REQUEST ? Or i have to check for each of them ? I can't find a clear info in the documentation for both REQUEST/QueryDict. NB: Django 1.4 Final
Does Django request.REQUEST.get() contain BOTH GET and POST parameters?
19,984,347
1
6
8,947
0
python,django,post,get
Yes, the doc says: HttpRequest.REQUEST For convenience, a dictionary-like object that searches POST first, then GET. Inspired by PHP’s $_REQUEST. For example, if GET = {"name": "john"} and POST = {"age": '34'}, REQUEST["name"] would be "john", and REQUEST["age"] would be "34". It’s strongly suggested that you use ...
0
0
0
0
2013-11-14T17:22:00.000
4
0.049958
false
19,984,224
0
0
1
2
Are the parameters in request.POST and request.GET BOTH in request.REQUEST ? Or i have to check for each of them ? I can't find a clear info in the documentation for both REQUEST/QueryDict. NB: Django 1.4 Final
Is a web2py project typically made up of multiple applications?
19,988,936
0
0
97
0
python,web,web2py
In most cases, a website is probably a single web2py application, though that doesn't have to be the case (a web2py installation can include multiple applications, which can interact with each other). An application itself can be composed of multiple re-usable plugins (similar to how a Django project can be made up of ...
0
0
0
0
2013-11-14T19:36:00.000
1
0
false
19,986,721
0
0
1
1
web2py beginner. In django, a project is typically made up of multiple applications that encapsulate project functions, right? Do web2py projects typically have the same structure or is the entire website just a single application?
Google AppEngine: Setting up user roles and permissions
20,210,524
0
1
874
0
python,google-app-engine,permissions,roles,app-engine-ndb
You must manage user_profile yourself. In your user_profile, you can store the user id such as an email address or a google user id like you want. Add a role array in this entity where you store all roles for this user and you manage access with decorators. For example, users which are employers will have "EMPLOYERS" i...
0
1
0
0
2013-11-14T21:21:00.000
3
0
false
19,988,654
0
0
1
2
I am undergoing Udacity's Web Development course which uses Google AppEngine and Python. I would like to set up specific user roles, and their alloted permissions. For example, I may have two users roles, Employer and SkilledPerson, and assign their permissions as follows: Only Employers may create Job entities. Only ...
Google AppEngine: Setting up user roles and permissions
20,207,381
0
1
874
0
python,google-app-engine,permissions,roles,app-engine-ndb
I'd create a user_profile table which stores their Google user id, and two Boolean fields for is_employer and is_skilled_person, because there's always potential for someone to be both of these roles on your site. (Maybe I'm an employer posting a job but also looking for a job as well) If you perceive having multiple r...
0
1
0
0
2013-11-14T21:21:00.000
3
0
false
19,988,654
0
0
1
2
I am undergoing Udacity's Web Development course which uses Google AppEngine and Python. I would like to set up specific user roles, and their alloted permissions. For example, I may have two users roles, Employer and SkilledPerson, and assign their permissions as follows: Only Employers may create Job entities. Only ...