django-ddp
django-ddp copied to clipboard
Example Usage more clearer documentation
Hi,
I'm sorry for this question I am not yet an expert to both django and meteorjs. I am trying to use this django-ddp technology but I am a little stuck on "Start the Django DDP service" on the Example Usage
I created a virtualenv, I created a project named tutorial, I followed the example usage instructions from the start until, Every time I tried to run this command (DJANGO_SETTINGS_MODULE=tutorial.settings dddp) in shell I always get a response of "ImportError: No module named tutorial.settings"
P.S.: I even tried to package the project dir but still no luck.
I really like to practice and use django-ddp ever since I watched your presentation in pycon AU at youtube.
I have same problem as mentioned in above comment. I've done many django projects.
from django.db import models
class Person(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30)
from dddp.api import API, Collection, Publication from dm2 import models
class Person(Collection): model = models.Person
class People(Publication): queries = [ models.Person.objects.all(), ] API.register([Person, People])
$ DJANGO_SETTINGS_MODULE=dm2.settings dddp Traceback (most recent call last): File "~/.virtualenvs/dddp/bin/dddp", line 11, in
sys.exit(main()) File "~/.virtualenvs/dddp/lib/python3.5/site-packages/dddp/main.py", line 349, in main verbosity=namespace.verbosity, File "~/.virtualenvs/dddp/lib/python3.5/site-packages/dddp/main.py", line 279, in serve launcher = DDPLauncher(debug=verbosity == 3, verbosity=verbosity) File "~/.virtualenvs/dddp/lib/python3.5/site-packages/dddp/main.py", line 104, in init close_old_connections() File "~/.virtualenvs/dddp/lib/python3.5/site-packages/django/db/init.py", line 63, in close_old_connections for conn in connections.all(): File "~/.virtualenvs/dddp/lib/python3.5/site-packages/django/db/utils.py", line 227, in all return [self[alias] for alias in self] File "~/.virtualenvs/dddp/lib/python3.5/site-packages/django/db/utils.py", line 224, in iter return iter(self.databases) File "~/.virtualenvs/dddp/lib/python3.5/site-packages/django/utils/functional.py", line 33, in get res = instance.dict[self.name] = self.func(instance) File "~/.virtualenvs/dddp/lib/python3.5/site-packages/django/db/utils.py", line 157, in databases self._databases = settings.DATABASES File "~/.virtualenvs/dddp/lib/python3.5/site-packages/django/conf/init.py", line 55, in getattr self._setup(name) File "~/.virtualenvs/dddp/lib/python3.5/site-packages/django/conf/init.py", line 43, in _setup self._wrapped = Settings(settings_module) File "~/.virtualenvs/dddp/lib/python3.5/site-packages/django/conf/init.py", line 99, in init mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/opt/python-3.5.0/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File " ", line 986, in _gcd_import File " ", line 969, in _find_and_load File " ", line 944, in _find_and_load_unlocked File " ", line 222, in _call_with_frames_removed File " ", line 986, in _gcd_import File " ", line 969, in _find_and_load File " ", line 956, in _find_and_load_unlocked ImportError: No module named 'dm2'`
I answered the above issue on StackOverflow and didn't realize he posted it here too.
See if this helps: [http://stackoverflow.com/questions/34280559/django-ddp-assistance/35560043#35560043]