Re: Django call_command from Admin

2022-10-24 Thread Paul Kudla



you need to basically add a hook (save class) to your save model and 
process stuff along the way.


you will need to modify this example but it's how i update info when 
saving an scom email user for dovecot.


you can also override the admin class as well with something simaliar

Note :
super(EmailUsers, self).save(*args, **kwargs)  #Save the email changes

is extemely important as stuff will process but any field updates will 
not save without the above line..


example :


	def save(self, *args, **kwargs): #This will create an email account if 
nessesary.
		emailaddress = str(self.username) #Set the email address to see if we 
need to create the mailbox?
		emailpassword = str(self.password) #Set the password (used for check 
alias)


#prefill username/domain is blank
if self.domain == None or str(self.domain) == '' :
self.domain = self.username.split('@')[1]

if self.source == None or str(self.source) == '' :
self.source = self.username

if self.destination == None or str(self.destination) == '' :
self.destination = self.username




domain = str(self.domain)
send_settings = str(self.send_settings)
if self.send_settings == None :
send_settings = ''
self.send_settings = ''
dontupdate = self.dontupdate
self.dontupdate = False

#set dovecot directory & split user / domain
if self.username.split('@')[1] == 'preload.scom.ca' :
			self.home = '/data/dovecot/users/%s/%s' %( 
self.domain,self.destination.split('@')[0] )

else:
self.home = '/data/dovecot/users/%s/%s' %( 
self.domain,self.destination )

self.user = self.username.split('@')[0]

#Set alias Flag
if self.password == 'alias' or (self.source != 
self.destination) :
self.alias_flag = True
#self.sieve_forwards = ''
#self.vacation_active = False
else :
self.alias_flag = False

self.username_search = self.username
self.username_search = self.username_search.replace ('.','')
self.username_search = self.username_search.replace ('@','')


super(EmailUsers, self).save(*args, **kwargs)  #Save the email 
changes

i email with something like :

#Try to get info for this account
if dontupdate == False :

			imap_test = Dovecot_Command ('INFO',self.username) #do i have this 
account ?


if 'BAD' in imap_test.answer :
try : #Try to Create the account, note that the db must be updated 
properly before it will work

imap_create = Dovecot_Command 
('CM',self.username)
if 'OK' in imap_create.answer :
send_subject = 'Email Account 
Created : %s' %(str(self.username) )

except :
send_subject = 'Error Account : %s' 
%(str(self.username) )
pass

else :
send_subject = 'Email Account Updated : %s' 
%(self.username)

#Send update email

send_from = 'moni...@scom.ca'
send_files = []
    send_to = ['moni...@scom.ca']   
send_text = '\n\n'+ send_subject + '\n'
			sendmail(send_from,send_to,send_subject,send_text,send_files) #Send 
the warning email





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 p...@scom.ca

On 10/21/2022 2:30 PM, Mohammad Ehsan Ansari wrote:

Please refer the signal concept in django you will get how to implement it

On Thu, 20 Oct, 2022, 9:36 pm Aziz Mek, <mailto:aziz...@gmail.com>> wrote:


Hi All,

I was wondering  if you have come across the following

Re: Django call_command from Admin

2022-10-24 Thread Paul Kudla



example for admin.py

def save_model(self, request, obj, form, change): #This will save create
#Check to see if this will be an invoice copy
copy = False
current_invoice = obj.invoice_number
		if obj.new_invoice :	#clear the flag and save the current object then 
set new & date

obj.new_invoice = False
obj.save()
copy = True




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 p...@scom.ca

On 10/20/2022 12:05 PM, Aziz Mek wrote:

Hi All,

I was wondering  if you have come across the following:

I have a field in the model that's empty, when the user fills it up and 
clicks Save, it
should trigger/call a management Command (This command is already build 
that sends emails ), Django docs say i can use call_command but not sure 
how to implement it with the save


I am just after the trigger really when the save takes place

Many thanks in advance

Kind regards
Aziz


--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a0ca69f0-6065-4b86-a977-cfb6dcab8fd7n%40googlegroups.com <https://groups.google.com/d/msgid/django-users/a0ca69f0-6065-4b86-a977-cfb6dcab8fd7n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c1f3567f-e13c-0a12-4f5e-ce0af7eaf115%40scom.ca.


Re: how can i create databases, routers and install apps in runtime?

2022-10-31 Thread Paul Kudla



just add them using a text editor (vi etc)

when you need to access them an import settings (already shoud be done) 
will present them


python 101 stuff more then django

fyi



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 p...@scom.ca

On 10/31/2022 8:28 AM, emilton mendoza wrote:
Could someone tell me how I can add new values ​​to the variables of 
settings.py?


Thanks

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ddf803a2-d90b-45e4-a3c9-920ff73a43abn%40googlegroups.com <https://groups.google.com/d/msgid/django-users/ddf803a2-d90b-45e4-a3c9-920ff73a43abn%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d85631c6-8a6f-cd32-8dd0-2b391278e80a%40scom.ca.


Re: Django Admin

2023-03-13 Thread Paul Kudla



ok hope i am not adding to the confusion

I ran into this a while back

CSRF errors are usually (in my case anyways) triggered by apache SSL 
setup etc


