All Projects → lincolnloop → Django Layout

lincolnloop / Django Layout

Django project template layout

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Django Layout

Tacticalrmm
A remote monitoring & management tool, built with Django, Vue and Go.
Stars: ✭ 231 (-7.6%)
Mutual labels:  django
Fosswebsite
A club management system that handles student details, progress, events, achievements, attendance, status updates, teams and workshop registrations. This is the official [email protected] website
Stars: ✭ 242 (-3.2%)
Mutual labels:  django
Django Bootstrap Modal Forms
A Django plugin for creating AJAX driven forms in Bootstrap modal.
Stars: ✭ 244 (-2.4%)
Mutual labels:  django
Relate
RELATE is an Environment for Learning And TEaching
Stars: ✭ 239 (-4.4%)
Mutual labels:  django
Django Salesforce
Salesforce integration for Django's ORM using the SF REST API.
Stars: ✭ 241 (-3.6%)
Mutual labels:  django
Django Rest Registration
User-related REST API based on the awesome Django REST Framework
Stars: ✭ 240 (-4%)
Mutual labels:  django
Django Dynamic Preferences
Dynamic global and instance settings for your django project
Stars: ✭ 238 (-4.8%)
Mutual labels:  django
Django Flat Responsive
📱 An extension for Django admin that makes interface mobile-friendly. Merged into Django 2.0
Stars: ✭ 249 (-0.4%)
Mutual labels:  django
Django Rest Framework Datatables
Seamless integration between Django REST framework and Datatables.
Stars: ✭ 241 (-3.6%)
Mutual labels:  django
Django Micro
Django as a microframework
Stars: ✭ 245 (-2%)
Mutual labels:  django
Pyinstrument
🚴 Call stack profiler for Python. Shows you why your code is slow!
Stars: ✭ 3,870 (+1448%)
Mutual labels:  django
Django Vuejs Tutorial
A tutorial to integrate Vue.js with django
Stars: ✭ 242 (-3.2%)
Mutual labels:  django
Cancan
cancan is a tiny permission controller base on ruby cancan library.
Stars: ✭ 244 (-2.4%)
Mutual labels:  django
Chain
链喵 CMDB 本项目已停止开发!因长时间未对代码进行维护,可能会造成项目在不同环境上无法部署、运行BUG等问题,请知晓!项目仅供参考!
Stars: ✭ 240 (-4%)
Mutual labels:  django
Tweetme 2
Build a twitter-like app in Django, Bootstrap, Javascript, & React.js. Step-by-Step.
Stars: ✭ 247 (-1.2%)
Mutual labels:  django
Django Colorfield
color field for django models with a nice color-picker in the admin. 🎨
Stars: ✭ 238 (-4.8%)
Mutual labels:  django
Hackide
hackIDE is an online code editor, compiler and interpreter based on Django, powered by HackerEarth API! Go, hack it!
Stars: ✭ 242 (-3.2%)
Mutual labels:  django
Fabricio
Docker deploy automation tool
Stars: ✭ 250 (+0%)
Mutual labels:  django
Ecommerce website development
本项目基于Django1.8.2等来开发一个电商平台,可实现注册、登录、浏览、购买、支付等全部常用功能。
Stars: ✭ 246 (-1.6%)
Mutual labels:  django
Sh00t
Security Testing is not as simple as right click > Scan. It's messy, a tough game. What if you had missed to test just that one thing and had to regret later? Sh00t is a highly customizable, intelligent platform that understands the life of bug hunters and emphasizes on manual security testing.
Stars: ✭ 245 (-2%)
Mutual labels:  django

{% comment %}

=============== Django Layout

django-layout provides sane defaults for new Django projects based on established best practices <http://lincolnloop.com/django-best-practices/>__ and some configuration setups frequently used in Lincoln Loop's projects, like using pip-tools for dependency locking <https://lincolnloop.com/blog/python-dependency-locking-pip-tools/>, using setup.py <https://lincolnloop.com/blog/using-setuppy-your-django-project/> and making manage.py a console script <https://lincolnloop.com/blog/goodbye-managepy/>__.

