python-mentorship
python-mentorship copied to clipboard
Submissions for Assignment2
This assignment is based on DevHub. Please check repository before starting with this assignment.
As a task, you need to implement basic functionality for Django 2 project. Video describing all the details:
Shortly,
- you need to fork this repository
- then in
assignments/assignment2/solutionscreate a new folder associated with your username. Example:assignments/assignment2/solutions/kenanbek - as a base version copy
assignments/assignment2/devhub-0.1.0to this directory - start with the implementation of the following tasks
Tasks for Assignment2:
- Introduce Django backend and frontend (separate from React frontend)
- Introduce database model classes
- User register model (via Django frontend)
- User login model (via Django frontend)
- Setup Docker environment for Django project with Postgres database
In the example folder (assignments/assignment2/solutions/kenanbek) you can find a solution for the first task. Video explaining the solution:
Exact steps to start with the assignment:
cd assignments/assignment2
cp -R devhub-0.1.0 solutions/<YOUR-GITHUB-USERNAME>
cd solutions/<YOUR-GITHUB-USERNAME>
virtualenv venv -p python3
source ./venv/bin/activate
python src/manage.py makemigrations
python src/manage.py migrate
python src/manage.py runserver
These tutorials can be helpful:
Hi, am having the following error after cloning and running the DevHub app.
Unhandled exception in thread started by <function check_errors.
@Nkarnaud could you please provide the actions you take to run the app? Do you set src as source root?
Yes the src is my root directory and i run with this command python manage.py runserver
To solve the issue i have to clone the project from
**CoderVlogger/devhub**and copy it in my project on python mentorship
@Nkarnaud no, you can use the version which is in assignments/assignment2/devhub-0.1.0.
Steps to start with the assignment:
cd assignments/assignment2
cp -R devhub-0.1.0 solutions/<YOUR-GITHUB-USERNAME>
cd solutions/<YOUR-GITHUB-USERNAME>
virtualenv venv -p python3
source ./venv/bin/activate
python src/manage.py runserver
@KenanBek I use that but it is giving me the above error. i will check on that again
@Nkarnaud I found error. In src/devhub/settings change this account.app.AccountConfig to this account.apps.AccountConfig.
okay thanks for your feedback
@Nkarnaud and also in src/account/models.py change this REQUIRED_FIELDS = ['username', 'email'] to REQUIRED_FIELDS = ['email'].
i have already done that
@Nkarnaud and before runserver run:
python manage.py makemigrations
python manage.py migrate
Let me know if you can run app now.
the app is running now
I have updated the source code with the fixes in assignments/assignment2/devhub-0.1.0.
the app is running now