Skip to content

A web application for Discord Oauth2 with Django framework

License

Notifications You must be signed in to change notification settings

TShoKT/Django-DiscordOauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django-DiscordOauth2

Django Bootstrap jQuery

A web application for Discord Oauth2 with Django web framework

And Jquery, Bootstrap css and JavaScript framework 😐

About

This project was just to practice in the Django framework and challenge me in this framework.

allows you to see your profile and the servers you are in after your authentication in Discord, but according to Discord rules and the services it provides to us. So do not worry about stealing your identity and the servers you are on.

How to usage

  1. Clone this repo.

  2. Open command prompt inside the folder where you cloned repo and enter this command pip install -r requirements.txt.

  3. Create Discord account and login with the browser.

  4. Go to Discord Developer portal and create your own application, click OAuth2 and copy your client ID and client secret.

  5. Then paste them into the .env file.

    client_id = Your client id
    client_secret = Your client secret
    
  6. In the same section of Oauth2, click on Add redirect and enter this address for callback. http://127.0.0.1:8000/auth

    tip

    If you want to run this project on a server or host, put your domain instead of 127.0.0.1:8000 and go to the settings.py file in the DiscordOauth2 folder and set DEBUG to False and put your domain in the ALLOWED_HOSTS list, e.g => www.mydomain.com or mydomain.com, then change redirect_uri to http://yourdomain/auth And for static files, serving is the responsibility of the server or host(For more information).

  7. Then with the help of OAuth2 URL Generator In Oauth2, by selecting the url you added in Redirects in the SELECT REDIRECT URL section and checking identify and guilds, the url generator will give you a url, copy it and paste it in .env file

     auth_url_discord = The url you copied
    
  8. Enter this command on command prompt python manage.py runserver

  9. If you encounter an error during Authentication, raise it here.

    But some errors are related to the database, e.g => no such table django_section, so you can delete db.sqlite3 file and run this command on command prompt python manage.py migrate 😁