http___pythontr.blogspot.com.tr_2008_09_django-ile-anket-yapalm.html_1.xml
1.1 1.2 2.1 3.1 3.2 3.3 3.4 4.1 5.1 6.1 6.2 6.3 7.1 7.2 8.1 8.2 9.1 10.1 10.2 10.3 11.1 12.1 12.2 12.3 13.1 14.1 15.1 16.1 17.1 17.2 18.1 19.1 20.1 21.1 21.2 22.1 23.1 23.2 23.3 23.4 24.1 25.1 25.2 26.1 27.1 28.1 28.2 29.1 29.2 30.1 30.2 30.3 31.1 31.2 32.1 33.1 34.1 34.2 34.3 35.1 35.2 35.3 35.4 35.5 36.1 37.1 37.2 37.3 38.1 38.2 38.3 38.4 38.5 38.6 38.7 38.8 38.9 38.10 39.1 39.2 40.1 41.1 42.1 42.2 42.3 43.1 44.1 45.1 46.1 46.2 46.3 47.1 47.2 47.3 47.4 48.1 48.2 48.3 49.1 50.1 50.2 50.3 51.1 51.2 52.1 52.2 52.3 52.4 52.5 52.6 53.1 54.1 54.2 54.3 54.4 54.5 54.6 55.1 56.1 57.1 57.2 58.1 59.1 59.2 59.3 60.1 61.1 61.2 62.1 62.2 62.3 62.4 62.5 62.6 62.7 62.8 63.1 63.2 64.1 65.1 65.2 66.1 67.1 67.2 67.3 67.4 67.5 68.1 69.1 69.2 70.1 71.1 72.1 73.1 74.1 75.1 75.2 76.1 77.1 77.2 78.1 79.1 79.2 79.3 80.1 80.2 80.3 81.1 82.1 82.2 82.3 82.4 83.1 84.1 85.1 86.1 86.2 86.3 86.4 86.5 86.6 87.1 87.2 87.3 87.4 88.1 89.1 89.2 90.1 91.1 92.1 93.1 94.1 95.1 96.1 97.1 98.1 99.1 99.2 99.3 99.4 100.1 101.1 101.2 102.1 103.1 104.1 105.1 105.2 105.3 106.1 107.1 107.2 107.3 107.4 108.1 108.2 109.1 110.1 111.1 112.1 112.2 113.1 114.1 115.1 116.1 117.1 118.1 119.1 119.2 120.1 120.2 121.1 121.2 122.1 122.2 122.3 123.1 124.1 124.2 125.1 125.2 125.3 125.4 125.5 126.1 127.1 128.1 128.2 128.3 128.4 129.1 129.2 129.3 129.4 130.1 131.1 131.2 132.1 132.2 133.1 134.1 135.1 135.2 136.1 136.2 137.1 137.2 138.1 138.2 139.1 140.1 141.1 142.1 142.2 142.3 143.1 143.2 144.1
We?ve covered quite a bit of Python in the previous tutorials in this Session. Today, we?re going to combine everything we?ve learned so far to build a dynamic website with Python. Prefer a Video Tutorial? So, how do you get started creating websites with Python? Well, you could do it all yourself, and write a program that runs on a web server, accepting page requests and serving up responses in the form of HTML and other resources. However, that?s a lot of work, so why go to all the trouble when there are plenty of existing tools out there to do the job for you? These tools are called frameworks, and they’re what we?ll use today to create our website. Python Frameworks There are quite a few Python web frameworks, but here are some of the best: - Django – We’re going to use this today. It has a huge set of features, but remains simple to use. The documentation is also excellent, so if you get stuck, you’ll have the easiest time solving your problem with Django. - Grok – Another framework with a feature set that comes close to Django. If you decide you don’t prefer Django, this is a good alternative. - WebPy – A much more lightweight framework. It doesn’t have as many features, though it did power Reddit for a period of time! - TurboGears – Though previously having a reputation for poor documentation, TurboGears has improved substantially in the last year. A more comprehensive list can be found on the Python website if you’re in need of additional options. Today we?re going to set Django up for development on a local machine, and then build a simple blog. We’re also going to review the process of installing it on a remote web server. Installing Django We’ll be performing most of our work today in the Terminal. This should all work on Mac and Linux; however, if you’re running Windows, the process is somewhat different. A familiarity with the command line isn’t necessary if you’re only writing Python, though, if you’re planning on using Django, or running a dynamic website in general, it’s worth learning. Terminal Tutorials Consider reviewing these tutorials to get yourself up and running with the Terminal. - An intro to working in the terminal, which covers Git and Github too. - 10 tips to work faster in the terminal. Here are the commands you need to install Django. It’s not compatible with Python 3, so you’ll need to install version 2.7 or earlier to get it running. wget http://www.djangoproject.com/download/1.3.1/tarball/ tar xzvf Django-1.3.1.tar.gz cd Django-1.3.1 python setup.py install Next, we can optionally remove the install files. rm Django-1.3.1.tar.gz That should do it! Let’s test it out. python from django import get_version get_version() You should see ’1.3.1′. If you do, everything worked and Django is installed on your system. Congratulations! We’re ready to begin creating our site! Building our Blog We’re going to build a blog system today, because it’s an excellent way to learn the basics. First, we need to create a Django project. cd ~/Documents/Projects django-admin.py startproject FirstBlog cd FirstBlog ls What do each of these files do? __init__.pytells Python that this folder is a Python package. We learned about these in the third lesson; it allows Python to import all of the scripts in the folder as modules. manage.pyisn?t actually part of your website; it?s a utility script that you run from the command line. It contains an array of functions for managing your site. settings.pycontains your website’s settings. Django doesn?t use XML files for configuration; everything is Python. This file is simply a number of variables that define the setting for your site. urls.pyis the file that maps URLs to pages. For example, it could map yourwebsite.com/about to an About Us page. Django refers to itself an MTV framework, which stands for Model Template View. Apps However none of these files on their own make a functional website. For that, we need Apps. Apps are where you write the code that makes your website function, but before we take a look at them, we need to understand a bit about Django?s design principles. First, Django is an MVC framework, which stands for Model View Controller. Django refers to itself an MTV framework, which stands for Model Template View. It?s a slightly different approach than MVC, but fundamentally, they?re quite similar. Anyhow, MVC is an architectural pattern that provides a method for structuring your projects. It separates the code that?s used to process data from the code that manages the user interface. Django subscribes to the DRY, or “Don?t Repeat Yourself” philosophy. Secondly, Django subscribes to the DRY, or Don?t Repeat Yourself philosophy, which means that you should never be writing code that performs a certain task more than once. For example, in our blog, if we wrote a feature that picked a random article from the archive, and implemented this feature on multiple pages, we wouldn?t code it again each time it was needed. We?d code it once and then use it on each page. So how does this relate to apps? Well, apps allow you to write your website in a DRY style. Each project, like the one we have here, can contain multiple apps. Conversely, each app can be part of multiple projects. Using the example from earlier, this means that if we made another site in the future that also needed a random page feature, we wouldn?t have to write it all over again. We could simply import the app from this project. Because of this, it?s important that each app serves one distinct purpose. If you write all the functionality of your site within one app, and then need to use part of it again later, you have to import it all. If you were making an eCommerce website, for example, you wouldn?t want to import all the blog features. However, if you make one app for the random feature and one app for the blog publishing system, you could pick and choose the bits that you require. This also means that within the site, the code is well organized. If you want to alter a feature, you don?t have to search through one massive file; you can instead browse to the relevant app and change it without worrying about interfering with anything else. python mangage.py startapp blog cd blog ls Again, we?ve got an __init__.py file to make it a package, and three other files: models, tests and views. We don?t need to worry about tests for now, but the other two are important. Models and Views are the M and V parts of MVC. In models, we define our data structures. If you?ve ever worked with PHP before, you might have used PhpMyAdmin to create your MySQL tables, and then written out your SQL queries manually in your PHP scripts. In Django, it?s much easier. We define all the data structures we need in this models file, then run a command and all the necessary databases are made for us. When you wish to access that data, you go via these models by calling method on them, instead of running raw queries. This is very helpful, because Django can use several database programs. We?re going to use MySQL today, because it?s the most powerful, and is what most hosts provide, but if we needed to switch to a different database in the future, all of the code will still be valid! In other languages, if you wanted to switch to SQLite or something similar, you would need to rewrite the code that accesses your database. In the views file, we write the code that actually generates the web pages. This ties all the other parts together. When a user types in a URL, it is sent by the urls script we saw earlier to the views script, which then gets relevant data from the models, processes it and passes it into a template, which finally gets served up as the page the user sees. We?ll take a look at those templates shortly. They?re the easiest part – mostly HTML. For a blog, we?ll need a table of posts, with several fields for the title, body text, author, the time it was written, and so on. A real blog would have comments, but that?s beyond the scope of today’s demo. from django.db import models class posts(models. Model): author = models. CharField(max_length = 30) title = models. CharField(max_length = 100) bodytext = models. TextField() timestamp = models. DateTimeField() MySQL These models are just a description. We need to make an actual database from them. First, however, we need MySQL running on our system. On an actual web server, this wouldn?t be a problem, because they usually have it preinstalled. Luckily, with a package manager, it?s easy to install. First, you need to install Homebrew and Easy Install brew install mysql easy_install mysql-python mysqld_safe --skip-grant-tables #let anyone have full permissions mysql -u root UPDATE mysql.user SET Password=PASSWORD('nettuts') WHERE User='root'; #give the user 'root' a password FLUSH PRIVILEGES; mysql -u root -p #log in with our password 'nettuts' CREATE DATABASE firstblog; quit python2.6 manage.py runserver When you reboot, MySQL won’t be running, so every time you need to do this in the future, run mysqld to start the server. You can then run python2.6 manange.py runserver in a new tab to start the development server. This command won’t run the server yet, it will just return an error. That’s because we need to configure our settings. Let’s take a look at settings.py. You need to change the database settings first. These begin on line twelve. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'firstblog', # Or path to database file if using sqlite3. 'USER': 'root', # Not used with sqlite3. 'PASSWORD': 'nettuts', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. If you try to run the server again, it should work, provided that you successfully installed MySQL. If you visit 127.0.0.1:8000 in your web browser, you should see the default Django page. Now let’s turn our Django site into a blog. First, we need to use our Models to create tables in the database by running the following command: python2.6 manage.py syncdb Every time you change your models, you should run this command to update the database. Note that this can’t alter existing fields; it may only add new ones. So if you want to remove fields, you’ll have to do that manually with something like PhpMyAdmin. Because this is the first time we’ve run the command, Django will set up all the default built in tables for things like the administration system. Just type ‘yes’ and then fill in your details. Now let’s set up the urls.py file. Uncomment the first line in the examples section, and change it to say url(r'^$', 'FirstBlog.blog.views.home', name='home') . Now, let’s create the views file to respond to these requests. from django.shortcuts import render_to_response from blog.models import posts def home(request): return render_to_response('index.html') Templates This index.html file doesn’t exist yet, so let’s make it. Create a folder, called templates in the blog app and save a file in it called index.html, which can simply contain “Hello World” for now. Then, we need to edit the settings file so Django knows where this template is located. Line 105 is where the section for declaring template folders starts; so adjust it, like so: TEMPLATE_DIRS = ( "blog/templates", # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. If you run the server again and refresh the page in your browser, you should see the “Hello World” message. We can now begin laying out our blog. We’ll add some boilerplate HTML for the home page. First Blog         First Blog   Title   Posted on date by author   Body Text If you save and refresh the page, you should see that the page has been updated with this new content. The next step is to add dynamic content from the database. To accomplish this, Django has a templating language that allows you to embed variables with curly braces. Change the middle section of your page to look like this: First Blog   {{ title }}   Posted on {{ date }} by {{ author }}   {{ body }} We can then pass in values to these variable placeholders from the views.py file by creating a dictionary of values. from django.shortcuts import render_to_response from blog.models import posts def home(request): content = { 'title' : 'My First Post', 'author' : 'Giles', 'date' : '18th September 2011', 'body' : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam cursus tempus dui, ut vulputate nisl eleifend eget. Aenean justo felis, dapibus quis vulputate at, porta et dolor. Praesent enim libero, malesuada nec vestibulum vitae, fermentum nec ligula. Etiam eget convallis turpis. Donec non sem justo.', } return render_to_response('index.html', content) Save and refresh, and you should see that you’re now passing in content to a template from your views file. The final step is to get data from our database and pass that in instead. Luckily, we can do this all without SQL queries, using Django’s models. We need to add our blog app to our FirstBlog project by changing another setting. Go to INSTALLED_APPS on line 112, and add the 'FirstBlog.blog', to the list. Then change views.py so it adds data from the database. from django.shortcuts import render_to_response from blog.models import posts def home(request): entries = posts.objects.all()[:10] return render_to_response('index.html', {'posts' : entries}) Next, update the template to access this data. First Blog    {% for post in posts %}    {{ post.title }}   Posted on {{ post.timestamp }} by {{ post.author }}   {{ post.bodytext }}      {% endfor %} Here, we can access all the data in our table in the views.py file, then select only the first ten entries. We pass this data into the template, loop through the entries and display the data with the HTML of our site. This won’t work just yet, because there’s nothing in the database. Stop the server and run: python2.6 manage.py syncdb This will add the new table for our posts to the database. Then, open a new tab and type: mysql -u root -p …type your password, hit enter, and execute: INSERT INTO blog_posts (author, title, bodytext) values ('Bob', 'Hello World', 'Lorem Ipsum'); Return to the previous tab and run the server again. Refresh the page and you should see a blog post with the dummy content you just added. If you run the MySQL command a few more times, you should see more posts appear on the page when you refresh. Django’s Admin System The last thing we need to do today is review Django’s administration system. This is a really powerful feature of Django that lets you manage your site without writing any more code, as you would have to if you were creating a site from scratch. To enable it, we need to change a few settings. First, uncomment lines 4, 5, 13 and 16 within urls.py, so that you can actually access the admin page. Next, go to the INSTALLED_APPS section of settings.py and uncomment 'django.contrib.admin', and 'django.contrib.admindocs',. To let the admin control your posts table, create a new file called admin.py in the blog folder, and add the following lines: from django.contrib import admin from blog.models import posts admin.site.register(posts) Run python2.6 manage.py syncdb again to add the tables for the admin section, and restart the server. If you visit 127.0.0.1:8000/admin now in your browser, you should see a login page. Use the details you chose earlier when you first ran the syncdb command to log in. You should see a section, called Blog, with a subtitle for the posts table. You can use this to create, edit and remove blog posts with a simple interface. That’s all there is to do. You’ve just created a fully functioning, albeit simple, blog. To finish this lesson, we’re going to look at installing Django on a web server. Installing on a Web Server There are two types of web hosting, and which one you have will affect whether you can use Django. If you have shared hosting, you’re entirely at the mercy of your host. Many cheap web hosts don?t support Python. While PHP is nearly guaranteed, support for other languages often isn?t. You’ll have to check the control panel to determine if Python (and Django) are available. Obviously the process is slightly different with every host. Almost all hosting runs on Apache, and we can use it to host Django, using the mod_wsgior mod_pythonApache modules. Most web hosts run scripts in several languages using CGI. Django can run on FastCGI, and also, theoretically, on CGI, but this is not officially supported and would be far too slow for an actual production website. You?ll need to check if these are installed. They?re usually found under a heading, like ?CGI and Scripting Language Support?. If you have VPS hosting, or are lucky enough to have a dedicated server, your life is much easier. Usually these come with Python preinstalled, and from there, you only need to follow the same steps we went through to get a local copy of Django running. If you don’t have Python, you can install it with a package manager. Your system may even come with Django. ssh root@example.com wget http://www.djangoproject.com/download/1.3.1/tarball/ tar xzvf Django-1.3.1.tar.gz cd Django-1.3.1 python setup.py install Once you’ve installed Django on your server, upload the site you just made using any file transfer client. You can put the files anywhere, but keep them out of the public folder, or anyone will be able to see the source code of your site. I use /home for all my projects. Next, create a MySQL database, called ‘firstblog’ on your server and run syncdb again. You’ll have to create your account for the admin control panel again, but this is a one-time thing. If you try and run this, you might receive an error, and that’s because the settings for the server are different those on your local computer. You may need to change the database password within settings.py, but depending on your server configuration, you may also encounter other issues. Google is your friend in these situations! To run the server this time, the command is slightly different. You have to specify an IP address and port so that you can access the site over the internet. python manage.py runserver 0.0.0.0:8000 If you visit your site in a web browser, on port 8000, you should see your site! Conclusion That’s it for this lesson…and our series. I hope you’ve learned a number of useful skills over these past five lessons, and that you’re ready to go on and learn even more Python in the future. If you like the look of Django, and wish to continue increasing your knowledge of the framework, here’s some additional tutorials on the subject. As always, I?m happy to discuss any questions about this tutorial or Python in general within the comments. Thanks for reading. Source: http://feedproxy.google.com/~r/nettuts/~3/LbjkA5zNcNM/
1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 16.1 17.1 18.1 19.1 20.1 21.1 22.1 23.1 24.1 26.1 27.1 28.1 29.1 30.1 31.1 32.1 33.1 34.1 35.1 36.1 37.1 38.1 39.1 40.1 43.1 44.1 45.1 46.1 47.1 50.1 51.1 52.1 53.1 54.1 55.1 56.1 57.1 58.1 59.1 60.1 61.1 62.1 63.1 64.1 65.1 66.1 67.1 68.1 69.1 70.1 71.1 72.1 73.1 74.1 75.1 77.1 78.1 79.1 80.1 81.1 82.1 83.1 84.1 85.1 86.1 87.1 88.1 89.1
Şimdi yeni bir proje başlatmak için gerekli olan komutumuzu veriyoruz. Deniz@ParMak ~ $ django-admin.py startproject OrnekProje OrnekProje adıyla yeni bir projeye başladık şimdi o dizine geçip uygulamamıza devam edelim. Deniz@ParMak ~ $ cd OrnekProje/ Şimdi de projemiz içerisinde yeni bir uygulama başlatalım. Not: Uygulamalar genellikle belirlir bir görevi yerine getirmek üzere kullanılırken. Projeyi ise içinde bir çok uygulamayı içerisinde düzenli şekilde barındıran uygulamalar bütünü olarak tanımlayabiliriz. Yine uygulamalarımızı bir kere oluşturup farklı projeler içerisinde de kullabiliriz. Deniz@ParMak OrnekProje $ python manage.py startapp anket Projemiz içerisinde anket isimli bir dizin oluştuğunu göreceksiniz içinde ise "__init__.py __init__.pyo models.py models.pyo views.py views.pyo " dosyaları mevcuttur. models.py dosyası bizim modellerimizi tanımlayacağımız dosya olacak. Anket uygulaması için 2 model oluşturacağız: Anket ve Secim. Anket içerisinde soru ve yayın tarihi yer alırken Secim içerisinde secenekler ve oylar alanları yer alacak. Bunun için aşağıda ki kodları models.py dosyamıza kaydediyoruz. from django.db import models class Anket(models.Model): soru = models.CharField(max_length=200) yayin_tarihi = models.DateTimeField('yayin tarihi') class Secim(models.Model): anket = models.ForeignKey(Anket) secenek = models.CharField(max_length=200) oylar = models.IntegerField() Şimdide bir üst dizinde yer alan settings.py dosyasında INSTALLED_APPS kısmını şu şekilde düzenliyoruz. INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'OrnekProje.anket', Şimdi veri tabanı ayarlarını düzenliyoruz. (Ayrıntılı bilgi için miratın yazını inceleyiniz. DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'veritabanı_ismi' # Or path to database file if using sqlite3. DATABASE_USER = 'Deniz' # Not used with sqlite3. DATABASE_PASSWORD = 'şifrem' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. Eğer Pardus kullanıyorsanız Tasma-Servis Yöneticisinden mysql_server'i çalıştırmayı unutmayınız. Ardından bakalım az önce models.py içerisine pythoncasını yazdığımız modellerin mysql karşılıkları nelermiş ? Deniz@ParMak OrnekProje $ python manage.py sql anket BEGIN; CREATE TABLE `anket_anket` ( `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `soru` varchar(200) NOT NULL, `yayin_tarihi` datetime NOT NULL CREATE TABLE `anket_secim` ( `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `anket_id` integer NOT NULL, `secenek` varchar(200) NOT NULL, `oylar` integer NOT NULL ALTER TABLE `anket_secim` ADD CONSTRAINT anket_id_refs_id_4e3e5fcb FOREIGN KEY (`anket_id`) REFERENCES `anket_anket` (`id`); COMMIT; Eğer benzer bir çıktı aldıysanız herşey yolunda devam edebiliriz. Eğer bir hata almadıysanız djangoya az önceki sql komutlarını çalıştırmasını söylemek için aşağıda ki komutu giriyoruz. python manage.py syncdb Çıktısında şöyle birşey göreceksiniz. Creating table anket_anket Creating table anket_secim Installing index for anket.Secim model Şu ana kadar veri tabanı ayarlarımız yaptık şimdi Admin paneliyle ilgili ayarlarımıza geçiyorum. Tekrar setting.py dosyasını açıp INSTALLED_APPS bölümüne az önceki örnekteki gibi 'django.contrib.admin' satırını ekliyoruz. Ardından tekrar python "manage.py syncdb" komutunu verip veri tabanını güncellemesini istiyoruz. Bu esnada sizden admin paneline girişte kullanmanız için bir kullanıcı adı ve şifresi isteyecek gerekli ayarları yapıp devam ediniz. Son olarakta urls.py dosyasının başında admin paneli için gerekli olan modülleri yüklemek için # işaretini kaldırıyoruz. Ve yine o dosyanın sonundaki admin alanını djangoya göstermek için oradan da # işaretini kaldırıyoruz. Yani dosyanın en son hali şu şekilde olacak. from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^OrnekProje/', include('OrnekProje.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: (r'^admin/(.*)', admin.site.root), #burasını Şimdi django sunucusunu çalıştıralım. python manage.py runserver Şimdi tarayıcınızdan http://127.0.0.1:8000/admin/ adresini açıp neler olduğuna bakabilirsiniz :) Biraz kurcalayınca Gruplar,Kullanıcılar ve Siteler adında 3 bölüm göreceksiniz. Bunlar django ile öntanımlı olarak gelen admin paneli araçlarıdır. Fakat sanki bizim anket piyasada görünmüyor ? Bunun için yapmamız gereken tek birşey daha kaldı. Anket dizini içerisine admin.py adında bir dosya oluşturup içerisine şu satırları eklemek. from OrnekProje.anket.models import Anket from django.contrib import admin admin.site.register(Anket) Şimdi sunucumuzu yeniden başlatalım.(Ctrl+c) ile sonlandırıp. python manage.py runserver ile yeniden başlatabilirsiniz. Eğer bir aksilik çıkmadıysa artık admin panelinde anket uygulamımızı görmüşsünüzdür. Aslında buradan sonra anlatılacak pek birşey kalmıyor ama ben kısaca bir kaç ufak şeyden bahsedeyim. *Anketlere girdiğimizde görmüş olduğumuz form anket modelinde yazmış olduğumuz koda göre django tarafından otomatik olarak oluşturuluyor. *Anket modelinde oluşturduğumuz alanları hatırlayacak olursanız (DateTimeField, CharField gibi) django bunlara bakarak admin panelinde ona göre bir html üretiyor. *Örneğin DateTimeField ile gün ayarı yapabileceğimiz bir JavaScript kısayolunu bizim için panele ekliyor. Şimdilik bu kadarla kesiyorum. Admin panelinide kendi isteğimize göre özelleştirebiliyoruz. İlerleyen günlerde bu ufak tefek özelleştirmelerden de bahsedebilirim.