Re: Django-Registration/Custom Authentication Issue

2013-04-19 Thread Paul Walsh
James Bennet says above that it is compatible, but the latest django-registration code is not compatible with custom user models. RegistrationProfile, for example, still refers directly to User, whereas the new custom user implementation in Django 1.5 require this to be changed in order to work

Re: Django-Registration/Custom Authentication Issue

2013-04-19 Thread Paul Walsh
These are the changes you'll have to make to django-registration, if you are using AUTH_USER_MODEL in django 1.5 and inheriting from AbstractUser: https://bitbucket.org/prjts/django-registration/commits/ba31fc3053bfca7eb7a19d912882e50e295adc55 On Friday, 19 April 2013 11:52:55 UTC+3, Paul Wals

Re: IDE to practice django template language

2013-04-19 Thread Avraham Serour
I really like pycharm , you should give it a try On Fri, Apr 19, 2013 at 6:42 AM, Apokalyptica Painkiller < apokalyptic...@gmail.com> wrote: > Now i'm using this: http://ninja-ide.org/. I don't know if this is what > you need, but why don't you try it. > > See

Re: IDE to practice django template language

2013-04-19 Thread Thomas Weholt
PyCharm! Allthough commercial - it's great and really worth the prize, and now is on sale for half prize! On Fri, Apr 19, 2013 at 1:52 PM, Avraham Serour wrote: > I really like pycharm , you should > give it a try > > > On Fri, Apr 19, 2013 at 6:42 AM, Apok

Re: Oracle database TextField limitations and Django admin interface queries

2013-04-19 Thread Lauri Savolainen
On Saturday, April 13, 2013 7:54:43 PM UTC+3, Ian wrote: > > On Saturday, April 13, 2013 10:40:10 AM UTC-6, Ian wrote: >> >> On Friday, April 12, 2013 7:43:32 AM UTC-6, Lauri Savolainen wrote: >>> >>> Thank you for the reply, >>> >>> The field is defined in the Django model as: >>> location_descr

Re: IDE to practice django template language

2013-04-19 Thread Tim Cook
On Fri, Apr 19, 2013 at 9:01 AM, Thomas Weholt wrote: > PyCharm! Allthough commercial - it's great and really worth the prize, and > now is on sale for half prize! > > > Hi Thomas, I am a long time WingIDE user and although it supports Django quite well I am wondering if you can contrast it with

Re: IDE to practice django template language

2013-04-19 Thread Thomas Weholt
I have no experience in WingIDE, but PyCharm supports django development with intregrated starting of server, running of unittests, running of commands like syncdb etc. That was a terribly sales-pitch, but search google or youtube and you'll find videos demonstrating its features. Thomas On Fri,

Re: IDE to practice django template language

2013-04-19 Thread william ratcliff
For Wing (professional) you can debug templates, which can be useful. William On Fri, Apr 19, 2013 at 10:02 AM, Thomas Weholt wrote: > I have no experience in WingIDE, but PyCharm supports django development > with intregrated starting of server, running of unittests, running of > commands like

Upload Image

2013-04-19 Thread Hélio Miranda
I'm trying to make a simple uplaod picture but I'm not getting. I'm doing the following way: *Models.py:* *class TestUpload(models.Model):* * model_pic = models.ImageField(upload_to='Temp/', blank=True, null=True)* * * *Forms.py:* class TestUploadForm(forms.Form): image = forms.ImageFiel

Re: Upload Image

2013-04-19 Thread Tom Evans
On Fri, Apr 19, 2013 at 3:14 PM, Hélio Miranda wrote: > I'm trying to make a simple uplaod picture but I'm not getting. I'm doing > the following way: > > Models.py: > class TestUpload(models.Model): > model_pic = models.ImageField(upload_to='Temp/', blank=True, null=True) > > Forms.py: > cla

Re: Upload Image

2013-04-19 Thread Hélio Miranda
I draw the picture and then when I submite, gives me the following error: *'TestUploadForm' object has no attribute 'save'* -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send a

Can't enter admin site

2013-04-19 Thread Alex Lee
Hi guys, I just started the second tutorial! I'm trying to connect to the admin site, but when I go to http://127.0.0.1:8000/admin after I runserver, I get the same "Welcome to django!" screen that I get if I would just connect to http://127.0.0.1:8000/. The tutorial says that the admin site is

Re: Can't enter admin site

2013-04-19 Thread Jonathan Harris
Hello Alex Just to see how far you have gone: Have you uncommented 'django.contrib.admin' in settings.py and run syncdb? Also, have you uncommented the relevant lines in urls.py? On Fri, Apr 19, 2013 at 4:17 PM, Alex Lee wrote: > Hi guys, I just started the second tutorial! I'm trying to con

Re: Upload Image

2013-04-19 Thread Tom Evans
On Fri, Apr 19, 2013 at 4:16 PM, Hélio Miranda wrote: > I draw the picture and then when I submite, gives me the following error: > > 'TestUploadForm' object has no attribute 'save' > Your form has no save() method. What do you want to happen when you call save()? If you want to save the image a

Re: Can't enter admin site

2013-04-19 Thread Tom Evans
On Fri, Apr 19, 2013 at 4:17 PM, Alex Lee wrote: > Hi guys, I just started the second tutorial! I'm trying to connect to the > admin site, but when I go to http://127.0.0.1:8000/admin after I runserver, > I get the same "Welcome to django!" screen that I get if I would just > connect to http://127

Joining Geo Tables with non-Geo Tables

2013-04-19 Thread Val Neekman
Folks, Unfortunately joining tables are possible only (my experience) when all your tables are of the same kind. Either they all have to be Geo or all have to be non-Geo tables. Now, the question is if anyone has tried the new custom user Model in 1.5 while using the GeoManager. If so, how did y

Re: Django-Registration/Custom Authentication Issue

2013-04-19 Thread Lee Hinde
Thanks. On Fri, Apr 19, 2013 at 4:41 AM, Paul Walsh wrote: > These are the changes you'll have to make to django-registration, if you > are using AUTH_USER_MODEL in django 1.5 and inheriting from AbstractUser: > > > https://bitbucket.org/prjts/django-registration/commits/ba31fc3053bfca7eb7a19d9

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Been changing and now have the following code: Models.py: *class Document(models.Model):* * docfile = models.FileField(upload_to='documents/%Y/%m/%d')* Forms.py: *class DocumentForm(forms.Form):* *docfile = forms.FileField()* Views.py: *def index(request):* *if request.method == 'POS

Re: Upload Image

2013-04-19 Thread carlos
Hi se this code * fnewdoc = Document(docfile = request.FILES['docfile'])* * newdoc.save()* * * *diferent name fnewdoc != newdoc* * * *Cheers* On Fri, Apr 19, 2013 at 10:31 AM, Hélio Miranda wrote: > Been changing and now have the following code: > > Models.py: > *class Document(models.Model):*

Re: Upload Image

2013-04-19 Thread Hélio Miranda
has not changed and continues to keep me in the picture anywhere ... -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. T

Re: Upload Image

2013-04-19 Thread Peith Vergil
Maybe DocumentForm should inherit from ModelForm: *class DocumentForm(forms.ModelForm): class Meta: model = Document* -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it,

How to add Django project to sys.path?

2013-04-19 Thread Cody Scott
I am trying to use apache to serve my development site locally. I am trying to implement download functionality and figured since it was best done through a web server that I would just serve the with apache from now on. Is this recommended to start using your django site with a web server earl

Re: Upload Image

2013-04-19 Thread Hélio Miranda
I still have the same problem. My question is whether I have the code, the image would be saved in? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+

Re: Upload Image

2013-04-19 Thread Peith Vergil
Try this: In your forms.py *class DocumentForm(forms.ModelForm): class Meta: model = Document* *...* In your views.py *def index(request): if request.method == 'POST': form = DocumentForm(request.POST, request.FILES) if form.is_valid(): form.sa

Re: Upload Image

2013-04-19 Thread Hélio Miranda
So it gives me an error: local variable 'form' referenced before assignment in views.py -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr.

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Can I have the ill-defined folder? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email t

Re: Upload Image

2013-04-19 Thread Peith Vergil
the *else:* should be part of *if form.is_valid():*, so just indent it. On Sat, Apr 20, 2013 at 2:13 AM, Hélio Miranda wrote: > So it gives me an error: > > local variable 'form' referenced before assignment > > > in views.py > > -- > You received this message because you are subscribed to the

Re: Upload Image

2013-04-19 Thread Hélio Miranda
My whole code including the settings are here: http://plnkr.co/edit/neqmvI13prMySMtHQHta And my structure is this: What do you think could be wrong? -- You received this message becau

Re: Upload Image

