rhenter / django-stuff Goto Github PK
View Code? Open in Web Editor NEWDjango Stuff is a collection of tools and utilities to make your development with Django simpler.
License: MIT License
Django Stuff is a collection of tools and utilities to make your development with Django simpler.
License: MIT License
Erro:
$ py.test -vv -s
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.6.6, pytest-4.3.1, py-1.8.0, pluggy-0.9.0 -- /home/rg3915/gh/my/django-stuff/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/rg3915/gh/my/django-stuff, inifile: pytest.ini
plugins: django-3.4.8, cov-2.6.1
collected 20 items / 2 errors / 18 selected
================================================================================== ERRORS ==================================================================================
________________________________________________________ ERROR collecting test-django-project/tests/test_fields.py _________________________________________________________
test-django-project/tests/test_fields.py:6: in <module>
from testapp.models import TestModel, TestDigitsOnlyField
test-django-project/testapp/models.py:3: in <module>
from django_stuff.models import UUIDModel, HistoryModel, SignalsModel, TimestampedModel, SerializerModel
test-django-project/django_stuff/models/__init__.py:1: in <module>
from .generic import SlugModel, TimestampedModel, UUIDModel, SerializerModel # noqa
test-django-project/django_stuff/models/generic.py:11: in <module>
class BaseModel(models.Model):
.venv/lib/python3.6/site-packages/django/db/models/base.py:87: in __new__
app_config = apps.get_containing_app_config(module)
.venv/lib/python3.6/site-packages/django/apps/registry.py:249: in get_containing_app_config
self.check_apps_ready()
.venv/lib/python3.6/site-packages/django/apps/registry.py:131: in check_apps_ready
settings.INSTALLED_APPS
.venv/lib/python3.6/site-packages/django/conf/__init__.py:57: in __getattr__
self._setup(name)
.venv/lib/python3.6/site-packages/django/conf/__init__.py:42: in _setup
% (desc, ENVIRONMENT_VARIABLE))
E django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
________________________________________________________ ERROR collecting test-django-project/tests/test_models.py _________________________________________________________
test-django-project/tests/test_models.py:4: in <module>
from django_stuff.models.exceptions import HistoryModelNotSetError
test-django-project/django_stuff/models/__init__.py:1: in <module>
from .generic import SlugModel, TimestampedModel, UUIDModel, SerializerModel # noqa
test-django-project/django_stuff/models/generic.py:11: in <module>
class BaseModel(models.Model):
.venv/lib/python3.6/site-packages/django/db/models/base.py:87: in __new__
app_config = apps.get_containing_app_config(module)
.venv/lib/python3.6/site-packages/django/apps/registry.py:249: in get_containing_app_config
self.check_apps_ready()
.venv/lib/python3.6/site-packages/django/apps/registry.py:131: in check_apps_ready
settings.INSTALLED_APPS
.venv/lib/python3.6/site-packages/django/conf/__init__.py:57: in __getattr__
self._setup(name)
.venv/lib/python3.6/site-packages/django/conf/__init__.py:42: in _setup
% (desc, ENVIRONMENT_VARIABLE))
E django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
----------- coverage: platform linux, python 3.6.6-final-0 -----------
Name Stmts Miss Cover Missing
-----------------------------------------------------------------
django_stuff/__init__.py 3 0 100%
django_stuff/backends/__init__.py 0 0 100%
django_stuff/backends/auth.py 18 18 0% 1-24
django_stuff/fields.py 17 9 47% 10-13, 16-22
django_stuff/forms.py 31 16 48% 12-15, 22, 25-29, 40, 43-47
django_stuff/logging_tools.py 13 13 0% 1-31
django_stuff/models/__init__.py 4 3 25% 2-5
django_stuff/models/exceptions.py 2 2 0% 1-2
django_stuff/models/generic.py 38 29 24% 17-65
django_stuff/models/history.py 22 22 0% 1-34
django_stuff/models/managers.py 12 12 0% 1-16
django_stuff/models/signals.py 35 35 0% 1-51
django_stuff/utils.py 97 78 20% 15-33, 37, 41, 45-47, 52-76, 81-101, 105-107, 111-113, 117-130
django_stuff/version.py 1 0 100%
-----------------------------------------------------------------
TOTAL 293 237 19%
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================= 2 error in 1.09 seconds ==========================================================================
Erro após instalar e rodar o django com django-stuff.
Eu coloquei o django_stuff
em INSTALLED_APPS, mas
$ python manage.py
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "/tmp/dj/.venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/tmp/dj/.venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/tmp/dj/.venv/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/tmp/dj/.venv/lib/python3.5/site-packages/django/apps/registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "/tmp/dj/.venv/lib/python3.5/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/tmp/dj/.venv/lib/python3.5/site-packages/django_stuff/__init__.py", line 4, in <module>
from .version import version # noqa
File "/tmp/dj/.venv/lib/python3.5/site-packages/django_stuff/version.py", line 24, in <module>
version = get_version()
File "/tmp/dj/.venv/lib/python3.5/site-packages/django_stuff/version.py", line 15, in get_version
with codecs.open(changes, encoding='utf-8') as changes:
File "/usr/lib/python3.5/codecs.py", line 895, in open
file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/dj/.venv/lib/python3.5/site-packages/CHANGES.rst'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.