国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

# 0x00 django -- creating your first django projec

fuchenxuan / 3248人閱讀

0x00 django -- creating your first django project

1.preparatory work


python3: we will use python 3.5 to develop this project

pycharm: install pycharm professional on your computer--->Pycharm downloads

linux: we will develop this project on linux

django: pip3 install django

2.use pycharm IDLE to start your project


open your pycharm and create a django project

you will get a project

3.modify the setting file ~/djangoCarl/settings.py

ALLOWED_HOSTS = [
    "127.0.0.1",
    "www.exampleCarlBenjamin.com"
]

4.create the index.html ~/templates/index.html like that




    
    Hello Django


Hello Django

5.modify your views ~/application/views.py like that

# coding=utf-8
from django.shortcuts import render


# Create your views here.
def application(request):
    return render(request, "index.html")

6.modify your urls ~/djangoCarl/urls.py like that

from django.conf.urls import url
from django.contrib import admin
from application.views import application

urlpatterns = [
    url(r"$", application, name="application"),
    url(r"^admin/", admin.site.urls),
]

7.cd to your workspace and

python3 manage.py runserver

8.You will see 127.0.0.1:8000

9.Now you complete your first project of django

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/38616.html

相關(guān)文章

  • #date:2017.07.19 django app, Part 2

    摘要:這篇教程從教程,我們會(huì)配置自己的數(shù)據(jù)庫,創(chuàng)造你的第一個(gè)模型,開始一個(gè)快捷的自動(dòng)生成管理員站點(diǎn)。項(xiàng)目是一個(gè)特性網(wǎng)站的相關(guān)配置和應(yīng)用的集合。 Writing your first django app, part 2 this tutorial begins where Tutorial 1 left off.Well setup the database, create your fir...

    MartinHan 評(píng)論0 收藏0
  • python第三方庫之Django學(xué)習(xí)筆記二

    摘要:上一節(jié)項(xiàng)目框架已經(jīng)搭建完畢,現(xiàn)在開始連接數(shù)據(jù)庫,創(chuàng)建數(shù)據(jù)庫設(shè)置默認(rèn)安裝了數(shù)據(jù)庫打開文件數(shù)據(jù)庫引擎數(shù)據(jù)庫的名字小貼士如果你選擇,數(shù)據(jù)庫是以文件的形式生成,要設(shè)置成絕對(duì)路徑創(chuàng)建表結(jié)構(gòu)創(chuàng)建模型激活模型執(zhí)行命令執(zhí)行成功后目錄結(jié)構(gòu)如下圖 上一節(jié)項(xiàng)目框架已經(jīng)搭建完畢,現(xiàn)在開始連接數(shù)據(jù)庫,創(chuàng)建model 1、數(shù)據(jù)庫設(shè)置python默認(rèn)安裝了sqlite數(shù)據(jù)庫 打開文件:dayang/settings...

    Java3y 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

fuchenxuan

|高級(jí)講師

TA的文章

閱讀更多
最新活動(dòng)
閱讀需要支付1元查看
<