Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How can i Add captcha to my Html form using Django
I have already made a website with Django but unable to add captcha with Django and link it with html template -
After setup nginx assets folder not found (Django)
I was trying to set up Nginx + gunicorn + Django in a ubuntu private server by following this link Here is my /etc/nginx/sites-available file server { listen 80; server_name 192.168.0.157; location = /favicon.ico { access_log off; log_not_found off; } location /assets/ { root /home/isho/ishoErp/production; } location / { include proxy_params; proxy_pass http://unix:/run/gunicorn.sock; } } Here is my settings.py file STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'assets') ] I have a assets folder. everything works fine but assets file not found. what I'm doing wrong? -
How to set globally-accessible context variables in django template tags?
There is a template tag which returns a random element from the list. I also need to save all the elements that were in the list and the one that had been picked in context, and later depict that information in django-debug-toolbar panel. from django import template import random register = template.Library() @register.simple_tag(takes_context=True, name='pickrandomelementtag') def pickrandomelementtag(context, list_of_random_elements): context.dicts[0]["key18"] = "value19" return random.choice(list_of_random_elements) So I test setting the variables functionality with given line: context.dicts[0]["key18"] = "value19" I am able to access the {{key18}} within the template, but my aim is set this variable in a manner that it would be accessible later on (globally?) from django-debug-toolbar panel. That's where i'm stuck. Here is my django-debug-toolbar panels.py file: from debug_toolbar.panels import Panel from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from django.template.response import SimpleTemplateResponse class RandomPanel(Panel): name = "RandomPanel;" has_content = True template = 'panels/randompanel.html' def title(self): return _('Random Panel') def generate_stats(self, request, response): print('that is where I need to access key18') self.record_stats( { "request": request } ) How would I access context variable key18 in generate_stats method of RandomPanel class object? Or maybe context is a wrong place to set custom cariables within template tags and you'd advise other … -
How to set 'DJANGO_SETTINGS_MODULE' based on mysite.settings from a different directory
I have a Django project which works good. My manage.py and mysite folder (the one that includes the following: __init__.py settings.py urls.py views.py wsgi.py ) and a bunch of django app folders are located in the following directory E:\mydjangoproject In order to use the django setting of this project in a script, I used to use the following code at the beginning of that script: os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' which always works fine since the python script file which I was running was also located in the directory E:\mydjangoproject and it locates the mysite folder as a module and its settings perfectly. My question is what if I am trying to run that exact python script from another directory say E:\mydjangoproject\SubFolder 1\SubFolder 2\ and still want the os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' Off course when I try this I get the error ModuleNotFoundError: No module named 'mysite'. How can I pass the right path of the django settings to the script? -
Django rest hyperlinks for foreign key
Im trying to connect 2 objects using hyperlinks. I have a Company object and a 'Client' object, a company has multiple clients, so the models.py looks like this: models.py: class Company(models.Model): name = models.CharField(max_length=200) lookup_field = 'id' def __str__(self): return self.name def get_absolute_url(self): return reverse('common_app:company-detail', kwargs={'id': self.id}) class Meta: ordering = ['-id'] class Client(models.Model): image = models.ImageField() name = models.CharField(max_length=200) company = models.ForeignKey(Company, on_delete=models.SET_NULL, null=True, default=None) verified = models.BooleanField(default=False) def __str__(self): return self.name serializers: class CompanySerializer(serializers.HyperlinkedModelSerializer): url = serializers.HyperlinkedIdentityField(view_name="common_app:company-detail") read_only = ('id', ) class Meta: model = Company fields = '__all__' class ClientSerializer(serializers.HyperlinkedModelSerializer): company = serializers.HyperlinkedRelatedField(read_only=True, view_name='common_app:company-detail') read_only = ('id', ) lookup_field = 'id' class Meta: model = Client lookup_field = 'id' fields = ('url', 'name', 'company') views.py: class CompanyViewSet(BaseModelViewSet): serializer_class = CompanySerializer queryset = Company.objects.all() lookup_field = "id" class ClientViewSet(BaseModelViewSet): serializer_class = ClientSerializer queryset = Client.objects.all() lookup_field = "id" urls.py: app_name = 'common_app' router = DefaultRouter() router.register('client', ClientViewSet, basename='client') router.register('company', CompanyViewSet, basename='company') for url in router.urls: print(url.__dict__) urlpatterns = [ path('api/', include(router.urls)), ] I cant understand what is going wrong (i tried to put the lookup_field everywhere) but i get: E django.core.exceptions.ImproperlyConfigured: Could not resolve URL for hyperlinked relationship using view name "client-detail". You may have failed to include … -
Saving / accessing fields from Class methods (Django)
Appologies for the beginner question and/or stupidity - I'm learning as I go.... I'm trying to pass a user entered url of a PubMed article to access the metadata for that article. I'm using the following code, but I cannot access anything form the save method in he 'Entry' model. For example in my html form I can display {{entry.date_added }} in a form but not {{ entry.title}}. I suspect it's a simple answer but not obvious to me. Thanks for any help. models.py from django.db import models from django.contrib.auth.models import User import pubmed_lookup from django.utils.html import strip_tags class Topic(models.Model): """Broad topic to house articles""" text = models.CharField(max_length=200) date_added = models.DateTimeField(auto_now_add=True) owner = models.ForeignKey(User, on_delete=models.CASCADE) def __str__(self): """Return a string representation of the model""" return self.text class Entry(models.Model): """Enter and define article from topic""" topic = models.ForeignKey(Topic, on_delete=models.CASCADE) pub_med_url = models.URLField(unique=True) date_added = models.DateTimeField(auto_now_add=True) def save(self, *args, **kwargs): query = self.pub_med_url email = "david.hallsworth@hotmail.com" lookup = pubmed_lookup.PubMedLookup(query, email) publication = pubmed_lookup.Publication(lookup) self.title = strip_tags(publication.title) self.authors = publication.authors self.first_author = publication.first_author self.last_author = publication.last_author self.journal = publication.journal self.year = publication.year self.month = publication.month self.day = publication.day self.url = publication.url self.citation = publication.cite() self.mini_citation = publication.cite_mini() self.abstract = strip_tags(publication.abstract) super().save(*args, **kwargs) class … -
How to get thumbnail of mp4 when upload it with `django-storages`?
I work on local.py I can get instance.video.path and be able to get the thumbnail. Here are my function, testcase, and model utils.py def save_screen_shot(instance: Video) -> Video: try: filename = instance.video.path except ValueError as err: logger.info(f"The 'video' attribute has no file associated with it.") else: video_length = clean_duration(get_length(filename)) instance.video_length = video_length img_output_path = f"/tmp/{str(uuid.uuid4())}.jpg" subprocess.call(['ffmpeg', '-i', filename, '-ss', '00:00:00.000', '-vframes', '1', img_output_path]) # save screen_shot with open(img_output_path, 'rb') as ss_file: instance.screen_shot.save(str(uuid.uuid4()) + '.jpg', ss_file) instance.save() finally: instance.refresh_from_db() return instance tests.py def test_screen_shot(self): client = APIClient() client.force_authenticate(user=self.user_a) with open('media/SampleVideo_1280x720_1mb.mp4', 'rb') as mp4_file: data = { 'text': "Big Bug Bunny", 'multipart_tags': 'Tri Uncle featuring', 'video': mp4_file, } url = reverse('api:tweet-list') res = client.post(url, data=data, format='multipart') video = Video.objects.first() mp4_file.seek(0) # set head to first position before do an `assertion` assert status.HTTP_201_CREATED == res.status_code assert mp4_file.read() == video.video.read() assert video.screen_shot # Not None assert 1 == Video.objects.count() models.py class Video(models.Model): video = models.FileField(upload_to='./videos/', null=True, blank=True) I put debug and found that in my production INSTALLED_APPS has 'storages' in it. And it raise me the error ipdb> instance.video.path *** NotImplementedError: This backend doesn't support absolute paths. ipdb> dir(instance.video) ['DEFAULT_CHUNK_SIZE', '__bool__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__enter__', '__eq__', '__exit__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', … -
Internal Server Error when running Django with Scrapy
I am making a relatively simple django app where you can add articles to it. Besides adding the article manually i am attempting to make use of scrapy and after you have added the title of the article manually you would visit the page of the article from the front-end and by the push of a button it would crawl another website to find that article and copy specific links it would find. The problem is that i am facing several issues that results in Internal Server Error. The errors are ValueError: signal only works in main thread when I am not using the options --noreload --nothreading to run the django server. When running the server with the options mentioned just before, i get raise error.ReactorNotRestartable() twisted.internet.error.ReactorNotRestartable. I would not like to have to use the options --noreload --nothreading to run the django server in general as I read that it limits performance a lot. I made a seperate app in my django project to keep things clean. The views.py I am using is the following from django.shortcuts import render, get_object_or_404 from django.urls import reverse_lazy from templates import * from .models import * import scrapy from scrapy.crawler import CrawlerProcess def … -
How do I add one model objects to another model’s ModelForm template with many to one relationship in Django?
I am trying to create a Hospital Management System in which have Two ModelForms, one ModelForm creates Patient Object, And another form of model two is used to admit that Patient which means it uses Patient Objects in New Form Template with new fields and creates new ID Which have model one id(patient ID) and model two id(IPD ID )as well and model two is linked with model one with Patient Id,one patient can have multiple Ipd id -
How to implement a shared variable for the entire django project?
I am writing a django server for a card game. The game begins when 2 players press the play button. To do this, in views.py I have the variable "turn", in which the id of the player who wants to play is recorded. As soon as 2 players appear in the "turn", an instance of the class with the game is created for them and is written into the dictionary, for example: games_now = {"id1": , "id2": }. Thus, 2 players use one class and manipulate common variables in it. So far, I run django as "manage.py runserver 0.0.0.0:80" on the server 1 core and do not notice any problems. But in production I have to use apache or nginx. What happens if I run a django-project on nginx on a multi-core VPS? Will all players then have access to the "turn" and "games_now" variables? How can I implement the functionality of the game on a multi-core processor to avoid conflicts? The game is implemented in the bot on vk.com I receive requests from vk.com in the form {"from_id": from_id (int), "objects": {"message": message (text)}} and within 3 seconds I should return the answer 'ok' to the server. Therefore, everything … -
Django Models, on delete set pk
This is my models: class Customer(models.Model): nome = models.CharField(max_length=40) indirizzo = models.CharField(max_length=40) class Appo(models.Model): appo = models.CharField(max_length=40) customer = models.ForeignKey(Customer, on_delete=models.SET_NULL, null=True, blank=True, default=1,related_name='appocli') now, if I delete a Customer I need SQL set in Appo models a specific PK for customer Foreign Key. For example 1. Something like: on delete set 1 Please help -
I forget on which virtual environment i was working on?
I have several virtual environment in my computer and i have forget the name of the virtual environment i was working on and i don't know how can i know the name of the environment. Can someone help me please -
How to create a seperate table for the user when they registered on site
I have to create a site where every user store's there data and each user get the isolated storage for which i have to allot a particular table to each user, as the size of data stored by user is big enough too and I doesn't now how to do it in django. Please suggest me the same. -
How to upload a file from django view using filepath
I have to upload a file from django views using the file path from the local system. I'm using models.create method to save the filepath. But the image is not getting uploaded into the media directory. I have tried the Content and File from django core.utils but it deos not work def createevent(request): file_path = os.path.join(settings.FILES_DIR) # Getting the directory with files f = [] for (dirpath, dirnames, filenames) in walk(file_path): f.extend(filenames) break f.remove(".DS_Store") img = random.choice(f) # Select a random file pa = os.path.abspath(img) # absolute file path # pa = (img,File(pa)) response = File(pa) print(pa) loc = "School Ground" if request.method == 'POST': get_dateof = request.POST.get('dateof') get_nameof = request.POST.get('nameof') get_descof = request.POST.get('descof') new_report = Event.objects.create( name=get_nameof, description=get_descof, location=loc, timeoftheevent=get_dateof, user=request.user, image= pa ) #creating a db record return HttpResponse('') -
scope in django_channels searches for an argument on all pages from URLRouter
I need to support multiple-page socket connection, URLRouter is like this: URLRouter([ path('device/<device_name>',IndicatorConsumer), path('add',IndicatorConsumer), path('', IndicatorConsumer) ]) consumers.py is async def websocket_connect(self,event): print('connection succefull ', event) await self.send({ 'type': 'websocket.accept' }) self.device_id = self.get_device_id(self.scope['url_route']['kwargs']['device_name']) I need to get device_name via scope to send it to another function. But for some reason the scope searches for this on all the pages that are in the URLRouter, and so, for example, in the /add socket immediately closes because it can not find there device_name Everything works fine on the device pages, others get an error: Exception inside application: 'device_name' -
Insert multiple values with unique record in database in Django
I have a form in which user selects value from downtown and insert one value from text box. I have made a text-box such that user can enter multiple values by adding it. like in pic But when I submit form it saves only one record in database with value of last text box. Can anyone tell me how to save each value in database with unique record. my view:- class PerticularCreatView(LoginRequiredMixin,SuccessMessageMixin,CreateView): model=Perticular success_message = " Perticulars Added successfully!" reverse_lazy('add-perticular') template_name = 'add-perticular' form_class = PerticularCreateForm # fields =[] def get_context_data(self, **kwargs): kwargs['perticulars'] = Perticular.objects.filter(is_del=0).order_by('-perticular_crt_date') return super(PerticularCreatView, self).get_context_data(**kwargs) def form_valid(self,form): form.instance.perticular_crt_by = self.request.user return super(PerticularCreatView, self).form_valid(form) -
Django website deploying to heroku. Application error
I'm trying to deploy my django website to heroku but I get an Application Error shown on the webpage. Looking at my logs using heroku logs --tail (what it tells me to do on webpage), I recieve an error 2019-07-27T06:14:34.046386+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=prremia.herokuapp.com request_id=20cd473d-50c2-43b6-892e-ce8f8981229d fwd="49.36.8.33" dyno= connect= service= status=503 bytes= protocol=https 2019-07-27T06:14:34.878053+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=prremia.herokuapp.com request_id=53c5e449-ba17-4e93-86f9-7b70eeb7e074 fwd="49.36.8.33" dyno= connect= service= status=503 bytes= protocol=https I followed the instructions from Django's docs. Django 2.2.3 Python 3.7.3 Heroku-18 My webpage: -
Django safe and striptags don't work properly
if don't have seo description,post.conten|trunnchars:160 show it. However, i have uniode and charset problem Turkish characters like " ş Ş İ I ö Ö ü Ü ç Ç " doesn't work properly the result is for Ö= &#214; ı= &#305; i added <meta charset="utf-8"> {% block description %}{% if post.seo_description %}{{post.seo_description|truncchar:160}}{% else %}{{ post.content|truncatechars:160 |safe|striptags}}{% endif %}{% endblock %} -
MultiValueDictKeyError when upload an Image using Django Test
Hi I am trying to make a test case to test my upload image API. But I think I am not returning something when I pass the files for request.FILES #models.py class Image(models.Model): name = models.CharField(max_length=200) imagefile = models.ImageField( null=True, blank=True, max_length=500, upload_to='temp/images/') def __str__(self): return self.name #views.py class ImagesView(APIView): def post(self, request): print("DATA!!!", request.data) print("FILE!!!", request.FILES) params = Image( imagefile=request.FILES['image']) params.save() print(params) return Response({"status": "ok"}) #test.py class CanalImagesApiTests(TestCase): fixtures = [] def test_post_image(self): c = Client() response = c.post('/admin/login/', {'username': 'admin', 'password': 'passwrd'}) filename = 'data/sample_image.jpg' name = 'sample_image.jpg' data = {"data": "passthis"} print(to_upload) with open(filename, 'rb') as f: c.post('/images/', data=data, files={"name": name, "image": f}, format='multipart') response = c.get('/images/') results = response.json() My request.FILES is empty: <MultiValueDict: {}> and my test gets an error: django.utils.datastructures.MultiValueDictKeyError: 'image' -
Getting unreachable error when making migration in django
I have Django conde all is running fine.But when i run py manage.py it is raising erron which i am not understanding. Operations to perform: Apply all migrations: admin, api, auth, contenttypes, sessions, social_django Running migrations: Applying api.0004_auto_20190726_1113...Traceback (most recent call last): File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\utils.py", line 85, in _execute return self.cursor.execute(sql, params) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\sqlite3\base.py", line 298, in execute return Database.Cursor.execute(self, query, params) sqlite3.OperationalError: near ")": syntax error The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line utility.execute() File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\core\management\__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\core\management\base.py", line 316, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\core\management\base.py", line 353, in execute output = self.handle(*args, **options) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\core\management\base.py", line 83, in wrapped res = handle_func(*args, **kwargs) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\core\management\commands\migrate.py", line 203, in handle fake_initial=fake_initial, File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\migrations\executor.py", line 117, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\migrations\executor.py", line 147, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\migrations\executor.py", line 244, in apply_migration state = migration.apply(state, schema_editor) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\migrations\migration.py", line 124, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\migrations\operations\fields.py", line 150, in database_forwards schema_editor.remove_field(from_model, from_model._meta.get_field(self.name)) File "C:\Users\santhoshe.e\AppData\Local\Continuum\anaconda3\lib\site-packages\django\db\backends\sqlite3\schema.py", line 327, in remove_field self._remake_table(model, delete_field=field) File … -
User specific storage backends in Django
Use case: I want to develop a Django app that supports a collaborative workflow of multiple users. Users shall be invited to review files in an order defined by the uploading user. For this the file is uploaded to the app and users are invited. Multiple users belong to one organization. There are several organization. Files uploaded by an organization user to the app shall be stored in a space owned/controlled by the organization (“bring your own storage”), e.g an existing GoogleDrive or Dropbox. The storage target is configured by the first user of a new organization (target url, oauth token). Question: is it possible to switch the storage backend of Django based on information related to the user uploading a new file, e.g. the users organization? -
How to apply zoom effect on mouseover for all the images passed in a single Image tag using jquery?
I am trying to zoom images on mouseover but zoom is applied only on first image . I am using given code in my django templates to zoom images . {% for image in images_obj %} <img class="drift-demo-trigger" data-zoom="{% static '/images/catalog/products/thumbnail/' %}{{image}}" src="{% static '/images/catalog/products/thumbnail/' %}{{image}}" alt="IMG-PRODUCT" style="width:99%;border:1px solid #ccc;"> <div class="detail"> <section> </section> </div> {% endfor %} new Drift(document.querySelector('.drift-demo-trigger'), { paneContainer: document.querySelector('.detail'), inlinePane: 900, inlineOffsetY: -85, containInline: true, hoverBoundingBox: true }); All images which are coming in loop should be zoomed but currently only the first image is able to zoom . -
Django migrate --fake-initial reports relation already exist
I am trying to import an existing database into my Django project, so I run python manage.py migrate --fake-initial, but I get this error: operations to perform: Apply all migrations: ExcursionsManagerApp, GeneralApp, InvoicesManagerApp, OperationsManagerApp, PaymentsManagerApp, RatesMan agerApp, ReportsManagerApp, ReservationsManagerApp, UsersManagerApp, admin, auth, authtoken, contenttypes, sessions Running migrations: Applying contenttypes.0001_initial... FAKED Applying auth.0001_initial... FAKED Applying contenttypes.0002_remove_content_type_name... OK Applying GeneralApp.0001_initial...Traceback (most recent call last): File "/Users/hugovillalobos/Documents/Code/IntellibookWebProject/IntellibookWebVenv/lib/python3.6/site-packages/django/db/back ends/utils.py", line 83, in _execute return self.cursor.execute(sql) psycopg2.ProgrammingError: relation "GeneralApp_airport" already exists Of course all the tables already exist in the database, that is the reason why I use --fake-initial, that is supposed to fake the creation of database objects. Why is migrate attempting to create the table GeneralApp__airport instead of faking it? -
Unable to import module 'handler': No module named 'werkzeug'
I suddenly started getting this error on a Django + AWS lambda setup with zappa. I'm using ubuntu 18.04 image on bitbucket pipelines to trigger the deployment. Unable to import module 'handler': No module named 'werkzeug' It was working fine for python3.6 on zappa==0.42.2 until the last deployment in 25-July-2019. I thought it was due to some code changes on the app that's causing it (even though the code changes are not related to pip modules - just some updates on the application's codebase) but even reverting to previous deployments are throwing this error now. My zappa config has a slim_handler: true { "staging": { "project_name": "myapp", "slim_handler": true, "runtime": "python3.6", "log_level": "WARNING", "timeout_seconds": 300 } } I have tried some suggested solutions in Zappa's GitHub issues but without success. https://github.com/Miserlou/Zappa/issues/64 https://github.com/Miserlou/Zappa/issues/1549 I've also tried some SO solutions from questions related to import issues in zappa and haven't been successful. I would highly appreciate any pointers for debugging or workarounds for this zappa issue in AWS lambda with python3.6. -
Why Supervisor can cause mysql sock problem?
I'm deploying my Django project on Debian system ,when I want to use supervisor to manage processes , I met some strange problem. Django:2.1 Python:3.5 Supervisor:3.3.1 Error message: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) The history is: At first I ran the Django by Gunicorn alone, it works , I can visit my website from outside. Then I use apt-get install supervisor to install it in order to manage the processes. Configuration Please see bottom. What I've tried : 1:cancel the celery and redis program in supervisor configuration No use 2:cancel the redis program and keep Django and celery inside , then run redis manually No use 3:Only run Django under superviosr Ok Why I'm so confused is Why it can caused mysql sock problem....? I searched out google for 3 days already... PS: if this error occurred , I can't use mysql anymore , like mysql -u root -p [program:NBAsite] directory = /home/allen/NBAsite/NBAsite command = /home/allen/NBAsite/env/bin/gunicorn NBAsite.wsgi:application -b 0.0.0.0:8000 autostart = true startsecs = 5 autorestart = true startretries = 3 user = allen redirect_stderr = true stdout_logfile_maxbytes = 20MB stdout_logfile_backups = 20 stdout_logfile = /home/allen/NBAsite/supervisor_log/allenbigbear.log [program:celery] directory = /home/allen/NBAsite/NBAsite command = /home/allen/NBAsite/env/bin/celery -A NBAsite …