Giter VIP home page Giter VIP logo

django-base-template's Introduction

Django4 / Django3 / Django2.2+ / Django1.11 complete installer

About

This template installs a fully functional Django website in just a few minutes.

Django 1.11 (for python2.7) Django 2+ (python3) includes bootstrap3, Allauth, and some other useful apps. These are easy to remove if you dont need it.

The goal of this template is to set up a fully functional django project in minutes, and have a clear project structure.

src                   # project root  
├── manage.py
├── /static
├── /config           # project configuration 
│   ├── /settings   
│   │   ├── base.py   # project settings   
│   │   ├── local.py  # local settings (development)
│   ├── urls.py        
│   ├── wsgi.py
├── /layout           # base templates and static files  
│   ├── models.py
│   ├── /staticu
    ... 

Quick Install

first create a virtenv, activate. Then,

source <(wget -qO- https://raw.githubusercontent.com/Alex-CodeLab/django-base-template/master/install.sh)

(if nothing happens when running above command, you should probably update ssl certs: sudo update-ca-certificates --fresh && export SSL_CERT_DIR=/etc/ssl/certs )

Step by step Installation

  • (when using python3) Make sure you have libevent-dev, python3-dev installed :
$ sudo apt-get install libevent-dev python3-dev
  • Install if not installed already :
$ sudo apt-get install build-essential libssl-dev libffi-dev python-dev libtiff5-dev libjpeg8-dev libffi-dev
  • Create your working environment and virtualenv:
$ virtualenv project
$ virtualenv -p python3 project  # for python3/django2
$ cd project
$ source bin/activate
  • run install.sh :
$ source <(wget -qO- https://raw.githubusercontent.com/Alex-CodeLab/django-base-template/master/install.sh)

...and that's all!

Features

By default, this project template includes:

A set of basic templates and Twitter Bootstrap 3.3.5 (located in the base app, with css and javascript included).

Templating:

  • django_compressor for compressing javascript/css/less/sass

Authentication, registration

  • allauth (+ base-template)

Security:

  • bleach
  • bcrypt - uses bcrypt for password hashing by default

Background Tasks:

  • Celery

Caching:

  • python-memcached

Admin:

  • Includes django-debug-toolbar for development and production (enabled for superusers)

Testing:

  • nose and django-nose
  • pylint, pep8, and coverage

Any of these options can added, modified, or removed as you like after creating your project.

Python 3 compatability

  • use python3-memcached instead of python-memcached

Prerequisites

  • Python 2.7 or 3.*
  • pip
  • virtualenv (virtualenvwrapper is recommended for use during development)

License

This software is licensed under the New BSD License.

django-base-template's People

Contributors

alex-codelab avatar eshar avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-base-template's Issues

the changes dont load in firts time

Hey. When you change a html file this dont update. You need stop the server and run again for show it.
SOLVED:

DEBUG: True --- in development

install error

hello,

I tried to install this and got this error

(gaming) jcasanova@casanova-master:~/Desktop/git_test/gaming_django/gaming/src$ ./manage.py runserver
Performing system checks...

Unhandled exception in thread started by <function check_errors..wrapper at 0x7fc80a5986a8>
Traceback (most recent call last):
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(_args, *_kwargs)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run
self.check(display_num_errors=True)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/core/management/base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/core/management/base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/core/checks/urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/urls/resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/src/mainapp/urls.py", line 22, in
url(r'', include('base.urls')),
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/site-packages/django/conf/urls/init.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "/home/jcasanova/Desktop/git_test/gaming_django/gaming/src/base/urls.py", line 4, in
from views import home
ImportError: No module named 'views'

error installing

Traceback (most recent call last):
File "./manage.py", line 11, in
execute_from_command_line(sys.argv)
File "/home/aj/project/local/lib/python3.7/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/home/aj/project/local/lib/python3.7/site-packages/django/core/management/init.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/aj/project/local/lib/python3.7/site-packages/django/core/management/base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/aj/project/local/lib/python3.7/site-packages/django/core/management/base.py", line 366, in execute
self.check()
File "/home/aj/project/local/lib/python3.7/site-packages/django/core/management/base.py", line 395, in check
include_deployment_checks=include_deployment_checks,
File "/home/aj/project/local/lib/python3.7/site-packages/django/core/management/base.py", line 382, in _run_checks
return checks.run_checks(**kwargs)
File "/home/aj/project/local/lib/python3.7/site-packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/aj/project/local/lib/python3.7/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/home/aj/project/local/lib/python3.7/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/home/aj/project/local/lib/python3.7/site-packages/django/urls/resolvers.py", line 407, in check
for pattern in self.url_patterns:
File "/home/aj/project/local/lib/python3.7/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/aj/project/local/lib/python3.7/site-packages/django/urls/resolvers.py", line 588, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/aj/project/local/lib/python3.7/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/aj/project/local/lib/python3.7/site-packages/django/urls/resolvers.py", line 581, in urlconf_module
return import_module(self.urlconf_name)
File "/home/aj/project/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/aj/project/src/config/urls.py", line 5, in
from layout.views import profile
File "/home/aj/project/src/layout/views.py", line 3, in
from django.shortcuts import render, render_to_response, HttpResponseRedirect
ImportError: cannot import name 'render_to_response' from 'django.shortcuts' (/home/aj/project/local/lib/python3.7/site-packages/django/shortcuts.py)

error "DebugToolbarMiddleware is missing" on centos7

I installed all the packages, and python34, and it failed, could you please help on it?

Thanks.

**wrapt-1.10.11
Install completed. Create Database
SystemCheckError: System check identified some issues:

ERRORS:
?: debug_toolbar.middleware.DebugToolbarMiddleware is missing from MIDDLEWARE.
HINT: Add debug_toolbar.middleware.DebugToolbarMiddleware to MIDDLEWARE.**

Problem with installing rjsmin and rcssmin

I followed your installation guide:

Collecting lazy-object-proxy (from astroid<2.0,>=1.6->pylint->-r requirements/local.txt (line 19))
  Using cached https://files.pythonhosted.org/packages/65/1f/2043ec33066e779905ed7e6580384425fdc7dc2ac64d6931060c75b0c5a3/lazy_object_proxy-1.3.1-cp36-cp36m-manylinux1_x86_64.whl
Building wheels for collected packages: rjsmin, rcssmin
  Running setup.py bdist_wheel for rjsmin ... error
  Complete output from command /home/username/Documents/sideprojects/.venv/demo/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-og0r07l4/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-dcve_2us --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  copying ./rjsmin.py -> build/lib.linux-x86_64-3.6
  running build_ext
  building '_rjsmin' extension
  creating build/temp.linux-x86_64-3.6
  gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o
  gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for rjsmin
  Running setup.py clean for rjsmin
  Running setup.py bdist_wheel for rcssmin ... error
  Complete output from command /home/username/Documents/sideprojects/.venv/demo/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-og0r07l4/rcssmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-_qbkmpd_ --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  copying ./rcssmin.py -> build/lib.linux-x86_64-3.6
  running build_ext
  building '_rcssmin' extension
  creating build/temp.linux-x86_64-3.6
  gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DEXT_MODULE=_rcssmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -c rcssmin.c -o build/temp.linux-x86_64-3.6/rcssmin.o
  gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for rcssmin
  Running setup.py clean for rcssmin
Failed to build rjsmin rcssmin
Installing collected packages: rjsmin, rcssmin, django-compressor, webencodings, six, html5lib, bleach, python-memcached, sqlparse, django-debug-toolbar, oauthlib, chardet, certifi, urllib3, idna, requests, requests-oauthlib, defusedxml, python3-openid, django-allauth, Pillow, billiard, django-extensions, pycparser, cffi, bcrypt, invoke, pyasn1, pynacl, asn1crypto, cryptography, paramiko, Fabric, MarkupSafe, Jinja2, Pygments, alabaster, sphinxcontrib-websupport, docutils, snowballstemmer, babel, pyparsing, packaging, imagesize, Sphinx, nose, pbr, mock, django-nose, coverage, pep8, pyflakes, isort, mccabe, wrapt, lazy-object-proxy, astroid, pylint
  Running setup.py install for rjsmin ... error
    Complete output from command /home/username/Documents/sideprojects/.venv/demo/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-og0r07l4/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-hbwge76l/install-record.txt --single-version-externally-managed --compile --install-headers /home/username/Documents/sideprojects/.venv/demo/include/site/python3.6/rjsmin:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    copying ./rjsmin.py -> build/lib.linux-x86_64-3.6
    running build_ext
    building '_rjsmin' extension
    creating build/temp.linux-x86_64-3.6
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o
    gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/home/username/Documents/sideprojects/.venv/demo/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-og0r07l4/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-hbwge76l/install-record.txt --single-version-externally-managed --compile --install-headers /home/username/Documents/sideprojects/.venv/demo/include/site/python3.6/rjsmin" failed with error code 1 in /tmp/pip-install-og0r07l4/rjsmin/

Some believe that it might have been a python3.6 version dependency to the rjsmin and rcssmin and is only compatible with python3.6-dev but I'm not certain. I'm using a virtualenv -p python3 while my host is on python2.7 (I might consider upgrading in the near future).

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.