Coder Social home page Coder Social logo

mimischi / django-docker Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 4.0 236 KB

Toy project. Trying to use Django inside a Docker container for both local development and production deployment.

Shell 3.46% Python 83.93% HTML 0.08% Makefile 3.70% Dockerfile 8.84%
python3 django docker dokku alpine travis-ci sentry django-docker

django-docker's People

Contributors

chgad avatar dependabot[bot] avatar mimischi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

django-docker's Issues

Cookiecutter Template

Wouldn't it be greate to have this project as cookiecutter template?

With this one can avoid the trouble of cloneing and carrying all the previous commits and also avoid renaming stuff.

Travis

Is there a reason why #3 isn't merged yet ?

Fresh run : django.db.utils.ProgrammingError: relation "main_visits" does not exist error

Got the following error fresh from baking. Am I missing something?

django.db.utils.ProgrammingError
django.db.utils.ProgrammingError: relation "main_visits" does not exist
LINE 1: ...CT "main_visits"."id", "main_visits"."count" FROM "main_visi...
                                                             ^

Trace:

web_1  | 10.0.2.2 - - [24/Feb/2018 04:52:44] "GET / HTTP/1.1" 500 -
web_1  | Traceback (most recent call last):
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/contrib/staticfiles/handlers.py", line 66, in __call__
web_1  |     return self.application(environ, start_response)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 146, in __call__
web_1  |     response = self.get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 81, in get_response
web_1  |     response = self._middleware_chain(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
web_1  |     response = response_for_exception(request, exc)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
web_1  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
web_1  |     return debug.technical_500_response(request, *exc_info)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
web_1  |     six.reraise(exc_type, exc_value, tb)
web_1  |   File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
web_1  |     raise value
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
web_1  |     response = get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
web_1  |     response = self.get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
web_1  |     response = response_for_exception(request, exc)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
web_1  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
web_1  |     return debug.technical_500_response(request, *exc_info)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
web_1  |     six.reraise(exc_type, exc_value, tb)
web_1  |   File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
web_1  |     raise value
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
web_1  |     response = get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
web_1  |     response = self.get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
web_1  |     response = response_for_exception(request, exc)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
web_1  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
web_1  |     return debug.technical_500_response(request, *exc_info)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
web_1  |     six.reraise(exc_type, exc_value, tb)
web_1  |   File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
web_1  |     raise value
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
web_1  |     response = get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
web_1  |     response = self.get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
web_1  |     response = response_for_exception(request, exc)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
web_1  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
web_1  |     return debug.technical_500_response(request, *exc_info)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
web_1  |     six.reraise(exc_type, exc_value, tb)
web_1  |   File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
web_1  |     raise value
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
web_1  |     response = get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
web_1  |     response = self.get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
web_1  |     response = response_for_exception(request, exc)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
web_1  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
web_1  |     return debug.technical_500_response(request, *exc_info)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
web_1  |     six.reraise(exc_type, exc_value, tb)
web_1  |   File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
web_1  |     raise value
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
web_1  |     response = get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
web_1  |     response = self.get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
web_1  |     response = response_for_exception(request, exc)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
web_1  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
web_1  |     return debug.technical_500_response(request, *exc_info)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
web_1  |     six.reraise(exc_type, exc_value, tb)
web_1  |   File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
web_1  |     raise value
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
web_1  |     response = get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
web_1  |     response = self.get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
web_1  |     response = response_for_exception(request, exc)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
web_1  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
web_1  |     return debug.technical_500_response(request, *exc_info)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
web_1  |     six.reraise(exc_type, exc_value, tb)
web_1  |   File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
web_1  |     raise value
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
web_1  |     response = get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/utils/deprecation.py", line 95, in __call__
web_1  |     response = self.get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 37, in inner
web_1  |     response = response_for_exception(request, exc)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 87, in response_for_exception
web_1  |     response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 122, in handle_uncaught_exception
web_1  |     return debug.technical_500_response(request, *exc_info)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django_extensions/management/technical_response.py", line 6, in null_technical_500_response
web_1  |     six.reraise(exc_type, exc_value, tb)
web_1  |   File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
web_1  |     raise value
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
web_1  |     response = get_response(request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response
web_1  |     response = self.process_exception_by_middleware(e, request)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
web_1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
web_1  |   File "/app/main/views.py", line 11, in home
web_1  |     c = Visits.objects.get(pk=1)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
web_1  |     return getattr(self.get_queryset(), name)(*args, **kwargs)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 397, in get
web_1  |     num = len(clone)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 254, in __len__
web_1  |     self._fetch_all()
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 1179, in _fetch_all
web_1  |     self._result_cache = list(self._iterable_class(self))
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 53, in __iter__
web_1  |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1064, in execute_sql
web_1  |     cursor.execute(sql, params)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 100, in execute
web_1  |     return super().execute(sql, params)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute
web_1  |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
web_1  |     return executor(sql, params, many, context)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
web_1  |     return self.cursor.execute(sql, params)
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
web_1  |     raise dj_exc_value.with_traceback(traceback) from exc_value
web_1  |   File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
web_1  |     return self.cursor.execute(sql, params)
web_1  | django.db.utils.ProgrammingError: relation "main_visits" does not exist
web_1  | LINE 1: ...CT "main_visits"."id", "main_visits"."count" FROM "main_visi...
web_1  |              

pg_isready not found

When starting the local docker container via docker-compose up we get the error

/entrypoint.sh: 4: /entrypoint.sh: pg_isready: not found

This can be fixed with using the scripts as shown here and here

Run django Tests predeploy

It might be usefull to run project tests, if provided, in the predeploy state and if any of them fails reject the changes. This should only be used for detecting wether there are failing tests or not. So we should keep it simple just, eventually echo the number of failed, and stop the deploy when not passing all tests.

I know that nowadays there are services like Travis CI which do that for you, even Github integrated, but why not double check it ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.