Mirco
I have empty FileField in model and path to file. I get MyModel.instance and want write file on path in MyModal.instance.MyFileField
don't use "pseudo-code" examples, describe your use case it's easier to understand what you wanna do you wanna upload a file and show its name into a template ?
Alexander
something like that with open(path + "_sale.xlsx") as f: questionnaire_instance.form_file_path = f qform = QuestionnaireForm(request.POST, instance=questionnaire_instance) qform.save()
A
Does heroku free account option comes with SOC 2 and ISO 127001?
Manish
hey
Manish
why there is not feature of selecting images from server instead of uploading in django yet.
Manish
Anyone know how to get that feature. I am using drf with react.
Manish
select via ORM?
Mirco
i dont know
Select them by query with Django ORM
Manish
but i will get only those images which are associated with an instance of model.
Manish
if i haven't associated a image with any model then how can i get?
Mirco
Upload the image to a CDN a use that link
Manish
Upload the image to a CDN a use that link
well this is workaround. But yeah it will work thank you.
Manish
django should have feature for select images from server
Mirco
django should have feature for select images from server
But you can always make a get to the server where you have the images
Manish
i think i should protect /media directory with auth then serve to react. then i can select image name with directory to send to drf.
Manish
Is it will be good practice?
Anonymous
Please help, I need delete a user in the database, but that user has info in two tables, therefore, I need delete in both tables
Anonymous
How can I do that
Anonymous
In working with Django 1.1q
Anonymous
1.11*
Anonymous
How to create a chattin app using django ? Any one have code.
Guillermo
How to create a chattin app using django ? Any one have code.
Check the django channels documentation. The tutorial is exactly that
Anonymous
👍
Anonymous
Hello, who knows Apium?
Shubham
Hello I have created psql data base but still it giving following error
Shubham
conn = _connect(dsn, connection_factory=connection_factory, **kwasync) django.db.utils.OperationalError: FATAL: database "School" does not exist
Shubham
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'School', 'USER': 'shubham311507', 'PASSWORD': 'snj', 'HOST': 'localhost', 'PORT': '5433', } }
Shubham
this in settings.py
Shubham
snj=# man \du List of roles Role name | Attributes | Member of ---------------+------------------------------------------------------------+----------- eventUser | Superuser, Create role, Create DB | {} giguser | Superuser, Create role, Create DB | {} giguser2 | Superuser, Create role, Create DB | {} points | Superuser, Create role, Create DB | {} pointuser | Superuser, Create role, Create DB | {} postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} shubham | Superuser, Create role, Create DB | {} shubham1507 | | {} shubham311507 | | {} shubhamj | | {} snj | Superuser, Create role, Create DB | {} test | | {}
Shubham
PostgresSQL port should be 5432 by default and did you run migrations ?
on applying migration it gave this error but I got the solution changed 'NAME': 'School', to 'NAME': 'school', in settings.py DATABASES
Shubham
it worked too
Mirco
it worked too
👍🏻
Shubham
thanks @pyflare for your kind attention
Shubham
Do anyone want Django book by william vinscent?
Mirco
Do anyone want Django book by william vinscent?
Let them buy it, we don't support piracy here ( if you wanna give them the professional one )
Shubham
okay, actually I am not piratting but I got on fb_group so thought to give it way, anyway its cool! I will take care here onward
Shubham
o okay
Mirco
😄
Shubham
Hello
Shubham
whats wrong completely unaware
Code9
Please use dpaste.de, pastebin or github gist when sharing code and image sharing service to share images
Shubham
okay
Code9
have you completed makemigrations
Shubham
yes
Shubham
and redeleted pld and remigrated too
Shubham
*old
inchidi
and redeleted pld and remigrated too
what do you mean by redeleted old? did you mean you reset migration instead?
Shubham
I have deleted the migrations and remigrated
Shubham
I mean
Shubham
https://dpaste.de/Sxz5
inchidi
I have deleted the migrations and remigrated
if you delete your old migration files then you should delete your database and create new one also
Shubham
okayy
Shubham
let me do it
inchidi
let me do it
do this: delete your database, delete all migration files, create new database, makemigrations, migrate
Shubham
okay
Ganeshan
Guys can i get link for some small django projects for beginners ?
your contributions are welcome ===> https://github.com/GaneshanNT/Knowledge-Replica
sahil
Can I make two table in one model
inchidi
Can I make two table in one model
what you want to achieve?
sahil
what you want to achieve?
One table or database for login and one for product description
Shubham
Hello Guys I need some suggetion
Shubham
I am creating the login /registrtion functionality in DRF for admin,teacher and student, the teacher and student will fill the entire reg form including many fields and that form will be send to admin's emailId for verification , if its okay then student/teaher will able to sign in
Shubham
can I refer https://wsvincent.com/django-rest-framework-user-authentication-tutorial/ for the admin and onwards inherit this app for student and teacher app?
Shubham
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency adminapp.0001_initial on database 'default'
Shubham
can you tell what went wrong?
Artyom
Hi, guys! Who know answer on this question?
Artyom
https://stackoverflow.com/questions/55616356/typeerror-at-django-db-models-fields-related-foreignkey-is-not-json-serial