For a long time I can not find the right way. I always get a mistake. I have already tried all the paths listed below.
os.path.abspath sys.path.insert(0,
os.path.dirname(os.path.dirname(os.path.abspath("."))))
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.insert(0, os.path.dirname(os.path.abspath('.')))
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
Here is the ReadTheDocs error output
Running Sphinx v1.6.5
making output directory...
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/kh-taskbuster/envs/latest/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 305, in main
opts.warningiserror, opts.tags, opts.verbosity, opts.jobs)
File "/home/docs/checkouts/readthedocs.org/user_builds/kh-taskbuster/envs/latest/local/lib/python2.7/site-packages/sphinx/application.py", line 168, in __init__
confoverrides or {}, self.tags)
File "/home/docs/checkouts/readthedocs.org/user_builds/kh-taskbuster/envs/latest/local/lib/python2.7/site-packages/sphinx/config.py", line 150, in __init__
execfile_(filename, config)
File "/home/docs/checkouts/readthedocs.org/user_builds/kh-taskbuster/envs/latest/local/lib/python2.7/site-packages/sphinx/util/pycompat.py", line 150, in execfile_
exec_(code, _globals)
File "/home/docs/checkouts/readthedocs.org/user_builds/kh-taskbuster/envs/latest/local/lib/python2.7/site-packages/six.py", line 709, in exec_
exec("""exec _code_ in _globs_, _locs_""")
File "<string>", line 1, in <module>
File "conf.py", line 23, in <module>
from django.conf import settings
ImportError: No module named django.conf
Exception occurred:
File "conf.py", line 23, in <module>
from django.conf import settings
ImportError: No module named django.conf
Here is my conf.py line 1-19 only comments
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
from django.conf import settings
settings.configure()
Here is my project three
This is because you didn't specified the content of the requirements file which is needed for your project's requirement details.
Go to your readthedocs project page and click to the 'admin' link in the top of the menu. then go to the 'advanced settings' page. You'll see a text box for the reqirements file. Write 'requirements/base.txt' here or write the path of your requirements file.
Before save this, go to the bottom of the page and you'll see 'Python Interpreter' setting here. Select the '... 3.x' version if you're using python 3 with your django project.
Then save and go to the 'Overview' section of your readthedocs project. Click to the build and then click to the 'Triggered' in the opened page. Wait a moment and... here is your project with successful build.