Skip to content

Commit 489e6fc

Browse files
fourth commit
1 parent 24953b1 commit 489e6fc

File tree

5 files changed

+119
-0
lines changed

5 files changed

+119
-0
lines changed

LICENSE.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2016 The Python Packaging Authority (PyPA)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7+
of the Software, and to permit persons to whom the Software is furnished to do
8+
so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

MAINFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include LICENSE.txt
2+
include README.rst
3+
recursive-include citylocations/static *
4+
recursive-include citylocations/templates *

README.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Django Packaging Exercise
2+
3+
Will be creating a package in order to install it into an existing Django project
4+
5+
STEPS
6+
1. Setup the project directory
7+
- python -m venv venv
8+
- . venv/Scripts/activate
9+
- pip install wheel setuptools twine
10+
- citylocations.zip
11+
12+
2. Create package configuration files
13+
- README.rst
14+
- setup.cfg
15+
- setup.py
16+
- MANIFEST.in
17+
- LICENSE.txt
18+
19+
3. Build package
20+
- (bash terminal) python setup.py sdist
21+
22+
4. Install packaged app (on week4 folder)
23+
- hello_django.zip
24+
- pip install -r requirements.txt
25+
- ls ../django_cityloc_pkg/dist
26+
- pip install ../django_cityloc_pkg/dist/django_cityloc_pkg-0.0.1.tar.gz
27+
- pip list (to double check pkg installed)
28+
29+
5. Connect new app to project
30+
- python manage.py runserver 8000
31+
- Open a browser, and type: http://127.0.0.1:8000 (should see "Hello World")
32+
- update message and restart app to see new message
33+
34+
35+
==============
36+
City Locations
37+
==============
38+
39+
City Locations is a Django app that can be installed in an existing Django project
40+
Documentation: https://toddpy-django-cityloc-pkg.readthedocs.io/en/latest/
41+
42+
Installation
43+
------------
44+
45+
1. Add "citylocations" to your INSTALLED_APPS setting in settings.py:
46+
47+
INSTALLED_APPS = [
48+
...
49+
'citylocations',
50+
]
51+
52+
2. Include the citylocations URLconf in your project urls.py like this::
53+
path('', include('citylocations.urls')),
54+
55+
3. Start the development server and visit http://127.0.0.1:8000/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Publish Python Package
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
deploy:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v2
11+
- name: Install dependencies
12+
run: |
13+
python -m pip install --upgrade pip
14+
pip install setuptools wheel twine
15+
- name: Build and publish
16+
env:
17+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
18+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
19+
run: |
20+
python setup.py sdist bdist_wheel
21+
twine upload --verbose --repository-url https://test.pypi.org/legacy/ -u ${{ secrets.TWINE_USERNAME }} -p ${{ secrets.TWINE_PASSWORD }} dist/*

setup.cfg

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[metadata]
2+
name = django_cityloc_pkg_fidencio-codes
3+
version = 0.0.1
4+
description = A Django app about city locations
5+
author = Author Name
6+
author_email = authoremail@example.com
7+
classifiers =
8+
Environment :: Web Environment
9+
Framework :: Django
10+
Framework :: Django :: 3.2
11+
License :: OSI Approved :: MIT License
12+
Operating System :: OS Independent
13+
Programming Language :: Python :: 3.9
14+
15+
[options]
16+
include_package_data = true
17+
packages = find:
18+
python_requires = >=3.8
19+
install_requires =
20+
Django >= 3.2

0 commit comments

Comments
 (0)