Re: How to save a table in a cell in django models.

2015-12-02 Thread Timothy W. Cook
On Wed, Dec 2, 2015 at 2:27 AM, Billu wrote: > What I want to do is generate a HTML table (alongwith other data viz. > images, text) when somebody opens a page. > > So how would I *save *a table, i.e, what would be the keyword for it eg. > CharField, IntegerField. > > I've googled and people have

Re: Making a field readonly according to the user in admin.py

2015-11-18 Thread Timothy W. Cook
While Jani's admonishments might be considered 'best practice' in some cases. Those do not always cover everyone's use case. I solved a similar issue allowing users with the superuser role to have edit access to some items that other staff do not have access to edit. Use the get_form method of th

Re: Django on CentOS

2015-11-10 Thread Timothy W. Cook
If you have the option use a different Linux distribution. If you must use CentOS this may help with getting Apache and Python (newer than 2.6) working. http://stackoverflow.com/questions/21158918/django-mod-wsgi-psycopg2-improperlyconfigured-error-loading-psycopg2-module I see that since I had

Re: Django w/ XML DOM

2015-09-18 Thread Timothy W. Cook
lxml - I assume using XPath will do what you want. I am not familiar with XML cursor and jaxb. On Fri, Sep 18, 2015 at 9:03 PM, Arnab Banerji wrote: > Hi - I am looking for a way to display XML documents in Django and get the > xml section information from cursor location using XMLCursor like >

Re: Can u tell me how to build restful api project in django

2015-08-14 Thread Timothy W. Cook
Did you follow these instructions? http://www.django-rest-framework.org/tutorial/quickstart/ Spend the time on the tutorial. It will save you time in the long run. On Fri, Aug 14, 2015 at 10:59 AM, HARSHIT GARG wrote: > I am getting the following error: > > ImportError: rest_framework doesn't

Re: Django - Website Bootstrap Design Breaks For Production

2015-07-17 Thread Timothy W. Cook
You may find that even after running collectstatic the dev server doesn't see the static files. You can add the --insecure option to runserver, with DEBUG=False and it should work as expected. On Fri, Jul 17, 2015 at 6:44 AM, Andreas Kuhne wrote: > Hi, > > There is a difference to running the r

Re: Recommend guide to setting up a production server with Django and Python 3

2015-07-10 Thread Timothy W. Cook
This is a couple of years old but I used it for a template and it works great. http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/ On Fri, Jul 10, 2015 at 8:42 AM, Christian Kleineidam < christian.kleinei...@gmail.com> wrote: > Is there a recommended guide to

Re: Testing Setup gives 500, but dev server works okay

2015-05-25 Thread Timothy W. Cook
I should add that the actual error is: selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: {"method":"id","selector":"id_login"} because the main page never loads so it can't find the login button, On Mon, May 25, 2

Testing Setup gives 500, but dev server works okay

2015-05-25 Thread Timothy W. Cook
I have a project that I started, then decided I should apply a TDD approach. Well the user registration and login portion already works but I am attempting to add some tests to it. The user can register, is redirected back to the main page with a Login button. Here is the test code: def test

Re: Improve Performance in Admin ManyToMany

2015-05-20 Thread Timothy W. Cook
#x27;,'dvratio',]:* *formfield.queryset = formfield.queryset.select_related('prj_name')* *return formfield* Reduced the number of queries to 33 and the time to 182ms. Awesome, thanks for the pointers. On Sun, May 17, 2015 at 8:53 PM, Timothy W. Cook wrote:

Re: Improve Performance in Admin ManyToMany

