use database (it's useless but it works)
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
class TaMereLaPute(models.Model):
|
class TaMereLaPute(models.Model):
|
||||||
test=models.CharField(max_length=200)
|
id = models.AutoField(primary_key=True)
|
||||||
|
test = models.CharField(max_length=200)
|
||||||
|
@ -23,7 +23,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||||||
SECRET_KEY = 'django-insecure-vgcqdf^%(+@t*+cof@755e#q9p)myir%z2s*e*ea*v^i(4pta9'
|
SECRET_KEY = 'django-insecure-vgcqdf^%(+@t*+cof@755e#q9p)myir%z2s*e*ea*v^i(4pta9'
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = False
|
DEBUG = True
|
||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
@ -31,12 +31,12 @@ ALLOWED_HOSTS = ['*']
|
|||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'django.contrib.admin',
|
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'server',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
@ -18,5 +18,6 @@ from django.urls import path
|
|||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("",views.index, name='patate')
|
path("",views.index, name='patate'),
|
||||||
|
path("set",views.set, name='patate douce')
|
||||||
]
|
]
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
from .models import TaMereLaPute
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
return HttpResponse("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br>ca marche enfin")
|
try:
|
||||||
|
a = TaMereLaPute.objects.get(id=1)
|
||||||
|
return HttpResponse(a.test)
|
||||||
|
except TaMereLaPute.DoesNotExist:
|
||||||
|
return HttpResponse("does not exist")
|
||||||
|
|
||||||
|
def set(request):
|
||||||
|
a = TaMereLaPute(test="coucou les musulmans moi je mange la glace")
|
||||||
|
a.save()
|
||||||
|
return HttpResponse("done")
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
until pg_isready -h "$DB_HOST"; do sleep 0.5 ;echo "waiting for database";done
|
until pg_isready -h "$DB_HOST"; do sleep 0.5 ;echo "waiting for database";done
|
||||||
cd /var/www/djangoserver/server
|
cd /var/www/djangoserver/server
|
||||||
python3 manage.py makemigrations
|
python3 manage.py makemigrations server
|
||||||
python3 manage.py migrate
|
python3 manage.py migrate
|
||||||
python3 manage.py runserver 0.0.0.0:8000
|
python3 manage.py runserver 0.0.0.0:8000
|
||||||
|
Reference in New Issue
Block a user