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
Backup in one and restore in another Google App Engine application by using Cloud Storage?
34,706,288
4
8
961
1
python,google-app-engine
Yes!! What you are trying to do is not possible. The reason is that there are absolute references in the backup files to the original backup location (bucket). So moving the files to another GCS location will not work. Instead you have to leave the backup files in the original GCS bucket and give your new project read ...
0
1
0
0
2014-12-16T22:17:00.000
2
0.379949
false
27,514,985
0
0
1
2
My goal was to duplicate my Google App Engine application. I created new application, and upload all needed code from source application(python). Then I uploaded previously created backup files from the Cloud Storage of the source application (first I downloaded those files to PC and than uploaded files to GCS bucket ...
Backup in one and restore in another Google App Engine application by using Cloud Storage?
29,852,870
1
8
961
1
python,google-app-engine
Given the message, my guess is that the target application has no read access to the bucket where the backup is stores. Add the application to the permitted users to that bucket before creating the backup so that the backup objects will inherit the permission.
0
1
0
0
2014-12-16T22:17:00.000
2
0.099668
false
27,514,985
0
0
1
2
My goal was to duplicate my Google App Engine application. I created new application, and upload all needed code from source application(python). Then I uploaded previously created backup files from the Cloud Storage of the source application (first I downloaded those files to PC and than uploaded files to GCS bucket ...
Cherrypy session timeout on browser closed?
27,565,293
0
0
474
0
python,cherrypy
Set tools.sessions.persistent to False
0
0
1
0
2014-12-17T01:59:00.000
2
0
false
27,517,192
0
0
1
1
In cherrypy is there a configuration option so that sessions do not have a "timeout", or if they do, expire immediately when the browser is closed? Right now tools.sessions.on is true and tools.sessions.timeout is 60 minutes.
How to embed Bokeh server in Django application
27,520,156
10
13
5,749
0
python,django,bokeh
No need to reinvent. bokeh-server is a webserver and can listen on arbitrary port. you can have your django webserver listen on some other arbitrary port. ... and integrate the two: have redirects from django to bokeh-server, or webserver in front, e.g. nginx which does reverse-proxy.
0
0
0
0
2014-12-17T07:02:00.000
1
1
false
27,519,960
0
0
1
1
From what I read the dynamic and big data rendering capabilities of Bokeh are accessible by use of the bokeh-server. In Bokeh documentation there is a brief mention of embedding the bokeh-server in a Flask application using the blueprint api. This option retains all of the Bokeh's dynamic and big data rendering capabil...
Completion of App Engine Index Writes (Python)
27,540,122
1
1
45
0
python,google-app-engine,google-cloud-datastore
No, it is done asynchronously and you are not able to control this process. Hooks available only for by key gets, not for index queries. Try to build your datastore with parent-child relationships, so you can do ancestor queries, they are always consistent.
0
1
0
0
2014-12-17T10:13:00.000
1
1.2
true
27,523,124
0
0
1
1
Is there a way to know / detect if an object (after being put to the datastore) has been written to an index i.e. object would be visible in a relevant query? Maybe something like a hook method? Thanks!
Multiple Time Zones in Google Appengine Cron Job
27,530,878
3
0
571
0
python,google-app-engine,cron
You can schedule a cron job to run every hour, because every hour there is 9 am somewhere.
0
1
0
0
2014-12-17T15:19:00.000
1
0.53705
false
27,528,859
0
0
1
1
I want to schedule a task for 9:00 AM in every country. (basically 9:00 AM in every time zone). How can I schedule that in google appengine? Will it take multiple timezones for time zone parameter? Thanks in advance
Associate Existing Image File with Django Model
27,534,164
1
0
360
0
python,django,django-models,django-templates,django-admin
Well you have to save it somewhere in order to map the user and the image.... So I can think of 2 solutions - Have a field that stores the path. Then you can access it via the template, something like this - <img src="{{author.photo_path}}"> If you're saying the path might change, you can have a user ID for each user...
0
0
0
0
2014-12-17T20:16:00.000
1
1.2
true
27,534,078
0
0
1
1
I'm creating a basic blog in Django. One of my classes is for the authors. Each contains Name, Position, Biography, etc., and I'm attempting to associate existing images with each author to be used as avatars, essentially. FileField and ImageField aren't what I want to use as I already have images stored statically els...
Terminal/django/komodo edit
27,559,411
1
0
323
0
python,django,terminal,komodoedit
Let's start from the beginning: You are in your project folder eg /home/me/myproject You create a new virtualenv, eg virtualenv /home/me/virtualenvs/myprojectenv You activate the new virtualenv: source /home/me/virtualenvs/myprojectenv/bin/activate ...this means that python and pip commands now point to the versions i...
0
0
0
0
2014-12-19T03:32:00.000
1
1.2
true
27,559,330
1
0
1
1
I sincerely apologize for the noobish dribble thats about to come out here: Okay so I am following along with a youtube tutorial using terminal/django/komodo edit to make a simple website. This is my first time really using terminal, I am having issues. I have read up on the terminal and searched this site for my que...
Python MySQLdb with SELinux
27,734,160
0
8
1,090
1
python,django,mysql-python,selinux
Couple of permission issues that I notice: Make sure your credentials for mySQLdb have access to the database. If you are using IP and Port to connect to the database, try using localhost. Make sure the user (chmod permissions) have access to the folder where mySQL stores stuff. Sometimes when storing media and things...
0
0
0
0
2014-12-20T21:29:00.000
4
0
false
27,584,508
0
0
1
1
I'm using the mySQLdb module within my django application which is linked to Apache via WSGI. However I'm getting permission issues (shown below). This is down to SElinux and if I set it to passive everything is ok. ImproperlyConfigured: Error loading MySQLdb module: /opt/django/virtenv/django15/lib/python2.7/site-p...
Django on CentOS/Bluehost: Attempt to Write a Readonly Database, which Chmod besides 777 to use?
27,594,818
1
2
310
1
python,django,sqlite
The user accessing the database (www-data?) needs to have write privileges to the folder the data resides in as well as the file itself. I would probably change the group ownership (chgrp) of the folder to www-data and add a group sticky bit to the folder as well (chmod g+s dbfolder). The last one makes sure that any...
0
0
0
0
2014-12-21T23:04:00.000
1
1.2
true
27,594,703
0
0
1
1
I am trying to get writing privileges to my sqlite3.db file in my django project hosted on bluehost, but I cannot get any other chmod command to work besides the dangerous/risky chmod 777. When I chmod 777 the db file and the directory, everything works perfectly. However, in order to be more prudent, I’ve tried chmod...
scrapy: does it make sense to disable filtering on a formrequest?
27,602,635
1
1
134
0
python,scrapy
If the request has the dont_filter attribute set, the offsite middleware will allow the request even if its domain is not listed in allowed domains.
0
0
1
0
2014-12-22T10:24:00.000
1
1.2
true
27,600,761
0
0
1
1
So I've been wondering regarding a spider, if maybe some of my requests might be getting filtered because they are to the url endpoint but with different body arguments (form data). Does the dont_filter=True make sense with FormRequest object?
When should I use the Flask.config vs. use flask.session?
27,608,409
6
1
170
0
python,flask
Anything that is static, app-wide, doesn't change much, and has important information for all users, should use config. (e.g. secret keys, options to modify the app from project to project, emails, generic messages) Session should only be used to store relevant user data as the data is modified through each page. (e.g....
0
0
0
0
2014-12-22T18:27:00.000
2
1.2
true
27,608,372
0
0
1
2
Is there a rule for when to use Flask.config vs. flask.session to store variables?
When should I use the Flask.config vs. use flask.session?
27,608,411
4
1
170
0
python,flask
Yes, most definitely. The config is for global, project-level variables: the location of files, keys for any APIs you might be using, your database access settings, things like that. The session is for variables related to the current user's session on the site: their previous choices on a multi-page form, preferences,...
0
0
0
0
2014-12-22T18:27:00.000
2
0.379949
false
27,608,372
0
0
1
2
Is there a rule for when to use Flask.config vs. flask.session to store variables?
Best way to add Django migrations to a django project
27,615,457
0
0
635
0
python,django,django-migrations
I have done the migration from 1.6 to 1.7 on an existing project. It was fairly painless. I renamed my old South migrations folders and let the django 1.7 migrations create a new one. (i.e. $mv appname/migrations appname/migrations.south) That will make it easier to go back to South for any reason and will keep fro...
0
0
0
0
2014-12-23T05:21:00.000
2
0
false
27,614,494
0
0
1
1
I have a Django application initially created for version 1.6 and I've just finished the upgrade for the last version. All the models has managed = False and prior none of them was managed by south and now I want to start using Django migrations for 1.7 version. Which would be the best and seamless way to do it? I'm af...
Notifying user's browser of change without websockets
27,616,278
0
1
55
1
python,web,pyramid
You need a table with current editor, record_id and timeout. The first editor asks per POST-request to edit a record and you put a new line in this table, with a reasonable timeout, say 5 min. The first editor gets an "ok" in return. For the second editor you find a match for the record_id in the table, look at the tim...
0
0
0
0
2014-12-23T07:44:00.000
2
0
false
27,616,098
0
0
1
1
I'm developing intranet web app that is based on Pyramid with SQLAlchemy. It eventually may (will) happen that 2 users will edit the same record. How can I handle the requirement to notify the user who started editing later that particular record is being edited by the first user?
how to tell browser screen size in python
27,627,672
0
0
209
0
python,browser,size
I am not sure about what you are trying to do, but I have pretty good reasons to believe that this is something you want to handle in your css/js side of the application. I am not familiar with app-engine, but the browser does not send it's viewport size with requests (unless you put it yourself in request data). So if...
0
0
0
0
2014-12-23T20:34:00.000
1
0
false
27,627,619
0
0
1
1
I am using WebApp2 with python (and app-engine). Is there a way to tell the screen size of the browser in python? I am trying to figure if the browser size is less than 768.
Get host and port for Heroku app
27,666,089
2
3
1,682
0
python,heroku,host,crossbar
For the host use 0.0.0.0. For the port number it's slightly more complicated... When it creates a web dynamo Heroku sets a PORT environment variable with the dynamo's port. To set this in crossbar you need to create a script that reads that variable and writes it into your config wherever the port is requested. Then yo...
0
0
0
0
2014-12-23T21:22:00.000
1
1.2
true
27,628,174
0
0
1
1
I'm trying to get a Crossbar.io app running on Heroku. Crossbar.io requires you to put the app's host in a config file that's used to launch the app. I've tried the following: my-app-name.herokuapp.com: No dice. I imagine Heroku does some fancy redirection internally that prevents this from working. $HOSTNAME: running...
Bulk download of web images
27,647,682
1
0
83
0
javascript,python,amazon-s3
I'd suggest spinning up one or more EC2 instances and running your thumbnail job there. You'll eliminate almost all lot of the bandwidth costs (free from ec2 instances in the right region to s3), and certainly the transfer speed will be faster within the AWS network. For 600K files to process, you may want to consider ...
0
0
1
0
2014-12-24T08:09:00.000
1
1.2
true
27,633,641
0
0
1
1
I have about 600k images url (in a list) and I would like to achieve the following : Download all of them generate a thumbnail of specific dimensions upload them to Amazon s3 I have estimated my images average to about 1mb which would be about 600gb of data transfer for downloads. I don't believe my laptop and my I...
Can uWSGI return a response before the POST data is uploaded?
27,646,090
0
0
244
0
python,nginx,uwsgi
The limit here is nginx. It cannot avoid (unless when in websockets mode) buffering the input. You may have more luck with apache or the uWSGI http router (albeit i suppose they are not a viable choice)
0
0
1
1
2014-12-25T07:32:00.000
1
0
false
27,645,172
0
0
1
1
I have an api with publishers + subscribers and I want to stop a publisher from uploading a lot of data if there are no subscribers. In an effort to avoid another RTT I want to parse the HTTP header, see if there are any subscribers and if not return an HTTP error before the publisher finishes sending all of the data. ...
If a website gives a 302 HTTP response code, can I get the original link's raw HTML still?
27,651,589
1
0
66
0
python,http,python-requests
Basically you don't. If the web server is returning a 302 unless it decides to include the old html(which would be very odd ) you are basically out of luck. Now if you hit it with a web browser and it doesn't redirect you, then perhaps it is doing something like user agent sniffing and redirecting based on that. So in...
0
0
1
0
2014-12-25T23:26:00.000
2
0.099668
false
27,651,530
0
0
1
1
I'm trying, in Python, using the requests library, to get the HTML for a website that automatically redirects to another one. How do I avoid this and get the HTML for the original site, if possible? I know it exists and has HTML for it because I have accessed it via the Chrome view-source function. Any help appreciated...
How to manage migrations in django 1.7 among developers?
27,654,493
1
4
56
0
python,django
so there are developers A and B. if it is very important you both have notification enabled in git so that you know what your friend has pushed. lets imagine, A and B are working at the same time on same django app, possibly on the same models.py. if A pushes changes on models.py, B needs to apply these changes in h...
0
0
0
0
2014-12-26T07:54:00.000
1
0.197375
false
27,654,405
0
0
1
1
We are 2 developers working on a django application. As we are in the initial stages of the app our models are changing rapidly and so are django migration files. So if one of us pushes the migrations to git and when the other one pulls them and tries to apply them, django is not able to find a common migration point a...
Is it okay to spawn a thread from django post save signal?
27,676,874
1
5
826
0
python,json,django,multithreading,django-models
I don't know where you would have read that signals are executed in threads, because it is not at all true. Django does not do anything with threads, and neither should you: if you want to execute something out of process, use a task queue system like Celery.
0
0
0
0
2014-12-28T13:27:00.000
2
0.099668
false
27,676,834
1
0
1
1
I have post_save signal on one of my models which calls json.dumps on a large python dictionary. I want to call this json.dumps in a separate thread so it may not slow down the save call on my model. I was wondering if it is okay to spawn a new thread from inside a post_save signal? I have read that post_save signals a...
Django, move variables
27,695,615
2
1
46
0
python,django,middleware
I'm not sure why you say that session variables are not the best solution. On the contrary, they are absolutely the right solution for doing this. In the first view, you can simply do request.session['first_data'] = my_data, and in the second, my_data = request.session.pop('first_data').
0
0
0
0
2014-12-29T20:29:00.000
2
1.2
true
27,695,564
0
0
1
1
I have a standard django application. In a view (let's name it First) I call an HttpResponseRedirect (to the view called Second) however there is some data I'd like to transfer to the Second view. What options do I have to achieve this? One would be to set a GET parameter, however this is not a nice solution. I also co...
Import absolute import only once in Django project
27,710,578
2
2
904
0
python,django,python-2.7
The problem with frequent use of absolute_import is usually caused by the ambiguity within a package. If you are developing several subpackages and need to constantly use absolute_import to use a top-level package, just rename the problem subpackage. It is anyway a good idea.
0
0
0
0
2014-12-30T18:09:00.000
2
0.197375
false
27,710,366
0
0
1
1
I like to use absolute_import function in Python 2.7. Because in Python 2.7 there is no absolute_import So I have to import it like this. from __future__ import absolute_import In my Django project I have a lot of files, like models.py, views.py and so on. And on top of each file I have to put from __future__ import a...
Using Robot framework with Google Chrome browser
27,816,296
0
0
580
0
python-2.7,selenium-webdriver,robotframework
Have you tried running the test with 'pybot -L TRACE' ?
0
0
1
1
2014-12-31T06:21:00.000
1
0
false
27,717,059
0
0
1
1
I am running test scripts in Robot framework using Google Chrome browser. But when I run scripts consecutively two times, no message log gets generated in message log section in Run tab. This problem is being encountered only while using Chrome. Can anyone help me on this as why it is occurring.
How to override a signal in the sites framework django framework
27,780,840
0
0
92
0
python,django,django-signals
You should be able to do this by importing only the signals you need to use. You could have a separate set of signal files for each of your sites, importing them relatively to your wsgi.py or manage.py files, which should allow you to override or extend your entire base signal library. If all of your sites are running ...
0
0
0
0
2014-12-31T07:41:00.000
1
0
false
27,717,893
0
0
1
1
I have a model that is firing a post_save signal in the django framework set to run more than one site. What I need to do is to be able to override that signal with a signal that will be defined in the specific site that needs this signal and use the one in the main app as a base. Or maybe in short I want to be able to...
How to cancel Django cache in fastcgi
27,725,014
2
0
47
0
python,django,apache
Thats the nature of using it in that format/setup. On development, running as 'manage.py runserver' it auto reloads on file changes. production/proxy setups like you have, you need to reload/restart the service to have changes take effect.
0
0
0
0
2014-12-31T17:57:00.000
1
1.2
true
27,724,624
0
0
1
1
I am testing a web application on both shared host and Apache localhost, using Django and fastcgi. When I edited my code and refreshing the page, many times the new code does not take effect. I think this is a cache issue, but I don't know how from the application. For example: adding new url pattern to mysite/urls.py...
Django: How to query terms with punctuation (ie: !.;’) insensitivity?
27,730,225
2
0
195
0
python,django,facebook,facebook-graph-api
You'll need to store two versions of the username: one for querying against, and one for display.
0
0
0
0
2015-01-01T11:03:00.000
3
0.132549
false
27,730,191
0
0
1
2
I am creating an application that needs to find facebook usernames that I’ve stored in the database, but facebook usernames are both case insensitive and insensitive to periods. For example, the username Johnsmith.55 is the same as johnsmith55 or even j…O.hn.sMiTh.5.5. when sending facebook API requests. Obviously, I a...
Django: How to query terms with punctuation (ie: !.;’) insensitivity?
27,730,740
1
0
195
0
python,django,facebook,facebook-graph-api
You can also implement your own querying loguc with custom lookups in Django 1.7 or later.
0
0
0
0
2015-01-01T11:03:00.000
3
0.066568
false
27,730,191
0
0
1
2
I am creating an application that needs to find facebook usernames that I’ve stored in the database, but facebook usernames are both case insensitive and insensitive to periods. For example, the username Johnsmith.55 is the same as johnsmith55 or even j…O.hn.sMiTh.5.5. when sending facebook API requests. Obviously, I a...
Scrapy ImportError: No module named project.settings when using subprocess.Popen
27,731,947
0
4
1,463
0
python,scrapy,popen
I suggest let python focus on the scrape task and use something else for process control. If it were me, I'd write a small bash script to run your program. Test that the launcher script works by running it with env -i yourscript.sh because that will make sure it runs without any inherited environment settings. Once t...
0
0
0
0
2015-01-01T14:32:00.000
2
0
false
27,731,670
0
0
1
1
I have scrapy crawler scraping thru sites. On some occasions scrapy kills itself due to RAM issues. I rewrote the spider such that it can be split and run for a site. After the initial run, I use subprocess.Popen to submit the scrapy crawler again with new start item. But I am getting error ImportError: No module name...
Installing python packages in virtual environment
27,732,951
1
0
1,051
0
python,pip,virtualenv
Either change the permissions of the virtual enviroment directory or recreate it without using sudo.
0
0
0
0
2015-01-01T17:19:00.000
4
0.049958
false
27,732,911
1
0
1
3
I'm trying to install django in a virtual environment. I'm in a virtual environment, but when i type pip install django I get a permission denied error. If I try to run sudo pip install django, however, I get sudo: pip: command not found. Not entierly sure where to go from here.
Installing python packages in virtual environment
27,732,983
0
0
1,051
0
python,pip,virtualenv
This is a permissions issue and caused by how the virtual environment has been set up. The safest thing to do now is to remove the virtual environment and make sure to recreate it with the user's permissions (no sudo). And as a side note, the command not found error is due to pip not being set up for root.
0
0
0
0
2015-01-01T17:19:00.000
4
0
false
27,732,911
1
0
1
3
I'm trying to install django in a virtual environment. I'm in a virtual environment, but when i type pip install django I get a permission denied error. If I try to run sudo pip install django, however, I get sudo: pip: command not found. Not entierly sure where to go from here.
Installing python packages in virtual environment
27,733,194
2
0
1,051
0
python,pip,virtualenv
Since you setup your virtual environment with sudo virtualenv /opt/myenv, you now need to run the correct pip instance (i.e. the one inside your newly created virtual environment). Therefore, your command needs to be sudo /opt/myenv/bin/pip install django
0
0
0
0
2015-01-01T17:19:00.000
4
0.099668
false
27,732,911
1
0
1
3
I'm trying to install django in a virtual environment. I'm in a virtual environment, but when i type pip install django I get a permission denied error. If I try to run sudo pip install django, however, I get sudo: pip: command not found. Not entierly sure where to go from here.
Django models with external DBs
27,744,297
0
1
437
1
python,django
I would create the minimal django models on the external databases => those that interact with your code: Several outcomes to this If parts of the database you're not interested in change, it won't have an impact on your app. If the external models your using change, you probably want to be aware of that as quickly as...
0
0
0
0
2015-01-02T12:45:00.000
3
0
false
27,742,457
0
0
1
1
I have a typical Django project with one primary database where I keep all the data I need. Suppose there is another DB somewhere with some additional information. That DB isn't directly related to my Django project so let's assume I do not even have a control under it. The problem is that I do ont know if I need to cr...
How to convert python time to java date
27,745,293
1
0
2,695
0
java,python,time
Remove the decimal point and convert it to a float.
0
0
0
0
2015-01-02T16:28:00.000
3
0.066568
false
27,745,253
1
0
1
1
I have a python date formatted like this 1418572798.498 within a string. In Java the dates are formatted like this 1418572798498. How to convert this string to Java date? Is there any third party library to use for the conversion?
How do I clear a flask session?
27,764,937
-42
37
74,779
0
python-2.7,flask
There is no way to clear session or anything. One must simply change the app.config["SECRET_KEY"] and the contents in session dictionary will get erased.
0
0
0
0
2015-01-02T19:36:00.000
6
1.2
true
27,747,578
0
0
1
1
While importing flask, we import modules such as session etc. SecureCookieSession is a kind of dictionary, that can be accessed using session. Now, I try to clear all the junk variables that I used while trying to build a website. One of the answers on stackoverflow used a command like session.clear() for clearing th...
Best Way to Store Large Amount of Outside API Data... using Ruby or Python
27,761,882
0
0
149
0
python,mysql,ruby,json,mongodb
I think this all boils down to what the most important needs are for the project. These are some of the questions I would try to answer before selecting the technology: Will I need to access records individually after inserting into the database? Will I ever need to aggregate the data when reading it (for reporting, f...
0
0
0
1
2015-01-04T02:11:00.000
1
0
false
27,761,684
1
0
1
1
Im trying to design a system that can periodic "download" a large amount of data from an outside api.. This user could have around 600,000 records of data that I need once, then to check back every hour or so to reconcile both datasets. Im thinking about doing this in python or ruby in background tasks eventually but I...
UnicodeDecodeError in django 1.6 and allauth
27,787,697
0
0
135
0
django,python-2.7,django-allauth
Problem solved: the secret key in my configuration file started with an (unicode) opening quote, instead of a regular double quote, probably a result of copying and pasting the original file that had been written with an editor that uses these "smarter" quotes.
0
0
0
0
2015-01-05T01:56:00.000
1
0
false
27,772,452
0
0
1
1
I'm trying to run a django website on my local computer. It works fine on an external server, but I didn't set it up and right now I don't have access to all the specs. The issue I have is when I try to log in the web site as a user, which has been defined. Running in debug mode I get a detailed error page containing o...
How to create link for django filter
60,852,547
0
2
2,342
0
python,django,python-2.7,django-filter
maybe you try use some js solution. just get all the current attributes from url by using js ,build dict. when clicking other attribute button,you can add or replace the attribute in the dict. use this dict to form your url.
0
0
0
0
2015-01-05T11:37:00.000
3
0
false
27,778,737
0
0
1
1
Scenario: Products can have multiple attributes defined in the database, I want to be able to filter by those attributes. Since i have not found a way to use dynamic attributes using django-filter, this is currently achieved by using django filter MethodFilter which parses the attributes passed as query string as: /pro...
Google Drive / App Engine for Document Management System
27,791,624
0
1
1,208
0
google-app-engine,google-drive-api,document-management,google-apps-for-education,google-app-engine-python
Since you'll be building your own software, the answer to "will it do what I want" is always "yes, eventually". You'll need to make a decision about document formats, which in turn will influence your indexing mechanism. Specifically, you have two primary options:- convert the files to Google document formats (doc, s...
0
1
0
0
2015-01-05T19:53:00.000
1
1.2
true
27,786,842
0
0
1
1
I administer a University's document management system. The system is a 3rd party that integrates with another 3rd party database that acts as our ERP system. The DMS is quite clunky and has a wide array of terrible bugs / lacks features & support. I've been playing around with Google App Engine / Drive SDK in my free ...
Serve static files with Eve
41,322,114
1
5
1,052
0
python,flask,eve
try set import_name arg for Eve: app = Eve(import_name=__name__)
0
0
0
0
2015-01-06T12:36:00.000
3
0.066568
false
27,798,842
0
0
1
1
I am running Flask and Eve on localhost at a same time. The Flask app serves static files and makes requests to the Eve app to get some data. I want to run Eve only, without a separate Flask app. How can I serve static files with Eve?
epub3 : how to add the mimetype at first in archive
28,436,076
0
0
1,098
0
python,zip,epub,epub3
The solution I've found: delete the previous mimetype file when creating the new archive create an new mimetype file before adding anything else : zipFile.writestr("mimetype", "application/epub+zip") Why does it work : the mimetype is the same for all epub : "application/epub+zip", no need to use the original file.
0
0
1
0
2015-01-06T13:28:00.000
2
1.2
true
27,799,692
0
0
1
1
I'm working on a script to create epub from html files, but when I check my epub I have the following error : Mimetype entry missing or not the first in archive The Mimetype is present, but it's not the first file in the epub. Any idea how to put it in first place in any case using Python ?
Django - signals. Simple examples to start
61,509,996
0
33
24,175
0
python,django,django-signals
In the signals.post_save.connect(receiver=create_customer, sender=Customer)... sender will always be the model which we are defining... or we can use the User as well in the sender.
0
0
0
0
2015-01-06T17:08:00.000
5
0
false
27,803,633
0
0
1
1
I am new to Django and I'm not able to understand how to work with Django signals. Can anyone please explain "Django signals" with simple examples? Thanks in advance.
Python - Flask not storing session
27,852,529
2
1
794
0
python,session,flask
Note to self: make sure memcached is running.
0
0
0
0
2015-01-06T22:10:00.000
2
1.2
true
27,808,101
1
0
1
1
I have a Python project built using the Flask framework. The project is established and I have installed and ran it on numerous machines (Ubuntu and OSX) using virtualenv. I went to set up my project on a new computer with Yosemite installed. It installed all of the requirements with no errors and the site runs locall...
Send button in yahoo mail page is not not visible - Firefox, Freebsd 7.2
27,815,406
0
0
673
0
python,firefox,freebsd,yahoo-mail
Check if the button is inside an iframe. If it is then switch to frame and try it again.
0
0
1
1
2015-01-07T07:54:00.000
1
0
false
27,814,764
0
0
1
1
I have a python script that sends a mail from Yahoo including an attachment. This script runs on a Freebsd 7.2 client and uses firefox : Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.0.10) Gecko/2009072813 Firefox/3.0.10. The script fails with the error - Element xpath=//input[@value="Send"] not found. Checked the P...
Restricted database user for Django
27,964,212
0
2
1,088
1
python,django,database,postgresql,security
Yes, this is practiced sometimes, but not commonly. The best way to do it is to grant specific privileges on user, not in django. Making such restrictions means that we should not trust application, because it might change some files / data in db in the way that we do not expect it to do so. So, to sum up: create anoth...
0
0
0
0
2015-01-07T12:50:00.000
3
0
false
27,819,930
0
0
1
2
I'm running Django with Postgres database. On top of application-level security checks, I'm considering adding database-level restrictions. E.g. the application code should only be able to INSERT into log tables, and not UPDATE or DELETE from them. I would manually create database user with appropriate grants for this...
Restricted database user for Django
27,972,123
1
2
1,088
1
python,django,database,postgresql,security
For storing the credentials to the privileged user for management commands, when running manage.py you can use the --settings flag, which you would point to another settings file that has the other database credentials. Example migrate command using the new settings file: python manage.py migrate --settings=myapp.privi...
0
0
0
0
2015-01-07T12:50:00.000
3
0.066568
false
27,819,930
0
0
1
2
I'm running Django with Postgres database. On top of application-level security checks, I'm considering adding database-level restrictions. E.g. the application code should only be able to INSERT into log tables, and not UPDATE or DELETE from them. I would manually create database user with appropriate grants for this...
python simple server with 3.4.2
31,328,765
0
0
192
0
angularjs,python-3.4,simplehttpserver
resolved it by re-installing python on my machine.
0
0
0
1
2015-01-07T16:09:00.000
1
1.2
true
27,823,606
0
0
1
1
I'm not savvy with Python or server programming at all. My AVG blocked Python from running SimpleHTTPServer. I was able to install Python 3.4.2 successfully, but noticed that SimpleHTTPServer has been moved into HTTP server. How can I set up my machine or Python 3.4.2 so that I can just type python -m SimpleHTTPServer ...
What are the application and request contexts?
27,863,220
1
0
94
0
python,flask
app.app_context loads the application and any extentions you have loaded. A request context is loaded when you are dealing with a request. A good example. If you have a background cron that does some database work, you'll need to make use of app_context to get access to the models. You'll be a in request context pretty...
0
0
0
0
2015-01-08T04:32:00.000
1
1.2
true
27,832,993
0
0
1
1
I'm new to Flask but have experience with PHP. I know there are session variables and global variables just as in PHP, but what do the contexts actually mean? I read the documentation but could not understand whet it was saying. What are the application and request contexts, and what the is app.app_context()?
How To check for environment vars during django startup
28,414,823
0
0
170
0
python,django,environment-variables
well, it turned out that the AppConfig is not the right spot for a task like that .. i realized my loading of secrets with a modification of the projects manage.py and im planning to release an app with all of the code in the near furture :)
0
0
0
0
2015-01-08T06:57:00.000
1
1.2
true
27,834,570
0
0
1
1
Id like to have my secret keys loaded via environment vars that shall be check on startup of my Django app. Im using an AppConfig for that purpose, because that code will be executed on startup. For now i wrote a little helper to get the vars and a list of vars to check. Which is working fine. The problem: I also wrot...
How can I get the PORT number when using Nginx + Tornado?
27,880,443
0
0
96
0
python,nginx,tornado
Each of these ports is a different python process, right? At some point you must be passing in the port number to each process and calling app.listen(port) (or one of the related bind/listen methods). Just save the port number at that time (could just be a global variable if you only have one server per process)
0
1
0
0
2015-01-08T08:06:00.000
1
1.2
true
27,835,528
0
0
1
1
Nginx make PORT 8000:8003 to Tornado server.py I want to get the PORT number in MainHanlder and print it in the browser when someone visit my site. And I don't want to make several copies of server.py to server8000.py, server8001.py, ..., I want just one main entrance to solve this problem. How can I do it?
Cloning PyQt app in django framework
27,880,120
2
1
1,730
0
django,python-2.7,pyqt4
I'm not aware of any libraries to port a PyQT desktop app to a django webapp. Django certainly does nothing to enable this one way or another. I think, you'll find that you have to rewrite it for the web. Django is a great framework and depending on the complexity of your app, it might not be too difficult. If you have...
1
0
0
0
2015-01-10T18:52:00.000
1
1.2
true
27,879,952
0
0
1
1
I've designed a desktop app using PyQt GUI toolkit and now I need to embed this app on my Django website. Do I need to clone it using django's own logic or is there a way to get it up on website using some interface. Coz I need this to work on my website same way it works as desktop. Do I need to find out packages in d...
Clients uploading to database
27,885,848
1
0
70
1
python,postgresql,security,csv
The script makes a POST request to your Django web server either with login/pwd or unique string. The web server validates credentials and inserts data into DB.
0
0
0
0
2015-01-11T09:46:00.000
2
0.099668
false
27,885,733
0
0
1
1
I have a python script set up that captures game data from users while the game is being played. The end goal of this is to get all that data, from every user, into a postgresql database on my web server where it can all be collated and displayed via django The way I see it, I have 2 options to accomplish this: While ...
Django i18n pattern
27,913,910
0
1
436
0
python,django,internationalization,django-i18n
What you are experiencing is that your language selection is not sticking as it should and so to do this there are a few things to check. My guess is that you have 'en' as your LANGUAGE_CODE in your settings so that will always be your fallback. Quite often the reason that you cannot get your language to stick is that ...
0
0
0
0
2015-01-12T23:29:00.000
3
0
false
27,912,563
0
0
1
1
I'm using internationalization. So, everyhting works fine, when I access http://localhost:8000/en/ and http://localhost:8000/de/ But when I access http://localhost:8000/ it redirects me to http://localhost:8000/en/ even when the last accessed page was http://localhost:8000/de/ Basically, I want to save language code, b...
Backup Odoo db from within odoo
28,070,202
1
13
4,840
1
python,openerp,odoo
You can use a private browser session to access the Database menu, from the login screen, and perform the the backup form there (you need to know the master password to access that, defined in the server configuration file).
0
0
0
0
2015-01-14T04:11:00.000
9
0.022219
false
27,935,745
0
0
1
1
I need to backup the current db while logged into odoo. I should be able to do it using a button, so that suppose I click on the button, it works the same way as odoo default backup in manage databases, but I should be able to do it from within while logged in. Is there any way to achieve this? I do know that this is p...
Should I allow users to manage their profile using the admin application?
27,936,097
2
0
50
0
python,django,django-admin
You can code the "member area" to be much more user-friendly than Django's admin, inevitably very general purpose. You can carefully restrict exactly what a user can change, saving them from mistakes that could be damaging and hard to fix, add more sanity checks too. All in all, I'd say that, while more work, coding y...
0
0
0
0
2015-01-14T04:43:00.000
2
1.2
true
27,936,012
0
0
1
2
Maybe my question can sound a little bit stupid but it's a real one. I'm doing an ecommerce website, so as an admin I directly use the one provided by django, to manage my article and user. But, what's the best for my user? Should I let them use the admin panel to manage their profile? (I saw I can manage who can do wh...
Should I allow users to manage their profile using the admin application?
28,121,019
0
0
50
0
python,django,django-admin
Alternatively, you can make these users as 'superusers' in admin, to manage. And you can override view in admin to make it more friendly. Good luck!
0
0
0
0
2015-01-14T04:43:00.000
2
0
false
27,936,012
0
0
1
2
Maybe my question can sound a little bit stupid but it's a real one. I'm doing an ecommerce website, so as an admin I directly use the one provided by django, to manage my article and user. But, what's the best for my user? Should I let them use the admin panel to manage their profile? (I saw I can manage who can do wh...
Is it possible to have an absolute href attribute with no scheme?
27,955,487
2
0
173
0
python,html,tags,uri,url-scheme
If you don't include the URI scheme (http://, https://, //, etc) then the browser will assume it to be a relative URL. You should be aware of scheme-relative URLs like //www.google.com for your script. In short your should look for a double forward slash // to figure out whether or not a URL will be treated as relativ...
0
0
1
0
2015-01-15T01:29:00.000
2
1.2
true
27,955,463
0
0
1
1
I'm trying to find a way to test whether a URL is absolute or relative in Python. In the href attribute of an HTML tag, is the lack of a scheme (e.g. http, ftp, etc.) sufficient to mark a URL as relative, or is it possible to have an absolute URL as a href attribute without explicitly specifying the scheme (e.g. 'www.g...
Java/python using processBuilder
27,969,431
0
1
266
0
java,python,processbuilder,inter-process-communicat
From your scenario, you are looking for inter process communication. You can achieve this using shared file. Your python script will write the output in text file, and your java program will read the same file.
0
0
0
0
2015-01-15T01:51:00.000
1
0
false
27,955,622
0
0
1
1
Good evening all, am running a python script inside java using processBuilder. the python script returns a list and i dont know how to get it java and use it since all i can do for the moment with process builder is print errors or outputs. is it possible to get the list in java as well. Many thanks
django run localhost from another computer connected to another network
60,644,419
0
6
8,099
0
python,django,localhost
If you're working DEBUG=True mod in your Django project, you shouldn't need anything other than that (I assume you are not using port 80, it requires root access). You must use 0.0.0.0 as host IP, it is a simple solution. And the command is: python manage.py runserver 0.0.0.0:8000. That's it.
0
0
0
0
2015-01-15T04:56:00.000
3
0
false
27,957,035
0
0
1
1
I am running my django project in localhost and it works fine.. For test purpose I want to run my localhost from another computer connected in the same network. I have done python manage.py runserver 'my ip address' That works fine too.. Is there any way that I can access my localhost from another computer connected to...
In the PayPal REST API, how can I get payer information from a newly executed BillingAgreement?
27,989,541
2
1
555
0
python,rest,paypal
Got a reply from PayPal support. Apparently you can take the same token you pass to BillingAgreement.execute() and pass it to GetExpressCheckoutDetails in their classic API. I tried it and it works. It means you have to use both APIs (which we weren't planning to do) and store both API auth info, which is annoying. ...
0
0
1
0
2015-01-15T20:32:00.000
1
0.379949
false
27,972,459
0
0
1
1
Let's say I have a billing agreement, which I just executed on the callback from the PayPal site: resource = BillingAgreement.execute(token) The resource returned does not have any payer information (name, email, etc). I can use the ID to load the full BillingAgreement: billing_agreement = BillingAgreement.find(res...
Is client side validation nessesary in Django?
27,976,034
2
3
1,963
0
python,django,validation
Client side validation may improve user experience (less page reloads). It may decrease number of hits to he server (but sometimes this number is increased :). But it is not necessary. Anyway server side validation is a must. You can't trust data from user input.
0
0
0
0
2015-01-16T01:27:00.000
3
1.2
true
27,975,963
0
0
1
2
I am writing a Django app, and am wondering if any client side validation is necessary. Django handles all validation through forms in python on the backend. If something validates wrong, the user is returned to the screen with all their information still there. I can't see any reason I need to implement client side ...
Is client side validation nessesary in Django?
27,976,103
3
3
1,963
0
python,django,validation
If you have a web application that faces the public internet client side, validation is pretty much a user expectation. You might be able to ignore this if volume is low and people are motivated to use your website. For an company intranet site, the additional development cost may weigh against client side validation. ...
0
0
0
0
2015-01-16T01:27:00.000
3
0.197375
false
27,975,963
0
0
1
2
I am writing a Django app, and am wondering if any client side validation is necessary. Django handles all validation through forms in python on the backend. If something validates wrong, the user is returned to the screen with all their information still there. I can't see any reason I need to implement client side ...
PDFKit with python on Ubuntu
29,774,518
0
0
487
0
python,ubuntu,pdf-generation,pdfkit
I found the solution. The problem was that I didn't close .colse() the file before the initialisation of the pdfkit
0
0
0
1
2015-01-16T21:52:00.000
1
0
false
27,993,383
0
0
1
1
I have a very strange problem. I have a script written in python which is generating an html report then I convert it using pdfkit to pdf . The script is working just fine on MAC and the pdf is generated normally. When I tried to install the same script on Ubuntu I got the following upnormal behavior: The html file is...
Embed Python code on a webpage
27,994,687
0
0
273
0
python,web
Recommend flask. I've just done something like this. Only need a few lines of python code and a few lines of html code. No more than 30 lines. Write a html page which has an input and a button. When the page gets an input and the button gets hit, a python script will be invoked. And then result will be rendered to a ne...
0
0
0
0
2015-01-16T23:49:00.000
2
0
false
27,994,576
0
0
1
1
Is there an easy, simple way to embed python code in a webpage; i.e., have an embedded app where viewers input numbers and a python code is run and an output is spit out? I don't really want to learn Django just for one project, but if there's no other way, I might have to.
Login and registration example in Django with different user table
27,999,374
3
1
1,284
0
python,django
You can specify different permissions in the auth_user table using the is_superuser and is_staff boolean attributes in the model. Maintaining the session and permissions is easier if you use the auth_user table
0
0
0
0
2015-01-17T09:57:00.000
2
0.291313
false
27,998,297
0
0
1
1
I am quite new to Django, I need a example code for creating login and registration form and a default page which a user can see only after logged in. Here important thing is that i want to use different table for users other than the auth_user table for admin. These users can logged in and able to perform some functio...
running django python 3.4 on mod_wsgi with apache2
28,044,520
0
6
5,696
0
django,apache,python-3.x,mod-wsgi
Thanks guys, I actually fixed the issue myself this morning by running the make install of mod_wsgi with .configure pointing to python3.4. I think you were right Adam.
0
0
0
1
2015-01-19T06:51:00.000
3
0
false
28,019,310
0
0
1
3
Hi I am getting the error below when going to the website url on ubuntu server 14.10 running apache 2 with mod_wsgi and python on django. My django application uses python 3.4 but it seems to be defaulting to python 2.7, I am unable to import image from PIL and AES from pycrypto. ImportError at / cannot import name _...
running django python 3.4 on mod_wsgi with apache2
28,038,045
9
6
5,696
0
django,apache,python-3.x,mod-wsgi
I believe that mod_wsgi is compiled against a specific version of python, so you need a py3.4 version of mod_wsgi. You may be able to get one from your os's package repository or you can build one without too much drama. From memory you'll need gcc and python-dev packages (python3-dev?) to build. OK, quick google, for ...
0
0
0
1
2015-01-19T06:51:00.000
3
1.2
true
28,019,310
0
0
1
3
Hi I am getting the error below when going to the website url on ubuntu server 14.10 running apache 2 with mod_wsgi and python on django. My django application uses python 3.4 but it seems to be defaulting to python 2.7, I am unable to import image from PIL and AES from pycrypto. ImportError at / cannot import name _...
running django python 3.4 on mod_wsgi with apache2
28,032,221
0
6
5,696
0
django,apache,python-3.x,mod-wsgi
From what I see here your application is using py2 interpreter with py3 compiled modules, which is no-go. One simple possible solution that comes me in mind is to add or change first line of manage.py to #!/usr/bin/python3. This will tell script to be interpreted with py3. Next on guess list would be misconfiguration i...
0
0
0
1
2015-01-19T06:51:00.000
3
0
false
28,019,310
0
0
1
3
Hi I am getting the error below when going to the website url on ubuntu server 14.10 running apache 2 with mod_wsgi and python on django. My django application uses python 3.4 but it seems to be defaulting to python 2.7, I am unable to import image from PIL and AES from pycrypto. ImportError at / cannot import name _...
Django Navigation from Template-Login to a self written index.html
28,024,750
0
0
85
0
python,django,login,navigation
1: create your own view that the login button take the person to when clicked and load your index.html template. you do not have to use the built in login. 2: logo? you can use any logo/format you want. Django doesn't come with a template that creates the look of the site (beside the admin one); so you need to create ...
0
0
0
0
2015-01-19T12:26:00.000
2
0
false
28,024,651
0
0
1
2
Im using the Django template login and want to navigate from the login to my own written index.html file. so if a user push the "login" button the result page is my index file. My second question is how to use logos in django python and what structure i need in my project. best regards
Django Navigation from Template-Login to a self written index.html
28,028,387
0
0
85
0
python,django,login,navigation
create custom log-in and registration in your project, and write the custom back-end if you have more user ,if request is came from user to log-in then redirect to index,html,
0
0
0
0
2015-01-19T12:26:00.000
2
0
false
28,024,651
0
0
1
2
Im using the Django template login and want to navigate from the login to my own written index.html file. so if a user push the "login" button the result page is my index file. My second question is how to use logos in django python and what structure i need in my project. best regards
Should I be adding the Django migration files in the .gitignore file?
68,283,683
1
187
78,791
0
python,django,git
You should think of migrations as a version control system for your database schema. makemigrations is responsible for packaging up your model changes into individual migration files - analogous to commits - and migrate is responsible for applying those to your database. The migration files for each app live in a “migr...
0
0
0
0
2015-01-19T23:10:00.000
10
0.019997
false
28,035,119
0
0
1
5
Should I be adding the Django migration files in the .gitignore file? I've recently been getting a lot of git issues due to migration conflicts and was wondering if I should be marking migration files as ignore. If so, how would I go about adding all of the migrations that I have in my apps, and adding them to the .g...
Should I be adding the Django migration files in the .gitignore file?
56,424,456
3
187
78,791
0
python,django,git
Gitignore the migrations, if You have separate DBs for Development, Staging and Production environment. For dev. purposes You can use local sqlite DB and play with migrations locally. I would recommend You to create four additional branches: Master - Clean fresh code without migrations. Nobody is connected to this bra...
0
0
0
0
2015-01-19T23:10:00.000
10
0.059928
false
28,035,119
0
0
1
5
Should I be adding the Django migration files in the .gitignore file? I've recently been getting a lot of git issues due to migration conflicts and was wondering if I should be marking migration files as ignore. If so, how would I go about adding all of the migrations that I have in my apps, and adding them to the .g...
Should I be adding the Django migration files in the .gitignore file?
52,187,013
1
187
78,791
0
python,django,git
Having a bunch of migration files in git is messy. There is only one file in migration folder that you should not ignore. That file is init.py file, If you ignore it, python will no longer look for submodules inside the directory, so any attempts to import the modules will fail. So the question should be how to ignore ...
0
0
0
0
2015-01-19T23:10:00.000
10
0.019997
false
28,035,119
0
0
1
5
Should I be adding the Django migration files in the .gitignore file? I've recently been getting a lot of git issues due to migration conflicts and was wondering if I should be marking migration files as ignore. If so, how would I go about adding all of the migrations that I have in my apps, and adding them to the .g...
Should I be adding the Django migration files in the .gitignore file?
37,484,659
4
187
78,791
0
python,django,git
I can't imagine why you would be getting conflicts, unless you're editing the migrations somehow? That usually ends badly - if someone misses some intermediate commits then they won't be upgrading from the correct version, and their copy of the database will be corrupted. The process that I follow is pretty simple - wh...
0
0
0
0
2015-01-19T23:10:00.000
10
0.07983
false
28,035,119
0
0
1
5
Should I be adding the Django migration files in the .gitignore file? I've recently been getting a lot of git issues due to migration conflicts and was wondering if I should be marking migration files as ignore. If so, how would I go about adding all of the migrations that I have in my apps, and adding them to the .g...
Should I be adding the Django migration files in the .gitignore file?
45,315,509
5
187
78,791
0
python,django,git
The solution usually used, is that, before anything is merged into master, the developer must pull any remote changes. If there's a conflict in migration versions, he should rename his local migration (the remote one has been run by other devs, and, potentially, in production), to N+1. During development it might be ok...
0
0
0
0
2015-01-19T23:10:00.000
10
0.099668
false
28,035,119
0
0
1
5
Should I be adding the Django migration files in the .gitignore file? I've recently been getting a lot of git issues due to migration conflicts and was wondering if I should be marking migration files as ignore. If so, how would I go about adding all of the migrations that I have in my apps, and adding them to the .g...
Python Client side tool( should work in browser) to extract values from a pfx file and sign it
28,065,519
1
1
146
0
python,python-2.7,openssl,pycrypto,brython
So, first things first: it is not usueal to have the same code to run on server side and client side. Second thing: be aware that no authentication (or "signing") done on client side can be regarded as safe. At most, the client side can take care of closely coupling the signing with the UI to give the user dynamic feed...
0
0
1
0
2015-01-20T05:30:00.000
1
0.197375
false
28,038,384
0
0
1
1
Client side tool to extract values such as common name serial number and public key from pfx file which is loaded by client, and then sign the public key and send to server.. I have completed the backend python code which will import modules from OpenSSL.Crypto library.. How to execute the same in client side?.. i.e s...
get_or_create: is it a 'get' or a 'create'?
28,041,761
1
0
3,290
0
python,peewee
According to source code, no way to find out. Also, according to documentation, it is not recommended to use this method. I suggest to use try/except/else clause.
0
0
0
0
2015-01-20T09:11:00.000
3
1.2
true
28,041,429
0
0
1
1
AFAIK, peewee's Model.get_or_create() doesn't return a flag that indicates a creation, unlike django's get_or_create(). Is there a good way to check if an instance returned by get_or_create() is freshly created? Thanks
Does django store instance values before changing it by default
28,045,449
0
0
42
0
python,django,versioning
As an other answer mentions, Django doesn't store old values by default. You can do this yourself by grabbing the old value and storing it to another attribute on your model on save.
0
0
0
0
2015-01-20T09:53:00.000
2
0
false
28,042,290
0
0
1
1
For a model instance does Django store the model instance value by default that I could retrieve before it has been changed? Example I would like to get the status(model attribute) changed for a given date? I am able to check the attribute from LogEntry, But is there some default which stores the actual old value that ...
django work with a Thermal Printer in Raspberry PI
28,060,170
0
0
349
0
python,linux,django,printing,raspberry-pi
install a print server on the pi and serve the printer. you may need some sort of tunnel so that the VPS can reach the pi.
0
0
0
1
2015-01-21T05:00:00.000
1
0
false
28,059,937
0
0
1
1
I have a website in django, I only going to visit the website using a Raspberry Pi, I need print a data, and for print I am using a Thermal Printer in the Raspberry Pi. I can print from the Raspberry pi using ("/dev/ttyAMA0",19200,timeout=5) for obtain serial communication This work fine but only when the project i...
AMPPS Yosemite Python configuration
28,284,966
1
0
259
0
python,macos,apache,ampps
As far as I can tell, AMPPS does not work on Yosemite at all (@ v2.8)
0
0
0
0
2015-01-21T09:14:00.000
1
1.2
true
28,063,378
0
0
1
1
I am have just recently acquired a new Mac (Yosemite OSX 10.10) I am reconfiguring everything and I need to work with external configs and Python on some new projects. Which bring me to two additional question: how to include an extra configuration with an external config file ? can I just include it to the httpd.con...
Odoo - Write null to numeric column
28,069,999
7
8
4,136
0
python,mysql,openerp-7,odoo
You can't: the Odoo ORM does not support null numeric values. If you really need to distinguish an "empty" value from a zero value, you need a workaround: either use a string field (simpler, but needs additional checks to allow only number and it's harder to perform calculations) or use a second boolean field to mark e...
0
0
0
0
2015-01-21T14:19:00.000
1
1.2
true
28,069,439
0
0
1
1
In Odoo/OpenERP 7, I have a nullable numeric column called balance 'balance': fields.float(string='Balance',digits=(20,2)) I am trying to use Python code to update None into the field self.write(cr, uid, [1], { 'balance':None }) but, rather frustratingly, Python treats None the same as 0 so I end up with 0 in the D...
How do I make my django application perform a job at a fixed time everyday?
28,076,369
2
0
140
0
python,django,scheduled-tasks,celery,django-celery
Use a simple cron job to trigger a custom Django management command.
0
0
0
0
2015-01-21T20:34:00.000
2
0.197375
false
28,076,316
0
0
1
2
Some tuples in my database need to be erased after a given time. I need my django app to check if the rows have expired. While I can definitely write the function, how do I make Django run at everyday at a fixed time? I have heard about Task Queues like Celery. Are they too much powerful for this? Is their anything sim...
How do I make my django application perform a job at a fixed time everyday?
28,076,358
-1
0
140
0
python,django,scheduled-tasks,celery,django-celery
Use a threading.Thread to schedule a continuous event loop. In your thread, use time.sleep to create a gap before the next occurrence of the event.
0
0
0
0
2015-01-21T20:34:00.000
2
-0.099668
false
28,076,316
0
0
1
2
Some tuples in my database need to be erased after a given time. I need my django app to check if the rows have expired. While I can definitely write the function, how do I make Django run at everyday at a fixed time? I have heard about Task Queues like Celery. Are they too much powerful for this? Is their anything sim...
How to handle static/media file permission on flask?
28,084,606
2
1
1,641
0
python,nginx,flask
Serve your image through Flask instead of your web server, treat it like any other url with permissions. Nginx is obviously a much better choice to serve your static files but it won't integrate with Flask.
0
0
0
0
2015-01-22T08:20:00.000
2
0.197375
false
28,084,065
0
0
1
1
I've created an application in which media files(files that are uploaded by users, not css/js) are served statically by another server on the subdomain like: media.example.com/path/to/image.jpg. How can I limit access to the images so that only certain people who are logged in and have permission can see them? Please n...
Django password_change_done viewable only on redirect from password_change view (on succesful password change)
28,103,925
0
0
100
0
python,django,django-forms,django-templates,django-views
Probably the best way to do that is to use the session: When the password_change view is valid and before redirecting to the password_change_done view, just set a password_changed session attribute to True, something like this: request.session['password_changed'] = True After that, in your password_change_done view, ch...
0
0
0
0
2015-01-23T05:06:00.000
1
0
false
28,103,374
0
0
1
1
I require the password_change_done url to be visible only when the password_change view redirects to it (on successful change of password). Otherwise on going to the password_change_done view, it must redirect to the password_change view How can this be done?
Django: calling a function before session expires
28,107,498
2
0
312
0
python,django,function,session
You can't. This question betrays a fundamental misunderstanding of how both sessions and web applications work. Web code is stateless; there is nothing "running" for any user in between the requests that user makes. If a user doesn't make any requests for longer than the session timeout, the only time the server code k...
0
0
0
0
2015-01-23T09:36:00.000
1
1.2
true
28,106,854
0
0
1
1
So i'm using the request.session.set_expiry(NUMBER_OF_SECONDS) in order to check if the user of my webpage has been inactive for a number of seconds and clossing the session when it happens. The problem is that i want to call a function for doing some things jsut before the session expires and i don't know how can I do...
How to send an HTTP PUT request using urllib2 or requests
28,115,962
0
0
831
0
django,python-2.7
Found the answer: req = urllib2.Request(url=your_url, data=your_data) req.get_method = lambda: 'PUT'
0
0
1
0
2015-01-23T17:10:00.000
1
0
false
28,115,111
0
0
1
1
In my Django app I need to send an HTTP PUT request to a url. What is the proper syntax for that?
DjangoCMS: how to auto-add default plugins in placeholders
29,008,788
0
3
790
0
python,django,django-cms
One more hint: static placeholders are good for this purposes.
0
0
0
0
2015-01-24T11:32:00.000
3
0
false
28,125,037
0
0
1
1
I have a few placeholders in my DjangoCMS template (par example, header, contetent and footer). I want to automatically populate any newly-created pages with default items: header placeholder with header plugin and footer placeholder with footer plugin. How can it be done?
Duplicating an entire Django project
28,133,201
3
0
1,706
0
python,django
Properly written django project will work from any directory. The only thing you need to change is the database settings and, may be, some paths in settings.py.
0
0
0
0
2015-01-25T04:18:00.000
1
1.2
true
28,133,177
0
0
1
1
Is it possible to duplicate an entire Django project and rename it? For example, let's say Client1 asks me for a Django project. I would name the entire project Client1. Client2 now comes and asks for the exact same file. Can I simply copy and paste Client1's project and rename it to Client2, or do I need to rename a f...
How to fill data in a base html file Django
28,135,065
0
0
77
0
python,html,django
Yes. You need to use Context Processor. Google "django context procoessor" it'll come up with many results.
0
0
0
0
2015-01-25T09:40:00.000
2
0
false
28,135,050
0
0
1
1
I have a base html file (for which code shouldn't be necessary) that requires some tags in the menu to be filled with id numbers (which are dynamic, and can't be hard coded). It seems to me that writing code to populate the tags for each view violates the DRY principle, and as such there should be some way to provide v...
Bottle, how to get_cookie during AJAX request (same domain)
28,137,747
1
1
167
0
ajax,python-3.x,cookies,xmlhttprequest,bottle
I tried to set_cookies('test', 123, secret='mysecret') under AJAX request, it worked, but still couldn't find previous cookies. Then I remarked that my previous cookies, called cook1 and cook2, written under 'normal' http request, if they had same domain, had different 'path' (under Chrome ressource explorer). They w...
0
0
0
0
2015-01-25T11:52:00.000
2
0.099668
false
28,136,063
0
0
1
1
I use bottle set/get cookie mecanism to track my user_id (with 'secret' param when calling set/get_cookie() During normal http(s) request everything is fine but when making a xhr request (same domain)user_id = request.get_cookie('user_id', secret='mysecret') returns None. When checking on client browser, cookie and key...
Cannot find PRAW config file when wrapping application with py2app
30,129,259
1
0
399
0
python,pyinstaller,py2app,praw
I came across this error today - not in the context of py2app, but after a pip upgrade of praw. In case you still have this problem (unlikely :)) and/or in the interest of posterity, here's how I was able to fix it: I noticed that the error was in reading the praw.ini file, which very much exists on my system. The real...
0
0
0
0
2015-01-26T18:07:00.000
1
1.2
true
28,156,037
1
0
1
1
I'm trying to wrap my Python script into an application using py2app, but when I try to run the app I'm getting this PRAW related error: Exception: Could not find config file in any of: ['/Users/username/CS/Applicationame/dist/applicationname.app/Contents/Resources/lib/python2.7/site-packages.zip/praw/praw.ini', '/User...
Django app shows the same instance every time I hit the server
28,159,360
0
1
98
0
python,django,django-deployment
The built-in development server (that you get by doing python manage.py runserver) will refresh whenever you make a change. Apache will not (by default). You either need to restart apache, or you need to set maximum-requests=1 in your WSGI config. The way to go is to run the built-in dev server for development, and th...
0
0
0
0
2015-01-26T18:32:00.000
2
0
false
28,156,422
0
0
1
1
I have a sample Django app which is being hosted on an Apache2 server using mod_wsgi. Currently I am testing it only on the loopback address (127.0.0.1). So this is what I do: Open a tab and go to the loop back address. And then I work on the Django app. Now when I start another tab and go to the loopback address, th...
Virtualenv installed package not found
28,159,200
0
0
196
0
python,django
Make sure your wsgi file points to the right virtualenv!
0
0
0
0
2015-01-26T21:30:00.000
1
1.2
true
28,159,111
1
0
1
1
I installed a django-secure into a virtualenv using pip. The install was normal. The module shows up in the virtualenv pip list and in virtualenvs/dev/lib/python2.7/site-packages. I get the following error when running my code. ImportError: No module named djangosecure The folder is in there and there is an init. N...
Django Hide Processing Page
28,180,194
1
0
34
0
python,django,django-views
I think the flow would look more like: Question_Page -> Post Data View (processes the data from the question page) -> redirect to Output page (based upon data results). The only page someone would "see" is the "Question Page" and "Output page"... now if processing takes a long time, they could click submit again on the...
0
0
0
0
2015-01-27T21:11:00.000
1
1.2
true
28,180,074
0
0
1
1
I have a generic set up where you take an assessment which kicks you to a processing page which massages the data, stores it, and then funnels you to the correct output page. You never actually see the processing page it runs and sorts you to the results. I'm concerned this could be exploited. Is there a way to hide...
View running application output in the browser, how?
28,188,969
1
0
1,186
0
java,c#,python,ide,desktop-application
You need a web application.Now this web application when loads send request to backend code that backend code will do SSH to remote machine and read the file from specific location.Now that read stream will be send back in response and displayed on web based UI. In these type of application few thinks matters. 1) Like ...
0
1
0
0
2015-01-28T09:34:00.000
2
0.099668
false
28,188,783
0
0
1
1
I have a simple cloud IDE,I want to make it able to build and run applications remotely, the target application's source files will be in a remote server in isolated virtual machine (e.g Windows 8.1,or Ubuntu 14.04). It's not difficult to build that application but how to run it and view its output to users ? What if i...
Right Auth with AngularJS, Django and external API service
28,196,456
0
0
246
0
python,django,angularjs,api
Depending from your needs you should think about storing the token in the session storage in the local storage or in a cookie(in this case the cookie is used as a storage mechanism and not as an authentication mechanism).
0
0
0
0
2015-01-28T15:05:00.000
1
0
false
28,195,547
0
0
1
1
I'm developing my first AngularJS application with Django as backend. My overall architecture is composed of: Public API json-rpc server (from which I must retrive data previous authentication process (the client send a user/password with a POST request, and then, the server response with a token string). Django frame...
Is migration required in a Django application?
28,201,899
2
2
228
0
python,django
Migrations are not required. They can be useful for creating and tracking database changes via code, but Django applications will run properly without them.
0
0
0
0
2015-01-28T20:32:00.000
2
0.197375
false
28,201,859
0
0
1
2
I want to use Django with nothing but legacy databases. Lots of them. I want to use raw SQL in my model(s). Do I need migration to make Django function properly? I don't want to use migration because I don't want Django to do anything with or to my databases. I prefer to use SQL and return data.
Is migration required in a Django application?
28,201,926
2
2
228
0
python,django
No, you don't need to use migrations. (Also, it may be relevant to note that you can use raw SQL, but Django will still set up some things for you so you can use its ORM, even with legacy databases. But migrations are not one of these things it does for you.)
0
0
0
0
2015-01-28T20:32:00.000
2
1.2
true
28,201,859
0
0
1
2
I want to use Django with nothing but legacy databases. Lots of them. I want to use raw SQL in my model(s). Do I need migration to make Django function properly? I don't want to use migration because I don't want Django to do anything with or to my databases. I prefer to use SQL and return data.