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.
🧰
Features
- 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
📽️
Demo
📜
How to Run
Clone the repository and follow the steps bellow:
.venv
for your project
1. Create a new virtual environment virtualenv .venv && source .venv/bin/activate
2. Install the requirements
python3 -m pip install -r requirements.txt
python3 manage.py tailwind install
./config/local_settings.py
and .env
files and write the following contents in them
3. Create both touch ./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>
4. Create an application
Create a new Django app in your project
python3 manage.py startapp myapp
Append your local application to
INSTALLED_APPS
insidesettings.py
Create your URL, Template and views
You can extend your templates from base/_base.html
🦋
5. Migrate You need to create migration files (if you have any changes in your models) and run migrate
command to apply them.
python3 manage.py makemigrations
python3 manage.py migrate
6. Run your local server
Start TailWindCSS by running the following command in your terminal:
python3 manage.py tailwind start
Then you simply need to run Django's local server:
python3 manage.py runserver
🚀
7. Start Exploring That's all you need to do for having a ready-to-develop Django project with some
❓
How to use Crispy Forms
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
FormHelper
to 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.
🌈
Next Steps
- Add gunicorn as the production web server.
- Update the EMAIL_BACKEND and connect with a mail provider.
- Make the admin more secure.
django-allauth
supports social authentication if you need that.
🎟️
Contributing
Contributions, issues and feature requests are welcome! See CONTRIBUTING.
🌟
Support
Give the repository a
🛡️
License
This project is being licensed under the MIT License.
📎
Links
- 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.