Re: if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket): TypeError: expected string or bytes-like object

2024-06-05 Thread Sanjay Sikdar
 django-storages has been updated that's why you are getting this error. 

OLD SYNTAX
from storages.backends.s3boto3 import S3Boto3Storage
import os

class MediaStorage(S3Boto3Storage):
bucket_name = os.environ.get('AWS_STORAGE_BUCKET_NAME')
location = 'media'

class StaticStorage(S3Boto3Storage):
bucket_name = os.environ.get('AWS_STORAGE_BUCKET_NAME')
location = 'static'
UPDATED SYNTAX 

STORAGES = {
"default": {
"BACKEND": "storages.backends.s3.S3Storage",
"OPTIONS": {
"bucket_name": AWS_STORAGE_BUCKET_NAME,
"location": 'media'
},
},
"staticfiles": {
"BACKEND": "storages.backends.s3.S3Storage",
"OPTIONS": {
"bucket_name": AWS_STORAGE_BUCKET_NAME,
"location": 'static'
},
},
}

On Monday, December 14, 2020 at 2:10:32 PM UTC+5:30 KUMBHAGIRI SIVAKRISHNA 
wrote:

> ile 
> "/home/sivakrishna/Downloads/peeljobs-env/lib/python3.8/site-packages/botocore/handlers.py",
>  
> line 200, in validate_bucket_name
> if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket):
> TypeError: expected string or bytes-like object
>
>
> Please help me to solve this problem 
>

-- 
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/561c9981-ae62-4a88-90ac-4704968e1ad2n%40googlegroups.com.


Re: if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket): TypeError: expected string or bytes-like object

2020-12-14 Thread Kasper Laudrup

On 14/12/2020 09.38, KUMBHAGIRI SIVAKRISHNA wrote:
ile 
"/home/sivakrishna/Downloads/peeljobs-env/lib/python3.8/site-packages/botocore/handlers.py", 
line 200, in validate_bucket_name

     if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket):
TypeError: expected string or bytes-like object


Please help me to solve this problem



https://stackoverflow.com/help/how-to-ask

--
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/886570b2-6eee-45ef-83a3-16a8cc939e12%40stacktrace.dk.


if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket): TypeError: expected string or bytes-like object

2020-12-14 Thread KUMBHAGIRI SIVAKRISHNA
ile
"/home/sivakrishna/Downloads/peeljobs-env/lib/python3.8/site-packages/botocore/handlers.py",
line 200, in validate_bucket_name
if not VALID_BUCKET.search(bucket) and not VALID_S3_ARN.search(bucket):
TypeError: expected string or bytes-like object


Please help me to solve this problem

-- 
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/CAMM5N90eXxofy6AOG54bC%2B_qN1-UcECOR6tKZYdzhhPrgmSecg%40mail.gmail.com.


Re: TypeError: expected string or bytes-like object

2019-08-30 Thread Suraj Thapa FC
Code pls

On Fri, 30 Aug, 2019, 6:06 PM Soumen Khatua, 
wrote:

> Hi Folks,
>
> After do some modification in models.py like I remove some column and add
> some column in my models,now I'm getting this error:
>
> *TypeError: expected string or bytes-like object*
>
>
> Please tell me how can i solve this problem?
>
>
> Thank You
>
> Regards,
> Soumen
>
> --
> 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/CAPUw6WaHcREmx0Nw8NTXoxdC-fKrQKQuVMfdk5DmGz6%3DTd4yFw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPUw6WaHcREmx0Nw8NTXoxdC-fKrQKQuVMfdk5DmGz6%3DTd4yFw%40mail.gmail.com?utm_medium=email_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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPjsHcHtxZa8wTY%2Bb0EpAOXgu4PfrSM232OXS9V6pmt-Lve%3DdQ%40mail.gmail.com.


TypeError: expected string or bytes-like object

2019-08-30 Thread Soumen Khatua
Hi Folks,

After do some modification in models.py like I remove some column and add
some column in my models,now I'm getting this error:

*TypeError: expected string or bytes-like object*


Please tell me how can i solve this problem?


Thank You

Regards,
Soumen

-- 
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/CAPUw6WaHcREmx0Nw8NTXoxdC-fKrQKQuVMfdk5DmGz6%3DTd4yFw%40mail.gmail.com.


TypeError: expected string or bytes-like object