if you are running Apache + SSL you need to make sure the certificates 
and the SNI ssl naming is setup correctly or the CSRF errors will 
trigger randomly.


of course the ssl cert has to match the site name

this config assumes APACHE + WSGI + SSL etc. and you are running 
multiple virtual sites under apache.


Also note the port 80 redirect (ie everything is directed to the SSL site)

if you are mixing ssl & non-ssl apache / django will get confused and 
trip the CSRF error as well.


relative apache config (httpd.conf):


SSLRandomSeed startup builtin
SSLRandomSeed connect builtin

SSLSessionCache memcache:localhost:11211  <<-- only if using memcache.



then my apache config for a site ?

admin.scom.ca ?


ServerName admin.scom.ca
ServerAlias admin.scom.ca
Redirect permanent / https://admin.scom.ca/



ServerName admin.scom.ca
ServerAlias admin.scom.ca
DocumentRoot /www/admin.scom.ca

Alias /media/ /www/admin.scom.ca/media/
Alias /static/ /www/admin.scom.ca/statics/
Alias /statics/ /www/admin.scom.ca/statics/


  Options FollowSymLinks
  AllowOverride None
  Require all granted


SSLEngine on
SSLProtocol all
SSLCertificateFile /www/admin.scom.ca/ssl/admin.scom.ca.crt
SSLCertificateKeyFile /www/admin.scom.ca/ssl/admin.scom.ca.key
SSLCertificateChainFile /www/admin.scom.ca/ssl/admin.scom.ca.chain



SuexecUserGroup www www

##Below only used if running WSGI##

WSGIDaemonProcess adminscomcassl user=www group=www processes=10 threads=20
WSGIProcessGroup adminscomcassl
WSGIApplicationGroup %{GLOBAL}
WSGIImportScript /www/admin.scom.ca/django.wsgi 
process-group=adminscomcassl application-group=%{GLOBAL}


WSGIScriptAlias / /www/admin.scom.ca/django.wsgi

##End of WSGI##


SecFilterEngine Off
SecFilterScanPOST Off




Order Deny,Allow
Deny from All




php_admin_value open_basedir /www/admin.scom.ca:/var/log/



php_admin_value sys_temp_dir /www/admin.scom.ca/tmp/



php_admin_value session.save_path /www/admin.scom.ca/tmp/



php_admin_value soap.wsdl_cache_dir /www/admin.scom.ca/tmp/



php_admin_value upload_tmp_dir /www/admin.scom.ca/tmp



AllowOverride All
php_value session.save_path "/www/admin.scom.ca/"










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 p...@scom.ca

On 3/12/2023 5:44 AM, Muhammad Juwaini Abdul Rahman wrote:

I think you need to add the following in settings.py:

CSRF_TRUSTED_ORIGIN = ('')



On Sun, 12 Mar 2023 at 02:04, James Hunt <mailto:newbypass...@gmail.com>> wrote:


Hi there. I am fairly new to Django but have had previous success
with creating an app and being able to access the Admin page.
Recently, if I attempt to access the admin page of a new Django app
it throws the CSRF error upon trying to log in!!!

I have attempted several ways to bypass this error including adding
allowed hosts but I cant seem to get past this issue.

Can someone please provide me with the definitive way of stopping
CSRF error when simply trying to access the admin part of Django? I
mean there are no post functions that really apply to this feature
so I cant understand the CSRF token.

I cant get past this issue which means I can never access the admin
page!!

Please help.

Regards

James

-- 
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
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/django-users/e13c7765-831e-45c5-b091-c8fcfbed19c5n%40googlegroups.com
 
<https://groups.google.com/d/msgid/django-users/e13c7765-831e-45c5-b091-c8fcfbed19c5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFKhtoRactd%2Bhg-3_m8d5MOKSYb0gp9J9m%2BjNM7naykJ8r3Kww%40mail.gmail.com <https://groups.google.com/d/msgid/django-users/CAFKhtoRactd%2Bhg-3_m8d5MOKSYb0gp9J9m%2BjNM7naykJ8r3Kww%40mail.gmail.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 

Re: Suggestions for Reducing Spam

2023-06-18 Thread Paul Kudla



a django jobs posting group would probably be best

i admit i have used this group for looking for professional help etc but 
always move off to the side if someone respond's


i too have seen recently google looking for programmers etc which has 
nothing to do with this group ??


fyi



Happy Sunday !!!
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 p...@scom.ca

On 6/18/2023 12:04 PM, Abhishek Choudhury wrote:

Hi Django User Group Admins,

I hope this email finds you well.

I'm writing this to discuss the recent influx of spam emails in our 
group. As we know, this group is a great resource for Django developers 
to learn, share, and collaborate. However, in the past few months, we've 
seen an increase in emails that are unrelated to Django, such as job 
postings and promotional materials.


I understand that some people may want to use the group to post job 
listings, but I believe that these emails are disruptive and detract 
from the purpose of the group. I've also noticed that some people are 
responding to these emails, which only encourages more spam.


I've been thinking about ways to address this issue, and I have a few 
ideas. One idea is to create a separate Google group for job postings. 
This would allow people who are looking for jobs to connect with each 
other, while keeping the Django_users group focused on Django-related 
content.


