Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ tests.py
*.egg-info/
dist/
pyconfluence/__pycache__/
.idea/
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ environment variables. Here's the step-by-step process:

export PYCONFLUENCE_TOKEN=[password for Confluence account]

export PYCONFLUENCE_ORG=[organization name; found in "https://[org].atlassian.net/wiki/..." URL]
export BASE_URL=[url of your Confluence website]

3. Save the file, then add this to ".bash_profile" in your home directory ("~/.bash_profile"):

Expand Down
5 changes: 2 additions & 3 deletions pyconfluence/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def load_variables():
"""Load variables from environment variables."""
if (not os.environ.get("PYCONFLUENCE_TOKEN") or
not os.environ.get("PYCONFLUENCE_USER") or
not os.environ.get("PYCONFLUENCE_ORG")):
not os.environ.get("BASE_URL")):
print ("One or more pyconfluence environment variables are not set. "
"See README for directions on how to resolve this.")
sys.exit("Error")
Expand All @@ -32,8 +32,7 @@ def load_variables():
global base_url
token = os.environ["PYCONFLUENCE_TOKEN"]
user = os.environ["PYCONFLUENCE_USER"]
base_url = ("https://" + os.environ["PYCONFLUENCE_ORG"] + ".atlassian"
".net/wiki/rest/api/content")
base_url = (os.environ["BASE_URL"] + "/rest/api/content")


def rest(url, req="GET", data=None):
Expand Down