Re: python manage.py commonds: AttributeError: 'PosixPath' object has no attribute 'startswith'

2023-05-14 Thread David Du
Thanks to all and best wishes!

Julius Chesoni在 2023年4月26日星期三下午9:58:23 [UTC+8]寫道:

> You must be a very good Django programmer. 
>
> Thank you on behalf of Django community, for such a great answer that even 
> novices like me are able to understand.
>
>  I had no idea that there were other non default configurations of the 
> variable BASE_DIR. 
>
>
> Julius.
>
> On Wed, Apr 26, 2023 at 1:15 AM David Nugent  wrote:
>
>> This error is being triggered by an outdated and badly behaved module 
>> that contains the run_cmdb_worker management command.
>>
>> Anything that relies on the presence of BASE_DIR in settings is bad 
>> behaviour. This is an entirely arbitrary variable name that might not even 
>> be present in a non-default configuration, and it effectively a "private" 
>> variable.
>>
>> There are better ways to determine the Django base directory (although 
>> reliance on same is also questionable as it probably assumes a specific 
>> Django layout, which is also poor behaviour).
>>
>> If you insist on using it, then simply wrap BASE_DIR def with a str() 
>> cast, or use .as_posix() member, i.e.
>>
>> BASE_DIR = str(Path(__file__).resolve().parent.parent)
>>
>> This may invalidate other uses in your settings module though, for 
>> example:
>>
>> BASE_DIR / 'someothervalue'
>>
>> If your change does not trigger an error otherwise, then you are probably 
>> fine.
>>
>> Regards,
>> David
>>
>>
>> On Mon, Apr 24, 2023 at 2:21 AM DL  wrote:
>>
>>> Django 4.2
>>> Python 3.10.10
>>>
>>> # python manage.py run_cmdb_worker
>>> Traceback (most recent call last):
>>>   File "/usr/local/python/lib/python3.10/pkgutil.py", line 417, in 
>>> get_importer
>>> importer = sys.path_importer_cache[path_item]
>>> KeyError: PosixPath('/www/cloudadmin')
>>>
>>> During handling of the above exception, another exception occurred:
>>>
>>> Traceback (most recent call last):
>>>   File "/www/cloudadmin/manage.py", line 22, in 
>>> main()
>>>   File "/www/cloudadmin/manage.py", line 18, in main
>>> execute_from_command_line(sys.argv)
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/django/core/management/__init__.py",
>>>  
>>> line 442, in execute_from_command_line
>>> utility.execute()
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/django/core/management/__init__.py",
>>>  
>>> line 436, in execute
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/django/core/management/__init__.py",
>>>  
>>> line 275, in fetch_command
>>> klass = load_command_class(app_name, subcommand)
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/django/core/management/__init__.py",
>>>  
>>> line 48, in load_command_class
>>> module = import_module("%s.management.commands.%s" % (app_name, 
>>> name))
>>>   File "/usr/local/python/lib/python3.10/importlib/__init__.py", line 
>>> 126, in import_module
>>> return _bootstrap._gcd_import(name[level:], package, level)
>>>   File "", line 1050, in _gcd_import
>>>   File "", line 1027, in _find_and_load
>>>   File "", line 1006, in 
>>> _find_and_load_unlocked
>>>   File "", line 688, in _load_unlocked
>>>   File "", line 883, in exec_module
>>>   File "", line 241, in 
>>> _call_with_frames_removed
>>>   File 
>>> "/www/cloudadmin/apps/cmdb/management/commands/run_cmdb_worker.py", line 2, 
>>> in 
>>> from cmdb.scheduler import Scheduler
>>>   File "/www/cloudadmin/apps/cmdb/scheduler.py", line 3, in 
>>> from apscheduler.schedulers.background import BackgroundScheduler
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/apscheduler/__init__.py", line 
>>> 1, in 
>>> from pkg_resources import get_distribution, DistributionNotFound
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 
>>> 3260, in 
>>> def _initialize_master_working_set():
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 
>>> 3234, in _call_aside
>>> f(*args, **kwargs)
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 
>>> 3272, in _initialize_master_working_set
>>> working_set = WorkingSet._build_master()
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 
>>> 572, in _build_master
>>> ws = cls()
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 
>>> 565, in __init__
>>> self.add_entry(entry)
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 
>>> 621, in add_entry
>>> for dist in find_distributions(entry, True):
>>>   File 
>>> "/opt/.pyvenv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 
>>> 1988, in find_distributions
>>> importer = get_importer(path_item)
>>>   File "/usr/local/python/lib/python3.10/pkgutil.py", line 421, in 
>>> get_importer
>>> importer = path_hook(path_item)
>>>   File "", line 16

Re: Masonry card columns

2023-05-14 Thread Michael Edet
Thank you
It worked well
But I didn't see Borders
Are you on WhatsApp?


On Sat, 13 May 2023, 22:06 ALBERT ASHABA AHEEBWA, <
ashabaaheebwaalb...@gmail.com> wrote:

> This is a simple css issue. You need to change the width of the card.
> Making it compact will result in the desired outcome.
>
> If you are using bootstrap use grid instead of flexbox. Set width to w-50.
>
> i.e
>
> 
>
> 
>
> <-! Card here -->
>
> 
>
> 
> 
>
>
> Best Regards,
>
> Albert Ashaba Aheebwa
> +256 781 435857
>
> On Sat, 13 May 2023, 23:42 Michael Edet,  wrote:
>
>> I have been trying to do card columns on my html but it is not working
>> What is wrong with it?
>> The first one is the outcome
>> The second one is what I want it to look like
>>
>>
>> --
>> 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/CACM0XWwTq5kcnx3i8VsA0Euq4bq-CBd7CQnGK108VJm2hsVNYg%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAQecPeEq12qAhi1FwgwZV_xdnLYWomwPLVT%2By5fG7ecHRpCuA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACM0XWz0i8b9GtxHs8uPo_kvdrH95Oxa8pnUR5oQ8VVSDBawEg%40mail.gmail.com.