-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"# renthouse" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class HomeConfig(AppConfig): | ||
name = 'home' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>İlk Django Sayfası</title> | ||
</head> | ||
<body> | ||
<h1>Selam Canım, Ben Senin Amcanım</h1> | ||
<h3>Merve Gündoğmuş</h3> | ||
<p> | ||
{{ text | safe }} | ||
</p> | ||
|
||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.urls import path | ||
|
||
from . import views | ||
|
||
urlpatterns = [ | ||
# ex: /home/ | ||
path('', views.index, name='index'), | ||
|
||
# ex: /polls/5/ | ||
# path('<int:question_id>/', views.detail, name='detail'), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.http import HttpResponse | ||
from django.shortcuts import render | ||
|
||
#Create your views here. | ||
|
||
def index(request): | ||
text="Merhaba Django <br> PyCharm Editör" | ||
context = {'text': text} | ||
return render(request, 'index.html', context) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/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', 'renthouse.settings') | ||
try: | ||
from django.core.management import execute_from_command_line | ||
except ImportError as exc: | ||
raise ImportError( | ||
"Couldn't import Django. Are you sure it's installed and " | ||
"available on your PYTHONPATH environment variable? Did you " | ||
"forget to activate a virtual environment?" | ||
) from exc | ||
execute_from_command_line(sys.argv) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. | ||
from property.models import Category, Property | ||
|
||
|
||
class CategoryAdmin(admin.ModelAdmin): | ||
list_display = ['title', 'description', 'status'] | ||
list_filter = ['status'] | ||
|
||
class PropertyAdmin(admin.ModelAdmin): | ||
list_display = ['title', 'category', 'price', 'amount', 'status'] | ||
list_filter = ['status'] | ||
|
||
admin.site.register(Category,CategoryAdmin) | ||
admin.site.register(Property, PropertyAdmin) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class PropertyConfig(AppConfig): | ||
name = 'property' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by Django 3.1 on 2020-08-07 00:13 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Category', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('title', models.CharField(max_length=150)), | ||
('keywords', models.CharField(max_length=255)), | ||
('description', models.CharField(max_length=30)), | ||
('image', models.ImageField(blank=True, upload_to='images/')), | ||
('status', models.CharField(choices=[('True', 'Evet'), ('False', 'Hayir')], max_length=10)), | ||
('slug', models.SlugField(unique=True)), | ||
('create_at', models.DateTimeField(auto_now_add=True)), | ||
('update_at', models.DateTimeField(auto_now=True)), | ||
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='property.category')), | ||
], | ||
), | ||
] |