Problem renaming my application

68 views
Skip to first unread message

Erfan Shokrollahi

unread,
Nov 26, 2015, 9:46:46 AM11/26/15
to Django users
Hello.
I have a project named venus. I'm creating an application named aboutus and want to rename it in my admin page.
As decribed here ,I created apps.py file in my application's directory as:

aboutus/apps.py
from django.apps import AppConfig



class AboutUsConfig(AppConfig):
    name
= 'aboutus'
    verbose_name
= 'Who we are'

Then I added the code to __init__.py in my applcation directory as:

aboutus/__init__.py
default_app_config = 'aboutus.apps.AboutUsConfig'

As docs says,It is enough. But I get this exception:

pygeek@pygeek-VPCF115FM:~/DjangoProjects/venus$ python manage.py runserver 8002
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/core/management/__init__.py", line 351, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/core/management/__init__.py", line 343, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/core/management/__init__.py", line 177, in fetch_command
    commands = get_commands()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/utils/lru_cache.py", line 101, in wrapper
    result = user_function(*args, **kwds)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/core/management/__init__.py", line 72, in get_commands
    for app_config in reversed(list(apps.get_app_configs())):
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/apps/registry.py", line 137, in get_app_configs
    self.check_apps_ready()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/apps/registry.py", line 124, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.


I don't know what is going on. I just followed the docs. Also before running server, I make migrations to aboutus application and get this error:

pygeek@pygeek-VPCF115FM:~/DjangoProjects/venus$ python manage.py makemigrations aboutus
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/core/management/__init__.py", line 351, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/core/management/__init__.py", line 325, in execute
    django.setup()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.8.5-py2.7.egg/django/apps/config.py", line 112, in create
    mod = import_module(mod_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named aboutus.apps


what??? No module named aboutus.apps???
Have I missed sth?? Please help me. Im new to django.
Thanks in advance...

Erfan Shokrollahi

unread,
Dec 5, 2015, 10:34:07 AM12/5/15
to Django users
I found it. I was renaming app to a word containin Persian alphabet
I used u'PersianWord' and th problem solved.
Thanks for viewing my post!
Reply all
Reply to author
Forward
0 new messages