Thank you very much @joshm
After challenging this for a while I found that in addition to CUSTOM_CERTIFICATE_TEMPLATES_ENABLED I have to activate ORGANIZATIONS_APP and define an organization and assign it to my course from django admin.
After all I can put any html or mako template code in template
field of my theme. also it is possible to copy and paste the content of lms/templates/certificates/valid.html
there and it works.
putting the following line:
<div>${accomplishment_copy_username}</div>
in that field changes the certificate to an empty page which only contains the user’s username.
again thank you for your answer