2015-05-17 Thread Timothy W. Cook
On Sun, May 17, 2015 at 4:20 PM, Erik Cederstrand wrote: > > I just noticed you have a typo: > > if db_field.name in ['cluster', ... > > should be: > > if db_field.name in ['clusters', ... > > according to your model definition. > > ​Thanks Erik. Yes, that was a typo. Unfortunately fixin

Re: Improve Performance in Admin ManyToMany

2015-05-16 Thread Timothy W. Cook
On Sat, May 16, 2015 at 5:27 PM, Erik Cederstrand wrote: > > > Den 15/05/2015 kl. 20.54 skrev Timothy W. Cook : > > > > def formfield_for_many_to_many(self, db_field, *args, **kwargs): > > formfield = super(ClusterAdmin, > self).formfield_for_many_to_

Re: File Upload in Django

2015-05-16 Thread Timothy W. Cook
The official docs are a good place to start https://docs.djangoproject.com/en/1.8/topics/http/file-uploads/ This GitHub example is about the newest one available showing the changes in recent Django versions https://github.com/axelpale/minimal-django-file-upload-example On Sat, May 16, 2015 at

Re: Improve Performance in Admin ManyToMany

2015-05-15 Thread Timothy W. Cook
On Fri, May 15, 2015 at 7:25 AM, Erik Cederstrand wrote: > > > I wonder if there is another approach that I can use to solve this? > > Does the suggestion to append select_related() / prefetch_related() to the > queryset in your admin view not work? > ​If I implemented it correctly, it doesn't h

Re: Improve Performance in Admin ManyToMany

2015-05-14 Thread Timothy W. Cook
lds is displayed in the admin. To make sure >>> only one query is executed you must make sure Baz.bars are selected with >>> their related Foo objects: >>> >>> from django.contrib import admin >>> >>> class BazAdmin(admin.ModelAdmin): >>>

Re: Improve Performance in Admin ManyToMany

2015-05-14 Thread Timothy W. Cook
raham wrote: > Are you sure it's the query that's slow and not the template rendering > and/or JavaScript performance? > > > On Wednesday, May 13, 2015 at 12:32:50 PM UTC-4, Timothy W. Cook wrote: >> >> I have a model with 13 M2M relations and some of those have a

Improve Performance in Admin ManyToMany

2015-05-13 Thread Timothy W. Cook
I have a model with 13 M2M relations and some of those have a few thousand instances. This renders rather slowly in the Admin. Thinking about improvements I wonder if it will help to setup prefetch_related queries https://docs.djangoproject.com/en/1.8/ref/models/querysets/#prefetch-related inside

Stale contenttype

2015-05-06 Thread Timothy W. Cook
Django 1.8.1, PostgreSQL 9.3, Python 3.4, Ubuntu I have a project that started under Django 1.4 and I have been migrating through the updates as they were published. At one point (I think under Django 1.5) I installed django-authtools (currently at 1.2.0) I am of course using Django migrations n

Re: Admin Inlines

2015-04-25 Thread Timothy W. Cook
For reference. My mistake is that I really have a ManyToMany relationship and I used this http://www.mc706.com/tip_trick_snippets/18/django-manytomany-inline-admin/ to solve the problem. Thanks to Ryan McDevitt. On Sat, Apr 25, 2015 at 3:11 PM, Timothy W. Cook wrote: > The usage

Admin Inlines

2015-04-25 Thread Timothy W. Cook
The usage of AdminInlines seems backwards to me. At least in the use case I have. I have two models: DvInterval: lower = models.CharField(max_length=110) upper = models.CharField(max_length=110) ... ReferenceRange: ​ ​ ​ ​ ... ​data_range = models.ForeignKey(DvInterval)

Re: Migrations During Development

2015-04-25 Thread Timothy W. Cook
On Sat, Apr 25, 2015 at 2:15 PM, Javier Guerra Giraldez wrote: > > > with South i used to save them to the repo too and push whole to > production. haven't tried Django migrations yet; is there any > difference that make this more appropriate? > > ​Hmmm, good question. That was kind of my quest

Re: Migrations During Development

2015-04-25 Thread Timothy W. Cook
n the Django >> project you are deploying. >> >> On Sat, Apr 25, 2015 at 9:26 AM, Timothy W. Cook wrote: >> >>> Django 1.8 Python 3.4 PostgreSQL 9.3 >>> >>> During development I am creating several migrations. It seems >>> unnecessa

Migrations During Development

2015-04-25 Thread Timothy W. Cook
Django 1.8 Python 3.4 PostgreSQL 9.3 During development I am creating several migrations. It seems unnecessary to keep these since they only exist on my dev machine. Any data that I have created can be thrown away too. Is it safe to delete these migrations (and the database) before deploying to

Re: Version

2015-04-21 Thread Timothy W. Cook
I really doubt a new user wants to install 1.4 After getting your virtualenv setup then use: pip install django to install the latest version. On Tue, Apr 21, 2015 at 9:12 AM, Andreas Kuhne wrote: > Hi, > > First of all, don't use apt-get to install django, you will never get the > version

Re: Django Admin UI Bug - 1.7.3

2015-01-18 Thread Timothy W. Cook
On Sun, Jan 18, 2015 at 5:35 PM, Collin Anderson wrote: > Hi, > > Rename your __unicode__ to __str__. Python 3 doesn't know what > "__unicode__" is. :) > > ​Yep, that did it.​ Interesting that it was working up until now and that my AJAX calls worked either way. > You say this works fine: >

Re: Django Admin UI Bug - 1.7.3

2015-01-18 Thread Timothy W. Cook
="prj_name" means you can't easily change the name of > the project. > > ​Yes, Once created the name cannot be changed, and once an item is assigned to a project the attached items are immutable. Thanks, Tim > Collin > > On Friday, January 16, 2015 at 3:14:55

Re: Django Admin UI Bug - 1.7.3

2015-01-16 Thread Timothy W. Cook
I should also mention that I have some AJAX calls for the same information and they still work fine. So I am quite certain it is in the Admin templates or the Admin properties definitions. On Fri, Jan 16, 2015 at 5:56 PM, Timothy W. Cook wrote: > Is this a bug or did I miss something in

Django Admin UI Bug - 1.7.3

2015-01-16 Thread Timothy W. Cook
Is this a bug or did I miss something in the release notes? ​Moving from 1.6.4 to 1.7.3 the listing in the Admin UI is not resolving a related field now. There are not any model changes involved. Attached are two screen shots named for the versions. I haven't changed the admin code either. Fo

Re: Model to create forms

2015-01-09 Thread Timothy W. Cook
I think you are looking for a way to provide an abstraction like this http://django-forms-builder.readthedocs.org/en/latest/ On Thu, Jan 8, 2015 at 6:52 PM, Lorenzo Bernardi < lorenzo.berna...@lpn.cnrs.fr> wrote: > > Hello, > >> this is what _relational_ databases are built for. if you have two

Re: Multiple levels of user in django application

2014-11-29 Thread Timothy W. Cook
may have different > fields > > > > On Saturday, 29 November 2014 16:49:35 UTC+5:30, Timothy W. Cook wrote: >> >> >> >> On Sat, Nov 29, 2014 at 6:49 AM, Anju SB wrote: >> >>> Actually my application needs to store different information about

Re: Multiple levels of user in django application

2014-11-29 Thread Timothy W. Cook
​ ​There are similar examples you​ find with a search engine. The mailing list and stackoverflow are good places to look. > > On Saturday, 29 November 2014 13:34:49 UTC+5:30, Timothy W. Cook wrote: >> >> >> >> On Sat, Nov 29, 2014 at 3:51 AM, Anju SB wrote: >

Re: Multiple levels of user in django application

2014-11-29 Thread Timothy W. Cook
On Sat, Nov 29, 2014 at 3:51 AM, Anju SB wrote: > Thank you Scot Hacker. > But my application needs more than one user from the same group. > > ​You can have multiple users in a group. That is kind of the definition of a group. :-) See here: https://docs.djangoproject.com/en/1.7/topics/aut

Re: Does Django offers a way to generate data grid from database table like web2py

2014-11-28 Thread Timothy W. Cook
The Django 'admin' section provides this functionality. On Fri, Nov 28, 2014 at 2:55 AM, Sarbjit singh wrote: > What web2py GRID does is, that it takes the SQL table/query as argument, > and return the records satisfying the query. > > Records which are returned are seen in bootstrap enabled ta

Re: Upgrading Django (to 1.7)

2014-11-26 Thread Timothy W. Cook
Excellent resource. Thanks Andrew. On Tue, Nov 25, 2014 at 10:16 PM, Andrew Pinkham wrote: > Hi, > Upgrading Django (to 1.7) Part IV: Upgrade Strategies is now available! > > For the article: > afrg.co/updj17/a4/ > > For all of the material: > afrg.co/updj17/ > > I've also provided a checkli

Re: Webcomponents in Django

2014-11-19 Thread Timothy W. Cook
. Cook wrote: > Maybe I bit off too much to start. IT looks like this may be a better > place to start. > > http://themikelewis.com/2014/10/01/django-and-polymer-the-basics-and-vulcanizing/ > > > ... and not running the Django development server. > > > On Wed, Nov 1

Re: Webcomponents in Django

2014-11-19 Thread Timothy W. Cook
Maybe I bit off too much to start. IT looks like this may be a better place to start. http://themikelewis.com/2014/10/01/django-and-polymer-the-basics-and-vulcanizing/ ... and not running the Django development server. On Wed, Nov 19, 2014 at 12:18 PM, Timothy W. Cook wrote: > > On We

Re: Webcomponents in Django

2014-11-19 Thread Timothy W. Cook
html except the file is named designer.html vs. index.html Thanks, Tim > On Wed, Nov 19, 2014 at 3:02 PM, Timothy W. Cook wrote: > >> At the top of the both the main file where designer is called from and at >> the top of designer.html I have: >> {% load staticfiles

Re: Webcomponents in Django

2014-11-19 Thread Timothy W. Cook
d designer-element.html are both returning 200 even though the url gets longer with each recursion; seems strange to me. Thanks, Tim On Wed, Nov 19, 2014 at 11:02 AM, Timothy W. Cook wrote: > At the top of the both the main file where designer is called from and at > the top of designer.html I

Re: Webcomponents in Django

2014-11-19 Thread Timothy W. Cook
: > looks like the html rendered is making the recursive requests, are you > using {% static %} and {% url 'designer' %} ? > > On Wed, Nov 19, 2014 at 1:53 PM, Timothy W. Cook wrote: > >> >> I have a Django app that I want to include a UI similar to the Po

Webcomponents in Django

2014-11-19 Thread Timothy W. Cook
I have a Django app that I want to include a UI similar to the Polymer designer https://www.polymer-project.org/tools/designer/ Source code here: https://github.com/twcook/TdV-app-designer/tree/tdv plus the components installed via bower. I have built this designer as a standalone app and it wo

Re: Setting up Apache to be the web server for apache for Django 1.7 and python 3.3

2014-10-03 Thread Timothy W. Cook
Of course http://www.giyf.com/ but unless you have some very compelling need to use Apache. This may be a better choice. http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/ I found it to be much easier to setup and maintain. On Fri, Oct 3, 2014 at 9:42 AM,

Re: Rendering XML using XSLT

2014-09-27 Thread Timothy W. Cook
return response ​ ​ ​Thanks for the nudge in the right direction. ​ > > > On 27/09/14 12:37, Timothy W. Cook wrote: > > Some details I forgot are that this is Django 1.6.4, Python 3.4.1. > The 404 error is on http://192.168.1.9:8080/get_xsd/ccd-description.xsl >

Re: Rendering XML using XSLT

2014-09-27 Thread Timothy W. Cook
Some details I forgot are that this is Django 1.6.4, Python 3.4.1. The 404 error is on http://192.168.1.9:8080/get_xsd/ccd-description.xsl On Sat, Sep 27, 2014 at 8:10 AM, Timothy W. Cook wrote: > I have a view that opens an XML file (it happens to be a schema but that > doesn't m

Rendering XML using XSLT

2014-09-27 Thread Timothy W. Cook
I have a view that opens an XML file (it happens to be a schema but that doesn't matter) that specifies a stylesheet. It works as expected when opening the XML file locally. ​The stylesheet isn't applied when viewing the file via Django and I see in Firebug that I am getting a 404 on the styleshee

Re: Any stable and trusted packages for python XML?

2014-09-19 Thread Timothy W. Cook
XML is more complex than JSON and AFAIK there isn't a generic tool to do this. I work with XML all the time with Python/Django and I would only recommend lxml http://lxml.de/ On Fri, Sep 19, 2014 at 9:39 PM, Chen Xu wrote: > Hi Everyone, > I wonder if there is any good, stable and trusted

Re: Admin UI not commiting to DB

2014-07-15 Thread Timothy W. Cook
On Mon, Jul 14, 2014 at 12:44 PM, Tom Evans wrote: > > > Have you ruled out that this is simply a mid air collision? IIRC, > django admin has no mid air collision detection system > > Cheers > > Tom > > Eg if user A loads Item i, user B loads Item i, user A changes > i.foo='hi' and saves item i,

Re: Admin UI not commiting to DB

2014-07-12 Thread Timothy W. Cook
n you > will struggle to debug. Have you tried adding in log statements at key > points to try & see where things go haywire? > > > On Saturday, 12 July 2014 10:52:37 UTC+2, Timothy W. Cook wrote: >> >> Django 1.65, PostgreSQL. >> >> Several users of the admi

Admin UI not commiting to DB

2014-07-12 Thread Timothy W. Cook
Django 1.65, PostgreSQL. Several users of the admin UI in my app have noted that clicking Save or Save and Continue buttons does not always actually save changes to the database. Has anyone else seen this? I do override get_form in admin.py so that I can set some fields as readonly based on a bo

Re: Python 3 Usage

2014-07-07 Thread Timothy W. Cook
I've been using Python 3 with Django for about 8 months. No real problems. Early on I had to patch a couple of add-ons. On Mon, Jul 7, 2014 at 9:10 PM, Richard Eng wrote: > I was wondering how many Django users have switched to Python 3. Are the > majority of users still on Python 2? I'm loo

Re: Problem hiding fields from admin page based on another fields value

2014-05-30 Thread Timothy W. Cook
ways get this > error. I guess it must be something essential I am doing wrong here, since > my obj seems to be none always... > > I have get_form inside my modelAdmin class. > > > On Friday, May 30, 2014 2:06:59 PM UTC+2, Timothy W. Cook wrote: > >> What do you me

Re: Problem hiding fields from admin page based on another fields value

2014-05-30 Thread Timothy W. Cook
','function','mode','simple_function','simple_mode',] except (AttributeError, TypeError) as e: self.readonly_fields = ['published','schema_code'] return super(ParticipationAdmin, self).get_form(request, ob

Re: Problem hiding fields from admin page based on another fields value

2014-05-30 Thread Timothy W. Cook
What do you mean by tri-state? You are using a field that allows three states: TRUE, FALSE and NULL. If I understand the model, readiness would either be TRUE or FALSE. But if you do not want to change your field type to: readiness = models.BooleanField("Readiness", blank=True) then try changin

Re: Problem hiding fields from admin page based on another fields value

2014-05-30 Thread Timothy W. Cook
Is 'readiness' really a tri-state flag? Anyway you may want to test if obj.readiness exists, and is TRUE. if obj.readiness and obj.readiness == TRUE: HTH, Tim On Fri, May 30, 2014 at 7:57 AM, Hilde Rafaelsen wrote: > Hello, > > In my django admin page I want to hide some filelds from users

Re: website statistics

2014-05-22 Thread Timothy W. Cook
On Wed, May 21, 2014 at 4:46 PM, chansonsyiddish wrote: > > Thanks for the suggestion anyway... other ideas? > You can import your logfile data into R and do any analysis you want. Timothy Cook LinkedIn Profile:http://www.linkedin.com/in/timothyway

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-13 Thread Timothy W. Cook
gt; '/data/app/guillem >> -py3-dj17-test/lib64/python3.3/lib-dynload', >> '/opt/rh/python33/root/usr/lib64/python3.3', >> '/opt/rh/python33/root/usr/lib/python3.3', '/data/app/guillem-py3-dj17- >> test/lib/python3.3/site-packa >> ges

Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-12 Thread Timothy W. Cook
I can't imagine virtualenv being a vulnerability risk. AFAIK; All it does is create a set of scripts to isolate the executing Python environment. http://virtualenv.readthedocs.org/en/latest/virtualenv.html In fact, I would almost say that it improves your ability to know EXACTLY what is in your e

Re: django on rhel5 with both python2.4 and python2.7 confusion

2014-05-07 Thread Timothy W. Cook
A good place to start is with this thread: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/django-users/_0RTNcYyCSI/24QinBTEnX8J Be sure to include CentOS in your searches for clues about this setup since many people use CentOS instead of RHEL. HTH, Tim On Wed, May 7,

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-06 Thread Timothy W. Cook
On Tue, May 6, 2014 at 7:01 PM, Guillem Liarte < guillem.lia...@googlemail.com> wrote: > > > But I still get the locale encoding problem. Do you guys have any > suggestions? > > I do not recall the exact error I had with this config (once you corrected those you mentioned) but eventually I had to

Re: Analysis of csv data

2014-04-10 Thread Timothy W. Cook
Uh, R ??? http://cran.r-project.org/doc/manuals/R-intro.html On Thu, Apr 10, 2014 at 7:43 AM, Saransh Mehta wrote: > I need to analyze the incoming data from the csv file and present it to > the user in the best possible way? > What tools do i need to use for analyzing the csv and drawin

"depth" keyword argument has been deprecated. Use related field names instead.

2014-03-12 Thread Timothy W. Cook
I am using django-forms-builder and I am updating it to work with later versions of Django. I get the above deprecation warning. This is the code: forms.py line 367: # Get the field entries for the given form and filter by entry_time # if specified. model = self.fieldentry_model

Re: Template/Form Errors and DynaTree.js

2014-03-01 Thread Timothy W. Cook
the action of the form and the parameters of the form. It > would look something like this: > > function submitForm(form_id) { > var $form = $("#" + form_id); > > $.ajax({ > type: 'POST', > url: $form.attr('action'), > dataType: 'html

Re: Template/Form Errors and DynaTree.js

2014-02-28 Thread Timothy W. Cook
s on the server. When you replace > the html in the div that you want to replace, the user will just get the > validation errors that django creates for you. > > You really don't have to change anything in the view that you are using at > the moment, because it already retur

Re: Template/Form Errors and DynaTree.js

2014-02-27 Thread Timothy W. Cook
he server. When you replace > the html in the div that you want to replace, the user will just get the > validation errors that django creates for you. > > You really don't have to change anything in the view that you are using at > the moment, because it already returns the informa

Re: Tools to document api

2014-02-27 Thread Timothy W. Cook
Are you using the django-rest-framework? See: http://www.django-rest-framework.org/topics/documenting-your-api Swagger works great. On Thu, Feb 27, 2014 at 3:41 AM, wrote: > I have a Django project in which i have written api interface to which i > want to document. > what are the best too

Re: collectstatic is not working

2014-02-27 Thread Timothy W. Cook
I think you need to set STATICFILES_DIRS as well On Thu, Feb 27, 2014 at 10:05 AM, Robin Lery wrote: > Hello, > I have been trying to collect statics from the static folder but, its not > collecting any files. But it did collect the admin files. What's wrong. > Please help me. > > Thank you.

Re: Template/Form Errors and DynaTree.js

2014-02-27 Thread Timothy W. Cook
'enums_annotations': Textarea(attrs={'cols':50, 'rows':5,'wrap':'off'}), 't_code': Textarea(attrs={'cols':15, 'rows':5,'wrap':'off'}), 't_string'

Re: import

2014-02-11 Thread Timothy W. Cook
Welcome to the wonderful world of Python. I suggest that you immerse yourself in http://www.greenteapress.com/thinkpython/ and then take this (free) course next month https://www.coursera.org/course/interactivepython before tackling anything like Django. Best, Tim On Tue, Feb 11, 2014 at 8:2

Re: Custom User

2014-02-02 Thread Timothy W. Cook
deal with this? > > On Sunday, February 2, 2014 4:26:44 PM UTC-2, Timothy W. Cook wrote: > >> I suggest, and I believe it is considered best practice by others. To >> create a profile model for your members with a one to one relationship to >> the user. Basically you do not

Re: Custom User

2014-02-02 Thread Timothy W. Cook
I suggest, and I believe it is considered best practice by others. To create a profile model for your members with a one to one relationship to the user. Basically you do not want anything in the user model that doesn't apply to all users. On Sun, Feb 2, 2014 at 3:27 PM, Henrique Oliveira < h

Re: Problems Setting Up wsgi and Apache

2014-01-27 Thread Timothy W. Cook
On Mon, Jan 27, 2014 at 2:22 PM, Mark Phillips wrote: > > I have this at the top of the apache conf file for the site - > WSGIPythonPath > /home/django/.virtualenvs/inventory_project/lib/python2.7/site-packages/ > > which is the correct path to the site packages directory. Perhaps another > permis

Re: Problems Setting Up wsgi and Apache

2014-01-27 Thread Timothy W. Cook
Mark, I don't know if this will help. But I found (on CentOS) I had to add the 'apache' user to the django users group. Not that it should matter, but it seemed to. This seemed to be easier to add group rw permissions to the django app directory. HTH, Tim On Mon, Jan 27, 2014 at 2:01 PM, Mar

Re: Widget attributes in ModelForm

2014-01-25 Thread Timothy W. Cook
SOLVED: The correct setting on the CBV is: *form_class =* not *form =* On Fri, Jan 24, 2014 at 2:09 PM, Timothy W. Cook wrote: > My widget attribute settings aren't having any effect in the render > template. > > View: > class DvBooleanCreateView(CreateView):

Widget attributes in ModelForm

2014-01-24 Thread Timothy W. Cook
My widget attribute settings aren't having any effect in the render template. View: class DvBooleanCreateView(CreateView): template_name = 'dvboolean_create.html' success_url = '/dashboard' model = DvBoolean form = DvBooleanCreateForm fields = ['prj_name','data_name','lang','v

Re: UUIDField from django-extensions is not available in Class Based Views

2014-01-21 Thread Timothy W. Cook
Tim On Mon, Jan 20, 2014 at 7:55 PM, Timothy W. Cook wrote: > BTW: > > In the actual code the ct_id field is quaoted correctly. It was just an > error in my post here. > > fields =['published','prj_name','data_name','ct_id',] > > >

Re: UUIDField from django-extensions is not available in Class Based Views

2014-01-20 Thread Timothy W. Cook
BTW: In the actual code the ct_id field is quaoted correctly. It was just an error in my post here. fields =['published','prj_name','data_name','ct_id',] On Mon, Jan 20, 2014 at 7:03 PM, Timothy W. Cook wrote: > > I have a web application wh

UUIDField from django-extensions is not available in Class Based Views

2014-01-20 Thread Timothy W. Cook
I have a web application where I use a couple of UUIDFields. In the Admin UI, in function based views and other Python code, these fields work as expected. However, when trying to list them in the 'fields' in a CBV, I get the error: FieldError(message) django.core.exceptions.FieldError: Unknown fi

Re: deploy django and apache mod wsgi

2014-01-20 Thread Timothy W. Cook
On Mon, Jan 20, 2014 at 11:32 AM, parnigot wrote: > Can you post: > > >- your_app.wsgi file >- apache version >- apache configuration >- apache error.log > > > AND! your OS And version. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: ImproperlyConfigured: Error loading psycopg2 module: No module named _psycopg

2014-01-17 Thread Timothy W. Cook
you can do it by this command: > $ sudo apt-get install libapache2-mod-wsgi-py3 > > > Thanks, After some poking around, I did find that this was the problem. Now, recompiling it on CentOS (with Python 3 as an alternate install) was quite another trick. :-) Thanks. > >

ImproperlyConfigured: Error loading psycopg2 module: No module named _psycopg

2014-01-16 Thread Timothy W. Cook
This question is also on Stackoverflow http://goo.gl/LinMue but I thought somene here may have an idea. I have a Django 1.5, Python 2.7 site running under Apache with mod_wsgi on a CentOS 6.4 server. I have rebuilt this site using Django 1.6 and Python 3.3. Deploying it to the same server and c

Re: Jquery Ajax Autocomplete

2014-01-14 Thread Timothy W. Cook
Well, it isn't my site, but the link appears to be working okay. I assume yo mean you had trouble with the example? There is an email link on the site. On Tue, Jan 14, 2014 at 12:22 PM, Ali Hayder wrote: > Hello >> Timothy W. Cook > > Thanks for your quick answere.

Re: Jquery Ajax Autocomplete

2014-01-14 Thread Timothy W. Cook
Okay, take a breath. The world will still be here tomorrow. :-) Then take a look here: http://flaviusim.com/blog/AJAX-Autocomplete-Search-with-Django-and-jQuery/ On Tue, Jan 14, 2014 at 9:37 AM, Ali Hayder wrote: > Hello guys, > In my project's home page I have two forms for input two mobil

Re: Django Website Development issue

2014-01-10 Thread Timothy W. Cook
You could follow the getting started guide: https://docs.djangoproject.com/en/1.6/contents/ But I really suggest that no matter your skill level in any area. Do the outstanding tutorial. It will save you a lot of time in the long run: https://docs.djangoproject.com/en/1.6/intro/tutorial01/ HTH,

Re: DecimalField Problem

2014-01-09 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 10:42 PM, Dennis Lee Bieber wrote: > If Django's "DecimalField" is NOT use Python's Decimal type, I'd be > concerned... Python's Decimal is NOT a "float". > > However, the conversion of a Decimal to/from PostgreSQL might > result in > a floating point value

Re: referencing choices tuples

2014-01-08 Thread Timothy W. Cook
I am not exactly sure what you are asking. However, I believe you want to make this change in the form. hth, Tim On Wed, Jan 8, 2014 at 7:51 PM, Phil Hughes wrote: > I have a typical set of choices tuples that are then referenced in a > choices=... reference in a field definition. It does, w

Re: DecimalField Problem

2014-01-08 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 6:07 PM, Erik Cederstrand wrote: > Den 08/01/2014 kl. 17.56 skrev Daniel Roseman : > > > > Greatly embarrassed, and thanks for clarifying. Will be more careful when > answering next time :-) > > Erik > > Well, Erik. I appreciate you answering even if it wasn't 100% accurate

Re: DecimalField Problem

2014-01-08 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 2:56 PM, Daniel Roseman wrote: > > No, no, no. None of this is true. > > Decimals are not a differently-formatted version of floats. Decimals are > not a built-in datatype in Python, it's true, but they are provided in the > standard library in (not surprisingly) the `decima

Re: DecimalField Problem

2014-01-08 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 1:44 PM, Erik Cederstrand wrote: > Den 08/01/2014 kl. 16.18 skrev Timothy W. Cook : > > > > So, why doesn't it just store a zero? > > Underneath a DecimalField there is a Python float type, and some > equivalent float type in your

DecimalField Problem

2014-01-08 Thread Timothy W. Cook
I have several decimal fields defined in the model like this: min_inclusive = models.DecimalField(_('minimum inclusive'), max_digits=19, decimal_places=10, help_text=_("Enter the minimum (inclusive) value for this concept."), null=True, blank=True) Via the admin interface when I enter a 0 (zero)

Re: How to migrate a project from one DB to another

2013-12-29 Thread Timothy W. Cook
I recommend using South http://south.aeracode.org/ and just follow the tutorial as if it is a new project. Do you need to migrate data as well as the schema? That may require more manual intervention. HTH, Tim On Sun, Dec 29, 2013 at 3:10 AM, Don Fox wrote: > I've started a small project an

Re: Can't Install on Windows 8.1

2013-12-25 Thread Timothy W. Cook
start over? >> >> >> No. What you will find is that virtualenv will pick up whatever python it >> finds and package it in a new self-contained area. At that point you will >> have full control over what additional things get installed. But it needs a >>

Re: How to deploy a django project in the web?

2013-12-24 Thread Timothy W. Cook
Great! Thanks. On Tue, Dec 24, 2013 at 5:18 PM, Mark Moss wrote: > All these 3 DB engines are available: MySQL, PostgreSQL & SQLite. This > have now been updated on this page -- > http://www.gigapros.com/portal/django-hosting > > All 3 Db engines run simultaneously and you may choose to select

Re: How to deploy a django project in the web?

2013-12-24 Thread Timothy W. Cook
On Tue, Dec 24, 2013 at 2:35 PM, Mark Moss wrote: > You may easily deploy your Django Apps on Gigapros. See -- > http://www.gigapros.com/portal/django-hosting > You get full rot access to the server and there's no restrictions at all. > :) > > Hmmm, no PostgreSQL? -- MLHIM VIP Signup: http:

Re: Can't Install on Windows 8.1

2013-12-24 Thread Timothy W. Cook
Since it appears that you are not too familiar with Python, this may help: http://www.youtube.com/watch?v=d_W02OwHa38 Using a virtual environment and pip will a long way to solving many of your issues. It is considered best practice 'for a reason'. https://zignar.net/2012/06/17/install-python-o

Re: django 1.6 + django-allauth facebook authentication error

2013-12-24 Thread Timothy W. Cook
My guess is because FB can't redirect to a localhost URL. You could probably use something like no-ip.org and setup a reachable URL. HTH, Tim On Tue, Dec 24, 2013 at 5:05 AM, Nobin Mathew wrote: > Hi, > > I am writing a django website using django-allauth for facebook > authentication. > > Whe

Re: Template Interactions & NoReverse Match Errors

2013-12-23 Thread Timothy W. Cook
SOLVED: by adding the cur_mgr ID to the get() kwargs. On Mon, Dec 23, 2013 at 8:38 AM, Timothy W. Cook wrote: > > (details below) > I have a dashboard view and from there I want to perform various > activities inside a portion of the page. > So, I built a dashboard base te

Template Interactions & NoReverse Match Errors

2013-12-23 Thread Timothy W. Cook
(details below) I have a dashboard view and from there I want to perform various activities inside a portion of the page. So, I built a dashboard base template to reuse. From the main index.html I call a view with the ID of the user (it is actually an internal role ID not the user id) which calls

Re: How do I test my Django App on my Phone

2013-12-09 Thread Timothy W. Cook
Tim Chase's answer works well for a now and then test. But many static IPs change every 24 hours or so. Plus you will probably want to do this many more times in the future as well as ask others to test it on various devices. . I suggest setting up a URL using no-ip.org or similar service. No

Re: python virtual environment

2013-12-05 Thread Timothy W. Cook
On Thu, Dec 5, 2013 at 2:09 PM, Vibhu Rishi wrote: > I am getting the same error when I did an upgrade of Django to 1.6 . > Reverted back to 1.5 and it seems to work, but i am still searching for a > solution for this to work with 1.6 > > V. > > execute_manager was deprecated: https://docs.django

Re: Save the user from one model to the another model

2013-12-03 Thread Timothy W. Cook
On Tue, Dec 3, 2013 at 9:56 AM, Aamu Padi wrote: > Ok! Plural names. Got it. But I was looking for something more of a > overriding the save method for the Thread class, so that I don't have to do > that in the view. > You can do it in the same view as the message. You aren't limited to working

Re: python virtual environment

2013-12-02 Thread Timothy W. Cook
On Fri, Nov 29, 2013 at 3:44 PM, tino wrote: > > > Hello > > I am trying to run a project that was setup in another server, but getting > the following error. I am using python 2.7, django, virtualenv. So I am > running the project inside a python virtual environment > > > (virtualenv)[web.srv1 da

  1   2   >