xenith / django-base-template Goto Github PK
View Code? Open in Web Editor NEWA Django 1.8 base template with HTML5Boilerplate and Twitter Bootstrap
License: BSD 3-Clause "New" or "Revised" License
A Django 1.8 base template with HTML5Boilerplate and Twitter Bootstrap
License: BSD 3-Clause "New" or "Revised" License
Hey Xenith!
Love the project, use it all the time.
I've run into this issue a few times now, thought maybe it could be mentioned in the docs. When running the server with Gunicorn in Debug mode, there will be an error about the URLs not working:
ImproperlyConfigured: The included urlconf projectname.urls doesn't have any patterns in it
This can be fixed by setting
DEBUG_TOOLBAR_PATCH_SETTINGS = False
This is isn't something I would have thought of on my own, fortunately there is a well-voted StackOverflow post with the answer.
Not sure what you want to do about this, but figured I'd bring it up.
Tx!
R
The get_env_setting example from settings/base.py means that anyone following the "How to use" will hit an error unless they also edit base.py or set SECRET_KEY in their environment.
Maybe a short mention of this in the "How to use" section? Also needed to change line 17 to: "return os.environ.get(setting)" to get it working.
I don't know if anyone has got this going on Heroku but i can't get passed this error message:
2015-12-01T11:00:29.615984+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2015-12-01T11:00:29.615985+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
2015-12-01T11:00:29.615987+00:00 app[web.1]: self._wrapped = Settings(settings_module)
2015-12-01T11:00:29.615985+00:00 app[web.1]: self._setup(name)
2015-12-01T11:00:29.615986+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
2015-12-01T11:00:29.615988+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
2015-12-01T11:00:29.615989+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
2015-12-01T11:00:29.615990+00:00 app[web.1]: __import__(name)
2015-12-01T11:00:29.615990+00:00 app[web.1]: File "/app/basic/settings/__init__.py", line 6, in <module>
2015-12-01T11:00:29.616059+00:00 app[web.1]: Traceback (most recent call last):
2015-12-01T11:00:29.615988+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE)
2015-12-01T11:00:29.615991+00:00 app[web.1]: from .local import *
2015-12-01T11:00:29.616060+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
2015-12-01T11:00:29.616066+00:00 app[web.1]: self.callable = self.load()
2015-12-01T11:00:29.615996+00:00 app[web.1]: ImportError: No module named local
2015-12-01T11:00:29.616079+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
2015-12-01T11:00:29.616057+00:00 app[web.1]: [2015-12-01 11:00:29 +0000] [10] [ERROR] Exception in worker process:
2015-12-01T11:00:29.616062+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
2015-12-01T11:00:29.616068+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2015-12-01T11:00:29.616080+00:00 app[web.1]: django.setup()
2015-12-01T11:00:29.616080+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/__init__.py", line 17, in setup
2015-12-01T11:00:29.616082+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
2015-12-01T11:00:29.616070+00:00 app[web.1]: __import__(module)
2015-12-01T11:00:29.616061+00:00 app[web.1]: worker.init_process()
2015-12-01T11:00:29.616064+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2015-12-01T11:00:29.616065+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2015-12-01T11:00:29.616069+00:00 app[web.1]: return util.import_app(self.app_uri)
2015-12-01T11:00:29.616088+00:00 app[web.1]: from .local import *
2015-12-01T11:00:29.616089+00:00 app[web.1]: Traceback (most recent call last):
2015-12-01T11:00:29.616063+00:00 app[web.1]: self.load_wsgi()
2015-12-01T11:00:29.616063+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
2015-12-01T11:00:29.616067+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2015-12-01T11:00:29.616078+00:00 app[web.1]: application = get_wsgi_application()
2015-12-01T11:00:29.616067+00:00 app[web.1]: return self.load_wsgiapp()
2015-12-01T11:00:29.616089+00:00 app[web.1]: ImportError: No module named local
2015-12-01T11:00:29.616091+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
2015-12-01T11:00:29.616070+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
2015-12-01T11:00:29.616081+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2015-12-01T11:00:29.616083+00:00 app[web.1]: self._wrapped = Settings(settings_module)
2015-12-01T11:00:29.616085+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE)
2015-12-01T11:00:29.616086+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
2015-12-01T11:00:29.616087+00:00 app[web.1]: __import__(name)
2015-12-01T11:00:29.616077+00:00 app[web.1]: File "/app/basic/heroku_wsgi.py", line 16, in <module>
2015-12-01T11:00:29.616082+00:00 app[web.1]: self._setup(name)
2015-12-01T11:00:29.616090+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
2015-12-01T11:00:29.616090+00:00 app[web.1]: worker.init_process()
2015-12-01T11:00:29.616093+00:00 app[web.1]: self.load_wsgi()
2015-12-01T11:00:29.616096+00:00 app[web.1]: self.callable = self.load()
2015-12-01T11:00:29.616083+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
2015-12-01T11:00:29.616087+00:00 app[web.1]: File "/app/basic/settings/__init__.py", line 6, in <module>
2015-12-01T11:00:29.616098+00:00 app[web.1]: return util.import_app(self.app_uri)
2015-12-01T11:00:29.616104+00:00 app[web.1]: __import__(module)
2015-12-01T11:00:29.616084+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
2015-12-01T11:00:29.616095+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2015-12-01T11:00:29.616097+00:00 app[web.1]: return self.load_wsgiapp()
2015-12-01T11:00:29.616094+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
2015-12-01T11:00:29.616094+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2015-12-01T11:00:29.616096+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2015-12-01T11:00:29.616108+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
2015-12-01T11:00:29.616111+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
2015-12-01T11:00:29.616113+00:00 app[web.1]: File "/app/basic/settings/__init__.py", line 6, in <module>
2015-12-01T11:00:29.616111+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE)
2015-12-01T11:00:29.616112+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
2015-12-01T11:00:29.616118+00:00 app[web.1]: ImportError: No module named local
2015-12-01T11:00:29.616114+00:00 app[web.1]: from .local import *
2015-12-01T11:00:29.639425+00:00 app[web.1]: Traceback (most recent call last):
2015-12-01T11:00:29.639429+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2015-12-01T11:00:29.616103+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
2015-12-01T11:00:29.616098+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2015-12-01T11:00:29.616104+00:00 app[web.1]: File "/app/basic/heroku_wsgi.py", line 16, in <module>
2015-12-01T11:00:29.616105+00:00 app[web.1]: application = get_wsgi_application()
2015-12-01T11:00:29.616107+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/__init__.py", line 17, in setup
2015-12-01T11:00:29.616109+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
2015-12-01T11:00:29.616105+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
2015-12-01T11:00:29.616106+00:00 app[web.1]: django.setup()
2015-12-01T11:00:29.616108+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2015-12-01T11:00:29.616109+00:00 app[web.1]: self._setup(name)
2015-12-01T11:00:29.616110+00:00 app[web.1]: self._wrapped = Settings(settings_module)
2015-12-01T11:00:29.616113+00:00 app[web.1]: __import__(name)
2015-12-01T11:00:29.639434+00:00 app[web.1]: sys.exit(run())
2015-12-01T11:00:29.639597+00:00 app[web.1]: Arbiter(self).run()
2015-12-01T11:00:29.639703+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 302, in halt
2015-12-01T11:00:29.639898+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 464, in reap_workers
2015-12-01T11:00:29.639491+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 192, in run
2015-12-01T11:00:29.639771+00:00 app[web.1]: self.stop()
2015-12-01T11:00:29.639774+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 347, in stop
2015-12-01T11:00:29.640028+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2015-12-01T11:00:29.639545+00:00 app[web.1]: super(Application, self).run()
2015-12-01T11:00:29.639626+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 206, in run
2015-12-01T11:00:29.639895+00:00 app[web.1]: self.reap_workers()
2015-12-01T11:00:29.639842+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 219, in handle_chld
2015-12-01T11:00:29.616119+00:00 app[web.1]: [2015-12-01 11:00:29 +0000] [9] [INFO] Worker exiting (pid: 9)
2015-12-01T11:00:29.616215+00:00 app[web.1]: [2015-12-01 11:00:29 +0000] [10] [INFO] Worker exiting (pid: 10)
2015-12-01T11:00:29.639435+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2015-12-01T11:00:29.639699+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2015-12-01T11:00:29.639469+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2015-12-01T11:00:29.639548+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
2015-12-01T11:00:29.639839+00:00 app[web.1]: time.sleep(0.1)
2015-12-01T11:00:29.639977+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2015-12-01T11:00:30.334116+00:00 heroku[web.1]: State changed from starting to crashed
2015-12-01T11:00:30.332471+00:00 heroku[web.1]: Process exited with status 1
I have the following error message:
ImproperlyConfigured: Error importing middleware commonware.middleware: "cannot import name HidePasswordOnException"
I found it was an error with playdoh-libs
this error was corrected on the pull #12 of playdoh-lib. I just patch the exception/middleware.py
file with the file corrected.
Is there any non-temporal solution to this problem?
I couldn't find where is the reference to this libraries.
When running the command "pip install -r requirements/local.txt" , i got the following error - 'No package 'libffi' found'. I think it's due to the bcrypt.
Hello,
I am a user of the project. I was wondering if anyone has written a blog post or tutorial on how to deploy projects using the files included in the conf and bin folders. I have an idea on how to do it, but I would like to see an example from someone who really knows what they are doing.
Awesome project by the way! Congrats!
Whats the motivations to ignore */settings/local.py
in .gitignore if in settings/__init__.py
, local.py
are imported?
README.md denotes south for database migrations, yet it is not listed in the requirements files nor settings.
Is D-B-T 1.8 ready yet? This is my favorite template.
Hi,
In production server, i set DEV=False and debug=False than my IP added to allowed_hosts. but its getting server error 500. Now how can i fix the issue.whats wrong with my settings , But in development mode everything works fine
Probably being a little pedantic, but you should add a line to the setup instructions about copying projectname/settings/local-dist.py
to projectname/settings/local.py
, otherwise you'll immediately get
ImportError: Could not import settings 'projectname.settings' (Is it on sys.path?): No module named local (did you rename settings/local-dist.py?)
when you try to do a runserver.
Octal values have to start with 0o or 0O in python 3.
FILE_UPLOAD_PERMISSIONS = 0o0664
will you support python 3? django has support for it
cTraceback (most recent call last):
File "manage.py", line 11, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 453, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
import(name)
File "/usr/local/lib/python2.7/dist-packages/south/management/commands/init.py", line 10, in
import django.template.loaders.app_directories
File "/usr/local/lib/python2.7/dist-packages/django/template/loaders/app_directories.py", line 25, in
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError commonware.response.cookies: No module named commonware.response.cookies
Do you plan to support Django 1.7?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.