Adds a generic contact app for use with Giant projects
Project description
Giant Contact
A re-usable package which can be used in any project that requires a generic Contact app.
This will include the basic formatting and functionality such as model creation via the admin and email sending.
Installation
To install with the package manager, run:
$ poetry add giant-contact
You should then add "contact" to the INSTALLED_APPS in base.py and to the Makefile.
In base.py there should also be a DEFAULT_FROM_EMAIL and a DEFAULT_TO_EMAIL. This is used by the email sending method.
Configuration
This application exposes the following settings:
-
DEFAULT_FROM_EMAILis theFromaddress in the email. -
DEFAULT_TO_EMAILis the default recipient. This is usually the client's address. -
CONTACT_EMAIL_TEMPLATE_HTMLis the path to the email's HTML representation. -
CONTACT_EMAIL_TEMPLATE_TXTis the path to the email's text representation. -
CONTACT_ADMIN_LIST_DISPLAYis the field list for the admin index. -
CONTACT_ADMIN_FIELDSETSallows the user to define the admin fieldset. -
CONTACT_ADMIN_READONLY_FIELDSallows the user to configure readonly fields in the admin.
URLs
Add the following to core.urls for general functionality:
path("contact/", include("contact.urls"), name="contact"),
If you want to customize the urls to include a different path and/or templates, first you must import contact.views in core.urls and then you could do add the following:
path("contact-us/", contact.views.EnquiryFormView.as_view({"template_name": "custom_template_name.html}), name=contact-us)
path("contact-us/success/", contact.views..SuccessView.as_view(), name=contact-success)
Preparing for release
In order to prep the package for a new release on TestPyPi and PyPi there is one key thing that you need to do. You need to update the version number in the pyproject.toml.
This is so that the package can be published without running into version number conflicts. The version numbering must also follow the Semantic Version rules which can be found here https://semver.org/.
Publishing
Publishing a package with poetry is incredibly easy. Once you have checked that the version number has been updated (not the same as a previous version) then you only need to run two commands.
$ `poetry build`
will package the project up for you into a way that can be published.
$ `poetry publish`
will publish the package to PyPi. You will need to enter the username and password for the account which can be found in the company password manager
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file giant-contact-0.3.1.tar.gz.
File metadata
- Download URL: giant-contact-0.3.1.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.3.0-53-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78204ba3472c6b6de4b478e0a2fd6d22593066fd836a0fee72fd10fdcea34c6e
|
|
| MD5 |
440739b7209cb4aa319ad437b1abb612
|
|
| BLAKE2b-256 |
c6f352b4eb37a1ee33522fbf2929acedc4d760b46ea5acb027f267e1bf3e2bc0
|
File details
Details for the file giant_contact-0.3.1-py3-none-any.whl.
File metadata
- Download URL: giant_contact-0.3.1-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.3.0-53-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09c64170435c36163cb1edcbc2237017719caf4dafa9afc37df0fb0ddf807be6
|
|
| MD5 |
727f6f3ed04ec412ce08ca9fe59074b7
|
|
| BLAKE2b-256 |
08bbd8aaeec929255668df5fd8595f74c94580e344fa9f7e7acc1270dc87b0ed
|