To use django-layout:

  1. follow the steps for Python instalation from the Pre-Requisites_ section;

  2. create and activate a virtualenv::

    python3.9 -m venv .venv . .venv/bin/activate

  3. install Django with :code:pip install django or :code:pip install Django==3.2b1 if you want the latest version;

  4. run the following command::

    django-admin.py startproject --template=https://github.com/lincolnloop/django-layout/zipball/master --extension=py,rst,gitignore,cfg,in,yml,json,dockerignore --name=Makefile,Dockerfile {{ project_name }}

Postgres

If you want to use Postgres database, you can

  • go to the generated project folder,
  • uncomment the lines preceded by :code:# Postgres in
    • :code:requirements/requirements.in
    • :code:docker-compose.yml
    • :code:{{ project_name }}/config.py
  • replace :code:{{ project_name }} with the project name you chose.

Another alternative is to

  • download this repository to your local machine,

  • uncomment the lines preceded by :code:# Postgres in

    • :code:requirements/requirements.in
    • :code:docker-compose.yml
    • :code:{{ project_name }}/config.py
  • run the command with the appropriate path to the :code:django-layout folder::

    django-admin.py startproject --template=<PATH_TO>/django-layout --extension=py,rst,gitignore,cfg,in,yml,json,dockerignore --name=Makefile,Dockerfile {{ project_name }}

.. note:: The text following this comment block will become the README.rst of the new project.


{% endcomment %}

====================== {{ project_name }}

Docker Installation

Build and run the project::

docker-compose build
docker-compose up

To run Django commands like migrations and shell or to enter the container bash do::

docker-compose run --rm app bash
docker-compose run --rm app manage.py createsuperuser
docker-compose run --rm app manage.py migrate
docker-compose run --rm app manage.py shell

To stop containers run::

docker-compose down

To update a container after adding a new requirement for example::

docker-compose build app
docker-compose build client

Local Installation

Pre-Requisites

Python3.9

To install all of the system dependencies on a Debian-based system, run::

sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9 python3.9-venv python3.9-dev

Creating the Virtual Environment

First, create a clean base environment using virtualenv::

make .venv/bin/activate
. .venv/bin/activate

Installing the Project

Compile requirements to make sure you have all the latests dependencies::

make upgrade-pip
make requirements.txt
make requirements/dev.txt

Install the requirements and the project source::

make install
make install-dev

Configuring a Local Environment

If you're just checking the project out locally, you can generate the configuration file with already filled default values::

make {{ project_name }}.yml

This will create the :code:{{ project_name }}.yml file where you can customize the variables used in project settings.

Optional: Configuring Postgres

If you want to use Postgres for the database, install it according to your OS requirements.

To configure the database enter PSQL shell and create the database and user::

$ sudo -u postgres psql
postgres=# create database {{ project_name }};
postgres=# create user {{ project_name }};
postgres=# alter role dataplatform SUPERUSER;
postgres=# alter role dataplatform with password '{{ project_name }}';

Replace :code:{{ project_name }} with whatever values you want for database, user and password.

Change the value of :code:DATABASE_URL in :code:{{ project_name }}.yml::

DATABASE_URL: postgres://{{ project_name }}:{{ project_name }}@localhost:5432/{{ project_name }}

Replace the appropriate credentials if necessary.

Running the project

Docker

Run migrations::

docker-compose run --rm app manage.py migrate

Create super user::

docker-compose run --rm app manage.py createsuperuser

Make sure you have the containers running::

docker-compose up

Access localhost:8000/admin <localhost:8000/admin>_.

Local

Run migrations::

manage.py migrate

Create super user::

manage.py createsuperuser

Run the server::

manage.py runserver

Access localhost:8000/admin <localhost:8000/admin>_.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].