Create store app and add some templates
This commit is contained in:
parent
583f06ea42
commit
993e9b16a5
@ -37,6 +37,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'store',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
@ -14,8 +14,10 @@ Including another URLconf
|
|||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path
|
from django.urls import path, include
|
||||||
|
import store
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
|
path('store/', include('store.urls'))
|
||||||
]
|
]
|
||||||
|
0
PDMI/db.sqlite3
Normal file
0
PDMI/db.sqlite3
Normal file
0
PDMI/store/__init__.py
Normal file
0
PDMI/store/__init__.py
Normal file
3
PDMI/store/admin.py
Normal file
3
PDMI/store/admin.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
5
PDMI/store/apps.py
Normal file
5
PDMI/store/apps.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class StoreConfig(AppConfig):
|
||||||
|
name = 'store'
|
0
PDMI/store/migrations/__init__.py
Normal file
0
PDMI/store/migrations/__init__.py
Normal file
3
PDMI/store/models.py
Normal file
3
PDMI/store/models.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
21
PDMI/store/templates/base/base.html
Normal file
21
PDMI/store/templates/base/base.html
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{% load static %}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<title>{% block title %}PDMI - Python Discord Module Index{% endblock %}</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="PDMI - Python Discord Module Index">
|
||||||
|
<meta name="author" content="Louis Chauvet">
|
||||||
|
<!-- Favicon.ico -->
|
||||||
|
<link rel="shortcut icon" href="{% static 'favicon.ico' %}">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{% include "base/navbar.html" %}
|
||||||
|
{% block body %}
|
||||||
|
{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
31
PDMI/store/templates/base/navbar.html
Normal file
31
PDMI/store/templates/base/navbar.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
||||||
|
<a class="navbar-brand" href="#">P.D.M.I</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
|
||||||
|
<ul class="navbar-nav mr-auto">
|
||||||
|
<li class="nav-item active">
|
||||||
|
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Documentation</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Download</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="dropdown01">
|
||||||
|
<a class="dropdown-item" href="#">Download bot</a>
|
||||||
|
<a class="dropdown-item" href="#">Download server</a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#">Gestion des modules</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<form class="form-inline my-2 my-lg-0">
|
||||||
|
<input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
|
||||||
|
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</nav>
|
87
PDMI/store/templates/index.html
Normal file
87
PDMI/store/templates/index.html
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
{% extends 'base/base.html' %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
|
||||||
|
|
||||||
|
<main role="main">
|
||||||
|
|
||||||
|
<!-- Main jumbotron for a primary marketing message or call to action -->
|
||||||
|
<div class="jumbotron">
|
||||||
|
<div class="container">
|
||||||
|
<h1 class="display-3">PDMI - Python Discord Module Index</h1>
|
||||||
|
<p>
|
||||||
|
PDMI is a part of PDBA project. PDBA is a basic discord bot which integrate possibility to install
|
||||||
|
modules.
|
||||||
|
PDMI is the website where most of modules are uploaded. If you want to create your own module you can
|
||||||
|
check
|
||||||
|
<a href="#">documentation</a>. You can also create your own
|
||||||
|
<a href="#">repository</a>.
|
||||||
|
</p>
|
||||||
|
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more
|
||||||
|
»</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<!-- Example row of columns -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<h2>Heading</h2>
|
||||||
|
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor
|
||||||
|
mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna
|
||||||
|
mollis euismod. Donec sed odio dui. </p>
|
||||||
|
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<h2>Heading</h2>
|
||||||
|
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor
|
||||||
|
mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna
|
||||||
|
mollis euismod. Donec sed odio dui. </p>
|
||||||
|
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<h2>Heading</h2>
|
||||||
|
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula
|
||||||
|
porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh,
|
||||||
|
ut fermentum massa justo sit amet risus.</p>
|
||||||
|
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
{% for i in '123'|make_list %}
|
||||||
|
<div class="col-md">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Card title</h5>
|
||||||
|
<h6 class="card-subtitle mb-2 text-muted">Card subtitle - Description</h6>
|
||||||
|
<p class="card-text">Donec id elit non mi porta gravida at eget metus. Fusce dapibus,
|
||||||
|
tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo
|
||||||
|
sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.
|
||||||
|
</p>
|
||||||
|
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
</div> <!-- /container -->
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="container">
|
||||||
|
<p>© Louis Chauvet 2019</p>
|
||||||
|
</footer>
|
||||||
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
|
||||||
|
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
|
||||||
|
crossorigin="anonymous"></script>
|
||||||
|
<script>window.jQuery || document.write('<script src="/docs/4.3/assets/js/vendor/jquery-slim.min.js"><\/script>')
|
||||||
|
</script>
|
||||||
|
<script src="/docs/4.3/dist/js/bootstrap.bundle.min.js"
|
||||||
|
integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o"
|
||||||
|
crossorigin="anonymous"></script>
|
||||||
|
{% endblock %}
|
3
PDMI/store/tests.py
Normal file
3
PDMI/store/tests.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
22
PDMI/store/urls.py
Normal file
22
PDMI/store/urls.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
"""PDMI URL Configuration
|
||||||
|
|
||||||
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||||
|
https://docs.djangoproject.com/en/3.0/topics/http/urls/
|
||||||
|
Examples:
|
||||||
|
Function views
|
||||||
|
1. Add an import: from my_app import views
|
||||||
|
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||||
|
Class-based views
|
||||||
|
1. Add an import: from other_app.views import Home
|
||||||
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||||
|
Including another URLconf
|
||||||
|
1. Import the include() function: from django.urls import include, path
|
||||||
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
|
"""
|
||||||
|
from django.urls import path
|
||||||
|
import store.views
|
||||||
|
import store
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
path('index/', store.views.index),
|
||||||
|
]
|
5
PDMI/store/views.py
Normal file
5
PDMI/store/views.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
||||||
|
def index(request):
|
||||||
|
return render(request, 'index.html')
|
Loading…
Reference in New Issue
Block a user