I'm using oscar and added from fork order app. After added that cant run syncdb or server. It is giving an error import error: No module named 'project\\order'
from oscar import get_core_apps
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.flatpages',
'django.contrib.sites',
'compressor',
] + get_core_apps(['project\order'])
SITE_ID = 1
this is my installed apps. I didnt understand why it doing this.
This get_core_apps(['project\order']) should be get_core_apps(['project.order']).
I changed project to oscar.apps.order and it did work. But why, it is a question for me.
Related
Tying to register my djano app in the settings section of my django project. but when i run the server i am getting an error in the terminal.
django.core.exceptions.ImproperlyConfigured: 'site1app.apps' does not contain a class 'Site1appConfig'. Choices are: 'Site1AppConfig'.
I dont know what's going wrong as i just added it to the list of installed apps in settings.py:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'site1app.apps.Site1appConfig',
]
This looks like a miss on the capitalization for your class
Change:
'site1app.apps.Site1appConfig'
To:
'site1app.apps.Site1AppConfig'
Hello everyone.
This is the first time I ask for help on StackOverflow, so please forgive me if my question here is clear enough... I will gladly provide anything you ask me for in order to have a better understanding of this issue
I have Django project that is not importing a model from an app that is registered on my settings.
This app has been working good until 2 day ago, but I haven't made any changes related to models.
I have tried many things to fix this issue but still giving me the same error...
I can't import anything coming from the models on any of my apps...
This is very frustrating. Please some advise
INSTALLED_APPS = (
# Django Applications
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.sitemaps',
# 'satchmo_store.shop',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.staticfiles',
'django.contrib.messages',
'django_comments',
'django.contrib.humanize',
# Reorder admin apps
'admin_reorder',
# Third Party Django Applications
## 'django_extensions',
'photologue',
'sorl.thumbnail',
'filebrowser',
'widget_tweaks',
'snowpenguin.django.recaptcha2',
'tinymce',
'django_extensions',
'model_utils',
'cart',
'anymail',
'rest_framework',
'storages',
# 'django_s3_storage',
'my_project.libs.chunks',
'my_project.apps.definition',
'my_project.apps.makeaword',
'my_project.apps.tellinstories',
'my_project.apps.wordsearch',
'my_project.libs.payflowpro',
# Project Applications
'my_project.apps.accounts',
'my_project.apps.book',
'my_project.apps.general',
'my_project.apps.illustrate',
'my_project.apps.write',
'my_project.apps.pressroom',
'my_project.apps.images',
'my_project.apps.comic',
'my_project.apps.library',
'my_project.apps.reports',
'my_project.apps.orders',
'my_project.apps.gift_cards',
'my_project.apps.stationary',
'my_project.apps.invoices',
'my_project.apps.cart_itt',
)
Import like:
from general.models import GiftCardOrders
hello guys what the difference between this two syntax
'blog' and 'blog.apps.BlogConfig'
in project this is located in installed app.
I think both are same but there should be difference between this 2 commands because they looks like different
first one is this
INSTALLED_APPS = [
'blog',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
seccond one is :
INSTALLED_APPS = [
'blog.apps.BlogConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
I assume that you have a custom configuration(BlogConfig) for your app.
You have at least two options to register the app with custom config in project settings(INSTALLED_APPS).
(if)You have a variable default_app_config = 'blog.apps.BlogConfig' in blog/__init__.py file, then inserting blog into INSTALLED_APPS will be the same as blog.apps.BlogConfig. If you don't have it in __init__.py, BlogConfig won't be applied in the example below.
INSTALLED_APPS = [
...,
'blog',
...,
]
(if)You have an empty __init__.py in your app. Then to apply the custom config you must include the path to config.
INSTALLED_APPS = [
...,
'blog.apps.BlogConfig',
...,
]
putting only blog in the second example will work without the custom config.
I'm setting up the enviroment variables in my venv created with virtualenv.
I created two scripts: postactivate and preactivate, The order of the commands that I follow are: source venv/bin/activate, source venv/bin/postactivate and python manage.py runserver but I have this error when I try to run my command python manage.py runserver : django.core.exceptions.ImproperlyConfigured: The INSTALLED_APPS setting must be a list or a tuple.
Y tried some things: put the entire list in only one line, to exchange between single and double quotes, even, convert to a tuple.
postactivate script
export INSTALLED_APPS="[
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.humanize',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'custom_user',
'corsheaders',
'django_s3_storage',
'django_ses',
'captcha',
'embed_video',
'bootstrap_forms',
'models_simple_trans',
'tables',
'markdown_filter',
'apps.countries',
'apps.companies',
'apps.organizations',
'apps.campaigns',
'apps.auctions',
'apps.users',
'apps.home',
'apps.emails',
'apps.adminpanel',
'apps.payments',
'helpers',
'celery',
'rest_framework_swagger',
'django_extensions',
'social_django',
'mapwidgets',
'rosetta',
'channels',
'django_user_agents',
'django.contrib.sitemaps',
'django_tables2',
]"
I hope you can help me.
Looks like you are setting INSTALLED_APPS in the environment as a string. If you have a line like this in settings file:
INSTALLED_APPS = os.environ.get('INSTALLED_APPS '),
you might try chaning it to
INSTALLED_APPS = json.loads(os.environ.get('INSTALLED_APPS '))
I´m using python 3.5.1 and django 2.0.1. I have a django app which I want to start but i get the following error message:
ImportError: No module named 'nested_inline'
Under settings.py I have in installed apps:
INSTALLED_APPS = [
'nested_inline',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'betonermüdung'
]
So.. I can´t understand where the problem could be... can anyone help??
Thank you in advance