Attachment '00_startproject.sh'
Download# Som v mojom domovskom adresari # spravim si adresar na djangovske projekty # mkdir django # # vleziem donho # cd django # # vytvorim projekt s nazvom minidata # django-admin startproject minidata ls -l # # vznikol novy adresar s projektom, vlezme don # cd minidata ls -l # # popis obsahu adresara: # __init__.py je inicializacny modul balicka minidata # manage.py je program, ktory nam umoznuje spravovat nas projekt # settings.py je modul s nastaveniami # urls.py obsahuje mapovanie URL na views # # Dolezite je nastavit teraz v settings.py # pouzitu databazu. # # Ak chceme pouzivat sqlite (to je pre takyto skusobny projekt # najjednoduchsie), treba nastavit # # DATABASE_ENGINE = 'sqlite3' # # a aj meno databazy napr. takto # # DATABASE_NAME = 'meno_databazy.db' # # Tuna to spravim pomocou sedu, ale samozrejme # kazda pricetna osoba by to zeditovala. # sed -i "s/DATABASE_ENGINE.*/DATABASE_ENGINE = \'sqlite3\'/" settings.py sed -i "s/DATABASE_NAME.*/DATABASE_NAME = \'meno_databazy.db\'/" settings.py # # manage.py budeme pouzivat casto. # V pripade, ze nie je spustitelny (to zavisi od verzie # djanga alebo distribucie), je vhodne ho zospustitelnit. # chmod a+x manage.py ls -l manage.py # # V settings.py su v casti INSTALLED_APPS na konci # defaultne nakonfigurovane niektore aplikacie (autentifikacia, # sprava uzivatelov a podobne) # # Tieto pouzivaju databazu. Inicializaciu # databaz zabezpecime prikazom ./manage.py syncdb yes no | ./manage.py syncdb # Teraz uz mozeme spustit prazdny projekt # django pocuva na http://localhost:8000/ ./manage.py runserver
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.- [get | view] (2009-02-23 20:53:28, 1.6 KB) [[attachment:00_startproject.sh]]
- [get | view] (2009-02-23 20:48:15, 2.6 KB) [[attachment:00_startproject_out.sh]]
You are not allowed to attach a file to this page.