Another idea is to develop a Zapier + OpenAI plugin that can detect the 
type of email (sentiment analysis) and then mark it as spam or 
non-Django related, add automated reply and mute it. This would help to 
automatically filter out spam emails, so that they don't clutter up our 
group's inbox.


I'm not sure which of these ideas is the best solution, but I wanted to 
get your thoughts on the matter. What do you think about the recent 
influx of spam emails in our group? Do you have any suggestions for how 
we can address this issue?


I'm happy to help in any way I can. Please let me know if you have any 
questions.


Thank you for your time.

With kind regards,
Abhishek Choudhury

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B3kJUaoGRXy47q6wUFyYtn4u3YO1rm1gZJR4rYNcEXizxEnOg%40mail.gmail.com <https://groups.google.com/d/msgid/django-users/CA%2B3kJUaoGRXy47q6wUFyYtn4u3YO1rm1gZJR4rYNcEXizxEnOg%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/57363a7d-547a-b3f6-ca90-79db4aaa9272%40scom.ca.


Django 1.10 How to Take form Inputs (ie field one + field two = field three) and auto update before submitting the form.

2016-08-13 Thread Paul Kudla
I am running django 1.10 and assume i will need to use java scripts, jquery 
or angularjs

Simply put i have a decimal field that i want to add to another decimal 
field and place the answer in a third decimal field.

I want this to be displayed on the fly as the form gets data inputed on the 
client side into it (aka no submit and display the answer immediately for 
example)

And then update the relative fields upon a save request (the data would 
already be in the form)

This is a very basic function but is nessesary on any invoice program etc 
ie to add up the actual total of the invoice for example or multiply a qty 
of one against the amount of the item and then total it, for example in an 
invoice body using tabularinline.

There must be examples on how to modify the admin form template to allow 
for this, I have just been unable to find any documentation that shows how 
to do this in a simple way.



Any help would be appreciated.

basic model :

#models.py (Remote Access VNC Application)
from django.db import models


class Test_Add(models.Model):
siteid   = models.CharField(max_length=64, primary_key=True, 
unique=True)
field1   = models.DecimalField(verbose_name='field1', 
max_digits=10, decimal_places=2, null=True, blank=True)
field2   = models.DecimalField(verbose_name='field2', 
max_digits=10, decimal_places=2, null=True, blank=True)
field3   = models.DecimalField(verbose_name='field3', 
max_digits=10, decimal_places=2, null=True, blank=True)
field4   = models.DecimalField(verbose_name='field4', 
max_digits=10, decimal_places=2, null=True, blank=True)


class Meta:
ordering = ['siteid',]
db_table = u'test_add'
verbose_name = u"Test template"
verbose_name_plural = u"Test Template"

def __unicode__(self):
return self.siteid

Basic Admin :

#admin.py - (Remote Access VNC Application)
from django.contrib import admin

#import the application stuff
from Add.models import Test_Add


class Test_Add_Admin(admin.ModelAdmin):

fieldsets = [
('Site Information',{'fields': ['siteid', 
'field1','field2','field3','field4']}),

]
list_display = ('siteid', 'field1', 'field2', 'field3','field4',)
list_display_links = ('siteid', )

search_fields = ['siteid', ]


admin.site.register(Test_Add, Test_Add_Admin)


-- 
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 to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8303e4b8-b02f-49be-b48e-b68b87fdc4a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.10 How to Take form Inputs (ie field one + field two = field three) and auto update before submitting the form.

2016-08-15 Thread Paul Kudla
ludovic coues :

If you can please contact me directly with email p...@scom.ca

would like to discuss further, am willing to pay for programming time to 
sort out some basic issues and get some working examples.

have been programming for 25 years, know what i need to accomplish and want to 
use django framework for this.
however there simply just does not seem to be any direct documentation 
on django + interfacing java (jquery etc) on how to do this.

What i am looking for seems very straight forward in todays web apps? and from 
what i have read should not be that hard to implement.

can provide ftp / http access to test site on my server.

pls advise.



