Elinde lisans oluşturma scripti olan var mı ? Yardımcı olabilecek birileri ?
Follow along with the video below to see how to install our site as a web app on your home screen.
Not: This feature may not be available in some browsers.
import json
import random
from flask import Flask #Biliyorum, bloated
app = Flask(__name__)
with open('licenses.json') as f:
licenses = json.load(f)
[USER=437476]app[/USER].route('/new')
def new():
key = '-'.join(''.join(random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") for _ in range(4)) for _ in range(4))
licenses.update({key: False})
with open('licenses.json', 'w') as f:
json.dump(licenses, f)
return key
[USER=437476]app[/USER].route('/use/<key>')
def use(key):
if key in licenses:
if licenses[key]:
return 'Licnese used!'
else:
licenses[key] = True
with open('licenses.json', 'w') as f:
json.dump(licenses, f)
return 'Done!'
else:
return 'License does not exist!'