{% 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.
Using this token

To use this API token:

If you are using Poetry to publish 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 }}"

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

[distutils]
  index-servers =
    pypi
    warehouse14
    PROJECT_NAME

[warehouse14]
  username = __token__
  password = # either a user-scoped token or a project-scoped token you want to set as the default

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

You can then use twine --repository PROJECT_NAME to switch to the correct token when uploading to PyPI.

For further instructions on how to use this token, visit the PyPI help page.

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