Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MingqianYang/77f88a0c57f9bdc40466f25b12a9a89c to your computer and use it in GitHub Desktop.
Save MingqianYang/77f88a0c57f9bdc40466f25b12a9a89c to your computer and use it in GitHub Desktop.
django toutoril
<component name="ProjectDictionaryState">
<dictionary name="a1" />
</component>
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
</profile>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
</expanded-state>
<selected-state>
<State>
<id>Buildout</id>
</State>
</selected-state>
</profile-state>
</entry>
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.4.0 (/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4)" project-jdk-type="Python SDK" />
<component name="masterDetails">
<states>
<state key="ScopeChooserConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/djangoPlayground.iml" filepath="$PROJECT_DIR$/.idea/djangoPlayground.iml" />
</modules>
</component>
</project>
django install
django-admin startproject projectName
django-admin startapp blog
edit settings.py
app add----->blog
edit views url.py
url(r'blog/index/$', 'blog.views.index')
edit blog/views.py
from django.http import HttpResponse
def index(req):
return HttpResponse('<h1>hello</h1>')
python3.4 manage.py runserver
url:127.0.0.1:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment