Fakultas Ilmu Komputer UI

Commit 5cb5e098 authored by Fredy Pasaud's avatar Fredy Pasaud
Browse files

Initial commit

parents
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
}
\ No newline at end of file
File added
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'oauthservice.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
"""
Registering models to django admin
"""
from django.contrib import admin
from .models import Client,Mahasiswa,Token
# Register your models here.
admin.site.register(Client)
admin.site.register(Mahasiswa)
admin.site.register(Token)
from django.apps import AppConfig
class OauthConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'oauth'
# Generated by Django 4.0.3 on 2022-03-09 17:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Client',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('client_id', models.CharField(max_length=20)),
('client_secret', models.CharField(max_length=20)),
('client_url', models.CharField(max_length=50)),
],
),
migrations.CreateModel(
name='Mahasiswa',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('username', models.CharField(max_length=25)),
('password', models.CharField(max_length=100)),
('name', models.CharField(max_length=100)),
('npm', models.CharField(max_length=10)),
('client', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='oauth.client')),
],
),
migrations.CreateModel(
name='Token',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('access_token', models.CharField(max_length=40)),
('refresh', models.CharField(max_length=40)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='oauth.mahasiswa')),
],
),
]
# Generated by Django 4.0.3 on 2022-03-09 17:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('oauth', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='client',
name='client_url',
),
]
# Generated by Django 4.0.3 on 2022-03-09 17:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('oauth', '0002_remove_client_client_url'),
]
operations = [
migrations.AlterField(
model_name='mahasiswa',
name='client',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oauth.client'),
),
migrations.AlterField(
model_name='token',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='oauth.mahasiswa'),
),
]
# Generated by Django 4.0.3 on 2022-03-09 18:01
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('oauth', '0003_alter_mahasiswa_client_alter_token_user'),
]
operations = [
migrations.AddField(
model_name='token',
name='expire',
field=models.DateTimeField(default=django.utils.timezone.now),
preserve_default=False,
),
]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment