Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
Django and aiohttp together under the same project

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'
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

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()
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!