diff --git a/README.md b/README.md index f147ad8..44fe6d0 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,26 @@ Bu depo, yeni Django projelerine standart, hızlı ve temiz bir şekilde başlam ## 📦 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 # 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 \ No newline at end of file +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 +``` \ No newline at end of file diff --git a/jcore/templates/jcore/index.html b/jcore/templates/jcore/index.html index 1854ab3..28cf448 100644 --- a/jcore/templates/jcore/index.html +++ b/jcore/templates/jcore/index.html @@ -1,49 +1,48 @@ -{% extends 'BaseLayout.html' %} -{% load static %} -{% block title %}{{ project_name }} Django Template{% endblock %} -{% block content %} - -
-
-
-

Hoş Geldiniz!

-

- {{ project_name }} projesi, özel Django şablonunuz kullanılarak başarıyla oluşturuldu. Dahili jcore uygulaması çalışmaya hazır. -

-
-

Şu anda Bootstrap 5 ile şekillendirilmiş varsayılan şablonu görüyorsunuz.

-
- Admin Paneline Git - Dokümantasyon +{% templatetag openblock %} extends 'BaseLayout.html' {% templatetag closeblock %} +{% templatetag openblock %} block title {% templatetag closeblock %}{{ project_name }} Django Template{% templatetag openblock %} endblock {% templatetag closeblock %} +{% templatetag openblock %} block content {% templatetag closeblock %} + +
+
+
+

Hoş Geldiniz!

+

+ {{ project_name }} projesi, özel Django şablonunuz kullanılarak başarıyla oluşturuldu. Dahili jcore uygulaması çalışmaya hazır. +

+
+

Şu anda Bootstrap 5 ile şekillendirilmiş varsayılan şablonu görüyorsunuz.

+ +
+ +
+
+
+
+
🚀 Hızlı Başlangıç
+

Projeniz temel ayarlar ve jcore uygulaması ile birlikte anında kodlamaya hazır.

+
- -
-
-
-
-
🚀 Hızlı Başlangıç
-

Projeniz temel ayarlar ve jcore uygulaması ile birlikte anında kodlamaya hazır.

-
+
+
+
+
🎨 Modern Tasarım
+

Bootstrap 5 entegrasyonu sayesinde mobil uyumlu ve şık bir arayüz.

-
-
-
-
🎨 Modern Tasarım
-

Bootstrap 5 entegrasyonu sayesinde mobil uyumlu ve şık bir arayüz.

-
-
-
-
-
-
-
⚙️ Özelleştirilmiş
-

Views, urls ve settings dosyaları sizin belirlediğiniz standartlara göre yapılandırıldı.

-
+
+
+
+
+
⚙️ Özelleştirilmiş
+

Views, urls ve settings dosyaları sizin belirlediğiniz standartlara göre yapılandırıldı.

-
-{% endblock %} +
+
+{% templatetag openblock %} endblock {% templatetag closeblock %} diff --git a/manage.py b/manage.py index 857f321..7f03c4e 100755 --- a/manage.py +++ b/manage.py @@ -1,12 +1,13 @@ #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" + import os import sys def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djtemplate.settings') + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: @@ -18,5 +19,5 @@ def main(): execute_from_command_line(sys.argv) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/djtemplate/__init__.py b/project_name/__init__.py similarity index 100% rename from djtemplate/__init__.py rename to project_name/__init__.py diff --git a/djtemplate/asgi.py b/project_name/asgi.py similarity index 70% rename from djtemplate/asgi.py rename to project_name/asgi.py index 9e0d98c..8e5b322 100644 --- a/djtemplate/asgi.py +++ b/project_name/asgi.py @@ -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``. @@ -11,6 +11,6 @@ import os 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() diff --git a/djtemplate/settings.py b/project_name/settings.py similarity index 93% rename from djtemplate/settings.py rename to project_name/settings.py index 1c9fae3..a14d772 100644 --- a/djtemplate/settings.py +++ b/project_name/settings.py @@ -1,5 +1,5 @@ """ -Django settings for djtemplate project. +Django settings for {{ project_name }} project. 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/ # 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! DEBUG = True @@ -50,7 +50,7 @@ MIDDLEWARE = [ "django.middleware.clickjacking.XFrameOptionsMiddleware", ] -ROOT_URLCONF = "djtemplate.urls" +ROOT_URLCONF = "{{ project_name }}.urls" TEMPLATES = [ { @@ -67,7 +67,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = "djtemplate.wsgi.application" +WSGI_APPLICATION = "{{ project_name }}.wsgi.application" # Database diff --git a/djtemplate/urls.py b/project_name/urls.py similarity index 93% rename from djtemplate/urls.py rename to project_name/urls.py index 6c9df8b..d3e8d36 100644 --- a/djtemplate/urls.py +++ b/project_name/urls.py @@ -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: https://docs.djangoproject.com/en/6.1/topics/http/urls/ diff --git a/djtemplate/wsgi.py b/project_name/wsgi.py similarity index 70% rename from djtemplate/wsgi.py rename to project_name/wsgi.py index d502743..a69276a 100644 --- a/djtemplate/wsgi.py +++ b/project_name/wsgi.py @@ -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``. @@ -11,6 +11,6 @@ import os 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() diff --git a/templates/BaseLayout.html b/templates/BaseLayout.html index e10a31f..2a351dc 100644 --- a/templates/BaseLayout.html +++ b/templates/BaseLayout.html @@ -1,15 +1,16 @@ -{% load static %} +{% templatetag openblock %} load static {% templatetag closeblock %} - {% block title %}{{ project_name }}{% endblock %} + {% templatetag openblock %} block title {% templatetag closeblock %}{{ project_name }}{% templatetag openblock %} endblock {% templatetag closeblock %} - + - + @@ -40,7 +41,7 @@ - {% block content %}{% endblock %} + {% templatetag openblock %} block content {% templatetag closeblock %}{% templatetag openblock %} endblock {% templatetag closeblock %} - + - +