[damned-lies] Updated file structure to new Django versions (incl. wsgi file)
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Updated file structure to new Django versions (incl. wsgi file)
- Date: Fri, 17 Apr 2015 13:42:23 +0000 (UTC)
commit b615cf5844a40358ad5107febd648b39a354d961
Author: Claude Paroz <claude 2xlibre net>
Date: Fri Apr 17 15:34:06 2015 +0200
Updated file structure to new Django versions (incl. wsgi file)
.gitignore | 2 +-
__init__.py => damnedlies/__init__.py | 0
settings.py => damnedlies/settings.py | 15 +++++++--------
urls.py => damnedlies/urls.py | 0
damnedlies/wsgi.py | 6 ++++++
manage.py | 2 +-
6 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 37d7a4b..da32599 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
*.pyc
locale
-local_settings.py
+damnedlies/local_settings.py
/static
diff --git a/__init__.py b/damnedlies/__init__.py
similarity index 100%
rename from __init__.py
rename to damnedlies/__init__.py
diff --git a/settings.py b/damnedlies/settings.py
similarity index 92%
rename from settings.py
rename to damnedlies/settings.py
index c42aa37..80a3b67 100644
--- a/settings.py
+++ b/damnedlies/settings.py
@@ -11,8 +11,7 @@ STATIC_SERVE = True
USE_DEBUG_TOOLBAR = False
USE_DJANGO_OPENID = False
-PROJECT_PATH = os.path.dirname(os.path.abspath(__file__))
-PROJECT_NAME = PROJECT_PATH.split('/')[-1]
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
ADMINS = (
('Your Name', 'your_address example org'),
@@ -23,7 +22,7 @@ MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
- 'NAME' : os.path.join(PROJECT_PATH, 'database.db'),
+ 'NAME' : os.path.join(BASE_DIR, 'database.db'),
}
}
# Please refer to the README file to create an UTF-8 database with MySQL.
@@ -62,17 +61,17 @@ SITE_ID = 1
USE_I18N = True
USE_L10N = True
LOCALE_PATHS = (
- os.path.join(PROJECT_PATH, 'locale'),
+ os.path.join(BASE_DIR, 'locale'),
)
# Absolute path to the directory that holds media.
-MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
+MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
MEDIA_URL = '/media/'
-STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')
+STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
@@ -116,10 +115,10 @@ MIDDLEWARE_CLASSES = (
'django.middleware.transaction.TransactionMiddleware',
)
-ROOT_URLCONF = 'urls'
+ROOT_URLCONF = 'damnedlies.urls'
TEMPLATE_DIRS = (
- os.path.join(PROJECT_PATH, 'templates'),
+ os.path.join(BASE_DIR, 'templates'),
)
INSTALLED_APPS = (
diff --git a/urls.py b/damnedlies/urls.py
similarity index 100%
rename from urls.py
rename to damnedlies/urls.py
diff --git a/damnedlies/wsgi.py b/damnedlies/wsgi.py
new file mode 100644
index 0000000..0dbbc54
--- /dev/null
+++ b/damnedlies/wsgi.py
@@ -0,0 +1,6 @@
+import os
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "damnedlies.settings")
+
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()
diff --git a/manage.py b/manage.py
index f9726f9..e1ff043 100755
--- a/manage.py
+++ b/manage.py
@@ -3,7 +3,7 @@ import os
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "damnedlies.settings")
from django.core.management import execute_from_command_line
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]