Commits

Hector Garcia committed d0dd63b

Removed reverse three tier settings conf because it caused me lot of problems, not worth it. Back to old import system.

  • Participants
  • Parent commits bba7d6e

Comments (0)

Files changed (6)

File conf/localsettings.py

+import os
+from settings import *
+
+# Static media
+MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media')
+MEDIA_URL = '/media/'
+ADMIN_MEDIA_PREFIX = '/media/admin/'
+
+# Flags that enable/disable other settings
+DEBUG = True
+USE_LOCALIZATION = False
+
+# Database
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': os.path.join(os.path.dirname(__file__), 'dev.db'),
+    }
+}
+
+# Template settings
+TEMPLATE_DEBUG = DEBUG
+TEMPLATE_DIRS = (
+    os.path.join(os.path.dirname(__file__), 'templates'),
+)
+
+# Localization
+if USE_LOCALIZATION:
+    ugettext = lambda s: s
+    # Replace with your languages
+    LANGUAGES = (
+        ('en', ugettext('English')),
+        ('es', ugettext('Spanish')),
+        ('it', ugettext('Italian')),
+    )
+    MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + \
+        ('django.middleware.locale.LocaleMiddleware',)
+
+# Debug Toolbar
+INTERNAL_IPS = ('127.0.0.1')
+INSTALLED_APPS = INSTALLED_APPS + ('debug_toolbar',)
+MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + \
+    ('debug_toolbar.middleware.DebugToolbarMiddleware',)
+DEBUG_TOOLBAR_CONFIG = {
+    'INTERCEPT_REDIRECTS': False,
+}
+

File conf/setup.py

     nbskel_dir = os.path.join(root_dir, 'nbskel')
     prj_dir = os.path.join(root_dir, PROJECT)
 
-    # Copy settings conf folder
-    settings_dir = os.path.join(nbskel_dir, 'settings_conf')
-    shutil.copytree(settings_dir, os.path.join(prj_dir, 'settings_conf'))
-
-    # Copy initial data fixture
+    # Copy initial data fixture and localsettings
     fixt_src = os.path.join(nbskel_dir, 'initial_data.json')
     shutil.copy(fixt_src, prj_dir)
+    local_settings = os.path.join(conf_dir, 'localsettings.py')
+    shutil.copy(local_settings, prj_dir)
 
     # Append static serve to urls
     global_urls = os.path.join(prj_dir, 'urls.py')

File docs/django-nbskel.rst

 django-nbskel
 =============
 
-The purpose if this application is to contain a basic django project and help you out configure it to speed up the process of starting up a new development, be it a quick hack or a long project.
+The purpose if this application is to contain a basic django project and help
+you out configure it to speed up the process of starting up a new development,
+be it a quick hack or a long project.
 
-I often need to produce new django projects and I don't enjoy doing repetitive things. They start basically with the same structure so with this app I can wrap all the first steps into a couple of actions. It also makes me feel secure because I always tend to forget to initialize settings, include files, import modules, and so on, so with django-nbskel I am sure I am beginning to develop upon a tested and stable code.
+I often need to produce new django projects and I don't enjoy doing repetitive
+things. They start basically with the same structure so with this app I can
+wrap all the first steps into a couple of actions. It also makes me feel
+secure because I always tend to forget to initialize settings, include files,
+import modules, and so on, so with django-nbskel I am sure I am beginning to
+develop upon a tested and stable code.
 
-Please be warned this is code that automates stuff for **me**, so you will be probably modifying it to fit your django configuration, tools, and deployment layout. A much recommended way to do this is forking the project and host it in social distributed code hosting sites like Bitbucket or Github.
+Please be warned this is code that automates stuff for **me**, so you will be
+probably modifying it to fit your django configuration, tools, and deployment
+layout. A much recommended way to do this is forking the project and host it
+in social distributed code hosting sites like Bitbucket or Github.
 
 Download
 ========
 
 	http://bitbucket.org/nabucosound/django-nbskel/
 
-If you want to add new features, fix a bug or use your customized version of django-nbskel, you may want to fork it to your Bitbucket own space (I highly recommend it), or clone it to your machine using Mercurial::
+If you want to add new features, fix a bug or use your customized version of
+django-nbskel, you may want to fork it to your Bitbucket own space (I highly
+recommend it), or clone it to your machine using Mercurial::
 
 	hg clone https://bitbucket.org/nabucosound/django-nbskel
 
 Project layout
 ==============
 
-At this moment for most of my projects I am using ``apache2`` web server with ``mod_wsgi`` and ``nginx`` as proxy. So once the project is going to be deployed for the first time, the ``conf`` folder includes the apache and nginx configuration files to be copied to their respective directories, and the ``wsgi`` contains the mod_wsgi config files. For this purpose, a ``first_deply`` is also created, containing commands to be executed.
+At this moment for most of my projects I am using ``apache2`` web server with
+``mod_wsgi`` and ``nginx`` as proxy. So once the project is going to be
+deployed for the first time, the ``conf`` folder includes the apache and nginx
+configuration files to be copied to their respective directories, and the
+``wsgi`` contains the mod_wsgi config files. For this purpose, a
+``first_deply`` is also created, containing commands to be executed.
 
-I also make use of the ubiquitous Trac project management software. If you include Trac to be configured by django-nbskel (setting the ``TRAC`` parameter to True in the ``project_conf``), additional files are produced to set another domain that will hold the Trac instance, as well as an htpasswd file in the root folder, in order to protect the Trac site from undesirable eyes.
+I also make use of the ubiquitous Trac project management software. If you
+include Trac to be configured by django-nbskel (setting the ``TRAC`` parameter
+to True in the ``project_conf``), additional files are produced to set another
+domain that will hold the Trac instance, as well as an htpasswd file in the
+root folder, in order to protect the Trac site from undesirable eyes.
 
-I am not going to explain how to deploy django projects here, tyhe choices are vast and interent is plenty of docs, how-to's, etc. You surely are going to modify django-nbskel to your systems architecture needs (unless you are happy with my initial layout) so you will have to understand how things work in your machine (web server configuration stuff mainly) in order to modify the code.
+I am not going to explain how to deploy django projects here, tyhe choices are
+vast and interent is plenty of docs, how-to's, etc. You surely are going to
+modify django-nbskel to your systems architecture needs (unless you are happy
+with my initial layout) so you will have to understand how things work in your
+machine (web server configuration stuff mainly) in order to modify the code.
 
 How to use it
 =============
 
 Following this steps you'll be ready to start working within minutes.
 
-1. Download the latest version. Do not clone it! It would add repository files you don't want in your project, simply because you probably will add it to your preferred revision control system. You can use the download URL that points to the latest app changeset (tip)::
+1. Download the latest version. Do not clone it! It would add repository files
+you don't want in your project, simply because you probably will add it to your
+preferred revision control system. You can use the download URL that points to
+the latest app changeset (tip)::
 
 	$ wget https://bitbucket.org/nabucosound/django-nbskel/get/tip.tar.gz
 	
-2. Extract the tarball contents and rename the resulting django-nbskel folder to whatever your project is going to call (in the example below a name it myproject)::
+2. Extract the tarball contents and rename the resulting django-nbskel folder
+to whatever your project is going to call (in the example below
+a name it myproject)::
 
 	$ tar xzvf tip.tar.gz && mv django-nbskel myproject
 	
-3. Move to this folder and edit the ``conf/project_conf`` settings to your values. These are being used by the ``setup.py`` to search and replace inside the apache, nginx, wsgi and django configuration files, and to rename them afterwards. Don't go ahead until you have filled out these settings, follow the examples in the file for each setting.
+3. Move to this folder and edit the ``conf/project_conf`` settings to your
+values. These are being used by the ``setup.py`` to search and replace inside
+the apache, nginx, wsgi and django configuration files, and to rename them
+afterwards. Don't go ahead until you have filled out these settings, follow
+the examples in the file for each setting.
 
-4. Run the ``setup.py`` script. If you have included Trac to be configured, you will be asked for an ``htpasswd`` password::
+4. Run the ``setup.py`` script. If you have included Trac to be configured,
+you will be asked for an ``htpasswd`` password::
 
 	$ python conf/setup.py
 	
-5. Move to your project directory and run these two django commands to initialize everything::
+5. Move to your project directory and run these two django commands to
+initialize everything::
 
 	$ python manage.py syncdb --noinput --settings=settings_conf.localsettings
 	$ python manage.py runserver --settings=settings_conf.localsettings
 
-6. At this point you can begin coding. As long as you have all the necessary included into your django project, you can forget about all those startup quirks and go straight to the point.
+6. At this point you can begin coding. As long as you have all the necessary
+included into your django project, you can forget about all those startup
+quirks and go straight to the point.
 
 The nbskel folder
 =================
 
-This folder contains basic settings, initial fixture datam as well as a minimal django app called *website* along with some templates and some other things I almost always include in my projects, which you can copy into your project folder to use it as a quick way to test basic things. Add your most common stuff here to keep it handy.
+This folder contains initial fixture data as well as a minimal django app
+called *website* along with some templates and some other things I almost
+always include in my projects, which you can copy into your project folder
+to use it as a quick way to test basic things. Add your most common stuff
+here to keep it handy.
 
 First deployment
 ================
 
-Your development will take you or your team minutes, hours, days, years, but sooner or later the first deployment time comes. Again, django-nbskel made your life easier because all your files are ready. So, once you have been put your whole project in the path you specified in the ``PROJECT_PATH`` folder, move to the ``conf`` folder and execute all the commands listed in the ``first_deploy`` file. If everything went right, reload apache and nginx and go to the URL specified in the ``DOMAIN`` setting and your site will be up and running!
+Your development will take you or your team minutes, hours, days, years, but
+sooner or later the first deployment time comes. Again, django-nbskel made
+your life easier because all your files are ready. So, once you have been put
+your whole project in the path you specified in the ``PROJECT_PATH`` folder,
+move to the ``conf`` folder and execute all the commands listed in the
+``first_deploy`` file. If everything went right, reload apache and nginx and
+go to the URL specified in the ``DOMAIN`` setting and your site will be up
+and running!
+

File nbskel/settings_conf/__init__.py

Empty file removed.

File nbskel/settings_conf/localsettings.py

-import os
-from prj_settings import *
-
-# Flags that enable/disable other settings
-DEBUG = True
-USE_LOCALIZATION = False
-
-# Database
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': os.path.join(os.path.dirname(__file__), '..', 'dev.db'),
-    }
-}
-
-# Template settings
-TEMPLATE_DEBUG = DEBUG
-TEMPLATE_DIRS = (
-    os.path.join(os.path.dirname(__file__), '..', 'templates'),
-)
-
-# Debug Toolbar
-INTERNAL_IPS = ('127.0.0.1')
-INSTALLED_APPS = INSTALLED_APPS + ('debug_toolbar',)
-MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + \
-    ('debug_toolbar.middleware.DebugToolbarMiddleware',)
-DEBUG_TOOLBAR_CONFIG = {
-    'INTERCEPT_REDIRECTS': False,
-}
-
-# Localization
-if USE_LOCALIZATION:
-    ugettext = lambda s: s
-    # Replace with your languages
-    LANGUAGES = (
-        ('en', ugettext('English')),
-        ('ca', ugettext('Catalan')),
-        ('es', ugettext('Spanish')),
-    )
-    MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + \
-        ('django.middleware.locale.LocaleMiddleware',)
-

File nbskel/settings_conf/prj_settings.py

-# Overriding project-scope settings.
-# Add, change or remove yours.
-
-import os
-from settings import *
-
-TIME_ZONE = 'Europe/Madrid'
-MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media')
-MEDIA_URL = '/media/'
-ADMIN_MEDIA_PREFIX = '/media/admin/'
-