On Sunday, August 14, 2016 at 4:57:15 AM UTC-4, ludovic coues wrote:
>
> if what you are doing is a quote, you don't need to get the total from 
> the user. I would go one step further, don't get price from the user. 
> Form can be altered. 
>
> I would do the model like that: 
>
>
> class Invoice(models.Model): 
> user = models.ForeignKey(User, models.CASCADE) 
> date = models.DateTimeField() 
>
>
> class InvoiceItem(models.Model): 
> invoice = models.ForeignKey(Invoice, models.CASCADE, 
> related_name="items") 
> product = models.ForeignKey(Product, models.CASCADE) 
> quantity = models.PositiveSmallIntegerField() 
>
> def total(self): 
> return product.price * quantity 
>
>
> With this setup, if `invoice` is an Invoice object, invoice.items is 
> the list of product related to the invoice. In you JS, you will have 3 
> HTML elements of interest. On represent either the price or the item, 
> the second the quantity, and the third the total. If either of the two 
> first one change, update the total. 
>
>  
> Pokeball 
> Greatball 
>  
>  
>  
>  
> $('itm').on('change', updateTotal) 
> $('qty').on('change', updateTotal) 
>
> function updateTotal() { 
> price = parseInt( $('itm').get_attribute('data-value') ) 
> quantity = parseInt( $('qty').value() ) 
> $('total').update('$'+price*quantity) 
> } 
>  
>
> (The script don't work as is but should give the general idea) 
> This way, the user see instantly the effect of their change but your 
> application only work with safe value. 
>
> I hope I didn't go too far off-path and that will be useful to you :) 
>
> 2016-08-13 22:12 GMT+02:00 Paul Kudla >: 
> > I am running django 1.10 and assume i will need to use java scripts, 
> jquery 
> > or angularjs 
> > 
> > Simply put i have a decimal field that i want to add to another decimal 
> > field and place the answer in a third decimal field. 
> > 
> > I want this to be displayed on the fly as the form gets data inputed on 
> the 
> > client side into it (aka no submit and display the answer immediately 
> for 
> > example) 
> > 
> > And then update the relative fields upon a save request (the data would 
> > already be in the form) 
> > 
> > This is a very basic function but is nessesary on any invoice program 
> etc ie 
> > to add up the actual total of the invoice for example or multiply a qty 
> of 
> > one against the amount of the item and then total it, for example in an 
> > invoice body using tabularinline. 
> > 
> > There must be examples on how to modify the admin form template to allow 
> for 
> > this, I have just been unable to find any documentation that shows how 
> to do 
> > this in a simple way. 
> > 
> > 
> > 
> > Any help would be appreciated. 
> > 
> > basic model : 
> > 
> > #models.py (Remote Access VNC Application) 
> > from django.db import models 
> > 
> > 
> > class Test_Add(models.Model): 
> > siteid   = models.CharField(max_length=64, primary_key=True, 
> > unique=True) 
> > field1   = models.DecimalField(verbose_name='field1', 
> > max_digits=10, decimal_places=2, null=True, blank=True) 
> > field2   = models.DecimalField(verbose_name='field2', 
> > max_digits=10, decimal_places=2, null=True, blank=True) 
> > field3   = models.DecimalField(verbose_name='field3', 
> > max_digits=10, decimal_places=2, null=True, blank=True) 
> > field4   = models.DecimalField(verbose_name='field4', 
> > max_digits=10, decimal_places=2, null=True, blank=True) 
> > 
> > 
> > class Me

Re: Unpaid Internship

2023-04-24 Thread Paul Kudla ( SCOM )
Pls contact me directly at p...@scom.ca please have an idea


   
thanks - paul 
   Paul Kudla  SCOM.CA Internet Services Inc.004-1009 Byron Street 
South   Whitby, Ontario - Canada   L1N 4S3Toronto   416.642.7266   Main   
1.866.411.7266   Fax   1.888.892.7266   

On Apr 24, 2023 at 10:26:17 EDT, John Diginee  
wrote:

 Dear Sir/Ma'am,I hope this message finds you well. I am a full-stack 
software engineering student at Holberton School, a Silicon Valley-based 
software engineering institution. I am reaching out to express my interest in 
an unpaid backend intern or junior role at your esteemed company.My primary 
goal is to learn from your inspiring and experienced developers and gain 
practical, real-world experience. I am not particularly concerned about 
financial compensation at this time.I understand that my request may seem 
unconventional, but I would be grateful for any opportunity to work with your 
company. I am a hardworking, persistent, determined, resilient, and 
fast-learning individual, and I am confident that I can contribute positively 
to your team.Here's my LinkedIn and GitHub profile for your review: 
https://www.linkedin.com/in/johndiginee/
https://github.com/johndiginee
  
 
  Thank you for your precious time and consideration. I look forward to hearing 
from 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+unsubscr...@googlegroups.com .
To view this discussion on the web visit  
https://groups.google.com/d/msgid/django-users/d0247416-15e7-42c2-bf56-54ef95bb6733n%40googlegroups.com
 .

-- 
This message has been scanned for viruses and
dangerous content by  MailScanner  , 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/94938A57-A4DB-4AF7-9C36-C59A2A3C8ED5.goodhumans%40scom.ca.


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

2022-05-28 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



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   SizeUsed 
Avail Capacity  Mounted on
zroot/ROOT/default   393G3.3G 
389G 1%/
devfs1.0K1.0K 
0B   100%/dev
zroot/var/tmp389G 96K 
389G 0%/var/tmp
zroot/tmp389G136K 
389G 0%/tmp
zroot/var/log389G1.4M 
389G 0%/var/log
zroot389G 96K 
389G 0%/zroot
zroot/var/mail   389G148K 
389G 0%/var/mail
zroot/usr/src391G1.7G 
389G 0%/usr/src
zroot/var/audit  389G 96K 
389G 0%/var/audit
zroot/usr/ports  399G9.4G 
389G 2%/usr/ports
zroot/usr/home   431G 42G 
389G10%/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 p...@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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@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+unsubscr...@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.


Re: What do they mean, exactly

2022-05-28 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



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  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  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 p...@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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@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+unsubscr...@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: Django email | Gmail | Outlook

2022-05-30 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



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 p...@scom.ca

On 5/30/2022 7:22 AM, Dev femibadmus wrote:

*Google* no longer support less seureappswhat 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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@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+unsubscr...@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.


Re: POS Printer

2022-05-31 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



ok a few zillion requirements

You need something that will generate a pdf file and then send it to a 
printer / email etc


Basically Pillow libs needs to be installed to generate a pdf file

from there is is system dependant

if running linux / freebsd then i would write the pdf file into the /tmp 
folder (make sure you set the rights of /tmp to 777)


next to be able to print you will need ghostscript / cups

cups needs the printer to be on your network (NOT USB Preferably)

USB Can be made to work but requires a whole wack of printer setup on 
the stations.


also Report Lab (Pillow libs)

#PDF (Report Lab Stuff)
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch
from reportlab.lib.pagesizes import letter, A4
from reportlab.lib import colors
from reportlab.graphics.shapes import *
from reportlab.platypus import SimpleDocTemplate, Image

from reportlab.lib.colors import PCMYKColor, PCMYKColorSep, Color, 
black, blue, red, orange



please understand that this is very rough approach

if you need more info a can send my django code if nessesary but is 
tailered to my system


fyi





Happy Tuesday !!!
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 p...@scom.ca

On 5/31/2022 10:00 AM, Asif Foysal wrote:

How to use POS printer in Django

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23dc7e2f-3650-4ddb-8212-7a509f797fe1n%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/23dc7e2f-3650-4ddb-8212-7a509f797fe1n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bb26b262-97c7-5d24-e34c-e67b3ddd3bc2%40scom.ca.


Re: Django email | Gmail | Outlook

2022-06-02 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



thanks for the hint on gmailapi

i figure they had something outlook has an azure server plugin (same idea)

just an fyi i was taking a more generalized approach to the issue

as an isp i have customers spanning several different providers needing 
a more generalized solution.


gmail, office, rogers, aol, yahoo etc etc etc

i generally use fetchmail to handle this but there is no oauth2 
avaliable yet and you still need a device key - aka manual setup


I am putting together a python program to handle this the main issue is 
getting prompted backwards in html on a new device / connection and 
busilding some sort of connect library per provider.


Afterwhich i save the device key in a local database for future use?





Happy Thursday !!!
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 p...@scom.ca

On 5/31/2022 4:31 PM, Dev femibadmus wrote:

i have solved my issue using the gmailapi anyone having same issue??


On Mon, May 30, 2022 at 2:57 PM Dev femibadmus <mailto:devfemibad...@gmail.com>> wrote:


Wow 😲 thanks 🙏 so much Paul

On Mon, May 30, 2022, 13:40 Paul Kudla (SCOM.CA <http://SCOM.CA>
Internet Services Inc.) mailto:p...@scom.ca>> wrote:


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 <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 p...@scom.ca <mailto:p...@scom.ca>

On 5/30/2022 7:22 AM, Dev femibadmus wrote:
 > *Google* no longer support less seureappswhat 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+unsubscr...@googlegroups.com
<mailto:django-users%2bunsubscr...@googlegroups.com>
 > <mailto:django-users+unsubscr...@googlegroups.com
<mailto:django-users%2bunsubscr...@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&g

Re: ?? question ,its urgent

2022-06-20 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



Just an fyi your email showed up as suspect ??

spf=softfail (google.com: domain of transitioning 
abhinan...@snakescript.com does not designate 2607:f8b0:4864:20::62b as 
permitted sender)


might want to get that fixed




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 p...@scom.ca

On 6/20/2022 2:46 AM, Abhinandan K wrote:
how to store the data in django databse table if user append fields 
according to their need

for example i have 1 one field 1) name 2) age 3) salary and the sign('+)
if user click on + sign row append one plus in form..my question is that 
i want to store the data in all appended textboxes in single field in 
database,,


--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA6_Mp6UPLakoi-JhcgB4U89-iKfDwAaxDWwW547tFKyk_imrg%40mail.gmail.com 
<https://groups.google.com/d/msgid/django-users/CAA6_Mp6UPLakoi-JhcgB4U89-iKfDwAaxDWwW547tFKyk_imrg%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f5251350-9b5b-a938-408f-124b590b5c37%40scom.ca.


Re: server can't connect in browser

2022-06-23 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



ok this is networking 101 stuff

if the server is running on 127.0.0.1 8000 (or whatever port)

and you are trying to access from another system you need to use the ip 
address of the server (not 127.0.0.1) and it needs to be accesable on 
your network to be able to find it.


best to try telneting to the server as a test to verify ip & ports are 
correct.


example :

telnet 192.168.0.2  8000  for example if you get 
a response then you are good to go.


ie

"telnet 192.168.0.2 8000"





Happy Thursday !!!
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 p...@scom.ca

On 6/22/2022 1:46 PM, Django-Admin wrote:
Try opening the link in a browser in the same EC2 instance, if you are 
not doing so.


On Wednesday, June 22, 2022 at 6:37:18 PM UTC+5:30 kamald...@gmail.com 
wrote:


Hi all,
I am quite new in django. Just started my first project in it.
I started an ec2 instance, setup virtual environment and run server
through
python manage.py runserver command.
Server is up with no errors. But when I copy the link and open in
browser it says site can't be reached. Screenshots of it are
attached for reference.

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dfe8f847-65bc-4602-b3b9-9e7a81998459n%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/dfe8f847-65bc-4602-b3b9-9e7a81998459n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/eef876cb-0c0c-5123-63f2-3fc6b727eac5%40scom.ca.


Re: Fetch email from google

2022-07-08 Thread Paul Kudla (SCOM.CA Internet Services Inc.)
appointed as guardians or payees in court. For the same reasons of 
legalized theft, extortion, and wrongful appropriation through state, 
local, military and federal court systems, individuals with similar 
names to known criminals are not allowed to hold significant assets in 
their names or possess firearms or obtain employment in sensitive 
positions in the United States.

>
> * https://en.wikipedia.org/wiki/Thief_in_law
>
> On Sunday, June 26, 2022 2:52:05 PM AKDT, Steve Dondley wrote:
>> I have a small client whose insurance company insists they have MFA 
for their email to be covered under some kind of data protection policy. 
Currently I have the client set up on a Debian box for the email server 
coupled with roundcube for webmail. Most the users just use roundcube 
but some also use their mobile devices to check email. Maybe one person 
uses outlook. There’s about 5 to 10 users total.
>> I know roundcube offers a MFA plugin. But I don’t have the foggiest 
idea how of an iPhone, Android device, or Outlook could all be set up to 
work with MFA with a standard dovecot/postfix setup. Are there any 
practical solutions for easily implementing MFA that could work across 
multiple devices?

>>


Disclaimer: I work for Auth0 (now Okta)

On 7/3/22 9:40 AM, Paul Kudla (SCOM.CA Internet Services Inc.) wrote:
>
> It seems any kind of dual auth will need a security app running on 
YOUR server saving toikens, logins etc etc


Not necessarily. With Auth0, the IDP runs on Auth0's server.
You are responsible for storing ID tokens, access tokens, and refresh 
tokens in your app.
There are ways of doing this fairly securely, even with desktop apps or 
mobile

devices, where you don't have a secure backend.

>
> this is what lead to microsoft, gmail etc having their own api which 
will only work for them


If I understand this correctly, Google et al provide an MFA API for apps 
that want to handle
auth themselves, instead of going the OIDC/OAuth2/SAML route. They also 
provide standards

based protocols, like OIDC.

That's what I was hinting at above - adopting OIDC makes things easier 
than trying to bolt

on security (via some MFA API).

>
> this is also (mainly because of https authing the device) what makes 
it hard to proxy oauth2 etc


This is definitely a pain point. You can either open up a browser from 
the device, or on constrained
devices, use device flow (display a URL, user visits that URL on their 
laptop, device grabs confirmation
from the IDP that they did). Neither one is completely elegant, but 
opening a browser on a mobile

device is far less intrusive than you might think.

>
> 5.7. Authenticating using C.A.S.
> ...
>
> basically the reality is every server will have it's own token base 
etc thus preventing any kind of a standard.


I'm not familiar with C.A.S. I don't have any clients that I know of 
using it, so I can't comment on it.

But the JWT token spec is now common, and is a standard. Also the SAML spec.
I see more OIDC, but also a lot of SAML.

Happy IAM Sunday to you too!

j



It IS possible to use 2FA on Dovecot, but it would be better if Dovecot 
supported options by Plugins to control what supported 2FA options are 
supported in the CAPABILITIES string.  (Ongoing problem getting more 
power in the handles of 3rd party plugins for Dovecot, politics.. )


HOWEVER, there are many ways if you 'roll your own' dovecot, eg can 
apply patches to the build process.  We do this.


Having said that, yes.. especially in North America this push by 
insurance agents for 2FA, is driven by the RansomWare problems, and 
gives an insurance company a way out..


The only problem is, having looked at several of these insurance 
companies forms, it is almost as if a o365 sales person wrote the 
requirements.  And even IF you apply a 2FA, (eg a 2nd factor) you might 
find that the insurance documents will not accept anything other than 
what their legal department defined as 2FA..


The biggest problem, is not the use of 2FA, it is making 2FA transparent 
and simple enough for end users to adopt.  End users don't want to mess 
with a second factor they have to add, or a hardware dongle, or giving 
their cel# out..


And the industry has to come together, otherwise you will quickly find 
out insurance companies ONLY accept 2FA from one or two closed source 
companies..


Which is why once again, I wish that Dovecot would take a leadership 
role in this, and allow more 3rd party plugins to be available to 
address this business need.


(Oh, on the side, there ARE some ways you actually do 2FA transparently, 
but of course the email client has to understand it.  But while you can 
do 'tricks' even in IMAP for 2FA, we need to think that the same method 
should work for ALL communication channels which utilize the same 
credentials, eg IMAP/SMTP/POP, even other things like caldav/carddav etc)

Re: I need help with saving data to django database.

2022-08-17 Thread Paul Kudla (SCOM.CA Internet Services Inc.)
invoice.sold_to) + ' ' + 
str(invoice.invoice_total) + ' '




		for item in 
Invoice.objects.get(pk=invoice.invoice_number).invoicing_items.all():

#set the search parameters for the this body line
if str(item.item) <> 'None' and str(item.item) <> '':
invoice.body_search = invoice.body_search + 
str(item.item) + ' '
			if str(item.item_description) <> 'None' and 
str(item.item_description) <> '' :
invoice.body_search = invoice.body_search + 
str(item.item_description) + ' '


#Now do the math
if str(item.item_qty) <> 'None' and str(item.item_unit) 
<> 'None' :
item.item_extention = float(item.item_qty) * 
float(item.item_unit)
invoice.sub_total = float(invoice.sub_total) + 
float(item.item_extention)

item.save()

#Now the taxes
if invoice.gst_tax_exempt == False :
			invoice.gst_tax_amount = float(invoice.sub_total) * 
float(invoice.gst_tax_value) / 100

else :
invoice.gst_tax_amount = float(0)

if invoice.hst_tax_exempt == False :
			invoice.hst_tax_amount = float(invoice.sub_total) * 
float(invoice.hst_tax_value) / 100

else :
invoice.hst_tax_amount = float(0)   

if invoice.pst_tax_exempt == False :
			invoice.pst_tax_amount = float(invoice.sub_total) * 
float(invoice.pst_tax_value) / 100

