Django application template repository.
Project description
!!! Remove this section !!!
- Create empty Git repository with your preferred name: example
django-my-new-pkg-name
- Checkout local copy of this new empty repository
- Copy all the contents of this repository inside the new cloned empty repository
- Delete the directory src\django_pkg.egg-info
- Rename the directory inside src from
PACKAGE_NAME
tomy_new_pkg_src_location
- Massive replace with match case the string
model_mixin
with your src locationmy_new_pkg_src_location
- Massive replace the string
django-pkg
with your new package's namedjango-my-new-pkg-name
- Edit the
tests/settings.py
file for the needed configuration to test your app - Rename and edit the
tests/test_fake.py
file for the needed application's tests - Copy or create all source's files of the app inside the src/my_new_pkg_src_location
- Install python's requirements
pip install -r requirements/dev.in
- Install python's requirements
pip install -r requirements/requirements.in
- Install python's package
pip install .
to test the package's local version - Execute
python runtests.py
and validate all tests are passed (if any error is present, the automatic workflow on tag will fail) - Edit docs ...
- Install python requirements
pip install -r requirements/docs.in
- Execute
python setup.py sdist bdist_wheel
to build the project - Execute
twine upload dist/*
to upload the built files - Inside PyPi repository, generate new API key with the only scope of project
- Inside Git repository's settings, section General, enable the
Allow auto-merge
andAutomatically delete head branches
- Inside Git repository's settings, section Access, add access to be able to execute workflows (as team member's or bot-user collaborator)
- Inside Git repository's settings, section Security, add security repository secret named
PYPI_API_TOKEN
to be able to upload packages inside PyPi's repository - Add git files as first commit
git add .github .gitattributes .gitignore
django-model-mixin
GitHub
Test
Check Demo Project
- Check the demo repo on GitHub
Requirements
- Python 3.8+ supported.
- Django 3.2+ supported.
Setup
- Install from pip:
pip install django-model-mixin
- Modify
settings.py
by adding the app toINSTALLED_APPS
:
INSTALLED_APPS = [
# ...
"model_mixin",
# ...
]
- Finally, modify your project
urls.py
with handlers for all errors:
# ...other imports...
urlpatterns = [
# ...other urls...
]
- Execute Django's command
migrate
inside your project's root:
python manage.py migrate
Running migrations:
Applying model_mixin.0001_initial... OK
Run Example Project
git clone --depth=50 --branch=django-model-mixin https://github.com/DLRSP/example.git DLRSP/example
cd DLRSP/example
python manage.py runserver
Now browser the app @ http://127.0.0.1:8000
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-model-mixin-0.2.0.tar.gz
(16.4 kB
view hashes)
Built Distribution
Close
Hashes for django_model_mixin-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 505d84f6b6c46763ee754edad5401858eb42848476fd3ef01dc2dfe93596da11 |
|
MD5 | afd31d414c03581f6a7b4f823b787c02 |
|
BLAKE2b-256 | 0d441fa0f9acbfc968f4e8c9af8dbcb303a546690bb69b1f5d41c81bf8dd35ed |