Re: Django: Relation does not exist in Postgresql

2015-09-04 Thread Anderson Resende
You need to create that tables at your database. Please run: python manage.py makemigrations python manage.py migrate Try it! -- 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, s

Re: Django Http post and csrf error

2015-03-31 Thread Anderson Resende
In your template put in your form: {% csrf_token %} example: {% csrf_token %} -- 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: Problem at server startup

2015-03-28 Thread Anderson Resende
Put this code on first line in your files.py: # -*- coding: utf-8 -*- Maybe work! -- 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...@g

Re: Strange deployment problem

2015-03-28 Thread Anderson Resende
I don't used mysql,but in postgres for you write in a database your user db needs permission to write. Check that! -- 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

Re: Global access to request.user

2015-03-27 Thread Anderson Resende
Other way is use sessions! Django provide session midleware. You can get the session dict out of the view! Sorry my english, I am a Brazilian guy! > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Global access to request.user

2015-03-27 Thread Anderson Resende
Maybe a global state? Yes! https://docs.djangoproject.com/en/1.7/topics/http/middleware/#init I never did that, but you can try! -- 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

Re: Global access to request.user

2015-03-26 Thread Anderson Resende
You can use middlewares!!! It is a way... -- 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

Re: how to access manager from a model instance?

2015-03-26 Thread Anderson Resende
Can you give a example? be more especific, post some code. -- 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

Re: Max_length of EmailField in django.contrib.auth.models.User

2015-03-22 Thread Anderson Resende
I will give you one more complete example: Custom a User is not easy you need to do many things: In that link django-docs explain all for you and there is an example with email field. https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#a-full-example My tip is: In the docs there is

Re: Max_length of EmailField in django.contrib.auth.models.User

2015-03-22 Thread Anderson Resende
You can inheriant of AbstractBaseUser and define your field: from django.contrib.auth.models import AbstractBaseUser class MyCustomUser(AbstractBaseUser): mail = models.EmailField(max_lenght=254) REQUIRED_FIELDS = ['mail'] # more code Please sorry about my english, I'm a Brazili

Re: Why is appearance of admin page so different between development and deployment servers?

2015-03-22 Thread Anderson Resende
Em production you need to run the command: python manage.py collectstatic and you need configure your production serve like "apache" to read the 'static' folder in you root project. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscrib

Re: Max_length of EmailField in django.contrib.auth.models.User

2015-03-22 Thread Anderson Resende
No, the user class uses 75. You need to change to 254. models.EmailField(max_lenght=254) > > -- 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+unsub

Re: [Python] Problem with arguments given

2015-03-14 Thread Anderson Resende
Change your method: def ask_number(self,question,low,high): response=None while response not in range(low,high): response=int(input(question)) change self to class: This way you can call the method directly from Hand. @classmethod def ask_number(class,question,l