else :
invoice.pst_tax_amount = float(0)   

		invoice.invoice_total = float(invoice.sub_total) + 
float(invoice.gst_tax_amount) + float(invoice.hst_tax_amount) + 
float(invoice.pst_tax_amount)


if invoice.ar_owing == '99' :
invoice.ar_owing = invoice.invoice_total

#Now the a/r
total_ar = float(invoice.invoice_total)
try :
			record = Invoice_Payment.objects.all().filter( payment_item = '%s' 
%invoice.invoice_number )

for nn in range (0,len(record)) : #start the update
total_ar = total_ar - 
float(record[nn].cashbook_amount)
except : pass

invoice.ar_owing = total_ar #set the new ar value


invoice.save()

#Now generate the pdf's
		if invoice.printed == True or invoice.faxed == True or invoice.emailed 
== True :

makeinvoicepdf(invoice.invoice_number)



site.register(Invoice, InvoiceAdmin)


this is an example of my contacts save overrides in models.py:

	def save(self, *args, **kwargs):  #This will save / create the contact 
entry

super(Contacts, self).save(*args, **kwargs) #Save the contact 
entry
self.accountid_text = '0'
		self.accountid_text = 
self.accountid_text[0:5-len(str(self.accountid))] + str(self.accountid)


#See if i am going to email this contact ?
if not self.send_to == '' : #Send an email with contact info
			send_subject = 'Contact Info for : %s   -  %s' 
%(self.customer_name,self.send_to_subject)

send_from = 'i...@scom.ca'
send_files = []
send_to = self.send_to.split(',')
#Build the email text entry
send_text = '\n\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n' \
	 
%(self.customer_name,self.attention_to,self.address_1,self.address_2,self.city,self.province,self.postal_code)


#for nn in range (0,len(self.phone_number) ):
#   phone_data = self.phone_number[nn]

self.phonenumber = ''
			for self.item in 
Contacts.objects.get(pk=self.accountid).phone_number.all():
if str(self.item.phone_number) == '' or str(self.item.phone_number) 
== 'None' or str(self.item.phone_type) == 'Fax' :

pass
else :
if self.phonenumber <> '' :
self.phonenumber = 
self.phonenumber + ' / '

Re: django deploy on IIS

2022-09-10 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



Ok please do not take this the wrong way .

this comes from 20+ years of experience of all the different platforms.

windows is good for microsoft office etc, they have kinda set the 
standard in day to day useage to run a business.


however 

production servers today are almost entirley on the unix side of the 
platforms.


although you could  try getting a windows IIS running (never tried and i 
do apologise for answering this thread saying that - i appreciate your 
frustration)


to get django to run on IIS (or consider windows apache would probably 
be better but at the end of the day ???)



i did try server 2019 + python3 + django + apache etc etc and gave up 
ended up putting the project on their freebsd router.



a lot of work would be spent when unix flavors are more suited to stuff 
like this.


at the end of the day windows is just not stable for multiple reasons.


too many lib issues to mention a few.

if you are running any kind of production server you really should look 
at a linux flavor (i use freebsd as it has several enhancements to the 
network layer)


Again not an answer but maybe it is !



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 p...@scom.ca

On 9/10/2022 1:01 PM, jayson lauwerends wrote:

Hello,
Does anyone here know how to get a Django project to work on IIS.
I have been trying for the last three weeks following different tutorials.
Everyone on stack overflow is giving different answers.
And i am losing my m9nd.

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c91b9d18-af31-441f-a5a6-7b9e2a23f2edn%40googlegroups.com <https://groups.google.com/d/msgid/django-users/c91b9d18-af31-441f-a5a6-7b9e2a23f2edn%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8a14bd2c-7fdb-b1b7-436e-c99b529c1985%40scom.ca.


Re: Need help Scraping a couple of websites

2022-12-16 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



please contact me directly

i am familiar with all sorts of databases and have had to migrate data 
across multiple platforms.


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


Happy Friday !!!
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 p...@scom.ca

On 2022-12-16 12:11 p.m., John McClain wrote:

Hello,

I need help scraping a couple of commercial websites to collect product 
data for use in e-commerce store.


Willing to pay modest fee for the help.

Get in touch if interested...

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/acadd169-b7a3-42c9-b6ce-6ebe10ccf344n%40googlegroups.com <https://groups.google.com/d/msgid/django-users/acadd169-b7a3-42c9-b6ce-6ebe10ccf344n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a6a61786-87a3-cd36-80df-27a36bcc66cb%40scom.ca.


Re: it is very hard to find both email and phone number as username to login

2023-02-26 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



I use a plugin / python program

AUTHENTICATION_BACKENDS = (
# AxesStandaloneBackend should be the first backend in the 
AUTHENTICATION_BACKENDS list.

'axes.backends.AxesModelBackend',

'django.contrib.auth.email-auth.EmailBackend',
'django.contrib.auth.backends.ModelBackend',
 )

email-auth.py

place in project root or

/usr/local/lib/python2.7/site-packages/Django-1.11.29-py2.7.egg/django/contrib/auth

use phone number for the user account id and email address will kick in 
automatically


can use either for login with valid password



___
# cat email-auth.py
from django.contrib.auth.models import User
import re

# vem = Verify E-Mail.  This regular expression is from 
http://www.regular-expressions.info/email.html

# and is designed to detect anything that meets the RFC-2822 standard.
vem = 
re.compile(r"""(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])""", 
re.I)



class BasicBackend:
def get_user(self, user_id):
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist:
return None

class EmailBackend(BasicBackend):
def authenticate(self, username=None, password=None):
#If username is an email address, then try to pull it up
if vem.search(username):
try:
user = User.objects.get(email=username)
except User.DoesNotExist:
return None
else:
#We have a non-email address username we should 
try username

try:
user = User.objects.get(username=username)
except User.DoesNotExist:
return None
if user.check_password(password):
return user
____




Happy Sunday !!!
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 p...@scom.ca

On 2023-02-26 8:35 a.m., Manobhav Joshi wrote:
is there any way to use both email and phone number as username to login 
safely which we can use authenticate() function.


--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd5721c4-0a55-48c3-8a1c-5ef75e470e1cn%40googlegroups.com <https://groups.google.com/d/msgid/django-users/fd5721c4-0a55-48c3-8a1c-5ef75e470e1cn%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a875a175-d6d2-1ab2-c9aa-3460ee1e97c8%40scom.ca.


Re: Unpaid Internship

2023-04-30 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



ok please see scom.ca for contact info

did not realize email was blocked by django users list




Happy Sunday !!!
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 p...@scom.ca

On 2023-04-24 10:26 a.m., John Diginee wrote:

Dear Sir/Ma'am,

I hope this message finds you well. I am a full-stack software 
engineering student at Holberton School, a Silicon Valley-based software 
engineering institution. I am reaching out to express my interest in an 
unpaid backend intern or junior role at your esteemed company.


My primary goal is to learn from your inspiring and experienced 
developers and gain practical, real-world experience. I am not 
particularly concerned about financial compensation at this time.


I understand that my request may seem unconventional, but I would be 
grateful for any opportunity to work with your company. I am a 
hardworking, persistent, determined, resilient, and fast-learning 
individual, and I am confident that I can contribute positively to your 
team.


Here's my LinkedIn and GitHub profile for your review:
https://www.linkedin.com/in/johndiginee/
https://github.com/johndiginee

  Thank you for your precious time and consideration. I look forward to 
hearing from 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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0247416-15e7-42c2-bf56-54ef95bb6733n%40googlegroups.com <https://groups.google.com/d/msgid/django-users/d0247416-15e7-42c2-bf56-54ef95bb6733n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1b7d8dd5-5ea1-e483-ff64-7e77e3e448ee%40scom.ca.


Re: Unpaid Internship

2023-04-30 Thread Paul Kudla (SCOM.CA Internet Services Inc.)



sorry for using the list

John Diginee

please see scom.ca for my info



Happy Sunday !!!
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 p...@scom.ca

On 2023-04-24 10:26 a.m., John Diginee wrote:

Dear Sir/Ma'am,

I hope this message finds you well. I am a full-stack software 
engineering student at Holberton School, a Silicon Valley-based software 
engineering institution. I am reaching out to express my interest in an 
unpaid backend intern or junior role at your esteemed company.


My primary goal is to learn from your inspiring and experienced 
developers and gain practical, real-world experience. I am not 
particularly concerned about financial compensation at this time.


I understand that my request may seem unconventional, but I would be 
grateful for any opportunity to work with your company. I am a 
hardworking, persistent, determined, resilient, and fast-learning 
individual, and I am confident that I can contribute positively to your 
team.


Here's my LinkedIn and GitHub profile for your review:
https://www.linkedin.com/in/johndiginee/
https://github.com/johndiginee

  Thank you for your precious time and consideration. I look forward to 
hearing from 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+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0247416-15e7-42c2-bf56-54ef95bb6733n%40googlegroups.com <https://groups.google.com/d/msgid/django-users/d0247416-15e7-42c2-bf56-54ef95bb6733n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2ca3fe77-2fe1-a0c8-22f9-4ca678ce1b49%40scom.ca.