Basic game creating API (#2)

* Adding the base of our API

* Little file and lint adjustments

* Adding the lint command to Makefile

* Adding the Minesweeper logic for game creation

* Adding some tests for the Minesweeper algorithm

* Adding some tools command to Makefile like pre-commit and pip-tools

* Adding test help text to Makefile

* all new user is_staff=True, for development for now

* Now we can get the data from specific game

Adding game status

Adding game status

Fixing game models
This commit is contained in:
2020-11-05 23:29:35 -03:00
committed by GitHub
parent 55ae104806
commit 733f3e5992
35 changed files with 690 additions and 67 deletions

View File

@@ -16,6 +16,7 @@ ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "127.0.0.1,localhost").split(",")
# Application definition
INSTALLED_APPS = [
"rest_framework",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
@@ -23,6 +24,8 @@ INSTALLED_APPS = [
"django.contrib.messages",
"django.contrib.staticfiles",
"core",
"api",
"game",
]
MIDDLEWARE = [
@@ -68,9 +71,7 @@ DATABASES = {
"PASSWORD": os.getenv("DB_PASS"),
"HOST": os.getenv("DB_HOST"),
"PORT": os.getenv("DB_PORT"),
"OPTIONS": {
"charset": "utf8mb4",
},
"OPTIONS": {"charset": "utf8mb4"},
}
}
@@ -80,17 +81,11 @@ DATABASES = {
AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
},
{
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
},
{
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"
},
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
]
@@ -112,3 +107,12 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.1/howto/static-files/
STATIC_URL = "/static/"
# Some Django Rest Framework parameters
REST_FRAMEWORK = {
"DEFAULT_PERMISSION_CLASSES": ["rest_framework.permissions.AllowAny"],
"DEFAULT_AUTHENTICATION_CLASSES": [
"rest_framework.authentication.TokenAuthentication"
],
"DEFAULT_RENDERER_CLASSES": ("rest_framework.renderers.JSONRenderer",),
}