This project is still in its early stages of development. Any contributions to the repo is very welcomed. 🤍
Django Starter Project, Including TailWindCSS and all other useful modules used in my projects.
- Django 4.0 & Python 3.10
- Styling with TailWindCSS
- Complete user authentication (Log-in/Log-out, ...) via Django Allauth
- Static file combine with Django Compressor
- Strict separation of settings from code by using Python Decouple
- TailWind-styled crispy forms via Django Crispy Forms
Clone the repository and follow the steps bellow:
virtualenv .venv && source .venv/bin/activatepython3 -m pip install -r requirements.txtpython3 manage.py tailwind installtouch ./config/local_settings.py && touch .env# local_settings.py
DEBUG = True
ALLOWED_HOSTS = []Generate a new Django SECRET_KEY using Djecrety and paste it in the .env file in the root path of the project as follows
SECRET_KEY=<COPIED SECRET_KEY HERE>Create a new Django app in your project
python3 manage.py startapp myappAppend your local application to
INSTALLED_APPSinsidesettings.py
You can extend your templates from base/_base.html
You need to create migration files (if you have any changes in your
models) and run migrate command to apply them.
python3 manage.py makemigrationspython3 manage.py migrateStart TailWindCSS by running the following command in your terminal:
python3 manage.py tailwind startThen you simply need to run Django's local server:
python3 manage.py runserverThat's all you need to do for having a ready-to-develop Django project with some 🔋 included.
Current version (crispy-tailwind/0.5) allows the |crispy filter to be used to style your
form. In your template:
- Load the filter:
{% load tailwind_filters %} - Apply the crispy filter:
{{ form|crispy }}
You can also use the {% crispy %} tag to allow usage of crispy-forms'
FormHelper and Layout. In your template:
- Load the crispy tag:
{% load crispy_forms_tags %} - Add
FormHelperto your form and use crispy-forms to set-up your form - Use the crispy tag
{% crispy form %}in your template
Visit Crispy Forms Documentation and crispy-tailwind repository for more information.
- Add gunicorn as the production web server.
- Update the EMAIL_BACKEND and connect with a mail provider.
- Make the admin more secure.
django-allauthsupports social authentication if you need that.
Contributions, issues and feature requests are welcome! See CONTRIBUTING.
Give the repository a ⭐ if you found it helpful please.
This project is being licensed under the MIT License.
- I recommend you to have a 👀 at DjangoX, one of the best starter project repos for Django. This repository uses Bootstrap and inspired me to create what you are looking at now.
