Benutzer-Werkzeuge

Webseiten-Werkzeuge


Seitenleiste

3D

INTERN

ADOBE

ARDUINO

BITBUCKET

DOCKER

C4D

GIT

HTML

IPHONE

JAVASCRIPT

JTL-SHOP

LARAVEL

MAGENTO2

MYSQL

PHP

PLESK

PROCESSING

PYTHON

SUITECRM

SEO

TRYTON

THUNDERBIRD / ICEDOVE / FossaMail

TYPO3

TYPO3: BACKEND

TYPO3: TYPOSCRIPT

UNIX

VLC

VVVV

WINDOWS

WINDOWS 10

WORDPRESS

XAMPP

XT:C 4 (Veyton)

python-django-first-steps

python django first steps

PRE:

$ aptitude install python-2.7 python-pip
$ pip install virtualenv

change to your workdir and start venv and install django

$ mkdir -p ~/workspace/django
$ cd ~/workspace/django
$ virtualenv myenv
$ source myenv/bin/activate
(myenv) $ pip install django

:?: note: to leave a virtualenv, type: deactivate

GO:

(myenv) $ django-admin startproject sample
(myenv) $ cd sample/
(myenv) $ ls
  • manage.py (points to settings file in proj)
  • sample/init.py (indicate packages to compiler)
  • sample/urls.py (holds the urls)
  • sample/settings.py (apps, database settings)
  • sample/wsgi.py (request and response)
(myenv) $ manage.py runserver

webserver should've started and be accessible on http://localhost:8000

alternative: start at 0.0.0.0

this can be useful if you start inside a VM and want to access your project from the host system

(myenv) $ manage.py runserver 0.0.0.0:8000

manage.py:

build migrations of changed models

$ manage.py makemigrations

apply migrations

$ manage.py migrate

internationalisation

$ django-admin.py makemessages --ignore=myenv/* -a -l de -v3

myenv/* holds my virtualenv

$ django-admin.py compilemessages
python-django-first-steps.txt · Zuletzt geändert: 2015/02/09 03:06 von admin