Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
404 Error on TextArea in Admin interface, Django Summernote
For texteditor i use Summernote Django, but i got error 404 on admin interface. summernote editor id doesn't find. that's urls.py urlpatterns = [ path('admin/', admin.site.urls), path('summernote/', include('django_summernote.urls')), ] -
How to get updated class variable value in Django
Hello~ I'm having trouble getting the updated value of the class variable. When ConnectTestAPI is called after "p_request" function executed, the class variables which are "result" and "orderNo" should updated in the "post" function. Then I want to receive the updated value of class variables by looping while statement in "p_request" function. However, despite setting the values of class variables with the post request, when the while statement is run, the corresponding values are still empty and 0 value respectively, so the while statement cannot be terminated and result in a time out error. Here is my source code. Thank you in advance!!!! class ConnectTestAPI(APIView): result="" orderNo=0 def post(self, request): data = request.data ConnectTestAPI.result = data['result'] ConnectTestAPI.orderNo = data['orderNo'] print(ConnectTestAPI.result) # I could successfully get data from POST request here! print(ConnectTestAPI.orderNo) # I could successfully get data from POST request here! return HttpResponse("ok") def p_request(): data = { "a" : 1234, "b" : 5678 } data = json.dumps(data,ensure_ascii=False).encode('utf-8') con = redis.StrictRedis(outside_server['ip'],outside_server['port']) con.set("data_dict", data) while True: if ConnectTestAPI.result != "" and ConnectTestAPI.orderNo != 0: break res_result = ConnectTestAPI.result res_orderNo = ConnectTestAPI.orderNo return res_result, res_orderNo -
Url pattern in django rest framework
I am trying to use modelviewset and for that I have to use router in urls file for routing. Everything seems to be working as expected but my urls are highlighted as if the code is just ignored in my pycharm. It is as follows: Here as we can see above, it is highlighted by pycharm as if the code doesnt have any part in the project or is being ignored. When I use apiview and do not use the routers, the urls are not highlighted and are shown normally. What is the issue?? -
How to turn on and off pagination in django rest?
I tried like this but it is returning paginated queryset even if I call api with my/api/?no-page I want to disable pagination and show all data if no-page in query params else paginate queryset as usual. class CustomPagination(PageNumberPagination): def paginate_queryset(self, queryset, request, view=None): if "no_page" in request.query_params: return None return super().paginate_queryset(queryset, request, view) -
How to update a nested object in Django?
I'm trying to update a nested object in Django but facing an error with sub-object id's already existing. I have these two Models: class Plan(models.Model): planId = models.CharField(primary_key=True, max_length=100, unique=True) name = models.CharField(max_length=200) class PlanEvent(models.Model): plan = models.ForeignKey(Plan, on_delete=models.CASCADE) id = models.CharField(primary_key=True, max_length=100, unique=True, blank=False, null=False) done = models.BooleanField() title = models.CharField(max_length=100, blank=True) I have an update method in my PlanSerializer and it works if I send a PUT request with an empty events-list, but if I include some events I want to update, I get an error: { "events": [ { "id": [ "plan event with this id already exists." ] } ] } This is my PlanSerializer update method: class PlanSerializer(serializers.ModelSerializer): events = PlanEventSerializer(many=True) class Meta: model = Plan fields = ('planId', 'name', 'events') def update(self, instance, validated_data): events_validated_data = validated_data.pop('events') events = (instance.events.all()) events = list(events) instance.name = validated_data.get('name', instance.name) instance.save() for event_data in events_validated_data: event = events.pop(0) event.done= event_data.get('done', event.done) event.title = event_data.get('title', event.title) event.save() return instance So I'm not getting to the update-method at all when I pass events to the PUT -payload, what I'm doing wrong? -
How to display Model Object Count In Django Admin Index
I am trying to display the count of objects of each model. For this i have edited env > lib > django > contrib > templates > admin > app_list.html, bellow is the code. I am having to doubts here. I know this is not optimal solution where editing directly in env django folder. So how i can edit the app_list.html so that i can display the count. I tried {{model}}, but was not able to display count, always come as blank as you can see in image. Possible out i tried in template html- {{model}} Object - {'name': 'Exam categorys', 'object_name': 'ExamCategory', 'perms': {'add': True, 'change': True, 'delete': True, 'view': True}, 'admin_url': '/admin/quiz/examcategory/', 'add_url': '/admin/quiz/examcategory/add/', 'view_only': False} {{model.count}} Object - {{model.all}} Object - {{model.objects.all}} Object - ---------------------------------------------------------------- env > lib > django > contrib > templates > admin > app_list.html ---------------------------------------------------------------- {% load i18n %} {% if app_list %} {% for app in app_list %} <div class="app-{{ app.app_label }} module{% if app.app_url in request.path %} current-app{% endif %}"> <table> <caption> <a href="{{ app.app_url }}" class="section" title="{% blocktranslate with name=app.name %}Models in the {{ name }} application{% endblocktranslate %}">{{ app.name }}</a> </caption> {% for model in app.models %} <tr class="model-{{ … -
mod_wsgi-express module-config command not working during django deployment on apache
During the deployment of my Django Project with Apache and mod_wsgi on Windows10. I have installed Apache24 in my C drive and its working fine. After that I have installed openpyxl and mod_wsgi with the commands "pip install openpyxl" and "pip install mod_wsgi" respectively. Both has been installed successfully. But when I try to run this command "mod_wsgi-express module-config" on the command prompt it shows me error "mod_wsgi-express : The term 'mod_wsgi-express' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again." error picture -
unable to predict in my web model after conversion of keras_savedmodel
After tensorflowjs conversion i got my model.json and weights.bin files like tutorials suggested i posted it in my github repository and used it to load my web app but the predictions are horrible and i dont know how to include labels to identify while predicting the models[ const video = document.getElementById('webcam'); const liveView = document.getElementById('liveView'); const demosSection = document.getElementById('demos'); const enableWebcamButton = document.getElementById('webcamButton'); const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0) const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) var vidWidth = 0; var vidHeight = 0; var xStart = 0; var yStart = 0; // Check if webcam access is supported. function getUserMediaSupported() { return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia); } // If webcam supported, add event listener to activation button: if (getUserMediaSupported()) { enableWebcamButton.addEventListener('click', enableCam); } else { console.warn('getUserMedia() is not supported by your browser'); } // Enable the live webcam view and start classification. function enableCam(event) { // Only continue if the model has finished loading. if (!model) { return; } // Hide the button once clicked. enableWebcamButton.classList.add('removed'); // getUsermedia parameters to force video but not audio. const constraints = { video: true }; // Stream video from browser(for safari also) navigator.mediaDevices.getUserMedia({ video: { facingMode: "environment" }, … -
psycopg2 undefined column on column value
psycopg2 is being a preteen child to me right now. cur = conn.cursor() url = "https://shofi-mod.s3.us-east-2.amazonaws.com/" + str(rawbucketkey) query = f"""UPDATE contentcreatorcontentfeedposts_contentfeedpost SET picturemediatype = TRUE, mediakey ={rawbucketkey}, mediaurl= "{url}", active = TRUE, postsubmit = FALSE WHERE contentcreator_id ={userid} AND id ={contentpostid}; COMMIT;""" cur.execute(query) cur.close() But I keep getting an error: [ERROR] UndefinedColumn: column "https://shofi-mod.s3.us-east-2.amazonaws.com/061909729140543151" does not exist LINE 3: mediaurl= "https://shofi-mod.s3.us-east-... ^ Traceback (most recent call last): File "/var/task/lambdarunner.py", line 163, in lambda_handler cur.execute(query) and my database does in fact have a media column class ContentFeedPost(models.Model): contentcreator = models.ForeignKey(ContentCreatorUsers, on_delete=models.CASCADE) creationtimestamp = models.DateTimeField(auto_now_add=True) likes = models.BigIntegerField(default= 0) favoritedtimes = models.BigIntegerField(default=0) tipcount = models.IntegerField(default=0) mediakey = models.CharField(max_length=200, null=True, blank=True) mediaurl = models.CharField(max_length=200, null=True, blank=True) audiomediatype = models.BooleanField(default=False) videomediatype = models.BooleanField(default=False) audiotitle = models.CharField(max_length=100, null=True, blank=True) videoplaceholderimage = models.CharField(max_length=200, blank=True, null=True) videoplaceholderimagekey = models.CharField(max_length=200, blank=True, null=True) audioplaceholderimage = models.CharField(max_length=200, blank=True, null=True) audioplaceholderimagekey = models.CharField(max_length=200, blank=True, null=True) picturemediatype = models.BooleanField(default=False) postsubmit = models.BooleanField(default=True) posttext = models.CharField(max_length=1000, blank=True, null=True) active = models.BooleanField(default=False) Above is a django ORM definition whats weird is that it looks like its complaining about the value im trying to set the column mediaurl to. This makes no sense. Is there something Im doing wrong that is obvious? -
Is there a requirement needed to enable Ubuntu to allow allowed_hosts in django
I hope all of you are fine I have one problem. I can only access localhost through my browser whenever I try to add anything else in the allowed_host. The browser cannot even detect it. I am new on Linux so I wanted to know where I was going wrong maybe I have to install a package or something? -
How to save a django model with multiple images?
I've been betting for an hour, but apparently I don't understand something. There is a task to write a scraper with the django admin panel and everything is fine and works here. Now i need to save all the data to the database and here is the problem, only one photo appears in the django admin panel, but everything is downloaded in the media folder. # models.py from django.db import models class Apartment(models.Model): rooms = models.CharField('кол-во комнат', max_length=64) price = models.CharField('цена', max_length=10) address = models.CharField('Адрес', max_length=256) desc = models.TextField('описание') floor = models.CharField('этаж', max_length=5) def __str__(self): return self.address class Meta: verbose_name = 'квартира' verbose_name_plural = 'квартиры' class Image(models.Model): apartment = models.ForeignKey(Apartment, on_delete=models.CASCADE) img = models.ImageField(upload_to='media/') class Meta: verbose_name = 'фото' verbose_name_plural = 'фото' class Url(models.Model): created = models.DateTimeField(auto_now_add=True) url = models.URLField('ссылка') def __str__(self): return self.url class Meta: verbose_name = 'ссылка' verbose_name_plural = 'ссылки' ordering = ['-created'] #save function def save_data(apartments_list): for ap in apartments_list: im = Image() try: apartment = Apartment.objects.create( rooms=ap['rooms'], price=ap['price'], address=ap['address'], desc=ap['desc'], floor=ap['floor'], ) for image in ap['photos']: pic = urllib.request.urlretrieve(image, image.split('/')[-1])[0] im.img = im.img.save(pic, File(open(pic, 'rb'))) im.apartment = apartment except Exception as e: print(e) break -
how i store user input data in a file that give from front side of the browser?
Actually i want to store data in file that give from front side of the browser. well we can use form or ModelForm or maybe we give input in json and that json data store in a file..anyone have an idea or any hint? -
How to make a query from a selected choice from the user from a drop-down list in Django
I am new here. In an internship context, I have to developp a website in which the user will have the opportunity to select a program, a localisation or a thematic he wants to visualise in a heatmap. To do so, I decided to use Django. I am encoutering 2 issues : First one : I have a mysql database constituted with 1 table with the location names (detailed in many columns) and the coordinates, and one table by program of the raw datas. I need to find a way to join the two tables but one localisation name can have different coordinates depending on the program. So i need to concatenate 2 columns by table (2 columns from the raw datas that I join to two columns from the table with the coordinates) For now I have thought about using new_var = table.objects.annotate but i cannot join the two newly variables ... Do you have any ideas ? Secondly : The user is supposed to choose a localisation from a drop-down list, that i can use to filter my database and display the map as he wishes. For now I have that : (views.py) ''' def map(request): m = … -
Postgres createdb and create database is not working in Ubuntu 18.04
I have a Django project I am trying to set up on Ubuntu and am creating a new database in PostgreSQL 14. The default root user is Postgres as usual. Then I tried creating a new user with my Linux username "abc" with all the privileges: "SUPERUSER", "CREATEDB", etc. Everything worked fine and a new user was created. And it was suggested that I create a database with the same name "abc". So, I did CREATE DATABASE abc; in the psql shell, it gives no error and results in nothing. I tried createdb abc or creatdb in the bash terminal but this also does nothing either. The solution from this SO answer link does not work for me at all. I also tried this which did not do anything. I ultimately just want to be able to create the database for my Django project, which I am not able to do, and I have now no clue what I am doing wrong. Here's the command I am using to set up the Django project db: # create new user who will be the db owner # on Ubuntu, root user is postgres createuser -P <new_user_name> -U <root_user> # if you're … -
how to invite people from social to your django app [closed]
I am creating an app where I want some buttons just like you see on most of the apps where people can invite other people on app. like facebook, twitter or any other social link. if you click on it you can share the link on whatsapp or all of these sites and when the person who I sent click on that link he should redirect to my site -
How to add paginator and filter in your website?
I'm doing a project in which I need to display cars and the user is allowed to filter their queries based on price, make, model etc. Earlier today the filter was not working but the Paginator was, but now, the filter is working and the paginator is not. I've been stuck on this the whole day and I don't know what else to do. This is my code: views.py def posts(request): cars = Userpost.objects.all() myFilter = UserpostFilter(request.GET, queryset=cars) cars = myFilter.qs p = Paginator(Userpost.objects.all(), 2) page = request.GET.get('page') cars_list = p.get_page(page) nums = "a" * cars_list.paginator.num_pages context = {'cars':cars, "myFilter":myFilter, 'cars_list':cars_list, "nums":nums} return render(request, 'store/userposts.html', context) userposts.html {% extends 'store/main.html' %} {% load static %} {% block content %} <div class = 'row'> <div class = 'col'> <div class = 'card card-body'> <form method="get"> {{myFilter.form}} <button class="btn btn-primary" type = "submit">Search</button> </form> </div> </div> </div> <div class="row"> {% for car in cars %} <div class="col-lg-4"> <img class="thumbnail" src="{{car.imageURL|default:'/images/transparentLogo.png'}}"> <div class="box-element product"> <h6><strong>{{car.Year}} {{car.Make}} {{car.Model}}</strong></h6> <hr> <a class="btn btn-outline-success" href="{% url 'post_detail' car.pk %}">View</a> <h4 style="display: inline-block; float: right"><strong>${{car.Price|floatformat:2}}</strong></h4> </div> </div> {% endfor %} </div> <nav aria-label="Page navigation"> <ul class="pagination"> {% if cars_list.has_previous %} <li class="page-item"> <a class="page-link" href="?page=1" aria-label="Previous"> <span … -
postgres setup error: "movie_dev" dosen't exist in TDD with Django, DRF and Docker
I tried "re-build image, run container and then apply migration" approach in the course (Test-Driven Development with Django, Django REST Framework, and Docker), but not work -
Django call save method passing related instance
Following on from this question, which I was unable to resolve, I've decided to try implementing a save method on the Asset class. After the Asset is created, the Trade instance needs to save the Asset that has just been created, and update additional fields from variables. I think that post_save will be the best method to use. In addition to this a related model on the Trade instance also needs to be updated. The instances are created using a Celery Task. How can the Trade instance be passed to the post_save method of the Asset class? Or is there a better way to implement the updating of related models? -
Celery unable to use redis
Trying to start Celery first time but issues error as below, i have installed redis and its starting fine , but still somehow django seems to have issues with it , File "<frozen importlib._bootstrap_external>", line 848, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/atif/Documents/celery_test/celery-env/lib/python3.8/site-packages/kombu/transport/redis.py", line 263, in <module> class PrefixedStrictRedis(GlobalKeyPrefixMixin, redis.Redis): AttributeError: 'NoneType' object has no attribute 'Redis' Celery.py from django.conf import settings os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'celery_test.settings') app = Celery('celery_test',) app.config_from_object('django.conf:settings') # Load task modules from all registered Django apps. app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) @app.task(bind=True) def debug_task(self): print(f'Request: {self.request!r}') Settings #celery stuff --------------- BROKER_URL = 'redis://localhost:6379' CELERY_RESULT_BACKEND = 'redis://localhost:6379' CELERY_ACCEPT_CONTENT = ['application/json'] CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json' CELERY_TIMEZONE = 'Asia/Kolkata' celery_module/tasks.py from celery import Celery app = Celery('tasks',) @app.task def add(x, y): return x + y -
Django - Set ManyToMany attribute with empty list and serialize
I have this code below that sets relations tagged_users and hash_tags in a Post. It takes in the Post body and parses it for hashtags (Any word starting with a #) or a tagged_user (Any word starting with an @). Sometimes the post will contain neither, which causes an error at this line request.data['tagged_users'] = tagged_users. How do I resolve this so that it can be okay that it gives an empty list? view.py def request_to_post_data(request): post_text = request.data['body'] hash_tags_list = extract_hashtags(post_text) hash_tags = [HashTag.objects.get_or_create( hash_tag=ht)[0].hash_tag for ht in hash_tags_list] request.data['hash_tags'] = hash_tags tagged_users_list = extract_usernames(post_text) tagged_users = list() for username in tagged_users_list: try: tagged_users.append(User.objects.get(username=username).uuid) except User.DoesNotExist: pass request.data['tagged_users'] = tagged_users serializer = PostSerializer(data=request.data) if serializer.is_valid(raise_exception=True): post_obj = serializer.save() create_image_models_with_post(request=request, post_obj=post_obj) create_video_models_with_post(request=request, post_obj=post_obj) return serializer serializer.py class PostSerializer(serializers.ModelSerializer): hash_tags = HashTagSerializer(many=True, read_only=True) class Meta: model = Post fields = ('creator', 'body', 'uuid', 'created', 'type', 'updated_at', 'hash_tags', 'tagged_users') models.py class Post(models.Model): # ulid does ordered uuid creation uuid = models.UUIDField(primary_key=True, default=generate_ulid_as_uuid, editable=False) created = models.DateTimeField('Created at', auto_now_add=True) updated_at = models.DateTimeField('Last updated at', auto_now=True, blank=True, null=True) creator = models.ForeignKey( User, on_delete=models.CASCADE, related_name="post_creator") body = models.CharField(max_length=POST_MAX_LEN, validators=[MinLengthValidator(POST_MIN_LEN)]) hash_tags = models.ManyToManyField(HashTag) tagged_users = models.ManyToManyField(User) -
Setting up and calling a group of celery tasks with individual countdown
Using: Django==2.2.24, Python=3.6, celery==4.3.0 This is what I am currently doing: from celery import group the_group_of_tasks = group( some_task.s(an_object.the_data_dict) for an_object in AnObject.objects.all() ) the_group_of_tasks.delay() What I want to do: The group documentation: celery docs link I would like to spread the the_group_of_tasks individual some_task calls over some time range. Best if I can use the countdown feature, and spread the tasks over a variable number of seconds (like an hour, 3600 seconds). The distribution will be done to a random seconds integer between zero and 3600, imagine it can easily be calculated once I have the range. I think that I can add the countdown arg, with a random number generator within my range such that it will be "packaged" and ready to be executed in the group with the individual task preparation? some_task.s(an_object.the_data_dict, countdown=some_generator_call) Would that work? In case it helps, I am adding the code snippets for delay(), apply_async(), and Task.s(). Thank you! class Task(object): def apply_async(self, args=None, kwargs=None, task_id=None, producer=None, link=None, link_error=None, shadow=None, **options): """ Apply tasks asynchronously by sending a message. Arguments: args (Tuple): The positional arguments to pass on to the task. kwargs (Dict): The keyword arguments to pass on to the task. countdown … -
Django - Can I safely put information about is_staff in user model required fields to fetch them easily?
The problem is that I've tried to fetch info about user in react and the only fields that get returned from backend are the fields that are put in the required fields: from django.db import models from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager class UserAccountManager(BaseUserManager): def create_user(self, email, name, password=None): if not email: raise ValueError('Provide an email!') email = self.normalize_email(email) user = self.model(email=email, name=name) user.set_password(password) user.save() return user class UserAccount(AbstractBaseUser, PermissionsMixin): email = models.EmailField(max_length=255, unique=True) name = models.CharField(max_length=255) is_active = models.BooleanField(default=True) is_staff = models.BooleanField(default=False) objects = UserAccountManager() USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['name', 'is_staff'] def get_full_name(self): return self.name def __str__(self): return self.email Is it safe to do it like this or do I have to create separate api endpoint to return this information (I hope it is not necessary)? -
fixture not found using Factoryboy SubFactory
I'm getting an error building factories with subfactories to test django models. With models: class Space(ExportModelOperationsMixin('space'), models.Model): name = models.CharField(max_length=128, default='Default') class ShoppingListEntry(models.Model): food = models.ForeignKey(Food) space = models.ForeignKey(Space) class Food(models.Model): name = models.CharField(max_length=128) description = models.TextField(default='', blank=True) space = models.ForeignKey(Space) and fixtures: class SpaceFactory(factory.django.DjangoModelFactory): name = factory.LazyAttribute(lambda x: faker.word()) class FoodFactory(factory.django.DjangoModelFactory): name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=3)) description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10)) space = factory.SubFactory(SpaceFactory) class ShoppingListEntryFactory(factory.django.DjangoModelFactory): food = factory.SubFactory(FoodFactory, space=factory.SelfAttribute('..space')) space = factory.SubFactory(SpaceFactory) and test def test_list_space(shopping_list_entry): assert 1 == 1 throws the following error Failed with Error: [undefined]failed on setup with def test_list_space(sle_1): file <string>, line 2: source code not available file <string>, line 2: source code not available E fixture 'food__name' not found I'm struggling to figure out how to troubleshoot this. -
Dash datatable wont render on page in django-plotly-dash
I am creating a web application using django_plotly_dash, a module combining Django, Plotly, and Dash into one package. I am having an issue where I can trying to load some dash datatables that are part of the dash app, but they never end up rendering on the page. The page is stuck on "Loading..." like so: As you can see, the middle of the page (starting from Home Page) is where the dash datatables are supposed to load, but the screen is stuck on "Loading..." from the log output after starting the app, it seems it has something to do with Django not locating the right static files. Here is the output below: Watching for file changes with StatReloader Performing system checks... C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py:127: UserWarning: The dash_core_components package is deprecated. Please replace `import dash_core_components as dcc` with `from dash import dcc` return _bootstrap._gcd_import(name[level:], package, level) C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py:127: UserWarning: The dash_html_components package is deprecated. Please replace `import dash_html_components as html` with `from dash import html` return _bootstrap._gcd_import(name[level:], package, level) C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2544.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py:127: UserWarning: The dash_table package is deprecated. Please replace `import dash_table` with `from dash import dash_table` Also, if you're using any of the table format helpers (e.g. Group), replace `from dash_table.Format … -
Error running WSGI application, ModuleNotFoundError: No module named 'decouple' -- but module is installed
I've error with is "Error running WSGI application, ModuleNotFoundError: No module named 'decouple'" but i do have installed module. On the local version everything works fine with no errors, but when i put everything into pythonanywhere this erros starts to occur. requirements.txt asgiref==3.4.1 certifi==2021.10.8 cffi==1.15.0 charset-normalizer==2.0.7 cryptography==35.0.0 defusedxml==0.7.1 Django==3.2.8 django-extensions==3.1.5 idna==3.3 oauthlib==3.1.1 Pillow==8.4.0 pycparser==2.21 PyJWT==2.3.0 pyOpenSSL==21.0.0 python-decouple==3.5 python3-openid==3.2.0 pytz==2021.3 requests==2.26.0 requests-oauthlib==1.3.0 six==1.16.0 social-auth-app-django==5.0.0 social-auth-core==4.1.0 sqlparse==0.4.2 urllib3==1.26.7 Werkzeug==2.0.2 manage.py #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bookmarks.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) from exc execute_from_command_line(sys.argv) if __name__ == '__main__': main() settings.py import os from decouple import config # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = config('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', cast=bool) ALLOWED_HOSTS = ['mysite.com']#, 'localhost', '127.0.0.1'] # Application definition INSTALLED_APPS = [ 'account.apps.AccountConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'social_django', 'django_extensions', ] MIDDLEWARE …