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
Server doesn't follow TEMPLATE_DIRS path
21,827,881
0
0
57
0
python,django,templates
The static url should point to the staticfiles directory. And why do you put templates under staticfiles? You may have it as a seperate folder in the main folder(along with manage.py)
0
0
0
0
2014-02-17T11:09:00.000
2
0
false
21,827,432
0
0
1
1
The path to my templates folder in TEMPLATE_DIRS looks like this: os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) + '/static/templates/' When I run my server locally and open the page everything works fine and it detects the templates at ~/Documents/projects/clupus/static/templates. Whenever I pull ...
How to select a span element which is a list box ,when multiple span elements with same class ID are present in the same page?
22,005,969
0
0
313
0
python,selenium,automated-tests,robotframework
Could you please provide a part of your code you use to get the span element and a part of your GUI application where you are trying to get the element from (HTML, or smth.)?
0
0
1
0
2014-02-18T07:32:00.000
2
0
false
21,846,978
0
0
1
2
I am using robot framework to test a GUI application , I need to select a span element which is a list box , but I have multiple span elements with same class ID in the same page , So how can I select each span element(list box) ??? Thanks in advance
How to select a span element which is a list box ,when multiple span elements with same class ID are present in the same page?
22,013,855
0
0
313
0
python,selenium,automated-tests,robotframework
Selenium provides various ways to locate elements in the page. If you can't use id, consider using CSS or Xpath.
0
0
1
0
2014-02-18T07:32:00.000
2
0
false
21,846,978
0
0
1
2
I am using robot framework to test a GUI application , I need to select a span element which is a list box , but I have multiple span elements with same class ID in the same page , So how can I select each span element(list box) ??? Thanks in advance
call a method in Django admin site
21,852,651
0
1
2,361
0
python,django,django-admin,django-sites
1 WAY You can go to your models.py into your app by using django signal you can do this. from django.db.models.signals import post_save class Test(models.Model): # ... fields here # method for updating def update_on_test(sender, instance, **kwargs): # custome operation as you want to perform # registe...
0
0
0
0
2014-02-18T11:34:00.000
1
0
false
21,852,518
0
0
1
1
i have a Django project and right now everything works fine. i have a Django admin site and now, i want that when i add a new record to my model, a function calls simultaneously and a process starts. how i can do this? what is this actions name?
How to add Indian Standard Time (IST) in Django?
61,074,643
0
56
54,914
0
python,django
Adding to Jon Answer, If timezone.now() still not working after changing the TIME_ZONE='Asia/Kolkata'. Instead of timezone.now() you can use timezone.localtime(). Hope it solves.. :)
0
0
0
0
2014-02-18T13:29:00.000
14
0
false
21,855,357
1
0
1
6
We want to get the current time in India in our Django project. In settings.py, UTC is there by default. How do we change it to IST?
How to add Indian Standard Time (IST) in Django?
56,727,629
0
56
54,914
0
python,django
Simple Change TIME ZONE from 'UTC' to 'Asia/Kolkata' remember K and A is Capital here.
0
0
0
0
2014-02-18T13:29:00.000
14
0
false
21,855,357
1
0
1
6
We want to get the current time in India in our Django project. In settings.py, UTC is there by default. How do we change it to IST?
How to add Indian Standard Time (IST) in Django?
63,849,327
0
56
54,914
0
python,django
LANGUAGE_CODE = 'en-us' TIME_ZONE = 'Asia/Calcutta' USE_I18N = True USE_L10N = True USE_TZ = True This should work.
0
0
0
0
2014-02-18T13:29:00.000
14
0
false
21,855,357
1
0
1
6
We want to get the current time in India in our Django project. In settings.py, UTC is there by default. How do we change it to IST?
How to add Indian Standard Time (IST) in Django?
46,900,867
0
56
54,914
0
python,django
Modify setting.py and change the time zone to TIME_ZONE = 'Asia/Kolkata'
0
0
0
0
2014-02-18T13:29:00.000
14
0
false
21,855,357
1
0
1
6
We want to get the current time in India in our Django project. In settings.py, UTC is there by default. How do we change it to IST?
How to add Indian Standard Time (IST) in Django?
48,295,467
6
56
54,914
0
python,django
Use Below settings its worked for me. TIME_ZONE = 'Asia/Kolkata' USE_I18N = True USE_L10N = True USE_TZ = False
0
0
0
0
2014-02-18T13:29:00.000
14
1
false
21,855,357
1
0
1
6
We want to get the current time in India in our Django project. In settings.py, UTC is there by default. How do we change it to IST?
How to add Indian Standard Time (IST) in Django?
54,306,812
0
56
54,914
0
python,django
Keep TIME_ZONE = 'Asia/Kolkata' in settings.py file and restart the service from where you are accessing the timezone (server or shell). In my case, I restarted the python shell in which I was working and it worked fine for me.
0
0
0
0
2014-02-18T13:29:00.000
14
0
false
21,855,357
1
0
1
6
We want to get the current time in India in our Django project. In settings.py, UTC is there by default. How do we change it to IST?
How to hide url after domain in web2py?
21,868,611
1
0
493
0
python,url,web,web2py
Well I guess you're going to have a build the worlds most remarkable single page application :) Security through obscurity is never a good design pattern. There is absolutely no security "reason" for hiding a URL if your system is designed in a such a way that the use of the URLs is meaningless unless the access contro...
0
0
0
0
2014-02-18T23:43:00.000
1
0.197375
false
21,867,972
0
0
1
1
I am building a website using web2py. For security reasons I would like to hide the url after the domain to the visitors. For example, when a person clicks a link to "domain.com/abc", it will go to that page and the address bar shows "domain.com". I have played with the routes_in and routes_out, but it only seems to ma...
Flask request waiting for asynchronous background job
25,578,832
1
0
2,430
0
python,api,flask
Tornado would do the trick. Flask is not designed for asynchronization. A Flask instance processes one request at a time in one thread. Therefore, when you hold the connection, it will not proceed to next request.
0
0
1
0
2014-02-19T00:47:00.000
1
0.197375
false
21,868,709
0
0
1
1
I have an HTTP API using Flask and in one particular operation clients use it to retrieve information obtained from a 3rd party API. The retrieval is done with a celery task. Usually, my approach would be to accept the client request for that information and return a 303 See Other response with an URI that can be polle...
Find all possible query string values with python
21,872,039
0
0
299
0
python,parsing,query-string
It depends on the website itself. If it has other values of field1 or field2, you can only know that by looking into the code or documentation(if available). That's the only accurate way of knowing it. Otherwise, you can try brute forcing (trying all possible alphanumeric values Ever), but that doesn't guaranty anythin...
0
0
1
0
2014-02-19T05:13:00.000
1
0
false
21,871,636
1
0
1
1
I'm trying to figure out how to parse a website that doesn't have documentation available to explain the query string. I am wondering if there is a way to get all possible valid values for different fields in a query string using Python. For example, let's say I have the current URL that I wish to parse: http://www.web...
OpenERP trunk server gives import Error psutil
21,872,185
5
2
3,312
0
python,openerp,importerror,openerp-7
Getting this error because psutil is not installed. you have to install psutil using this command. sudo apt-get install python-psutil in terminal. after this restart server. This will solve your error.
0
0
0
0
2014-02-19T05:38:00.000
1
1.2
true
21,871,997
0
0
1
1
I download trunk version of OpenERP from lauchpad. When i start server it's gives following error Traceback (most recent call last): File "./openerp-server", line 2, in import openerp File "/home/jack/trunk/trunk-server/openerp/init.py", line 72, in import http File "/home/jack/trunk/trunk-server/opener...
Setting/Configuring the output file after running scrapy spider
21,873,566
2
1
487
0
python,json,scrapy
I think you should use scrapy crawl yourspider -o output.json -t json where -o output filename and -t output format.
0
0
0
0
2014-02-19T05:50:00.000
2
0.197375
false
21,872,179
1
0
1
1
I'm able to run a scrapy spider from a script. But I want to store the output in a specific file(say output.json) in json format. I did a lot of research & also tried to override FEED_URI & FEED_FORMAT from settings. I also tried to use JsonItemExporter function but all in vain. Any help will be appreciated. Thanks!
Flask python blueprint logic code separation
21,885,753
0
1
344
0
python,flask,blueprint
am I right your logic should be in models and service classes? and blueprints (aka views) only a thin middleware between template and these modules?
0
0
0
0
2014-02-19T15:42:00.000
2
0
false
21,885,365
0
0
1
1
I'm a bit confused about separation for my flask app. Users can login, post adverts and these are available to the public. The URL structure would be something like this: User Home - www.domain.com/user User login - www.domain.com/user/login User advert List - www.domain.com/user/advert User advert add - www.domain.co...
Custom jinja2 tag in sphinx template
21,909,382
1
0
737
0
python,jinja2,python-sphinx
I've found a good way to do this. Sphinx's configuration parameter template_bridge allows to control over TemplateBribge object - which is responsible for themes rendering. Standard sphinx.jinja2glue.TemplateBridge constructs environment attribute in init method (it's not a constructor, unfortunate name for method) - w...
0
0
0
0
2014-02-19T16:03:00.000
2
1.2
true
21,885,856
0
0
1
1
I'd like to implement custom navigation to my sphinx docs. I use my custom theme based on basic sphinx theme. But I don't know how to create new tag for template system or use my custom sphinx plugin's directive in html templates. Any ideas where I can plug in? Update As I can see in sphinx sources, jinja2 environment ...
BOTO distribute scraping tasks among AWS
21,899,718
1
0
262
0
python,amazon-web-services,cron,queue,boto
Question: (1) How to use boto to pass the variable/argument to another AWS instance and start a script to work on those variable Use shared datasource, such as DynamoDB or messaging framework such as SQS and .. use boto to retrieve the result back to the master box. Again, shared datasource, or messaging. (2) W...
0
0
1
0
2014-02-19T20:58:00.000
1
0.197375
false
21,892,302
0
0
1
1
I have 200,000 URLs that I need to scrape from a website. This website has a very strict scraping policy and you will get blocked if the scraping frequency is 10+ /min. So I need to control my pace. And I am thinking about start a few AWS instances (say 3) to run in parallel. In this way, the estimated time to collect...
Using memcached to host images
21,925,544
1
0
112
0
python,image,flask,memcached
Yes, you can do it. Create a controller or serlvet called for example www.yoursite.com/getImage/ID When you execute this URL, your program shoud connect to the memcached and return the image object that you have previously stored in it. Finally when in your html you add: src="www.yoursite.com/getImage/ID" the browser...
0
0
0
0
2014-02-20T01:19:00.000
1
1.2
true
21,896,157
0
0
1
1
Im writing simple blogging platform in Flask microframework, and I'd like to allow users to change image on the front page but without actually writing it into filesystem. Is it possible to point src attribute in img tag to an object stored in memory?
Record rules on same object with different CRUD options?
21,903,368
0
0
78
0
python,openerp,record,crud,access-rights
It seems this one works: Needed to create two rules (applies r,w,c): ['&', ('user_id','=',user.id),('state','=','stage1')] And second rule (applies r): [('stage','=','stage2')]
0
0
0
0
2014-02-20T09:02:00.000
1
1.2
true
21,902,861
0
0
1
1
I need to apply different record rules on same object to give different access rights depending on state that record is. For example there are three stages: stage1, stage2, stage3. On first stage user with specific access rights group can do this: Read, Write, Create his own records. When he presses button to go to sta...
Connect to flask over public connection
21,905,637
0
0
115
0
python,flask
You need to set your router to forward the relevant port to your laptop.
0
0
1
0
2014-02-20T10:54:00.000
1
1.2
true
21,905,560
0
0
1
1
I have flask running on my Macbook (10.9.1 if it makes a difference). I have no problem accessing what I have hosted there over my local network, but I'm trying to see if I can access it publicly. For example load a webpage on my iPhone over it's 3G connection. It doesn't appear to be as simple as /index. With my limit...
Parrallel south migration in django causes errors
21,927,635
0
0
87
0
python,django,amazon-web-services,django-south
Turns out the problem was that the git fetch on one of the front servers didnt take, which is what was causing the problem..it had nothing to do with running migrations in parallel (though I shouldnt have done that anyway)
0
0
0
0
2014-02-20T12:07:00.000
2
0
false
21,907,349
0
0
1
1
I ran a code update that points at two front end servers (Amazon Web Service Instances). A south migration was included as part of the update.Since the migration the live site appears to flit between the current code revision , and the previous revision, at will. Since discovering this, A previous developer (who has l...
Django & postgres - drawbacks of storing data as json in model fields
21,909,779
3
1
1,302
1
python,json,django,postgresql
Storing data as json (whether in text-typed fields, or PostgreSQL's native jsontype) is a form of denormalization. Like most denormalization, it can be an appropriate choice when working with very difficult to model data, or where there are serious performance challenges with storing data fully normalized into entities...
0
0
0
0
2014-02-20T12:38:00.000
1
0.53705
false
21,908,068
1
0
1
1
I'm sometimes using a TextField to store data with a structure that may change often (or very complex data) into model instances, instead of modelling everything with the relational paradigm. I could mostly achieve the same kind of things using more models, foreignkeys and such, but it sometimes feels more straightforw...
SOA versus Django ORM with multiple processes
21,914,906
0
0
138
1
python,django,sqlite,rest,orm
It depends on what your application is doing. If your REST application reads a piece of data from SQLITE using the Django ORM and then the other app does a write you can run into some interesting race situations. To prevent that it might make sense to have both these applications as django-app in a single Django proj...
0
0
0
0
2014-02-20T15:57:00.000
1
0
false
21,912,993
0
0
1
1
I have a django app which provides a rest api using Django-rest-framework. The API is used by clients as expected, but I also have another process(on the same node) that uses Django ORM to read the app's database, which is sqlite3. Is it better architecture for the process to use the rest api to interact(only reads) wi...
clean up .pyc files in virtualenv stored in souce repository after the fact?
21,936,238
4
2
1,403
0
python,version-control,virtualenv,ignore,pyc
That is fine, just remove them! Python auto-generates them from the corresponding .py file any time it wants to, so you needn't worry about simply deleting them all from your repository. A couple of related tips - if you don't want them generated at all on your local dev machine, set the environment variable PYTHONDON...
0
0
0
0
2014-02-21T13:45:00.000
1
1.2
true
21,936,158
1
0
1
1
I've created a virtualenv for my project and checked it into source control. I've installed a few projects into the virtualenv with pip: django, south, and pymysql. After the fact I realized that I had not set up source control for ignoring .pyc files. Could there be any subtle problems in simply removing all .py...
Whats the smartest way to password protect an entire Django site for testing purposes
21,937,650
0
3
4,949
0
python,html,django
Why you do not do simple form on index page when user is not authenticated?
0
0
0
1
2014-02-21T14:25:00.000
3
0
false
21,937,072
0
0
1
1
Here is the deal, how do I put the simplest password protection on an entire site. I simply want to open the site to beta testing but don't really care about elegance - just a dirty way of giving test users a username and password without recourse to anything complex and ideally i'd like to not to have to install any c...
AppEngine real time querying - cost, performance, latency balancing act and quotas
21,962,823
0
1
173
1
python,google-app-engine,mapreduce,task-queue
First, writes to the datastore take milliseconds. By the time your user hits the refresh button (or whatever you offer), the data will be as "real-time" as it gets. Typically, developers become concerned with real-time when there is a synchronization/congestion issue, i.e. each user can update something (e.g. bid on an...
0
1
0
0
2014-02-21T17:23:00.000
2
0
false
21,941,030
0
0
1
1
I am trying to design an app that uses Google AppEngine to store/process/query data that is then served up to mobile devices via Cloud Endpoints API in as real time as possible. It is straight forward enough solution, however I am struggling to get the right balance between, performance, cost and latency on AppEngine. ...
Django delete unused media files
21,943,591
2
37
19,573
0
python,django,django-admin
You can use signals. Than use os.remove() to clean up related files on delete. This way your file system always reflects you db. No need for hitting some button.
0
0
0
0
2014-02-21T17:45:00.000
5
0.07983
false
21,941,503
0
0
1
1
I have a django project in which the admins are able to upload media. As items sell, they are deleted from the site, thus removing their entry in the MySQL database. The images associated with the item, however, remain on the file system. This isn't neccessarily bad behavior - I don't mind keeping files around in case ...
Heroku: Putting a file in the bin folder
21,942,195
1
0
301
0
python,linux,django,heroku
You create it in the project root.
0
0
0
0
2014-02-21T18:15:00.000
1
1.2
true
21,942,110
0
0
1
1
I am sorry if this is too basic of a question but I spent the whole morning unsuccessfully figuring it out. I want to use the Heroku Scheduler for a Django app, and as per their documentary, I am supposed to put the python file I wan't to be executed by the Scheduler in the bin/ folder on Heroku. Now on my local copy...
Possible to make flask login system which doesn't use client-side session/cookie?
21,947,739
-1
4
1,749
0
python,session,flask,flask-login
Nope. That's literally impossible over pure HTTP. HTTP is a stateless protocol, which means that in order to preserve state, the client has to be able to identify itself on every request. What you might be able to do is HTTP Basic Authentication over HTTPS, then access that Authentication on the server side.
0
0
0
0
2014-02-22T00:11:00.000
4
-0.049958
false
21,947,723
0
0
1
2
I'm working on a Flask app to be used by a medical client. Their IT dept is so up tight about security that they disable cookies and scripting network-wide. Luckly, wtf-forms was able to address one of these issues with server-side validation of form input. However, I'm getting hung up on the login system. I've imple...
Possible to make flask login system which doesn't use client-side session/cookie?
21,947,780
1
4
1,749
0
python,session,flask,flask-login
With such restrictions as not having zero client side data, you could pass a session token in the GET parameters of every link rendered in the html page. Or you could create only POST views with a hidden token input (may be more secure indeed).
0
0
0
0
2014-02-22T00:11:00.000
4
0.049958
false
21,947,723
0
0
1
2
I'm working on a Flask app to be used by a medical client. Their IT dept is so up tight about security that they disable cookies and scripting network-wide. Luckly, wtf-forms was able to address one of these issues with server-side validation of form input. However, I'm getting hung up on the login system. I've imple...
Error 404 when trying to access a Django app installed in a subdomain
21,969,799
0
0
718
0
python,django,.htaccess,subdomain,virtualenv
The issue was solved by contacting the support service and asking them to open the port 8000 for me.
0
1
0
0
2014-02-23T00:15:00.000
2
1.2
true
21,962,475
0
0
1
1
I just installed Django and create a project and an app following the basic tutorial part 1, I created a virtualenv since centOS default python version is 2.4.3, I also created a subdomain to work on this for the development phase. when I try to access like dev.domain.com/admin/ or dev.domain.com/ I get a 404 error, it...
Python based asynchronous workflow modules : What is difference between celery workflow and luigi workflow?
25,704,688
27
37
8,450
0
python,celery,luigi
Update: As Erik pointed, Celery is better choice for this case. Celery: What is Celery? Celery is a simple, flexible and reliable distributed system to process vast amounts of messages, while providing operations with the tools required to maintain such a system. Why use Celery? It is simple to use & has lots of featu...
0
1
0
0
2014-02-23T11:08:00.000
2
1.2
true
21,967,398
0
0
1
2
I am using django as a web framework. I need a workflow engine that can do synchronous as well as asynchronous(batch tasks) chain of tasks. I found celery and luigi as batch processing workflow. My first question is what is the difference between these two modules. Luigi allows us to rerun failed chain of task and onl...
Python based asynchronous workflow modules : What is difference between celery workflow and luigi workflow?
34,112,320
45
37
8,450
0
python,celery,luigi
(I'm the author of Luigi) Luigi is not meant for synchronous low-latency framework. It's meant for large batch processes that run for hours or days. So I think for your use case, Celery might actually be slightly better
0
1
0
0
2014-02-23T11:08:00.000
2
1
false
21,967,398
0
0
1
2
I am using django as a web framework. I need a workflow engine that can do synchronous as well as asynchronous(batch tasks) chain of tasks. I found celery and luigi as batch processing workflow. My first question is what is the difference between these two modules. Luigi allows us to rerun failed chain of task and onl...
PyCharm include and modify External library in project
27,070,676
2
13
15,029
0
python,django,python-2.7,ide,pycharm
Another option would be to place libraries into separate project (or go even further and place each library in its own project) and then open this project/these projects side-by-side with the main project. This way you have clear separation between the main project and libraries used. This comes handy when you work on ...
0
0
0
0
2014-02-23T16:12:00.000
2
0.197375
false
21,970,771
1
0
1
1
I have an issue where I am developing a Django project which includes other libraries we are also developing. My current structure is as follows: Main Project App1 App2 Libraries Library 1 Library 2 All libraries have their own setup scripts and are in separate git repositories, and we are adding them in P...
Django Error: OperationalError: no such table: polls_poll
23,184,956
11
5
13,012
1
python,django,shell,sqlite
I meet the same problem today and fix it I think you miss some command in tutorial 1 just do follow: ./python manage.py makemigrations polls python manage.py sql polls ./python manage.py syncdb then fix it and gain the table polls and you can see the table created you should read the "manage.py makemigrations" command
0
0
0
0
2014-02-23T23:49:00.000
4
1.2
true
21,976,383
0
0
1
1
Going through Django tutorial 1 using Python 2.7 and can't seem to resolve this error: OperationalError: no such table: polls_poll This happens the moment I enter Poll.objects.all() into the shell. Things I've already tried based on research through the net: 1) Ensured that 'polls' is listed under INSTALLED_APPS in set...
Global leaderboard in Google App Engine
21,979,231
0
3
930
0
python,google-app-engine,cron,leaderboard
Whether this is simpler or not is debatable. I have assumed that ranking is not just a matter of ordering an accumulation of points, in which case thats just a simple query. I ranking involves other factors rather than just current score. I would consider writing out an Event record for each update of points for a ...
0
1
0
0
2014-02-24T04:43:00.000
3
0
false
21,979,038
0
0
1
2
I want to build a backend for a mobile game that includes a "real-time" global leaderboard for all players, for events that last a certain number of days, using Google App Engine (Python). A typical usage would be as follows: - User starts and finishes a combat, acquiring points (2-5 mins for a combat) - Points are acc...
Global leaderboard in Google App Engine
21,980,623
2
3
930
0
python,google-app-engine,cron,leaderboard
You don't need 50,000 reads or 50,000 writes. The solution is to set a sorting order on your points property. Every time you update it, the datastore will update its order automatically, which means that you don't need a rank property in addition to the points property. And you don't need a cron job, accordingly. Then,...
0
1
0
0
2014-02-24T04:43:00.000
3
1.2
true
21,979,038
0
0
1
2
I want to build a backend for a mobile game that includes a "real-time" global leaderboard for all players, for events that last a certain number of days, using Google App Engine (Python). A typical usage would be as follows: - User starts and finishes a combat, acquiring points (2-5 mins for a combat) - Points are acc...
How to make a task start right after another one finish in google app engine?
21,981,710
0
1
159
0
python,google-app-engine,task
It seems impossible to guarantee that B will be next.
0
1
0
0
2014-02-24T07:25:00.000
2
0
false
21,981,387
0
0
1
2
On taskqueue in gae. For example, I have task A, B. How to ensure that task B starts right after task A finishes. There could be other tasks, like C, to fix this problem. Also, 'right after' could be loose to 'after'. How about a dedicate queue with max_current_requests set to 1?
How to make a task start right after another one finish in google app engine?
21,982,975
2
1
159
0
python,google-app-engine,task
If you only have two tasks, you can start task B at the end of task A. For example, a task that updates user scores can start a task to send emails after it finished updating scores. In this case, you are guaranteed that task B is executed after task A, but there is no guarantee that there is no task C in between them ...
0
1
0
0
2014-02-24T07:25:00.000
2
0.197375
false
21,981,387
0
0
1
2
On taskqueue in gae. For example, I have task A, B. How to ensure that task B starts right after task A finishes. There could be other tasks, like C, to fix this problem. Also, 'right after' could be loose to 'after'. How about a dedicate queue with max_current_requests set to 1?
How to create a filter which compares only month in date type in OpenERP?
21,987,900
3
0
670
0
python,openerp,openerp-7
you can write a stored functional integer field on hr.employee with a function returning the month as integer. then you can use this field for filters.
0
0
0
0
2014-02-24T11:17:00.000
1
1.2
true
21,986,203
0
0
1
1
In HR module, in Employee form, I want to create a filter which gives me list of all employees whose birthday's appear in current month. Currently I am trying with static month, as below - but gives me error. [('birthday.month','=','02')] Error: File "/usr/lib/pymodules/python2.7/openerp/osv/expression.py", line 107...
OAuth fails after deploying google glass application
22,016,838
0
0
48
0
python,google-glass
A couple of things that are standard debugging practices, and you may want to update the original question to clarify: Did OAuth actually fail? What information do you have that it failed? Can you verify from web server logs that the callback URL was hit and that it contained non-error return values? Can you check you...
0
0
1
0
2014-02-24T13:02:00.000
1
0
false
21,988,618
0
0
1
1
I went through the instructions on for the Google Glass Python Quick Start. I deployed the app and the app supposedly finished deploying successfully. I then went to the main URL for the app and attempted to open the page. The page asked me which Google Account I wanted to use to access the app, and I chose one. It wen...
Running the same spider simultaniously
22,020,164
0
1
79
0
python,python-2.7,scrapy
The only application I see for running at the same time multiple instances of a spider is when each instance will have it's own part of start_urls. But each instance should be run on a different network interface, otherwise you cannot control effectively crawling intensity for the same domain.
0
0
0
0
2014-02-24T20:37:00.000
1
0
false
21,998,474
1
0
1
1
I am using scrapy 0.20 with python 2.7 I want to ask, what is the cons and pros of running the same spider twice in the same time? Please know that I am using a pipeline in order to write the results to a json file. Thanks
A Few questions on writing a RESTful web service
22,004,122
1
0
81
0
python,web-services,api,rest,amazon-web-services
A bit broad really especially the Python part. Yes this can be considered a API. Think of SOAP and REST services as an API available via the network. This question is opinion based and not suited for discussion here. A guideline is that if it works for you it is good. Yes you should use the REST services for the webs...
0
0
1
0
2014-02-24T22:55:00.000
2
0.099668
false
22,000,918
0
0
1
1
I just decided to start working on a mobile application for fun, but it will require a back-end. So I created an EC2 instance on Amazon Web Services, with an Amazon Linux AMI installed. I also have set up an database instance as well, and inserted some dummy data in there. Now, the next step I want to take is to wri...
backing up data from app engine datastore as spreadsheet or csv
22,031,727
0
0
163
0
python,google-app-engine,google-cloud-datastore,app-engine-ndb
You need to take a look at the google spreadsheets api, google it, try it, come back when something specific doesnt work. Also consider using google forms instead which already do what you want (save responses to a spreadsheet)
0
1
0
0
2014-02-24T23:42:00.000
1
0
false
22,001,578
0
0
1
1
I am making a survay website on google app engine using Python. For saving the survey form data i am using NDB Datastore. After the survey I have to import it as spreadsheet or CSV. How can i do that. Thanks.
how to do authentication of rest api from javascript, if javascript is on third party site?
25,426,295
0
1
117
0
javascript,jquery,python,api
It all depends on what you're authenticating. If you're authenticating each user that uses your API, you have to do something like the following: Your site has to somehow drop a cookie in that user's browser, Your API needs to support CORS (we use easyXDM.js), somehow upon logging in to their site, their site needs t...
0
0
1
0
2014-02-25T11:59:00.000
1
0
false
22,013,532
0
0
1
1
I have a javascript placed on third party site and this js makes API calls to my server. JS is publicly available and third party cannot save credentials in JS. I want to authenticate API calls before sharing JSON and also want to rate limit. Any one has ideas on how can i authenticate API?
Django - listening to rabbitmq, in a synchronized way. without celery. in the same process of the web bound django
32,414,239
2
2
1,008
0
python,django,rabbitmq
If anyone else bumps into this problem: The solution is using a RabbitMQ consumer from a different process (But in the same Django codebase) then Django (Not the running through wsgi, etc. you have to start it by it self) The consumer, connects to the appropriate rabbitmq queues and writes the data into the Django mode...
0
1
0
0
2014-02-25T15:30:00.000
1
0.379949
false
22,018,798
0
0
1
1
I need to implement a quite simple Django server that server some http requests and listens to a rabbitmq message queue that streams information into the Django app (that should be written to the db). the data must be written to the db in a synchronized order , So I can't use the obvious celery/rabbit configuration. I...
Best way to build a custom Django CMS
22,035,806
0
1
2,589
0
python,django,content-management-system,django-cms
django CMS is a CMS on top of django. It supports multiple languages really well and plays nice together with your own django apps. The basic idea is that you define placeholders in your template and then are able to fill those placeholders with content plugins. A content plugin can be a anything from text, picture, tw...
0
0
0
0
2014-02-26T02:47:00.000
2
0
false
22,030,696
0
0
1
1
I am new to Django, but heard it was promising when attempting to create a a custom CMS. I am looking to get started, but their seems to be a lack of documentation, tutorials, etc on how to actually get something like this going. I am curious if their are any books/tutorials/guides that can help me get started with CM...
Achieving django url-like functionality using resource_name in tastypie
22,069,707
1
0
158
0
python,django,tastypie
Although I'm not sure that the approach of using the resource_name with slashes will always work for you, in order to resolve your issue you can simply change the order of the URL registration. When register the urls, register the resource with the name "library/books" last. The reason that you have the issue is that "...
0
0
0
0
2014-02-26T15:38:00.000
1
0.197375
false
22,046,149
0
0
1
1
Is there a way to create a hierarchy of resources in tastypie using resource_name that will behave like regular django urls? I'm aiming to have tastypie urls that look like this: <app_name>/<module_name>/<functionality>, but I'm having trouble. I've created resources with the following resource_name: library/books l...
Using Django without templates?
22,055,844
2
0
1,483
0
python,django,django-templates
If you are making a web app, I'd say you need templates. Any other solution would be a mess. However, django templates have been known to not scale well because rendering them is relatively slow compared to other solutions like jinja2. There are several apps that integrate jinja2 into django. There's also been a lot o...
0
0
0
0
2014-02-26T23:03:00.000
1
0.379949
false
22,055,432
0
0
1
1
Forgive my knowledge on django, although I was briefly talking with a developer from Google whom I had met and he stated something confusing to me. He mentioned something that I hadn't really gotten a chance to ask him more about. He told me to be careful with django templates because in terms of scale, they can cause ...
How to re-architect a portal for creating mobile app
22,103,027
0
0
183
0
python,django,angularjs,heroku,architecture
What you guys think about architecture? This is a common Service Oriented Architecture with decoupled Clients. You just have REST endpoints on your backend, and any Client can consume those endpoints. You should also think about: Do you need RESTful service (RESTful == stateless, will you store any state on the serve...
0
0
0
0
2014-02-27T11:54:00.000
2
0
false
22,067,766
0
0
1
1
Currently I am working on a portal which is exposed to end users. This portal is developed using Python 2.7, Django 1.6 and MySQL. Now we want to expose this portal as a mobile app. But current design does not support that as templates, views and database are tightly coupled with each other. So we decided to re-archit...
Multiple storage engines for django media: prefer local, fallback to CDN
22,083,369
1
3
675
0
python,django,rackspace,mezzanine
The best way is to have this working, is to have a different web server serving all of your media (I used nginx). Then you setup a load balancer to detect failure and redirect all the requests to CDN in case of a failure. One thing that you might have to figure out is the image path.(use HAProxy to rewrite the request...
0
1
0
0
2014-02-27T22:31:00.000
2
0.099668
false
22,082,005
0
0
1
1
I have a django/mezzanine/django-cumulus project that uses the rackspace cloudfiles CDN for media storage. I would like to automatically serve all static files from the local MEDIA_ROOT, if they exist, and only fallback to the CDN URL if they do not. One possible approach is to manage the fallback at the template level...
Retrieving product list form openerp 7
22,103,548
0
0
273
0
python,openerp
Working through XML-RPC is pretty much like working directly on the server, only slower. To get the product list you'll need to interact wit product.product, and to narrow the list (and the data) you'll need to specify a domain such as domain=[('color','=','red'),('style','=','sport')] and fields=['id','name','...']. H...
0
0
0
0
2014-02-28T17:26:00.000
1
1.2
true
22,101,857
0
0
1
1
I'm currently working on a mobile app that connects with an openerp 7 instance though XML-RPC. Although xmlrpc comm between iOS & Openerp 7 works perfectly, I'm puzzled at which objects I need to interact with at the openerp side in order to get the product list with only the items I want and to post a sale. Any one? T...
Selenium phantomjs (python) not redirecting to welcome page after login, page is load dynamically using dojo
22,103,574
0
2
633
0
python,selenium,phantomjs
I just discovered that my problem was with a elem.send_keys(Keys.ENTER) line. Phantomjs seems to be very fast so I had to put a time.sleep of 2 seconds before that line, and now the script works fine. What happened is that Enter button for login wasn't clicked properly. Of course time.sleep(2) isn't the best way to sol...
0
0
1
0
2014-02-28T17:51:00.000
1
1.2
true
22,102,352
0
0
1
1
I was trying to log into a website that is loaded fuly dinamically using dojo.js scripts. On my tests I am using: Selenium 2.40 Phantomjs 1.9.7 (downloaded via npm) Ubuntu 12.04 When I try my script with: driver = webdriver.Firefox() Everything works fine, Firefox logins through login page /login.do, gets through aut...
How to debug a django application in a comfortable way?
22,116,486
0
0
91
0
python,django,debugging
To make your life easier, try IDE like PyCharm. I use pdb or ipdb to debug simple python file, but they wouldn't be so useful in debugging complex Python scripts. Also, django-debug-tools is a good tool to debug and optimize Django application.
0
0
0
0
2014-03-01T13:26:00.000
2
0
false
22,114,984
0
0
1
1
I'm currently debugging a django application by inserting import pdb; pdb.set_trace() in the code and using the debugger commands to navigate through running application. The debugger shows the current line, but most of the time it is helpful to have a bit more context. Therefore I open the current file in an editor in...
Using RabbitMQ with Django to get information from internal servers
22,125,431
0
4
3,991
0
python,linux,django,sockets
You need the following two programs running at all times: The producer, which will populate the queue. This is the program that will collect the various messages and then post them on the queue. The consumer, which will process messages from the queue. This consumer's job is to read the message and do something with i...
0
0
0
0
2014-03-01T22:42:00.000
3
0
false
22,121,368
0
0
1
1
I've been trying to make a decision about my student project before going further. The main idea is get disk usage data, active linux user data, and so on from multiple internal server and publish them with Django. Before I came to RabbitMQ I was thinking about developing a client application for each linux server and...
Should I use an ORM like SQLAlchemy for a lightweight Flask web service?
22,128,680
1
0
941
1
python,sqlalchemy,flask,flask-sqlalchemy
SQL Alchemy is generally not faster (esp. as it uses those driver to connect). However, SQL Alchemy will help you structure your data in a sensible way and help keep the data consistent. Will also make it easier for you to migrate to a different db if needed.
0
0
0
0
2014-03-02T13:49:00.000
2
0.099668
false
22,128,419
0
0
1
2
I'd rather just use raw MySQL, but I'm wondering if I'm missing something besides security concerns. Does SQLAlchemy or another ORM handle scaling any better than just using pymysql or MySQLdb?
Should I use an ORM like SQLAlchemy for a lightweight Flask web service?
22,134,840
1
0
941
1
python,sqlalchemy,flask,flask-sqlalchemy
Your question is too open to anyone guarantee SQLAlchemy is not a good fit, but SQLAlchemy probably will never be your problem to handle scalability. You'll have to handle almost the same problems with or without SQLAlchemy. Of course SQLAlchemy has some performance impact, it is a layer above the database driver, but ...
0
0
0
0
2014-03-02T13:49:00.000
2
1.2
true
22,128,419
0
0
1
2
I'd rather just use raw MySQL, but I'm wondering if I'm missing something besides security concerns. Does SQLAlchemy or another ORM handle scaling any better than just using pymysql or MySQLdb?
user upload to my S3 bucket
22,162,436
0
0
141
1
python,file-upload,amazon-web-services,amazon-s3
This answer is relevant to .Net as language. We had such requirement, where we had created an executable. The executable internally called a web method, which validated the app authenticated to upload files to AWS S3 or NOT. You can do this using a web browser too, but I would not suggest this, if you are targeting big...
0
0
0
0
2014-03-04T00:59:00.000
2
0
false
22,160,820
0
0
1
1
I would like for a user, without having to have an Amazon account, to be able to upload mutli-gigabyte files to an S3 bucket of mine. How can I go about this? I want to enable a user to do this by giving them a key or perhaps through an upload form rather than making a bucket world-writeable obviously. I'd prefer to ...
Permission to get the source code using spider
22,165,257
0
1
43
0
python,web-scraping
robots.txt file does have limits. Its better to inform the owner of the site if you are crawling too often and read reserved rights at the bottom of the site. It is a good idea to provide a link, to the source of your content.
0
0
1
0
2014-03-04T07:01:00.000
1
1.2
true
22,165,086
0
0
1
1
I am working on creating a web spider in python. Do i have to worry about permissions from any sites for scanning there content? If so, how do i get those? Thanks in advance
Saving user's social auth name using python social auth in django
22,521,700
2
3
1,254
0
django,python-social-auth
remove SOCIAL_AUTH_USER_MODEL because you are using Django Default User model.
0
0
0
0
2014-03-04T07:41:00.000
1
0.379949
false
22,165,792
0
0
1
1
I work on django project that migrate from django social auth to python social auth. Previously new social auth user first name/last name will be saved automatically for first time login. Now after using python social auth, it's not. Seems I have to use this setting: SOCIAL_AUTH_USER_MODEL but SOCIAL_AUTH_USER_MODEL ...
Setting an attribute on object's __class__ attribute
22,169,632
3
1
83
0
python,django
Yes, that is setting the attribute on the class. But no, that would not necessarily make it available between requests, although it might. Your question shows a misunderstanding of how Django requests work. Django is not necessarily served using multiple threads: in fact, in most server configuration, it is hosted by m...
0
0
0
0
2014-03-04T10:30:00.000
2
1.2
true
22,169,372
1
0
1
1
I am a bit confused over the difference between setting an object's attribute and setting an attribute on an object's __class__ attribute. Roughly, obj.attr vs obj.__class__.attr. What's the difference between them? Is the former setting an attribute on an instance and the latter setting an attribute on an instance's c...
Traversing back to parent with lxml.html.xpath
22,177,986
2
2
405
0
python,lxml,lxml.html
This will select the parent element of the XPath expression you gave: //*[@id="titleStoryLine"]/div/h4[text()="Genres:"]/..
0
0
1
0
2014-03-04T16:45:00.000
2
1.2
true
22,177,872
0
0
1
1
How can we traverse back to parent in xpath? I am crawling IMDB, to obtain genre of films, I am using elem = hxs.xpath('//*[@id="titleStoryLine"]/div/h4[text()="Genres:"]') Now,the genres are listed as anchor links, which are siblings to this tag. how can this be achieved?
Check time since last request
22,181,923
0
0
76
1
python
I asked about a soft button earlier. If your computer program is password/access protected you could just store it all in a pickle/config file somewhere, I am unsure what the value of the sql file is: use last_push = time.time() and check the difference to current push if seconds difference less than x do not progress,...
0
0
0
1
2014-03-04T17:13:00.000
2
0
false
22,178,513
0
0
1
2
I've a bit of code that involves sending an e-mail out to my housemates when it's time to top up the gas meter. This is done by pressing a button and picking whoever's next from the database and sending an email. This is open to a lot of abuse as you can just press the button 40 times and send 40 emails. My plan was to...
Check time since last request
22,179,026
0
0
76
1
python
If this is the easiest solution for you to implement, go right ahead. Worst case scenario, it's too slow to be practical and you'll need to find a better way. Any other scenario, it's good enough and you can forget about it. Honestly, it'll almost certainly be efficient enough to serve your purposes. The number of user...
0
0
0
1
2014-03-04T17:13:00.000
2
0
false
22,178,513
0
0
1
2
I've a bit of code that involves sending an e-mail out to my housemates when it's time to top up the gas meter. This is done by pressing a button and picking whoever's next from the database and sending an email. This is open to a lot of abuse as you can just press the button 40 times and send 40 emails. My plan was to...
Using php inside python code ,google app engine
22,183,262
2
1
361
0
php,google-app-engine,python-2.7
Those runtimes (Py, PHP, Java. etc.) are isolated from each other and are tightly sandboxed. So when you deploy a Python app, for example, it doesn't have access to the PHP or Java runtime. So, it's not possible to run PHP inside a python sandbox, at least not in the appengine platform.
0
1
0
1
2014-03-04T20:05:00.000
2
0.197375
false
22,181,860
0
0
1
1
I have a project that already written in php, and now i am using python in google app engine, actually i want to use the api that google support for python, for example : datastore, blobstore ... and also to save my time to re write the code again in python ! so, is it possible to run php script in python code ?
iPython notebook Websocket connection cannot be established
26,615,734
0
6
832
0
websocket,ipython,ipython-notebook
Try reinstalling your iPython server or creating a new profile for the server
0
0
1
0
2014-03-05T00:24:00.000
1
0
false
22,186,057
0
0
1
1
iPython was working fine until a few hours ago when I had to do a hard shutdown because I was not able to interrupt my kernel. Now opening any notebook gives me the following error: "WebSocket connection to could not be established. You will NOT be able to run code. Check your network connection or notebook server con...
Celery worker-offline event not generated
22,226,475
0
1
150
0
python,celery
After a bit of research, I ended up answering my own question: it was a bug which has been fixed in the later versions of celery.
0
1
0
0
2014-03-05T22:55:00.000
1
0
false
22,211,193
0
0
1
1
I am trying to capture the worker-related events, but there is something weird going on in my application: all the task events are being generated and captured and the worker events as well, except for worker-offline event. Is there any specific setting that I need to make for this event to be generated? I am using Cel...
Django CMS migrate pages
29,132,323
0
1
589
0
python,django,django-cms
This is what works for me: ./manage.py dumpdata cms.page cms.title > pages.json
0
0
0
0
2014-03-06T00:01:00.000
2
0
false
22,212,114
0
0
1
1
On my local machine I'm building a Django CMS site. I have about 50 CMS pages with page titles, custom slugs, and data. How do I dump just the CMS pages data on my local machine and load it into my staging environment? I've tried using a fixture with python manage.py dumpdata cms.page --indent=2 > cmspages.json, howeve...
UI Designed in Photoshop for Software
22,215,461
2
0
1,055
0
java,python,user-interface,photoshop
but how do I take what I made in Photoshop add some java or python code to it to make certain things happen No, you cannot expect things to happen magically, for that you need to learn front-end technologies like HTML, CSS, JavaScript etc and manually convert the UI which is in Photoshop to corresponding code. This ap...
1
0
0
0
2014-03-06T04:57:00.000
2
0.197375
false
22,215,361
0
0
1
1
so I am actually trying to get into software development and I currently have just spent a few days making a GUI in Photoshop. Now I know how to code in Java and Python but I have never implemented a GUI before. I am stuck on this because I know I can write the code and everything but how do I take what I made in Photo...
Using Sphinx within a project using several programming languages
22,318,733
0
2
1,026
0
documentation,python-sphinx,documentation-generation,autodoc
The best way to combine different languages in one Sphinx project is to write docs without autodoc or other means of automatic generation. For the most part they are available only for Python and even if some extension out there does allow other languages, you will be buried under different workflows before you even no...
0
0
0
0
2014-03-06T21:05:00.000
1
0
false
22,235,952
1
0
1
1
the project I am working on ship a package that contains API for different languages: Java, Python, C#, and others. All these APIs shared mostly the same documentation. The documentation should be available in PDF and HTML separately on our website. The user usually download/browse the one it is interested in. Currentl...
Django Deployment on Linux Ubuntu
22,241,285
0
0
117
0
python,linux,django,ubuntu,django-deployment
Here is my stack: Nignx + gunicon, Supervisor Deployment, If you are planing frequent releases you should be looking at something like Fabric. Even of not frequent Fabric is a very good tool to be aware of. People have preference in terms of stack, but this one has been working great for me.
0
1
0
0
2014-03-07T03:46:00.000
1
1.2
true
22,241,028
0
0
1
1
I am going to seploy my first Django application to a cloud server like Amazon EC2 and the system is Linux Ubuntu. But I cannot find a very good step-by-step tutorial for the deployment. Could you recommend one? And I also have the following questions: What is the most recommended environment? Gunicorn, Apache+mod_pyt...
Pyramid self.request.POST is empty - no post data available
22,251,970
2
1
1,795
0
python,forms,http-post,pyramid
I've managed to get it working. Silly me, coming from an ASP.NET background forgot the basics of POST form submissions, and that's each form field needs a name== attribute. As soon as I put them in, everything started working.
0
0
0
0
2014-03-07T06:32:00.000
3
0.132549
false
22,243,208
0
0
1
1
I'm currently working on a pyramid project, however I can't seem to submit POST data to the app from a form. I've created a basic form such as: <form method="post" role="form" action="/account/register"> <div class="form-group"> <label for="email">Email address:</label> <input type="email" c...
ZeroMQ is too fast for database transaction
22,247,025
0
1
2,062
1
python,postgresql,sqlalchemy,zeromq
This comes close to your second solution: Create a buffer, drop the ids from your zeromq messages in there and let you worker poll regularly this id-pool. If it fails retrieving an object for the id from the database, let the id sit in the pool until the next poll, else remove the id from the pool. You have to deal som...
0
0
0
1
2014-03-07T08:48:00.000
2
0
false
22,245,407
0
0
1
1
Inside an web application ( Pyramid ) I create certain objects on POST which need some work done on them ( mainly fetching something from the web ). These objects are persisted to a PostgreSQL database with the help of SQLAlchemy. Since these tasks can take a while it is not done inside the request handler but rather o...
Is there a way to use Mako templates for plain-text files where newlines matter?
27,262,018
4
2
855
0
python,template-engine,mako,plaintext
If you add a backslash at the end of the line like this: "<% %>\", you can suppress the newline.
0
0
0
1
2014-03-07T15:49:00.000
1
0.664037
false
22,254,612
0
0
1
1
In an existing application we are using Mako templates (unfortunately..). That works ok for HTML output since newlines do not matter. However, we now need to generate a text/plain email using a template - so any newlines introduced by control statements are not acceptable. Does Mako provide any options to make statemen...
Right way to manage a high traffic connection application
22,409,012
1
0
270
1
python,database,postgresql,gps,twisted
Databases do not just lose data willy-nilly. Not losing data is pretty much number one in their job description. If it seems to be losing data, you must be misusing transactions in your application. Figure out what you are doing wrong and fix it. Making and breaking a connection between your app and pgbouncer for each...
0
0
0
0
2014-03-07T17:28:00.000
1
1.2
true
22,256,760
0
0
1
1
Introduction I am working on a GPS Listener, this is a service build on twisted python, this app receive at least 100 connections from gps devices, and it is working without issues, each GPS send data each 5 seconds, containing positions. ( the next week must be at least 200 gps devices connected ) Database I am using ...
Duplicate App to an already existing ID on Google app engine
22,264,642
0
0
104
0
python,google-app-engine,blogs
You say you already used that id before. If you havent deleted that app just use that one to load your new code there. You will need to delete existing datastore data etc.
0
1
0
0
2014-03-07T23:04:00.000
2
0
false
22,262,420
0
0
1
1
I made a blog in Python and I am running it off of Google App Engine. When I started, I put a random ID, just because I was experimenting. Lately, my blog got a bit popular and I wanted to change the ID. I wanted to duplicate my app, but the problem is that I already registered that ID a while ago with google. How can...
Real time output of script on web page using mod_wsgi
22,933,666
1
1
406
0
python,web,mod-wsgi
You'll need JavaScript to do this Possibility 1, data generated by server - Make a static HTML page with an empty div. - Place a piece of Javascript code onto it that is run after the page is loaded. - The JavaScript will contain a timer that downloads the output of your script say every 5 seconds, using AJAX ands sets...
0
0
0
1
2014-03-08T11:53:00.000
1
0.197375
false
22,268,968
0
0
1
1
I have a Python application that I launch from a form using mod_wsgi. I would like to display in real time the output of the script, while it is running, to a web page. Does anybody know how I can do this?
Add field to existing django app in production environment
22,275,172
3
2
215
0
python,django,django-south,database-migration
first is to fake the initial migration: python manage.py migrate [yourapp] --fake 0001 then you can apply the migration to the db python manage.py migrate [yourapp] I'm assuming you ran convert_to_south on development, in which case production still wouldn't be aware of the migrations yet. convert_to_south automatica...
0
0
0
0
2014-03-08T21:05:00.000
1
1.2
true
22,275,083
0
0
1
1
I have an existing django app and would like to add a field to a model. But because the website is already in production, just deleting the database is not an option any more. These are the steps I took: pip install south added 'south' to INSTALLED_APPS python manage.py syncdb python manage.py convert_to_south [myapp]...
User session object is not available on POST in django?
22,282,298
0
0
123
0
python,django,forms,session
The user is never in request.session. It's directly on the request object as request.user.
0
0
0
0
2014-03-09T12:39:00.000
2
1.2
true
22,282,264
0
0
1
1
I have a form where users are submitting data. One of the fields is "author" which i automatically fill in by using the {{ user }} variable in the template, it will have the username if the user is logged in and AnonymousUser if not. This {{ user }} is not part of the form, just text. When a user submits the form i nee...
Restrict employees access to suppliers in OpenERP 7
22,312,919
0
0
296
0
python,openerp,openerp-7
You can't restrict all access to the partners table (contains suppliers and customers) as the system will probably not work at all. As of OpenERP 7, res.partners also contains contacts and each user has a contact so if you block all access you will probably break a lot of things (YMMV). You may be able to get away wi...
0
0
0
0
2014-03-09T15:19:00.000
2
0
false
22,284,018
0
0
1
2
Can anyone help me to restrict employees from accessing the suppliers and also restrict them from the notes of customers in OpenERP 7. I am trying to setup a Contact Centre platform using OpenERP 7, where i can have Service Requests. Thanks in Advance
Restrict employees access to suppliers in OpenERP 7
26,007,374
0
0
296
0
python,openerp,openerp-7
You could create a rule on the Partner object for your employee group - [('customer','=',True)] - that way only customers are shown, i.e. only those suppliers will be shown who are also customers. You could then also take away the Suppliers menu for the cosmetics.
0
0
0
0
2014-03-09T15:19:00.000
2
0
false
22,284,018
0
0
1
2
Can anyone help me to restrict employees from accessing the suppliers and also restrict them from the notes of customers in OpenERP 7. I am trying to setup a Contact Centre platform using OpenERP 7, where i can have Service Requests. Thanks in Advance
NDB validator argument vs extending base property classes
22,288,117
-1
0
138
0
python,google-app-engine,python-2.7,app-engine-ndb
It depends. Are the restrictions one-off or is any particular restriction going to be reused in many different fields/models? For one-off restrictions, the validator argument is simpler and involves less boilerplate. For reuse, subclassing lets you avoid having to repeatedly specify the validator argument.
0
1
0
0
2014-03-09T20:55:00.000
1
1.2
true
22,288,044
0
0
1
1
I'm using AppEngine NDB properties and I wonder what would be the best approach to: limit StringProperty to be not longer than 100 characters apply regexp validation to StringProperty prohibit IntegerProperty to be less than 0 Would it be best to use the validator argument or to subclass base ndb properties?
Why is "django.core.context_processors.request" not enabled by default?
22,292,916
1
5
160
0
python,django,django-1.6
This is a good question. The docs say Note that this processor is not enabled by default; you’ll have to activate it. but no explanation. My take on it is due to django's intense desire to separate view logic from the template. The request object is the gateway to all data that view logic is built from (given what the ...
0
0
0
0
2014-03-10T05:03:00.000
1
1.2
true
22,292,424
0
0
1
1
I was troubleshooting a problem with obtaining the request obj with a new project and realized "django.core.context_processors.request" was commented in vanilla installs of Django. Like the title suggests, why would this seemingly helpful context processor be turned off by default? Is it an issue with performance? I...
How can I upload a static HTML to templates folder of GAE app?
22,304,153
0
0
60
0
java,python,google-app-engine
No you cant if you want to store them in static storage. You can store them somewhere non-static but you will lose the many advantages of having it as static content.
0
1
0
0
2014-03-10T14:07:00.000
1
0
false
22,302,439
0
0
1
1
Can I upload a static HTML file to templates folder without re-deploying the app? Offline I create an HTML file which I want to upload to my Google app engine app,which displays the HTML as per URLs. But I don't want to deploy my site every time I am uploading a new file. Any suggestion would be helpful.
Encoding user input to be stored in MongoDB
22,315,740
4
7
2,232
1
javascript,python,ajax,mongodb,unicode
Does this need to be escaped to "&lt;script&gt;alert(&#x27;hi&#x27;);&lt;&#x2F;script&gt;" before sending it to the server? No, it has to be escaped like that just before it ends up in an HTML page - step (5) above. The right type of escaping has to be applied when text is injected into a new surrounding context. That...
0
0
0
0
2014-03-10T22:12:00.000
2
1.2
true
22,312,452
1
0
1
1
I'm trying to determine the best practices for storing and displaying user input in MongoDB. Obviously, in SQL databases, all user input needs to be encoded to prevent injection attacks. However, my understanding is that with MongoDB we need to be more worried about XSS attacks, so does user input need to be encoded on...
Djangorestframework: is it possible to deserialize only specific fields of incoming JSON?
22,322,831
1
1
61
0
python,json,django,django-rest-framework
You need to look into using the required=False flag on the device field in your serializer class.
0
0
0
0
2014-03-11T02:32:00.000
1
1.2
true
22,315,311
0
0
1
1
I need to deserialize incoming JSON. The incoming JSON will be transformed to a Django model object called AdvancedUser. An AdvancedUser has a one to one with a Device model. When I POST my incoming JSON, I'm getting errors that say "Device field is required". The Device field is optional in my AdvancedUser model...
Django app - importing module issues
22,335,116
1
0
62
0
python,django,module
Your "Mod" folder appears to be missing a "init.py" which it will need if you want to import from it. I also don't recommend a capitalized folder in Python, kind of confusing. I'd also recommend you add "mod" to your python path so you're not having to do Mod.mod.module you can just do mod.module. I assume you have "...
0
0
0
0
2014-03-11T18:44:00.000
2
0.099668
false
22,333,873
0
0
1
1
I am on Django 1.6 with Python 2.7, getting an issue with importing some custom modules. On my views.py file, I have import Mod.mod.module.file, where the Mod folder is stored in the project directory, outside the folders with settings.py and views.py. The traceback gives me ImportError: No module named Mod.mod.module....
Storing song, artist and album data on App Engine
22,552,471
0
0
235
0
python,json,google-app-engine,app-engine-ndb
I would process the data from json, and place it in Model. As far as schema goes, you really need not worry about having redundancies as you cannot really think of the ndb as a relational database. So do not bother yourself too much about normalising the schema. But don't process on the client side, it is really not a ...
0
1
0
0
2014-03-11T22:27:00.000
2
0
false
22,338,014
0
0
1
1
I need to store information on artists, albums and songs in Google App Engine for a project I'm working on. The information is meta data taken from a directory of MP3s (using Python) that needs to be sent to App Engine for display to users. Along with the meta data, the song's path will need to be stored. Currently whi...
Get redirected to a div automatically without user's intervention
22,348,762
0
1
68
0
javascript,python,html
I am not going to search the code for you. But most sites tell you you need an onclick event because that is needed to open a link. And example.com#idOfDiv, is the kind of link you would open. Howerver, there is another possibility. Find some javascript code to decide the position of an element in x and y coordinats. A...
0
0
1
0
2014-03-12T10:25:00.000
2
0
false
22,348,501
0
0
1
1
I am new to JavaScript. The problem goes as follows: I have 10 div in my html file. I am using links to go from one to another. Now, I want to test a condition which if satisfied (I am using python for this), should redirect me to another div within the same html. But I want that to be automatic. For eg, I am in <div...
How can I share my website in progress to partner?
22,357,361
1
2
122
0
python,twitter-bootstrap,hosting
Well, then use your ubuntu system, forward the right ports in your router and give your customers a link to your IPadres. I assume you use your ubuntu system as an webserver already for testing your site?
0
0
0
0
2014-03-12T16:07:00.000
2
0.099668
false
22,357,298
0
0
1
1
I'm developing a website in python (with django and GIT) for an association, and I am to a point where I need to share my work for approval from the team. I have around 50 people who need to be able to access my "website" 24/7. Apparently, free hosting is not the best way to do it (see answers to my original question)....
can i serve PHP and python on a single project in app engine?
22,365,130
0
0
63
0
php,python,google-app-engine
You can (and many do) use a front-end like nginx or Apache that handles and forwards different paths differently. I do not see why you would want your application engine to be "bilingual" though.
0
1
0
1
2014-03-12T22:12:00.000
1
0
false
22,365,018
0
0
1
1
Can I serve PHP and python on a single project in app engine? for example /php/* will run php code, but the root / will run python code.
How to edit record in google datastore in AppEngine?
22,370,376
1
0
255
0
python,django,google-app-engine,gql
Fetch the record you want to edit (by key , id or any filter) , modify the field you want to edit and then put() it.
0
1
0
0
2014-03-13T04:56:00.000
1
1.2
true
22,369,384
0
0
1
1
I was create one app which have model and it was created but i facing problem how to edit data in google data store using python or Django. Please Help me.
What is a preferred way for installing Karma in Angular/Django project?
22,385,076
2
2
634
0
javascript,python,django,angularjs,karma-runner
I have found that you need to install a particular node module in a folder that encompasses all files that will use it. This is most easily accomplished by putting all node modules in the root folder of your website. This is by design of node's creator, though I'm not sure if he wants it that way or just does not want ...
0
0
0
0
2014-03-13T15:31:00.000
1
1.2
true
22,383,464
1
0
1
1
I am just starting on integrating AngularJS into my Django project. After I installed Karma for testing following the tutorial I got bunch of Node.js modules installed in my root project folder. Should I check all of this files from node_modules folder into my repo? Or should I ignore them with .gitignore? Are there al...
Where do I put the specific translation functions in Django App?
22,384,701
0
0
90
0
python,django
Try to move your app name up to admin app in your INSTALLED_APPS settings.py tuple.
0
0
0
0
2014-03-13T16:11:00.000
1
0
false
22,384,473
0
0
1
1
I have a Django project in which I have changed the default 'Django Administration' text in the header. Now I have implemented translation of strings that django knows about, but I cannot figure out how to translate this title. I put the translation function in models.py but it doesn't change when I change Language. I'...
can I run django test but with out model define?
22,408,947
0
2
113
0
python,django,django-models,django-fixtures
The answer to your top question is yes, you should be able to use the Django test framework pieces that don't depend on models. The answer to your inner question about using fixtures (which sounds like it may be the real question) is, not without writing some additional test code. Django uses fixtures to populate Djan...
0
0
0
0
2014-03-14T10:01:00.000
1
0
false
22,401,722
0
0
1
1
my problem is that. this is a old django project that I need to work on it. As unknown reason, the project don't use django model. Instead, it define some class to CRUD the database by pure sql. and the project has no tests at all. now, I want to add unittest for the project(views/models/and so on).but I wonder if this...
How to transfer html view data or (Python) server data to Angular or Javascript?
22,408,064
2
0
586
0
javascript,python,angularjs,google-app-engine,jinja2
Since you are already going to build an Angular app for the front-end, why not make the whole architecture RESTful? That way the front-end Angular app will be in charge of presentation and the server of just the data. You can pass data between the server and front-end through JSON which has the benefit of not needing t...
0
0
0
0
2014-03-14T11:58:00.000
2
0.197375
false
22,404,358
0
0
1
1
I am programming a small web app on GAE using python webapp2 framework. What I want to achieve is displaying server data to the html view through javascript or angularjs. Actually the app draws some graph using d3.js based on the server data. I know I can use $http.get to retrieve the data from server. But this way I n...
How do I fill a form in a web site that calls javascript code and retrieve the results from a different frame using python?
22,408,435
0
0
41
0
javascript,python,forms,web
Yea. Reverse engineer the javascript using the chrome/firefox console, see what request it makes and mimic them in python using urllib2 or the requests library.
0
0
1
0
2014-03-14T14:20:00.000
1
1.2
true
22,407,628
0
0
1
1
I'm going to have to code a program in python that retrieves results after filling a web form (which in turn calls different javascript functions), and those results appear in a different frame of the website. I considered using the Selenium web engine, but I was wondering if anyone has any better idea? Thank you Danie...
How to install package not in site-packages of virtualenv and put command in requirements.txt that will install this package from local dir?
22,425,918
1
0
275
0
python,django,pip,easy-install,django-oscar
This isn't really what pip was designed to do. You should post your version of django-oscar to github, then reference that in your pip requirements.txt Or if you don't want to have it hosted remote you might as well just include it in your project directory as you would a Django app you are making.
0
0
0
0
2014-03-14T17:37:00.000
1
1.2
true
22,412,053
1
0
1
1
I have some django packages like django-oscar. I need to install it with pip and then edit code & revise. I'm tried to install it through setup.py deploy and to make .egg-info. Then I understand that pip doesn't have feature to install packages through .egg-info. I also tried to install package from local directory u...
How to manipulate a local text file from an HTML page
22,413,574
0
0
994
0
javascript,python,html,flask
There is many ways to do this Here is the easiest 3 Use JavaScript 2 install wampserver or similar and use php o modify the file 3 don't use te browser to delete and instead use a bat file to open the browser and remove the link from the text file
0
0
1
0
2014-03-14T18:57:00.000
2
0
false
22,413,513
0
0
1
1
I've generated an HTML file that sits on my local disk, and which I can access through my browser. The HTML file is basically a list of links to external websites. The HTML file is generated from a local text file, which is itself a list of links to the remote sites. When I click on one of the links in the HTML documen...