Simplifying the import structure of Django.
The full documentation is at https://dj-ango.readthedocs.org.
Install dj-ango:
pip install dj-ango
Then use it in a project:
from ango import settings, TemplateView, url
class AboutView(TemplateView):
template_name = "about.html"
def get_context_data(self, **kwargs):
context = super(AboutView, self).get_context_data(**kwargs)
context['is_debug_mode'] = settings.DEBUG
return context
urlpatterns = [
url(
regex=r'^about/$',
view=AboutView.as_view(),
name='about'
)
]Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install -r requirements-text.txt (myenv) $ python runtests.py
Tools used in creating this package: