Skip to content

Instantly share code, notes, and snippets.

@rudensm
Last active March 4, 2018 12:25
Show Gist options
  • Save rudensm/f433f5ccb44f9eeb54b7277dc02d0107 to your computer and use it in GitHub Desktop.
Save rudensm/f433f5ccb44f9eeb54b7277dc02d0107 to your computer and use it in GitHub Desktop.
Basic Django Skills Test

TASK

  • make new virutalenv with python3
  • install django and create sample project (with name "sample")
    • create git repo inside project's root folder
    • pull this repo to github.com
  • to configure django project use https://github.com/jazzband/django-configurations/
  • create abstract super class "CoreModel" for models with fields:
    • enabled: bool
    • created: datetime: "auto now" when create
    • updated: datetime: "auto now" when update
  • create model classes which implements "CoreModel":
    • Visit
      • query: string
    • Feedback
      • subject: string
      • body: text
      • email: email
      • ip_address: string
  • create custom middleware and store data in the "Visit" model
  • install and integrate django-rest-framework: http://django-rest-framework.org
    • make serializer and viewset (use viewsets.ReadOnlyModelViewSet) class for each of 2 model classes
    • implement those endpoints under http://localhost:8000/api/
  • create admin class for each of 2 model classes and implement there:
    • list_display (pk, ...)
    • list_filter (created, updated, enabled)
    • search
  • implement form for Feedback model in homepage (http://localhost:8000)
    • use forms.ModelForm
    • implement some kind of "success" message when form is submitted successfully
    • all fields (subject, body, email) are required
    • also store user's ip_address value
  • install Telegram client (if you aren't already) and create Telegram bot:
  • install and setup python lib to work with Telegram
  • install and setup Celery, create "shared_task":
    • send Telegram message to yourself each time the model "Feedback" is created
    • message body should contain "subject", "body", "email" and "ip_address"
  • store pip installed packages in {PROJECT_DIR}/requirements.txt
  • pull changes to github.com and send me a link to your repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment