diff --git a/environ.env b/environ.env new file mode 100644 index 0000000..223f969 --- /dev/null +++ b/environ.env @@ -0,0 +1,10 @@ +CONTAINERS_NAME=rsrv +# The name of the image to use for the containers +DJANGO_PORT=8000 +# The django container settings and enviroment +POSTGRES_DB=rsrv_db +POSTGRES_HOST=localhost +POSTGRES_PORT=5435 +POSTGRES_USER=rsrv_user +POSTGRES_PASSWORD=rsrv_pass +DEBUG=True \ No newline at end of file diff --git a/postamates/settings.py b/postamates/settings.py index cfce8ea..83a3fe4 100644 --- a/postamates/settings.py +++ b/postamates/settings.py @@ -44,6 +44,7 @@ INSTALLED_APPS = [ 'rest_framework', 'django_json_widget', 'django.contrib.gis', + 'rest_registration', ] MIDDLEWARE = [ @@ -147,4 +148,22 @@ CORS_ORIGIN_ALLOW = True DB_URL = f"postgresql://{os.getenv('POSTGRES_USER', 'postgres')}:{os.getenv('POSTGRES_PASSWORD', 'postgres')}@{os.getenv('POSTGRES_HOST', 'postgres')}:{os.getenv('POSTGRES_PORT', 'postgres')}/{os.getenv('POSTGRES_DB', 'postgres')}" if os.getenv('local') is not None: GDAL_LIBRARY_PATH = '/opt/homebrew/opt/gdal/lib/libgdal.dylib' - GEOS_LIBRARY_PATH = '/opt/homebrew/opt/geos/lib/libgeos_c.dylib' \ No newline at end of file + GEOS_LIBRARY_PATH = '/opt/homebrew/opt/geos/lib/libgeos_c.dylib' + +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' #new +EMAIL_HOST = 'smtp.yandex.ru' #new +EMAIL_PORT = 587 #new +EMAIL_HOST_USER = 'noreply@spatiality.website' #new +EMAIL_HOST_PASSWORD = "spatialitypass321" #new +EMAIL_USE_TLS = True #new +FRONTEND_URL = 'https://app.property.spatiality.website/' +REST_REGISTRATION = { + 'REGISTER_VERIFICATION_ENABLED': True, + 'RESET_PASSWORD_VERIFICATION_ENABLED': False, + 'REGISTER_EMAIL_VERIFICATION_ENABLED': True, + 'REGISTER_VERIFICATION_URL': f'{FRONTEND_URL}verify-user/', + 'RESET_PASSWORD_VERIFICATION_URL': f'{FRONTEND_URL}reset-password/', + 'REGISTER_EMAIL_VERIFICATION_URL': f'{FRONTEND_URL}verify-email/', + + 'VERIFICATION_FROM_EMAIL': 'noreply@spatiality.website', +} \ No newline at end of file diff --git a/postamates/urls.py b/postamates/urls.py index bb122ae..7904df3 100644 --- a/postamates/urls.py +++ b/postamates/urls.py @@ -7,5 +7,6 @@ from django.conf import settings urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('service.urls')), + path('accounts/', include('rest_registration.api.urls')), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file