Comments (7)
Well, the problem here is that mongoadmin runs fine without any relational db as long as it is set to
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.dummy'
}
}
The only problem is that the admin tends to use contenttypes all over the place. So in order to make the admin run without any kind of relational db mongoadmin tries to figure out if there is a relational db and if there isn't then uses the contenttypes provided by mongoengine. I think the auth system needs them at least.
I do very much agree though that the current test for a relational db sucks and I'd love to have a better (and more robust) test. I do remember that just catching every error the database might throw makes running syncdb next to impossible. Ah, well seems I need to figure out a better test now.
If you can tell jenkins to just catch and ignore it you should be fine though (maybe set HAS_RELATIONAL_DB
to False
too).
from django-mongoadmin.
Correct me if I'm wrong, but I feel like setting the default database engine to dummy
will imply the same for the test database ? It is obviously not what we want, but I will investigate this on my side.
I tend to think the same about HAS_RELATIONAL_DB
In fact, we have a relational db, but only for the tests.
from django-mongoadmin.
I have no idea but I suppose you'll get the same for tests. And, well, I can't tell you what you want of course, only the state the code is in. Which isn't all that great apparently.
And the only reason HAS_RELATIONAL_DB
is there is because it didn't really work for me without. I'm a bit amazed that you got it working without any relational db.
But I take a look at it tomorrow and hopefully come up with a better way to test this.
from django-mongoadmin.
Give d5633d2 a try. If you add MONGOADMIN_CHECK_CONTENTTYPE = False
to settings.py it should not try to figure out wether a relational db is there or not. I'd actually like to make the real test more robust, but failed miserably. So I hope this works for you too.
from django-mongoadmin.
Latest commit works, regarding this issue, on my already setup project.
The subsequent question is: is there a way to simply delay this test, like with a *_lazy()
function ? Because the crash still arise when I start a Django project from scratch.
The main problem beiing that even with a relational database and everything correctly configured, ./manage createdb
will fail because the ContentType
model has not created the SQL table yet. This happens a lot in our environment, either in Jenkins which always start from scratch to be sure the project is completely installable at any time, or when (re-)deploying a full preview environment to test new features.
I understand that I can either temporarily remove mongoadmin
from INSTALLED_APPS
or define MONGOADMIN_CHECK_CONTENTTYPE = False
until createdb
is done, but this is still awkward: you would have to document somewhere that any project starting from scratch with mongoadmin
included will fail to start, and provide these 2 possible workarounds.
from django-mongoadmin.
Aww, I thought createdb
would run without issue and the problem was that Jenkins just didn't create a database. I do wonder if there is a pattern I'm missing that runs tests like this only once but later.
Thinking a bit more about this I think looking at the database setting and assuming that the ContentType
stuff only needs replacement if the DB is explicitly set to dummy is the way to go. This is how it works at the moment anyway. Only uglier...
from django-mongoadmin.
I close this issue because I didn't have time to test further this particular config. I will reopen it if I hit the bug again.
from django-mongoadmin.
Related Issues (20)
- Circular Import Error HOT 1
- "You don't have permission to edit anything" HOT 9
- cannot import name LOOKUP_SEP
- cannot import name MAX_SHOW_ALL_ALLOWED HOT 9
- Maximum recursion exceeded with a ReferenceField('self') in Document HOT 1
- `raw_id_fields` crashing HOT 22
- ImportError: No module named 'mongoadmin.contenttypes' HOT 1
- TypeError: patch_document() got an unexpected keyword argument 'bound' HOT 7
- Exceptions using mongoadmin.auth and mongoadmin.form HOT 4
- 'DatabaseWrapper' object has no attribute 'Database' HOT 3
- 'PermissionManager' object has no attribute 'clone' HOT 3
- AttributeError: 'module' object has no attribute 'User'
- Please, example app with preconfigured settings
- mongo importerror: cannot import name get_verbose_name HOT 3
- clear HOT 2
- ImportError: cannot import name 'update_wrapper' HOT 1
- patch to fix saving error related to missing new_objects attribute HOT 1
- I get an error when I start server
- Django version 1.9 above, we are getting this problem HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-mongoadmin.