{% extends "base.html" %} {% set active_page = 'account' %} {% block title %}Home{% endblock %} {% block nav_content %} {% endblock %} {% set account = current_user.account %} {% block content %}

API Token

{% if token_raw %}
Token for "{{ new_token.name }}"
{{ token_raw }}
For security reasons this token will only appear once. Copy it now.
How to use this token:
{# Pip #}
Configure PIP:

To install packages prom this index, you will have to configure an extra index url for pip.

pip config set global.extra-index-url {{ url_for('simple.simple_index', _external=True).split("//")[0] }}//__token__:{{ token_raw }}@{{ url_for('simple.simple_index', _external=True).split("//")[1] }}
{# Poetry #}
Configure Poetry:

If use Poetry to upload your projects, use the following commands to configure:

poetry config repositories.warehouse14 {{ url_for('simple.simple_index', _external=True) }}
poetry config http-basic.warehouse14 __token__ "{{ token_raw }}"

Publish your projects with: poetry publish -r warehouse14

{# Twine #}
Configure Twine:

For example, if you use Twine to upload your projects, set up your $HOME/.pypirc file like this:

[distutils]
  index-servers =
    pypi
    warehouse14

[warehouse14]
  repository = {{ url_for('simple.simple_index', _external=True) }}
  username = __token__
  password = {{ token_raw }}

            

Now use twine --repository warehouse14 to upload your package.

{% else %}
{{ create_form.hidden_tag() }}
Create an API token
{{ create_form.name(size=20) }} {{ create_form.name.label }}
{% endif %}
{% endblock %}