Skip to content

Commit

Permalink
Merge pull request #66 from auth0-samples/qs/upgrade-django
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Jun 23, 2023
2 parents 7d3d34d + 3d83664 commit c2381f7
Show file tree
Hide file tree
Showing 29 changed files with 414 additions and 356 deletions.
41 changes: 20 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@ jobs:
working_directory: ~/repo/01-Authorization
machine:
image: ubuntu-2004:202107-02

steps:
- checkout:
path: ~/repo
path: ~/repo

- run:
- run:
name: Set .env file
command: |
echo "AUTH0_DOMAIN=$auth0_domain" >> .env
echo "API_IDENTIFIER=$api_identifier" >> .env
- run:
name: background server
command: sh exec.sh
background: true

echo "AUTH0_DOMAIN=$auth0_domain" >> .env
echo "AUTH0_API_IDENTIFIER=$api_identifier" >> .env
- run:
name: Wait until server is online
command: |
until $(curl --output /dev/null --silent --fail http://localhost:3010/api/public); do
sleep 5
done
name: background server
command: sh exec.sh
background: true

- run:
name: Wait until server is online
command: |
until $(curl --output /dev/null --silent --fail http://localhost:8000/api/public); do
sleep 5
done
- run:
name: Clone script test
command: git clone -b v0.0.1 --depth 1 https://github.com/auth0-samples/api-quickstarts-tests test
- run:

- run:
name: Prepare environment variables for test
command: |
cd test
Expand All @@ -45,7 +45,7 @@ jobs:
echo "AUTH0_CLIENT_SECRET_3=$client_secret_scopes_write" >> .env
echo "AUTH0_CLIENT_ID_4=$client_id_scopes_readwrite" >> .env
echo "AUTH0_CLIENT_SECRET_4=$client_secret_scopes_readwrite" >> .env
echo "API_URL=http://localhost:3010" >> .env
echo "API_URL=http://localhost:8000" >> .env
- run:
name: Install test script dependency
Expand All @@ -60,4 +60,3 @@ workflows:
jobs:
- build:
context: Quickstart API Tests

2 changes: 1 addition & 1 deletion 01-Authorization/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
AUTH0_DOMAIN={DOMAIN}
API_IDENTIFIER={API_IDENTIFIER}
AUTH0_API_IDENTIFIER={API_IDENTIFIER}
4 changes: 3 additions & 1 deletion 01-Authorization/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.env
db.sqlite3
*.pyc
*.pyc
requirements.in
__pycache__
8 changes: 4 additions & 4 deletions 01-Authorization/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ WORKDIR /home/app

#If we add the requirements and install dependencies first, docker can use cache if requirements don't change
ADD requirements.txt /home/app
RUN pip install --no-cache-dir -r requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt

ADD . /home/app

# Migrate the database
RUN python manage.py migrate
RUN python3 manage.py migrate

CMD python manage.py runserver 0.0.0.0:3010
CMD python manage.py runserver 0.0.0.0:8000

EXPOSE 3010
EXPOSE 8000
169 changes: 0 additions & 169 deletions 01-Authorization/apiexample/settings.py

This file was deleted.

22 changes: 0 additions & 22 deletions 01-Authorization/apiexample/urls.py

This file was deleted.

File renamed without changes.
16 changes: 16 additions & 0 deletions 01-Authorization/app/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for example project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")

application = get_asgi_application()
Loading

0 comments on commit c2381f7

Please sign in to comment.