Re: ERROR IndentationError: unindent does not match any outer indentation level

2019-12-03 Thread Tafadzwa Marshal
make sure the "objects=models.GeoManager()"  statement aligns with the
statement "location=models.PointField(sid=4326)"

On Tue, Dec 3, 2019 at 6:30 AM EMPOWER EXCEL  wrote:

> PLEASE PUSH ME UP TO CORRECT THIS PROBLEM:
>
> class Alerts(models.Model):
> name = models.CharField(max_length=20)
> location = models.PointField(srid=4326)
> objects = models.GeoManager()
>
>
> self.models_module = import_module(models_module_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
> import_module
> __import__(name)
>   File "/home/flavien/MyProjects/alertprot/ZSalertprot/models.py", line 11
> objects = models.GeoManager()
>   ^
> IndentationError: unindent does not match any outer indentation level
>
> --
> FLAVIEN HERI
>
> *Information management AscociateUNHCR-Kinshasa*
> Tél:+243978587009
> Skype: flavien.heri1
> Facebook: flavien semi
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAG3GEnzWm_4wAcFboaT%3Dn8OD%3DC1cigm%2B9N-%2Bvib8pin2Uv7BCA%40mail.gmail.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFgO-6jn5dr-hBM5_SA6kZFiNLi4rk%2B-5ZnzNsbbErmfWpVeHw%40mail.gmail.com.


Re: Styling in Django

2019-12-03 Thread Tafadzwa Marshal
thanks

On Tue, Dec 3, 2019 at 6:40 AM Thiago Luiz Parolin 
wrote:

> My last project materializecss uses materialize with great success and to
> stylizing forms i am using django-materializecss-form
>
> Em ter., 3 de dez. de 2019 às 10:52, Alan Gómez 
> escreveu:
>
>> You can work with materializecss In django. You must configure the static
>> path and put the materializecss files in these path.
>>
>> At night, I can send you an example.
>>
>> Regards.
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/74571e79-91d6-4fb8-b03f-1195893bfc91%40googlegroups.com
>> .
>>
>
>
> --
> Thiago Luiz Parolin
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANbmKys45f1c8s4W5SK0qDXUOJHBcRtq2Eo9LvQ9shz2%3DOBoAA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFgO-6hWOhj6YrnFjpFz9bH1W%2BynA71uXh0QmB3JijaTjhJMig%40mail.gmail.com.


Re: Styling in Django

2019-12-09 Thread Tafadzwa Marshal
hello. Can you send that Materialize tutorial

On Wed, Dec 4, 2019 at 3:27 AM Akshay Deep  wrote:

> https://vacancyjobalert.com/”>VacancyJobAlert.Com
>
> On Tuesday, December 3, 2019 at 7:16:34 PM UTC+5:30, marshalx4 wrote:
>>
>> How can I use Materialize CSS with Django? Seems like bootstrap is the
>> only framework that works with little to no hassle at all.
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/70b29d0a-0eb4-4edb-9a5d-b76c9cc62758%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFgO-6gVMQ44dnPFrOUhZ0_PVk5nNT0NoqZ-jsWsVvssi%3DFv6Q%40mail.gmail.com.


Re: Difficulty with Tutorial Part 2

2019-12-09 Thread Tafadzwa Marshal
I advice you to learn learn Python Language first before you start messing
with Django.

On Mon, Dec 9, 2019 at 2:19 AM Bruckner de Villiers <
bruckner.devilli...@gmail.com> wrote:

> Thank you Daniel. I believe that issue started with VSCode automatically
> inserting “from date time import date time” after I hit enter on “import
> date time”.
>
> Thank you for the quick response.
>
> Bruckner
> 0836251086
>
> On 09 Dec 2019, at 10:38, Daniel Hepper  wrote:
>
> 
> You can fix your code by changing datetime.timedelta to timedelta:
>
> *def* was_published_recently(self):
>
> return self.pub_date >= timezone.now() - timedelta(days=1)
>
> The statement "from datetime import datetime, timedelta" imports the
> classes datetime and timedelta from the module datetime.
>
> If you prefer to use "datetime.timedelta", you would have to use "import
> datetime" instead of "from datetime import datetime, timedelta"
>
> Hope that helps,
> Daniel
>
> On Mon, Dec 9, 2019 at 9:24 AM Bruckner de Villiers 
> wrote:
>
>> Running Django 3.0 & Python 3.7.3
>>
>> Everything works per the tutorial until I get to:
>>
>> q.was_published_recently()
>>
>> It throws the following error:
>>
>> File
>> "/Volumes/Data/DevelopmentTraining/django_tutorials/mysite/polls/models.py",
>> line 19, in was_published_recently
>>
>> return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
>>
>> AttributeError: type object 'datetime.datetime' has no attribute
>> 'timedelta'
>>
>>
>>
>> I also tried importing timedelta from datetime – to no avail.
>>
>>
>>
>> models.py code below:
>>
>>
>>
>> import datetime
>>
>> from datetime import datetime, timedelta
>>
>>
>>
>> from django.db import \
>>
>> models
>>
>>
>>
>> from django.utils import timezone
>>
>>
>>
>> *# Create your models here.*
>>
>>
>>
>> *class* Question(models.Model):
>>
>> question_text = models.CharField(max_length=200)
>>
>> pub_date = models.DateTimeField('date published')
>>
>>
>>
>> *def* __str__(self):
>>
>> return self.question_text
>>
>>
>>
>> *def* was_published_recently(self):
>>
>> return self.pub_date >= timezone.now() - datetime.timedelta(days=
>> 1)
>>
>>
>>
>> *class* Choice(models.Model):
>>
>> question = models.ForeignKey(Question, on_delete=models.CASCADE)
>>
>> choice_text = models.CharField(max_length=200)
>>
>> votes = models.IntegerField(default=0)
>>
>>
>>
>> *def* __str__(self):
>>
>> return self.choice_text
>>
>>
>>
>>
>>
>> Much obliged,
>>
>>
>>
>> Bruckner de Villiers
>>
>> +27 (0)83 625 1086
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/VI1PR07MB5680C26D410997944FF9A20BC8580%40VI1PR07MB5680.eurprd07.prod.outlook.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHEnUVXhx5C%2BwhvAoBzOq4s_SXMxqzhq_7Y5k5fCmmhEqr%2B75Q%40mail.gmail.com
> 
> .
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/07F65819-A66D-4F0B-BCBB-97EB1F1AD02C%40gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFgO-6hKc_ZQqXwOhUOQpq6pPNR1X47kucT_6Stw2H6517BCYQ%40mail.gmail.com.


Re: User is not logging in admin panel

2019-12-16 Thread Tafadzwa Marshal
hello, your problem is easy to solve. The 'createsuperuser' command creates
a user with the 'staff' attribute set to true. When you create a user
through
the model thats inheriting from the User model, the default for the 'staff'
attribute is set to false. The solution is to make sure you override the
save method
and set the 'staff' attribute to true.

On Mon, Dec 16, 2019 at 3:38 AM sagar ninave  wrote:

> Hello Everyone,
>
> i am getting some issue please help me.
>
> i have created custom user model in account app by extending auth user
> model. also i have creates register api to register user. i am able to
> create superuser from command prompt and api as well. and both user are
> storing in single User model along with when i am hitting get request and i
> got response all user which register from command prompt and api. problem
> is that User is able to logging in admin panel which is registered by
> command line by command *python manage.py createsuperuser *but user is
> not able tologging in admin panel user which is created by register api.
> when i am seeing data of both user created by cmd and created by register
> api in admin panel that CMD created user's password is encrypted and user
> created by register api is plain text. may be at the time of creating
> superuser password is saving in encrypted form and user registered by api
> his password is saving in plain text form so that it may not authenticating
> user to redirect on admin panel. so what is happening exactly please clear
> this doubt and help to get out from this situation
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a962e5fd-c41d-465c-a179-14f84ace9551%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFgO-6hUKDCcHqt9vZP645rAksuKjNhuPRyG3JPv1TQTQL948A%40mail.gmail.com.