Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manage.py crashes #46

Open
eirism opened this issue Oct 6, 2018 · 2 comments
Open

manage.py crashes #46

eirism opened this issue Oct 6, 2018 · 2 comments

Comments

@eirism
Copy link

eirism commented Oct 6, 2018

When running manage.py from the root folder I get the following traceback:

Traceback (most recent call last):
  File "./manage.py", line 5, in <module>
    from sdv import app
  File "<root folder>/sdv/__init__.py", line 46, in <module>
    from config import config
ModuleNotFoundError: No module named 'config'

Is it possible that you should import sdv.config instead of config?

@cheshire137
Copy link
Contributor

I got this error running sdv/createadmin.py in macOS using Python 3.6.4:

% python createadmin.py
Traceback (most recent call last):
  File "createadmin.py", line 2, in <module>
    from config import config
ImportError: cannot import name 'config'

@Sketchy502
Copy link
Owner

Hey,

To avoid these issues the file config.py should contain a dictionary named config where the keys are the environment names and the values are python classes used to store the configuration variables.
The following code segment shows an example of the basic structure for config.py, the required variables can be found in the README and you may also need to set the environment variable SDV_APP_SETTINGS=development.

class DevelopmentConfig():
    DEBUG = True

config = {
    'development': DevelopmentConfig
}

I have also noticed that sometimes there are issues when trying to import local modules, this can sometimes be fixed with some sys.path.insert trickery as seen at the bottom of manage.py or by making sure that the working directory is the root of the application.

If you encounter any other issues, let me know and I'll be happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants