Here are simple steps to create hello world web application in python using django framework
- Step 1: Install virtual environment and create virtual environment for your project
pip install virtualenvwrapper-win
mkvirtualenv myproject
-
pip install virtualenv -
virtualenv name_to_your_env -
name_to_your_env\Scripts\activate -
After activation $ django-admin.py startproject HelloWorld$ cd HelloWorld$ ls HelloWorld manage.py -
$ python manage.py runserver Validating models... 0 errors found ... Django version 1.6.5, using settings 'HelloWorld.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. - $ django-admin startapp HelloWorldApp
$ ls
HelloWorld HelloWorldApp manage.py - edit settings.py under HelloWorld project directory
# Application definition
INSTALLED_APPS = ( ‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
‘HelloWorldApp’, ) - modify the urls.py which is under the project directory, HelloWorld
from django.conf.urls import patterns, include, url from HelloWorldApp.views import foo #from django.contrib import admin #admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'HelloWorld.views.home', name='home'), # url(r'^blog/', include('blog.urls')), #url(r'^admin/', include(admin.site.urls)), url(r'HelloWorldApp/$', foo), ) - modify views.py under app directory, HelloWorldApp
# Create your views here. from django.http import HttpResponse def foo(request): return HttpResponse("Hello World!") - Run the server
python manage.py runserver
- Hit this URL on browser
http://localhost:8000/HelloWorldApp/
Ref Links:
- https://docs.djangoproject.com/en/1.11/howto/windows/
- http://www.bogotobogo.com/python/Django/Python_Django_hello_world.php
- https://stackoverflow.com/questions/18684231/python-setup-command-not-found
- https://stackoverflow.com/questions/8074955/cannot-import-name-patterns
- https://scotch.io/tutorials/build-your-first-python-and-django-application
- http://jinja.pocoo.org/docs/2.10/templates/
смотря фильмы онлайн документальное кино онлайн HD
the best adult generator adult fantasy ai chat create erotic videos, images, and virtual characters. flexible settings, high quality, instant results, and easy operation right in your browser. the best features for porn generation.
сервисы электронной рассылки сервис рассылки email российские
bookmaker melbet melbet telecharger
paris 1win 1win apk
какие цены на квартиры жк светский лес сочи