Create base django app structure
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -11,3 +11,6 @@ __pycache__/
|
|||||||
|
|
||||||
# Django Database
|
# Django Database
|
||||||
db.sqlite3
|
db.sqlite3
|
||||||
|
|
||||||
|
# Django Static Files
|
||||||
|
.stat/
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
from django.db import models
|
|
||||||
|
|
||||||
# Create your models here.
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{% extends "master.html" %}
|
||||||
|
{% load static %}
|
||||||
|
|
||||||
|
{% block title %}Urban Brothers - Home{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>Urban Brothers</h1>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
"""ub URL Configuration
|
||||||
|
"""
|
||||||
|
from django.urls import path
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('', views.home, name='home')
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
|
||||||
# Create your views here.
|
|
||||||
|
def home(request):
|
||||||
|
return render(request, 'home/index.html')
|
||||||
|
|||||||
0
src/shared/ressources/css/master.css
Normal file
0
src/shared/ressources/css/master.css
Normal file
44
src/shared/templates/master.html
Normal file
44
src/shared/templates/master.html
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{% load static %}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<!-- Title of the HTML page -->
|
||||||
|
<title>{% block title %}{% endblock %}</title>
|
||||||
|
<!-- Viewport for a pleasant mobile experience -->
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<!-- Charset for compatability and stability -->
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<!-- Description for right SE indexing -->
|
||||||
|
<meta name="Description" content="Homepage of the Urban Brothers.">
|
||||||
|
<!-- SE indexing -->
|
||||||
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
|
<!-- Icons for Materialize CSS -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/icon?family=Material+Icons&display=swap">
|
||||||
|
<!-- Load the default master.css for some values -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="{% static 'css/master.css' %}">
|
||||||
|
<!-- Add the favicon to the page -->
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" href="{% static 'pic/urban.ico' %}">
|
||||||
|
<!-- Compiled and minified CSS for Materialize CSS -->
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
|
||||||
|
<!-- JQuery for easier HTML manipulation -->
|
||||||
|
<script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||||
|
<!-- Compiled and minified JavaScript for Materialize CSS -->
|
||||||
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
|
||||||
|
<!-- For custom header elements -->
|
||||||
|
{% block header %}{% endblock %}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% block scripts_below %}{% endblock %}
|
||||||
|
|
||||||
|
{% if toast %}
|
||||||
|
<script type="text/javascript">M.toast({html: '{{ toast }}', classes: 'rounded'});</script>
|
||||||
|
{% endif %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
5
src/steam_tools/apps.py
Normal file
5
src/steam_tools/apps.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class SteamToolsConfig(AppConfig):
|
||||||
|
name = 'steam_tools'
|
||||||
6
src/steam_tools/urls.py
Normal file
6
src/steam_tools/urls.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.urls import path
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('swf', views.steam_with_friends, name='steam_with_friends')
|
||||||
|
]
|
||||||
6
src/steam_tools/views.py
Normal file
6
src/steam_tools/views.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
|
||||||
|
def steam_with_friends(request):
|
||||||
|
context = {}
|
||||||
|
return render(request, 'steam_tools/swf.html', context)
|
||||||
@@ -24,6 +24,7 @@ ALLOWED_HOSTS = []
|
|||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
'home',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
@@ -47,7 +48,9 @@ ROOT_URLCONF = 'ub.urls'
|
|||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': [],
|
'DIRS': [
|
||||||
|
BASE_DIR / 'shared/templates'
|
||||||
|
],
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
'context_processors': [
|
'context_processors': [
|
||||||
@@ -104,9 +107,17 @@ USE_TZ = True
|
|||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/3.1/howto/static-files/
|
# https://docs.djangoproject.com/en/3.1/howto/static-files/
|
||||||
|
STATIC_ROOT = os.path.join(BASE_DIR, 'stat/')
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
|
STATICFILES_DIRS = [
|
||||||
|
os.path.join(BASE_DIR, 'shared/ressources')
|
||||||
|
]
|
||||||
|
|
||||||
# Media paths for serving uploaded files
|
# Media paths for serving uploaded files
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
LOGIN_URL = '/login'
|
LOGIN_URL = '/login'
|
||||||
|
|
||||||
|
# Maximum File Size for File Uploads
|
||||||
|
FILE_UPLOAD_MAX_MEMORY_SIZE = 104857600
|
||||||
|
DATA_UPLOAD_MAX_MEMORY_SIZE = 104857600
|
||||||
|
|||||||
Reference in New Issue
Block a user