python manage.py commonds: AttributeError: 'PosixPath' object has no attribute 'startswith'
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 1632, in path_hook_for_FileFinder File "", line 1504, in __init__ File "", line 182, in _path_isabs AttributeError: 'PosixPath' object has no attribute 'startswith' I must midify settings.py, change BASE_DIR, it can run # BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)) -- 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/033f2f50-b073-4a97-9d66-6cc7f8a18049n%40googlegroups.com.
Re: 500 error
Its working now.There was a slight error in my url conf. I had put r'^students/(?P\w+)/$' when i should have put r'^(? P\w+)/'. It was the /students/ part of the URL that was giving the problem with CSS. Its now working properly. Can someone tell as to why the error occured?My knowledge of URLconfs is still a little sketchy. sorry about the hurry,I had to finish a project fast and so was a little anxious. Goutham On Nov 4, 8:50 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On 11/4/07, Goutham DL <[EMAIL PROTECTED]> wrote: > > > > > Anyone? > > Sheesh, give people a chance. In the hour you let the original query sit, > there was virtually no traffic on this list; it's quite likely that no one > with any ideas on how to help even read the question before you posted the > follow-up. > > On Nov 4, 6:14 pm, Goutham DL <[EMAIL PROTECTED]> wrote: > > > > The CSS for one of my pages is not loading. Its working properly for > > > all the other pages. > > So, there is something different between the pages that work and the one > that doesn't. What is it? > > > The page is displaying properly but without the CSS. > > > When i looked at the server, it showed a http response of 500. > > Look carefully at the request that gets the 500 vs. ones that work. There's > got to be something different between them. When you find it, fix things so > that the one that is getting the 500 is identical to the ones that work. > > Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: 500 error
Anyone? On Nov 4, 6:14 pm, Goutham DL <[EMAIL PROTECTED]> wrote: > The CSS for one of my pages is not loading. Its working properly for > all the other pages. > The page is displaying properly but without the CSS. > When i looked at the server, it showed a http response of 500.Iam > using django 0.96 on windows. > The server is django's development server. > Can someone help me out? > > Goutham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
500 error
The CSS for one of my pages is not loading. Its working properly for all the other pages. The page is displaying properly but without the CSS. When i looked at the server, it showed a http response of 500.Iam using django 0.96 on windows. The server is django's development server. Can someone help me out? Goutham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: CSS problem
Can some one please help me out here? On Nov 1, 7:03 pm, Goutham DL <[EMAIL PROTECTED]> wrote: > hi, > Its still not working. Iam actually using django 0.96.The code that > antoni gave is giving errors. > Can someone please explain why i need to configure media_urls ? > (media_root has been configured to the appropriate directory). I just > want to link the css file with the html one.how will using > django.views.static.serve help?? > > On Nov 1, 3:26 pm, Gonzalo Delgado <[EMAIL PROTECTED]> > wrote: > > > El Thu, 01 Nov 2007 10:13:13 - > > Goutham DL <[EMAIL PROTECTED]> escribió: > > > > Hi, > > > > Iam new to django. Iam having problems loading css files (and images) > > > using the development server. Is it possible to load css files in the > > > development server or should i use mod_python? > > > (since iam a newbie to mod_python also i prefer using the development > > > server for sometime) > > > > Goutham > > >http://www.djangoproject.com/documentation/0.96/static_files/ > > > -- > > Gonzalo Delgado <[EMAIL PROTECTED]> > > > application_pgp-signature_part > > 1KDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: CSS problem
hi, Its still not working. Iam actually using django 0.96.The code that antoni gave is giving errors. Can someone please explain why i need to configure media_urls ? (media_root has been configured to the appropriate directory). I just want to link the css file with the html one.how will using django.views.static.serve help?? On Nov 1, 3:26 pm, Gonzalo Delgado <[EMAIL PROTECTED]> wrote: > El Thu, 01 Nov 2007 10:13:13 - > Goutham DL <[EMAIL PROTECTED]> escribió: > > > > > Hi, > > > Iam new to django. Iam having problems loading css files (and images) > > using the development server. Is it possible to load css files in the > > development server or should i use mod_python? > > (since iam a newbie to mod_python also i prefer using the development > > server for sometime) > > > Goutham > > http://www.djangoproject.com/documentation/0.96/static_files/ > > -- > Gonzalo Delgado <[EMAIL PROTECTED]> > > application_pgp-signature_part > 1KDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
CSS problem
Hi, Iam new to django. Iam having problems loading css files (and images) using the development server. Is it possible to load css files in the development server or should i use mod_python? (since iam a newbie to mod_python also i prefer using the development server for sometime) Goutham --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---