Under my Django project I have created a directory for an aiohttp service.
1) How is the best way to structure it?
This is my current structure:
myproject/
myservice/
__init__.py
service.py
utils.py
myproject/
__init__.py
settings.py
urls.py
uwsgi.py
manage.py
2) If my service needs to import some settings from myproject.settings, how can I do it? Should I move service.py under the root?
I get:
ImportError: No module named 'myproject'
Your server.py script, which uses aiohttp should be next to your manage.py file.
You should probraly also add:
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
from django import setup
setup()