2013-04-19 Thread Peith Vergil
Try this in your view: from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from models import Document from forms import DocumentForm def index(request): if re

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Is giving an error of syntax and I do not see where ... Says it is on line 19 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegrou

Add user to authors on model save in admin form

2013-04-19 Thread Laurent GARTNER
Hi, I’m in trouble with model admin. I’ve create a CMS with Django and I try to add the last article editor, but it doesn’t work if the user don’t add his name in the field. In model.py class Article(models.Model): … author = models.ManyToManyField(User, ve

Re: Upload Image

2013-04-19 Thread Charly Román
def index(request): if request.method == 'POST': form = DocumentForm(request.POST, request.FILES) if form.is_valid(): form.save() return render_to_response('index.html', {'form': form}) else: form = DocumentForm() return render_to_res

Re: How to add Django project to sys.path?

2013-04-19 Thread Felipe Brunelli de Andrade
You can try to use that! that's works for me! import os # Make filepaths relative to settings. ROOT = os.path.dirname(os.path.abspath(__file__)) path = lambda *a: os.path.join(ROOT, *a) STATIC_ROOT = path('static') MEDIA_ROOT = path('media') --- Felipe Brune

Re: How to add Django project to sys.path?

2013-04-19 Thread Cody Scott
I followed getting started with djano's settings suggestions. This is what I currently have # here() gives us file paths from the root of the system to the directory # holding the current file. here = lambda * x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x) PROJECT_ROOT = here(".

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Gives the following error Charly Blog.views.index The view did not return an HttpResponse object. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+un

Re: Upload Image

2013-04-19 Thread Charly Román
def index(request): if request.method == 'POST': form = DocumentForm(request.POST, request.FILES) if form.is_valid(): form.save() return render_to_response('index.html', {'form': form}) else: form = DocumentForm() return render_to_respons

Re: Upload Image

2013-04-19 Thread Hélio Miranda
Gives no error But do not know where to send the image and sends Do not put the picture in the ... Does anything in the settings? Or have a folder in the wrong place? My folder structure is right? -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Upload Image

2013-04-19 Thread carlos
try this minimun changed = views === def index(request): if request.method == 'POST': form = DocumentForm(request.POST, request.FILES) if form.is_valid(): form.save() return HttpResponseRedirect('/') else: form = DocumentForm() re

Re: How to translate database content?

2013-04-19 Thread Daniel Krol
There isn't anything built into Django to translate the content of models. This is because the GNU gettext system that Django uses for translation stores the original->translation mappings in a "compiled" file which only changes between restarts of the server. That means anything you dynamically

Re: How to translate database content?

2013-04-19 Thread Daniel Krol
Oh, just to be clear, the hack involves putting the content into the template, and marking it for translation. On Friday, April 19, 2013 1:57:44 PM UTC-7, Daniel Krol wrote: > > There isn't anything built into Django to translate the content of models. > This is because the GNU gettext system th

Re: How to translate database content?

2013-04-19 Thread Cody Scott
I installed dbgettext and it allows you to mark model fields and then export them with dbgettext_export. Then when you run django-admin.py makemessages it includes the content in the .po file. Then you use django-admin.py compilemessages like normal. The only problem I am having is that only thre

Re: Help with integration of bootstrap and Django 1.4.3

2013-04-19 Thread Paras Nath Chaudhary
How I do this is in settings.py: PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) STATIC_ROOT = os.path.join(PROJECT_ROOT, '../static') STATIC_URL = '/static/' STATICFILES_DIRS = ( # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes,

Re: Upload Image

2013-04-19 Thread Michael Hernandez
Hi Miranda, If I understand correctly. Your code is working now but you cannot find the Image??? The image is currently being sent to the database. It is being store in a record in the table. On Friday, April 19, 2013 3:21:02 PM UTC-4, Hélio Miranda wrote: > > Gives no error > But do

Re: How to translate database content?

2013-04-19 Thread Michael Hernandez
Can you clarify. I wouldnt recommend using dbgettext implentation seems way too complex for your needs currently and it is only in 0.1 according to readthedocs. One I might suggest that looks simple enough in implementation is vinaigrette https://github.com/ecometrica/django-vinaigrette Very s

Re: Upload Image

2013-04-19 Thread Michael Hernandez
Grr i accidentally pressed enter before finishing the message Since its in the database it is not available in your filesystem or for immediate display. to check if its there ./manage.py shell import yourmodel as Document print Document.objects.all() i would suggest researching pythons mo