-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from OusmaneKK/22-ops-make-docker-compose
feat: adding docker compose and dockerfile
- Loading branch information
Showing
774 changed files
with
269,878 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Django project directories | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# Virtual environment directories | ||
venv/ | ||
env/ | ||
*.env | ||
|
||
# Development database | ||
db.sqlite3 | ||
|
||
# Logs | ||
*.log | ||
|
||
# Generated media and static files | ||
media/ | ||
staticfiles/ | ||
|
||
# IDE specific files | ||
.vscode/ | ||
*.idea/ | ||
|
||
# Compiled Python files | ||
*.pyc | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Local development settings | ||
*.local_settings.py | ||
|
||
# Compiled translation files | ||
locale/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Utilisez une image Python | ||
FROM python:3.8 | ||
|
||
# Créez un répertoire de travail | ||
WORKDIR /app | ||
|
||
# Copiez le fichier requirements.txt dans l'image | ||
COPY requirements.txt /app/ | ||
|
||
# Installez les dépendances | ||
RUN pip install -r requirements.txt | ||
|
||
# Copiez votre application dans l'image | ||
COPY . /app/ | ||
|
||
# Commande par défaut à exécuter lorsque le conteneur démarre | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class MainConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'main' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 4.2.3 on 2023-08-28 14:39 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Music', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=100)), | ||
('description', models.TextField()), | ||
('is_liked', models.BooleanField(default=False)), | ||
('like_count', models.PositiveIntegerField(default=0)), | ||
('image', models.ImageField(upload_to='music_images/')), | ||
('audio_file', models.FileField(upload_to='music_audio/')), | ||
], | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
class Music(models.Model): | ||
title = models.CharField(max_length=100) | ||
description = models.TextField() | ||
is_liked = models.BooleanField(default=False) | ||
like_count = models.PositiveIntegerField(default=0) | ||
image = models.ImageField(upload_to='music_images/') | ||
audio_file = models.FileField(upload_to='music_audio/') | ||
|
||
def __str__(self): | ||
return self.title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django.shortcuts import render, redirect | ||
from django.contrib.auth import authenticate, login, logout | ||
from django.http import JsonResponse | ||
|
||
# Create your views here. | ||
|
||
def register_view(request): | ||
if request.method == 'POST': | ||
return redirect('login') | ||
return render(request, 'registration/register.html') | ||
|
||
def login_view(request): | ||
if request.method =='POST': | ||
username = request.POST['username'] | ||
password = request.POST['password'] | ||
user = authenticate(request, username=username, password=password) | ||
if user is not None: | ||
login(request, user) | ||
return redirect('home') | ||
else: | ||
pass | ||
return render(request, 'registration/login.html') | ||
|
||
def logout_view(request): | ||
logout(request) | ||
return redirect('login') | ||
|
||
def check_authentication(request): | ||
is_logged = request.user.is_authenticated | ||
return JsonResponse({'isLogged': is_logged}) |
Oops, something went wrong.