atom-script | : runner : Run in Atom | Code Editor library
kandi X-RAY | atom-script Summary
kandi X-RAY | atom-script Summary
:runner: Run ( scripts | selections | source ) in Atom
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- activate a script view
- Generate C arguments
- Serialize script views
- Get the shebang comment from editor
- Deactivates script scripts
- Get the jgrammar for a given classpath
- Get coffee arguments
- Provides a JavaScript runtime .
- set default encoding
- Get the arguments for a file .
atom-script Key Features
atom-script Examples and Code Snippets
Community Discussions
Trending Discussions on atom-script
QUESTION
My Django skill level: noob.
I am going nuts at setting the DJANGO_SETTINGS_MODULE
properly to finally get my model imported within a script. I use a virtualenv
for my project.
This is my current error:
ModuleNotFoundError: No module named 'dashex'
And the according feeder.py
script:
ANSWER
Answered 2019-Dec-03 at 15:26django-admin and manage.py are not used to set environment variables, so the commands in your question like django-admin set DJANGO_SETTINGS_MODULE=dashex.settings
don't make sense.
On Windows, you can run set DJANGO_SETTINGS_MODULE=dashex.settings
in the command prompt before running the script. You say you don't want to use the shell, so it might be easier to set the environment variable in the script instead.
QUESTION
Background information:
I would like to run the feeder.py
script using atoms script
plug-in. I first encountered a ImproperlyConfigured
error which was solved as suggested here: First fix
Then I run into RuntimeError: Model class models.AccountInformation doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
error which was solved by using an absolute path for the model import as shown below.
Current issue:
Using the mentioned absolute import, I receive this error:
ModuleNotFoundError: No module named 'Dashboard_app'
I can even render the template for that app etc. so I am confused why he tells me that the module doesn't exist. When I remove the model import, everything works just fine. Is it maybe that the script
instance doesn't recognize it properly?
What I've tried:
- deleted + re-created
__init__.py
- checked settings for app to be included in
INSTALLED-APPS
dic - changed import path to
DASHEX.Dashboard_app.models
resulting inno module named DASHEX
error - changed import path to
models
resulting inModel class models.AccountInformation doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
error - changed the app in
INSTALLED_APPS
toDashboard_app
feeder.py script:
...ANSWER
Answered 2019-Dec-03 at 12:32I think (almost sure!) that the problem is about the settings.configure()
; as you didn't specify any default_settings
, django will use it's default settings template (the one you see when you create a new project) and your Dashboard_app
is not there. That's the cause of this error:
changed import path to models resulting in Model class models.AccountInformation doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS error
Try specifiying your settings inside the configure
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install atom-script
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page