Commit d13d3f53 authored by Aatish Neupane's avatar Aatish Neupane

create management command to create test users, use it in Docker

parent d3ade15c
......@@ -13,4 +13,4 @@ ADD requirements.txt /site/
RUN pip install -U -r /site/requirements.txt
COPY ./ /site
CMD bash -c 'python3 migrate --noinput && python3 collectstatic --noinput && uwsgi --ini=/site/uwsgi.ini'
\ No newline at end of file
CMD bash -c 'python3 migrate --noinput && python3 collectstatic --noinput && python3 create_test_users && uwsgi --ini=/site/uwsgi.ini'
docker build -t ipv6dotwork .
docker run -d -p --name ipv6dotwork ipv6dotwork
sudo docker rm -f ipv6dotwork
sudo docker run -d -p --env-file .env --name ipv6dotwork ipv6dotwork
\ No newline at end of file
from import BaseCommand
from django.contrib.auth import get_user_model
User = get_user_model()
class Command(BaseCommand):
help = "Create test accounts. Don't use this in production!"
def handle(self, *args, **options):
user_fixture = [
'username': 'user1',
'email': '',
'password': 'user1'
'username': 'user2',
'email': '',
'password': 'user2'
for user_data in user_fixture:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment