Re: I encountered a core exception and need help configuring for a database. My OS is Ubuntu 12.10 32 bit

2013-03-21 Thread hugh Manchu
CORRECTION; I gave it a shot Bill an thanks for the reply btw ... this also id not work I pasted what i did in the terminal. manage.py NOT settings.py is nested in /home/lightning/Docments/django-works/mysite/manage.py. settings.py is one down On Thu, Mar 21, 2013 at 10:51 PM, hugh Manchu

Re: I encountered a core exception and need help configuring for a database. My OS is Ubuntu 12.10 32 bit

2013-03-21 Thread hugh Manchu
I gave it a shot Bill an thanks for the reply btw ... this also id not work I pasted what i did in the terminal. settings.py is nested in /home/lightning/Docments/django-works/mysite/manage.py. settings.py is one down On Thu, Mar 21, 2013 at 1:39 PM, Bill Freeman wrote: >

Re: I encountered a core exception and need help configuring for a database. My OS is Ubuntu 12.10 32 bit

2013-03-21 Thread hugh Manchu
ightning@rigel5:~$ cd /home/lightning/Documents/django-works/mysite/ lightning@rigel5:~/Documents/django-works/mysite$ pathToDirectoryContainingManage_py$ python manage.py diffsettings pathToDirectoryContainingManage_py$: command not found lightning@rigel5:~/Documents/django-works/mysite$

Im having trouble accessing irc.freenode.net

2013-03-21 Thread Lightning
'Where to get help: If you’re having trouble going through this tutorial, please post a message to django-users or drop by #django on irc.freenode.net to chat with other Django users who might be able to help.'

Re: Can't store valid JSON in JSONField because of SubfieldBase/to_python issues

2013-03-21 Thread Brad Jasper
I ended up moving this to the Django bug tracker thinking it was an issue with Django itself: https://code.djangoproject.com/ticket/20090 Someone over there pointed me in the right direction: You need to subclass SubfieldBase and call your own method instead of to_python. You can pass the

Re: memory leak in django 1.5

2013-03-21 Thread Craig de Stigter
Karen Tracey saves the day! Thanks so much, seems likely that's it :) Craig de Stigter On Friday, March 22, 2013 2:25:04 PM UTC+13, Karen Tracey wrote: > > On Thu, Mar 21, 2013 at 9:00 PM, Craig de Stigter > > wrote: > >> Hi everyone >> >> (cross-posted because this seems

Re: memory leak in django 1.5

2013-03-21 Thread Craig de Stigter
Karen Tracey saves the day! Thanks so much, seems likely that's it :) Craig de Stigter On Friday, March 22, 2013 2:25:04 PM UTC+13, Karen Tracey wrote: > > On Thu, Mar 21, 2013 at 9:00 PM, Craig de Stigter > > wrote: > >> Hi everyone >> >> (cross-posted because this seems

Automated Django benchmarking with New Relic

2013-03-21 Thread Alan Johnson
I've got a Django web app with a complicated data model that's experiencing performance issues. Using New Relic, I was pretty much instantaneously able to isolate what the problem to a particular query. But there are a number of different solutions I can try. What I'd like to do is be able to

Re: Inspecting form errors in a view

2013-03-21 Thread Aubrey Stark-Toller
On Thu, Mar 21, 2013 at 03:40:39PM -0700, Rainy wrote: > I believe you can just set self.my_flag = foo in clean method and then > check for Cheers for the reply. I suspect my original mail could have clearer. Just setting attributes when checks fail seems to me to be the best way to do this,

Python problem

2013-03-21 Thread James
Hey there, Did first Django app and everything worked find, however my computer crashed and after restoring it each time I try to execute any .py file in command prompt it says syntax error or that the module doesnt exist... Would you know any reasons for this? Python is still installed and

Re: memory leak in django 1.5

2013-03-21 Thread Karen Tracey
On Thu, Mar 21, 2013 at 9:00 PM, Craig de Stigter wrote: > Hi everyone > > (cross-posted because this seems relevant to both django-users and > developers, and both might have experienced this problem) > > We've noticed a gradual increase in memory usage for our apache

memory leak in django 1.5

2013-03-21 Thread Craig de Stigter
Hi everyone (cross-posted because this seems relevant to both django-users and developers, and both might have experienced this problem) We've noticed a gradual increase in memory usage for our apache processes since upgrading to django 1.5. Here is a graph

Re: Inspecting form errors in a view

2013-03-21 Thread Rainy
On Thursday, March 21, 2013 5:07:36 PM UTC-4, aub...@deepearth.co.uk wrote: > > Hello, > > I have form class that has a relatively lengthy clean method which does > field > validation (as the validity of fields depends on the values of fields) as > well > setting error messages on the form

possible ModelMultipleChoiceField bug

2013-03-21 Thread Josh Cartmell
Today I noticed that while this breaks things complaining about an unexpected kwarg empty_label: some_field = forms.ModelMultipleChoiceField( widget=forms.CheckboxSelectMultiple(), queryset=SomeM2mField.objects.all(), empty_label='empty') doing the following in a form's init works

Re: Django split setting and environment variables

2013-03-21 Thread Mike Dewhirst
On 22/03/2013 7:58am, Alan Johnson wrote: I think hardcoding local machine development passwords is fine, but it's still better to store the production passwords in a key-value file that stays out of source control and is permissioned such that only authorized developers can directly access the

Inspecting form errors in a view

2013-03-21 Thread aubrey
Hello, I have form class that has a relatively lengthy clean method which does field validation (as the validity of fields depends on the values of fields) as well setting error messages on the form itself. I also intend to be part of an app used in multiple views in a few projects. I want to

Conditionally defined model field in abstract model

2013-03-21 Thread Alan Johnson
I've got an abstract model in my project that I want to use to define a field by default on concrete subclasses, but also to allow that field to be redefined as something other than the default dynamically. All of this works right now: class classproperty(object): """

Re: Django split setting and environment variables

2013-03-21 Thread Tim Cook
I just picked up a copy of "Two Scoops of Django". It covers this very, and much more in the area of project setup and management with Django. Some great lessons learned in this book. Well worth the investment. See the Django resources page for the link. HTH, --Tim On Thu, Mar 21, 2013 at

Re: PostgresSQL or MySql with django?

2013-03-21 Thread Alan Johnson
You don't have to have the databases set up at the same time for the django-extensions dumpscript method (nor for the dumpdata method). I haven't used it myself, but as I understand it, the script will contain the data you need. 1. Create the script with existing MySQL running 2.

Re: Django split setting and environment variables

2013-03-21 Thread Alan Johnson
I think hardcoding local machine development passwords is fine, but it's still better to store the production passwords in a key-value file that stays out of source control and is permissioned such that only authorized developers can directly access the server or the credential file. Of course

Re: I encountered a core exception and need help configuring for a database. My OS is Ubuntu 12.10 32 bit

2013-03-21 Thread Bill Freeman
Setting an environment variable is done by saying something like: lightning@rigel5:~$ export DJANGO_SETTINGS_MODULE='mysite.settings' assuming that your settings.py file is in a directory named "mysite", in turn in the current directory (your home directory, if I interpret your prompt string

Re: PostgresSQL or MySql with django?

2013-03-21 Thread Shawn Milochik
On Thu, Mar 21, 2013 at 3:44 PM, Lachlan Musicman wrote: > Frocco, > > No, he's saying you can have two databases set up at the same time. > You can have X databases (I presume). > > Cheers > L. > > On 22 March 2013 01:13, frocco wrote: >> Hi Alan, >> >> so

Re: PostgresSQL or MySql with django?

2013-03-21 Thread Lachlan Musicman
Frocco, No, he's saying you can have two databases set up at the same time. You can have X databases (I presume). Cheers L. On 22 March 2013 01:13, frocco wrote: > Hi Alan, > > so you are saying I should connect django to mysql first and then generate > the script. > Then

Re: Django split setting and environment variables

2013-03-21 Thread Bill Freeman
Are you doing this for password security? If so, note that, while not quite as easy as scraping command line argument, your environment is avilable via /dev/mem, and is trivially available to any Trojan that an attacker can convince this shell or any of its children (such as Django or any

Re: Django on Mediatemple DV (4.0) in Virtualenv

2013-03-21 Thread Bill Freeman
Have you considered a reverse proxy to something like gunicorn? The way that I know how to do this involves mod_rewrite - I don't know of of the top of my head whether it also requires mod_proxy. Are these available to you. I understand that gunicorn is to be preferred to fastcgi, which I

Re: I encountered a core exception and need help configuring for a database. My OS is Ubuntu 12.10 32 bit

2013-03-21 Thread Lightning
On Wednesday, March 20, 2013 11:50:49 PM UTC-7, Lightning wrote: > > > > > ** > > [image: enter image description here]I need help configuring for a > database.

Re: Django problem:AttributeError:Manage isn't accessible via Link instances

2013-03-21 Thread Tom Evans
On Thu, Mar 21, 2013 at 7:49 AM, simon xue wrote: > Hi,When I read the book named "Learning Website Development With > Django",step by step to doing the example,When I read to page 31,"To get an > object by ID,type the following:>>>Link.object.get(id=1) " I got

Re: Django problem:AttributeError:Manage isn't accessible via Link instances

2013-03-21 Thread Matt Woodward
On Thursday, March 21, 2013 12:49:45 AM UTC-7, simon xue wrote: > > When I read to page 31,"To get an object by ID,type the following: > >>>Link.object.get(id=1) Unless this is just a typo that should be objects plural: Link.objects.get(id=1) -- You received this message because you are

Django split setting and environment variables

2013-03-21 Thread demet8
I have a common.py, dev.py, and prod.py for my Django settings files. All files inherit from common.py. I want to keep my database passwords, database URL, etc stored as environment variables. I have researched the topic but I am not sure If I have a clear understanding of it. I am hoping I

Re: Django on Mediatemple DV (4.0) in Virtualenv

2013-03-21 Thread Tim Walzer
Thats what I was afraid of. Unfortunately Media Temple DVs come pre-installed with Plesk which in turn comes pre-installed with weird versions of different software packages, none of which are mod_wsgi. At this point I have not figured out a way to install mod_wsgi without breaking the

Re: PostgresSQL or MySql with django?

2013-03-21 Thread frocco
Hi Alan, so you are saying I should connect django to mysql first and then generate the script. Then connect django to postgresql and do the import? On Thursday, March 21, 2013 9:58:37 AM UTC-4, Alan Johnson wrote: > > I want to echo the support for Postgres. I find it to be a bit more arcane

RE: Apache JQuery deployment advice

2013-03-21 Thread Sells, Fred
I do use CVS for source code control and have upgrading to git on my which list. Changing from a binary build...deploy model to an ASCII deploy model does provide the opportunity to move out of the stone ages, just need to carve out some time/approval for git. I'm still wrapping my head

Re: PostgresSQL or MySql with django?

2013-03-21 Thread Alan Johnson
I want to echo the support for Postgres. I find it to be a bit more arcane than MySQL, but even in an extremely DB intensive app, Django's ORM is so slick that I rarely have to muck around in Postgres land. I think it's * slightly* better supported by Django, if you need to use things like

Re: PostgresSQL or MySql with django?

2013-03-21 Thread frocco
Yes, I used pip I get this error. py-mysql2pgsql' is not recognized as an internal or external command On Thursday, March 21, 2013 9:35:54 AM UTC-4, Patrick Craston wrote: > > I have found the py-mysql2pgsql to work without problems. > > > > Did you install it using “pip install

Re: PostgresSQL or MySql with django?

2013-03-21 Thread Tom Evans
On Thu, Mar 21, 2013 at 1:06 PM, frocco wrote: > Has anyone used this? > > https://github.com/lanyrd/mysql-postgresql-converter/ > > I cannot get this working, says cannot find the file > Why not use dumpdata as I suggested? Add your postgresql database connection in Django as

RE: PostgresSQL or MySql with django?

2013-03-21 Thread Patrick Craston
I have found the py-mysql2pgsql to work without problems. Did you install it using "pip install py-mysql2pgsql" (if you are using a virtualenv make sure you are running it from there or have activated the virtualenv)? No command found suggests there is a problem with your path and it can't

Re: Django 1.5 CBV - DeleteView - CustomQuery

2013-03-21 Thread Tom Christie
> Is there a site, where I can found such things like What happens in a CBV View? http://ccbv.co.uk is really great resource. Can't recommend it highly enough. On Thursday, 21 March 2013 13:23:05 UTC, Christian Schmitt wrote: > > Hi, yeah that definitly helps. > I didn't found a good site

Re: Django 1.5 CBV - DeleteView - CustomQuery

2013-03-21 Thread Christian Schmitt
Oh, yeah you gave me a good idea, but no, DELETE is fine. Since I wanted to do an ajax request anyway. Am Donnerstag, 21. März 2013 14:22:59 UTC+1 schrieb Tom Christie: > > Actually you'll probably want the `delete` method to be a `post` instead, > but either way hopefully it'll give you the

Re: Django 1.5 CBV - DeleteView - CustomQuery

2013-03-21 Thread Christian Schmitt
Hi, yeah that definitly helps. I didn't found a good site where CBVs getting described in that way. Is there a site, where I can found such things like What happens in a CBV View? It's way easier to understand the whole CBV thing. Btw. FBVs are way easier than CBVs but with FBVs I need to copy

Re: Django 1.5 CBV - DeleteView - CustomQuery

2013-03-21 Thread Tom Christie
Actually you'll probably want the `delete` method to be a `post` instead, but either way hopefully it'll give you the right idea. On Thursday, 21 March 2013 13:11:44 UTC, Tom Christie wrote: > > In cases like this, rather than rely on overriding the default behavior of > the DeleteView, > I'd

Re: Django 1.5 CBV - DeleteView - CustomQuery

2013-03-21 Thread Tom Christie
In cases like this, rather than rely on overriding the default behavior of the DeleteView, I'd recommend writing your own base class. It'll be more explicit and more obvious exactly what is going on... from django.views.generic import View class MarkDeletedView(View): """

Re: PostgresSQL or MySql with django?

2013-03-21 Thread frocco
Has anyone used this? https://github.com/lanyrd/mysql-postgresql-converter/ I cannot get this working, says cannot find the file On Thursday, March 21, 2013 8:14:04 AM UTC-4, frocco wrote: > > I have not been able to get this to work. > Says no command found. > > I must say, porting Mysql data

Re: Looking for best practices regarding Development and production server paths

2013-03-21 Thread DJ-Tom
Am Donnerstag, 21. März 2013 13:04:53 UTC+1 schrieb Tom Evans: > > In my settings.py, I set the path to the project template folder and > project static files like so: > > import os.path > ROOT = os.path.abspath(__file__).rsplit(os.path.sep, 2)[0] > TEMPLATE_DIRS = ( > os.path.join(ROOT,

Re: Looking for best practices regarding Development and production server paths

2013-03-21 Thread DJ-Tom
> > On Thu, Mar 21, 2013 at 5:05 PM, DJ-Tom >wrote: > Simple, you maintain two settings.py files, make one with Dev_settings.py > and two with Prod_settings.py. > You can run dev and production applications like this > > python manage.py runserver

Django 1.5 CBV - DeleteView - CustomQuery

2013-03-21 Thread Christian Schmitt
Hello guys, I have a question about the django CBV DeleteView, I want to use it but not delete the element, i just want to set a delete_date so that it isn't visible anymore. With FBV my view looked like this: def delete(request, customer_id): customer = get_object_or_404(Customer,

Re: PostgresSQL or MySql with django?

2013-03-21 Thread frocco
I have not been able to get this to work. Says no command found. I must say, porting Mysql data to Postgresql is a big pain on a mac. I am almost inclined to stay with mysql. I googled for an easy solution, but could not find anything except dbconvert for 100.00 On Wednesday, March 20, 2013

Re: Citing Django

2013-03-21 Thread Casey Greene
Sorry -- I guess I didn't mean the manual of style part, but instead the various fields. Thanks for your help. Embarrassingly I just realized that apparently that bug is one that I filed a couple years ago. Thanks again! Casey On Wed, Mar 20, 2013 at 7:58 PM, Russell Keith-Magee

Re: Looking for best practices regarding Development and production server paths

2013-03-21 Thread Tom Evans
On Thu, Mar 21, 2013 at 11:35 AM, DJ-Tom wrote: > Hi, > > I'm still a beginner and currently I'm trying to get more familiar with > Django. > > I'm looking for any more detailed best-practices-type description on how the > development cycle is meant to be managed. > > In

Re: [ver. 1.5] Specifying custom User model (extends AbstractUser) doesn't work

2013-03-21 Thread Lewis Taylor
And this is why I learnt the names of many of those major in the Django community! Now if I post after them, it's mostly to say. Yes I agree. Like I'm doing now :-) On Wednesday, 24 October 2012 05:02:02 UTC+1, Surya Mukherjee wrote: > > Django's standard User class isn't sufficient for my

django ImageField ignores upload_to kwarg

2013-03-21 Thread tomasz ducin
I've fallen into a problem with resolving the correct url of uploaded images. I've made sure that my routing/templates work correctly and the problem is somewhere inside the model layer. This is my model class: from django.db import models from tinymce.models import HTMLField class

Django problem:AttributeError:Manage isn't accessible via Link instances

2013-03-21 Thread simon xue
Hi,When I read the book named "Learning Website Development With Django",step by step to doing the example,When I read to page 31,"To get an object by ID,type the following:>>>Link.object.get(id=1) " I got this error: "Traceback : File "",line 1,in

I encountered a core exception and need help configuring for a database. My OS is Ubuntu 12.10 32 bit

2013-03-21 Thread Lightning
** [image: enter image description here]I need help configuring for a database. Is there a paper I can read that will give me an overview on this procedure? I

Re: Looking for best practices regarding Development and production server paths

2013-03-21 Thread Sreenivas Reddy T
On Thu, Mar 21, 2013 at 5:05 PM, DJ-Tom wrote: > Hi, > > I'm still a beginner and currently I'm trying to get more familiar with > Django. > > I'm looking for any more detailed best-practices-type description on how > the development cycle is meant to be managed. > > In

Looking for best practices regarding Development and production server paths

2013-03-21 Thread DJ-Tom
Hi, I'm still a beginner and currently I'm trying to get more familiar with Django. I'm looking for any more detailed best-practices-type description on how the development cycle is meant to be managed. In settings.py, there are paths like TEMPLATE_DIRS and STATICFILE_DIRS, how is this

Re: Database setup Issue

2013-03-21 Thread Antoni Aloy
You have to create first the database in Postgresql, give it a name and a password, and configure it to allow connections. Then you have to configure the database settings with the database name, ip, user and password. If you're doing the tutorial is much better to stay in sqlite3, so you'll have

Database setup Issue

2013-03-21 Thread Kamalakannan Srinivasan
Hi, I installed PostgreSQL 8.4.16 and was trying to set up the database as specified in the tutorial under djangoproject.com. I gave the Engine name as 'django.db.backends.postgresql_psycopg2' and Name as 'PostgreSQL' and ran the python manage.py syncdb command. But it gave the error

Re: Can Django do this?

2013-03-21 Thread Antoni Aloy
Hi Harry, Please hava a look at: http://www.apibaleares.com http://www.trobacaca.com Both are made with Django, the first one with 1.4.x and de second actually is 1.2 and initially was 0.96 :) They have the full front-end plus a customized backend to allow people to upload properties and