Repository: doccano/doccano

Issue:
New user signup page question
Hi i'm trying to understand the user structure. I see a few posts about only being able to assign users to specific projects through the django admin screen, but my question is about the 'sign up' page you get offered when you click login, is this totally non functional? That is, is the *only* way to make new users of any kind through the django admin page?

Thanks,
Z


Discussion:
I'd like to ask the same question
If you have a look at the `docker-compose.yml` file, you may have what you want: at line 15, change "False" to "True" and it should be ok

``` bash
version: "3"
services:

  django:
    image: python:3.6
    volumes:
      - .:/src
      - venv:/src/venv
    command: ["/src/tools/dev-django.sh", "0.0.0.0:8000"]
    environment:
      ADMIN_USERNAME: "admin"
      ADMIN_PASSWORD: "password"
      ADMIN_EMAIL: "admin@example.com"
      DATABASE_URL: "postgres://doccano:doccano@postgres:5432/doccano?sslmode=disable"
      ALLOW_SIGNUP: "False" 
    ports:
      - 8000:8000
```
@guillim Hello, I changed the fifteenth line of `docker-compose.yml` file to "true" and set up the mailbox at the bottom of `settings.py,` but when registering users, I still prompted, "The webmaster has not set up any emails yet, so we can't send any link confirmation. Contact the admin to learn more." What's the reason?


Does it work when you set up the mailing box as "localhost" by simply uncommenting
```EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'```
from this part of settings.py ?

```
## necessary for email verification setup
# EMAIL_USE_TLS = True
# EMAIL_HOST = 'smtp.gmail.com'
# EMAIL_HOST_USER = 'random@gmail.com'
# EMAIL_HOST_PASSWORD = 'gfds6jk#4ljIr%G8%'
# EMAIL_PORT = 587
#
## During development only
# EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
```
@guillim Hi,
I did that, but registration is still prompted
`The webmaster has not set up any emails yet, so 
we can't send you any link confirmation
Please contact the admin to learn more`
How do I configure files to use the user registration function?
You should see in your logs a message like this one:
```
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: Activate your account.
From: webmaster@localhost
To: user2@example.com
Date: Wed, 31 Jul 2019 08:58:26 -0000
Message-ID: <156456350669.28.14006987809080586397@6c92c4a3631f>
   
Hi user2,
Please click on the link to confirm your email,
http://localhost:8000/activate/NA/58h-5a294df47d15b63332b1
```

Simply follow the link to confirm your email and it should be good. Note that when this is done, you also need to add the user to the projects that you created as an admin (go to the [admin](http://localhost:8000/admin) page to do this)
@guillim 
Hi, thank you for your help. I want to know where the log is.
Depends if you use **docker**, **docker-compose** or if you launch it straight away. According to your earlier messages, I guess you use **docker-compose**. In that case, the log should be on the same terminal where you typed 
`docker-compose up`
@guillim The way I install it is`Option1: Pull the production Docker image`
you probably want to read things such as [docker logging](https://docs.docker.com/config/containers/logging/)

On my computer it would be something like that:
`docker logs doccano_test_django_1`

Resolving patch:
diff --git a/app/authentification/views.py b/app/authentification/views.py
--- a/app/authentification/views.py
+++ b/app/authentification/views.py
@@ -9,7 +9,7 @@
 from django.views.generic import TemplateView
 from django.shortcuts import redirect
 
-from app import settings
+from django.conf import settings
 
 
 class SignupView(TemplateView):


Test patch:
diff --git a/app/authentification/tests/test_template.py b/app/authentification/tests/test_template.py
--- a/app/authentification/tests/test_template.py
+++ b/app/authentification/tests/test_template.py
@@ -1,7 +1,7 @@
 from django.test import SimpleTestCase, TestCase, RequestFactory, override_settings
 from django.http import HttpRequest
 from ..views import SignupView
-from app import settings
+from django.conf import settings
 from api.tests.test_config import setenv
 
 @override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.storage.StaticFilesStorage')