Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
718d9f6c
Commit
718d9f6c
authored
Apr 23, 2018
by
Florent Chehab
Browse files
bug corrected in user creation
parent
047ae66b
Pipeline
#21972
passed with stages
in 3 minutes and 7 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
718d9f6c
...
...
@@ -28,4 +28,9 @@ To populate universities, also run in `./manage.py shell`:
%run ./rex/utils/insert_universities.py
```
Follow this tutorial : https://devcenter.heroku.com/articles/heroku-postgresql#local-setup
\ No newline at end of file
Follow this tutorial : https://devcenter.heroku.com/articles/heroku-postgresql#local-setup
in postgre
ALTER USER username CREATEDB;
GREATE DATABASE florent;
GRANT ALL on DATABASE florent to florent;
general/settings.py
View file @
718d9f6c
...
...
@@ -97,20 +97,20 @@ DATABASES = {
AUTH_PASSWORD_VALIDATORS
=
[
{
'NAME'
:
'django.contrib.auth.password_validation.
\
UserAttributeSimilarityValidator'
,
'NAME'
:
'django.contrib.auth.password_validation.
'
'
UserAttributeSimilarityValidator'
,
},
{
'NAME'
:
'django.contrib.auth.password_validation.
\
MinimumLengthValidator'
,
'NAME'
:
'django.contrib.auth.password_validation.
'
'
MinimumLengthValidator'
,
},
{
'NAME'
:
'django.contrib.auth.password_validation.
\
CommonPasswordValidator'
,
'NAME'
:
'django.contrib.auth.password_validation.
'
'
CommonPasswordValidator'
,
},
{
'NAME'
:
'django.contrib.auth.password_validation.
\
NumericPasswordValidator'
,
'NAME'
:
'django.contrib.auth.password_validation.
'
'
NumericPasswordValidator'
,
},
]
...
...
@@ -136,6 +136,7 @@ except KeyError:
dev_env
=
False
if
dev_env
:
print
(
"You are running in development mode"
)
DEBUG
=
True
ALLOWED_HOSTS
=
[]
SECRET_KEY
=
'0a1kbtt%as4624u*9+r+c%j1tlq&dc08==c3w604(4igc+t6tw'
...
...
general/tests.py
0 → 100644
View file @
718d9f6c
from
django.test
import
TestCase
from
django.contrib.auth.models
import
User
from
django.test.client
import
Client
class
SuperUserTest
(
TestCase
):
def
setUp
(
self
):
password
=
'root'
self
.
my_admin
=
User
.
objects
.
create_superuser
(
'myuser'
,
'myemail@test.com'
,
password
)
self
.
c
=
Client
()
self
.
c
.
login
(
username
=
self
.
my_admin
.
username
,
password
=
password
)
def
test_created
(
self
):
"""
Simple test to check if we can create a superuser. We had issues in the past.
"""
self
.
assertTrue
(
self
.
my_admin
.
is_superuser
)
rex/migrations/0001_initial.py
View file @
718d9f6c
# Generated by Django 2.0.3 on 2018-04-23
09:44
# Generated by Django 2.0.3 on 2018-04-23
15:30
import
django.core.validators
from
django.db
import
migrations
,
models
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment