mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-16 01:44:51 +03:00
Add RTD Support
* Sample URL: https://test-cookiecutter-django-rtd.readthedocs.io/en/latest/_source/howto.html# * Issue: you must go to /_source for this to work due to how the docs/* configuration is setup up.
This commit is contained in:
parent
3b5f3160c0
commit
92cafc618f
|
@ -14,11 +14,20 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import django
|
import django
|
||||||
|
|
||||||
|
if os.getenv("READTHEDOCS", default=False) == "True":
|
||||||
|
sys.path.insert(0, os.path.abspath(".."))
|
||||||
|
os.environ["DJANGO_READ_DOT_ENV_FILE"] = "True"
|
||||||
|
{% if cookiecutter.use_celery == 'y' -%}
|
||||||
|
os.environ["CELERY_BROKER_URL"] = os.getenv("REDIS_URL", "redis://redis:6379")
|
||||||
|
{%- endif %}
|
||||||
|
os.environ["USE_DOCKER"] = "no"
|
||||||
|
master_doc = "_source/index"
|
||||||
|
else:
|
||||||
{% if cookiecutter.use_docker == 'y' %}
|
{% if cookiecutter.use_docker == 'y' %}
|
||||||
sys.path.insert(0, os.path.abspath("/app"))
|
sys.path.insert(0, os.path.abspath("/app"))
|
||||||
os.environ.setdefault("DATABASE_URL", "")
|
os.environ.setdefault("DATABASE_URL", "")
|
||||||
{% else %}
|
{% else %}
|
||||||
sys.path.insert(0, os.path.abspath(".."))
|
sys.path.insert(0, os.path.abspath(".."))
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
||||||
django.setup()
|
django.setup()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user