Projekte: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
KKeine Bearbeitungszusammenfassung |
KKeine Bearbeitungszusammenfassung |
||
| Zeile 63: | Zeile 63: | ||
STATIC_ROOT = os.path.join(BASE_DIR, "static") *** wieder raus nach collectstatic | STATIC_ROOT = os.path.join(BASE_DIR, "static") *** wieder raus nach collectstatic | ||
* Ordnerstruktur erweitern (templates und static) | |||
* python manage.py collectstatic (kopiert die Adminfiles aus den Django-Verzeichnis in static) | |||
* Models erstellen | |||
* python manage.py makemigrations | |||
* python manage.py migrate | |||
* python manage.py createsuperuser | |||
* python manage.py runserver | |||
=== Hompage Deployment === | |||
*git pull git@github.com:holnet/Homepage.git | * git pull git@github.com:holnet/Homepage.git | ||
*sudo systemctl restart apache2 | * sudo systemctl restart apache2 | ||
{{Hauptseite}} | {{Hauptseite}} | ||
[[Kategorie:Projekte]] | [[Kategorie:Projekte]] | ||
Version vom 29. Juni 2023, 23:55 Uhr
Projekt Homepage astroneth.eu
Python Environment-Installation im entsprechenden Verzeichnis
- python3 -m venv .venv
- .venv\Scripts\activate.ps1
oder source .venv/bin/activate jetzt kann python.exe mit python benutzt werden deactivate ==> das Enviroment wieder deaktivieren
- pip install django mysqlclient
pip install --upgrade django
- pip list
- python -m django --version
ℹ nur zur Prüfung ob alles OK ist
- python -m pip install -U Django
ℹ Django upgraden
Projekt anlegen
- django-admin startproject astroneth
- python manage.py startapp home
- urls.py erstellen und registrieren (include in Projekt urls.py)
- settings.py bearbeiten
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'db-name',
'USER': 'db-user',
'PASSWORD': 'xxxxxxxxx',
'HOST': 'localhost',
'PORT': ,
}
}
INSTALLED_APPS = [
'home',
...
TEMPLATES = [
{
...
'DIRS': [(BASE_DIR / 'templates')],
...
LANGUAGE_CODE = 'de'
TIME_ZONE = 'Europe/Berlin'
STATIC_URL = 'static/'
#STATICFILES_DIRS = [
# BASE_DIR / "static"
#]
STATIC_ROOT = os.path.join(BASE_DIR, "static") *** wieder raus nach collectstatic
- Ordnerstruktur erweitern (templates und static)
- python manage.py collectstatic (kopiert die Adminfiles aus den Django-Verzeichnis in static)
- Models erstellen
- python manage.py makemigrations
- python manage.py migrate
- python manage.py createsuperuser
- python manage.py runserver
Hompage Deployment
- git pull git@github.com:holnet/Homepage.git
- sudo systemctl restart apache2
zurück zur ==> Hauptseite