Tuesday, May 31, 2022

Re: Auto Template Update

There's a couple of ways to update the UI without the user doing anything. First, you can poll the server at a regular interval using JavaScript. Second, you can use a websocket to push updates from the server to the client.

On May 30, 2022 6:28:40 AM CDT, Dev femibadmus <devfemibadmus@gmail.com> wrote:
fine! we can submit form with ajax, and update little tag b cant update all.

Instagram auto update likes, new post, message or even notification without any event, even if a event itself action how possible to update differents post likes, notification blah blah blah blah blah......How???

Monday, May 30, 2022

Re: Django email | Gmail | Outlook

Unfortunately gmail / outlook although on different time tables will
force oauth2 shortly without end users being able to avoid this.

Thus outlook protocol will not really be an option.

I have researched this with python and alike.

right now there does not seem to be any turn key soultions in python or
fetchmail (i use fetchmail for my older customers)

there seems to be lib's around to handle to oauth2 protocols but not
much doc's on how to use them?


simply put from my research to date is oauth2 does the following

1. you try to connect to the mail server

2. it stops (unless you already have a device id key) and redirects to a
website link for a key

3. once on the website you need to say yes to some kind of auth (trying
to accomodate with http libs)

4. the website returns the key (which you probably should save)

5. from there (thus far research to date) normal python libs will handle
emails thereafter as before.

other option is like with google where you need to signup for a
developer account (or something) that will generate a key for your
account & device at which point other emails to that, only good for 15
devices ??

after that you have to pay?

just a heads up, other non-main stream providers (like myself) have
other devices in place for security and will not force customers to
migrate, maybe look for a local provider?

I will eventually handle oauth2 etc but only when forced to (government
contracts etc)

My suggestion (if you are in unix) is to start up a postfix / dovecot
email server instance where you are in control of the protocol's used?
this way your in complete control of your emails in both directions. Its
a bit of work but leaving things to the main stream providers isn't







Happy Monday !!!
Thanks - paul

Paul Kudla


Scom.ca Internet Services <http://www.scom.ca>
004-1009 Byron Street South
Whitby, Ontario - Canada
L1N 4S3

Toronto 416.642.7266
Main 1.866.411.7266
Fax 1.888.892.7266
Email paul@scom.ca

On 5/30/2022 7:22 AM, Dev femibadmus wrote:
> *Google* no longer support less seureapps............what next?
> is there anyway we can use gmail for Django email?
>
>
> if no way please send the best lesson for *Outlook* configuration :)
>
> --
> 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+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5318be25-e226-489d-8586-155d9161dad5n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/5318be25-e226-489d-8586-155d9161dad5n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d3029493-4b38-903f-11f5-e5709cac9666%40scom.ca.

Saturday, May 28, 2022

Re: What do they mean, exactly

this occurs when manage does not detect any changes to your project

or if the project folders have lost sync.

I have run into this before lots of times.

this is based on djando 1.11 but should work moving forward in principal.

In general try the following :

syncdb :

No longer exists ....

when creating the database tables do the following :

remove ALL migrations directories in app's

manage makemigrations <appname> DO FOR ALL APPS

manage migrate --fake-initial

manage migrate

manage createsuperuser (optional)

When creating new apps __init__.py must exist

manage migrate --fake-initial <appname> to create the table(s)



the above will not destroy any db tables etc but if you added a field
that never got updated to the database you will probably need to reverse
the table changes (in your model), then sort the migrations out as per
above and then re-add the table entries

This can happen when syntax errors, migrations errors occured on the
last run and it did not make it far enough to add the fields?

hope this helps.

Happy Saturday !!!
Thanks - paul

Paul Kudla


Scom.ca Internet Services <http://www.scom.ca>
004-1009 Byron Street South
Whitby, Ontario - Canada
L1N 4S3

Toronto 416.642.7266
Main 1.866.411.7266
Fax 1.888.892.7266
Email paul@scom.ca

On 5/27/2022 4:12 PM, Sabir Ali wrote:
> (Hpenv) E:\HealthPrediction>python manage.py makemigrations
> _*No changes detected*_
>
> (Hpenv) E:\HealthPrediction>
>
>
> "No changes detected' what will i do Please help me. I am beginner in
> django. Please help me
>
>
> On Friday, May 27, 2022 at 2:12:09 AM UTC+5:30 dcol...@gmail.com wrote:
>
> I was reading the django docs and i have been confused by the
> explanation as shown in the snippet.
> Screenshot from 2022-04-29 01-36-59.png
>
> in the first snippet of code does it mean that both conditions will
> have to be met as in the case of "and" in logical operators?
> Second snippet, do they imply that the blog objects will first be
> filtered to have only those that contains "lennon" and then the
> results will be filtered again to have only those in year 2008?
>
> Please help
>
> --
> 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+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/dd74a081-d8ce-464e-9ae4-5f87d9e849dan%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/dd74a081-d8ce-464e-9ae4-5f87d9e849dan%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54e1bf6c-231b-e266-1401-f55cfe9c6a17%40scom.ca.

Re: OperationalError at /admin/login database or disk is full

ok i will assume you are running a flavor of unix aka linux, freebsd etc

/admin/login is a mount point but it depends on your hdd layout

for example depending on your hdd initalization


# df
Filesystem Size Used
Avail Capacity Mounted on
zroot/ROOT/default 393G 3.3G
389G 1% /
devfs 1.0K 1.0K
0B 100% /dev
zroot/var/tmp 389G 96K
389G 0% /var/tmp
zroot/tmp 389G 136K
389G 0% /tmp
zroot/var/log 389G 1.4M
389G 0% /var/log
zroot 389G 96K
389G 0% /zroot
zroot/var/mail 389G 148K
389G 0% /var/mail
zroot/usr/src 391G 1.7G
389G 0% /usr/src
zroot/var/audit 389G 96K
389G 0% /var/audit
zroot/usr/ports 399G 9.4G
389G 2% /usr/ports
zroot/usr/home 431G 42G
389G 10% /usr/home
zroot/var/crash 389G 96K
389G 0% /var/crash

when you do s 'df' to list you hdd's it will give you the partition
layouts and avaliable hdd space

if /admin/login is on it own partition then it probably has reduced size?

check that first

make sure you data base is running where there is plenty of space (ie /usr/)

otherwise post back your hdd layout

and do a

ps -axww

and return the process layouts

between the two you should be able to figure out where your database,
dhango etc lives and go from there

keep in mind that default locations usually work but sometimes not
pending how your system was formatted.





Happy Saturday !!!
Thanks - paul

Paul Kudla


Scom.ca Internet Services <http://www.scom.ca>
004-1009 Byron Street South
Whitby, Ontario - Canada
L1N 4S3

Toronto 416.642.7266
Main 1.866.411.7266
Fax 1.888.892.7266
Email paul@scom.ca

On 5/27/2022 5:37 PM, Andrew Rea wrote:
> Hello!
>
> This is my first post in this group so be gentle.
>
> I'm creating a new Django project, and I've successfully created a
> superuser. But when I try to access the Admin page of my project with my
> superuser credentials, I receive this error:
>
> OperationalError at /admin/login/
> database or disk is full
>
> Is this because my SQLite database is full from other projects? Or
> possibly because I have too many virtual envs from those same other
> projects? *Or* is it due to my personal computer's disk being too full?
>
> Thank you in advance,
>
> Andrew S. Rea
>
> --
> 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+unsubscribe@googlegroups.com
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d96ae214-4c6f-43c7-ae94-7fba910e68a1n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d96ae214-4c6f-43c7-ae94-7fba910e68a1n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ed6369f9-23f7-d3ce-38e2-4c1437496fd2%40scom.ca.

Thursday, May 26, 2022

LogIn Class Based View

I have this function based view which works perfectly but I would like to convert to a class based view but am stuck on how to do this:
This is my fbv:

def loginView(request):
    if request.method == 'POST':
        form = LoginForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            user = authenticate(request,
                                   email=cd['email'],
                                   password=cd['password'])
       
            if user is not None:
                login(request, user)
                if user.is_authenticated and user.is_client:
                    return redirect('clients:detail') # Go to client dashboard
                elif user.is_authenticated and user.is_account_manager:
                    return redirect('accountmanagers:detail') #Go to account manager dashboard
            else:
                   return HttpResponse('Invalid login')
    else:
            # Invalid email or password. Handle as you wish
        form = LoginForm()

    return render(request, 'registration/login.html', {'form': form})

I would appreciate any help.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ea6c54f2-ecc0-407d-a296-e168d509a299n%40googlegroups.com.

Monday, May 23, 2022

Re: Django SMS project

On Sun, May 22, 2022 at 09:08:27AM +0100, Tanni Seriki wrote:
> Hi guys I have a project of django to send SMS to mobile number,
> Please guys I really need your helps

I agree with the other replies that your post is a little vague.
That being said, in general when I want to send txts from Django, I use...

https://pypi.org/project/django-sms/

(disclosure: I've contributed to django-sms in the past)

- Ryan N

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20220523135439.GB10089%40fattuba.com.

Saturday, May 7, 2022

Re: Custom user model password is not hashed

Hey Benjamin, can you please share your github repo for the same code. I'm also getting the same error in one of my project, can't figure out how to solve it.

On Friday, November 13, 2015 at 6:11:09 PM UTC+5:30 benjamin...@gmail.com wrote:
The problem was, when creating a custom user, one has to define a custom model form and model admin that handles the password properly. After that it was solved.

Thank you.

On Thu, Nov 12, 2015 at 9:25 PM, Andreas Kuhne <andrea...@suitopia.com> wrote:
Try to debug and check what your password value is after the set_password() statement.  Also have you checked the database after trying to create a user with the new method? It should be hashed in the database. This is stuff that should "just work" in django (it's regulated by the AbstractBaseUser and is the same that I am using in a project).

You did restart the django shell after changing the code?

2015-11-12 16:44 GMT+01:00 Benjamin Smith <benjamin...@gmail.com>:
I have changed user.set_password(self.cleaned_data["password"]) to user.set_password(password). But I am getting the same result.

On Thu, Nov 12, 2015 at 8:57 PM, Andreas Kuhne <andrea...@suitopia.com> wrote:
As aRkadeFR says, you seam to have mixed code there....

The row:
user.set_password(self.cleaned_data["password"])

is taken from a form somewhere and won't work. It should instead be :
user.set_password(password)

I suppose the password is going through to the create method via the kwargs argument at the end of you create method. But if you change like I said, everything should work.


Med vänliga hälsningar,

Andréas Kühne
Software Development Manager
Suitopia Scandinavia AB

2015-11-12 16:20 GMT+01:00 aRkadeFR <con...@arkade.info>:
Hello,

I don't quite get the code in your method: 'MyUserManager.create_user':
        user.set_password(self.cleaned_data["password"])

You're in your Manager method but call self.cleaned_data ?

You can set a breakpoint inside your method with pdb to see
what's going on with your fields?


On 11/12/2015 04:11 PM, Benjamin Smith wrote:
I have my own custom User model, and its own Manger too.

Models:

class MyUser(AbstractBaseUser, PermissionsMixin):
    email = models.EmailField(max_length=255, unique=True)
    first_name = models.CharField(max_length=35)
    last_name = models.CharField(max_length=35)
    username = models.CharField(max_length=70, unique=True)
    date_of_birth = models.DateField()
    is_active = models.BooleanField(default=True)
    is_admin = models.BooleanField(default=False)

    @property
    def is_staff(self):
        return self.is_admin

    def get_full_name(self):
        return ('%s %s') % (self.first_name, self.last_name)

    def get_short_name(self):
        return self.username

    objects = MyUserManager()
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['first_name', 'last_name', 'username', 'date_of_birth']

Manager:

class MyUserManager(BaseUserManager):
    def create_user(self, email, first_name, last_name, username, date_of_birth, password=None, **kwargs):
        if not email:
            raise ValueError('User must have an email address')

        user = self.model(
            email=self.normalize_email(email),
            first_name=first_name,
            last_name=last_name,
            username=username,
            date_of_birth=date_of_birth,
            **kwargs
        )
        user.set_password(self.cleaned_data["password"])
        user.save(using=self._db)
        return user

    def create_superuser(self, email, first_name, last_name, username, date_of_birth, password, **kwargs):
        user = self.create_user(
            email,
            first_name=first_name,
            last_name=last_name,
            username=username,
            date_of_birth=date_of_birth,
            password=password,
            is_superuser=True,
            **kwargs
        )
        user.is_admin = True
        user.save(using=self._db)
        return user

Everything works when creating a new user without any errors. But when I try to login I can't. So I checked the user's email and password to confirm. Then I noticed that the password is displayed as plain text (eg. strongpassword), and when changed the admin form to get the hashed password using ReadOnlyPasswordHashField() I get an error inside the password field, even though I used set_password() for the Manger inside the create_user() function.

Invalid password format or unknown hashing algorithm

However, if I manually do set_password('strongpassword') for that user inside the console, then only the password is hashed. Could you please help me solve this problem. Thank you.
--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM4YLWJNGdSj-rVAuhta_UA50Cjna8zg-c14FPxK%3DtdU49mngQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--   aRkadeFR

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5644AE3A.5050609%40arkade.info.

For more options, visit https://groups.google.com/d/optout.

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALXYUb%3D-V1fqJLJSbUaPUWaYX6srAf9s0qnZ0ZrTZOv9757o2w%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAM4YLWJ3tgcBSe_VcH6T6t4UbbA4EqTB0R0TueL2BjidZow7xg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2c07f199-d8f2-4028-ba59-1b575cbbc24bn%40googlegroups.com.