jazzband / django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.

Home Page:http://django-embed-video.rtfd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example Project not updated for new Django version

HarryBerry87 opened this issue · comments

Hello,

I am very new to Django and Python in general, and I am having an issue running the example_project provided in the repository. Looking through some of the more recent (last 6 months) issues, it seems Django 2.1 update is stopping me from creating a database .

I replaced on my machine the from django.core.urlresolver import reverse line in posts/models.py with from django.urls import reverse, but something involving the urls is stopping it. If someone smarter could recreate it they could probably explain the problem better. Thanks, cheers!

Here are the minimum changes needed to get the example project to work on Django 2.x:

  1. Change the reverse import as you mention in posts/models.py
  2. Change the admin.site.urls line in example_project/urls.py to read url(r'^admin/', admin.site.urls),
  3. Add the line app_name = "posts" to posts/urls.py on line 5
  4. After running migrate, you also need to run python manage.py loaddata initial_data to load the provided fixtures into the database

I may submit a pull request with these changes.

The docs should be updated for multiple other settings as well as they refer to old Django configuration flags and types.

  1. changed (example_project -> posts -> models.py) this from django.core.urlresolver import reverse to from django.urls import reverse
  2. changed (example_project -> urls.py)
    url(r'^admin/', include(admin.site.urls)), to url(r'^admin/', admin.site.urls),
    and
    url(r'^', include('posts.urls', namespace='posts')), to url(r'^', include('posts.urls'), name='posts'),

Then it works fine :)

@Nilansha would you like to make a PR so we can update the upstream code?

I don't have permission to make PR for you repo

@Nilansha permissions aren't the problem on GitHub. You can make a fork, which creates a repository under your account, and then make the changes. When you go to the repository on GitHub and go to pull requests view you can just open a PR and it will show here. We can then merge it with one click. I hope this helps!

Great. Thanks a lot for your guidance I am a newcomer to github, this is my first contribution and the PR. I made a pull request according to your instructions.

It's great to help people getting started! The changes look good in the fork you have made, but I can't see the PR under this repository yet. GitHub has a decent document describing PRs from forks.

Thanks. Done. It should ok this time.

PR merged. Thank you for the contribution @Nilansha!