2017-05-18 Thread vitalysweb
Hello,
i have problem in migration, in my* "model.py"* file  i added a new table 
and new fields (into the exisiting table) and thats what i got when i do 
*""..manage.py 
migrate..."" :*

Operations to perform:
  Apply all migrations: utilisateur
Running migrations:
  Applying utilisateur.0002_auto_20170518_1610...Traceback (most recent 
call last):
  File "manage.py", line 22, in 
execute_from_command_line(sys.argv)
  File "C:\Python36\lib\site-packages\django\core\management\__init__.py", 
line 363, in execute_from_command_line
utility.execute()
  File "C:\Python36\lib\site-packages\django\core\management\__init__.py", 
line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python36\lib\site-packages\django\core\management\base.py", line 
283, in run_from_argv
self.execute(*args, **cmd_options)
  File "C:\Python36\lib\site-packages\django\core\management\base.py", line 
330, in execute
output = self.handle(*args, **options)
  File 
"C:\Python36\lib\site-packages\django\core\management\commands\migrate.py", 
line 204, in handle
fake_initial=fake_initial,
  File "C:\Python36\lib\site-packages\django\db\migrations\executor.py", 
line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, 
fake_initial=fake_initial)
  File "C:\Python36\lib\site-packages\django\db\migrations\executor.py", 
line 145, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, 
fake_initial=fake_initial)
  File "C:\Python36\lib\site-packages\django\db\migrations\executor.py", 
line 244, in apply_migration
state = migration.apply(state, schema_editor)
  File "C:\Python36\lib\site-packages\django\db\migrations\migration.py", 
line 129, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, 
project_state)
  File 
"C:\Python36\lib\site-packages\django\db\migrations\operations\fields.py", 
line 86, in database_forwards
field,
  File 
"C:\Python36\lib\site-packages\django\db\backends\sqlite3\schema.py", line 
238, in add_field
self._remake_table(model, create_field=field)
  File 
"C:\Python36\lib\site-packages\django\db\backends\sqlite3\schema.py", line 
113, in _remake_table
self.effective_default(create_field)
  File "C:\Python36\lib\site-packages\django\db\backends\base\schema.py", 
line 228, in effective_default
default = field.get_db_prep_save(default, self.connection)
  File "C:\Python36\lib\site-packages\django\db\models\fields\__init__.py", 
line 766, in get_db_prep_save
prepared=False)
  File "C:\Python36\lib\site-packages\django\db\models\fields\__init__.py", 
line 1297, in get_db_prep_value
value = self.get_prep_value(value)
  File "C:\Python36\lib\site-packages\django\db\models\fields\__init__.py", 
line 1292, in get_prep_value
return self.to_python(value)
  File "C:\Python36\lib\site-packages\django\db\models\fields\__init__.py", 
line 1254, in to_python
parsed = parse_date(value)
  File "C:\Python36\lib\site-packages\django\utils\dateparse.py", line 61, 
in parse_date
match = date_re.match(value)
PS C:\Users\admin\vital>

i'v included the models.py file !!

so if someone can help !! 
thnx

-- 
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/0666e7d3-f17c-490f-b1ee-e7d2af73dbdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
from django.db import models

class User(models.Model):
"""
On fait hériter notre classe User de AbstractUser pour avoir les groupes, les permissions, le nom, l'email, etc. 
Si vous n'avez pas besoin de ces fonctionnalités vous pouvez hériter de BaseAbstractUser
"""
username = models.CharField(max_length=255, unique=True, verbose_name=("Nom d'utilisateur"))
first_name = models.CharField(max_length=50, verbose_name=("Nom de Famille"))
last_name = models.CharField(max_length=50, verbose_name=("Prénom"))
birth_date = models.DateField(verbose_name= ("Date de Naissance"))
birth_place = models.DateField(verbose_name= ("Lieu de Naissance"))
email = models.EmailField(unique=True, verbose_name=("Adresse Email"))
adress = models.CharField(max_length=80, help_text='Exemple: 01 RUE DE CRAIOVA', verbose_name=("Adresse"))
adress_complement = models.CharField(max_length=80, help_text='Residence, batiment, Appt, BP, Chez..', verbose_name=("Complément d'Adresse"))
city = models.CharField(max_length=80, help_text='Exemple: PARIS', verbose_name=("Ville"))
zipcode = models.IntegerField(help_text='75016', verbose_name=("Code Postal"))
drive_licence_num