template proje hazır.
template proje hazır.
This commit is contained in:
@@ -16,8 +16,26 @@ Bu depo, yeni Django projelerine standart, hızlı ve temiz bir şekilde başlam
|
|||||||
|
|
||||||
## 📦 Kullanım
|
## 📦 Kullanım
|
||||||
|
|
||||||
Yepyeni bir projeye başlamak için terminalinizi açın, sanal ortamınızı aktif edin ve aşağıdaki komutu çalıştırın:
|
Yepyeni bir projeye başlamak için terminalinizi açın, sanal ortamınızı aktif edin ve aşağıdaki komutlardan birini çalıştırın:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Gitea üzerinden doğrudan proje oluşturmak için:
|
# Gitea üzerinden doğrudan proje oluşturmak için:
|
||||||
django-admin startproject --template=[https://gitea.ta1sph.info/suphicakir/django-template/archive/main.zip](https://gitea.ta1sph.info/suphicakir/django-template/archive/main.zip) --extension py,html proje_adi
|
django-admin startproject --template=https://gitea.ta1sph.info/suphicakir/django-template/archive/main.zip --extension py,html proje_adi
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Yerel diskteki bu depodan proje oluşturmak için:
|
||||||
|
django-admin startproject --template=/path/to/djtemplate --extension py,html proje_adi
|
||||||
|
```
|
||||||
|
|
||||||
|
Komut tamamlandığında `proje_adi/` dizini oluşur; `project_name` olarak adlandırılmış paket dizini ve içindeki tüm `.py`/`.html` dosyaları otomatik olarak `proje_adi` ile değiştirilir. `SECRET_KEY` de otomatik olarak yeni ve rastgele bir değerle doldurulur.
|
||||||
|
|
||||||
|
Ardından:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd proje_adi
|
||||||
|
python -m venv venv && source venv/bin/activate
|
||||||
|
pip install django
|
||||||
|
python manage.py migrate
|
||||||
|
python manage.py runserver
|
||||||
|
```
|
||||||
@@ -1,49 +1,48 @@
|
|||||||
{% extends 'BaseLayout.html' %}
|
{% templatetag openblock %} extends 'BaseLayout.html' {% templatetag closeblock %}
|
||||||
{% load static %}
|
{% templatetag openblock %} block title {% templatetag closeblock %}{{ project_name }} Django Template{% templatetag openblock %} endblock {% templatetag closeblock %}
|
||||||
{% block title %}{{ project_name }} Django Template{% endblock %}
|
{% templatetag openblock %} block content {% templatetag closeblock %}
|
||||||
{% block content %}
|
<!-- Ana İçerik (Hero Section) -->
|
||||||
<!-- Ana İçerik (Hero Section) -->
|
<main class="flex-shrink-0">
|
||||||
<main class="flex-shrink-0">
|
<div class="container mt-5">
|
||||||
<div class="container mt-5">
|
<div class="p-5 text-center bg-white rounded-3 shadow-sm border">
|
||||||
<div class="p-5 text-center bg-white rounded-3 shadow-sm border">
|
<h1 class="text-primary fw-bold">Hoş Geldiniz!</h1>
|
||||||
<h1 class="text-primary fw-bold">Hoş Geldiniz!</h1>
|
<p class="lead mt-3 text-muted">
|
||||||
<p class="lead mt-3 text-muted">
|
<strong>{{ project_name }}</strong> projesi, özel Django şablonunuz kullanılarak başarıyla oluşturuldu. Dahili <strong>jcore</strong> uygulaması çalışmaya hazır.
|
||||||
<strong>{{ project_name }}</strong> projesi, özel Django şablonunuz kullanılarak başarıyla oluşturuldu. Dahili <strong>jcore</strong> uygulaması çalışmaya hazır.
|
</p>
|
||||||
</p>
|
<hr class="my-4">
|
||||||
<hr class="my-4">
|
<p>Şu anda Bootstrap 5 ile şekillendirilmiş varsayılan şablonu görüyorsunuz.</p>
|
||||||
<p>Şu anda Bootstrap 5 ile şekillendirilmiş varsayılan şablonu görüyorsunuz.</p>
|
<div class="d-flex justify-content-center gap-3 mt-4">
|
||||||
<div class="d-flex justify-content-center gap-3 mt-4">
|
<a href="/admin" class="btn btn-primary btn-lg">Admin Paneline Git</a>
|
||||||
<a href="/admin" class="btn btn-primary btn-lg">Admin Paneline Git</a>
|
<a href="#" class="btn btn-outline-secondary btn-lg">Dokümantasyon</a>
|
||||||
<a href="#" class="btn btn-outline-secondary btn-lg">Dokümantasyon</a>
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Özellikler Kartları (Grid Sistemi Örneği) -->
|
||||||
|
<div class="row mt-5 text-center">
|
||||||
|
<div class="col-md-4 mb-4">
|
||||||
|
<div class="card h-100 shadow-sm border-0">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title text-dark">🚀 Hızlı Başlangıç</h5>
|
||||||
|
<p class="card-text text-muted">Projeniz temel ayarlar ve jcore uygulaması ile birlikte anında kodlamaya hazır.</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Özellikler Kartları (Grid Sistemi Örneği) -->
|
<div class="col-md-4 mb-4">
|
||||||
<div class="row mt-5 text-center">
|
<div class="card h-100 shadow-sm border-0">
|
||||||
<div class="col-md-4 mb-4">
|
<div class="card-body">
|
||||||
<div class="card h-100 shadow-sm border-0">
|
<h5 class="card-title text-dark">🎨 Modern Tasarım</h5>
|
||||||
<div class="card-body">
|
<p class="card-text text-muted">Bootstrap 5 entegrasyonu sayesinde mobil uyumlu ve şık bir arayüz.</p>
|
||||||
<h5 class="card-title text-dark">🚀 Hızlı Başlangıç</h5>
|
|
||||||
<p class="card-text text-muted">Projeniz temel ayarlar ve jcore uygulaması ile birlikte anında kodlamaya hazır.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 mb-4">
|
</div>
|
||||||
<div class="card h-100 shadow-sm border-0">
|
<div class="col-md-4 mb-4">
|
||||||
<div class="card-body">
|
<div class="card h-100 shadow-sm border-0">
|
||||||
<h5 class="card-title text-dark">🎨 Modern Tasarım</h5>
|
<div class="card-body">
|
||||||
<p class="card-text text-muted">Bootstrap 5 entegrasyonu sayesinde mobil uyumlu ve şık bir arayüz.</p>
|
<h5 class="card-title text-dark">⚙️ Özelleştirilmiş</h5>
|
||||||
</div>
|
<p class="card-text text-muted">Views, urls ve settings dosyaları sizin belirlediğiniz standartlara göre yapılandırıldı.</p>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4 mb-4">
|
|
||||||
<div class="card h-100 shadow-sm border-0">
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title text-dark">⚙️ Özelleştirilmiş</h5>
|
|
||||||
<p class="card-text text-muted">Views, urls ve settings dosyaları sizin belirlediğiniz standartlara göre yapılandırıldı.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</div>
|
||||||
{% endblock %}
|
</main>
|
||||||
|
{% templatetag openblock %} endblock {% templatetag closeblock %}
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
"""Django's command-line utility for administrative tasks."""
|
"""Django's command-line utility for administrative tasks."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Run administrative tasks."""
|
"""Run administrative tasks."""
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djtemplate.settings')
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
|
||||||
try:
|
try:
|
||||||
from django.core.management import execute_from_command_line
|
from django.core.management import execute_from_command_line
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
@@ -18,5 +19,5 @@ def main():
|
|||||||
execute_from_command_line(sys.argv)
|
execute_from_command_line(sys.argv)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
ASGI config for djtemplate project.
|
ASGI config for {{ project_name }} project.
|
||||||
|
|
||||||
It exposes the ASGI callable as a module-level variable named ``application``.
|
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||||
|
|
||||||
@@ -11,6 +11,6 @@ import os
|
|||||||
|
|
||||||
from django.core.asgi import get_asgi_application
|
from django.core.asgi import get_asgi_application
|
||||||
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djtemplate.settings')
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
|
||||||
|
|
||||||
application = get_asgi_application()
|
application = get_asgi_application()
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Django settings for djtemplate project.
|
Django settings for {{ project_name }} project.
|
||||||
|
|
||||||
Generated by 'django-admin startproject' using Django 6.1.
|
Generated by 'django-admin startproject' using Django 6.1.
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||||||
# See https://docs.djangoproject.com/en/6.1/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/6.1/howto/deployment/checklist/
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = "django-insecure-_3$kss#j69u95_#phki3x1+s^tf(1d1-59u-=bp&tovlyuuk2j"
|
SECRET_KEY = "{{ secret_key }}"
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
@@ -50,7 +50,7 @@ MIDDLEWARE = [
|
|||||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||||
]
|
]
|
||||||
|
|
||||||
ROOT_URLCONF = "djtemplate.urls"
|
ROOT_URLCONF = "{{ project_name }}.urls"
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
@@ -67,7 +67,7 @@ TEMPLATES = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
WSGI_APPLICATION = "djtemplate.wsgi.application"
|
WSGI_APPLICATION = "{{ project_name }}.wsgi.application"
|
||||||
|
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
URL configuration for djtemplate project.
|
URL configuration for {{ project_name }} project.
|
||||||
|
|
||||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||||
https://docs.djangoproject.com/en/6.1/topics/http/urls/
|
https://docs.djangoproject.com/en/6.1/topics/http/urls/
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
WSGI config for djtemplate project.
|
WSGI config for {{ project_name }} project.
|
||||||
|
|
||||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||||
|
|
||||||
@@ -11,6 +11,6 @@ import os
|
|||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
from django.core.wsgi import get_wsgi_application
|
||||||
|
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djtemplate.settings')
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
|
||||||
|
|
||||||
application = get_wsgi_application()
|
application = get_wsgi_application()
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
{% load static %}
|
{% templatetag openblock %} load static {% templatetag closeblock %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="tr">
|
<html lang="tr">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<!-- Django değişkeni: Proje adını sekme başlığı yapar -->
|
<!-- Django değişkeni: Proje adını sekme başlığı yapar -->
|
||||||
<title>{% block title %}{{ project_name }}{% endblock %}</title>
|
<title>{% templatetag openblock %} block title {% templatetag closeblock %}{{ project_name }}{% templatetag openblock %} endblock {% templatetag closeblock %}</title>
|
||||||
<!-- Bootstrap 5 CSS (CDN) -->
|
<!-- Bootstrap 5 CSS (CDN) -->
|
||||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
<link href="{% templatetag openblock %} static 'css/bootstrap.min.css' {% templatetag closeblock %}"
|
||||||
|
rel="stylesheet">
|
||||||
<!-- İsteğe bağlı kendi CSS dosyan için hazırlık -->
|
<!-- İsteğe bağlı kendi CSS dosyan için hazırlık -->
|
||||||
<!-- <link rel="stylesheet" href="{% static 'css/style.css' %}"> -->
|
<!-- <link rel="stylesheet" href="{% templatetag openblock %} static 'css/style.css' {% templatetag closeblock %}"> -->
|
||||||
</head>
|
</head>
|
||||||
<body class="d-flex flex-column min-vh-100 bg-light">
|
<body class="d-flex flex-column min-vh-100 bg-light">
|
||||||
<!-- Üst Navigasyon Çubuğu (Navbar) -->
|
<!-- Üst Navigasyon Çubuğu (Navbar) -->
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{% block content %}{% endblock %}
|
{% templatetag openblock %} block content {% templatetag closeblock %}{% templatetag openblock %} endblock {% templatetag closeblock %}
|
||||||
<!-- Alt Kısım (Footer) -->
|
<!-- Alt Kısım (Footer) -->
|
||||||
<footer class="footer mt-auto py-3 bg-white border-top">
|
<footer class="footer mt-auto py-3 bg-white border-top">
|
||||||
<div class="container text-center">
|
<div class="container text-center">
|
||||||
@@ -50,8 +51,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
<!-- Bootstrap 5 JS (CDN) -->
|
<!-- Bootstrap 5 JS (CDN) -->
|
||||||
<script src="{% static 'js/bootstrap.bundle.min.js' %}"></script>
|
<script src="{% templatetag openblock %} static 'js/bootstrap.bundle.min.js' {% templatetag closeblock %}"></script>
|
||||||
<!-- İsteğe bağlı kendi JS dosyan için hazırlık -->
|
<!-- İsteğe bağlı kendi JS dosyan için hazırlık -->
|
||||||
<!-- <script src="{% static 'js/main.js' %}"></script> -->
|
<!-- <script src="{% templatetag openblock %} static 'js/main.js' {% templatetag closeblock %}"></script> -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user