Django starter project with ๐Ÿ”‹

Overview

A batteries-included Django starter project. For a production-ready version see the book Django for Professionals.

๐Ÿš€ Features

Homepage

Table of Contents


๐Ÿ“– Installation

DjangoX can be installed via Pip, Pipenv, or Docker depending upon your setup. To start, clone the repo to your local computer and change into the proper directory.

$ git clone https://github.com/wsvincent/djangox.git
$ cd djangox

Pip

$ python3 -m venv djangox
$ source djangox/bin/activate
(djangox) $ pip install -r requirements.txt
(djangox) $ python manage.py migrate
(djangox) $ python manage.py createsuperuser
(djangox) $ python manage.py runserver
# Load the site at http://127.0.0.1:8000

Pipenv

$ pipenv install
$ pipenv shell
(djangox) $ python manage.py migrate
(djangox) $ python manage.py createsuperuser
(djangox) $ python manage.py runserver
# Load the site at http://127.0.0.1:8000

Docker

$ docker build .
$ docker-compose up -d
$ docker-compose exec web python manage.py migrate
$ docker-compose exec web python manage.py createsuperuser
# Load the site at http://127.0.0.1:8000

For Docker, the INTERNAL_IPS configuration in config/settings.py must be updated to the following:

# config/settings.py
# django-debug-toolbar
import socket
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS = [ip[:-1] + "1" for ip in ips]

Setup

# Run Migrations
(djangox) $ python manage.py migrate

# Create a Superuser
(djangox) $ python manage.py createsuperuser

# Confirm everything is working:
(djangox) $ python manage.py runserver

# Load the site at http://127.0.0.1:8000

๐Ÿค Contributing

Contributions, issues and feature requests are welcome! See CONTRIBUTING.md.

โญ๏ธ Support

Give a โญ๏ธ if this project helped you!

License

The MIT License

Comments
  • windows, docker web_1 | ModuleNotFoundError: No module named 'rest_framework'

    windows, docker web_1 | ModuleNotFoundError: No module named 'rest_framework'

    I'm trying to make an example at https://github.com/morenoh149/django-rest-datatables-relations-example

    I'm on windows trying to use docker. The base project works fine but now I want to add django-restframework. I edited requirements.txt and rebuild the project with docker-compose up -d --no-deps --build but that doesn't seem to install the latest requriements.

    I tried deleting pipfile.lock but cannot regenerate it on windows. Also the compose file seems to simply copy the Pipfile.lock into the docker container.

    error

    web_1 | File "/usr/local/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
    
    web_1 | res = instance.__dict__[self.name] = self.func(instance)
    
    web_1 | File "/usr/local/lib/python3.8/site-packages/django/urls/resolvers.py", line 582, in urlconf_module
    
    web_1 | return import_module(self.urlconf_name)
    
    web_1 | File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    
    web_1 | return _bootstrap._gcd_import(name[level:], package, level)
    
    web_1 | File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
    
    web_1 | File "<frozen importlib._bootstrap>", line 991, in _find_and_load
    
    web_1 | File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
    
    web_1 | File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
    
    web_1 | File "<frozen importlib._bootstrap_external>", line 783, in exec_module
    
    web_1 | File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    
    web_1 | File "/code/config/urls.py", line 5, in <module>
    
    web_1 | from rest_framework import routers
    
    web_1 | ModuleNotFoundError: No module named 'rest_framework'
    

    Any tips on how to get past this?

    opened by morenoh149 8
  • ValueError: Missing staticfiles manifest entry for 'images/favicon.ico'

    ValueError: Missing staticfiles manifest entry for 'images/favicon.ico'

    Django raises ValueError: Missing staticfiles manifest entry for 'some-static-file-path' when testing a django view before running

    python manage.py collectstatic
    

    As easy as it might be to fix this, a lot of people find this tough and uncomfortable to keep doing this for every new project. (After all the template is supposed to help fix these issues).

    I am willing to work on this myself.

    Just need to know if this is desired.

    Thank you.

    opened by Joetib 8
  • docker-compose for Postgresql

    docker-compose for Postgresql

    Installing and configuring Postgres on the system is a hassle for me, I like to use a containerized version for development... and I'd like to add it to this boilerplate... is that ok?

    opened by shahwan42 6
  • docker-compose.yml & Dockerfile cleanup.

    docker-compose.yml & Dockerfile cleanup.

    docker-compose already has the host current dir mapped to /code so there is no need for COPY . /code/ to copy the code into the dockerfile.

    WORKDIR /code is set in the dockerfile so docker-compose can just use ./manage.py to run the server.

    Changed the README.md to use docker-compose build vs docker build . as the build parameters are contained in the docker-compose.yml file.

    opened by FlynDice 5
  • Cannot import name 'python_2_unicode_compatible'

    Cannot import name 'python_2_unicode_compatible'

    Having tried to makemigrations users in different ways, I still get an ImportError:

    ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' (C:\Users\pyrro\.virtualenvs\djangox-wr5bj6HE\lib\site-packages\django\utils\encoding.py)

    I honestly don't understand why. I am using the correct versions.

    opened by Pyrross 4
  • issue with email signup

    issue with email signup

    @wsvincent

    user's username is set to the part of email before @. Because of this if someone signs up with email [email protected], they are assigned username john. If someone else tries to sign up with email [email protected], they get an error.

    opened by nigelfig 3
  • Docker installation still uses sqlite

    Docker installation still uses sqlite

    When following instructions setup with docker, it correctly creates postgres containers, but django still uses sqlite. Can we a) add note that you need to do it manually b) remove postgres from docker compose c) add instructions on how to add it ? I am happy to make a PR.

    opened by vlejd 2
  • Bump django from 3.1.4 to 3.1.10

    Bump django from 3.1.4 to 3.1.10

    Bumps django from 3.1.4 to 3.1.10.

    Commits
    • a2407cd [3.1.x] Bumped version for 3.1.10 release.
    • afb23f5 [3.1.x] Fixed #32713, Fixed CVE-2021-32052 -- Prevented newlines and tabs fro...
    • fdbf4a7 [3.1.x] Refs CVE-2021-31542 -- Skipped mock AWS storage test on Windows.
    • 48b39a8 [3.1.x] Added CVE-2021-31542 to security archive.
    • 8012441 [3.1.x] Post-release version bump.
    • 8284fd6 [3.1.x] Bumped version for 3.1.9 release.
    • 25d84d6 [3.1.x] Fixed CVE-2021-31542 -- Tightened path & file name sanitation in file...
    • 6b0c7e6 [3.1.x] Added CVE-2021-28658 to security archive.
    • 5b9ca81 [3.1.x] Post-release version bump.
    • c4928c9 [3.1.x] Bumped version for 3.1.8 release.
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 2
  • User Signup -- Password2 field

    User Signup -- Password2 field

    Shouldn't the signup form have email, password and a password2 field to ensure that the user didn't make a typo while entering their password? If they make that simple mistake and then they try to login, they will fail. And of they try to create a new account that will fail too because the email field will be taken.

    opened by eezis 2
  • Organizing to minimalistic

    Organizing to minimalistic

    What is this change?

    • I have tried to re-organize the file structure and code. The _base.html files contain css and js part, so I have to move them into a separate their own dedicated file. This will improve code visibility, structure & easier to read.

    What does it fix?

    • CSS and JS part inside of _base.html have now been under base/_base_css.html and base/_base_js.html respectively.
    • Create a base folder inside the template where _base.html, _base_css.html & _base_js.html resides.

    Is this a bug fix or a feature? Does it break any existing functionality or force me to update to a new version?

    • It's just re-organizing files.
    • It doesn't break code, only I have figured out the naming, path and static template tag.

    How has it been tested?

    • I have tested by running & visiting almost all templates where changes are reflected.

    Note- File naming convention I have adopted from your code (using underscore) and not this. Let me know your thought(all are welcomed).

    opened by ycv005 2
  • Signup Form is broken in a few ways (related to form validation?)

    Signup Form is broken in a few ways (related to form validation?)

    If a user attempts to register with an email that is already taken, the user is redirected to the signup page (which is now missing the email field). There isn't a message to indicate the error.

    I first noticed this problem because I was using two password fields. Essentially the same problem crops up if the passwords do not match - one of the password fields disappears and there are no error messages.

    A similar issue exists on the forgot password page. When entering an email that doesn't exists, the page reloads (with the email field now missing) and doesn't present an error message.

    I also noticed that the password reset fails in the same manner if the passwords don't match. It's somehow related to all POST requests concerning the user model.

    I've been digging for a few hours through the allauth code but I'm not having any luck getting to the source of the problem. I have my suspicions that it's due to something about the custom user but haven't had any luck yet.

    opened by mxnsbentonville 2
  • fix to psycopg version and docker directory

    fix to psycopg version and docker directory

    The directory in the docker file and docker-compose file were not matching, so when you run start-app, it didn't copy to the local folder. I updated the python env variable and psycopg version caused docker compose up to fail.

    opened by smitht06 0
  • Bump certifi from 2022.5.18.1 to 2022.12.7

    Bump certifi from 2022.5.18.1 to 2022.12.7

    Bumps certifi from 2022.5.18.1 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump django from 4.0.4 to 4.0.8

    Bump django from 4.0.4 to 4.0.8

    Bumps django from 4.0.4 to 4.0.8.

    Commits
    • 7d5cb49 [4.0.x] Bumped version for 4.0.8 release.
    • 23f0093 [4.0.x] Fixed CVE-2022-41323 -- Prevented locales being interpreted as regula...
    • 4a30e0d [4.0.x] Set date and added stub notes for 4.0.8 and 3.2.16 releases.
    • 898f0aa [4.0.x] Added CVE-2022-36359 to security archive.
    • 60e6bae [4.0.x] Post-release version bump.
    • e9e9729 [4.0.x] Bumped version for 4.0.7 release.
    • b7d9529 [4.0.x] Fixed CVE-2022-36359 -- Escaped filename in Content-Disposition header.
    • 2eb7ded [4.0.x] Adjusted version 4.0.7 release notes.
    • baeffe8 [4.0.x] Ignored 080359c4c5242ef69ac8c58c92f240e71121ffd7 formatting changes i...
    • 080359c [4.0.x] Fixed warnings per flake8 5.0.0.
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
William Vincent
Django Software Foundation Board Member. Founder of LearnDjango.com.
William Vincent
Django project/application starter for lazybones :)

Django Project Starter Template My custom project starter for Django! Iโ€™ll try to support every upcoming Django releases as much as I can! Requirement

UฤŸur ร–zyฤฑlmazel 40 Jul 16, 2022
Starter project for python based lambda project.

Serverless Python Starter Starter project for python based lambda project. Features FastAPI - Frontend dev with Hot Reload API Gateway Integration (+r

null 4 Feb 22, 2022
A Django starter template with a sound foundation.

SOS Django Template SOS Django Tempalate is a Django starter template that has opinionated and good solutions while starting your new Django project.

Eray Erdin 19 Oct 30, 2022
Launchr is an open source SaaS starter kit, based on Django.

Launchr Launchr is an open source SaaS starter kit. About Launchr is a fully-equipped starter template, ready to start a SaaS web app. It implements t

Jannis Gebauer 183 Jan 6, 2023
This is the starter for the Flask React project.

Flask React Project This is the starter for the Flask React project. Getting started Clone this repository (only this branch) git clone https://github

Jami Travers 5 May 25, 2022
The starter for the Flask React project

Flask React Project This is the starter for the Flask React project. Getting started Clone this repository (only this branch) git clone https://github

Parker Bolick 2 May 14, 2022
simple flask starter app utilizing docker

Simple flask starter app utilizing docker to showcase seasonal anime using jikanpy (myanimelist unofficial api).

Kennedy Ngugi Mwaura 5 Dec 15, 2021
A python starter package to be used as a template for creating your own python packages.

Python Starter Package This is a basic python starter package to be used as a template for creating your own python packages. Github repo: https://git

Mystic 1 Apr 4, 2022
The starter repository for submissions to the GeneDisco challenge for optimized experimental design in genetic perturbation experiments

GeneDisco ICLR-22 Challenge Starter Repository The starter repository for submissions to the GeneDisco challenge for optimized experimental design in

null 22 Dec 6, 2022
Django sample app with users including social auth via Django-AllAuth

demo-allauth-bootstrap Simple, out-of-the-box Django all-auth demo app A "brochure" or visitor (no login required) area A members-only (login required

Andrew E 215 Dec 20, 2022
Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.

Cookiecutter Django Powered by Cookiecutter, Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly. Documentati

Daniel Roy Greenfeld 10k Jan 1, 2023
Vue + Django with no compromises. Django Templates and Vue SFCs in harmony without sacrificing the full power of either.

Cookiecutter Vue Django Vue + Django with no compromise. Cookiecutter Vue Django is a framework for jumpstarting production-ready Django + Vue project

Mike Hoolehan 122 Dec 22, 2022
A Django project skeleton that is modern and cutting edge.

{% comment "This comment section will be deleted in the generated project" %} Edge A Fantastic Django project starter. Features Ready Bootstrap-themed

Arun Ravindran 827 Dec 15, 2022
Project template layout for Django 3.0+

Django 3.0+ project template This is a simple Django 3.0+ project template with my preferred setup. Most Django project templates make way too many as

Josรฉ Padilla 649 Dec 30, 2022
A project to get you started with Docker and Django.

Docker Django tl;dr $ git clone [email protected]:erroneousboat/docker-django.git $ docker-compose up Now you can access the application at https://local

JP Bruins Slot 176 Dec 29, 2022
A boilerplate Django project for quickly getting started.

The Definitive Django Learning Platform. Django Project Boilerplate This repository is a boilerplate Django project for quickly getting started. Getti

Le Huynh Long 1 Nov 1, 2021
A boilerplate for Django web applications

Django Hackathon Starter A boilerplate application for Django web applications. If you've attented hackathons, you already know how much time can be w

David Leonard 1.6k Dec 31, 2022
Bleeding edge django template focused on code quality and security.

wemake-django-template Bleeding edge django2.2 template focused on code quality and security. Purpose This project is used to scaffold a django projec

wemake.services 1.6k Jan 4, 2023
A framework for launching new Django Rest Framework projects quickly.

DRFx A framework for launching new Django Rest Framework projects quickly. Comes with a custom user model, login/logout/signup, social authentication

William Vincent 400 Dec 29, 2022