GithubHelp home page GithubHelp logo

Strong DB dependency about django-treemenus HOT 8 CLOSED

jphalip avatar jphalip commented on June 18, 2024
Strong DB dependency

from django-treemenus.

Comments (8)

jphalip avatar jphalip commented on June 18, 2024

Yes, I agree it should fail more gracefully and only show the exception if TEMPLATE_DEBUG (https://docs.djangoproject.com/en/dev/ref/settings/#template-debug) is set to True.

Would you like to provide a patch with some tests?

from django-treemenus.

dhiana avatar dhiana commented on June 18, 2024

Sure!

from django-treemenus.

dhiana avatar dhiana commented on June 18, 2024
$ make test
DJANGO_SETTINGS_MODULE=treemenus.tests.settings django-admin.py test treemenus
Traceback (most recent call last):
  File "/home/dhiana/.virtualenvs/dj16/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    commands = get_commands()
  File "/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/core/management/__init__.py", line 107, in get_commands
    apps = settings.INSTALLED_APPS
  File "/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/conf/__init__.py", line 54, in __getattr__
    self._setup(name)
  File "/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/conf/__init__.py", line 49, in _setup
    self._wrapped = Settings(settings_module)
  File "/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/conf/__init__.py", line 132, in __init__
    % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'treemenus.tests.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named treemenus.tests.settings
make: *** [test] Error 1

I've tried django 1.4 and 1.6. Any hints?

from django-treemenus.

jphalip avatar jphalip commented on June 18, 2024

Where did you run the 'make test' command from? Have you tried from the repository's root?

from django-treemenus.

dhiana avatar dhiana commented on June 18, 2024

I'm on the repo root. Calling python and importing the settings module
works fine...

(dj16)[dhiana@csrjl06l django-treemenus]$ ls
AUTHORS.txt  docs  LICENCE.txt  Makefile  README.rst  setup.cfg  setup.py
 treemenus

(dj16)[dhiana@csrjl06l django-treemenus]$ make test
DJANGO_SETTINGS_MODULE=treemenus.tests.settings django-admin.py test
treemenus
Traceback (most recent call last):
  File "/home/dhiana/.virtualenvs/dj16/bin/django-admin.py", line 5, in
<module>
    management.execute_from_command_line()
  File
"/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/core/management/__init__.py",
line 399, in execute_from_command_line
    utility.execute()
  File
"/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/core/management/__init__.py",
line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/core/management/__init__.py",
line 261, in fetch_command
    commands = get_commands()
  File
"/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/core/management/__init__.py",
line 107, in get_commands
    apps = settings.INSTALLED_APPS
  File
"/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/conf/__init__.py",
line 54, in __getattr__
    self._setup(name)
  File
"/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/conf/__init__.py",
line 49, in _setup
    self._wrapped = Settings(settings_module)
  File
"/home/dhiana/.virtualenvs/dj16/lib/python2.7/site-packages/django/conf/__init__.py",
line 132, in __init__
    % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'treemenus.tests.settings' (Is it on
sys.path? Is there an import error in the settings file?): No module named
treemenus.tests.settings
make: *** [test] Error 1

(dj16)[dhiana@csrjl06l django-treemenus]$ python
Python 2.7.5 (default, Jun 26 2014, 11:55:39)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import treemenus.tests.settings

2014-08-18 17:51 GMT-03:00 Julien Phalip [email protected]:

Where did you run the 'make test' command from? Have you tried from the
repository's root?


Reply to this email directly or view it on GitHub
#32 (comment)
.

from django-treemenus.

jphalip avatar jphalip commented on June 18, 2024

Could you try this?

$ PYTHONPATH=. make test

from django-treemenus.

dhiana avatar dhiana commented on June 18, 2024

It worked! Any thoughts on why this is necessary?

2014-09-06 16:05 GMT-03:00 Julien Phalip [email protected]:

Could you try this?

$ PYTHONPATH=. make test


Reply to this email directly or view it on GitHub
#32 (comment)
.

from django-treemenus.

jphalip avatar jphalip commented on June 18, 2024

Fixed in 4b8882f. Thank you!

from django-treemenus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.